@airtop/sdk 0.1.42-beta0 → 0.1.43
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 +10 -9
- package/api/resources/automations/client/Client.js +4 -4
- package/api/resources/files/client/Client.js +5 -5
- package/api/resources/profiles/client/Client.js +1 -1
- package/api/resources/requests/client/Client.js +1 -1
- package/api/resources/sessions/client/Client.js +6 -6
- package/api/resources/sessions/types/SessionsEventsResponse.d.ts +7 -7
- package/api/resources/sessions/types/index.d.ts +2 -2
- package/api/resources/sessions/types/index.js +2 -2
- package/api/resources/windows/client/Client.d.ts +0 -224
- package/api/resources/windows/client/Client.js +220 -1175
- package/api/resources/windows/client/requests/index.d.ts +0 -17
- package/api/resources/windows/types/index.d.ts +0 -1
- package/api/resources/windows/types/index.js +0 -1
- package/api/types/index.d.ts +0 -1
- package/api/types/index.js +0 -1
- package/dist/api/resources/automations/client/Client.js +4 -4
- package/dist/api/resources/files/client/Client.js +5 -5
- package/dist/api/resources/profiles/client/Client.js +1 -1
- package/dist/api/resources/requests/client/Client.js +1 -1
- package/dist/api/resources/sessions/client/Client.js +6 -6
- package/dist/api/resources/sessions/types/SessionsEventsResponse.d.ts +7 -7
- package/dist/api/resources/sessions/types/index.d.ts +2 -2
- package/dist/api/resources/sessions/types/index.js +2 -2
- package/dist/api/resources/windows/client/Client.d.ts +0 -224
- package/dist/api/resources/windows/client/Client.js +220 -1175
- package/dist/api/resources/windows/client/requests/index.d.ts +0 -17
- package/dist/api/resources/windows/types/index.d.ts +0 -1
- package/dist/api/resources/windows/types/index.js +0 -1
- package/dist/api/types/index.d.ts +0 -1
- package/dist/api/types/index.js +0 -1
- package/dist/serialization/resources/sessions/types/SessionsEventsResponse.d.ts +9 -9
- package/dist/serialization/resources/sessions/types/SessionsEventsResponse.js +4 -4
- package/dist/serialization/resources/sessions/types/index.d.ts +2 -2
- package/dist/serialization/resources/sessions/types/index.js +2 -2
- package/dist/serialization/resources/windows/client/requests/index.d.ts +0 -17
- package/dist/serialization/resources/windows/client/requests/index.js +1 -35
- package/dist/serialization/resources/windows/types/index.d.ts +0 -1
- package/dist/serialization/resources/windows/types/index.js +0 -1
- package/dist/serialization/types/index.d.ts +0 -1
- package/dist/serialization/types/index.js +0 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/reference.md +140 -1449
- package/serialization/resources/sessions/types/SessionsEventsResponse.d.ts +9 -9
- package/serialization/resources/sessions/types/SessionsEventsResponse.js +4 -4
- package/serialization/resources/sessions/types/index.d.ts +2 -2
- package/serialization/resources/sessions/types/index.js +2 -2
- package/serialization/resources/windows/client/requests/index.d.ts +0 -17
- package/serialization/resources/windows/client/requests/index.js +1 -35
- package/serialization/resources/windows/types/index.d.ts +0 -1
- package/serialization/resources/windows/types/index.js +0 -1
- package/serialization/types/index.d.ts +0 -1
- package/serialization/types/index.js +0 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/api/resources/windows/client/requests/ActRequest.d.ts +0 -30
- package/api/resources/windows/client/requests/ActRequest.js +0 -5
- package/api/resources/windows/client/requests/AsyncClickRequest.d.ts +0 -29
- package/api/resources/windows/client/requests/AsyncClickRequest.js +0 -5
- package/api/resources/windows/client/requests/AsyncFileInputRequest.d.ts +0 -33
- package/api/resources/windows/client/requests/AsyncFileInputRequest.js +0 -5
- package/api/resources/windows/client/requests/AsyncHoverRequest.d.ts +0 -27
- package/api/resources/windows/client/requests/AsyncHoverRequest.js +0 -5
- package/api/resources/windows/client/requests/AsyncMonitorRequest.d.ts +0 -27
- package/api/resources/windows/client/requests/AsyncMonitorRequest.js +0 -5
- package/api/resources/windows/client/requests/AsyncPageQueryRequest.d.ts +0 -29
- package/api/resources/windows/client/requests/AsyncPageQueryRequest.js +0 -5
- package/api/resources/windows/client/requests/AsyncPaginatedExtractionRequest.d.ts +0 -27
- package/api/resources/windows/client/requests/AsyncPaginatedExtractionRequest.js +0 -5
- package/api/resources/windows/client/requests/AsyncPromptContentRequest.d.ts +0 -29
- package/api/resources/windows/client/requests/AsyncPromptContentRequest.js +0 -5
- package/api/resources/windows/client/requests/AsyncScreenshotRequest.d.ts +0 -23
- package/api/resources/windows/client/requests/AsyncScreenshotRequest.js +0 -5
- package/api/resources/windows/client/requests/AsyncSummarizeContentRequest.d.ts +0 -25
- package/api/resources/windows/client/requests/AsyncSummarizeContentRequest.js +0 -5
- package/api/resources/windows/client/requests/AsyncTypeRequest.d.ts +0 -37
- package/api/resources/windows/client/requests/AsyncTypeRequest.js +0 -5
- package/api/resources/windows/client/requests/ExtractRequest.d.ts +0 -30
- package/api/resources/windows/client/requests/ExtractRequest.js +0 -5
- package/api/resources/windows/client/requests/FindManyRequest.d.ts +0 -30
- package/api/resources/windows/client/requests/FindManyRequest.js +0 -5
- package/api/resources/windows/client/requests/FindOneRequest.d.ts +0 -30
- package/api/resources/windows/client/requests/FindOneRequest.js +0 -5
- package/api/resources/windows/client/requests/LlmRequest.d.ts +0 -25
- package/api/resources/windows/client/requests/LlmRequest.js +0 -5
- package/api/resources/windows/client/requests/OperatorPromptV1Body.d.ts +0 -25
- package/api/resources/windows/client/requests/OperatorPromptV1Body.js +0 -5
- package/api/resources/windows/client/requests/WaitForPageRequest.d.ts +0 -23
- package/api/resources/windows/client/requests/WaitForPageRequest.js +0 -5
- package/api/resources/windows/types/WaitForPageRequestTargetStatus.d.ts +0 -11
- package/api/resources/windows/types/WaitForPageRequestTargetStatus.js +0 -10
- package/api/types/AsyncOperatorPromptResponseEnvelope.d.ts +0 -9
- package/api/types/AsyncOperatorPromptResponseEnvelope.js +0 -5
- package/dist/api/resources/windows/client/requests/ActRequest.d.ts +0 -30
- package/dist/api/resources/windows/client/requests/ActRequest.js +0 -5
- package/dist/api/resources/windows/client/requests/AsyncClickRequest.d.ts +0 -29
- package/dist/api/resources/windows/client/requests/AsyncClickRequest.js +0 -5
- package/dist/api/resources/windows/client/requests/AsyncFileInputRequest.d.ts +0 -33
- package/dist/api/resources/windows/client/requests/AsyncFileInputRequest.js +0 -5
- package/dist/api/resources/windows/client/requests/AsyncHoverRequest.d.ts +0 -27
- package/dist/api/resources/windows/client/requests/AsyncHoverRequest.js +0 -5
- package/dist/api/resources/windows/client/requests/AsyncMonitorRequest.d.ts +0 -27
- package/dist/api/resources/windows/client/requests/AsyncMonitorRequest.js +0 -5
- package/dist/api/resources/windows/client/requests/AsyncPageQueryRequest.d.ts +0 -29
- package/dist/api/resources/windows/client/requests/AsyncPageQueryRequest.js +0 -5
- package/dist/api/resources/windows/client/requests/AsyncPaginatedExtractionRequest.d.ts +0 -27
- package/dist/api/resources/windows/client/requests/AsyncPaginatedExtractionRequest.js +0 -5
- package/dist/api/resources/windows/client/requests/AsyncPromptContentRequest.d.ts +0 -29
- package/dist/api/resources/windows/client/requests/AsyncPromptContentRequest.js +0 -5
- package/dist/api/resources/windows/client/requests/AsyncScreenshotRequest.d.ts +0 -23
- package/dist/api/resources/windows/client/requests/AsyncScreenshotRequest.js +0 -5
- package/dist/api/resources/windows/client/requests/AsyncSummarizeContentRequest.d.ts +0 -25
- package/dist/api/resources/windows/client/requests/AsyncSummarizeContentRequest.js +0 -5
- package/dist/api/resources/windows/client/requests/AsyncTypeRequest.d.ts +0 -37
- package/dist/api/resources/windows/client/requests/AsyncTypeRequest.js +0 -5
- package/dist/api/resources/windows/client/requests/ExtractRequest.d.ts +0 -30
- package/dist/api/resources/windows/client/requests/ExtractRequest.js +0 -5
- package/dist/api/resources/windows/client/requests/FindManyRequest.d.ts +0 -30
- package/dist/api/resources/windows/client/requests/FindManyRequest.js +0 -5
- package/dist/api/resources/windows/client/requests/FindOneRequest.d.ts +0 -30
- package/dist/api/resources/windows/client/requests/FindOneRequest.js +0 -5
- package/dist/api/resources/windows/client/requests/LlmRequest.d.ts +0 -25
- package/dist/api/resources/windows/client/requests/LlmRequest.js +0 -5
- package/dist/api/resources/windows/client/requests/OperatorPromptV1Body.d.ts +0 -25
- package/dist/api/resources/windows/client/requests/OperatorPromptV1Body.js +0 -5
- package/dist/api/resources/windows/client/requests/WaitForPageRequest.d.ts +0 -23
- package/dist/api/resources/windows/client/requests/WaitForPageRequest.js +0 -5
- package/dist/api/resources/windows/types/WaitForPageRequestTargetStatus.d.ts +0 -11
- package/dist/api/resources/windows/types/WaitForPageRequestTargetStatus.js +0 -10
- package/dist/api/types/AsyncOperatorPromptResponseEnvelope.d.ts +0 -9
- package/dist/api/types/AsyncOperatorPromptResponseEnvelope.js +0 -5
- package/dist/serialization/resources/windows/client/requests/ActRequest.d.ts +0 -19
- package/dist/serialization/resources/windows/client/requests/ActRequest.js +0 -50
- package/dist/serialization/resources/windows/client/requests/AsyncClickRequest.d.ts +0 -20
- package/dist/serialization/resources/windows/client/requests/AsyncClickRequest.js +0 -51
- package/dist/serialization/resources/windows/client/requests/AsyncFileInputRequest.d.ts +0 -23
- package/dist/serialization/resources/windows/client/requests/AsyncFileInputRequest.js +0 -54
- package/dist/serialization/resources/windows/client/requests/AsyncHoverRequest.d.ts +0 -19
- package/dist/serialization/resources/windows/client/requests/AsyncHoverRequest.js +0 -50
- package/dist/serialization/resources/windows/client/requests/AsyncMonitorRequest.d.ts +0 -19
- package/dist/serialization/resources/windows/client/requests/AsyncMonitorRequest.js +0 -50
- package/dist/serialization/resources/windows/client/requests/AsyncPageQueryRequest.d.ts +0 -20
- package/dist/serialization/resources/windows/client/requests/AsyncPageQueryRequest.js +0 -51
- package/dist/serialization/resources/windows/client/requests/AsyncPaginatedExtractionRequest.d.ts +0 -19
- package/dist/serialization/resources/windows/client/requests/AsyncPaginatedExtractionRequest.js +0 -50
- package/dist/serialization/resources/windows/client/requests/AsyncPromptContentRequest.d.ts +0 -20
- package/dist/serialization/resources/windows/client/requests/AsyncPromptContentRequest.js +0 -51
- package/dist/serialization/resources/windows/client/requests/AsyncScreenshotRequest.d.ts +0 -18
- package/dist/serialization/resources/windows/client/requests/AsyncScreenshotRequest.js +0 -49
- package/dist/serialization/resources/windows/client/requests/AsyncSummarizeContentRequest.d.ts +0 -19
- package/dist/serialization/resources/windows/client/requests/AsyncSummarizeContentRequest.js +0 -50
- package/dist/serialization/resources/windows/client/requests/AsyncTypeRequest.d.ts +0 -24
- package/dist/serialization/resources/windows/client/requests/AsyncTypeRequest.js +0 -55
- package/dist/serialization/resources/windows/client/requests/ExtractRequest.d.ts +0 -19
- package/dist/serialization/resources/windows/client/requests/ExtractRequest.js +0 -50
- package/dist/serialization/resources/windows/client/requests/FindManyRequest.d.ts +0 -19
- package/dist/serialization/resources/windows/client/requests/FindManyRequest.js +0 -50
- package/dist/serialization/resources/windows/client/requests/FindOneRequest.d.ts +0 -19
- package/dist/serialization/resources/windows/client/requests/FindOneRequest.js +0 -50
- package/dist/serialization/resources/windows/client/requests/LlmRequest.d.ts +0 -17
- package/dist/serialization/resources/windows/client/requests/LlmRequest.js +0 -48
- package/dist/serialization/resources/windows/client/requests/OperatorPromptV1Body.d.ts +0 -17
- package/dist/serialization/resources/windows/client/requests/OperatorPromptV1Body.js +0 -48
- package/dist/serialization/resources/windows/client/requests/WaitForPageRequest.d.ts +0 -18
- package/dist/serialization/resources/windows/client/requests/WaitForPageRequest.js +0 -49
- package/dist/serialization/resources/windows/types/WaitForPageRequestTargetStatus.d.ts +0 -10
- package/dist/serialization/resources/windows/types/WaitForPageRequestTargetStatus.js +0 -41
- package/dist/serialization/types/AsyncOperatorPromptResponseEnvelope.d.ts +0 -15
- package/dist/serialization/types/AsyncOperatorPromptResponseEnvelope.js +0 -46
- package/serialization/resources/windows/client/requests/ActRequest.d.ts +0 -19
- package/serialization/resources/windows/client/requests/ActRequest.js +0 -50
- package/serialization/resources/windows/client/requests/AsyncClickRequest.d.ts +0 -20
- package/serialization/resources/windows/client/requests/AsyncClickRequest.js +0 -51
- package/serialization/resources/windows/client/requests/AsyncFileInputRequest.d.ts +0 -23
- package/serialization/resources/windows/client/requests/AsyncFileInputRequest.js +0 -54
- package/serialization/resources/windows/client/requests/AsyncHoverRequest.d.ts +0 -19
- package/serialization/resources/windows/client/requests/AsyncHoverRequest.js +0 -50
- package/serialization/resources/windows/client/requests/AsyncMonitorRequest.d.ts +0 -19
- package/serialization/resources/windows/client/requests/AsyncMonitorRequest.js +0 -50
- package/serialization/resources/windows/client/requests/AsyncPageQueryRequest.d.ts +0 -20
- package/serialization/resources/windows/client/requests/AsyncPageQueryRequest.js +0 -51
- package/serialization/resources/windows/client/requests/AsyncPaginatedExtractionRequest.d.ts +0 -19
- package/serialization/resources/windows/client/requests/AsyncPaginatedExtractionRequest.js +0 -50
- package/serialization/resources/windows/client/requests/AsyncPromptContentRequest.d.ts +0 -20
- package/serialization/resources/windows/client/requests/AsyncPromptContentRequest.js +0 -51
- package/serialization/resources/windows/client/requests/AsyncScreenshotRequest.d.ts +0 -18
- package/serialization/resources/windows/client/requests/AsyncScreenshotRequest.js +0 -49
- package/serialization/resources/windows/client/requests/AsyncSummarizeContentRequest.d.ts +0 -19
- package/serialization/resources/windows/client/requests/AsyncSummarizeContentRequest.js +0 -50
- package/serialization/resources/windows/client/requests/AsyncTypeRequest.d.ts +0 -24
- package/serialization/resources/windows/client/requests/AsyncTypeRequest.js +0 -55
- package/serialization/resources/windows/client/requests/ExtractRequest.d.ts +0 -19
- package/serialization/resources/windows/client/requests/ExtractRequest.js +0 -50
- package/serialization/resources/windows/client/requests/FindManyRequest.d.ts +0 -19
- package/serialization/resources/windows/client/requests/FindManyRequest.js +0 -50
- package/serialization/resources/windows/client/requests/FindOneRequest.d.ts +0 -19
- package/serialization/resources/windows/client/requests/FindOneRequest.js +0 -50
- package/serialization/resources/windows/client/requests/LlmRequest.d.ts +0 -17
- package/serialization/resources/windows/client/requests/LlmRequest.js +0 -48
- package/serialization/resources/windows/client/requests/OperatorPromptV1Body.d.ts +0 -17
- package/serialization/resources/windows/client/requests/OperatorPromptV1Body.js +0 -48
- package/serialization/resources/windows/client/requests/WaitForPageRequest.d.ts +0 -18
- package/serialization/resources/windows/client/requests/WaitForPageRequest.js +0 -49
- package/serialization/resources/windows/types/WaitForPageRequestTargetStatus.d.ts +0 -10
- package/serialization/resources/windows/types/WaitForPageRequestTargetStatus.js +0 -41
- package/serialization/types/AsyncOperatorPromptResponseEnvelope.d.ts +0 -15
- package/serialization/types/AsyncOperatorPromptResponseEnvelope.js +0 -46
@@ -58,63 +58,6 @@ 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.42-beta0", "User-Agent": "@airtop/sdk/0.1.42-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
|
-
}
|
118
61
|
/**
|
119
62
|
* Create an automation of a browser window asynchronously
|
120
63
|
*
|
@@ -132,7 +75,7 @@ class Windows {
|
|
132
75
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
133
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, `v1/async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/create-automation`),
|
134
77
|
method: "POST",
|
135
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
78
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.43", "User-Agent": "@airtop/sdk/0.1.43", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
136
79
|
contentType: "application/json",
|
137
80
|
requestType: "json",
|
138
81
|
body: serializers.AsyncCreateAutomationRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
@@ -187,7 +130,7 @@ class Windows {
|
|
187
130
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
188
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, `v1/async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/create-form-filler`),
|
189
132
|
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.
|
133
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.43", "User-Agent": "@airtop/sdk/0.1.43", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
191
134
|
contentType: "application/json",
|
192
135
|
requestType: "json",
|
193
136
|
body: serializers.AsyncCreateFormFillerRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
@@ -244,7 +187,7 @@ class Windows {
|
|
244
187
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
245
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)}/execute-automation`),
|
246
189
|
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.
|
190
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.43", "User-Agent": "@airtop/sdk/0.1.43", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
248
191
|
contentType: "application/json",
|
249
192
|
requestType: "json",
|
250
193
|
body: serializers.AsyncExecuteAutomationRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
@@ -282,61 +225,6 @@ class Windows {
|
|
282
225
|
}
|
283
226
|
});
|
284
227
|
}
|
285
|
-
/**
|
286
|
-
* Execute a file input interaction in a specific browser window asynchronously
|
287
|
-
*
|
288
|
-
* @param {string} sessionId - The session id for the window.
|
289
|
-
* @param {string} windowId - The Airtop window id of the browser window.
|
290
|
-
* @param {Airtop.AsyncFileInputRequest} request
|
291
|
-
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
292
|
-
*
|
293
|
-
* @example
|
294
|
-
* await client.windows.asyncFileInput("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
295
|
-
*/
|
296
|
-
asyncFileInput(sessionId_1, windowId_1) {
|
297
|
-
return __awaiter(this, arguments, void 0, function* (sessionId, windowId, request = {}, requestOptions) {
|
298
|
-
var _a, _b, _c;
|
299
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
300
|
-
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)}/file-input`),
|
301
|
-
method: "POST",
|
302
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.42-beta0", "User-Agent": "@airtop/sdk/0.1.42-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
303
|
-
contentType: "application/json",
|
304
|
-
requestType: "json",
|
305
|
-
body: serializers.AsyncFileInputRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
306
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
307
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
308
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
309
|
-
});
|
310
|
-
if (_response.ok) {
|
311
|
-
return serializers.AsyncSessionAiResponseEnvelope.parseOrThrow(_response.body, {
|
312
|
-
unrecognizedObjectKeys: "passthrough",
|
313
|
-
allowUnrecognizedUnionMembers: true,
|
314
|
-
allowUnrecognizedEnumValues: true,
|
315
|
-
skipValidation: true,
|
316
|
-
breadcrumbsPrefix: ["response"],
|
317
|
-
});
|
318
|
-
}
|
319
|
-
if (_response.error.reason === "status-code") {
|
320
|
-
throw new errors.AirtopError({
|
321
|
-
statusCode: _response.error.statusCode,
|
322
|
-
body: _response.error.body,
|
323
|
-
});
|
324
|
-
}
|
325
|
-
switch (_response.error.reason) {
|
326
|
-
case "non-json":
|
327
|
-
throw new errors.AirtopError({
|
328
|
-
statusCode: _response.error.statusCode,
|
329
|
-
body: _response.error.rawBody,
|
330
|
-
});
|
331
|
-
case "timeout":
|
332
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/async/sessions/{sessionId}/windows/{windowId}/file-input.");
|
333
|
-
case "unknown":
|
334
|
-
throw new errors.AirtopError({
|
335
|
-
message: _response.error.errorMessage,
|
336
|
-
});
|
337
|
-
}
|
338
|
-
});
|
339
|
-
}
|
340
228
|
/**
|
341
229
|
* Fill a form of a browser window asynchronously using a form-filler automation
|
342
230
|
*
|
@@ -356,7 +244,7 @@ class Windows {
|
|
356
244
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
357
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)}/fill-form`),
|
358
246
|
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.
|
247
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.43", "User-Agent": "@airtop/sdk/0.1.43", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
360
248
|
contentType: "application/json",
|
361
249
|
requestType: "json",
|
362
250
|
body: serializers.AsyncFillFormRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
@@ -395,87 +283,31 @@ class Windows {
|
|
395
283
|
});
|
396
284
|
}
|
397
285
|
/**
|
398
|
-
*
|
399
|
-
* @param {string} windowId - The Airtop window id of the browser window.
|
400
|
-
* @param {Airtop.AsyncHoverRequest} request
|
401
|
-
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
286
|
+
* Creates a new browser window in a session. Optionally, you can specify a url to load on the window upon creation.
|
402
287
|
*
|
403
|
-
* @
|
404
|
-
*
|
405
|
-
* elementDescription: "The search box input in the top right corner"
|
406
|
-
* })
|
407
|
-
*/
|
408
|
-
asyncHover(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)}/hover`),
|
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.42-beta0", "User-Agent": "@airtop/sdk/0.1.42-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.AsyncHoverRequest.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}/hover.");
|
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.AsyncMonitorRequest} request
|
288
|
+
* @param {string} sessionId - ID of the session that owns the window.
|
289
|
+
* @param {Airtop.CreateWindowInputV1Body} request
|
456
290
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
457
291
|
*
|
458
292
|
* @example
|
459
|
-
* await client.windows.
|
460
|
-
* condition: "Determine if the user appears to be signed in to the website"
|
461
|
-
* })
|
293
|
+
* await client.windows.create("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b")
|
462
294
|
*/
|
463
|
-
|
464
|
-
return __awaiter(this,
|
295
|
+
create(sessionId_1) {
|
296
|
+
return __awaiter(this, arguments, void 0, function* (sessionId, request = {}, requestOptions) {
|
465
297
|
var _a, _b, _c;
|
466
298
|
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/
|
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, `v1/sessions/${encodeURIComponent(sessionId)}/windows`),
|
468
300
|
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.
|
301
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.43", "User-Agent": "@airtop/sdk/0.1.43", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
470
302
|
contentType: "application/json",
|
471
303
|
requestType: "json",
|
472
|
-
body: serializers.
|
304
|
+
body: serializers.CreateWindowInputV1Body.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
473
305
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
474
306
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
475
307
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
476
308
|
});
|
477
309
|
if (_response.ok) {
|
478
|
-
return serializers.
|
310
|
+
return serializers.WindowIdResponse.parseOrThrow(_response.body, {
|
479
311
|
unrecognizedObjectKeys: "passthrough",
|
480
312
|
allowUnrecognizedUnionMembers: true,
|
481
313
|
allowUnrecognizedEnumValues: true,
|
@@ -496,7 +328,7 @@ class Windows {
|
|
496
328
|
body: _response.error.rawBody,
|
497
329
|
});
|
498
330
|
case "timeout":
|
499
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/
|
331
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows.");
|
500
332
|
case "unknown":
|
501
333
|
throw new errors.AirtopError({
|
502
334
|
message: _response.error.errorMessage,
|
@@ -505,87 +337,45 @@ class Windows {
|
|
505
337
|
});
|
506
338
|
}
|
507
339
|
/**
|
508
|
-
*
|
509
|
-
*
|
510
|
-
* @param {
|
340
|
+
* Get information about a browser window in a session, including the live view url.
|
341
|
+
*
|
342
|
+
* @param {string} sessionId - ID of the session that owns the window.
|
343
|
+
* @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.
|
344
|
+
* @param {Airtop.GetWindowInfoRequest} request
|
511
345
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
512
346
|
*
|
513
347
|
* @example
|
514
|
-
* await client.windows.
|
515
|
-
*
|
348
|
+
* await client.windows.getWindowInfo("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "7334da2a-91b0-42c5-6156-76a5eba87430", {
|
349
|
+
* screenResolution: "1280x720"
|
516
350
|
* })
|
517
351
|
*/
|
518
|
-
|
519
|
-
return __awaiter(this,
|
352
|
+
getWindowInfo(sessionId_1, windowId_1) {
|
353
|
+
return __awaiter(this, arguments, void 0, function* (sessionId, windowId, request = {}, requestOptions) {
|
520
354
|
var _a, _b, _c;
|
521
|
-
const
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
contentType: "application/json",
|
526
|
-
requestType: "json",
|
527
|
-
body: serializers.AsyncPageQueryRequest.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
|
-
});
|
355
|
+
const { includeNavigationBar, disableResize, screenResolution } = request;
|
356
|
+
const _queryParams = {};
|
357
|
+
if (includeNavigationBar != null) {
|
358
|
+
_queryParams["includeNavigationBar"] = includeNavigationBar.toString();
|
540
359
|
}
|
541
|
-
if (
|
542
|
-
|
543
|
-
statusCode: _response.error.statusCode,
|
544
|
-
body: _response.error.body,
|
545
|
-
});
|
360
|
+
if (disableResize != null) {
|
361
|
+
_queryParams["disableResize"] = disableResize.toString();
|
546
362
|
}
|
547
|
-
|
548
|
-
|
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}/page-query.");
|
555
|
-
case "unknown":
|
556
|
-
throw new errors.AirtopError({
|
557
|
-
message: _response.error.errorMessage,
|
558
|
-
});
|
363
|
+
if (screenResolution != null) {
|
364
|
+
_queryParams["screenResolution"] = screenResolution;
|
559
365
|
}
|
560
|
-
});
|
561
|
-
}
|
562
|
-
/**
|
563
|
-
* @param {string} sessionId - The session id for the window.
|
564
|
-
* @param {string} windowId - The Airtop window id of the browser window.
|
565
|
-
* @param {Airtop.AsyncPaginatedExtractionRequest} request
|
566
|
-
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
567
|
-
*
|
568
|
-
* @example
|
569
|
-
* await client.windows.asyncPaginatedExtraction("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
570
|
-
* 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."
|
571
|
-
* })
|
572
|
-
*/
|
573
|
-
asyncPaginatedExtraction(sessionId, windowId, request, requestOptions) {
|
574
|
-
return __awaiter(this, void 0, void 0, function* () {
|
575
|
-
var _a, _b, _c;
|
576
366
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
577
|
-
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/
|
578
|
-
method: "
|
579
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
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, `v1/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}`),
|
368
|
+
method: "GET",
|
369
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.43", "User-Agent": "@airtop/sdk/0.1.43", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
580
370
|
contentType: "application/json",
|
371
|
+
queryParameters: _queryParams,
|
581
372
|
requestType: "json",
|
582
|
-
body: serializers.AsyncPaginatedExtractionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
583
373
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
584
374
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
585
375
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
586
376
|
});
|
587
377
|
if (_response.ok) {
|
588
|
-
return serializers.
|
378
|
+
return serializers.WindowResponse.parseOrThrow(_response.body, {
|
589
379
|
unrecognizedObjectKeys: "passthrough",
|
590
380
|
allowUnrecognizedUnionMembers: true,
|
591
381
|
allowUnrecognizedEnumValues: true,
|
@@ -606,7 +396,7 @@ class Windows {
|
|
606
396
|
body: _response.error.rawBody,
|
607
397
|
});
|
608
398
|
case "timeout":
|
609
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling
|
399
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling GET /v1/sessions/{sessionId}/windows/{windowId}.");
|
610
400
|
case "unknown":
|
611
401
|
throw new errors.AirtopError({
|
612
402
|
message: _response.error.errorMessage,
|
@@ -615,777 +405,34 @@ class Windows {
|
|
615
405
|
});
|
616
406
|
}
|
617
407
|
/**
|
618
|
-
*
|
408
|
+
* Loads a specified url on a given window
|
619
409
|
*
|
620
|
-
* @param {string} sessionId -
|
621
|
-
* @param {string} windowId -
|
622
|
-
* @param {Airtop.
|
410
|
+
* @param {string} sessionId - ID of the session that owns the window.
|
411
|
+
* @param {string} windowId - Airtop window ID of the browser window.
|
412
|
+
* @param {Airtop.WindowLoadUrlV1Body} request
|
623
413
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
624
414
|
*
|
625
415
|
* @example
|
626
|
-
* await client.windows.
|
627
|
-
*
|
416
|
+
* await client.windows.loadUrl("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "7334da2a-91b0-42c5-6156-76a5eba87430", {
|
417
|
+
* url: "https://www.airtop.ai"
|
628
418
|
* })
|
629
419
|
*/
|
630
|
-
|
420
|
+
loadUrl(sessionId, windowId, request, requestOptions) {
|
631
421
|
return __awaiter(this, void 0, void 0, function* () {
|
632
422
|
var _a, _b, _c;
|
633
423
|
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/
|
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, `v1/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}`),
|
635
425
|
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.
|
426
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.43", "User-Agent": "@airtop/sdk/0.1.43", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
637
427
|
contentType: "application/json",
|
638
428
|
requestType: "json",
|
639
|
-
body: serializers.
|
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}/prompt-content.");
|
667
|
-
case "unknown":
|
668
|
-
throw new errors.AirtopError({
|
669
|
-
message: _response.error.errorMessage,
|
670
|
-
});
|
671
|
-
}
|
672
|
-
});
|
673
|
-
}
|
674
|
-
/**
|
675
|
-
* Take a screenshot of the current viewport of a browser window asynchronously
|
676
|
-
*
|
677
|
-
* @param {string} sessionId - The session id for the window.
|
678
|
-
* @param {string} windowId - The Airtop window id of the browser window.
|
679
|
-
* @param {Airtop.AsyncScreenshotRequest} request
|
680
|
-
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
681
|
-
*
|
682
|
-
* @example
|
683
|
-
* await client.windows.asyncScreenshot("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
684
|
-
*/
|
685
|
-
asyncScreenshot(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)}/screenshot`),
|
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.42-beta0", "User-Agent": "@airtop/sdk/0.1.42-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.AsyncScreenshotRequest.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}/screenshot.");
|
722
|
-
case "unknown":
|
723
|
-
throw new errors.AirtopError({
|
724
|
-
message: _response.error.errorMessage,
|
725
|
-
});
|
726
|
-
}
|
727
|
-
});
|
728
|
-
}
|
729
|
-
/**
|
730
|
-
* This endpoint is deprecated. Please use the `pageQuery` endpoint and ask for a summary in the prompt instead.
|
731
|
-
*
|
732
|
-
* @param {string} sessionId - The session id for the window.
|
733
|
-
* @param {string} windowId - The Airtop window id of the browser window to summarize.
|
734
|
-
* @param {Airtop.AsyncSummarizeContentRequest} request
|
735
|
-
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
736
|
-
*
|
737
|
-
* @example
|
738
|
-
* await client.windows.asyncSummarizeContent("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
739
|
-
*/
|
740
|
-
asyncSummarizeContent(sessionId_1, windowId_1) {
|
741
|
-
return __awaiter(this, arguments, void 0, function* (sessionId, windowId, request = {}, requestOptions) {
|
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)}/summarize-content`),
|
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.42-beta0", "User-Agent": "@airtop/sdk/0.1.42-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.AsyncSummarizeContentRequest.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}/summarize-content.");
|
777
|
-
case "unknown":
|
778
|
-
throw new errors.AirtopError({
|
779
|
-
message: _response.error.errorMessage,
|
780
|
-
});
|
781
|
-
}
|
782
|
-
});
|
783
|
-
}
|
784
|
-
/**
|
785
|
-
* @param {string} sessionId - The session id for the window.
|
786
|
-
* @param {string} windowId - The Airtop window id of the browser window.
|
787
|
-
* @param {Airtop.AsyncTypeRequest} request
|
788
|
-
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
789
|
-
*
|
790
|
-
* @example
|
791
|
-
* await client.windows.asyncType("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
792
|
-
* text: "Example text"
|
793
|
-
* })
|
794
|
-
*/
|
795
|
-
asyncType(sessionId, windowId, request, requestOptions) {
|
796
|
-
return __awaiter(this, void 0, void 0, function* () {
|
797
|
-
var _a, _b, _c;
|
798
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
799
|
-
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`),
|
800
|
-
method: "POST",
|
801
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.42-beta0", "User-Agent": "@airtop/sdk/0.1.42-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
802
|
-
contentType: "application/json",
|
803
|
-
requestType: "json",
|
804
|
-
body: serializers.AsyncTypeRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
805
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
806
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
807
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
808
|
-
});
|
809
|
-
if (_response.ok) {
|
810
|
-
return serializers.AsyncSessionAiResponseEnvelope.parseOrThrow(_response.body, {
|
811
|
-
unrecognizedObjectKeys: "passthrough",
|
812
|
-
allowUnrecognizedUnionMembers: true,
|
813
|
-
allowUnrecognizedEnumValues: true,
|
814
|
-
skipValidation: true,
|
815
|
-
breadcrumbsPrefix: ["response"],
|
816
|
-
});
|
817
|
-
}
|
818
|
-
if (_response.error.reason === "status-code") {
|
819
|
-
throw new errors.AirtopError({
|
820
|
-
statusCode: _response.error.statusCode,
|
821
|
-
body: _response.error.body,
|
822
|
-
});
|
823
|
-
}
|
824
|
-
switch (_response.error.reason) {
|
825
|
-
case "non-json":
|
826
|
-
throw new errors.AirtopError({
|
827
|
-
statusCode: _response.error.statusCode,
|
828
|
-
body: _response.error.rawBody,
|
829
|
-
});
|
830
|
-
case "timeout":
|
831
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/async/sessions/{sessionId}/windows/{windowId}/type.");
|
832
|
-
case "unknown":
|
833
|
-
throw new errors.AirtopError({
|
834
|
-
message: _response.error.errorMessage,
|
835
|
-
});
|
836
|
-
}
|
837
|
-
});
|
838
|
-
}
|
839
|
-
/**
|
840
|
-
* Creates a new browser window in a session. Optionally, you can specify a url to load on the window upon creation.
|
841
|
-
*
|
842
|
-
* @param {string} sessionId - ID of the session that owns the window.
|
843
|
-
* @param {Airtop.CreateWindowInputV1Body} request
|
844
|
-
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
845
|
-
*
|
846
|
-
* @example
|
847
|
-
* await client.windows.create("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b")
|
848
|
-
*/
|
849
|
-
create(sessionId_1) {
|
850
|
-
return __awaiter(this, arguments, void 0, function* (sessionId, request = {}, requestOptions) {
|
851
|
-
var _a, _b, _c;
|
852
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
853
|
-
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`),
|
854
|
-
method: "POST",
|
855
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.42-beta0", "User-Agent": "@airtop/sdk/0.1.42-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
856
|
-
contentType: "application/json",
|
857
|
-
requestType: "json",
|
858
|
-
body: serializers.CreateWindowInputV1Body.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
859
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
860
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
861
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
862
|
-
});
|
863
|
-
if (_response.ok) {
|
864
|
-
return serializers.WindowIdResponse.parseOrThrow(_response.body, {
|
865
|
-
unrecognizedObjectKeys: "passthrough",
|
866
|
-
allowUnrecognizedUnionMembers: true,
|
867
|
-
allowUnrecognizedEnumValues: true,
|
868
|
-
skipValidation: true,
|
869
|
-
breadcrumbsPrefix: ["response"],
|
870
|
-
});
|
871
|
-
}
|
872
|
-
if (_response.error.reason === "status-code") {
|
873
|
-
throw new errors.AirtopError({
|
874
|
-
statusCode: _response.error.statusCode,
|
875
|
-
body: _response.error.body,
|
876
|
-
});
|
877
|
-
}
|
878
|
-
switch (_response.error.reason) {
|
879
|
-
case "non-json":
|
880
|
-
throw new errors.AirtopError({
|
881
|
-
statusCode: _response.error.statusCode,
|
882
|
-
body: _response.error.rawBody,
|
883
|
-
});
|
884
|
-
case "timeout":
|
885
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows.");
|
886
|
-
case "unknown":
|
887
|
-
throw new errors.AirtopError({
|
888
|
-
message: _response.error.errorMessage,
|
889
|
-
});
|
890
|
-
}
|
891
|
-
});
|
892
|
-
}
|
893
|
-
/**
|
894
|
-
* Get information about a browser window in a session, including the live view url.
|
895
|
-
*
|
896
|
-
* @param {string} sessionId - ID of the session that owns the window.
|
897
|
-
* @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.
|
898
|
-
* @param {Airtop.GetWindowInfoRequest} request
|
899
|
-
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
900
|
-
*
|
901
|
-
* @example
|
902
|
-
* await client.windows.getWindowInfo("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "7334da2a-91b0-42c5-6156-76a5eba87430", {
|
903
|
-
* screenResolution: "1280x720"
|
904
|
-
* })
|
905
|
-
*/
|
906
|
-
getWindowInfo(sessionId_1, windowId_1) {
|
907
|
-
return __awaiter(this, arguments, void 0, function* (sessionId, windowId, request = {}, requestOptions) {
|
908
|
-
var _a, _b, _c;
|
909
|
-
const { includeNavigationBar, disableResize, screenResolution } = request;
|
910
|
-
const _queryParams = {};
|
911
|
-
if (includeNavigationBar != null) {
|
912
|
-
_queryParams["includeNavigationBar"] = includeNavigationBar.toString();
|
913
|
-
}
|
914
|
-
if (disableResize != null) {
|
915
|
-
_queryParams["disableResize"] = disableResize.toString();
|
916
|
-
}
|
917
|
-
if (screenResolution != null) {
|
918
|
-
_queryParams["screenResolution"] = screenResolution;
|
919
|
-
}
|
920
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
921
|
-
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)}`),
|
922
|
-
method: "GET",
|
923
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.42-beta0", "User-Agent": "@airtop/sdk/0.1.42-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
924
|
-
contentType: "application/json",
|
925
|
-
queryParameters: _queryParams,
|
926
|
-
requestType: "json",
|
927
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
928
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
929
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
930
|
-
});
|
931
|
-
if (_response.ok) {
|
932
|
-
return serializers.WindowResponse.parseOrThrow(_response.body, {
|
933
|
-
unrecognizedObjectKeys: "passthrough",
|
934
|
-
allowUnrecognizedUnionMembers: true,
|
935
|
-
allowUnrecognizedEnumValues: true,
|
936
|
-
skipValidation: true,
|
937
|
-
breadcrumbsPrefix: ["response"],
|
938
|
-
});
|
939
|
-
}
|
940
|
-
if (_response.error.reason === "status-code") {
|
941
|
-
throw new errors.AirtopError({
|
942
|
-
statusCode: _response.error.statusCode,
|
943
|
-
body: _response.error.body,
|
944
|
-
});
|
945
|
-
}
|
946
|
-
switch (_response.error.reason) {
|
947
|
-
case "non-json":
|
948
|
-
throw new errors.AirtopError({
|
949
|
-
statusCode: _response.error.statusCode,
|
950
|
-
body: _response.error.rawBody,
|
951
|
-
});
|
952
|
-
case "timeout":
|
953
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling GET /v1/sessions/{sessionId}/windows/{windowId}.");
|
954
|
-
case "unknown":
|
955
|
-
throw new errors.AirtopError({
|
956
|
-
message: _response.error.errorMessage,
|
957
|
-
});
|
958
|
-
}
|
959
|
-
});
|
960
|
-
}
|
961
|
-
/**
|
962
|
-
* Loads a specified url on a given window
|
963
|
-
*
|
964
|
-
* @param {string} sessionId - ID of the session that owns the window.
|
965
|
-
* @param {string} windowId - Airtop window ID of the browser window.
|
966
|
-
* @param {Airtop.WindowLoadUrlV1Body} request
|
967
|
-
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
968
|
-
*
|
969
|
-
* @example
|
970
|
-
* await client.windows.loadUrl("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "7334da2a-91b0-42c5-6156-76a5eba87430", {
|
971
|
-
* url: "https://www.airtop.ai"
|
972
|
-
* })
|
973
|
-
*/
|
974
|
-
loadUrl(sessionId, windowId, request, requestOptions) {
|
975
|
-
return __awaiter(this, void 0, void 0, function* () {
|
976
|
-
var _a, _b, _c;
|
977
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
978
|
-
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)}`),
|
979
|
-
method: "POST",
|
980
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.42-beta0", "User-Agent": "@airtop/sdk/0.1.42-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
981
|
-
contentType: "application/json",
|
982
|
-
requestType: "json",
|
983
|
-
body: serializers.WindowLoadUrlV1Body.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
984
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
985
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
986
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
987
|
-
});
|
988
|
-
if (_response.ok) {
|
989
|
-
return serializers.OperationOutcomeResponse.parseOrThrow(_response.body, {
|
990
|
-
unrecognizedObjectKeys: "passthrough",
|
991
|
-
allowUnrecognizedUnionMembers: true,
|
992
|
-
allowUnrecognizedEnumValues: true,
|
993
|
-
skipValidation: true,
|
994
|
-
breadcrumbsPrefix: ["response"],
|
995
|
-
});
|
996
|
-
}
|
997
|
-
if (_response.error.reason === "status-code") {
|
998
|
-
throw new errors.AirtopError({
|
999
|
-
statusCode: _response.error.statusCode,
|
1000
|
-
body: _response.error.body,
|
1001
|
-
});
|
1002
|
-
}
|
1003
|
-
switch (_response.error.reason) {
|
1004
|
-
case "non-json":
|
1005
|
-
throw new errors.AirtopError({
|
1006
|
-
statusCode: _response.error.statusCode,
|
1007
|
-
body: _response.error.rawBody,
|
1008
|
-
});
|
1009
|
-
case "timeout":
|
1010
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}.");
|
1011
|
-
case "unknown":
|
1012
|
-
throw new errors.AirtopError({
|
1013
|
-
message: _response.error.errorMessage,
|
1014
|
-
});
|
1015
|
-
}
|
1016
|
-
});
|
1017
|
-
}
|
1018
|
-
/**
|
1019
|
-
* Closes a browser window in a session
|
1020
|
-
*
|
1021
|
-
* @param {string} sessionId - ID of the session that owns the window.
|
1022
|
-
* @param {string} windowId - Airtop window ID of the browser window.
|
1023
|
-
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
1024
|
-
*
|
1025
|
-
* @example
|
1026
|
-
* await client.windows.close("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "7334da2a-91b0-42c5-6156-76a5eba87430")
|
1027
|
-
*/
|
1028
|
-
close(sessionId, windowId, requestOptions) {
|
1029
|
-
return __awaiter(this, void 0, void 0, function* () {
|
1030
|
-
var _a, _b, _c;
|
1031
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1032
|
-
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)}`),
|
1033
|
-
method: "DELETE",
|
1034
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.42-beta0", "User-Agent": "@airtop/sdk/0.1.42-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1035
|
-
contentType: "application/json",
|
1036
|
-
requestType: "json",
|
1037
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1038
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1039
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
1040
|
-
});
|
1041
|
-
if (_response.ok) {
|
1042
|
-
return serializers.WindowIdResponse.parseOrThrow(_response.body, {
|
1043
|
-
unrecognizedObjectKeys: "passthrough",
|
1044
|
-
allowUnrecognizedUnionMembers: true,
|
1045
|
-
allowUnrecognizedEnumValues: true,
|
1046
|
-
skipValidation: true,
|
1047
|
-
breadcrumbsPrefix: ["response"],
|
1048
|
-
});
|
1049
|
-
}
|
1050
|
-
if (_response.error.reason === "status-code") {
|
1051
|
-
throw new errors.AirtopError({
|
1052
|
-
statusCode: _response.error.statusCode,
|
1053
|
-
body: _response.error.body,
|
1054
|
-
});
|
1055
|
-
}
|
1056
|
-
switch (_response.error.reason) {
|
1057
|
-
case "non-json":
|
1058
|
-
throw new errors.AirtopError({
|
1059
|
-
statusCode: _response.error.statusCode,
|
1060
|
-
body: _response.error.rawBody,
|
1061
|
-
});
|
1062
|
-
case "timeout":
|
1063
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling DELETE /v1/sessions/{sessionId}/windows/{windowId}.");
|
1064
|
-
case "unknown":
|
1065
|
-
throw new errors.AirtopError({
|
1066
|
-
message: _response.error.errorMessage,
|
1067
|
-
});
|
1068
|
-
}
|
1069
|
-
});
|
1070
|
-
}
|
1071
|
-
/**
|
1072
|
-
* Execute a click interaction in a specific browser window
|
1073
|
-
*
|
1074
|
-
* @param {string} sessionId - The session id for the window.
|
1075
|
-
* @param {string} windowId - The Airtop window id of the browser window.
|
1076
|
-
* @param {Airtop.SessionClickHandlerRequestBody} request
|
1077
|
-
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
1078
|
-
*
|
1079
|
-
* @example
|
1080
|
-
* await client.windows.click("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
1081
|
-
* elementDescription: "The login button"
|
1082
|
-
* })
|
1083
|
-
*/
|
1084
|
-
click(sessionId, windowId, request, requestOptions) {
|
1085
|
-
return __awaiter(this, void 0, void 0, function* () {
|
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)}/click`),
|
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.42-beta0", "User-Agent": "@airtop/sdk/0.1.42-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.SessionClickHandlerRequestBody.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}/click.");
|
1121
|
-
case "unknown":
|
1122
|
-
throw new errors.AirtopError({
|
1123
|
-
message: _response.error.errorMessage,
|
1124
|
-
});
|
1125
|
-
}
|
1126
|
-
});
|
1127
|
-
}
|
1128
|
-
/**
|
1129
|
-
* Create a form-filler automation synchronously for the form loaded in the browser window
|
1130
|
-
*
|
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.CreateFormFillerRequest} request
|
1134
|
-
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
1135
|
-
*
|
1136
|
-
* @example
|
1137
|
-
* await client.windows.createFormFiller("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
1138
|
-
*/
|
1139
|
-
createFormFiller(sessionId_1, windowId_1) {
|
1140
|
-
return __awaiter(this, arguments, void 0, function* (sessionId, windowId, request = {}, requestOptions) {
|
1141
|
-
var _a, _b, _c;
|
1142
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1143
|
-
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`),
|
1144
|
-
method: "POST",
|
1145
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.42-beta0", "User-Agent": "@airtop/sdk/0.1.42-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1146
|
-
contentType: "application/json",
|
1147
|
-
requestType: "json",
|
1148
|
-
body: serializers.CreateFormFillerRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
1149
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1150
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1151
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
1152
|
-
});
|
1153
|
-
if (_response.ok) {
|
1154
|
-
return serializers.AiPromptResponse.parseOrThrow(_response.body, {
|
1155
|
-
unrecognizedObjectKeys: "passthrough",
|
1156
|
-
allowUnrecognizedUnionMembers: true,
|
1157
|
-
allowUnrecognizedEnumValues: true,
|
1158
|
-
skipValidation: true,
|
1159
|
-
breadcrumbsPrefix: ["response"],
|
1160
|
-
});
|
1161
|
-
}
|
1162
|
-
if (_response.error.reason === "status-code") {
|
1163
|
-
throw new errors.AirtopError({
|
1164
|
-
statusCode: _response.error.statusCode,
|
1165
|
-
body: _response.error.body,
|
1166
|
-
});
|
1167
|
-
}
|
1168
|
-
switch (_response.error.reason) {
|
1169
|
-
case "non-json":
|
1170
|
-
throw new errors.AirtopError({
|
1171
|
-
statusCode: _response.error.statusCode,
|
1172
|
-
body: _response.error.rawBody,
|
1173
|
-
});
|
1174
|
-
case "timeout":
|
1175
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/create-form-filler.");
|
1176
|
-
case "unknown":
|
1177
|
-
throw new errors.AirtopError({
|
1178
|
-
message: _response.error.errorMessage,
|
1179
|
-
});
|
1180
|
-
}
|
1181
|
-
});
|
1182
|
-
}
|
1183
|
-
/**
|
1184
|
-
* Execute a file input interaction in a specific browser window.
|
1185
|
-
* includeHiddenElements defaults to true and considers hidden file input elements.
|
1186
|
-
* If there is only one file input element, it will be used directly.
|
1187
|
-
* If there are multiple file input elements, the elementDescription will be used by AI to
|
1188
|
-
* select among them.
|
1189
|
-
* If no file input elements are found by inspecting the page structure, elementDescription
|
1190
|
-
* will be used by AI to try to find a match visually.
|
1191
|
-
*
|
1192
|
-
* @param {string} sessionId - The session id for the window.
|
1193
|
-
* @param {string} windowId - The Airtop window id of the browser window.
|
1194
|
-
* @param {Airtop.SessionFileInputHandlerRequestBody} request
|
1195
|
-
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
1196
|
-
*
|
1197
|
-
* @example
|
1198
|
-
* await client.windows.fileInput("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
1199
|
-
*/
|
1200
|
-
fileInput(sessionId_1, windowId_1) {
|
1201
|
-
return __awaiter(this, arguments, void 0, function* (sessionId, windowId, request = {}, requestOptions) {
|
1202
|
-
var _a, _b, _c;
|
1203
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1204
|
-
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)}/file-input`),
|
1205
|
-
method: "POST",
|
1206
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.42-beta0", "User-Agent": "@airtop/sdk/0.1.42-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1207
|
-
contentType: "application/json",
|
1208
|
-
requestType: "json",
|
1209
|
-
body: serializers.SessionFileInputHandlerRequestBody.jsonOrThrow(request, {
|
1210
|
-
unrecognizedObjectKeys: "strip",
|
1211
|
-
}),
|
1212
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1213
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1214
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
1215
|
-
});
|
1216
|
-
if (_response.ok) {
|
1217
|
-
return serializers.AiPromptResponse.parseOrThrow(_response.body, {
|
1218
|
-
unrecognizedObjectKeys: "passthrough",
|
1219
|
-
allowUnrecognizedUnionMembers: true,
|
1220
|
-
allowUnrecognizedEnumValues: true,
|
1221
|
-
skipValidation: true,
|
1222
|
-
breadcrumbsPrefix: ["response"],
|
1223
|
-
});
|
1224
|
-
}
|
1225
|
-
if (_response.error.reason === "status-code") {
|
1226
|
-
throw new errors.AirtopError({
|
1227
|
-
statusCode: _response.error.statusCode,
|
1228
|
-
body: _response.error.body,
|
1229
|
-
});
|
1230
|
-
}
|
1231
|
-
switch (_response.error.reason) {
|
1232
|
-
case "non-json":
|
1233
|
-
throw new errors.AirtopError({
|
1234
|
-
statusCode: _response.error.statusCode,
|
1235
|
-
body: _response.error.rawBody,
|
1236
|
-
});
|
1237
|
-
case "timeout":
|
1238
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/file-input.");
|
1239
|
-
case "unknown":
|
1240
|
-
throw new errors.AirtopError({
|
1241
|
-
message: _response.error.errorMessage,
|
1242
|
-
});
|
1243
|
-
}
|
1244
|
-
});
|
1245
|
-
}
|
1246
|
-
/**
|
1247
|
-
* Fill a form of a browser window synchronously using a form-filler automation
|
1248
|
-
*
|
1249
|
-
* @param {string} sessionId - The session id for the window.
|
1250
|
-
* @param {string} windowId - The Airtop window id of the browser window.
|
1251
|
-
* @param {Airtop.FillFormRequest} request
|
1252
|
-
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
1253
|
-
*
|
1254
|
-
* @example
|
1255
|
-
* await client.windows.fillForm("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
1256
|
-
* automationId: "automationId"
|
1257
|
-
* })
|
1258
|
-
*/
|
1259
|
-
fillForm(sessionId, windowId, request, requestOptions) {
|
1260
|
-
return __awaiter(this, void 0, void 0, function* () {
|
1261
|
-
var _a, _b, _c;
|
1262
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1263
|
-
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`),
|
1264
|
-
method: "POST",
|
1265
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.42-beta0", "User-Agent": "@airtop/sdk/0.1.42-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1266
|
-
contentType: "application/json",
|
1267
|
-
requestType: "json",
|
1268
|
-
body: serializers.FillFormRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
1269
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1270
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1271
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
1272
|
-
});
|
1273
|
-
if (_response.ok) {
|
1274
|
-
return serializers.AiPromptResponse.parseOrThrow(_response.body, {
|
1275
|
-
unrecognizedObjectKeys: "passthrough",
|
1276
|
-
allowUnrecognizedUnionMembers: true,
|
1277
|
-
allowUnrecognizedEnumValues: true,
|
1278
|
-
skipValidation: true,
|
1279
|
-
breadcrumbsPrefix: ["response"],
|
1280
|
-
});
|
1281
|
-
}
|
1282
|
-
if (_response.error.reason === "status-code") {
|
1283
|
-
throw new errors.AirtopError({
|
1284
|
-
statusCode: _response.error.statusCode,
|
1285
|
-
body: _response.error.body,
|
1286
|
-
});
|
1287
|
-
}
|
1288
|
-
switch (_response.error.reason) {
|
1289
|
-
case "non-json":
|
1290
|
-
throw new errors.AirtopError({
|
1291
|
-
statusCode: _response.error.statusCode,
|
1292
|
-
body: _response.error.rawBody,
|
1293
|
-
});
|
1294
|
-
case "timeout":
|
1295
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/fill-form.");
|
1296
|
-
case "unknown":
|
1297
|
-
throw new errors.AirtopError({
|
1298
|
-
message: _response.error.errorMessage,
|
1299
|
-
});
|
1300
|
-
}
|
1301
|
-
});
|
1302
|
-
}
|
1303
|
-
/**
|
1304
|
-
* Execute a hover interaction in a specific browser window
|
1305
|
-
*
|
1306
|
-
* @param {string} sessionId - The session id for the window.
|
1307
|
-
* @param {string} windowId - The Airtop window id of the browser window.
|
1308
|
-
* @param {Airtop.SessionHoverHandlerRequestBody} request
|
1309
|
-
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
1310
|
-
*
|
1311
|
-
* @example
|
1312
|
-
* await client.windows.hover("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
1313
|
-
* elementDescription: "The search box input in the top right corner"
|
1314
|
-
* })
|
1315
|
-
*/
|
1316
|
-
hover(sessionId, windowId, request, requestOptions) {
|
1317
|
-
return __awaiter(this, void 0, void 0, function* () {
|
1318
|
-
var _a, _b, _c;
|
1319
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1320
|
-
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`),
|
1321
|
-
method: "POST",
|
1322
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.42-beta0", "User-Agent": "@airtop/sdk/0.1.42-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1323
|
-
contentType: "application/json",
|
1324
|
-
requestType: "json",
|
1325
|
-
body: serializers.SessionHoverHandlerRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
1326
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1327
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1328
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
1329
|
-
});
|
1330
|
-
if (_response.ok) {
|
1331
|
-
return serializers.AiPromptResponse.parseOrThrow(_response.body, {
|
1332
|
-
unrecognizedObjectKeys: "passthrough",
|
1333
|
-
allowUnrecognizedUnionMembers: true,
|
1334
|
-
allowUnrecognizedEnumValues: true,
|
1335
|
-
skipValidation: true,
|
1336
|
-
breadcrumbsPrefix: ["response"],
|
1337
|
-
});
|
1338
|
-
}
|
1339
|
-
if (_response.error.reason === "status-code") {
|
1340
|
-
throw new errors.AirtopError({
|
1341
|
-
statusCode: _response.error.statusCode,
|
1342
|
-
body: _response.error.body,
|
1343
|
-
});
|
1344
|
-
}
|
1345
|
-
switch (_response.error.reason) {
|
1346
|
-
case "non-json":
|
1347
|
-
throw new errors.AirtopError({
|
1348
|
-
statusCode: _response.error.statusCode,
|
1349
|
-
body: _response.error.rawBody,
|
1350
|
-
});
|
1351
|
-
case "timeout":
|
1352
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/hover.");
|
1353
|
-
case "unknown":
|
1354
|
-
throw new errors.AirtopError({
|
1355
|
-
message: _response.error.errorMessage,
|
1356
|
-
});
|
1357
|
-
}
|
1358
|
-
});
|
1359
|
-
}
|
1360
|
-
/**
|
1361
|
-
* @param {string} sessionId - The session id for the window.
|
1362
|
-
* @param {string} windowId - The Airtop window id of the browser window.
|
1363
|
-
* @param {Airtop.SessionMonitorHandlerRequestBody} request
|
1364
|
-
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
1365
|
-
*
|
1366
|
-
* @example
|
1367
|
-
* await client.windows.monitor("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
1368
|
-
* condition: "Determine if the user appears to be signed in to the website"
|
1369
|
-
* })
|
1370
|
-
*/
|
1371
|
-
monitor(sessionId, windowId, request, requestOptions) {
|
1372
|
-
return __awaiter(this, void 0, void 0, function* () {
|
1373
|
-
var _a, _b, _c;
|
1374
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1375
|
-
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`),
|
1376
|
-
method: "POST",
|
1377
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.42-beta0", "User-Agent": "@airtop/sdk/0.1.42-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1378
|
-
contentType: "application/json",
|
1379
|
-
requestType: "json",
|
1380
|
-
body: serializers.SessionMonitorHandlerRequestBody.jsonOrThrow(request, {
|
1381
|
-
unrecognizedObjectKeys: "strip",
|
1382
|
-
}),
|
429
|
+
body: serializers.WindowLoadUrlV1Body.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
1383
430
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1384
431
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1385
432
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
1386
433
|
});
|
1387
434
|
if (_response.ok) {
|
1388
|
-
return serializers.
|
435
|
+
return serializers.OperationOutcomeResponse.parseOrThrow(_response.body, {
|
1389
436
|
unrecognizedObjectKeys: "passthrough",
|
1390
437
|
allowUnrecognizedUnionMembers: true,
|
1391
438
|
allowUnrecognizedEnumValues: true,
|
@@ -1406,7 +453,7 @@ class Windows {
|
|
1406
453
|
body: _response.error.rawBody,
|
1407
454
|
});
|
1408
455
|
case "timeout":
|
1409
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}
|
456
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}.");
|
1410
457
|
case "unknown":
|
1411
458
|
throw new errors.AirtopError({
|
1412
459
|
message: _response.error.errorMessage,
|
@@ -1415,34 +462,30 @@ class Windows {
|
|
1415
462
|
});
|
1416
463
|
}
|
1417
464
|
/**
|
1418
|
-
*
|
465
|
+
* Closes a browser window in a session
|
1419
466
|
*
|
1420
467
|
* @param {string} sessionId - ID of the session that owns the window.
|
1421
468
|
* @param {string} windowId - Airtop window ID of the browser window.
|
1422
|
-
* @param {Airtop.OperatorPromptV1Body} request
|
1423
469
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
1424
470
|
*
|
1425
471
|
* @example
|
1426
|
-
* await client.windows.
|
1427
|
-
* prompt: "What is the latest news about OpenAI?"
|
1428
|
-
* })
|
472
|
+
* await client.windows.close("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "7334da2a-91b0-42c5-6156-76a5eba87430")
|
1429
473
|
*/
|
1430
|
-
|
474
|
+
close(sessionId, windowId, requestOptions) {
|
1431
475
|
return __awaiter(this, void 0, void 0, function* () {
|
1432
476
|
var _a, _b, _c;
|
1433
477
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1434
|
-
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)}
|
1435
|
-
method: "
|
1436
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
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, `v1/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}`),
|
479
|
+
method: "DELETE",
|
480
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.43", "User-Agent": "@airtop/sdk/0.1.43", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1437
481
|
contentType: "application/json",
|
1438
482
|
requestType: "json",
|
1439
|
-
body: serializers.OperatorPromptV1Body.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
1440
483
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1441
484
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1442
485
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
1443
486
|
});
|
1444
487
|
if (_response.ok) {
|
1445
|
-
return serializers.
|
488
|
+
return serializers.WindowIdResponse.parseOrThrow(_response.body, {
|
1446
489
|
unrecognizedObjectKeys: "passthrough",
|
1447
490
|
allowUnrecognizedUnionMembers: true,
|
1448
491
|
allowUnrecognizedEnumValues: true,
|
@@ -1463,7 +506,7 @@ class Windows {
|
|
1463
506
|
body: _response.error.rawBody,
|
1464
507
|
});
|
1465
508
|
case "timeout":
|
1466
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling
|
509
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling DELETE /v1/sessions/{sessionId}/windows/{windowId}.");
|
1467
510
|
case "unknown":
|
1468
511
|
throw new errors.AirtopError({
|
1469
512
|
message: _response.error.errorMessage,
|
@@ -1472,30 +515,28 @@ class Windows {
|
|
1472
515
|
});
|
1473
516
|
}
|
1474
517
|
/**
|
1475
|
-
*
|
518
|
+
* Execute a click interaction in a specific browser window
|
1476
519
|
*
|
1477
520
|
* @param {string} sessionId - The session id for the window.
|
1478
521
|
* @param {string} windowId - The Airtop window id of the browser window.
|
1479
|
-
* @param {Airtop.
|
522
|
+
* @param {Airtop.SessionClickHandlerRequestBody} request
|
1480
523
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
1481
524
|
*
|
1482
525
|
* @example
|
1483
|
-
* await client.windows.
|
1484
|
-
*
|
526
|
+
* await client.windows.click("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
527
|
+
* elementDescription: "The login button"
|
1485
528
|
* })
|
1486
529
|
*/
|
1487
|
-
|
530
|
+
click(sessionId, windowId, request, requestOptions) {
|
1488
531
|
return __awaiter(this, void 0, void 0, function* () {
|
1489
532
|
var _a, _b, _c;
|
1490
533
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
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)}/
|
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, `v1/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/click`),
|
1492
535
|
method: "POST",
|
1493
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
536
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.43", "User-Agent": "@airtop/sdk/0.1.43", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1494
537
|
contentType: "application/json",
|
1495
538
|
requestType: "json",
|
1496
|
-
body: serializers.
|
1497
|
-
unrecognizedObjectKeys: "strip",
|
1498
|
-
}),
|
539
|
+
body: serializers.SessionClickHandlerRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
1499
540
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1500
541
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1501
542
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
@@ -1522,7 +563,7 @@ class Windows {
|
|
1522
563
|
body: _response.error.rawBody,
|
1523
564
|
});
|
1524
565
|
case "timeout":
|
1525
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/
|
566
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/click.");
|
1526
567
|
case "unknown":
|
1527
568
|
throw new errors.AirtopError({
|
1528
569
|
message: _response.error.errorMessage,
|
@@ -1531,30 +572,26 @@ class Windows {
|
|
1531
572
|
});
|
1532
573
|
}
|
1533
574
|
/**
|
1534
|
-
*
|
575
|
+
* Create a form-filler automation synchronously for the form loaded in the browser window
|
1535
576
|
*
|
1536
577
|
* @param {string} sessionId - The session id for the window.
|
1537
578
|
* @param {string} windowId - The Airtop window id of the browser window.
|
1538
|
-
* @param {Airtop.
|
579
|
+
* @param {Airtop.CreateFormFillerRequest} request
|
1539
580
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
1540
581
|
*
|
1541
582
|
* @example
|
1542
|
-
* await client.windows.
|
1543
|
-
* 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."
|
1544
|
-
* })
|
583
|
+
* await client.windows.createFormFiller("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
1545
584
|
*/
|
1546
|
-
|
1547
|
-
return __awaiter(this,
|
585
|
+
createFormFiller(sessionId_1, windowId_1) {
|
586
|
+
return __awaiter(this, arguments, void 0, function* (sessionId, windowId, request = {}, requestOptions) {
|
1548
587
|
var _a, _b, _c;
|
1549
588
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1550
|
-
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)}/
|
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, `v1/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/create-form-filler`),
|
1551
590
|
method: "POST",
|
1552
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
591
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.43", "User-Agent": "@airtop/sdk/0.1.43", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1553
592
|
contentType: "application/json",
|
1554
593
|
requestType: "json",
|
1555
|
-
body: serializers.
|
1556
|
-
unrecognizedObjectKeys: "strip",
|
1557
|
-
}),
|
594
|
+
body: serializers.CreateFormFillerRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
1558
595
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1559
596
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1560
597
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
@@ -1581,7 +618,7 @@ class Windows {
|
|
1581
618
|
body: _response.error.rawBody,
|
1582
619
|
});
|
1583
620
|
case "timeout":
|
1584
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/
|
621
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/create-form-filler.");
|
1585
622
|
case "unknown":
|
1586
623
|
throw new errors.AirtopError({
|
1587
624
|
message: _response.error.errorMessage,
|
@@ -1590,28 +627,32 @@ class Windows {
|
|
1590
627
|
});
|
1591
628
|
}
|
1592
629
|
/**
|
1593
|
-
*
|
630
|
+
* Execute a file input interaction in a specific browser window.
|
631
|
+
* includeHiddenElements defaults to true and considers hidden file input elements.
|
632
|
+
* If there is only one file input element, it will be used directly.
|
633
|
+
* If there are multiple file input elements, the elementDescription will be used by AI to
|
634
|
+
* select among them.
|
635
|
+
* If no file input elements are found by inspecting the page structure, elementDescription
|
636
|
+
* will be used by AI to try to find a match visually.
|
1594
637
|
*
|
1595
638
|
* @param {string} sessionId - The session id for the window.
|
1596
639
|
* @param {string} windowId - The Airtop window id of the browser window.
|
1597
|
-
* @param {Airtop.
|
640
|
+
* @param {Airtop.SessionFileInputHandlerRequestBody} request
|
1598
641
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
1599
642
|
*
|
1600
643
|
* @example
|
1601
|
-
* await client.windows.
|
1602
|
-
* prompt: "What is the main idea of this page?"
|
1603
|
-
* })
|
644
|
+
* await client.windows.fileInput("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
1604
645
|
*/
|
1605
|
-
|
1606
|
-
return __awaiter(this,
|
646
|
+
fileInput(sessionId_1, windowId_1) {
|
647
|
+
return __awaiter(this, arguments, void 0, function* (sessionId, windowId, request = {}, requestOptions) {
|
1607
648
|
var _a, _b, _c;
|
1608
649
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1609
|
-
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)}/
|
650
|
+
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)}/file-input`),
|
1610
651
|
method: "POST",
|
1611
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
652
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.43", "User-Agent": "@airtop/sdk/0.1.43", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1612
653
|
contentType: "application/json",
|
1613
654
|
requestType: "json",
|
1614
|
-
body: serializers.
|
655
|
+
body: serializers.SessionFileInputHandlerRequestBody.jsonOrThrow(request, {
|
1615
656
|
unrecognizedObjectKeys: "strip",
|
1616
657
|
}),
|
1617
658
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
@@ -1640,7 +681,7 @@ class Windows {
|
|
1640
681
|
body: _response.error.rawBody,
|
1641
682
|
});
|
1642
683
|
case "timeout":
|
1643
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/
|
684
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/file-input.");
|
1644
685
|
case "unknown":
|
1645
686
|
throw new errors.AirtopError({
|
1646
687
|
message: _response.error.errorMessage,
|
@@ -1649,32 +690,34 @@ class Windows {
|
|
1649
690
|
});
|
1650
691
|
}
|
1651
692
|
/**
|
1652
|
-
*
|
693
|
+
* Fill a form of a browser window synchronously using a form-filler automation
|
1653
694
|
*
|
1654
695
|
* @param {string} sessionId - The session id for the window.
|
1655
|
-
* @param {string} windowId - The Airtop window id of the browser window
|
1656
|
-
* @param {Airtop.
|
696
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
697
|
+
* @param {Airtop.FillFormRequest} request
|
1657
698
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
1658
699
|
*
|
1659
700
|
* @example
|
1660
|
-
* await client.windows.
|
701
|
+
* await client.windows.fillForm("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
702
|
+
* automationId: "automationId"
|
703
|
+
* })
|
1661
704
|
*/
|
1662
|
-
|
1663
|
-
return __awaiter(this,
|
705
|
+
fillForm(sessionId, windowId, request, requestOptions) {
|
706
|
+
return __awaiter(this, void 0, void 0, function* () {
|
1664
707
|
var _a, _b, _c;
|
1665
708
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1666
|
-
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)}/
|
709
|
+
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`),
|
1667
710
|
method: "POST",
|
1668
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
711
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.43", "User-Agent": "@airtop/sdk/0.1.43", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1669
712
|
contentType: "application/json",
|
1670
713
|
requestType: "json",
|
1671
|
-
body: serializers.
|
714
|
+
body: serializers.FillFormRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
1672
715
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1673
716
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1674
717
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
1675
718
|
});
|
1676
719
|
if (_response.ok) {
|
1677
|
-
return serializers.
|
720
|
+
return serializers.AiPromptResponse.parseOrThrow(_response.body, {
|
1678
721
|
unrecognizedObjectKeys: "passthrough",
|
1679
722
|
allowUnrecognizedUnionMembers: true,
|
1680
723
|
allowUnrecognizedEnumValues: true,
|
@@ -1695,7 +738,7 @@ class Windows {
|
|
1695
738
|
body: _response.error.rawBody,
|
1696
739
|
});
|
1697
740
|
case "timeout":
|
1698
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/
|
741
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/fill-form.");
|
1699
742
|
case "unknown":
|
1700
743
|
throw new errors.AirtopError({
|
1701
744
|
message: _response.error.errorMessage,
|
@@ -1704,28 +747,28 @@ class Windows {
|
|
1704
747
|
});
|
1705
748
|
}
|
1706
749
|
/**
|
1707
|
-
*
|
750
|
+
* Execute a hover interaction in a specific browser window
|
1708
751
|
*
|
1709
752
|
* @param {string} sessionId - The session id for the window.
|
1710
753
|
* @param {string} windowId - The Airtop window id of the browser window.
|
1711
|
-
* @param {Airtop.
|
754
|
+
* @param {Airtop.SessionHoverHandlerRequestBody} request
|
1712
755
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
1713
756
|
*
|
1714
757
|
* @example
|
1715
|
-
* await client.windows.
|
758
|
+
* await client.windows.hover("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
759
|
+
* elementDescription: "The search box input in the top right corner"
|
760
|
+
* })
|
1716
761
|
*/
|
1717
|
-
|
1718
|
-
return __awaiter(this,
|
762
|
+
hover(sessionId, windowId, request, requestOptions) {
|
763
|
+
return __awaiter(this, void 0, void 0, function* () {
|
1719
764
|
var _a, _b, _c;
|
1720
765
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1721
|
-
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)}/
|
766
|
+
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`),
|
1722
767
|
method: "POST",
|
1723
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
768
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.43", "User-Agent": "@airtop/sdk/0.1.43", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1724
769
|
contentType: "application/json",
|
1725
770
|
requestType: "json",
|
1726
|
-
body: serializers.
|
1727
|
-
unrecognizedObjectKeys: "strip",
|
1728
|
-
}),
|
771
|
+
body: serializers.SessionHoverHandlerRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
1729
772
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1730
773
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1731
774
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
@@ -1752,7 +795,7 @@ class Windows {
|
|
1752
795
|
body: _response.error.rawBody,
|
1753
796
|
});
|
1754
797
|
case "timeout":
|
1755
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/
|
798
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/hover.");
|
1756
799
|
case "unknown":
|
1757
800
|
throw new errors.AirtopError({
|
1758
801
|
message: _response.error.errorMessage,
|
@@ -1761,26 +804,28 @@ class Windows {
|
|
1761
804
|
});
|
1762
805
|
}
|
1763
806
|
/**
|
1764
|
-
* Execute a scroll interaction in a specific browser window
|
1765
|
-
*
|
1766
807
|
* @param {string} sessionId - The session id for the window.
|
1767
808
|
* @param {string} windowId - The Airtop window id of the browser window.
|
1768
|
-
* @param {Airtop.
|
809
|
+
* @param {Airtop.SessionMonitorHandlerRequestBody} request
|
1769
810
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
1770
811
|
*
|
1771
812
|
* @example
|
1772
|
-
* await client.windows.
|
813
|
+
* await client.windows.monitor("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
814
|
+
* condition: "Determine if the user appears to be signed in to the website"
|
815
|
+
* })
|
1773
816
|
*/
|
1774
|
-
|
1775
|
-
return __awaiter(this,
|
817
|
+
monitor(sessionId, windowId, request, requestOptions) {
|
818
|
+
return __awaiter(this, void 0, void 0, function* () {
|
1776
819
|
var _a, _b, _c;
|
1777
820
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1778
|
-
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)}/
|
821
|
+
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`),
|
1779
822
|
method: "POST",
|
1780
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
823
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.43", "User-Agent": "@airtop/sdk/0.1.43", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1781
824
|
contentType: "application/json",
|
1782
825
|
requestType: "json",
|
1783
|
-
body: serializers.
|
826
|
+
body: serializers.SessionMonitorHandlerRequestBody.jsonOrThrow(request, {
|
827
|
+
unrecognizedObjectKeys: "strip",
|
828
|
+
}),
|
1784
829
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1785
830
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1786
831
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
@@ -1807,7 +852,7 @@ class Windows {
|
|
1807
852
|
body: _response.error.rawBody,
|
1808
853
|
});
|
1809
854
|
case "timeout":
|
1810
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/
|
855
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/monitor.");
|
1811
856
|
case "unknown":
|
1812
857
|
throw new errors.AirtopError({
|
1813
858
|
message: _response.error.errorMessage,
|
@@ -1816,26 +861,28 @@ class Windows {
|
|
1816
861
|
});
|
1817
862
|
}
|
1818
863
|
/**
|
1819
|
-
*
|
864
|
+
* 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?).
|
1820
865
|
*
|
1821
866
|
* @param {string} sessionId - The session id for the window.
|
1822
|
-
* @param {string} windowId - The Airtop window id of the browser window
|
1823
|
-
* @param {Airtop.
|
867
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
868
|
+
* @param {Airtop.SessionPageQueryHandlerRequestBody} request
|
1824
869
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
1825
870
|
*
|
1826
871
|
* @example
|
1827
|
-
* await client.windows.
|
872
|
+
* await client.windows.pageQuery("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
873
|
+
* prompt: "What is the main idea of this page?"
|
874
|
+
* })
|
1828
875
|
*/
|
1829
|
-
|
1830
|
-
return __awaiter(this,
|
876
|
+
pageQuery(sessionId, windowId, request, requestOptions) {
|
877
|
+
return __awaiter(this, void 0, void 0, function* () {
|
1831
878
|
var _a, _b, _c;
|
1832
879
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1833
|
-
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)}/
|
880
|
+
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`),
|
1834
881
|
method: "POST",
|
1835
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
882
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.43", "User-Agent": "@airtop/sdk/0.1.43", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1836
883
|
contentType: "application/json",
|
1837
884
|
requestType: "json",
|
1838
|
-
body: serializers.
|
885
|
+
body: serializers.SessionPageQueryHandlerRequestBody.jsonOrThrow(request, {
|
1839
886
|
unrecognizedObjectKeys: "strip",
|
1840
887
|
}),
|
1841
888
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
@@ -1864,7 +911,7 @@ class Windows {
|
|
1864
911
|
body: _response.error.rawBody,
|
1865
912
|
});
|
1866
913
|
case "timeout":
|
1867
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/
|
914
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/page-query.");
|
1868
915
|
case "unknown":
|
1869
916
|
throw new errors.AirtopError({
|
1870
917
|
message: _response.error.errorMessage,
|
@@ -1873,28 +920,30 @@ class Windows {
|
|
1873
920
|
});
|
1874
921
|
}
|
1875
922
|
/**
|
1876
|
-
*
|
923
|
+
* Submit a prompt that queries the content of a specific browser window and paginates through pages to return a list of results.
|
1877
924
|
*
|
1878
925
|
* @param {string} sessionId - The session id for the window.
|
1879
926
|
* @param {string} windowId - The Airtop window id of the browser window.
|
1880
|
-
* @param {Airtop.
|
927
|
+
* @param {Airtop.SessionPaginatedExtractionHandlerRequestBody} request
|
1881
928
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
1882
929
|
*
|
1883
930
|
* @example
|
1884
|
-
* await client.windows.
|
1885
|
-
*
|
931
|
+
* await client.windows.paginatedExtraction("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
932
|
+
* 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."
|
1886
933
|
* })
|
1887
934
|
*/
|
1888
|
-
|
935
|
+
paginatedExtraction(sessionId, windowId, request, requestOptions) {
|
1889
936
|
return __awaiter(this, void 0, void 0, function* () {
|
1890
937
|
var _a, _b, _c;
|
1891
938
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1892
|
-
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)}/
|
939
|
+
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`),
|
1893
940
|
method: "POST",
|
1894
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
941
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.43", "User-Agent": "@airtop/sdk/0.1.43", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1895
942
|
contentType: "application/json",
|
1896
943
|
requestType: "json",
|
1897
|
-
body: serializers.
|
944
|
+
body: serializers.SessionPaginatedExtractionHandlerRequestBody.jsonOrThrow(request, {
|
945
|
+
unrecognizedObjectKeys: "strip",
|
946
|
+
}),
|
1898
947
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1899
948
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1900
949
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
@@ -1921,7 +970,7 @@ class Windows {
|
|
1921
970
|
body: _response.error.rawBody,
|
1922
971
|
});
|
1923
972
|
case "timeout":
|
1924
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/
|
973
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/paginated-extraction.");
|
1925
974
|
case "unknown":
|
1926
975
|
throw new errors.AirtopError({
|
1927
976
|
message: _response.error.errorMessage,
|
@@ -1930,35 +979,36 @@ class Windows {
|
|
1930
979
|
});
|
1931
980
|
}
|
1932
981
|
/**
|
1933
|
-
*
|
982
|
+
* This endpoint is deprecated. Please use the `pageQuery` endpoint instead.
|
1934
983
|
*
|
1935
984
|
* @param {string} sessionId - The session id for the window.
|
1936
985
|
* @param {string} windowId - The Airtop window id of the browser window.
|
1937
|
-
* @param {Airtop.
|
986
|
+
* @param {Airtop.SessionPageQueryHandlerRequestBody} request
|
1938
987
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
1939
988
|
*
|
1940
989
|
* @example
|
1941
|
-
* await client.windows.
|
1942
|
-
*
|
1943
|
-
* prompt: "Click the login button"
|
990
|
+
* await client.windows.promptContent("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
991
|
+
* prompt: "What is the main idea of this page?"
|
1944
992
|
* })
|
1945
993
|
*/
|
1946
|
-
|
994
|
+
promptContent(sessionId, windowId, request, requestOptions) {
|
1947
995
|
return __awaiter(this, void 0, void 0, function* () {
|
1948
996
|
var _a, _b, _c;
|
1949
997
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1950
|
-
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, `
|
998
|
+
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`),
|
1951
999
|
method: "POST",
|
1952
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1000
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.43", "User-Agent": "@airtop/sdk/0.1.43", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1953
1001
|
contentType: "application/json",
|
1954
1002
|
requestType: "json",
|
1955
|
-
body: serializers.
|
1003
|
+
body: serializers.SessionPageQueryHandlerRequestBody.jsonOrThrow(request, {
|
1004
|
+
unrecognizedObjectKeys: "strip",
|
1005
|
+
}),
|
1956
1006
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1957
1007
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1958
1008
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
1959
1009
|
});
|
1960
1010
|
if (_response.ok) {
|
1961
|
-
return serializers.
|
1011
|
+
return serializers.AiPromptResponse.parseOrThrow(_response.body, {
|
1962
1012
|
unrecognizedObjectKeys: "passthrough",
|
1963
1013
|
allowUnrecognizedUnionMembers: true,
|
1964
1014
|
allowUnrecognizedEnumValues: true,
|
@@ -1979,7 +1029,7 @@ class Windows {
|
|
1979
1029
|
body: _response.error.rawBody,
|
1980
1030
|
});
|
1981
1031
|
case "timeout":
|
1982
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /
|
1032
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/prompt-content.");
|
1983
1033
|
case "unknown":
|
1984
1034
|
throw new errors.AirtopError({
|
1985
1035
|
message: _response.error.errorMessage,
|
@@ -1988,35 +1038,32 @@ class Windows {
|
|
1988
1038
|
});
|
1989
1039
|
}
|
1990
1040
|
/**
|
1991
|
-
*
|
1041
|
+
* Scrape a window and return the content as markdown
|
1992
1042
|
*
|
1993
1043
|
* @param {string} sessionId - The session id for the window.
|
1994
|
-
* @param {string} windowId - The Airtop window id of the browser window.
|
1995
|
-
* @param {Airtop.
|
1044
|
+
* @param {string} windowId - The Airtop window id of the browser window to scrape.
|
1045
|
+
* @param {Airtop.ScrapeContentRequest} request
|
1996
1046
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
1997
1047
|
*
|
1998
1048
|
* @example
|
1999
|
-
* await client.windows.
|
2000
|
-
* jobId: "123",
|
2001
|
-
* prompt: "Extract all product prices from this page"
|
2002
|
-
* })
|
1049
|
+
* await client.windows.scrapeContent("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
2003
1050
|
*/
|
2004
|
-
|
2005
|
-
return __awaiter(this,
|
1051
|
+
scrapeContent(sessionId_1, windowId_1) {
|
1052
|
+
return __awaiter(this, arguments, void 0, function* (sessionId, windowId, request = {}, requestOptions) {
|
2006
1053
|
var _a, _b, _c;
|
2007
1054
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
2008
|
-
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, `
|
1055
|
+
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`),
|
2009
1056
|
method: "POST",
|
2010
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1057
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.43", "User-Agent": "@airtop/sdk/0.1.43", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
2011
1058
|
contentType: "application/json",
|
2012
1059
|
requestType: "json",
|
2013
|
-
body: serializers.
|
1060
|
+
body: serializers.ScrapeContentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
2014
1061
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
2015
1062
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
2016
1063
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
2017
1064
|
});
|
2018
1065
|
if (_response.ok) {
|
2019
|
-
return serializers.
|
1066
|
+
return serializers.ScrapeResponse.parseOrThrow(_response.body, {
|
2020
1067
|
unrecognizedObjectKeys: "passthrough",
|
2021
1068
|
allowUnrecognizedUnionMembers: true,
|
2022
1069
|
allowUnrecognizedEnumValues: true,
|
@@ -2037,7 +1084,7 @@ class Windows {
|
|
2037
1084
|
body: _response.error.rawBody,
|
2038
1085
|
});
|
2039
1086
|
case "timeout":
|
2040
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /
|
1087
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/scrape-content.");
|
2041
1088
|
case "unknown":
|
2042
1089
|
throw new errors.AirtopError({
|
2043
1090
|
message: _response.error.errorMessage,
|
@@ -2046,35 +1093,34 @@ class Windows {
|
|
2046
1093
|
});
|
2047
1094
|
}
|
2048
1095
|
/**
|
2049
|
-
*
|
1096
|
+
* Take a screenshot of a browser window
|
2050
1097
|
*
|
2051
1098
|
* @param {string} sessionId - The session id for the window.
|
2052
1099
|
* @param {string} windowId - The Airtop window id of the browser window.
|
2053
|
-
* @param {Airtop.
|
1100
|
+
* @param {Airtop.SessionScreenshotHandlerRequestBody} request
|
2054
1101
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
2055
1102
|
*
|
2056
1103
|
* @example
|
2057
|
-
* await client.windows.
|
2058
|
-
* jobId: "123",
|
2059
|
-
* prompt: "Find all the news articles"
|
2060
|
-
* })
|
1104
|
+
* await client.windows.screenshot("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
2061
1105
|
*/
|
2062
|
-
|
2063
|
-
return __awaiter(this,
|
1106
|
+
screenshot(sessionId_1, windowId_1) {
|
1107
|
+
return __awaiter(this, arguments, void 0, function* (sessionId, windowId, request = {}, requestOptions) {
|
2064
1108
|
var _a, _b, _c;
|
2065
1109
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
2066
|
-
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, `
|
1110
|
+
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`),
|
2067
1111
|
method: "POST",
|
2068
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1112
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.43", "User-Agent": "@airtop/sdk/0.1.43", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
2069
1113
|
contentType: "application/json",
|
2070
1114
|
requestType: "json",
|
2071
|
-
body: serializers.
|
1115
|
+
body: serializers.SessionScreenshotHandlerRequestBody.jsonOrThrow(request, {
|
1116
|
+
unrecognizedObjectKeys: "strip",
|
1117
|
+
}),
|
2072
1118
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
2073
1119
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
2074
1120
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
2075
1121
|
});
|
2076
1122
|
if (_response.ok) {
|
2077
|
-
return serializers.
|
1123
|
+
return serializers.AiPromptResponse.parseOrThrow(_response.body, {
|
2078
1124
|
unrecognizedObjectKeys: "passthrough",
|
2079
1125
|
allowUnrecognizedUnionMembers: true,
|
2080
1126
|
allowUnrecognizedEnumValues: true,
|
@@ -2095,7 +1141,7 @@ class Windows {
|
|
2095
1141
|
body: _response.error.rawBody,
|
2096
1142
|
});
|
2097
1143
|
case "timeout":
|
2098
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /
|
1144
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/screenshot.");
|
2099
1145
|
case "unknown":
|
2100
1146
|
throw new errors.AirtopError({
|
2101
1147
|
message: _response.error.errorMessage,
|
@@ -2104,35 +1150,32 @@ class Windows {
|
|
2104
1150
|
});
|
2105
1151
|
}
|
2106
1152
|
/**
|
2107
|
-
*
|
1153
|
+
* Execute a scroll interaction in a specific browser window
|
2108
1154
|
*
|
2109
1155
|
* @param {string} sessionId - The session id for the window.
|
2110
1156
|
* @param {string} windowId - The Airtop window id of the browser window.
|
2111
|
-
* @param {Airtop.
|
1157
|
+
* @param {Airtop.SessionScrollHandlerRequestBody} request
|
2112
1158
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
2113
1159
|
*
|
2114
1160
|
* @example
|
2115
|
-
* await client.windows.
|
2116
|
-
* jobId: "123",
|
2117
|
-
* prompt: "Find the login button"
|
2118
|
-
* })
|
1161
|
+
* await client.windows.scroll("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
2119
1162
|
*/
|
2120
|
-
|
2121
|
-
return __awaiter(this,
|
1163
|
+
scroll(sessionId_1, windowId_1) {
|
1164
|
+
return __awaiter(this, arguments, void 0, function* (sessionId, windowId, request = {}, requestOptions) {
|
2122
1165
|
var _a, _b, _c;
|
2123
1166
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
2124
|
-
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, `
|
1167
|
+
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`),
|
2125
1168
|
method: "POST",
|
2126
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1169
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.43", "User-Agent": "@airtop/sdk/0.1.43", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
2127
1170
|
contentType: "application/json",
|
2128
1171
|
requestType: "json",
|
2129
|
-
body: serializers.
|
1172
|
+
body: serializers.SessionScrollHandlerRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
2130
1173
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
2131
1174
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
2132
1175
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
2133
1176
|
});
|
2134
1177
|
if (_response.ok) {
|
2135
|
-
return serializers.
|
1178
|
+
return serializers.AiPromptResponse.parseOrThrow(_response.body, {
|
2136
1179
|
unrecognizedObjectKeys: "passthrough",
|
2137
1180
|
allowUnrecognizedUnionMembers: true,
|
2138
1181
|
allowUnrecognizedEnumValues: true,
|
@@ -2153,7 +1196,7 @@ class Windows {
|
|
2153
1196
|
body: _response.error.rawBody,
|
2154
1197
|
});
|
2155
1198
|
case "timeout":
|
2156
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /
|
1199
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/scroll.");
|
2157
1200
|
case "unknown":
|
2158
1201
|
throw new errors.AirtopError({
|
2159
1202
|
message: _response.error.errorMessage,
|
@@ -2162,34 +1205,34 @@ class Windows {
|
|
2162
1205
|
});
|
2163
1206
|
}
|
2164
1207
|
/**
|
2165
|
-
*
|
1208
|
+
* This endpoint is deprecated. Please use the `pageQuery` endpoint and ask for a summary in the prompt instead.
|
2166
1209
|
*
|
2167
1210
|
* @param {string} sessionId - The session id for the window.
|
2168
|
-
* @param {string} windowId - The Airtop window id of the browser window.
|
2169
|
-
* @param {Airtop.
|
1211
|
+
* @param {string} windowId - The Airtop window id of the browser window to summarize.
|
1212
|
+
* @param {Airtop.SessionSummaryHandlerRequestBody} request
|
2170
1213
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
2171
1214
|
*
|
2172
1215
|
* @example
|
2173
|
-
* await client.windows.
|
2174
|
-
* prompt: "Tell me about this webpage"
|
2175
|
-
* })
|
1216
|
+
* await client.windows.summarizeContent("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
2176
1217
|
*/
|
2177
|
-
|
2178
|
-
return __awaiter(this,
|
1218
|
+
summarizeContent(sessionId_1, windowId_1) {
|
1219
|
+
return __awaiter(this, arguments, void 0, function* (sessionId, windowId, request = {}, requestOptions) {
|
2179
1220
|
var _a, _b, _c;
|
2180
1221
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
2181
|
-
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, `
|
1222
|
+
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`),
|
2182
1223
|
method: "POST",
|
2183
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1224
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.43", "User-Agent": "@airtop/sdk/0.1.43", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
2184
1225
|
contentType: "application/json",
|
2185
1226
|
requestType: "json",
|
2186
|
-
body: serializers.
|
1227
|
+
body: serializers.SessionSummaryHandlerRequestBody.jsonOrThrow(request, {
|
1228
|
+
unrecognizedObjectKeys: "strip",
|
1229
|
+
}),
|
2187
1230
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
2188
1231
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
2189
1232
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
2190
1233
|
});
|
2191
1234
|
if (_response.ok) {
|
2192
|
-
return serializers.
|
1235
|
+
return serializers.AiPromptResponse.parseOrThrow(_response.body, {
|
2193
1236
|
unrecognizedObjectKeys: "passthrough",
|
2194
1237
|
allowUnrecognizedUnionMembers: true,
|
2195
1238
|
allowUnrecognizedEnumValues: true,
|
@@ -2210,7 +1253,7 @@ class Windows {
|
|
2210
1253
|
body: _response.error.rawBody,
|
2211
1254
|
});
|
2212
1255
|
case "timeout":
|
2213
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /
|
1256
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/summarize-content.");
|
2214
1257
|
case "unknown":
|
2215
1258
|
throw new errors.AirtopError({
|
2216
1259
|
message: _response.error.errorMessage,
|
@@ -2219,32 +1262,34 @@ class Windows {
|
|
2219
1262
|
});
|
2220
1263
|
}
|
2221
1264
|
/**
|
2222
|
-
*
|
1265
|
+
* Execute a type interaction in a specific browser window
|
2223
1266
|
*
|
2224
1267
|
* @param {string} sessionId - The session id for the window.
|
2225
1268
|
* @param {string} windowId - The Airtop window id of the browser window.
|
2226
|
-
* @param {Airtop.
|
1269
|
+
* @param {Airtop.SessionTypeHandlerRequestBody} request
|
2227
1270
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
2228
1271
|
*
|
2229
1272
|
* @example
|
2230
|
-
* await client.windows.
|
1273
|
+
* await client.windows.type("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
1274
|
+
* text: "Example text"
|
1275
|
+
* })
|
2231
1276
|
*/
|
2232
|
-
|
2233
|
-
return __awaiter(this,
|
1277
|
+
type(sessionId, windowId, request, requestOptions) {
|
1278
|
+
return __awaiter(this, void 0, void 0, function* () {
|
2234
1279
|
var _a, _b, _c;
|
2235
1280
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
2236
|
-
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, `
|
1281
|
+
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`),
|
2237
1282
|
method: "POST",
|
2238
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1283
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.43", "User-Agent": "@airtop/sdk/0.1.43", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
2239
1284
|
contentType: "application/json",
|
2240
1285
|
requestType: "json",
|
2241
|
-
body: serializers.
|
1286
|
+
body: serializers.SessionTypeHandlerRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
2242
1287
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
2243
1288
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
2244
1289
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
2245
1290
|
});
|
2246
1291
|
if (_response.ok) {
|
2247
|
-
return serializers.
|
1292
|
+
return serializers.AiPromptResponse.parseOrThrow(_response.body, {
|
2248
1293
|
unrecognizedObjectKeys: "passthrough",
|
2249
1294
|
allowUnrecognizedUnionMembers: true,
|
2250
1295
|
allowUnrecognizedEnumValues: true,
|
@@ -2265,7 +1310,7 @@ class Windows {
|
|
2265
1310
|
body: _response.error.rawBody,
|
2266
1311
|
});
|
2267
1312
|
case "timeout":
|
2268
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /
|
1313
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/type.");
|
2269
1314
|
case "unknown":
|
2270
1315
|
throw new errors.AirtopError({
|
2271
1316
|
message: _response.error.errorMessage,
|