@airtop/sdk 0.1.12 → 0.1.14

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.
Files changed (138) hide show
  1. package/api/resources/profiles/client/Client.d.ts +0 -10
  2. package/api/resources/profiles/client/Client.js +2 -82
  3. package/api/resources/profiles/client/requests/index.d.ts +0 -1
  4. package/api/resources/sessions/client/Client.js +12 -12
  5. package/api/resources/sessions/types/SessionsEventsResponse.d.ts +4 -4
  6. package/api/resources/sessions/types/index.d.ts +1 -1
  7. package/api/resources/sessions/types/index.js +1 -1
  8. package/api/resources/windows/client/Client.d.ts +32 -0
  9. package/api/resources/windows/client/Client.js +109 -24
  10. package/api/resources/windows/client/requests/SessionHoverHandlerRequestBody.d.ts +1 -1
  11. package/api/resources/windows/client/requests/SessionScreenshotHandlerRequestBody.d.ts +21 -0
  12. package/api/resources/windows/client/requests/SessionTypeHandlerRequestBody.d.ts +5 -1
  13. package/api/resources/windows/client/requests/index.d.ts +1 -0
  14. package/api/types/ClickConfig.d.ts +2 -0
  15. package/api/types/ClickConfigClickType.d.ts +12 -0
  16. package/api/types/ClickConfigClickType.js +11 -0
  17. package/api/types/ExternalSessionAiResponseMetadata.d.ts +2 -0
  18. package/api/types/MicroInteractionConfig.d.ts +10 -0
  19. package/api/types/ScreenshotConfig.d.ts +13 -0
  20. package/api/types/ScreenshotMetadata.d.ts +7 -0
  21. package/api/types/ScreenshotRequestConfig.d.ts +8 -0
  22. package/api/types/VisualAnalysisConfig.d.ts +5 -1
  23. package/api/types/VisualAnalysisConfigScope.d.ts +4 -2
  24. package/api/types/VisualAnalysisConfigScope.js +2 -0
  25. package/api/types/index.d.ts +5 -2
  26. package/api/types/index.js +5 -2
  27. package/dist/api/resources/profiles/client/Client.d.ts +0 -10
  28. package/dist/api/resources/profiles/client/Client.js +2 -82
  29. package/dist/api/resources/profiles/client/requests/index.d.ts +0 -1
  30. package/dist/api/resources/sessions/client/Client.js +12 -12
  31. package/dist/api/resources/sessions/types/SessionsEventsResponse.d.ts +4 -4
  32. package/dist/api/resources/sessions/types/index.d.ts +1 -1
  33. package/dist/api/resources/sessions/types/index.js +1 -1
  34. package/dist/api/resources/windows/client/Client.d.ts +32 -0
  35. package/dist/api/resources/windows/client/Client.js +109 -24
  36. package/dist/api/resources/windows/client/requests/SessionHoverHandlerRequestBody.d.ts +1 -1
  37. package/dist/api/resources/windows/client/requests/SessionScreenshotHandlerRequestBody.d.ts +21 -0
  38. package/dist/api/resources/windows/client/requests/SessionTypeHandlerRequestBody.d.ts +5 -1
  39. package/dist/api/resources/windows/client/requests/index.d.ts +1 -0
  40. package/dist/api/types/ClickConfig.d.ts +2 -0
  41. package/dist/api/types/ClickConfigClickType.d.ts +12 -0
  42. package/dist/api/types/ClickConfigClickType.js +11 -0
  43. package/dist/api/types/ExternalSessionAiResponseMetadata.d.ts +2 -0
  44. package/dist/api/types/MicroInteractionConfig.d.ts +10 -0
  45. package/dist/api/types/MicroInteractionConfig.js +5 -0
  46. package/dist/api/types/ScreenshotConfig.d.ts +13 -0
  47. package/dist/api/types/ScreenshotConfig.js +5 -0
  48. package/dist/api/types/ScreenshotMetadata.d.ts +7 -0
  49. package/dist/api/types/ScreenshotMetadata.js +5 -0
  50. package/dist/api/types/ScreenshotRequestConfig.d.ts +8 -0
  51. package/dist/api/types/ScreenshotRequestConfig.js +5 -0
  52. package/dist/api/types/VisualAnalysisConfig.d.ts +5 -1
  53. package/dist/api/types/VisualAnalysisConfigScope.d.ts +4 -2
  54. package/dist/api/types/VisualAnalysisConfigScope.js +2 -0
  55. package/dist/api/types/index.d.ts +5 -2
  56. package/dist/api/types/index.js +5 -2
  57. package/dist/serialization/resources/sessions/types/SessionsEventsResponse.d.ts +5 -5
  58. package/dist/serialization/resources/sessions/types/SessionsEventsResponse.js +2 -2
  59. package/dist/serialization/resources/sessions/types/index.d.ts +1 -1
  60. package/dist/serialization/resources/sessions/types/index.js +1 -1
  61. package/dist/serialization/resources/windows/client/requests/SessionHoverHandlerRequestBody.d.ts +2 -2
  62. package/dist/serialization/resources/windows/client/requests/SessionHoverHandlerRequestBody.js +2 -2
  63. package/dist/serialization/resources/windows/client/requests/SessionScreenshotHandlerRequestBody.d.ts +16 -0
  64. package/dist/serialization/resources/windows/client/requests/SessionScreenshotHandlerRequestBody.js +37 -0
  65. package/dist/serialization/resources/windows/client/requests/SessionTypeHandlerRequestBody.d.ts +4 -2
  66. package/dist/serialization/resources/windows/client/requests/SessionTypeHandlerRequestBody.js +4 -2
  67. package/dist/serialization/resources/windows/client/requests/index.d.ts +1 -0
  68. package/dist/serialization/resources/windows/client/requests/index.js +3 -1
  69. package/dist/serialization/types/ClickConfig.d.ts +2 -0
  70. package/dist/serialization/types/ClickConfig.js +2 -0
  71. package/dist/serialization/types/ClickConfigClickType.d.ts +10 -0
  72. package/dist/serialization/types/ClickConfigClickType.js +31 -0
  73. package/dist/serialization/types/ExternalSessionAiResponseMetadata.d.ts +2 -0
  74. package/dist/serialization/types/ExternalSessionAiResponseMetadata.js +2 -0
  75. package/dist/serialization/types/MicroInteractionConfig.d.ts +15 -0
  76. package/dist/serialization/types/{ProfilesResponse.js → MicroInteractionConfig.js} +6 -9
  77. package/dist/serialization/types/ScreenshotConfig.d.ts +15 -0
  78. package/{serialization/types/ProfilesResponse.js → dist/serialization/types/ScreenshotConfig.js} +6 -9
  79. package/dist/serialization/types/ScreenshotMetadata.d.ts +12 -0
  80. package/dist/serialization/types/{ExternalProfileV1.js → ScreenshotMetadata.js} +3 -5
  81. package/dist/serialization/types/ScreenshotRequestConfig.d.ts +13 -0
  82. package/{serialization/types/ExternalProfileV1.js → dist/serialization/types/ScreenshotRequestConfig.js} +4 -5
  83. package/dist/serialization/types/VisualAnalysisConfig.d.ts +2 -0
  84. package/dist/serialization/types/VisualAnalysisConfig.js +2 -0
  85. package/dist/serialization/types/VisualAnalysisConfigScope.d.ts +1 -1
  86. package/dist/serialization/types/VisualAnalysisConfigScope.js +1 -1
  87. package/dist/serialization/types/index.d.ts +5 -2
  88. package/dist/serialization/types/index.js +5 -2
  89. package/package.json +1 -1
  90. package/reference.md +184 -18
  91. package/serialization/resources/sessions/types/SessionsEventsResponse.d.ts +5 -5
  92. package/serialization/resources/sessions/types/SessionsEventsResponse.js +2 -2
  93. package/serialization/resources/sessions/types/index.d.ts +1 -1
  94. package/serialization/resources/sessions/types/index.js +1 -1
  95. package/serialization/resources/windows/client/requests/SessionHoverHandlerRequestBody.d.ts +2 -2
  96. package/serialization/resources/windows/client/requests/SessionHoverHandlerRequestBody.js +2 -2
  97. package/serialization/resources/windows/client/requests/SessionScreenshotHandlerRequestBody.d.ts +16 -0
  98. package/serialization/resources/windows/client/requests/SessionScreenshotHandlerRequestBody.js +37 -0
  99. package/serialization/resources/windows/client/requests/SessionTypeHandlerRequestBody.d.ts +4 -2
  100. package/serialization/resources/windows/client/requests/SessionTypeHandlerRequestBody.js +4 -2
  101. package/serialization/resources/windows/client/requests/index.d.ts +1 -0
  102. package/serialization/resources/windows/client/requests/index.js +3 -1
  103. package/serialization/types/ClickConfig.d.ts +2 -0
  104. package/serialization/types/ClickConfig.js +2 -0
  105. package/serialization/types/ClickConfigClickType.d.ts +10 -0
  106. package/serialization/types/ClickConfigClickType.js +31 -0
  107. package/serialization/types/ExternalSessionAiResponseMetadata.d.ts +2 -0
  108. package/serialization/types/ExternalSessionAiResponseMetadata.js +2 -0
  109. package/serialization/types/MicroInteractionConfig.d.ts +15 -0
  110. package/serialization/types/MicroInteractionConfig.js +36 -0
  111. package/serialization/types/ScreenshotConfig.d.ts +15 -0
  112. package/serialization/types/ScreenshotConfig.js +36 -0
  113. package/serialization/types/ScreenshotMetadata.d.ts +12 -0
  114. package/serialization/types/ScreenshotMetadata.js +33 -0
  115. package/serialization/types/ScreenshotRequestConfig.d.ts +13 -0
  116. package/serialization/types/ScreenshotRequestConfig.js +34 -0
  117. package/serialization/types/VisualAnalysisConfig.d.ts +2 -0
  118. package/serialization/types/VisualAnalysisConfig.js +2 -0
  119. package/serialization/types/VisualAnalysisConfigScope.d.ts +1 -1
  120. package/serialization/types/VisualAnalysisConfigScope.js +1 -1
  121. package/serialization/types/index.d.ts +5 -2
  122. package/serialization/types/index.js +5 -2
  123. package/api/resources/profiles/client/requests/ProfilesGetRequest.d.ts +0 -17
  124. package/api/types/ExternalProfileV1.d.ts +0 -11
  125. package/api/types/ProfilesResponse.d.ts +0 -10
  126. package/dist/api/resources/profiles/client/requests/ProfilesGetRequest.d.ts +0 -17
  127. package/dist/api/types/ExternalProfileV1.d.ts +0 -11
  128. package/dist/api/types/ProfilesResponse.d.ts +0 -10
  129. package/dist/serialization/types/ExternalProfileV1.d.ts +0 -14
  130. package/dist/serialization/types/ProfilesResponse.d.ts +0 -18
  131. package/serialization/types/ExternalProfileV1.d.ts +0 -14
  132. package/serialization/types/ProfilesResponse.d.ts +0 -18
  133. /package/api/resources/{profiles/client/requests/ProfilesGetRequest.js → windows/client/requests/SessionScreenshotHandlerRequestBody.js} +0 -0
  134. /package/api/types/{ExternalProfileV1.js → MicroInteractionConfig.js} +0 -0
  135. /package/api/types/{ProfilesResponse.js → ScreenshotConfig.js} +0 -0
  136. /package/{dist/api/resources/profiles/client/requests/ProfilesGetRequest.js → api/types/ScreenshotMetadata.js} +0 -0
  137. /package/{dist/api/types/ExternalProfileV1.js → api/types/ScreenshotRequestConfig.js} +0 -0
  138. /package/dist/api/{types/ProfilesResponse.js → resources/windows/client/requests/SessionScreenshotHandlerRequestBody.js} +0 -0
@@ -49,6 +49,8 @@ class Windows {
49
49
  this._options = _options;
50
50
  }
51
51
  /**
52
+ * Creates a new browser window in a session. Optionally, you can specify a url to load on the window upon creation.
53
+ *
52
54
  * @param {string} sessionId - ID of the session that owns the window.
53
55
  * @param {Airtop.CreateWindowInputV1Body} request
54
56
  * @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
@@ -66,8 +68,8 @@ class Windows {
66
68
  Authorization: yield this._getAuthorizationHeader(),
67
69
  "X-Fern-Language": "JavaScript",
68
70
  "X-Fern-SDK-Name": "@airtop/sdk",
69
- "X-Fern-SDK-Version": "0.1.12",
70
- "User-Agent": "@airtop/sdk/0.1.12",
71
+ "X-Fern-SDK-Version": "0.1.14",
72
+ "User-Agent": "@airtop/sdk/0.1.14",
71
73
  "X-Fern-Runtime": core.RUNTIME.type,
72
74
  "X-Fern-Runtime-Version": core.RUNTIME.version,
73
75
  },
@@ -109,6 +111,8 @@ class Windows {
109
111
  });
110
112
  }
111
113
  /**
114
+ * Get information about a browser window in a session, including the live view url.
115
+ *
112
116
  * @param {string} sessionId - ID of the session that owns the window.
113
117
  * @param {string} windowId - ID of the browser window, which can either be a normal AirTop windowId or a [CDP TargetId](https://chromedevtools.github.io/devtools-protocol/tot/Target/#type-TargetID) from a browser automation library like Puppeteer (typically associated with the page or main frame). Our SDKs will handle retrieving a TargetId for you from various popular browser automation libraries, but we also have details in our guides on how to do it manually.
114
118
  * @param {Airtop.GetWindowInfoRequest} request
@@ -140,8 +144,8 @@ class Windows {
140
144
  Authorization: yield this._getAuthorizationHeader(),
141
145
  "X-Fern-Language": "JavaScript",
142
146
  "X-Fern-SDK-Name": "@airtop/sdk",
143
- "X-Fern-SDK-Version": "0.1.12",
144
- "User-Agent": "@airtop/sdk/0.1.12",
147
+ "X-Fern-SDK-Version": "0.1.14",
148
+ "User-Agent": "@airtop/sdk/0.1.14",
145
149
  "X-Fern-Runtime": core.RUNTIME.type,
146
150
  "X-Fern-Runtime-Version": core.RUNTIME.version,
147
151
  },
@@ -183,6 +187,8 @@ class Windows {
183
187
  });
184
188
  }
185
189
  /**
190
+ * Loads a specified url on a given window
191
+ *
186
192
  * @param {string} sessionId - ID of the session that owns the window.
187
193
  * @param {string} windowId - Airtop window ID of the browser window.
188
194
  * @param {Airtop.WindowLoadUrlV1Body} request
@@ -203,8 +209,8 @@ class Windows {
203
209
  Authorization: yield this._getAuthorizationHeader(),
204
210
  "X-Fern-Language": "JavaScript",
205
211
  "X-Fern-SDK-Name": "@airtop/sdk",
206
- "X-Fern-SDK-Version": "0.1.12",
207
- "User-Agent": "@airtop/sdk/0.1.12",
212
+ "X-Fern-SDK-Version": "0.1.14",
213
+ "User-Agent": "@airtop/sdk/0.1.14",
208
214
  "X-Fern-Runtime": core.RUNTIME.type,
209
215
  "X-Fern-Runtime-Version": core.RUNTIME.version,
210
216
  },
@@ -246,6 +252,8 @@ class Windows {
246
252
  });
247
253
  }
248
254
  /**
255
+ * Closes a browser window in a session
256
+ *
249
257
  * @param {string} sessionId - ID of the session that owns the window.
250
258
  * @param {string} windowId - Airtop window ID of the browser window.
251
259
  * @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
@@ -263,8 +271,8 @@ class Windows {
263
271
  Authorization: yield this._getAuthorizationHeader(),
264
272
  "X-Fern-Language": "JavaScript",
265
273
  "X-Fern-SDK-Name": "@airtop/sdk",
266
- "X-Fern-SDK-Version": "0.1.12",
267
- "User-Agent": "@airtop/sdk/0.1.12",
274
+ "X-Fern-SDK-Version": "0.1.14",
275
+ "User-Agent": "@airtop/sdk/0.1.14",
268
276
  "X-Fern-Runtime": core.RUNTIME.type,
269
277
  "X-Fern-Runtime-Version": core.RUNTIME.version,
270
278
  },
@@ -305,6 +313,8 @@ class Windows {
305
313
  });
306
314
  }
307
315
  /**
316
+ * Execute a click interaction in a specific browser window
317
+ *
308
318
  * @param {string} sessionId - The session id for the window.
309
319
  * @param {string} windowId - The Airtop window id of the browser window.
310
320
  * @param {Airtop.SessionClickHandlerRequestBody} request
@@ -325,8 +335,8 @@ class Windows {
325
335
  Authorization: yield this._getAuthorizationHeader(),
326
336
  "X-Fern-Language": "JavaScript",
327
337
  "X-Fern-SDK-Name": "@airtop/sdk",
328
- "X-Fern-SDK-Version": "0.1.12",
329
- "User-Agent": "@airtop/sdk/0.1.12",
338
+ "X-Fern-SDK-Version": "0.1.14",
339
+ "User-Agent": "@airtop/sdk/0.1.14",
330
340
  "X-Fern-Runtime": core.RUNTIME.type,
331
341
  "X-Fern-Runtime-Version": core.RUNTIME.version,
332
342
  },
@@ -368,6 +378,8 @@ class Windows {
368
378
  });
369
379
  }
370
380
  /**
381
+ * Execute a hover interaction in a specific browser window
382
+ *
371
383
  * @param {string} sessionId - The session id for the window.
372
384
  * @param {string} windowId - The Airtop window id of the browser window.
373
385
  * @param {Airtop.SessionHoverHandlerRequestBody} request
@@ -386,8 +398,8 @@ class Windows {
386
398
  Authorization: yield this._getAuthorizationHeader(),
387
399
  "X-Fern-Language": "JavaScript",
388
400
  "X-Fern-SDK-Name": "@airtop/sdk",
389
- "X-Fern-SDK-Version": "0.1.12",
390
- "User-Agent": "@airtop/sdk/0.1.12",
401
+ "X-Fern-SDK-Version": "0.1.14",
402
+ "User-Agent": "@airtop/sdk/0.1.14",
391
403
  "X-Fern-Runtime": core.RUNTIME.type,
392
404
  "X-Fern-Runtime-Version": core.RUNTIME.version,
393
405
  },
@@ -429,6 +441,8 @@ class Windows {
429
441
  });
430
442
  }
431
443
  /**
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?).
445
+ *
432
446
  * @param {string} sessionId - The session id for the window.
433
447
  * @param {string} windowId - The Airtop window id of the browser window.
434
448
  * @param {Airtop.SessionPageQueryHandlerRequestBody} request
@@ -449,8 +463,8 @@ class Windows {
449
463
  Authorization: yield this._getAuthorizationHeader(),
450
464
  "X-Fern-Language": "JavaScript",
451
465
  "X-Fern-SDK-Name": "@airtop/sdk",
452
- "X-Fern-SDK-Version": "0.1.12",
453
- "User-Agent": "@airtop/sdk/0.1.12",
466
+ "X-Fern-SDK-Version": "0.1.14",
467
+ "User-Agent": "@airtop/sdk/0.1.14",
454
468
  "X-Fern-Runtime": core.RUNTIME.type,
455
469
  "X-Fern-Runtime-Version": core.RUNTIME.version,
456
470
  },
@@ -494,6 +508,8 @@ class Windows {
494
508
  });
495
509
  }
496
510
  /**
511
+ * Submit a prompt that queries the content of a specific browser window and paginates through pages to return a list of results.
512
+ *
497
513
  * @param {string} sessionId - The session id for the window.
498
514
  * @param {string} windowId - The Airtop window id of the browser window.
499
515
  * @param {Airtop.SessionPaginatedExtractionHandlerRequestBody} request
@@ -512,8 +528,8 @@ class Windows {
512
528
  Authorization: yield this._getAuthorizationHeader(),
513
529
  "X-Fern-Language": "JavaScript",
514
530
  "X-Fern-SDK-Name": "@airtop/sdk",
515
- "X-Fern-SDK-Version": "0.1.12",
516
- "User-Agent": "@airtop/sdk/0.1.12",
531
+ "X-Fern-SDK-Version": "0.1.14",
532
+ "User-Agent": "@airtop/sdk/0.1.14",
517
533
  "X-Fern-Runtime": core.RUNTIME.type,
518
534
  "X-Fern-Runtime-Version": core.RUNTIME.version,
519
535
  },
@@ -579,8 +595,8 @@ class Windows {
579
595
  Authorization: yield this._getAuthorizationHeader(),
580
596
  "X-Fern-Language": "JavaScript",
581
597
  "X-Fern-SDK-Name": "@airtop/sdk",
582
- "X-Fern-SDK-Version": "0.1.12",
583
- "User-Agent": "@airtop/sdk/0.1.12",
598
+ "X-Fern-SDK-Version": "0.1.14",
599
+ "User-Agent": "@airtop/sdk/0.1.14",
584
600
  "X-Fern-Runtime": core.RUNTIME.type,
585
601
  "X-Fern-Runtime-Version": core.RUNTIME.version,
586
602
  },
@@ -624,6 +640,8 @@ class Windows {
624
640
  });
625
641
  }
626
642
  /**
643
+ * Scrape a window and return the content as markdown
644
+ *
627
645
  * @param {string} sessionId - The session id for the window.
628
646
  * @param {string} windowId - The Airtop window id of the browser window to scrape.
629
647
  * @param {Airtop.ScrapeContentRequest} request
@@ -642,8 +660,8 @@ class Windows {
642
660
  Authorization: yield this._getAuthorizationHeader(),
643
661
  "X-Fern-Language": "JavaScript",
644
662
  "X-Fern-SDK-Name": "@airtop/sdk",
645
- "X-Fern-SDK-Version": "0.1.12",
646
- "User-Agent": "@airtop/sdk/0.1.12",
663
+ "X-Fern-SDK-Version": "0.1.14",
664
+ "User-Agent": "@airtop/sdk/0.1.14",
647
665
  "X-Fern-Runtime": core.RUNTIME.type,
648
666
  "X-Fern-Runtime-Version": core.RUNTIME.version,
649
667
  },
@@ -684,6 +702,71 @@ class Windows {
684
702
  }
685
703
  });
686
704
  }
705
+ /**
706
+ * Take a screenshot of a browser window
707
+ *
708
+ * @param {string} sessionId - The session id for the window.
709
+ * @param {string} windowId - The Airtop window id of the browser window.
710
+ * @param {Airtop.SessionScreenshotHandlerRequestBody} request
711
+ * @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
712
+ *
713
+ * @example
714
+ * await client.windows.screenshot("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
715
+ */
716
+ screenshot(sessionId, windowId, request = {}, requestOptions) {
717
+ var _a, _b;
718
+ return __awaiter(this, void 0, void 0, function* () {
719
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
720
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/screenshot`),
721
+ method: "POST",
722
+ headers: {
723
+ Authorization: yield this._getAuthorizationHeader(),
724
+ "X-Fern-Language": "JavaScript",
725
+ "X-Fern-SDK-Name": "@airtop/sdk",
726
+ "X-Fern-SDK-Version": "0.1.14",
727
+ "User-Agent": "@airtop/sdk/0.1.14",
728
+ "X-Fern-Runtime": core.RUNTIME.type,
729
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
730
+ },
731
+ contentType: "application/json",
732
+ requestType: "json",
733
+ body: serializers.SessionScreenshotHandlerRequestBody.jsonOrThrow(request, {
734
+ unrecognizedObjectKeys: "strip",
735
+ }),
736
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
737
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
738
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
739
+ });
740
+ if (_response.ok) {
741
+ return serializers.AiPromptResponse.parseOrThrow(_response.body, {
742
+ unrecognizedObjectKeys: "passthrough",
743
+ allowUnrecognizedUnionMembers: true,
744
+ allowUnrecognizedEnumValues: true,
745
+ skipValidation: true,
746
+ breadcrumbsPrefix: ["response"],
747
+ });
748
+ }
749
+ if (_response.error.reason === "status-code") {
750
+ throw new errors.AirtopError({
751
+ statusCode: _response.error.statusCode,
752
+ body: _response.error.body,
753
+ });
754
+ }
755
+ switch (_response.error.reason) {
756
+ case "non-json":
757
+ throw new errors.AirtopError({
758
+ statusCode: _response.error.statusCode,
759
+ body: _response.error.rawBody,
760
+ });
761
+ case "timeout":
762
+ throw new errors.AirtopTimeoutError();
763
+ case "unknown":
764
+ throw new errors.AirtopError({
765
+ message: _response.error.errorMessage,
766
+ });
767
+ }
768
+ });
769
+ }
687
770
  /**
688
771
  * This endpoint is deprecated. Please use the `pageQuery` endpoint and ask for a summary in the prompt instead.
689
772
  *
@@ -705,8 +788,8 @@ class Windows {
705
788
  Authorization: yield this._getAuthorizationHeader(),
706
789
  "X-Fern-Language": "JavaScript",
707
790
  "X-Fern-SDK-Name": "@airtop/sdk",
708
- "X-Fern-SDK-Version": "0.1.12",
709
- "User-Agent": "@airtop/sdk/0.1.12",
791
+ "X-Fern-SDK-Version": "0.1.14",
792
+ "User-Agent": "@airtop/sdk/0.1.14",
710
793
  "X-Fern-Runtime": core.RUNTIME.type,
711
794
  "X-Fern-Runtime-Version": core.RUNTIME.version,
712
795
  },
@@ -750,6 +833,8 @@ class Windows {
750
833
  });
751
834
  }
752
835
  /**
836
+ * Execute a type interaction in a specific browser window
837
+ *
753
838
  * @param {string} sessionId - The session id for the window.
754
839
  * @param {string} windowId - The Airtop window id of the browser window.
755
840
  * @param {Airtop.SessionTypeHandlerRequestBody} request
@@ -770,8 +855,8 @@ class Windows {
770
855
  Authorization: yield this._getAuthorizationHeader(),
771
856
  "X-Fern-Language": "JavaScript",
772
857
  "X-Fern-SDK-Name": "@airtop/sdk",
773
- "X-Fern-SDK-Version": "0.1.12",
774
- "User-Agent": "@airtop/sdk/0.1.12",
858
+ "X-Fern-SDK-Version": "0.1.14",
859
+ "User-Agent": "@airtop/sdk/0.1.14",
775
860
  "X-Fern-Runtime": core.RUNTIME.type,
776
861
  "X-Fern-Runtime-Version": core.RUNTIME.version,
777
862
  },
@@ -9,7 +9,7 @@ import * as Airtop from "../../../../index";
9
9
  export interface SessionHoverHandlerRequestBody {
10
10
  clientRequestId?: string;
11
11
  /** Request configuration */
12
- configuration?: Airtop.ClickConfig;
12
+ configuration?: Airtop.MicroInteractionConfig;
13
13
  /** 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). */
14
14
  costThresholdCredits?: number;
15
15
  /** A natural language description of where to hover (e.g. 'the search box', 'username field'). The interaction will be aborted if the target element cannot be found. */
@@ -0,0 +1,21 @@
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 SessionScreenshotHandlerRequestBody {
10
+ clientRequestId?: string;
11
+ /** Request configuration */
12
+ configuration?: Airtop.ScreenshotRequestConfig;
13
+ /** 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). */
14
+ costThresholdCredits?: number;
15
+ /**
16
+ * 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).
17
+ *
18
+ * This setting does not extend the maximum session duration provided at the time of session creation.
19
+ */
20
+ timeThresholdSeconds?: number;
21
+ }
@@ -9,15 +9,19 @@ import * as Airtop from "../../../../index";
9
9
  * }
10
10
  */
11
11
  export interface SessionTypeHandlerRequestBody {
12
+ /** If true, and an HTML input field is active, clears the input field before typing the text. */
13
+ clearInputField?: boolean;
12
14
  clientRequestId?: string;
13
15
  /** Request configuration */
14
- configuration?: Airtop.ClickConfig;
16
+ configuration?: Airtop.MicroInteractionConfig;
15
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). */
16
18
  costThresholdCredits?: number;
17
19
  /** A natural language description of where to type (e.g. 'the search box', 'username field'). The interaction will be aborted if the target element cannot be found. */
18
20
  elementDescription?: string;
19
21
  /** If true, simulates pressing the Enter key after typing the text. */
20
22
  pressEnterKey?: boolean;
23
+ /** If true, simulates pressing the Tab key after typing the text. Note that the tab key will be pressed after the Enter key if both options are configured. */
24
+ pressTabKey?: boolean;
21
25
  /** The text to type into the browser window. */
22
26
  text: string;
23
27
  /**
@@ -5,5 +5,6 @@ export { type SessionClickHandlerRequestBody } from "./SessionClickHandlerReques
5
5
  export { type SessionHoverHandlerRequestBody } from "./SessionHoverHandlerRequestBody";
6
6
  export { type SessionPaginatedExtractionHandlerRequestBody } from "./SessionPaginatedExtractionHandlerRequestBody";
7
7
  export { type ScrapeContentRequest } from "./ScrapeContentRequest";
8
+ export { type SessionScreenshotHandlerRequestBody } from "./SessionScreenshotHandlerRequestBody";
8
9
  export { type SessionSummaryHandlerRequestBody } from "./SessionSummaryHandlerRequestBody";
9
10
  export { type SessionTypeHandlerRequestBody } from "./SessionTypeHandlerRequestBody";
@@ -3,6 +3,8 @@
3
3
  */
4
4
  import * as Airtop from "../index";
5
5
  export interface ClickConfig {
6
+ /** The type of click to perform. Defaults to left click. */
7
+ clickType?: Airtop.ClickConfigClickType;
6
8
  /** Optional configuration for visual analysis when locating specified content. */
7
9
  visualAnalysis?: Airtop.VisualAnalysisConfig;
8
10
  /** Optional configuration for waiting for navigation to complete after clicking the element. */
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * The type of click to perform. Defaults to left click.
6
+ */
7
+ export declare type ClickConfigClickType = "click" | "doubleClick" | "rightClick";
8
+ export declare const ClickConfigClickType: {
9
+ readonly Click: "click";
10
+ readonly DoubleClick: "doubleClick";
11
+ readonly RightClick: "rightClick";
12
+ };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ClickConfigClickType = void 0;
7
+ exports.ClickConfigClickType = {
8
+ Click: "click",
9
+ DoubleClick: "doubleClick",
10
+ RightClick: "rightClick",
11
+ };
@@ -5,6 +5,8 @@ import * as Airtop from "../index";
5
5
  export interface ExternalSessionAiResponseMetadata {
6
6
  clientProvided?: Airtop.ClientProvidedResponseMetadata;
7
7
  requestId?: string;
8
+ /** Array containing any requested screenshots from the operation. */
9
+ screenshots?: Airtop.ScreenshotMetadata[];
8
10
  /** Outcome of the operation. */
9
11
  status: Airtop.ExternalSessionAiResponseMetadataStatus;
10
12
  usage: Airtop.ExternalSessionAiResponseMetadataUsage;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Airtop from "../index";
5
+ export interface MicroInteractionConfig {
6
+ /** Optional configuration for visual analysis when locating specified content. */
7
+ visualAnalysis?: Airtop.VisualAnalysisConfig;
8
+ /** Optional configuration for waiting for navigation to complete after clicking the element. */
9
+ waitForNavigationConfig?: Airtop.BrowserWaitNavigationConfig;
10
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface ScreenshotConfig {
5
+ /** Maximum height of the screenshot in pixels. The screenshot will be scaled down to fit within this height if necessary, preserving the aspect ratio. */
6
+ maxHeight?: number;
7
+ /** Maximum width of the screenshot in pixels. The screenshot will be scaled down to fit within this width if necessary, preserving the aspect ratio. */
8
+ maxWidth?: number;
9
+ /** JPEG quality (1-100). Note that this option is still in development and may not work as expected. */
10
+ quality?: number;
11
+ /** Whether to capture the current viewport or whole page. Only viewport is currently supported. */
12
+ scope?: "viewport";
13
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface ScreenshotMetadata {
5
+ /** Base64 encoded data URL of screenshot image data */
6
+ dataUrl?: string;
7
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Airtop from "../index";
5
+ export interface ScreenshotRequestConfig {
6
+ /** Optional configuration for the screenshot. */
7
+ screenshot?: Airtop.ScreenshotConfig;
8
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -3,10 +3,14 @@
3
3
  */
4
4
  import * as Airtop from "../index";
5
5
  export interface VisualAnalysisConfig {
6
+ /** Scan mode only: The maximum number of scrolls to perform. Defaults to 50. */
7
+ maxScanScrolls?: number;
6
8
  /** The percentage of overlap between screenshot chunks. Defaults to 30 (percent). */
7
9
  overlapPercentage?: number;
8
10
  /** The direction to partition the screenshot into chunks: 'vertical', 'horizontal', or 'bidirectional'. Defaults to 'vertical', which is recommended for most web pages. For optimal results when partitioning in a single direction, ensure the perpendicular dimension does not exceed 1920 pixels. */
9
11
  partitionDirection?: Airtop.VisualAnalysisConfigPartitionDirection;
10
- /** Whether to analyze the current viewport or the whole page. Can be 'viewport' or 'page'. Defaults to 'page', which provides the simplest out-of-the-box experience for most web pages. Use 'viewport' for full control over the analyzed content. */
12
+ /** Scan mode only: The delay between scrolls in milliseconds. Defaults to 1000 (milliseconds). */
13
+ scanScrollDelay?: number;
14
+ /** Whether to analyze the current viewport or the whole page. Can be 'viewport', 'page', 'scan' or 'auto'. Defaults to 'auto', which provides the simplest out-of-the-box experience for most web pages. Use 'viewport' for analysis of the current browser view only. Use 'page' for a full page analysis. Use 'scan' for a full page analysis on sites that have compatibility or accuracy issues with 'page' mode. */
11
15
  scope?: Airtop.VisualAnalysisConfigScope;
12
16
  }
@@ -2,10 +2,12 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  /**
5
- * Whether to analyze the current viewport or the whole page. Can be 'viewport' or 'page'. Defaults to 'page', which provides the simplest out-of-the-box experience for most web pages. Use 'viewport' for full control over the analyzed content.
5
+ * Whether to analyze the current viewport or the whole page. Can be 'viewport', 'page', 'scan' or 'auto'. Defaults to 'auto', which provides the simplest out-of-the-box experience for most web pages. Use 'viewport' for analysis of the current browser view only. Use 'page' for a full page analysis. Use 'scan' for a full page analysis on sites that have compatibility or accuracy issues with 'page' mode.
6
6
  */
7
- export declare type VisualAnalysisConfigScope = "viewport" | "page";
7
+ export declare type VisualAnalysisConfigScope = "viewport" | "page" | "scan" | "auto";
8
8
  export declare const VisualAnalysisConfigScope: {
9
9
  readonly Viewport: "viewport";
10
10
  readonly Page: "page";
11
+ readonly Scan: "scan";
12
+ readonly Auto: "auto";
11
13
  };
@@ -7,4 +7,6 @@ exports.VisualAnalysisConfigScope = void 0;
7
7
  exports.VisualAnalysisConfigScope = {
8
8
  Viewport: "viewport",
9
9
  Page: "page",
10
+ Scan: "scan",
11
+ Auto: "auto",
10
12
  };
@@ -2,6 +2,7 @@ export * from "./AiPromptResponse";
2
2
  export * from "./AiResponseEnvelope";
3
3
  export * from "./BrowserWaitNavigationConfigWaitUntil";
4
4
  export * from "./BrowserWaitNavigationConfig";
5
+ export * from "./ClickConfigClickType";
5
6
  export * from "./ClickConfig";
6
7
  export * from "./ClientProvidedResponseMetadata";
7
8
  export * from "./EnvelopeDefaultMeta";
@@ -9,24 +10,26 @@ export * from "./ErrorBody";
9
10
  export * from "./ErrorDetail";
10
11
  export * from "./ErrorMessage";
11
12
  export * from "./ErrorModel";
12
- export * from "./ExternalProfileV1";
13
13
  export * from "./ExternalSessionAiResponseMetadataStatus";
14
14
  export * from "./ExternalSessionAiResponseMetadata";
15
15
  export * from "./ExternalSessionAiResponseMetadataUsage";
16
16
  export * from "./ExternalSessionConfig";
17
17
  export * from "./ExternalSessionWithConnectionInfo";
18
18
  export * from "./Issue";
19
+ export * from "./MicroInteractionConfig";
19
20
  export * from "./OperationOutcome";
20
21
  export * from "./OperationOutcomeResponse";
21
22
  export * from "./PageQueryConfig";
22
23
  export * from "./PageQueryExperimentalConfig";
23
24
  export * from "./PaginatedExtractionConfig";
24
25
  export * from "./Pagination";
25
- export * from "./ProfilesResponse";
26
26
  export * from "./ScrapeResponse";
27
27
  export * from "./ScrapeResponseContent";
28
28
  export * from "./ScrapeResponseEnvelope";
29
29
  export * from "./ScrapeResponseOutput";
30
+ export * from "./ScreenshotConfig";
31
+ export * from "./ScreenshotMetadata";
32
+ export * from "./ScreenshotRequestConfig";
30
33
  export * from "./Proxy";
31
34
  export * from "./CustomProxy";
32
35
  export * from "./SessionConfigV1ProxyItem";
@@ -18,6 +18,7 @@ __exportStar(require("./AiPromptResponse"), exports);
18
18
  __exportStar(require("./AiResponseEnvelope"), exports);
19
19
  __exportStar(require("./BrowserWaitNavigationConfigWaitUntil"), exports);
20
20
  __exportStar(require("./BrowserWaitNavigationConfig"), exports);
21
+ __exportStar(require("./ClickConfigClickType"), exports);
21
22
  __exportStar(require("./ClickConfig"), exports);
22
23
  __exportStar(require("./ClientProvidedResponseMetadata"), exports);
23
24
  __exportStar(require("./EnvelopeDefaultMeta"), exports);
@@ -25,24 +26,26 @@ __exportStar(require("./ErrorBody"), exports);
25
26
  __exportStar(require("./ErrorDetail"), exports);
26
27
  __exportStar(require("./ErrorMessage"), exports);
27
28
  __exportStar(require("./ErrorModel"), exports);
28
- __exportStar(require("./ExternalProfileV1"), exports);
29
29
  __exportStar(require("./ExternalSessionAiResponseMetadataStatus"), exports);
30
30
  __exportStar(require("./ExternalSessionAiResponseMetadata"), exports);
31
31
  __exportStar(require("./ExternalSessionAiResponseMetadataUsage"), exports);
32
32
  __exportStar(require("./ExternalSessionConfig"), exports);
33
33
  __exportStar(require("./ExternalSessionWithConnectionInfo"), exports);
34
34
  __exportStar(require("./Issue"), exports);
35
+ __exportStar(require("./MicroInteractionConfig"), exports);
35
36
  __exportStar(require("./OperationOutcome"), exports);
36
37
  __exportStar(require("./OperationOutcomeResponse"), exports);
37
38
  __exportStar(require("./PageQueryConfig"), exports);
38
39
  __exportStar(require("./PageQueryExperimentalConfig"), exports);
39
40
  __exportStar(require("./PaginatedExtractionConfig"), exports);
40
41
  __exportStar(require("./Pagination"), exports);
41
- __exportStar(require("./ProfilesResponse"), exports);
42
42
  __exportStar(require("./ScrapeResponse"), exports);
43
43
  __exportStar(require("./ScrapeResponseContent"), exports);
44
44
  __exportStar(require("./ScrapeResponseEnvelope"), exports);
45
45
  __exportStar(require("./ScrapeResponseOutput"), exports);
46
+ __exportStar(require("./ScreenshotConfig"), exports);
47
+ __exportStar(require("./ScreenshotMetadata"), exports);
48
+ __exportStar(require("./ScreenshotRequestConfig"), exports);
46
49
  __exportStar(require("./Proxy"), exports);
47
50
  __exportStar(require("./CustomProxy"), exports);
48
51
  __exportStar(require("./SessionConfigV1ProxyItem"), exports);
@@ -4,13 +4,16 @@
4
4
  import * as serializers from "../../../index";
5
5
  import * as Airtop from "../../../../api/index";
6
6
  import * as core from "../../../../core";
7
+ import { SessionsEventsResponseSessionEvent } from "./SessionsEventsResponseSessionEvent";
7
8
  import { SessionsEventsResponseStatus } from "./SessionsEventsResponseStatus";
8
9
  import { SessionsEventsResponseError } from "./SessionsEventsResponseError";
9
10
  import { SessionsEventsResponseWindowEvent } from "./SessionsEventsResponseWindowEvent";
10
- import { SessionsEventsResponseSessionEvent } from "./SessionsEventsResponseSessionEvent";
11
11
  export declare const SessionsEventsResponse: core.serialization.Schema<serializers.SessionsEventsResponse.Raw, Airtop.SessionsEventsResponse>;
12
12
  export declare namespace SessionsEventsResponse {
13
- type Raw = SessionsEventsResponse.Status | SessionsEventsResponse.Error | SessionsEventsResponse.WindowEvent | SessionsEventsResponse.SessionEvent;
13
+ type Raw = SessionsEventsResponse.SessionEvent | SessionsEventsResponse.Status | SessionsEventsResponse.Error | SessionsEventsResponse.WindowEvent;
14
+ interface SessionEvent extends SessionsEventsResponseSessionEvent.Raw {
15
+ event: "sessionEvent";
16
+ }
14
17
  interface Status extends SessionsEventsResponseStatus.Raw {
15
18
  event: "status";
16
19
  }
@@ -20,7 +23,4 @@ export declare namespace SessionsEventsResponse {
20
23
  interface WindowEvent extends SessionsEventsResponseWindowEvent.Raw {
21
24
  event: "windowEvent";
22
25
  }
23
- interface SessionEvent extends SessionsEventsResponseSessionEvent.Raw {
24
- event: "sessionEvent";
25
- }
26
26
  }
@@ -28,16 +28,16 @@ var __importStar = (this && this.__importStar) || function (mod) {
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.SessionsEventsResponse = void 0;
30
30
  const core = __importStar(require("../../../../core"));
31
+ const SessionsEventsResponseSessionEvent_1 = require("./SessionsEventsResponseSessionEvent");
31
32
  const SessionsEventsResponseStatus_1 = require("./SessionsEventsResponseStatus");
32
33
  const SessionsEventsResponseError_1 = require("./SessionsEventsResponseError");
33
34
  const SessionsEventsResponseWindowEvent_1 = require("./SessionsEventsResponseWindowEvent");
34
- const SessionsEventsResponseSessionEvent_1 = require("./SessionsEventsResponseSessionEvent");
35
35
  exports.SessionsEventsResponse = core.serialization
36
36
  .union("event", {
37
+ sessionEvent: SessionsEventsResponseSessionEvent_1.SessionsEventsResponseSessionEvent,
37
38
  status: SessionsEventsResponseStatus_1.SessionsEventsResponseStatus,
38
39
  error: SessionsEventsResponseError_1.SessionsEventsResponseError,
39
40
  windowEvent: SessionsEventsResponseWindowEvent_1.SessionsEventsResponseWindowEvent,
40
- sessionEvent: SessionsEventsResponseSessionEvent_1.SessionsEventsResponseSessionEvent,
41
41
  })
42
42
  .transform({
43
43
  transform: (value) => value,