@airtop/sdk 0.1.13 → 0.1.15-beta0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Client.d.ts +3 -0
- package/Client.js +7 -2
- package/README.md +8 -6
- package/api/resources/index.d.ts +1 -0
- package/api/resources/index.js +2 -1
- package/api/resources/profiles/client/Client.d.ts +0 -10
- package/api/resources/profiles/client/Client.js +2 -82
- package/api/resources/profiles/client/requests/index.d.ts +0 -1
- package/api/resources/requests/client/Client.d.ts +34 -0
- package/api/resources/requests/client/Client.js +115 -0
- package/api/resources/requests/client/index.d.ts +1 -0
- package/api/resources/requests/client/index.js +2 -0
- package/api/resources/requests/index.d.ts +1 -0
- package/api/resources/requests/index.js +17 -0
- package/api/resources/sessions/client/Client.js +12 -12
- package/api/resources/windows/client/Client.d.ts +148 -0
- package/api/resources/windows/client/Client.js +737 -24
- package/api/resources/windows/client/requests/AsyncClickRequest.d.ts +29 -0
- package/api/resources/windows/client/requests/AsyncHoverRequest.d.ts +25 -0
- package/api/resources/windows/client/requests/AsyncMonitorRequest.d.ts +27 -0
- package/api/resources/windows/client/requests/AsyncPageQueryRequest.d.ts +29 -0
- package/api/resources/windows/client/requests/AsyncPaginatedExtractionRequest.d.ts +25 -0
- package/api/resources/windows/client/requests/AsyncPromptContentRequest.d.ts +29 -0
- package/api/resources/windows/client/requests/AsyncScreenshotRequest.d.ts +23 -0
- package/api/resources/windows/client/requests/AsyncScreenshotRequest.js +5 -0
- package/api/resources/windows/client/requests/AsyncSummarizeContentRequest.d.ts +25 -0
- package/api/resources/windows/client/requests/AsyncSummarizeContentRequest.js +5 -0
- package/api/resources/windows/client/requests/AsyncTypeRequest.d.ts +37 -0
- package/api/resources/windows/client/requests/AsyncTypeRequest.js +5 -0
- package/api/resources/windows/client/requests/SessionMonitorHandlerRequestBody.d.ts +25 -0
- package/api/resources/windows/client/requests/SessionMonitorHandlerRequestBody.js +5 -0
- package/api/resources/windows/client/requests/SessionScreenshotHandlerRequestBody.d.ts +21 -0
- package/api/resources/windows/client/requests/SessionScreenshotHandlerRequestBody.js +5 -0
- package/api/resources/windows/client/requests/SessionTypeHandlerRequestBody.d.ts +4 -0
- package/api/resources/windows/client/requests/index.d.ts +11 -0
- package/api/types/AsyncConfig.d.ts +7 -0
- package/api/types/AsyncConfig.js +5 -0
- package/api/types/{ProfilesResponse.d.ts → AsyncSessionAiResponseEnvelope.d.ts} +2 -3
- package/api/types/AsyncSessionAiResponseEnvelope.js +5 -0
- package/api/types/BrowserWaitSelectorConfig.d.ts +11 -0
- package/api/types/BrowserWaitSelectorConfig.js +5 -0
- package/api/types/ExternalSessionAiResponseMetadata.d.ts +2 -0
- package/api/types/IntervalMonitorConfig.d.ts +9 -0
- package/api/types/IntervalMonitorConfig.js +5 -0
- package/api/types/MonitorConfig.d.ts +14 -0
- package/api/types/MonitorConfig.js +5 -0
- package/api/types/MonitorConfigIncludeVisualAnalysis.d.ts +12 -0
- package/api/types/MonitorConfigIncludeVisualAnalysis.js +11 -0
- package/api/types/MonitorConfigMonitorType.d.ts +11 -0
- package/api/types/MonitorConfigMonitorType.js +10 -0
- package/api/types/RequestStatusResponse.d.ts +8 -0
- package/api/types/RequestStatusResponse.js +5 -0
- package/api/types/ScreenshotConfig.d.ts +13 -0
- package/api/types/ScreenshotConfig.js +5 -0
- package/api/types/ScreenshotMetadata.d.ts +7 -0
- package/api/types/ScreenshotMetadata.js +5 -0
- package/api/types/ScreenshotRequestConfig.d.ts +8 -0
- package/api/types/ScreenshotRequestConfig.js +5 -0
- package/api/types/VisualAnalysisConfig.d.ts +5 -1
- package/api/types/VisualAnalysisConfigScope.d.ts +4 -2
- package/api/types/VisualAnalysisConfigScope.js +2 -0
- package/api/types/index.d.ts +11 -2
- package/api/types/index.js +11 -2
- package/dist/Client.d.ts +3 -0
- package/dist/Client.js +7 -2
- package/dist/api/resources/index.d.ts +1 -0
- package/dist/api/resources/index.js +2 -1
- package/dist/api/resources/profiles/client/Client.d.ts +0 -10
- package/dist/api/resources/profiles/client/Client.js +2 -82
- package/dist/api/resources/profiles/client/requests/index.d.ts +0 -1
- package/dist/api/resources/requests/client/Client.d.ts +34 -0
- package/dist/api/resources/requests/client/Client.js +115 -0
- package/dist/api/resources/requests/client/index.d.ts +1 -0
- package/dist/api/resources/requests/client/index.js +2 -0
- package/dist/api/resources/requests/index.d.ts +1 -0
- package/dist/api/resources/requests/index.js +17 -0
- package/dist/api/resources/sessions/client/Client.js +12 -12
- package/dist/api/resources/windows/client/Client.d.ts +148 -0
- package/dist/api/resources/windows/client/Client.js +737 -24
- package/dist/api/resources/windows/client/requests/AsyncClickRequest.d.ts +29 -0
- package/dist/api/resources/windows/client/requests/AsyncClickRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/AsyncHoverRequest.d.ts +25 -0
- package/dist/api/resources/windows/client/requests/AsyncHoverRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/AsyncMonitorRequest.d.ts +27 -0
- package/dist/api/resources/windows/client/requests/AsyncMonitorRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/AsyncPageQueryRequest.d.ts +29 -0
- package/dist/api/resources/windows/client/requests/AsyncPageQueryRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/AsyncPaginatedExtractionRequest.d.ts +25 -0
- package/dist/api/resources/windows/client/requests/AsyncPaginatedExtractionRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/AsyncPromptContentRequest.d.ts +29 -0
- package/dist/api/resources/windows/client/requests/AsyncPromptContentRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/AsyncScreenshotRequest.d.ts +23 -0
- package/dist/api/resources/windows/client/requests/AsyncScreenshotRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/AsyncSummarizeContentRequest.d.ts +25 -0
- package/dist/api/resources/windows/client/requests/AsyncSummarizeContentRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/AsyncTypeRequest.d.ts +37 -0
- package/dist/api/resources/windows/client/requests/AsyncTypeRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/SessionMonitorHandlerRequestBody.d.ts +25 -0
- package/dist/api/resources/windows/client/requests/SessionMonitorHandlerRequestBody.js +5 -0
- package/dist/api/resources/windows/client/requests/SessionScreenshotHandlerRequestBody.d.ts +21 -0
- package/dist/api/resources/windows/client/requests/SessionScreenshotHandlerRequestBody.js +5 -0
- package/dist/api/resources/windows/client/requests/SessionTypeHandlerRequestBody.d.ts +4 -0
- package/dist/api/resources/windows/client/requests/index.d.ts +11 -0
- package/dist/api/types/AsyncConfig.d.ts +7 -0
- package/dist/api/types/AsyncConfig.js +5 -0
- package/dist/api/types/{ProfilesResponse.d.ts → AsyncSessionAiResponseEnvelope.d.ts} +2 -3
- package/dist/api/types/AsyncSessionAiResponseEnvelope.js +5 -0
- package/dist/api/types/BrowserWaitSelectorConfig.d.ts +11 -0
- package/dist/api/types/BrowserWaitSelectorConfig.js +5 -0
- package/dist/api/types/ExternalSessionAiResponseMetadata.d.ts +2 -0
- package/dist/api/types/IntervalMonitorConfig.d.ts +9 -0
- package/dist/api/types/IntervalMonitorConfig.js +5 -0
- package/dist/api/types/MonitorConfig.d.ts +14 -0
- package/dist/api/types/MonitorConfig.js +5 -0
- package/dist/api/types/MonitorConfigIncludeVisualAnalysis.d.ts +12 -0
- package/dist/api/types/MonitorConfigIncludeVisualAnalysis.js +11 -0
- package/dist/api/types/MonitorConfigMonitorType.d.ts +11 -0
- package/dist/api/types/MonitorConfigMonitorType.js +10 -0
- package/dist/api/types/RequestStatusResponse.d.ts +8 -0
- package/dist/api/types/RequestStatusResponse.js +5 -0
- package/dist/api/types/ScreenshotConfig.d.ts +13 -0
- package/dist/api/types/ScreenshotConfig.js +5 -0
- package/dist/api/types/ScreenshotMetadata.d.ts +7 -0
- package/dist/api/types/ScreenshotMetadata.js +5 -0
- package/dist/api/types/ScreenshotRequestConfig.d.ts +8 -0
- package/dist/api/types/ScreenshotRequestConfig.js +5 -0
- package/dist/api/types/VisualAnalysisConfig.d.ts +5 -1
- package/dist/api/types/VisualAnalysisConfigScope.d.ts +4 -2
- package/dist/api/types/VisualAnalysisConfigScope.js +2 -0
- package/dist/api/types/index.d.ts +11 -2
- package/dist/api/types/index.js +11 -2
- package/dist/serialization/resources/windows/client/requests/AsyncClickRequest.d.ts +20 -0
- package/dist/serialization/resources/windows/client/requests/AsyncClickRequest.js +41 -0
- package/dist/serialization/resources/windows/client/requests/AsyncHoverRequest.d.ts +19 -0
- package/dist/serialization/resources/windows/client/requests/AsyncHoverRequest.js +40 -0
- package/dist/serialization/resources/windows/client/requests/AsyncMonitorRequest.d.ts +20 -0
- package/dist/serialization/resources/windows/client/requests/AsyncMonitorRequest.js +41 -0
- package/dist/serialization/resources/windows/client/requests/AsyncPageQueryRequest.d.ts +20 -0
- package/dist/serialization/resources/windows/client/requests/AsyncPageQueryRequest.js +41 -0
- package/dist/serialization/resources/windows/client/requests/AsyncPaginatedExtractionRequest.d.ts +19 -0
- package/dist/serialization/resources/windows/client/requests/AsyncPaginatedExtractionRequest.js +40 -0
- package/dist/serialization/resources/windows/client/requests/AsyncPromptContentRequest.d.ts +20 -0
- package/dist/serialization/resources/windows/client/requests/AsyncPromptContentRequest.js +41 -0
- package/dist/serialization/resources/windows/client/requests/AsyncScreenshotRequest.d.ts +18 -0
- package/dist/serialization/resources/windows/client/requests/AsyncScreenshotRequest.js +39 -0
- package/dist/serialization/resources/windows/client/requests/AsyncSummarizeContentRequest.d.ts +19 -0
- package/dist/serialization/resources/windows/client/requests/AsyncSummarizeContentRequest.js +40 -0
- package/dist/serialization/resources/windows/client/requests/AsyncTypeRequest.d.ts +24 -0
- package/dist/serialization/resources/windows/client/requests/AsyncTypeRequest.js +45 -0
- package/dist/serialization/resources/windows/client/requests/SessionMonitorHandlerRequestBody.d.ts +18 -0
- package/dist/serialization/resources/windows/client/requests/SessionMonitorHandlerRequestBody.js +39 -0
- package/dist/serialization/resources/windows/client/requests/SessionScreenshotHandlerRequestBody.d.ts +16 -0
- package/dist/serialization/resources/windows/client/requests/SessionScreenshotHandlerRequestBody.js +37 -0
- package/dist/serialization/resources/windows/client/requests/SessionTypeHandlerRequestBody.d.ts +2 -0
- package/dist/serialization/resources/windows/client/requests/SessionTypeHandlerRequestBody.js +2 -0
- package/dist/serialization/resources/windows/client/requests/index.d.ts +11 -0
- package/dist/serialization/resources/windows/client/requests/index.js +23 -1
- package/dist/serialization/types/AsyncConfig.d.ts +12 -0
- package/dist/serialization/types/{ExternalProfileV1.js → AsyncConfig.js} +3 -5
- package/dist/serialization/types/AsyncSessionAiResponseEnvelope.d.ts +15 -0
- package/dist/serialization/types/{ProfilesResponse.js → AsyncSessionAiResponseEnvelope.js} +3 -6
- package/dist/serialization/types/BrowserWaitSelectorConfig.d.ts +14 -0
- package/dist/serialization/types/BrowserWaitSelectorConfig.js +35 -0
- package/dist/serialization/types/ExternalSessionAiResponseMetadata.d.ts +2 -0
- package/dist/serialization/types/ExternalSessionAiResponseMetadata.js +2 -0
- package/dist/serialization/types/IntervalMonitorConfig.d.ts +13 -0
- package/{serialization/types/ExternalProfileV1.js → dist/serialization/types/IntervalMonitorConfig.js} +4 -5
- package/dist/serialization/types/MonitorConfig.d.ts +19 -0
- package/dist/serialization/types/MonitorConfig.js +40 -0
- package/dist/serialization/types/MonitorConfigIncludeVisualAnalysis.d.ts +10 -0
- package/dist/serialization/types/MonitorConfigIncludeVisualAnalysis.js +31 -0
- package/dist/serialization/types/MonitorConfigMonitorType.d.ts +10 -0
- package/dist/serialization/types/MonitorConfigMonitorType.js +31 -0
- package/dist/serialization/types/RequestStatusResponse.d.ts +13 -0
- package/dist/serialization/types/RequestStatusResponse.js +34 -0
- package/dist/serialization/types/ScreenshotConfig.d.ts +15 -0
- package/dist/serialization/types/ScreenshotConfig.js +36 -0
- package/dist/serialization/types/ScreenshotMetadata.d.ts +12 -0
- package/dist/serialization/types/ScreenshotMetadata.js +33 -0
- package/dist/serialization/types/ScreenshotRequestConfig.d.ts +13 -0
- package/dist/serialization/types/ScreenshotRequestConfig.js +34 -0
- package/dist/serialization/types/VisualAnalysisConfig.d.ts +2 -0
- package/dist/serialization/types/VisualAnalysisConfig.js +2 -0
- package/dist/serialization/types/VisualAnalysisConfigScope.d.ts +1 -1
- package/dist/serialization/types/VisualAnalysisConfigScope.js +1 -1
- package/dist/serialization/types/index.d.ts +11 -2
- package/dist/serialization/types/index.js +11 -2
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/process-screenshots.d.ts +10 -0
- package/dist/utils/process-screenshots.js +59 -0
- package/dist/wrapper/AirtopWindows.d.ts +10 -0
- package/dist/wrapper/AirtopWindows.js +17 -0
- package/package.json +1 -1
- package/reference.md +982 -48
- package/serialization/resources/windows/client/requests/AsyncClickRequest.d.ts +20 -0
- package/serialization/resources/windows/client/requests/AsyncClickRequest.js +41 -0
- package/serialization/resources/windows/client/requests/AsyncHoverRequest.d.ts +19 -0
- package/serialization/resources/windows/client/requests/AsyncHoverRequest.js +40 -0
- package/serialization/resources/windows/client/requests/AsyncMonitorRequest.d.ts +20 -0
- package/serialization/resources/windows/client/requests/AsyncMonitorRequest.js +41 -0
- package/serialization/resources/windows/client/requests/AsyncPageQueryRequest.d.ts +20 -0
- package/serialization/resources/windows/client/requests/AsyncPageQueryRequest.js +41 -0
- package/serialization/resources/windows/client/requests/AsyncPaginatedExtractionRequest.d.ts +19 -0
- package/serialization/resources/windows/client/requests/AsyncPaginatedExtractionRequest.js +40 -0
- package/serialization/resources/windows/client/requests/AsyncPromptContentRequest.d.ts +20 -0
- package/serialization/resources/windows/client/requests/AsyncPromptContentRequest.js +41 -0
- package/serialization/resources/windows/client/requests/AsyncScreenshotRequest.d.ts +18 -0
- package/serialization/resources/windows/client/requests/AsyncScreenshotRequest.js +39 -0
- package/serialization/resources/windows/client/requests/AsyncSummarizeContentRequest.d.ts +19 -0
- package/serialization/resources/windows/client/requests/AsyncSummarizeContentRequest.js +40 -0
- package/serialization/resources/windows/client/requests/AsyncTypeRequest.d.ts +24 -0
- package/serialization/resources/windows/client/requests/AsyncTypeRequest.js +45 -0
- package/serialization/resources/windows/client/requests/SessionMonitorHandlerRequestBody.d.ts +18 -0
- package/serialization/resources/windows/client/requests/SessionMonitorHandlerRequestBody.js +39 -0
- package/serialization/resources/windows/client/requests/SessionScreenshotHandlerRequestBody.d.ts +16 -0
- package/serialization/resources/windows/client/requests/SessionScreenshotHandlerRequestBody.js +37 -0
- package/serialization/resources/windows/client/requests/SessionTypeHandlerRequestBody.d.ts +2 -0
- package/serialization/resources/windows/client/requests/SessionTypeHandlerRequestBody.js +2 -0
- package/serialization/resources/windows/client/requests/index.d.ts +11 -0
- package/serialization/resources/windows/client/requests/index.js +23 -1
- package/serialization/types/AsyncConfig.d.ts +12 -0
- package/serialization/types/AsyncConfig.js +33 -0
- package/serialization/types/AsyncSessionAiResponseEnvelope.d.ts +15 -0
- package/serialization/types/{ProfilesResponse.js → AsyncSessionAiResponseEnvelope.js} +3 -6
- package/serialization/types/BrowserWaitSelectorConfig.d.ts +14 -0
- package/serialization/types/BrowserWaitSelectorConfig.js +35 -0
- package/serialization/types/ExternalSessionAiResponseMetadata.d.ts +2 -0
- package/serialization/types/ExternalSessionAiResponseMetadata.js +2 -0
- package/serialization/types/IntervalMonitorConfig.d.ts +13 -0
- package/serialization/types/IntervalMonitorConfig.js +34 -0
- package/serialization/types/MonitorConfig.d.ts +19 -0
- package/serialization/types/MonitorConfig.js +40 -0
- package/serialization/types/MonitorConfigIncludeVisualAnalysis.d.ts +10 -0
- package/serialization/types/MonitorConfigIncludeVisualAnalysis.js +31 -0
- package/serialization/types/MonitorConfigMonitorType.d.ts +10 -0
- package/serialization/types/MonitorConfigMonitorType.js +31 -0
- package/serialization/types/RequestStatusResponse.d.ts +13 -0
- package/serialization/types/RequestStatusResponse.js +34 -0
- package/serialization/types/ScreenshotConfig.d.ts +15 -0
- package/serialization/types/ScreenshotConfig.js +36 -0
- package/serialization/types/ScreenshotMetadata.d.ts +12 -0
- package/serialization/types/ScreenshotMetadata.js +33 -0
- package/serialization/types/ScreenshotRequestConfig.d.ts +13 -0
- package/serialization/types/ScreenshotRequestConfig.js +34 -0
- package/serialization/types/VisualAnalysisConfig.d.ts +2 -0
- package/serialization/types/VisualAnalysisConfig.js +2 -0
- package/serialization/types/VisualAnalysisConfigScope.d.ts +1 -1
- package/serialization/types/VisualAnalysisConfigScope.js +1 -1
- package/serialization/types/index.d.ts +11 -2
- package/serialization/types/index.js +11 -2
- package/utils/index.d.ts +1 -0
- package/utils/index.js +1 -0
- package/utils/process-screenshots.d.ts +10 -0
- package/utils/process-screenshots.js +59 -0
- package/wrapper/AirtopWindows.d.ts +10 -0
- package/wrapper/AirtopWindows.js +17 -0
- package/api/resources/profiles/client/requests/ProfilesGetRequest.d.ts +0 -17
- package/api/types/ExternalProfileV1.d.ts +0 -11
- package/dist/api/resources/profiles/client/requests/ProfilesGetRequest.d.ts +0 -17
- package/dist/api/types/ExternalProfileV1.d.ts +0 -11
- package/dist/serialization/types/ExternalProfileV1.d.ts +0 -14
- package/dist/serialization/types/ProfilesResponse.d.ts +0 -18
- package/serialization/types/ExternalProfileV1.d.ts +0 -14
- package/serialization/types/ProfilesResponse.d.ts +0 -18
- /package/api/resources/{profiles/client/requests/ProfilesGetRequest.js → windows/client/requests/AsyncClickRequest.js} +0 -0
- /package/api/{types/ExternalProfileV1.js → resources/windows/client/requests/AsyncHoverRequest.js} +0 -0
- /package/api/{types/ProfilesResponse.js → resources/windows/client/requests/AsyncMonitorRequest.js} +0 -0
- /package/{dist/api/resources/profiles/client/requests/ProfilesGetRequest.js → api/resources/windows/client/requests/AsyncPageQueryRequest.js} +0 -0
- /package/{dist/api/types/ExternalProfileV1.js → api/resources/windows/client/requests/AsyncPaginatedExtractionRequest.js} +0 -0
- /package/{dist/api/types/ProfilesResponse.js → api/resources/windows/client/requests/AsyncPromptContentRequest.js} +0 -0
@@ -49,6 +49,573 @@ class Windows {
|
|
49
49
|
this._options = _options;
|
50
50
|
}
|
51
51
|
/**
|
52
|
+
* Execute a click interaction in a specific browser window asynchronously
|
53
|
+
*
|
54
|
+
* @param {string} sessionId - The session id for the window.
|
55
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
56
|
+
* @param {Airtop.AsyncClickRequest} request
|
57
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
58
|
+
*
|
59
|
+
* @example
|
60
|
+
* await client.windows.asyncClick("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
61
|
+
* elementDescription: "The login button"
|
62
|
+
* })
|
63
|
+
*/
|
64
|
+
asyncClick(sessionId, windowId, request, requestOptions) {
|
65
|
+
var _a, _b;
|
66
|
+
return __awaiter(this, void 0, void 0, function* () {
|
67
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
68
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AirtopEnvironment.Default, `async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/click`),
|
69
|
+
method: "POST",
|
70
|
+
headers: {
|
71
|
+
Authorization: yield this._getAuthorizationHeader(),
|
72
|
+
"X-Fern-Language": "JavaScript",
|
73
|
+
"X-Fern-SDK-Name": "@airtop/sdk",
|
74
|
+
"X-Fern-SDK-Version": "0.1.16",
|
75
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
76
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
77
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
78
|
+
},
|
79
|
+
contentType: "application/json",
|
80
|
+
requestType: "json",
|
81
|
+
body: serializers.AsyncClickRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
82
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
83
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
84
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
85
|
+
});
|
86
|
+
if (_response.ok) {
|
87
|
+
return serializers.AsyncSessionAiResponseEnvelope.parseOrThrow(_response.body, {
|
88
|
+
unrecognizedObjectKeys: "passthrough",
|
89
|
+
allowUnrecognizedUnionMembers: true,
|
90
|
+
allowUnrecognizedEnumValues: true,
|
91
|
+
skipValidation: true,
|
92
|
+
breadcrumbsPrefix: ["response"],
|
93
|
+
});
|
94
|
+
}
|
95
|
+
if (_response.error.reason === "status-code") {
|
96
|
+
throw new errors.AirtopError({
|
97
|
+
statusCode: _response.error.statusCode,
|
98
|
+
body: _response.error.body,
|
99
|
+
});
|
100
|
+
}
|
101
|
+
switch (_response.error.reason) {
|
102
|
+
case "non-json":
|
103
|
+
throw new errors.AirtopError({
|
104
|
+
statusCode: _response.error.statusCode,
|
105
|
+
body: _response.error.rawBody,
|
106
|
+
});
|
107
|
+
case "timeout":
|
108
|
+
throw new errors.AirtopTimeoutError();
|
109
|
+
case "unknown":
|
110
|
+
throw new errors.AirtopError({
|
111
|
+
message: _response.error.errorMessage,
|
112
|
+
});
|
113
|
+
}
|
114
|
+
});
|
115
|
+
}
|
116
|
+
/**
|
117
|
+
* @param {string} sessionId - The session id for the window.
|
118
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
119
|
+
* @param {Airtop.AsyncHoverRequest} request
|
120
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
121
|
+
*
|
122
|
+
* @example
|
123
|
+
* await client.windows.asyncHover("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
124
|
+
*/
|
125
|
+
asyncHover(sessionId, windowId, request = {}, requestOptions) {
|
126
|
+
var _a, _b;
|
127
|
+
return __awaiter(this, void 0, void 0, function* () {
|
128
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
129
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AirtopEnvironment.Default, `async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/hover`),
|
130
|
+
method: "POST",
|
131
|
+
headers: {
|
132
|
+
Authorization: yield this._getAuthorizationHeader(),
|
133
|
+
"X-Fern-Language": "JavaScript",
|
134
|
+
"X-Fern-SDK-Name": "@airtop/sdk",
|
135
|
+
"X-Fern-SDK-Version": "0.1.16",
|
136
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
137
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
138
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
139
|
+
},
|
140
|
+
contentType: "application/json",
|
141
|
+
requestType: "json",
|
142
|
+
body: serializers.AsyncHoverRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
143
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
144
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
145
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
146
|
+
});
|
147
|
+
if (_response.ok) {
|
148
|
+
return serializers.AsyncSessionAiResponseEnvelope.parseOrThrow(_response.body, {
|
149
|
+
unrecognizedObjectKeys: "passthrough",
|
150
|
+
allowUnrecognizedUnionMembers: true,
|
151
|
+
allowUnrecognizedEnumValues: true,
|
152
|
+
skipValidation: true,
|
153
|
+
breadcrumbsPrefix: ["response"],
|
154
|
+
});
|
155
|
+
}
|
156
|
+
if (_response.error.reason === "status-code") {
|
157
|
+
throw new errors.AirtopError({
|
158
|
+
statusCode: _response.error.statusCode,
|
159
|
+
body: _response.error.body,
|
160
|
+
});
|
161
|
+
}
|
162
|
+
switch (_response.error.reason) {
|
163
|
+
case "non-json":
|
164
|
+
throw new errors.AirtopError({
|
165
|
+
statusCode: _response.error.statusCode,
|
166
|
+
body: _response.error.rawBody,
|
167
|
+
});
|
168
|
+
case "timeout":
|
169
|
+
throw new errors.AirtopTimeoutError();
|
170
|
+
case "unknown":
|
171
|
+
throw new errors.AirtopError({
|
172
|
+
message: _response.error.errorMessage,
|
173
|
+
});
|
174
|
+
}
|
175
|
+
});
|
176
|
+
}
|
177
|
+
/**
|
178
|
+
* @param {string} sessionId - The session id for the window.
|
179
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
180
|
+
* @param {Airtop.AsyncMonitorRequest} request
|
181
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
182
|
+
*
|
183
|
+
* @example
|
184
|
+
* await client.windows.asyncMonitor("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
185
|
+
*/
|
186
|
+
asyncMonitor(sessionId, windowId, request = {}, requestOptions) {
|
187
|
+
var _a, _b;
|
188
|
+
return __awaiter(this, void 0, void 0, function* () {
|
189
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
190
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AirtopEnvironment.Default, `async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/monitor`),
|
191
|
+
method: "POST",
|
192
|
+
headers: {
|
193
|
+
Authorization: yield this._getAuthorizationHeader(),
|
194
|
+
"X-Fern-Language": "JavaScript",
|
195
|
+
"X-Fern-SDK-Name": "@airtop/sdk",
|
196
|
+
"X-Fern-SDK-Version": "0.1.16",
|
197
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
198
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
199
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
200
|
+
},
|
201
|
+
contentType: "application/json",
|
202
|
+
requestType: "json",
|
203
|
+
body: serializers.AsyncMonitorRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
204
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
205
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
206
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
207
|
+
});
|
208
|
+
if (_response.ok) {
|
209
|
+
return serializers.AsyncSessionAiResponseEnvelope.parseOrThrow(_response.body, {
|
210
|
+
unrecognizedObjectKeys: "passthrough",
|
211
|
+
allowUnrecognizedUnionMembers: true,
|
212
|
+
allowUnrecognizedEnumValues: true,
|
213
|
+
skipValidation: true,
|
214
|
+
breadcrumbsPrefix: ["response"],
|
215
|
+
});
|
216
|
+
}
|
217
|
+
if (_response.error.reason === "status-code") {
|
218
|
+
throw new errors.AirtopError({
|
219
|
+
statusCode: _response.error.statusCode,
|
220
|
+
body: _response.error.body,
|
221
|
+
});
|
222
|
+
}
|
223
|
+
switch (_response.error.reason) {
|
224
|
+
case "non-json":
|
225
|
+
throw new errors.AirtopError({
|
226
|
+
statusCode: _response.error.statusCode,
|
227
|
+
body: _response.error.rawBody,
|
228
|
+
});
|
229
|
+
case "timeout":
|
230
|
+
throw new errors.AirtopTimeoutError();
|
231
|
+
case "unknown":
|
232
|
+
throw new errors.AirtopError({
|
233
|
+
message: _response.error.errorMessage,
|
234
|
+
});
|
235
|
+
}
|
236
|
+
});
|
237
|
+
}
|
238
|
+
/**
|
239
|
+
* @param {string} sessionId - The session id for the window.
|
240
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
241
|
+
* @param {Airtop.AsyncPageQueryRequest} request
|
242
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
243
|
+
*
|
244
|
+
* @example
|
245
|
+
* await client.windows.asyncPageQuery("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
246
|
+
* prompt: "What is the main idea of this page?"
|
247
|
+
* })
|
248
|
+
*/
|
249
|
+
asyncPageQuery(sessionId, windowId, request, requestOptions) {
|
250
|
+
var _a, _b;
|
251
|
+
return __awaiter(this, void 0, void 0, function* () {
|
252
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
253
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AirtopEnvironment.Default, `async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/page-query`),
|
254
|
+
method: "POST",
|
255
|
+
headers: {
|
256
|
+
Authorization: yield this._getAuthorizationHeader(),
|
257
|
+
"X-Fern-Language": "JavaScript",
|
258
|
+
"X-Fern-SDK-Name": "@airtop/sdk",
|
259
|
+
"X-Fern-SDK-Version": "0.1.16",
|
260
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
261
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
262
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
263
|
+
},
|
264
|
+
contentType: "application/json",
|
265
|
+
requestType: "json",
|
266
|
+
body: serializers.AsyncPageQueryRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
267
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
268
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
269
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
270
|
+
});
|
271
|
+
if (_response.ok) {
|
272
|
+
return serializers.AsyncSessionAiResponseEnvelope.parseOrThrow(_response.body, {
|
273
|
+
unrecognizedObjectKeys: "passthrough",
|
274
|
+
allowUnrecognizedUnionMembers: true,
|
275
|
+
allowUnrecognizedEnumValues: true,
|
276
|
+
skipValidation: true,
|
277
|
+
breadcrumbsPrefix: ["response"],
|
278
|
+
});
|
279
|
+
}
|
280
|
+
if (_response.error.reason === "status-code") {
|
281
|
+
throw new errors.AirtopError({
|
282
|
+
statusCode: _response.error.statusCode,
|
283
|
+
body: _response.error.body,
|
284
|
+
});
|
285
|
+
}
|
286
|
+
switch (_response.error.reason) {
|
287
|
+
case "non-json":
|
288
|
+
throw new errors.AirtopError({
|
289
|
+
statusCode: _response.error.statusCode,
|
290
|
+
body: _response.error.rawBody,
|
291
|
+
});
|
292
|
+
case "timeout":
|
293
|
+
throw new errors.AirtopTimeoutError();
|
294
|
+
case "unknown":
|
295
|
+
throw new errors.AirtopError({
|
296
|
+
message: _response.error.errorMessage,
|
297
|
+
});
|
298
|
+
}
|
299
|
+
});
|
300
|
+
}
|
301
|
+
/**
|
302
|
+
* @param {string} sessionId - The session id for the window.
|
303
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
304
|
+
* @param {Airtop.AsyncPaginatedExtractionRequest} request
|
305
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
306
|
+
*
|
307
|
+
* @example
|
308
|
+
* await client.windows.asyncPaginatedExtraction("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
309
|
+
*/
|
310
|
+
asyncPaginatedExtraction(sessionId, windowId, request = {}, requestOptions) {
|
311
|
+
var _a, _b;
|
312
|
+
return __awaiter(this, void 0, void 0, function* () {
|
313
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
314
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AirtopEnvironment.Default, `async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/paginated-extraction`),
|
315
|
+
method: "POST",
|
316
|
+
headers: {
|
317
|
+
Authorization: yield this._getAuthorizationHeader(),
|
318
|
+
"X-Fern-Language": "JavaScript",
|
319
|
+
"X-Fern-SDK-Name": "@airtop/sdk",
|
320
|
+
"X-Fern-SDK-Version": "0.1.16",
|
321
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
322
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
323
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
324
|
+
},
|
325
|
+
contentType: "application/json",
|
326
|
+
requestType: "json",
|
327
|
+
body: serializers.AsyncPaginatedExtractionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
328
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
329
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
330
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
331
|
+
});
|
332
|
+
if (_response.ok) {
|
333
|
+
return serializers.AsyncSessionAiResponseEnvelope.parseOrThrow(_response.body, {
|
334
|
+
unrecognizedObjectKeys: "passthrough",
|
335
|
+
allowUnrecognizedUnionMembers: true,
|
336
|
+
allowUnrecognizedEnumValues: true,
|
337
|
+
skipValidation: true,
|
338
|
+
breadcrumbsPrefix: ["response"],
|
339
|
+
});
|
340
|
+
}
|
341
|
+
if (_response.error.reason === "status-code") {
|
342
|
+
throw new errors.AirtopError({
|
343
|
+
statusCode: _response.error.statusCode,
|
344
|
+
body: _response.error.body,
|
345
|
+
});
|
346
|
+
}
|
347
|
+
switch (_response.error.reason) {
|
348
|
+
case "non-json":
|
349
|
+
throw new errors.AirtopError({
|
350
|
+
statusCode: _response.error.statusCode,
|
351
|
+
body: _response.error.rawBody,
|
352
|
+
});
|
353
|
+
case "timeout":
|
354
|
+
throw new errors.AirtopTimeoutError();
|
355
|
+
case "unknown":
|
356
|
+
throw new errors.AirtopError({
|
357
|
+
message: _response.error.errorMessage,
|
358
|
+
});
|
359
|
+
}
|
360
|
+
});
|
361
|
+
}
|
362
|
+
/**
|
363
|
+
* This endpoint is deprecated. Please use the `pageQuery` endpoint instead.
|
364
|
+
*
|
365
|
+
* @param {string} sessionId - The session id for the window.
|
366
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
367
|
+
* @param {Airtop.AsyncPromptContentRequest} request
|
368
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
369
|
+
*
|
370
|
+
* @example
|
371
|
+
* await client.windows.asyncPromptContent("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
372
|
+
* prompt: "What is the main idea of this page?"
|
373
|
+
* })
|
374
|
+
*/
|
375
|
+
asyncPromptContent(sessionId, windowId, request, requestOptions) {
|
376
|
+
var _a, _b;
|
377
|
+
return __awaiter(this, void 0, void 0, function* () {
|
378
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
379
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AirtopEnvironment.Default, `async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/prompt-content`),
|
380
|
+
method: "POST",
|
381
|
+
headers: {
|
382
|
+
Authorization: yield this._getAuthorizationHeader(),
|
383
|
+
"X-Fern-Language": "JavaScript",
|
384
|
+
"X-Fern-SDK-Name": "@airtop/sdk",
|
385
|
+
"X-Fern-SDK-Version": "0.1.16",
|
386
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
387
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
388
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
389
|
+
},
|
390
|
+
contentType: "application/json",
|
391
|
+
requestType: "json",
|
392
|
+
body: serializers.AsyncPromptContentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
393
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
394
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
395
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
396
|
+
});
|
397
|
+
if (_response.ok) {
|
398
|
+
return serializers.AsyncSessionAiResponseEnvelope.parseOrThrow(_response.body, {
|
399
|
+
unrecognizedObjectKeys: "passthrough",
|
400
|
+
allowUnrecognizedUnionMembers: true,
|
401
|
+
allowUnrecognizedEnumValues: true,
|
402
|
+
skipValidation: true,
|
403
|
+
breadcrumbsPrefix: ["response"],
|
404
|
+
});
|
405
|
+
}
|
406
|
+
if (_response.error.reason === "status-code") {
|
407
|
+
throw new errors.AirtopError({
|
408
|
+
statusCode: _response.error.statusCode,
|
409
|
+
body: _response.error.body,
|
410
|
+
});
|
411
|
+
}
|
412
|
+
switch (_response.error.reason) {
|
413
|
+
case "non-json":
|
414
|
+
throw new errors.AirtopError({
|
415
|
+
statusCode: _response.error.statusCode,
|
416
|
+
body: _response.error.rawBody,
|
417
|
+
});
|
418
|
+
case "timeout":
|
419
|
+
throw new errors.AirtopTimeoutError();
|
420
|
+
case "unknown":
|
421
|
+
throw new errors.AirtopError({
|
422
|
+
message: _response.error.errorMessage,
|
423
|
+
});
|
424
|
+
}
|
425
|
+
});
|
426
|
+
}
|
427
|
+
/**
|
428
|
+
* Take a screenshot of the current viewport of a browser window asynchronously
|
429
|
+
*
|
430
|
+
* @param {string} sessionId - The session id for the window.
|
431
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
432
|
+
* @param {Airtop.AsyncScreenshotRequest} request
|
433
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
434
|
+
*
|
435
|
+
* @example
|
436
|
+
* await client.windows.asyncScreenshot("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
437
|
+
*/
|
438
|
+
asyncScreenshot(sessionId, windowId, request = {}, requestOptions) {
|
439
|
+
var _a, _b;
|
440
|
+
return __awaiter(this, void 0, void 0, function* () {
|
441
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
442
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AirtopEnvironment.Default, `async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/screenshot`),
|
443
|
+
method: "POST",
|
444
|
+
headers: {
|
445
|
+
Authorization: yield this._getAuthorizationHeader(),
|
446
|
+
"X-Fern-Language": "JavaScript",
|
447
|
+
"X-Fern-SDK-Name": "@airtop/sdk",
|
448
|
+
"X-Fern-SDK-Version": "0.1.16",
|
449
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
450
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
451
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
452
|
+
},
|
453
|
+
contentType: "application/json",
|
454
|
+
requestType: "json",
|
455
|
+
body: serializers.AsyncScreenshotRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
456
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
457
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
458
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
459
|
+
});
|
460
|
+
if (_response.ok) {
|
461
|
+
return serializers.AsyncSessionAiResponseEnvelope.parseOrThrow(_response.body, {
|
462
|
+
unrecognizedObjectKeys: "passthrough",
|
463
|
+
allowUnrecognizedUnionMembers: true,
|
464
|
+
allowUnrecognizedEnumValues: true,
|
465
|
+
skipValidation: true,
|
466
|
+
breadcrumbsPrefix: ["response"],
|
467
|
+
});
|
468
|
+
}
|
469
|
+
if (_response.error.reason === "status-code") {
|
470
|
+
throw new errors.AirtopError({
|
471
|
+
statusCode: _response.error.statusCode,
|
472
|
+
body: _response.error.body,
|
473
|
+
});
|
474
|
+
}
|
475
|
+
switch (_response.error.reason) {
|
476
|
+
case "non-json":
|
477
|
+
throw new errors.AirtopError({
|
478
|
+
statusCode: _response.error.statusCode,
|
479
|
+
body: _response.error.rawBody,
|
480
|
+
});
|
481
|
+
case "timeout":
|
482
|
+
throw new errors.AirtopTimeoutError();
|
483
|
+
case "unknown":
|
484
|
+
throw new errors.AirtopError({
|
485
|
+
message: _response.error.errorMessage,
|
486
|
+
});
|
487
|
+
}
|
488
|
+
});
|
489
|
+
}
|
490
|
+
/**
|
491
|
+
* This endpoint is deprecated. Please use the `pageQuery` endpoint and ask for a summary in the prompt instead.
|
492
|
+
*
|
493
|
+
* @param {string} sessionId - The session id for the window.
|
494
|
+
* @param {string} windowId - The Airtop window id of the browser window to summarize.
|
495
|
+
* @param {Airtop.AsyncSummarizeContentRequest} request
|
496
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
497
|
+
*
|
498
|
+
* @example
|
499
|
+
* await client.windows.asyncSummarizeContent("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
500
|
+
*/
|
501
|
+
asyncSummarizeContent(sessionId, windowId, request = {}, requestOptions) {
|
502
|
+
var _a, _b;
|
503
|
+
return __awaiter(this, void 0, void 0, function* () {
|
504
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
505
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AirtopEnvironment.Default, `async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/summarize-content`),
|
506
|
+
method: "POST",
|
507
|
+
headers: {
|
508
|
+
Authorization: yield this._getAuthorizationHeader(),
|
509
|
+
"X-Fern-Language": "JavaScript",
|
510
|
+
"X-Fern-SDK-Name": "@airtop/sdk",
|
511
|
+
"X-Fern-SDK-Version": "0.1.16",
|
512
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
513
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
514
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
515
|
+
},
|
516
|
+
contentType: "application/json",
|
517
|
+
requestType: "json",
|
518
|
+
body: serializers.AsyncSummarizeContentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
519
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
520
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
521
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
522
|
+
});
|
523
|
+
if (_response.ok) {
|
524
|
+
return serializers.AsyncSessionAiResponseEnvelope.parseOrThrow(_response.body, {
|
525
|
+
unrecognizedObjectKeys: "passthrough",
|
526
|
+
allowUnrecognizedUnionMembers: true,
|
527
|
+
allowUnrecognizedEnumValues: true,
|
528
|
+
skipValidation: true,
|
529
|
+
breadcrumbsPrefix: ["response"],
|
530
|
+
});
|
531
|
+
}
|
532
|
+
if (_response.error.reason === "status-code") {
|
533
|
+
throw new errors.AirtopError({
|
534
|
+
statusCode: _response.error.statusCode,
|
535
|
+
body: _response.error.body,
|
536
|
+
});
|
537
|
+
}
|
538
|
+
switch (_response.error.reason) {
|
539
|
+
case "non-json":
|
540
|
+
throw new errors.AirtopError({
|
541
|
+
statusCode: _response.error.statusCode,
|
542
|
+
body: _response.error.rawBody,
|
543
|
+
});
|
544
|
+
case "timeout":
|
545
|
+
throw new errors.AirtopTimeoutError();
|
546
|
+
case "unknown":
|
547
|
+
throw new errors.AirtopError({
|
548
|
+
message: _response.error.errorMessage,
|
549
|
+
});
|
550
|
+
}
|
551
|
+
});
|
552
|
+
}
|
553
|
+
/**
|
554
|
+
* @param {string} sessionId - The session id for the window.
|
555
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
556
|
+
* @param {Airtop.AsyncTypeRequest} request
|
557
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
558
|
+
*
|
559
|
+
* @example
|
560
|
+
* await client.windows.asyncType("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
561
|
+
* text: "Example text"
|
562
|
+
* })
|
563
|
+
*/
|
564
|
+
asyncType(sessionId, windowId, request, requestOptions) {
|
565
|
+
var _a, _b;
|
566
|
+
return __awaiter(this, void 0, void 0, function* () {
|
567
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
568
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AirtopEnvironment.Default, `async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/type`),
|
569
|
+
method: "POST",
|
570
|
+
headers: {
|
571
|
+
Authorization: yield this._getAuthorizationHeader(),
|
572
|
+
"X-Fern-Language": "JavaScript",
|
573
|
+
"X-Fern-SDK-Name": "@airtop/sdk",
|
574
|
+
"X-Fern-SDK-Version": "0.1.16",
|
575
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
576
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
577
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
578
|
+
},
|
579
|
+
contentType: "application/json",
|
580
|
+
requestType: "json",
|
581
|
+
body: serializers.AsyncTypeRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
582
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
583
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
584
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
585
|
+
});
|
586
|
+
if (_response.ok) {
|
587
|
+
return serializers.AsyncSessionAiResponseEnvelope.parseOrThrow(_response.body, {
|
588
|
+
unrecognizedObjectKeys: "passthrough",
|
589
|
+
allowUnrecognizedUnionMembers: true,
|
590
|
+
allowUnrecognizedEnumValues: true,
|
591
|
+
skipValidation: true,
|
592
|
+
breadcrumbsPrefix: ["response"],
|
593
|
+
});
|
594
|
+
}
|
595
|
+
if (_response.error.reason === "status-code") {
|
596
|
+
throw new errors.AirtopError({
|
597
|
+
statusCode: _response.error.statusCode,
|
598
|
+
body: _response.error.body,
|
599
|
+
});
|
600
|
+
}
|
601
|
+
switch (_response.error.reason) {
|
602
|
+
case "non-json":
|
603
|
+
throw new errors.AirtopError({
|
604
|
+
statusCode: _response.error.statusCode,
|
605
|
+
body: _response.error.rawBody,
|
606
|
+
});
|
607
|
+
case "timeout":
|
608
|
+
throw new errors.AirtopTimeoutError();
|
609
|
+
case "unknown":
|
610
|
+
throw new errors.AirtopError({
|
611
|
+
message: _response.error.errorMessage,
|
612
|
+
});
|
613
|
+
}
|
614
|
+
});
|
615
|
+
}
|
616
|
+
/**
|
617
|
+
* Creates a new browser window in a session. Optionally, you can specify a url to load on the window upon creation.
|
618
|
+
*
|
52
619
|
* @param {string} sessionId - ID of the session that owns the window.
|
53
620
|
* @param {Airtop.CreateWindowInputV1Body} request
|
54
621
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
@@ -66,8 +633,8 @@ class Windows {
|
|
66
633
|
Authorization: yield this._getAuthorizationHeader(),
|
67
634
|
"X-Fern-Language": "JavaScript",
|
68
635
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
69
|
-
"X-Fern-SDK-Version": "0.1.
|
70
|
-
"User-Agent": "@airtop/sdk/0.1.
|
636
|
+
"X-Fern-SDK-Version": "0.1.16",
|
637
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
71
638
|
"X-Fern-Runtime": core.RUNTIME.type,
|
72
639
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
73
640
|
},
|
@@ -109,6 +676,8 @@ class Windows {
|
|
109
676
|
});
|
110
677
|
}
|
111
678
|
/**
|
679
|
+
* Get information about a browser window in a session, including the live view url.
|
680
|
+
*
|
112
681
|
* @param {string} sessionId - ID of the session that owns the window.
|
113
682
|
* @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.
|
114
683
|
* @param {Airtop.GetWindowInfoRequest} request
|
@@ -140,8 +709,8 @@ class Windows {
|
|
140
709
|
Authorization: yield this._getAuthorizationHeader(),
|
141
710
|
"X-Fern-Language": "JavaScript",
|
142
711
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
143
|
-
"X-Fern-SDK-Version": "0.1.
|
144
|
-
"User-Agent": "@airtop/sdk/0.1.
|
712
|
+
"X-Fern-SDK-Version": "0.1.16",
|
713
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
145
714
|
"X-Fern-Runtime": core.RUNTIME.type,
|
146
715
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
147
716
|
},
|
@@ -183,6 +752,8 @@ class Windows {
|
|
183
752
|
});
|
184
753
|
}
|
185
754
|
/**
|
755
|
+
* Loads a specified url on a given window
|
756
|
+
*
|
186
757
|
* @param {string} sessionId - ID of the session that owns the window.
|
187
758
|
* @param {string} windowId - Airtop window ID of the browser window.
|
188
759
|
* @param {Airtop.WindowLoadUrlV1Body} request
|
@@ -203,8 +774,8 @@ class Windows {
|
|
203
774
|
Authorization: yield this._getAuthorizationHeader(),
|
204
775
|
"X-Fern-Language": "JavaScript",
|
205
776
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
206
|
-
"X-Fern-SDK-Version": "0.1.
|
207
|
-
"User-Agent": "@airtop/sdk/0.1.
|
777
|
+
"X-Fern-SDK-Version": "0.1.16",
|
778
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
208
779
|
"X-Fern-Runtime": core.RUNTIME.type,
|
209
780
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
210
781
|
},
|
@@ -246,6 +817,8 @@ class Windows {
|
|
246
817
|
});
|
247
818
|
}
|
248
819
|
/**
|
820
|
+
* Closes a browser window in a session
|
821
|
+
*
|
249
822
|
* @param {string} sessionId - ID of the session that owns the window.
|
250
823
|
* @param {string} windowId - Airtop window ID of the browser window.
|
251
824
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
@@ -263,8 +836,8 @@ class Windows {
|
|
263
836
|
Authorization: yield this._getAuthorizationHeader(),
|
264
837
|
"X-Fern-Language": "JavaScript",
|
265
838
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
266
|
-
"X-Fern-SDK-Version": "0.1.
|
267
|
-
"User-Agent": "@airtop/sdk/0.1.
|
839
|
+
"X-Fern-SDK-Version": "0.1.16",
|
840
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
268
841
|
"X-Fern-Runtime": core.RUNTIME.type,
|
269
842
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
270
843
|
},
|
@@ -305,6 +878,8 @@ class Windows {
|
|
305
878
|
});
|
306
879
|
}
|
307
880
|
/**
|
881
|
+
* Execute a click interaction in a specific browser window
|
882
|
+
*
|
308
883
|
* @param {string} sessionId - The session id for the window.
|
309
884
|
* @param {string} windowId - The Airtop window id of the browser window.
|
310
885
|
* @param {Airtop.SessionClickHandlerRequestBody} request
|
@@ -325,8 +900,8 @@ class Windows {
|
|
325
900
|
Authorization: yield this._getAuthorizationHeader(),
|
326
901
|
"X-Fern-Language": "JavaScript",
|
327
902
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
328
|
-
"X-Fern-SDK-Version": "0.1.
|
329
|
-
"User-Agent": "@airtop/sdk/0.1.
|
903
|
+
"X-Fern-SDK-Version": "0.1.16",
|
904
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
330
905
|
"X-Fern-Runtime": core.RUNTIME.type,
|
331
906
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
332
907
|
},
|
@@ -368,6 +943,8 @@ class Windows {
|
|
368
943
|
});
|
369
944
|
}
|
370
945
|
/**
|
946
|
+
* Execute a hover interaction in a specific browser window
|
947
|
+
*
|
371
948
|
* @param {string} sessionId - The session id for the window.
|
372
949
|
* @param {string} windowId - The Airtop window id of the browser window.
|
373
950
|
* @param {Airtop.SessionHoverHandlerRequestBody} request
|
@@ -386,8 +963,8 @@ class Windows {
|
|
386
963
|
Authorization: yield this._getAuthorizationHeader(),
|
387
964
|
"X-Fern-Language": "JavaScript",
|
388
965
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
389
|
-
"X-Fern-SDK-Version": "0.1.
|
390
|
-
"User-Agent": "@airtop/sdk/0.1.
|
966
|
+
"X-Fern-SDK-Version": "0.1.16",
|
967
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
391
968
|
"X-Fern-Runtime": core.RUNTIME.type,
|
392
969
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
393
970
|
},
|
@@ -429,6 +1006,71 @@ class Windows {
|
|
429
1006
|
});
|
430
1007
|
}
|
431
1008
|
/**
|
1009
|
+
* @param {string} sessionId - The session id for the window.
|
1010
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
1011
|
+
* @param {Airtop.SessionMonitorHandlerRequestBody} request
|
1012
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
1013
|
+
*
|
1014
|
+
* @example
|
1015
|
+
* await client.windows.monitor("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
1016
|
+
*/
|
1017
|
+
monitor(sessionId, windowId, request = {}, requestOptions) {
|
1018
|
+
var _a, _b;
|
1019
|
+
return __awaiter(this, void 0, void 0, function* () {
|
1020
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1021
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/monitor`),
|
1022
|
+
method: "POST",
|
1023
|
+
headers: {
|
1024
|
+
Authorization: yield this._getAuthorizationHeader(),
|
1025
|
+
"X-Fern-Language": "JavaScript",
|
1026
|
+
"X-Fern-SDK-Name": "@airtop/sdk",
|
1027
|
+
"X-Fern-SDK-Version": "0.1.16",
|
1028
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
1029
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
1030
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
1031
|
+
},
|
1032
|
+
contentType: "application/json",
|
1033
|
+
requestType: "json",
|
1034
|
+
body: serializers.SessionMonitorHandlerRequestBody.jsonOrThrow(request, {
|
1035
|
+
unrecognizedObjectKeys: "strip",
|
1036
|
+
}),
|
1037
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1038
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1039
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
1040
|
+
});
|
1041
|
+
if (_response.ok) {
|
1042
|
+
return serializers.AiPromptResponse.parseOrThrow(_response.body, {
|
1043
|
+
unrecognizedObjectKeys: "passthrough",
|
1044
|
+
allowUnrecognizedUnionMembers: true,
|
1045
|
+
allowUnrecognizedEnumValues: true,
|
1046
|
+
skipValidation: true,
|
1047
|
+
breadcrumbsPrefix: ["response"],
|
1048
|
+
});
|
1049
|
+
}
|
1050
|
+
if (_response.error.reason === "status-code") {
|
1051
|
+
throw new errors.AirtopError({
|
1052
|
+
statusCode: _response.error.statusCode,
|
1053
|
+
body: _response.error.body,
|
1054
|
+
});
|
1055
|
+
}
|
1056
|
+
switch (_response.error.reason) {
|
1057
|
+
case "non-json":
|
1058
|
+
throw new errors.AirtopError({
|
1059
|
+
statusCode: _response.error.statusCode,
|
1060
|
+
body: _response.error.rawBody,
|
1061
|
+
});
|
1062
|
+
case "timeout":
|
1063
|
+
throw new errors.AirtopTimeoutError();
|
1064
|
+
case "unknown":
|
1065
|
+
throw new errors.AirtopError({
|
1066
|
+
message: _response.error.errorMessage,
|
1067
|
+
});
|
1068
|
+
}
|
1069
|
+
});
|
1070
|
+
}
|
1071
|
+
/**
|
1072
|
+
* 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?).
|
1073
|
+
*
|
432
1074
|
* @param {string} sessionId - The session id for the window.
|
433
1075
|
* @param {string} windowId - The Airtop window id of the browser window.
|
434
1076
|
* @param {Airtop.SessionPageQueryHandlerRequestBody} request
|
@@ -449,8 +1091,8 @@ class Windows {
|
|
449
1091
|
Authorization: yield this._getAuthorizationHeader(),
|
450
1092
|
"X-Fern-Language": "JavaScript",
|
451
1093
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
452
|
-
"X-Fern-SDK-Version": "0.1.
|
453
|
-
"User-Agent": "@airtop/sdk/0.1.
|
1094
|
+
"X-Fern-SDK-Version": "0.1.16",
|
1095
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
454
1096
|
"X-Fern-Runtime": core.RUNTIME.type,
|
455
1097
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
456
1098
|
},
|
@@ -494,6 +1136,8 @@ class Windows {
|
|
494
1136
|
});
|
495
1137
|
}
|
496
1138
|
/**
|
1139
|
+
* Submit a prompt that queries the content of a specific browser window and paginates through pages to return a list of results.
|
1140
|
+
*
|
497
1141
|
* @param {string} sessionId - The session id for the window.
|
498
1142
|
* @param {string} windowId - The Airtop window id of the browser window.
|
499
1143
|
* @param {Airtop.SessionPaginatedExtractionHandlerRequestBody} request
|
@@ -512,8 +1156,8 @@ class Windows {
|
|
512
1156
|
Authorization: yield this._getAuthorizationHeader(),
|
513
1157
|
"X-Fern-Language": "JavaScript",
|
514
1158
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
515
|
-
"X-Fern-SDK-Version": "0.1.
|
516
|
-
"User-Agent": "@airtop/sdk/0.1.
|
1159
|
+
"X-Fern-SDK-Version": "0.1.16",
|
1160
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
517
1161
|
"X-Fern-Runtime": core.RUNTIME.type,
|
518
1162
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
519
1163
|
},
|
@@ -579,8 +1223,8 @@ class Windows {
|
|
579
1223
|
Authorization: yield this._getAuthorizationHeader(),
|
580
1224
|
"X-Fern-Language": "JavaScript",
|
581
1225
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
582
|
-
"X-Fern-SDK-Version": "0.1.
|
583
|
-
"User-Agent": "@airtop/sdk/0.1.
|
1226
|
+
"X-Fern-SDK-Version": "0.1.16",
|
1227
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
584
1228
|
"X-Fern-Runtime": core.RUNTIME.type,
|
585
1229
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
586
1230
|
},
|
@@ -624,6 +1268,8 @@ class Windows {
|
|
624
1268
|
});
|
625
1269
|
}
|
626
1270
|
/**
|
1271
|
+
* Scrape a window and return the content as markdown
|
1272
|
+
*
|
627
1273
|
* @param {string} sessionId - The session id for the window.
|
628
1274
|
* @param {string} windowId - The Airtop window id of the browser window to scrape.
|
629
1275
|
* @param {Airtop.ScrapeContentRequest} request
|
@@ -642,8 +1288,8 @@ class Windows {
|
|
642
1288
|
Authorization: yield this._getAuthorizationHeader(),
|
643
1289
|
"X-Fern-Language": "JavaScript",
|
644
1290
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
645
|
-
"X-Fern-SDK-Version": "0.1.
|
646
|
-
"User-Agent": "@airtop/sdk/0.1.
|
1291
|
+
"X-Fern-SDK-Version": "0.1.16",
|
1292
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
647
1293
|
"X-Fern-Runtime": core.RUNTIME.type,
|
648
1294
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
649
1295
|
},
|
@@ -684,6 +1330,71 @@ class Windows {
|
|
684
1330
|
}
|
685
1331
|
});
|
686
1332
|
}
|
1333
|
+
/**
|
1334
|
+
* Take a screenshot of a browser window
|
1335
|
+
*
|
1336
|
+
* @param {string} sessionId - The session id for the window.
|
1337
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
1338
|
+
* @param {Airtop.SessionScreenshotHandlerRequestBody} request
|
1339
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
1340
|
+
*
|
1341
|
+
* @example
|
1342
|
+
* await client.windows.screenshot("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
1343
|
+
*/
|
1344
|
+
screenshot(sessionId, windowId, request = {}, requestOptions) {
|
1345
|
+
var _a, _b;
|
1346
|
+
return __awaiter(this, void 0, void 0, function* () {
|
1347
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1348
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/screenshot`),
|
1349
|
+
method: "POST",
|
1350
|
+
headers: {
|
1351
|
+
Authorization: yield this._getAuthorizationHeader(),
|
1352
|
+
"X-Fern-Language": "JavaScript",
|
1353
|
+
"X-Fern-SDK-Name": "@airtop/sdk",
|
1354
|
+
"X-Fern-SDK-Version": "0.1.16",
|
1355
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
1356
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
1357
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
1358
|
+
},
|
1359
|
+
contentType: "application/json",
|
1360
|
+
requestType: "json",
|
1361
|
+
body: serializers.SessionScreenshotHandlerRequestBody.jsonOrThrow(request, {
|
1362
|
+
unrecognizedObjectKeys: "strip",
|
1363
|
+
}),
|
1364
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1365
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1366
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
1367
|
+
});
|
1368
|
+
if (_response.ok) {
|
1369
|
+
return serializers.AiPromptResponse.parseOrThrow(_response.body, {
|
1370
|
+
unrecognizedObjectKeys: "passthrough",
|
1371
|
+
allowUnrecognizedUnionMembers: true,
|
1372
|
+
allowUnrecognizedEnumValues: true,
|
1373
|
+
skipValidation: true,
|
1374
|
+
breadcrumbsPrefix: ["response"],
|
1375
|
+
});
|
1376
|
+
}
|
1377
|
+
if (_response.error.reason === "status-code") {
|
1378
|
+
throw new errors.AirtopError({
|
1379
|
+
statusCode: _response.error.statusCode,
|
1380
|
+
body: _response.error.body,
|
1381
|
+
});
|
1382
|
+
}
|
1383
|
+
switch (_response.error.reason) {
|
1384
|
+
case "non-json":
|
1385
|
+
throw new errors.AirtopError({
|
1386
|
+
statusCode: _response.error.statusCode,
|
1387
|
+
body: _response.error.rawBody,
|
1388
|
+
});
|
1389
|
+
case "timeout":
|
1390
|
+
throw new errors.AirtopTimeoutError();
|
1391
|
+
case "unknown":
|
1392
|
+
throw new errors.AirtopError({
|
1393
|
+
message: _response.error.errorMessage,
|
1394
|
+
});
|
1395
|
+
}
|
1396
|
+
});
|
1397
|
+
}
|
687
1398
|
/**
|
688
1399
|
* This endpoint is deprecated. Please use the `pageQuery` endpoint and ask for a summary in the prompt instead.
|
689
1400
|
*
|
@@ -705,8 +1416,8 @@ class Windows {
|
|
705
1416
|
Authorization: yield this._getAuthorizationHeader(),
|
706
1417
|
"X-Fern-Language": "JavaScript",
|
707
1418
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
708
|
-
"X-Fern-SDK-Version": "0.1.
|
709
|
-
"User-Agent": "@airtop/sdk/0.1.
|
1419
|
+
"X-Fern-SDK-Version": "0.1.16",
|
1420
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
710
1421
|
"X-Fern-Runtime": core.RUNTIME.type,
|
711
1422
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
712
1423
|
},
|
@@ -750,6 +1461,8 @@ class Windows {
|
|
750
1461
|
});
|
751
1462
|
}
|
752
1463
|
/**
|
1464
|
+
* Execute a type interaction in a specific browser window
|
1465
|
+
*
|
753
1466
|
* @param {string} sessionId - The session id for the window.
|
754
1467
|
* @param {string} windowId - The Airtop window id of the browser window.
|
755
1468
|
* @param {Airtop.SessionTypeHandlerRequestBody} request
|
@@ -770,8 +1483,8 @@ class Windows {
|
|
770
1483
|
Authorization: yield this._getAuthorizationHeader(),
|
771
1484
|
"X-Fern-Language": "JavaScript",
|
772
1485
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
773
|
-
"X-Fern-SDK-Version": "0.1.
|
774
|
-
"User-Agent": "@airtop/sdk/0.1.
|
1486
|
+
"X-Fern-SDK-Version": "0.1.16",
|
1487
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
775
1488
|
"X-Fern-Runtime": core.RUNTIME.type,
|
776
1489
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
777
1490
|
},
|