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