@airtop/sdk 0.1.35-beta0 → 0.1.36-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/api/resources/automations/client/Client.d.ts +8 -8
- package/api/resources/automations/client/Client.js +12 -12
- package/api/resources/files/client/Client.js +4 -4
- package/api/resources/files/client/requests/CreateFileRestInputV1.d.ts +2 -0
- package/api/resources/profiles/client/Client.js +1 -1
- package/api/resources/requests/client/Client.js +1 -1
- package/api/resources/sessions/client/Client.d.ts +0 -10
- package/api/resources/sessions/client/Client.js +6 -52
- 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 +52 -0
- package/api/resources/windows/client/Client.js +250 -26
- package/api/resources/windows/client/requests/AsyncCreateFormFillerRequest.d.ts +23 -0
- package/api/resources/windows/client/requests/AsyncFillFormRequest.d.ts +27 -0
- package/api/resources/windows/client/requests/CreateFormFillerRequest.d.ts +23 -0
- package/api/resources/windows/client/requests/CreateFormFillerRequest.js +5 -0
- package/api/resources/windows/client/requests/FillFormRequest.d.ts +27 -0
- package/api/resources/windows/client/requests/FillFormRequest.js +5 -0
- package/api/resources/windows/client/requests/index.d.ts +4 -0
- package/api/types/index.d.ts +0 -11
- package/api/types/index.js +0 -11
- package/dist/api/resources/automations/client/Client.d.ts +8 -8
- package/dist/api/resources/automations/client/Client.js +12 -12
- package/dist/api/resources/files/client/Client.js +4 -4
- package/dist/api/resources/files/client/requests/CreateFileRestInputV1.d.ts +2 -0
- package/dist/api/resources/profiles/client/Client.js +1 -1
- package/dist/api/resources/requests/client/Client.js +1 -1
- package/dist/api/resources/sessions/client/Client.d.ts +0 -10
- package/dist/api/resources/sessions/client/Client.js +6 -52
- 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 +52 -0
- package/dist/api/resources/windows/client/Client.js +250 -26
- package/dist/api/resources/windows/client/requests/AsyncCreateFormFillerRequest.d.ts +23 -0
- package/dist/api/resources/windows/client/requests/AsyncCreateFormFillerRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/AsyncFillFormRequest.d.ts +27 -0
- package/dist/api/resources/windows/client/requests/AsyncFillFormRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/CreateFormFillerRequest.d.ts +23 -0
- package/dist/api/resources/windows/client/requests/CreateFormFillerRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/FillFormRequest.d.ts +27 -0
- package/dist/api/resources/windows/client/requests/FillFormRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/index.d.ts +4 -0
- package/dist/api/types/index.d.ts +0 -11
- package/dist/api/types/index.js +0 -11
- package/dist/serialization/resources/files/client/requests/CreateFileRestInputV1.d.ts +1 -0
- package/dist/serialization/resources/files/client/requests/CreateFileRestInputV1.js +1 -0
- 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/AsyncCreateFormFillerRequest.d.ts +18 -0
- package/dist/serialization/resources/windows/client/requests/AsyncCreateFormFillerRequest.js +49 -0
- package/dist/serialization/resources/windows/client/requests/AsyncFillFormRequest.d.ts +18 -0
- package/dist/serialization/resources/windows/client/requests/AsyncFillFormRequest.js +49 -0
- package/dist/serialization/resources/windows/client/requests/CreateFormFillerRequest.d.ts +18 -0
- package/dist/serialization/resources/windows/client/requests/CreateFormFillerRequest.js +49 -0
- package/dist/serialization/resources/windows/client/requests/FillFormRequest.d.ts +18 -0
- package/dist/serialization/resources/windows/client/requests/FillFormRequest.js +49 -0
- package/dist/serialization/resources/windows/client/requests/index.d.ts +4 -0
- package/dist/serialization/resources/windows/client/requests/index.js +9 -1
- package/dist/serialization/types/index.d.ts +0 -11
- package/dist/serialization/types/index.js +0 -11
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/wrapper/AirtopClient.d.ts +2 -1
- package/dist/wrapper/AirtopClient.js +6 -3
- package/dist/wrapper/AirtopWindows.d.ts +1 -1
- package/package.json +2 -3
- package/reference.md +253 -395
- package/serialization/resources/files/client/requests/CreateFileRestInputV1.d.ts +1 -0
- package/serialization/resources/files/client/requests/CreateFileRestInputV1.js +1 -0
- 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/AsyncCreateFormFillerRequest.d.ts +18 -0
- package/serialization/resources/windows/client/requests/AsyncCreateFormFillerRequest.js +49 -0
- package/serialization/resources/windows/client/requests/AsyncFillFormRequest.d.ts +18 -0
- package/serialization/resources/windows/client/requests/AsyncFillFormRequest.js +49 -0
- package/serialization/resources/windows/client/requests/CreateFormFillerRequest.d.ts +18 -0
- package/serialization/resources/windows/client/requests/CreateFormFillerRequest.js +49 -0
- package/serialization/resources/windows/client/requests/FillFormRequest.d.ts +18 -0
- package/serialization/resources/windows/client/requests/FillFormRequest.js +49 -0
- package/serialization/resources/windows/client/requests/index.d.ts +4 -0
- package/serialization/resources/windows/client/requests/index.js +9 -1
- package/serialization/types/index.d.ts +0 -11
- package/serialization/types/index.js +0 -11
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/wrapper/AirtopClient.d.ts +2 -1
- package/wrapper/AirtopClient.js +6 -3
- package/wrapper/AirtopWindows.d.ts +1 -1
- package/api/types/ExtensionConfigurationOutput.d.ts +0 -13
- package/dist/api/types/ExtensionConfigurationOutput.d.ts +0 -13
- /package/api/{types/ExtensionConfigurationOutput.js → resources/windows/client/requests/AsyncCreateFormFillerRequest.js} +0 -0
- /package/{dist/api/types/ExtensionConfigurationOutput.js → api/resources/windows/client/requests/AsyncFillFormRequest.js} +0 -0
@@ -77,7 +77,7 @@ class Windows {
|
|
77
77
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
78
78
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/click`),
|
79
79
|
method: "POST",
|
80
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
80
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.36-beta0", "User-Agent": "@airtop/sdk/0.1.36-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
81
81
|
contentType: "application/json",
|
82
82
|
requestType: "json",
|
83
83
|
body: serializers.AsyncClickRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
@@ -132,7 +132,7 @@ class Windows {
|
|
132
132
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
133
133
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/create-automation`),
|
134
134
|
method: "POST",
|
135
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
135
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.36-beta0", "User-Agent": "@airtop/sdk/0.1.36-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
136
136
|
contentType: "application/json",
|
137
137
|
requestType: "json",
|
138
138
|
body: serializers.AsyncCreateAutomationRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
@@ -170,6 +170,61 @@ class Windows {
|
|
170
170
|
}
|
171
171
|
});
|
172
172
|
}
|
173
|
+
/**
|
174
|
+
* Create a form filler automation asynchronously
|
175
|
+
*
|
176
|
+
* @param {string} sessionId - The session id for the window.
|
177
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
178
|
+
* @param {Airtop.AsyncCreateFormFillerRequest} request
|
179
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
180
|
+
*
|
181
|
+
* @example
|
182
|
+
* await client.windows.asyncCreateFormFiller("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
183
|
+
*/
|
184
|
+
asyncCreateFormFiller(sessionId_1, windowId_1) {
|
185
|
+
return __awaiter(this, arguments, void 0, function* (sessionId, windowId, request = {}, requestOptions) {
|
186
|
+
var _a, _b, _c;
|
187
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
188
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/create-form-filler`),
|
189
|
+
method: "POST",
|
190
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.36-beta0", "User-Agent": "@airtop/sdk/0.1.36-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
191
|
+
contentType: "application/json",
|
192
|
+
requestType: "json",
|
193
|
+
body: serializers.AsyncCreateFormFillerRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
194
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
195
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
196
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
197
|
+
});
|
198
|
+
if (_response.ok) {
|
199
|
+
return serializers.AsyncSessionAiResponseEnvelope.parseOrThrow(_response.body, {
|
200
|
+
unrecognizedObjectKeys: "passthrough",
|
201
|
+
allowUnrecognizedUnionMembers: true,
|
202
|
+
allowUnrecognizedEnumValues: true,
|
203
|
+
skipValidation: true,
|
204
|
+
breadcrumbsPrefix: ["response"],
|
205
|
+
});
|
206
|
+
}
|
207
|
+
if (_response.error.reason === "status-code") {
|
208
|
+
throw new errors.AirtopError({
|
209
|
+
statusCode: _response.error.statusCode,
|
210
|
+
body: _response.error.body,
|
211
|
+
});
|
212
|
+
}
|
213
|
+
switch (_response.error.reason) {
|
214
|
+
case "non-json":
|
215
|
+
throw new errors.AirtopError({
|
216
|
+
statusCode: _response.error.statusCode,
|
217
|
+
body: _response.error.rawBody,
|
218
|
+
});
|
219
|
+
case "timeout":
|
220
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /async/sessions/{sessionId}/windows/{windowId}/create-form-filler.");
|
221
|
+
case "unknown":
|
222
|
+
throw new errors.AirtopError({
|
223
|
+
message: _response.error.errorMessage,
|
224
|
+
});
|
225
|
+
}
|
226
|
+
});
|
227
|
+
}
|
173
228
|
/**
|
174
229
|
* Execute an automation of a browser window asynchronously
|
175
230
|
*
|
@@ -189,7 +244,7 @@ class Windows {
|
|
189
244
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
190
245
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/execute-automation`),
|
191
246
|
method: "POST",
|
192
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
247
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.36-beta0", "User-Agent": "@airtop/sdk/0.1.36-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
193
248
|
contentType: "application/json",
|
194
249
|
requestType: "json",
|
195
250
|
body: serializers.AsyncExecuteAutomationRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
@@ -227,6 +282,63 @@ class Windows {
|
|
227
282
|
}
|
228
283
|
});
|
229
284
|
}
|
285
|
+
/**
|
286
|
+
* Fill a form of a browser window asynchronously using a form-filler automation
|
287
|
+
*
|
288
|
+
* @param {string} sessionId - The session id for the window.
|
289
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
290
|
+
* @param {Airtop.AsyncFillFormRequest} request
|
291
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
292
|
+
*
|
293
|
+
* @example
|
294
|
+
* await client.windows.asyncFillForm("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
295
|
+
* automationId: "automationId"
|
296
|
+
* })
|
297
|
+
*/
|
298
|
+
asyncFillForm(sessionId, windowId, request, requestOptions) {
|
299
|
+
return __awaiter(this, void 0, void 0, function* () {
|
300
|
+
var _a, _b, _c;
|
301
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
302
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/fill-form`),
|
303
|
+
method: "POST",
|
304
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.36-beta0", "User-Agent": "@airtop/sdk/0.1.36-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
305
|
+
contentType: "application/json",
|
306
|
+
requestType: "json",
|
307
|
+
body: serializers.AsyncFillFormRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
308
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
309
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
310
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
311
|
+
});
|
312
|
+
if (_response.ok) {
|
313
|
+
return serializers.AsyncSessionAiResponseEnvelope.parseOrThrow(_response.body, {
|
314
|
+
unrecognizedObjectKeys: "passthrough",
|
315
|
+
allowUnrecognizedUnionMembers: true,
|
316
|
+
allowUnrecognizedEnumValues: true,
|
317
|
+
skipValidation: true,
|
318
|
+
breadcrumbsPrefix: ["response"],
|
319
|
+
});
|
320
|
+
}
|
321
|
+
if (_response.error.reason === "status-code") {
|
322
|
+
throw new errors.AirtopError({
|
323
|
+
statusCode: _response.error.statusCode,
|
324
|
+
body: _response.error.body,
|
325
|
+
});
|
326
|
+
}
|
327
|
+
switch (_response.error.reason) {
|
328
|
+
case "non-json":
|
329
|
+
throw new errors.AirtopError({
|
330
|
+
statusCode: _response.error.statusCode,
|
331
|
+
body: _response.error.rawBody,
|
332
|
+
});
|
333
|
+
case "timeout":
|
334
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /async/sessions/{sessionId}/windows/{windowId}/fill-form.");
|
335
|
+
case "unknown":
|
336
|
+
throw new errors.AirtopError({
|
337
|
+
message: _response.error.errorMessage,
|
338
|
+
});
|
339
|
+
}
|
340
|
+
});
|
341
|
+
}
|
230
342
|
/**
|
231
343
|
* @param {string} sessionId - The session id for the window.
|
232
344
|
* @param {string} windowId - The Airtop window id of the browser window.
|
@@ -244,7 +356,7 @@ class Windows {
|
|
244
356
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
245
357
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/hover`),
|
246
358
|
method: "POST",
|
247
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
359
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.36-beta0", "User-Agent": "@airtop/sdk/0.1.36-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
248
360
|
contentType: "application/json",
|
249
361
|
requestType: "json",
|
250
362
|
body: serializers.AsyncHoverRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
@@ -299,7 +411,7 @@ class Windows {
|
|
299
411
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
300
412
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/monitor`),
|
301
413
|
method: "POST",
|
302
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
414
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.36-beta0", "User-Agent": "@airtop/sdk/0.1.36-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
303
415
|
contentType: "application/json",
|
304
416
|
requestType: "json",
|
305
417
|
body: serializers.AsyncMonitorRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
@@ -354,7 +466,7 @@ class Windows {
|
|
354
466
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
355
467
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/page-query`),
|
356
468
|
method: "POST",
|
357
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
469
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.36-beta0", "User-Agent": "@airtop/sdk/0.1.36-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
358
470
|
contentType: "application/json",
|
359
471
|
requestType: "json",
|
360
472
|
body: serializers.AsyncPageQueryRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
@@ -409,7 +521,7 @@ class Windows {
|
|
409
521
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
410
522
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/paginated-extraction`),
|
411
523
|
method: "POST",
|
412
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
524
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.36-beta0", "User-Agent": "@airtop/sdk/0.1.36-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
413
525
|
contentType: "application/json",
|
414
526
|
requestType: "json",
|
415
527
|
body: serializers.AsyncPaginatedExtractionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
@@ -466,7 +578,7 @@ class Windows {
|
|
466
578
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
467
579
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/prompt-content`),
|
468
580
|
method: "POST",
|
469
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
581
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.36-beta0", "User-Agent": "@airtop/sdk/0.1.36-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
470
582
|
contentType: "application/json",
|
471
583
|
requestType: "json",
|
472
584
|
body: serializers.AsyncPromptContentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
@@ -521,7 +633,7 @@ class Windows {
|
|
521
633
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
522
634
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/screenshot`),
|
523
635
|
method: "POST",
|
524
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
636
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.36-beta0", "User-Agent": "@airtop/sdk/0.1.36-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
525
637
|
contentType: "application/json",
|
526
638
|
requestType: "json",
|
527
639
|
body: serializers.AsyncScreenshotRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
@@ -576,7 +688,7 @@ class Windows {
|
|
576
688
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
577
689
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/summarize-content`),
|
578
690
|
method: "POST",
|
579
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
691
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.36-beta0", "User-Agent": "@airtop/sdk/0.1.36-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
580
692
|
contentType: "application/json",
|
581
693
|
requestType: "json",
|
582
694
|
body: serializers.AsyncSummarizeContentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
@@ -631,7 +743,7 @@ class Windows {
|
|
631
743
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
632
744
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/type`),
|
633
745
|
method: "POST",
|
634
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
746
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.36-beta0", "User-Agent": "@airtop/sdk/0.1.36-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
635
747
|
contentType: "application/json",
|
636
748
|
requestType: "json",
|
637
749
|
body: serializers.AsyncTypeRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
@@ -685,7 +797,7 @@ class Windows {
|
|
685
797
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
686
798
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows`),
|
687
799
|
method: "POST",
|
688
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
800
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.36-beta0", "User-Agent": "@airtop/sdk/0.1.36-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
689
801
|
contentType: "application/json",
|
690
802
|
requestType: "json",
|
691
803
|
body: serializers.CreateWindowInputV1Body.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
@@ -753,7 +865,7 @@ class Windows {
|
|
753
865
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
754
866
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}`),
|
755
867
|
method: "GET",
|
756
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
868
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.36-beta0", "User-Agent": "@airtop/sdk/0.1.36-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
757
869
|
contentType: "application/json",
|
758
870
|
queryParameters: _queryParams,
|
759
871
|
requestType: "json",
|
@@ -810,7 +922,7 @@ class Windows {
|
|
810
922
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
811
923
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}`),
|
812
924
|
method: "POST",
|
813
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
925
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.36-beta0", "User-Agent": "@airtop/sdk/0.1.36-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
814
926
|
contentType: "application/json",
|
815
927
|
requestType: "json",
|
816
928
|
body: serializers.WindowLoadUrlV1Body.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
@@ -864,7 +976,7 @@ class Windows {
|
|
864
976
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
865
977
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}`),
|
866
978
|
method: "DELETE",
|
867
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
979
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.36-beta0", "User-Agent": "@airtop/sdk/0.1.36-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
868
980
|
contentType: "application/json",
|
869
981
|
requestType: "json",
|
870
982
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
@@ -920,7 +1032,7 @@ class Windows {
|
|
920
1032
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
921
1033
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/click`),
|
922
1034
|
method: "POST",
|
923
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1035
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.36-beta0", "User-Agent": "@airtop/sdk/0.1.36-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
924
1036
|
contentType: "application/json",
|
925
1037
|
requestType: "json",
|
926
1038
|
body: serializers.SessionClickHandlerRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
@@ -958,6 +1070,118 @@ class Windows {
|
|
958
1070
|
}
|
959
1071
|
});
|
960
1072
|
}
|
1073
|
+
/**
|
1074
|
+
* Create a form-filler automation synchronously for the form loaded in the browser window
|
1075
|
+
*
|
1076
|
+
* @param {string} sessionId - The session id for the window.
|
1077
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
1078
|
+
* @param {Airtop.CreateFormFillerRequest} request
|
1079
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
1080
|
+
*
|
1081
|
+
* @example
|
1082
|
+
* await client.windows.createFormFiller("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
1083
|
+
*/
|
1084
|
+
createFormFiller(sessionId_1, windowId_1) {
|
1085
|
+
return __awaiter(this, arguments, void 0, function* (sessionId, windowId, request = {}, requestOptions) {
|
1086
|
+
var _a, _b, _c;
|
1087
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1088
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/create-form-filler`),
|
1089
|
+
method: "POST",
|
1090
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.36-beta0", "User-Agent": "@airtop/sdk/0.1.36-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1091
|
+
contentType: "application/json",
|
1092
|
+
requestType: "json",
|
1093
|
+
body: serializers.CreateFormFillerRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
1094
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1095
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1096
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
1097
|
+
});
|
1098
|
+
if (_response.ok) {
|
1099
|
+
return serializers.AiPromptResponse.parseOrThrow(_response.body, {
|
1100
|
+
unrecognizedObjectKeys: "passthrough",
|
1101
|
+
allowUnrecognizedUnionMembers: true,
|
1102
|
+
allowUnrecognizedEnumValues: true,
|
1103
|
+
skipValidation: true,
|
1104
|
+
breadcrumbsPrefix: ["response"],
|
1105
|
+
});
|
1106
|
+
}
|
1107
|
+
if (_response.error.reason === "status-code") {
|
1108
|
+
throw new errors.AirtopError({
|
1109
|
+
statusCode: _response.error.statusCode,
|
1110
|
+
body: _response.error.body,
|
1111
|
+
});
|
1112
|
+
}
|
1113
|
+
switch (_response.error.reason) {
|
1114
|
+
case "non-json":
|
1115
|
+
throw new errors.AirtopError({
|
1116
|
+
statusCode: _response.error.statusCode,
|
1117
|
+
body: _response.error.rawBody,
|
1118
|
+
});
|
1119
|
+
case "timeout":
|
1120
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /sessions/{sessionId}/windows/{windowId}/create-form-filler.");
|
1121
|
+
case "unknown":
|
1122
|
+
throw new errors.AirtopError({
|
1123
|
+
message: _response.error.errorMessage,
|
1124
|
+
});
|
1125
|
+
}
|
1126
|
+
});
|
1127
|
+
}
|
1128
|
+
/**
|
1129
|
+
* Fill a form of a browser window synchronously using a form-filler automation
|
1130
|
+
*
|
1131
|
+
* @param {string} sessionId - The session id for the window.
|
1132
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
1133
|
+
* @param {Airtop.FillFormRequest} request
|
1134
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
1135
|
+
*
|
1136
|
+
* @example
|
1137
|
+
* await client.windows.fillForm("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
1138
|
+
* automationId: "automationId"
|
1139
|
+
* })
|
1140
|
+
*/
|
1141
|
+
fillForm(sessionId, windowId, request, requestOptions) {
|
1142
|
+
return __awaiter(this, void 0, void 0, function* () {
|
1143
|
+
var _a, _b, _c;
|
1144
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1145
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/fill-form`),
|
1146
|
+
method: "POST",
|
1147
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.36-beta0", "User-Agent": "@airtop/sdk/0.1.36-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1148
|
+
contentType: "application/json",
|
1149
|
+
requestType: "json",
|
1150
|
+
body: serializers.FillFormRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
1151
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1152
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1153
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
1154
|
+
});
|
1155
|
+
if (_response.ok) {
|
1156
|
+
return serializers.AiPromptResponse.parseOrThrow(_response.body, {
|
1157
|
+
unrecognizedObjectKeys: "passthrough",
|
1158
|
+
allowUnrecognizedUnionMembers: true,
|
1159
|
+
allowUnrecognizedEnumValues: true,
|
1160
|
+
skipValidation: true,
|
1161
|
+
breadcrumbsPrefix: ["response"],
|
1162
|
+
});
|
1163
|
+
}
|
1164
|
+
if (_response.error.reason === "status-code") {
|
1165
|
+
throw new errors.AirtopError({
|
1166
|
+
statusCode: _response.error.statusCode,
|
1167
|
+
body: _response.error.body,
|
1168
|
+
});
|
1169
|
+
}
|
1170
|
+
switch (_response.error.reason) {
|
1171
|
+
case "non-json":
|
1172
|
+
throw new errors.AirtopError({
|
1173
|
+
statusCode: _response.error.statusCode,
|
1174
|
+
body: _response.error.rawBody,
|
1175
|
+
});
|
1176
|
+
case "timeout":
|
1177
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /sessions/{sessionId}/windows/{windowId}/fill-form.");
|
1178
|
+
case "unknown":
|
1179
|
+
throw new errors.AirtopError({
|
1180
|
+
message: _response.error.errorMessage,
|
1181
|
+
});
|
1182
|
+
}
|
1183
|
+
});
|
1184
|
+
}
|
961
1185
|
/**
|
962
1186
|
* Execute a hover interaction in a specific browser window
|
963
1187
|
*
|
@@ -977,7 +1201,7 @@ class Windows {
|
|
977
1201
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
978
1202
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/hover`),
|
979
1203
|
method: "POST",
|
980
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1204
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.36-beta0", "User-Agent": "@airtop/sdk/0.1.36-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
981
1205
|
contentType: "application/json",
|
982
1206
|
requestType: "json",
|
983
1207
|
body: serializers.SessionHoverHandlerRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
@@ -1032,7 +1256,7 @@ class Windows {
|
|
1032
1256
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1033
1257
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/monitor`),
|
1034
1258
|
method: "POST",
|
1035
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1259
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.36-beta0", "User-Agent": "@airtop/sdk/0.1.36-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1036
1260
|
contentType: "application/json",
|
1037
1261
|
requestType: "json",
|
1038
1262
|
body: serializers.SessionMonitorHandlerRequestBody.jsonOrThrow(request, {
|
@@ -1091,7 +1315,7 @@ class Windows {
|
|
1091
1315
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1092
1316
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/page-query`),
|
1093
1317
|
method: "POST",
|
1094
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1318
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.36-beta0", "User-Agent": "@airtop/sdk/0.1.36-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1095
1319
|
contentType: "application/json",
|
1096
1320
|
requestType: "json",
|
1097
1321
|
body: serializers.SessionPageQueryHandlerRequestBody.jsonOrThrow(request, {
|
@@ -1150,7 +1374,7 @@ class Windows {
|
|
1150
1374
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1151
1375
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/paginated-extraction`),
|
1152
1376
|
method: "POST",
|
1153
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1377
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.36-beta0", "User-Agent": "@airtop/sdk/0.1.36-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1154
1378
|
contentType: "application/json",
|
1155
1379
|
requestType: "json",
|
1156
1380
|
body: serializers.SessionPaginatedExtractionHandlerRequestBody.jsonOrThrow(request, {
|
@@ -1209,7 +1433,7 @@ class Windows {
|
|
1209
1433
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1210
1434
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/prompt-content`),
|
1211
1435
|
method: "POST",
|
1212
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1436
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.36-beta0", "User-Agent": "@airtop/sdk/0.1.36-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1213
1437
|
contentType: "application/json",
|
1214
1438
|
requestType: "json",
|
1215
1439
|
body: serializers.SessionPageQueryHandlerRequestBody.jsonOrThrow(request, {
|
@@ -1266,7 +1490,7 @@ class Windows {
|
|
1266
1490
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1267
1491
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/scrape-content`),
|
1268
1492
|
method: "POST",
|
1269
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1493
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.36-beta0", "User-Agent": "@airtop/sdk/0.1.36-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1270
1494
|
contentType: "application/json",
|
1271
1495
|
requestType: "json",
|
1272
1496
|
body: serializers.ScrapeContentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
@@ -1321,7 +1545,7 @@ class Windows {
|
|
1321
1545
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1322
1546
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/screenshot`),
|
1323
1547
|
method: "POST",
|
1324
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1548
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.36-beta0", "User-Agent": "@airtop/sdk/0.1.36-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1325
1549
|
contentType: "application/json",
|
1326
1550
|
requestType: "json",
|
1327
1551
|
body: serializers.SessionScreenshotHandlerRequestBody.jsonOrThrow(request, {
|
@@ -1378,7 +1602,7 @@ class Windows {
|
|
1378
1602
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1379
1603
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/scroll`),
|
1380
1604
|
method: "POST",
|
1381
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1605
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.36-beta0", "User-Agent": "@airtop/sdk/0.1.36-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1382
1606
|
contentType: "application/json",
|
1383
1607
|
requestType: "json",
|
1384
1608
|
body: serializers.SessionScrollHandlerRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
@@ -1433,7 +1657,7 @@ class Windows {
|
|
1433
1657
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1434
1658
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/summarize-content`),
|
1435
1659
|
method: "POST",
|
1436
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1660
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.36-beta0", "User-Agent": "@airtop/sdk/0.1.36-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1437
1661
|
contentType: "application/json",
|
1438
1662
|
requestType: "json",
|
1439
1663
|
body: serializers.SessionSummaryHandlerRequestBody.jsonOrThrow(request, {
|
@@ -1492,7 +1716,7 @@ class Windows {
|
|
1492
1716
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1493
1717
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/type`),
|
1494
1718
|
method: "POST",
|
1495
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1719
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.36-beta0", "User-Agent": "@airtop/sdk/0.1.36-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1496
1720
|
contentType: "application/json",
|
1497
1721
|
requestType: "json",
|
1498
1722
|
body: serializers.SessionTypeHandlerRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
@@ -0,0 +1,23 @@
|
|
1
|
+
/**
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
3
|
+
*/
|
4
|
+
import * as Airtop from "../../../../index";
|
5
|
+
/**
|
6
|
+
* @example
|
7
|
+
* {}
|
8
|
+
*/
|
9
|
+
export interface AsyncCreateFormFillerRequest {
|
10
|
+
/** Async configuration options. */
|
11
|
+
async?: Airtop.AsyncConfig;
|
12
|
+
clientRequestId?: string;
|
13
|
+
/** Request configuration */
|
14
|
+
configuration?: Airtop.CreateAutomationRequestBodyConfiguration;
|
15
|
+
/** A credit threshold that, once exceeded, will cause the operation to be cancelled. Note that this is *not* a hard limit, but a threshold that is checked periodically during the course of fulfilling the request. A default threshold is used if not specified, but you can use this option to increase or decrease as needed. Set to 0 to disable this feature entirely (not recommended). */
|
16
|
+
costThresholdCredits?: number;
|
17
|
+
/**
|
18
|
+
* A time threshold in seconds that, once exceeded, will cause the operation to be cancelled. Note that this is *not* a hard limit, but a threshold that is checked periodically during the course of fulfilling the request. A default threshold is used if not specified, but you can use this option to increase or decrease as needed. Set to 0 to disable this feature entirely (not recommended).
|
19
|
+
*
|
20
|
+
* This setting does not extend the maximum session duration provided at the time of session creation.
|
21
|
+
*/
|
22
|
+
timeThresholdSeconds?: number;
|
23
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
/**
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
3
|
+
*/
|
4
|
+
import * as Airtop from "../../../../index";
|
5
|
+
/**
|
6
|
+
* @example
|
7
|
+
* {
|
8
|
+
* automationId: "automationId"
|
9
|
+
* }
|
10
|
+
*/
|
11
|
+
export interface AsyncFillFormRequest {
|
12
|
+
/** Async configuration options. */
|
13
|
+
async?: Airtop.AsyncConfig;
|
14
|
+
/** The ID of the automation to execute */
|
15
|
+
automationId: string;
|
16
|
+
clientRequestId?: string;
|
17
|
+
/** A credit threshold that, once exceeded, will cause the operation to be cancelled. Note that this is *not* a hard limit, but a threshold that is checked periodically during the course of fulfilling the request. A default threshold is used if not specified, but you can use this option to increase or decrease as needed. Set to 0 to disable this feature entirely (not recommended). */
|
18
|
+
costThresholdCredits?: number;
|
19
|
+
/** Optional parameters to pass to the automation execution */
|
20
|
+
parameters?: Record<string, unknown>;
|
21
|
+
/**
|
22
|
+
* A time threshold in seconds that, once exceeded, will cause the operation to be cancelled. Note that this is *not* a hard limit, but a threshold that is checked periodically during the course of fulfilling the request. A default threshold is used if not specified, but you can use this option to increase or decrease as needed. Set to 0 to disable this feature entirely (not recommended).
|
23
|
+
*
|
24
|
+
* This setting does not extend the maximum session duration provided at the time of session creation.
|
25
|
+
*/
|
26
|
+
timeThresholdSeconds?: number;
|
27
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
/**
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
3
|
+
*/
|
4
|
+
import * as Airtop from "../../../../index";
|
5
|
+
/**
|
6
|
+
* @example
|
7
|
+
* {}
|
8
|
+
*/
|
9
|
+
export interface CreateFormFillerRequest {
|
10
|
+
/** Async configuration options. */
|
11
|
+
async?: Airtop.AsyncConfig;
|
12
|
+
clientRequestId?: string;
|
13
|
+
/** Request configuration */
|
14
|
+
configuration?: Airtop.CreateAutomationRequestBodyConfiguration;
|
15
|
+
/** A credit threshold that, once exceeded, will cause the operation to be cancelled. Note that this is *not* a hard limit, but a threshold that is checked periodically during the course of fulfilling the request. A default threshold is used if not specified, but you can use this option to increase or decrease as needed. Set to 0 to disable this feature entirely (not recommended). */
|
16
|
+
costThresholdCredits?: number;
|
17
|
+
/**
|
18
|
+
* A time threshold in seconds that, once exceeded, will cause the operation to be cancelled. Note that this is *not* a hard limit, but a threshold that is checked periodically during the course of fulfilling the request. A default threshold is used if not specified, but you can use this option to increase or decrease as needed. Set to 0 to disable this feature entirely (not recommended).
|
19
|
+
*
|
20
|
+
* This setting does not extend the maximum session duration provided at the time of session creation.
|
21
|
+
*/
|
22
|
+
timeThresholdSeconds?: number;
|
23
|
+
}
|