@airtop/sdk 0.1.16-beta0 → 0.1.16
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 +0 -6
- package/Client.js +4 -14
- package/README.md +6 -8
- package/api/resources/index.d.ts +0 -3
- package/api/resources/index.js +1 -4
- package/api/resources/profiles/client/Client.js +2 -2
- package/api/resources/sessions/client/Client.d.ts +2 -2
- package/api/resources/sessions/client/Client.js +17 -17
- package/api/resources/sessions/types/SessionsEventsResponse.d.ts +4 -4
- package/api/resources/sessions/types/index.d.ts +1 -1
- package/api/resources/sessions/types/index.js +1 -1
- package/api/resources/windows/client/Client.d.ts +0 -116
- package/api/resources/windows/client/Client.js +26 -654
- package/api/resources/windows/client/requests/index.d.ts +0 -10
- package/api/types/SessionConfigV1.d.ts +2 -2
- package/api/types/index.d.ts +0 -9
- package/api/types/index.js +0 -9
- package/dist/Client.d.ts +0 -6
- package/dist/Client.js +4 -14
- package/dist/api/resources/index.d.ts +0 -3
- package/dist/api/resources/index.js +1 -4
- package/dist/api/resources/profiles/client/Client.js +2 -2
- package/dist/api/resources/sessions/client/Client.d.ts +2 -2
- package/dist/api/resources/sessions/client/Client.js +17 -17
- package/dist/api/resources/sessions/types/SessionsEventsResponse.d.ts +4 -4
- package/dist/api/resources/sessions/types/index.d.ts +1 -1
- package/dist/api/resources/sessions/types/index.js +1 -1
- package/dist/api/resources/windows/client/Client.d.ts +0 -116
- package/dist/api/resources/windows/client/Client.js +26 -654
- package/dist/api/resources/windows/client/requests/index.d.ts +0 -10
- package/dist/api/types/SessionConfigV1.d.ts +2 -2
- package/dist/api/types/index.d.ts +0 -9
- package/dist/api/types/index.js +0 -9
- package/dist/serialization/resources/sessions/types/SessionsEventsResponse.d.ts +5 -5
- package/dist/serialization/resources/sessions/types/SessionsEventsResponse.js +2 -2
- package/dist/serialization/resources/sessions/types/index.d.ts +1 -1
- package/dist/serialization/resources/sessions/types/index.js +1 -1
- package/dist/serialization/resources/windows/client/requests/index.d.ts +0 -10
- package/dist/serialization/resources/windows/client/requests/index.js +1 -21
- package/dist/serialization/types/index.d.ts +0 -9
- package/dist/serialization/types/index.js +0 -9
- package/dist/wrapper/AirtopClient.d.ts +0 -1
- package/dist/wrapper/AirtopClient.js +0 -3
- package/dist/wrapper/AirtopWindows.d.ts +0 -10
- package/dist/wrapper/AirtopWindows.js +0 -17
- package/package.json +1 -1
- package/reference.md +2 -898
- package/serialization/resources/sessions/types/SessionsEventsResponse.d.ts +5 -5
- package/serialization/resources/sessions/types/SessionsEventsResponse.js +2 -2
- package/serialization/resources/sessions/types/index.d.ts +1 -1
- package/serialization/resources/sessions/types/index.js +1 -1
- package/serialization/resources/windows/client/requests/index.d.ts +0 -10
- package/serialization/resources/windows/client/requests/index.js +1 -21
- package/serialization/types/index.d.ts +0 -9
- package/serialization/types/index.js +0 -9
- package/wrapper/AirtopClient.d.ts +0 -1
- package/wrapper/AirtopClient.js +0 -3
- package/wrapper/AirtopWindows.d.ts +0 -10
- package/wrapper/AirtopWindows.js +0 -17
- package/api/resources/extensionConfigurations/client/Client.d.ts +0 -50
- package/api/resources/extensionConfigurations/client/Client.js +0 -214
- package/api/resources/extensionConfigurations/client/index.d.ts +0 -1
- package/api/resources/extensionConfigurations/client/index.js +0 -17
- package/api/resources/extensionConfigurations/client/requests/ExtensionConfigurationDeleteRequest.d.ts +0 -13
- package/api/resources/extensionConfigurations/client/requests/ExtensionConfigurationDeleteRequest.js +0 -5
- package/api/resources/extensionConfigurations/client/requests/index.d.ts +0 -1
- package/api/resources/extensionConfigurations/client/requests/index.js +0 -2
- package/api/resources/extensionConfigurations/index.d.ts +0 -1
- package/api/resources/extensionConfigurations/index.js +0 -17
- package/api/resources/requests/client/Client.d.ts +0 -34
- package/api/resources/requests/client/Client.js +0 -115
- package/api/resources/requests/client/index.d.ts +0 -1
- package/api/resources/requests/client/index.js +0 -2
- package/api/resources/requests/index.d.ts +0 -1
- package/api/resources/requests/index.js +0 -17
- package/api/resources/windows/client/requests/AsyncClickRequest.d.ts +0 -29
- package/api/resources/windows/client/requests/AsyncClickRequest.js +0 -5
- package/api/resources/windows/client/requests/AsyncHoverRequest.d.ts +0 -25
- package/api/resources/windows/client/requests/AsyncHoverRequest.js +0 -5
- package/api/resources/windows/client/requests/AsyncMonitorRequest.d.ts +0 -27
- package/api/resources/windows/client/requests/AsyncMonitorRequest.js +0 -5
- package/api/resources/windows/client/requests/AsyncPageQueryRequest.d.ts +0 -29
- package/api/resources/windows/client/requests/AsyncPageQueryRequest.js +0 -5
- package/api/resources/windows/client/requests/AsyncPaginatedExtractionRequest.d.ts +0 -25
- 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/SessionMonitorHandlerRequestBody.d.ts +0 -25
- package/api/resources/windows/client/requests/SessionMonitorHandlerRequestBody.js +0 -5
- package/api/types/AsyncConfig.d.ts +0 -7
- package/api/types/AsyncConfig.js +0 -5
- package/api/types/AsyncSessionAiResponseEnvelope.d.ts +0 -9
- package/api/types/AsyncSessionAiResponseEnvelope.js +0 -5
- package/api/types/BrowserWaitSelectorConfig.d.ts +0 -11
- package/api/types/BrowserWaitSelectorConfig.js +0 -5
- package/api/types/ExtensionConfigurationOutput.d.ts +0 -13
- package/api/types/ExtensionConfigurationOutput.js +0 -5
- package/api/types/IntervalMonitorConfig.d.ts +0 -9
- package/api/types/IntervalMonitorConfig.js +0 -5
- package/api/types/MonitorConfig.d.ts +0 -14
- package/api/types/MonitorConfig.js +0 -5
- package/api/types/MonitorConfigIncludeVisualAnalysis.d.ts +0 -12
- package/api/types/MonitorConfigIncludeVisualAnalysis.js +0 -11
- package/api/types/MonitorConfigMonitorType.d.ts +0 -11
- package/api/types/MonitorConfigMonitorType.js +0 -10
- package/api/types/RequestStatusResponse.d.ts +0 -8
- package/api/types/RequestStatusResponse.js +0 -5
- package/dist/api/resources/extensionConfigurations/client/Client.d.ts +0 -50
- package/dist/api/resources/extensionConfigurations/client/Client.js +0 -214
- package/dist/api/resources/extensionConfigurations/client/index.d.ts +0 -1
- package/dist/api/resources/extensionConfigurations/client/index.js +0 -17
- package/dist/api/resources/extensionConfigurations/client/requests/ExtensionConfigurationDeleteRequest.d.ts +0 -13
- package/dist/api/resources/extensionConfigurations/client/requests/ExtensionConfigurationDeleteRequest.js +0 -5
- package/dist/api/resources/extensionConfigurations/client/requests/index.d.ts +0 -1
- package/dist/api/resources/extensionConfigurations/client/requests/index.js +0 -2
- package/dist/api/resources/extensionConfigurations/index.d.ts +0 -1
- package/dist/api/resources/extensionConfigurations/index.js +0 -17
- package/dist/api/resources/requests/client/Client.d.ts +0 -34
- package/dist/api/resources/requests/client/Client.js +0 -115
- package/dist/api/resources/requests/client/index.d.ts +0 -1
- package/dist/api/resources/requests/client/index.js +0 -2
- package/dist/api/resources/requests/index.d.ts +0 -1
- package/dist/api/resources/requests/index.js +0 -17
- package/dist/api/resources/windows/client/requests/AsyncClickRequest.d.ts +0 -29
- package/dist/api/resources/windows/client/requests/AsyncClickRequest.js +0 -5
- package/dist/api/resources/windows/client/requests/AsyncHoverRequest.d.ts +0 -25
- 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 -25
- 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/SessionMonitorHandlerRequestBody.d.ts +0 -25
- package/dist/api/resources/windows/client/requests/SessionMonitorHandlerRequestBody.js +0 -5
- package/dist/api/types/AsyncConfig.d.ts +0 -7
- package/dist/api/types/AsyncConfig.js +0 -5
- package/dist/api/types/AsyncSessionAiResponseEnvelope.d.ts +0 -9
- package/dist/api/types/AsyncSessionAiResponseEnvelope.js +0 -5
- package/dist/api/types/BrowserWaitSelectorConfig.d.ts +0 -11
- package/dist/api/types/BrowserWaitSelectorConfig.js +0 -5
- package/dist/api/types/ExtensionConfigurationOutput.d.ts +0 -13
- package/dist/api/types/ExtensionConfigurationOutput.js +0 -5
- package/dist/api/types/IntervalMonitorConfig.d.ts +0 -9
- package/dist/api/types/IntervalMonitorConfig.js +0 -5
- package/dist/api/types/MonitorConfig.d.ts +0 -14
- package/dist/api/types/MonitorConfig.js +0 -5
- package/dist/api/types/MonitorConfigIncludeVisualAnalysis.d.ts +0 -12
- package/dist/api/types/MonitorConfigIncludeVisualAnalysis.js +0 -11
- package/dist/api/types/MonitorConfigMonitorType.d.ts +0 -11
- package/dist/api/types/MonitorConfigMonitorType.js +0 -10
- package/dist/api/types/RequestStatusResponse.d.ts +0 -8
- package/dist/api/types/RequestStatusResponse.js +0 -5
- package/dist/serialization/resources/windows/client/requests/AsyncClickRequest.d.ts +0 -20
- package/dist/serialization/resources/windows/client/requests/AsyncClickRequest.js +0 -41
- package/dist/serialization/resources/windows/client/requests/AsyncHoverRequest.d.ts +0 -19
- package/dist/serialization/resources/windows/client/requests/AsyncHoverRequest.js +0 -40
- package/dist/serialization/resources/windows/client/requests/AsyncMonitorRequest.d.ts +0 -20
- package/dist/serialization/resources/windows/client/requests/AsyncMonitorRequest.js +0 -41
- package/dist/serialization/resources/windows/client/requests/AsyncPageQueryRequest.d.ts +0 -20
- package/dist/serialization/resources/windows/client/requests/AsyncPageQueryRequest.js +0 -41
- package/dist/serialization/resources/windows/client/requests/AsyncPaginatedExtractionRequest.d.ts +0 -19
- package/dist/serialization/resources/windows/client/requests/AsyncPaginatedExtractionRequest.js +0 -40
- package/dist/serialization/resources/windows/client/requests/AsyncPromptContentRequest.d.ts +0 -20
- package/dist/serialization/resources/windows/client/requests/AsyncPromptContentRequest.js +0 -41
- package/dist/serialization/resources/windows/client/requests/AsyncScreenshotRequest.d.ts +0 -18
- package/dist/serialization/resources/windows/client/requests/AsyncScreenshotRequest.js +0 -39
- package/dist/serialization/resources/windows/client/requests/AsyncSummarizeContentRequest.d.ts +0 -19
- package/dist/serialization/resources/windows/client/requests/AsyncSummarizeContentRequest.js +0 -40
- package/dist/serialization/resources/windows/client/requests/AsyncTypeRequest.d.ts +0 -24
- package/dist/serialization/resources/windows/client/requests/AsyncTypeRequest.js +0 -45
- package/dist/serialization/resources/windows/client/requests/SessionMonitorHandlerRequestBody.d.ts +0 -18
- package/dist/serialization/resources/windows/client/requests/SessionMonitorHandlerRequestBody.js +0 -39
- package/dist/serialization/types/AsyncConfig.d.ts +0 -12
- package/dist/serialization/types/AsyncConfig.js +0 -33
- package/dist/serialization/types/AsyncSessionAiResponseEnvelope.d.ts +0 -15
- package/dist/serialization/types/AsyncSessionAiResponseEnvelope.js +0 -36
- package/dist/serialization/types/BrowserWaitSelectorConfig.d.ts +0 -14
- package/dist/serialization/types/BrowserWaitSelectorConfig.js +0 -35
- package/dist/serialization/types/ExtensionConfigurationOutput.d.ts +0 -15
- package/dist/serialization/types/ExtensionConfigurationOutput.js +0 -36
- package/dist/serialization/types/IntervalMonitorConfig.d.ts +0 -13
- package/dist/serialization/types/IntervalMonitorConfig.js +0 -34
- package/dist/serialization/types/MonitorConfig.d.ts +0 -19
- package/dist/serialization/types/MonitorConfig.js +0 -40
- package/dist/serialization/types/MonitorConfigIncludeVisualAnalysis.d.ts +0 -10
- package/dist/serialization/types/MonitorConfigIncludeVisualAnalysis.js +0 -31
- package/dist/serialization/types/MonitorConfigMonitorType.d.ts +0 -10
- package/dist/serialization/types/MonitorConfigMonitorType.js +0 -31
- package/dist/serialization/types/RequestStatusResponse.d.ts +0 -13
- package/dist/serialization/types/RequestStatusResponse.js +0 -34
- package/serialization/resources/windows/client/requests/AsyncClickRequest.d.ts +0 -20
- package/serialization/resources/windows/client/requests/AsyncClickRequest.js +0 -41
- package/serialization/resources/windows/client/requests/AsyncHoverRequest.d.ts +0 -19
- package/serialization/resources/windows/client/requests/AsyncHoverRequest.js +0 -40
- package/serialization/resources/windows/client/requests/AsyncMonitorRequest.d.ts +0 -20
- package/serialization/resources/windows/client/requests/AsyncMonitorRequest.js +0 -41
- package/serialization/resources/windows/client/requests/AsyncPageQueryRequest.d.ts +0 -20
- package/serialization/resources/windows/client/requests/AsyncPageQueryRequest.js +0 -41
- package/serialization/resources/windows/client/requests/AsyncPaginatedExtractionRequest.d.ts +0 -19
- package/serialization/resources/windows/client/requests/AsyncPaginatedExtractionRequest.js +0 -40
- package/serialization/resources/windows/client/requests/AsyncPromptContentRequest.d.ts +0 -20
- package/serialization/resources/windows/client/requests/AsyncPromptContentRequest.js +0 -41
- package/serialization/resources/windows/client/requests/AsyncScreenshotRequest.d.ts +0 -18
- package/serialization/resources/windows/client/requests/AsyncScreenshotRequest.js +0 -39
- package/serialization/resources/windows/client/requests/AsyncSummarizeContentRequest.d.ts +0 -19
- package/serialization/resources/windows/client/requests/AsyncSummarizeContentRequest.js +0 -40
- package/serialization/resources/windows/client/requests/AsyncTypeRequest.d.ts +0 -24
- package/serialization/resources/windows/client/requests/AsyncTypeRequest.js +0 -45
- package/serialization/resources/windows/client/requests/SessionMonitorHandlerRequestBody.d.ts +0 -18
- package/serialization/resources/windows/client/requests/SessionMonitorHandlerRequestBody.js +0 -39
- package/serialization/types/AsyncConfig.d.ts +0 -12
- package/serialization/types/AsyncConfig.js +0 -33
- package/serialization/types/AsyncSessionAiResponseEnvelope.d.ts +0 -15
- package/serialization/types/AsyncSessionAiResponseEnvelope.js +0 -36
- package/serialization/types/BrowserWaitSelectorConfig.d.ts +0 -14
- package/serialization/types/BrowserWaitSelectorConfig.js +0 -35
- package/serialization/types/ExtensionConfigurationOutput.d.ts +0 -15
- package/serialization/types/ExtensionConfigurationOutput.js +0 -36
- package/serialization/types/IntervalMonitorConfig.d.ts +0 -13
- package/serialization/types/IntervalMonitorConfig.js +0 -34
- package/serialization/types/MonitorConfig.d.ts +0 -19
- package/serialization/types/MonitorConfig.js +0 -40
- package/serialization/types/MonitorConfigIncludeVisualAnalysis.d.ts +0 -10
- package/serialization/types/MonitorConfigIncludeVisualAnalysis.js +0 -31
- package/serialization/types/MonitorConfigMonitorType.d.ts +0 -10
- package/serialization/types/MonitorConfigMonitorType.js +0 -31
- package/serialization/types/RequestStatusResponse.d.ts +0 -13
- package/serialization/types/RequestStatusResponse.js +0 -34
@@ -48,571 +48,6 @@ class Windows {
|
|
48
48
|
constructor(_options) {
|
49
49
|
this._options = _options;
|
50
50
|
}
|
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-beta0",
|
75
|
-
"User-Agent": "@airtop/sdk/0.1.16-beta0",
|
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-beta0",
|
136
|
-
"User-Agent": "@airtop/sdk/0.1.16-beta0",
|
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-beta0",
|
197
|
-
"User-Agent": "@airtop/sdk/0.1.16-beta0",
|
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-beta0",
|
260
|
-
"User-Agent": "@airtop/sdk/0.1.16-beta0",
|
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-beta0",
|
321
|
-
"User-Agent": "@airtop/sdk/0.1.16-beta0",
|
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-beta0",
|
386
|
-
"User-Agent": "@airtop/sdk/0.1.16-beta0",
|
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-beta0",
|
449
|
-
"User-Agent": "@airtop/sdk/0.1.16-beta0",
|
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-beta0",
|
512
|
-
"User-Agent": "@airtop/sdk/0.1.16-beta0",
|
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-beta0",
|
575
|
-
"User-Agent": "@airtop/sdk/0.1.16-beta0",
|
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
51
|
/**
|
617
52
|
* Creates a new browser window in a session. Optionally, you can specify a url to load on the window upon creation.
|
618
53
|
*
|
@@ -633,8 +68,8 @@ class Windows {
|
|
633
68
|
Authorization: yield this._getAuthorizationHeader(),
|
634
69
|
"X-Fern-Language": "JavaScript",
|
635
70
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
636
|
-
"X-Fern-SDK-Version": "0.1.16
|
637
|
-
"User-Agent": "@airtop/sdk/0.1.16
|
71
|
+
"X-Fern-SDK-Version": "0.1.16",
|
72
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
638
73
|
"X-Fern-Runtime": core.RUNTIME.type,
|
639
74
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
640
75
|
},
|
@@ -709,8 +144,8 @@ class Windows {
|
|
709
144
|
Authorization: yield this._getAuthorizationHeader(),
|
710
145
|
"X-Fern-Language": "JavaScript",
|
711
146
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
712
|
-
"X-Fern-SDK-Version": "0.1.16
|
713
|
-
"User-Agent": "@airtop/sdk/0.1.16
|
147
|
+
"X-Fern-SDK-Version": "0.1.16",
|
148
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
714
149
|
"X-Fern-Runtime": core.RUNTIME.type,
|
715
150
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
716
151
|
},
|
@@ -774,8 +209,8 @@ class Windows {
|
|
774
209
|
Authorization: yield this._getAuthorizationHeader(),
|
775
210
|
"X-Fern-Language": "JavaScript",
|
776
211
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
777
|
-
"X-Fern-SDK-Version": "0.1.16
|
778
|
-
"User-Agent": "@airtop/sdk/0.1.16
|
212
|
+
"X-Fern-SDK-Version": "0.1.16",
|
213
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
779
214
|
"X-Fern-Runtime": core.RUNTIME.type,
|
780
215
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
781
216
|
},
|
@@ -836,8 +271,8 @@ class Windows {
|
|
836
271
|
Authorization: yield this._getAuthorizationHeader(),
|
837
272
|
"X-Fern-Language": "JavaScript",
|
838
273
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
839
|
-
"X-Fern-SDK-Version": "0.1.16
|
840
|
-
"User-Agent": "@airtop/sdk/0.1.16
|
274
|
+
"X-Fern-SDK-Version": "0.1.16",
|
275
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
841
276
|
"X-Fern-Runtime": core.RUNTIME.type,
|
842
277
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
843
278
|
},
|
@@ -900,8 +335,8 @@ class Windows {
|
|
900
335
|
Authorization: yield this._getAuthorizationHeader(),
|
901
336
|
"X-Fern-Language": "JavaScript",
|
902
337
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
903
|
-
"X-Fern-SDK-Version": "0.1.16
|
904
|
-
"User-Agent": "@airtop/sdk/0.1.16
|
338
|
+
"X-Fern-SDK-Version": "0.1.16",
|
339
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
905
340
|
"X-Fern-Runtime": core.RUNTIME.type,
|
906
341
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
907
342
|
},
|
@@ -963,8 +398,8 @@ class Windows {
|
|
963
398
|
Authorization: yield this._getAuthorizationHeader(),
|
964
399
|
"X-Fern-Language": "JavaScript",
|
965
400
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
966
|
-
"X-Fern-SDK-Version": "0.1.16
|
967
|
-
"User-Agent": "@airtop/sdk/0.1.16
|
401
|
+
"X-Fern-SDK-Version": "0.1.16",
|
402
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
968
403
|
"X-Fern-Runtime": core.RUNTIME.type,
|
969
404
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
970
405
|
},
|
@@ -1005,69 +440,6 @@ class Windows {
|
|
1005
440
|
}
|
1006
441
|
});
|
1007
442
|
}
|
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-beta0",
|
1028
|
-
"User-Agent": "@airtop/sdk/0.1.16-beta0",
|
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
443
|
/**
|
1072
444
|
* 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
445
|
*
|
@@ -1091,8 +463,8 @@ class Windows {
|
|
1091
463
|
Authorization: yield this._getAuthorizationHeader(),
|
1092
464
|
"X-Fern-Language": "JavaScript",
|
1093
465
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
1094
|
-
"X-Fern-SDK-Version": "0.1.16
|
1095
|
-
"User-Agent": "@airtop/sdk/0.1.16
|
466
|
+
"X-Fern-SDK-Version": "0.1.16",
|
467
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
1096
468
|
"X-Fern-Runtime": core.RUNTIME.type,
|
1097
469
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
1098
470
|
},
|
@@ -1156,8 +528,8 @@ class Windows {
|
|
1156
528
|
Authorization: yield this._getAuthorizationHeader(),
|
1157
529
|
"X-Fern-Language": "JavaScript",
|
1158
530
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
1159
|
-
"X-Fern-SDK-Version": "0.1.16
|
1160
|
-
"User-Agent": "@airtop/sdk/0.1.16
|
531
|
+
"X-Fern-SDK-Version": "0.1.16",
|
532
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
1161
533
|
"X-Fern-Runtime": core.RUNTIME.type,
|
1162
534
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
1163
535
|
},
|
@@ -1223,8 +595,8 @@ class Windows {
|
|
1223
595
|
Authorization: yield this._getAuthorizationHeader(),
|
1224
596
|
"X-Fern-Language": "JavaScript",
|
1225
597
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
1226
|
-
"X-Fern-SDK-Version": "0.1.16
|
1227
|
-
"User-Agent": "@airtop/sdk/0.1.16
|
598
|
+
"X-Fern-SDK-Version": "0.1.16",
|
599
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
1228
600
|
"X-Fern-Runtime": core.RUNTIME.type,
|
1229
601
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
1230
602
|
},
|
@@ -1288,8 +660,8 @@ class Windows {
|
|
1288
660
|
Authorization: yield this._getAuthorizationHeader(),
|
1289
661
|
"X-Fern-Language": "JavaScript",
|
1290
662
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
1291
|
-
"X-Fern-SDK-Version": "0.1.16
|
1292
|
-
"User-Agent": "@airtop/sdk/0.1.16
|
663
|
+
"X-Fern-SDK-Version": "0.1.16",
|
664
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
1293
665
|
"X-Fern-Runtime": core.RUNTIME.type,
|
1294
666
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
1295
667
|
},
|
@@ -1351,8 +723,8 @@ class Windows {
|
|
1351
723
|
Authorization: yield this._getAuthorizationHeader(),
|
1352
724
|
"X-Fern-Language": "JavaScript",
|
1353
725
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
1354
|
-
"X-Fern-SDK-Version": "0.1.16
|
1355
|
-
"User-Agent": "@airtop/sdk/0.1.16
|
726
|
+
"X-Fern-SDK-Version": "0.1.16",
|
727
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
1356
728
|
"X-Fern-Runtime": core.RUNTIME.type,
|
1357
729
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
1358
730
|
},
|
@@ -1416,8 +788,8 @@ class Windows {
|
|
1416
788
|
Authorization: yield this._getAuthorizationHeader(),
|
1417
789
|
"X-Fern-Language": "JavaScript",
|
1418
790
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
1419
|
-
"X-Fern-SDK-Version": "0.1.16
|
1420
|
-
"User-Agent": "@airtop/sdk/0.1.16
|
791
|
+
"X-Fern-SDK-Version": "0.1.16",
|
792
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
1421
793
|
"X-Fern-Runtime": core.RUNTIME.type,
|
1422
794
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
1423
795
|
},
|
@@ -1483,8 +855,8 @@ class Windows {
|
|
1483
855
|
Authorization: yield this._getAuthorizationHeader(),
|
1484
856
|
"X-Fern-Language": "JavaScript",
|
1485
857
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
1486
|
-
"X-Fern-SDK-Version": "0.1.16
|
1487
|
-
"User-Agent": "@airtop/sdk/0.1.16
|
858
|
+
"X-Fern-SDK-Version": "0.1.16",
|
859
|
+
"User-Agent": "@airtop/sdk/0.1.16",
|
1488
860
|
"X-Fern-Runtime": core.RUNTIME.type,
|
1489
861
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
1490
862
|
},
|