@airtop/sdk 0.1.4 → 0.1.6

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 (118) hide show
  1. package/api/resources/profiles/client/Client.js +4 -4
  2. package/api/resources/sessions/client/Client.d.ts +2 -2
  3. package/api/resources/sessions/client/Client.js +12 -12
  4. package/api/resources/windows/client/Client.d.ts +52 -2
  5. package/api/resources/windows/client/Client.js +272 -16
  6. package/api/resources/windows/client/requests/SessionClickHandlerRequestBody.d.ts +25 -0
  7. package/api/resources/windows/client/requests/SessionHoverHandlerRequestBody.d.ts +23 -0
  8. package/api/resources/windows/client/requests/SessionSummaryHandlerRequestBody.d.ts +3 -0
  9. package/api/resources/windows/client/requests/SessionTypeHandlerRequestBody.d.ts +29 -0
  10. package/api/resources/windows/client/requests/index.d.ts +3 -1
  11. package/api/types/ClickConfig.d.ts +4 -0
  12. package/api/types/CustomProxy.d.ts +1 -1
  13. package/api/types/PageQueryConfig.d.ts +7 -0
  14. package/api/types/{PromptContentExperimentalConfig.d.ts → PageQueryExperimentalConfig.d.ts} +1 -1
  15. package/api/types/SessionConfigV1Proxy.d.ts +4 -1
  16. package/api/{resources/windows/client/requests/SessionContentPromptHandlerRequestBody.d.ts → types/SessionPageQueryHandlerRequestBody.d.ts} +6 -9
  17. package/api/types/SessionPageQueryHandlerRequestBody.js +5 -0
  18. package/api/types/SummaryConfig.d.ts +2 -2
  19. package/api/types/index.d.ts +4 -2
  20. package/api/types/index.js +4 -2
  21. package/dist/api/resources/profiles/client/Client.js +4 -4
  22. package/dist/api/resources/sessions/client/Client.d.ts +2 -2
  23. package/dist/api/resources/sessions/client/Client.js +12 -12
  24. package/dist/api/resources/windows/client/Client.d.ts +52 -2
  25. package/dist/api/resources/windows/client/Client.js +272 -16
  26. package/dist/api/resources/windows/client/requests/SessionClickHandlerRequestBody.d.ts +25 -0
  27. package/dist/api/resources/windows/client/requests/SessionClickHandlerRequestBody.js +5 -0
  28. package/dist/api/resources/windows/client/requests/SessionHoverHandlerRequestBody.d.ts +23 -0
  29. package/dist/api/resources/windows/client/requests/SessionHoverHandlerRequestBody.js +5 -0
  30. package/dist/api/resources/windows/client/requests/SessionSummaryHandlerRequestBody.d.ts +3 -0
  31. package/dist/api/resources/windows/client/requests/SessionTypeHandlerRequestBody.d.ts +29 -0
  32. package/dist/api/resources/windows/client/requests/SessionTypeHandlerRequestBody.js +5 -0
  33. package/dist/api/resources/windows/client/requests/index.d.ts +3 -1
  34. package/dist/api/types/ClickConfig.d.ts +4 -0
  35. package/dist/api/types/ClickConfig.js +5 -0
  36. package/dist/api/types/CustomProxy.d.ts +1 -1
  37. package/dist/api/types/PageQueryConfig.d.ts +7 -0
  38. package/dist/api/types/PageQueryConfig.js +5 -0
  39. package/dist/api/types/{PromptContentExperimentalConfig.d.ts → PageQueryExperimentalConfig.d.ts} +1 -1
  40. package/dist/api/types/PageQueryExperimentalConfig.js +5 -0
  41. package/dist/api/types/SessionConfigV1Proxy.d.ts +4 -1
  42. package/dist/api/{resources/windows/client/requests/SessionContentPromptHandlerRequestBody.d.ts → types/SessionPageQueryHandlerRequestBody.d.ts} +6 -9
  43. package/dist/api/types/SessionPageQueryHandlerRequestBody.js +5 -0
  44. package/dist/api/types/SummaryConfig.d.ts +2 -2
  45. package/dist/api/types/index.d.ts +4 -2
  46. package/dist/api/types/index.js +4 -2
  47. package/{serialization/resources/windows/client/requests/SessionContentPromptHandlerRequestBody.d.ts → dist/serialization/resources/windows/client/requests/SessionClickHandlerRequestBody.d.ts} +5 -4
  48. package/dist/serialization/resources/windows/client/requests/SessionClickHandlerRequestBody.js +38 -0
  49. package/dist/serialization/resources/windows/client/requests/SessionHoverHandlerRequestBody.d.ts +17 -0
  50. package/dist/serialization/resources/windows/client/requests/SessionHoverHandlerRequestBody.js +38 -0
  51. package/dist/serialization/resources/windows/client/requests/SessionSummaryHandlerRequestBody.d.ts +2 -0
  52. package/dist/serialization/resources/windows/client/requests/SessionSummaryHandlerRequestBody.js +2 -0
  53. package/dist/serialization/resources/windows/client/requests/SessionTypeHandlerRequestBody.d.ts +19 -0
  54. package/dist/serialization/resources/windows/client/requests/SessionTypeHandlerRequestBody.js +40 -0
  55. package/dist/serialization/resources/windows/client/requests/index.d.ts +3 -1
  56. package/dist/serialization/resources/windows/client/requests/index.js +7 -3
  57. package/dist/serialization/types/ClickConfig.d.ts +10 -0
  58. package/dist/serialization/types/ClickConfig.js +31 -0
  59. package/dist/serialization/types/PageQueryConfig.d.ts +12 -0
  60. package/dist/serialization/types/{PromptContentConfig.js → PageQueryConfig.js} +3 -4
  61. package/dist/serialization/types/{PromptContentExperimentalConfig.d.ts → PageQueryExperimentalConfig.d.ts} +2 -2
  62. package/dist/serialization/types/{PromptContentExperimentalConfig.js → PageQueryExperimentalConfig.js} +2 -2
  63. package/dist/serialization/types/SessionConfigV1Proxy.d.ts +1 -1
  64. package/dist/serialization/types/SessionConfigV1Proxy.js +5 -1
  65. package/dist/serialization/types/SessionPageQueryHandlerRequestBody.d.ts +18 -0
  66. package/{serialization/resources/windows/client/requests/SessionContentPromptHandlerRequestBody.js → dist/serialization/types/SessionPageQueryHandlerRequestBody.js} +5 -3
  67. package/dist/serialization/types/SummaryConfig.d.ts +1 -2
  68. package/dist/serialization/types/SummaryConfig.js +1 -2
  69. package/dist/serialization/types/index.d.ts +4 -2
  70. package/dist/serialization/types/index.js +4 -2
  71. package/dist/wrapper/AirtopClient.d.ts +6 -5
  72. package/dist/wrapper/AirtopClient.js +11 -10
  73. package/dist/wrapper/AirtopSessions.d.ts +11 -11
  74. package/dist/wrapper/AirtopSessions.js +16 -17
  75. package/dist/wrapper/AirtopWindows.d.ts +62 -14
  76. package/dist/wrapper/AirtopWindows.js +73 -31
  77. package/package.json +1 -1
  78. package/reference.md +295 -3
  79. package/{dist/serialization/resources/windows/client/requests/SessionContentPromptHandlerRequestBody.d.ts → serialization/resources/windows/client/requests/SessionClickHandlerRequestBody.d.ts} +5 -4
  80. package/serialization/resources/windows/client/requests/SessionClickHandlerRequestBody.js +38 -0
  81. package/serialization/resources/windows/client/requests/SessionHoverHandlerRequestBody.d.ts +17 -0
  82. package/serialization/resources/windows/client/requests/SessionHoverHandlerRequestBody.js +38 -0
  83. package/serialization/resources/windows/client/requests/SessionSummaryHandlerRequestBody.d.ts +2 -0
  84. package/serialization/resources/windows/client/requests/SessionSummaryHandlerRequestBody.js +2 -0
  85. package/serialization/resources/windows/client/requests/SessionTypeHandlerRequestBody.d.ts +19 -0
  86. package/serialization/resources/windows/client/requests/SessionTypeHandlerRequestBody.js +40 -0
  87. package/serialization/resources/windows/client/requests/index.d.ts +3 -1
  88. package/serialization/resources/windows/client/requests/index.js +7 -3
  89. package/serialization/types/ClickConfig.d.ts +10 -0
  90. package/serialization/types/ClickConfig.js +31 -0
  91. package/serialization/types/PageQueryConfig.d.ts +12 -0
  92. package/serialization/types/{PromptContentConfig.js → PageQueryConfig.js} +3 -4
  93. package/serialization/types/{PromptContentExperimentalConfig.d.ts → PageQueryExperimentalConfig.d.ts} +2 -2
  94. package/serialization/types/{PromptContentExperimentalConfig.js → PageQueryExperimentalConfig.js} +2 -2
  95. package/serialization/types/SessionConfigV1Proxy.d.ts +1 -1
  96. package/serialization/types/SessionConfigV1Proxy.js +5 -1
  97. package/serialization/types/SessionPageQueryHandlerRequestBody.d.ts +18 -0
  98. package/{dist/serialization/resources/windows/client/requests/SessionContentPromptHandlerRequestBody.js → serialization/types/SessionPageQueryHandlerRequestBody.js} +5 -3
  99. package/serialization/types/SummaryConfig.d.ts +1 -2
  100. package/serialization/types/SummaryConfig.js +1 -2
  101. package/serialization/types/index.d.ts +4 -2
  102. package/serialization/types/index.js +4 -2
  103. package/wrapper/AirtopClient.d.ts +6 -5
  104. package/wrapper/AirtopClient.js +11 -10
  105. package/wrapper/AirtopSessions.d.ts +11 -11
  106. package/wrapper/AirtopSessions.js +16 -17
  107. package/wrapper/AirtopWindows.d.ts +62 -14
  108. package/wrapper/AirtopWindows.js +73 -31
  109. package/api/types/PromptContentConfig.d.ts +0 -8
  110. package/dist/api/types/PromptContentConfig.d.ts +0 -8
  111. package/dist/serialization/types/PromptContentConfig.d.ts +0 -13
  112. package/serialization/types/PromptContentConfig.d.ts +0 -13
  113. /package/api/resources/windows/client/requests/{SessionContentPromptHandlerRequestBody.js → SessionClickHandlerRequestBody.js} +0 -0
  114. /package/api/{types/PromptContentConfig.js → resources/windows/client/requests/SessionHoverHandlerRequestBody.js} +0 -0
  115. /package/api/{types/PromptContentExperimentalConfig.js → resources/windows/client/requests/SessionTypeHandlerRequestBody.js} +0 -0
  116. /package/{dist/api/resources/windows/client/requests/SessionContentPromptHandlerRequestBody.js → api/types/ClickConfig.js} +0 -0
  117. /package/{dist/api/types/PromptContentConfig.js → api/types/PageQueryConfig.js} +0 -0
  118. /package/{dist/api/types/PromptContentExperimentalConfig.js → api/types/PageQueryExperimentalConfig.js} +0 -0
@@ -77,8 +77,8 @@ class Profiles {
77
77
  Authorization: yield this._getAuthorizationHeader(),
78
78
  "X-Fern-Language": "JavaScript",
79
79
  "X-Fern-SDK-Name": "@airtop/sdk",
80
- "X-Fern-SDK-Version": "0.1.4",
81
- "User-Agent": "@airtop/sdk/0.1.4",
80
+ "X-Fern-SDK-Version": "0.1.6",
81
+ "User-Agent": "@airtop/sdk/0.1.6",
82
82
  "X-Fern-Runtime": core.RUNTIME.type,
83
83
  "X-Fern-Runtime-Version": core.RUNTIME.version,
84
84
  },
@@ -148,8 +148,8 @@ class Profiles {
148
148
  Authorization: yield this._getAuthorizationHeader(),
149
149
  "X-Fern-Language": "JavaScript",
150
150
  "X-Fern-SDK-Name": "@airtop/sdk",
151
- "X-Fern-SDK-Version": "0.1.4",
152
- "User-Agent": "@airtop/sdk/0.1.4",
151
+ "X-Fern-SDK-Version": "0.1.6",
152
+ "User-Agent": "@airtop/sdk/0.1.6",
153
153
  "X-Fern-Runtime": core.RUNTIME.type,
154
154
  "X-Fern-Runtime-Version": core.RUNTIME.version,
155
155
  },
@@ -58,9 +58,9 @@ export declare class Sessions {
58
58
  * @throws {@link Airtop.InternalServerError}
59
59
  *
60
60
  * @example
61
- * await client.sessions.getinfo("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b")
61
+ * await client.sessions.getInfo("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b")
62
62
  */
63
- getinfo(id: string, requestOptions?: Sessions.RequestOptions): Promise<Airtop.SessionResponse>;
63
+ getInfo(id: string, requestOptions?: Sessions.RequestOptions): Promise<Airtop.SessionResponse>;
64
64
  /**
65
65
  * Ends a session by ID. If a given session id does not exist within the organization, it is ignored.
66
66
  *
@@ -94,8 +94,8 @@ class Sessions {
94
94
  Authorization: yield this._getAuthorizationHeader(),
95
95
  "X-Fern-Language": "JavaScript",
96
96
  "X-Fern-SDK-Name": "@airtop/sdk",
97
- "X-Fern-SDK-Version": "0.1.4",
98
- "User-Agent": "@airtop/sdk/0.1.4",
97
+ "X-Fern-SDK-Version": "0.1.6",
98
+ "User-Agent": "@airtop/sdk/0.1.6",
99
99
  "X-Fern-Runtime": core.RUNTIME.type,
100
100
  "X-Fern-Runtime-Version": core.RUNTIME.version,
101
101
  },
@@ -180,8 +180,8 @@ class Sessions {
180
180
  Authorization: yield this._getAuthorizationHeader(),
181
181
  "X-Fern-Language": "JavaScript",
182
182
  "X-Fern-SDK-Name": "@airtop/sdk",
183
- "X-Fern-SDK-Version": "0.1.4",
184
- "User-Agent": "@airtop/sdk/0.1.4",
183
+ "X-Fern-SDK-Version": "0.1.6",
184
+ "User-Agent": "@airtop/sdk/0.1.6",
185
185
  "X-Fern-Runtime": core.RUNTIME.type,
186
186
  "X-Fern-Runtime-Version": core.RUNTIME.version,
187
187
  },
@@ -233,9 +233,9 @@ class Sessions {
233
233
  * @throws {@link Airtop.InternalServerError}
234
234
  *
235
235
  * @example
236
- * await client.sessions.getinfo("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b")
236
+ * await client.sessions.getInfo("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b")
237
237
  */
238
- getinfo(id, requestOptions) {
238
+ getInfo(id, requestOptions) {
239
239
  var _a, _b;
240
240
  return __awaiter(this, void 0, void 0, function* () {
241
241
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
@@ -245,8 +245,8 @@ class Sessions {
245
245
  Authorization: yield this._getAuthorizationHeader(),
246
246
  "X-Fern-Language": "JavaScript",
247
247
  "X-Fern-SDK-Name": "@airtop/sdk",
248
- "X-Fern-SDK-Version": "0.1.4",
249
- "User-Agent": "@airtop/sdk/0.1.4",
248
+ "X-Fern-SDK-Version": "0.1.6",
249
+ "User-Agent": "@airtop/sdk/0.1.6",
250
250
  "X-Fern-Runtime": core.RUNTIME.type,
251
251
  "X-Fern-Runtime-Version": core.RUNTIME.version,
252
252
  },
@@ -332,8 +332,8 @@ class Sessions {
332
332
  Authorization: yield this._getAuthorizationHeader(),
333
333
  "X-Fern-Language": "JavaScript",
334
334
  "X-Fern-SDK-Name": "@airtop/sdk",
335
- "X-Fern-SDK-Version": "0.1.4",
336
- "User-Agent": "@airtop/sdk/0.1.4",
335
+ "X-Fern-SDK-Version": "0.1.6",
336
+ "User-Agent": "@airtop/sdk/0.1.6",
337
337
  "X-Fern-Runtime": core.RUNTIME.type,
338
338
  "X-Fern-Runtime-Version": core.RUNTIME.version,
339
339
  },
@@ -380,8 +380,8 @@ class Sessions {
380
380
  Authorization: yield this._getAuthorizationHeader(),
381
381
  "X-Fern-Language": "JavaScript",
382
382
  "X-Fern-SDK-Name": "@airtop/sdk",
383
- "X-Fern-SDK-Version": "0.1.4",
384
- "User-Agent": "@airtop/sdk/0.1.4",
383
+ "X-Fern-SDK-Version": "0.1.6",
384
+ "User-Agent": "@airtop/sdk/0.1.6",
385
385
  "X-Fern-Runtime": core.RUNTIME.type,
386
386
  "X-Fern-Runtime-Version": core.RUNTIME.version,
387
387
  },
@@ -64,10 +64,46 @@ export declare class Windows {
64
64
  * await client.windows.close("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "7334da2a-91b0-42c5-6156-76a5eba87430")
65
65
  */
66
66
  close(sessionId: string, windowId: string, requestOptions?: Windows.RequestOptions): Promise<Airtop.WindowIdResponse>;
67
+ /**
68
+ * @param {string} sessionId - The session id for the window.
69
+ * @param {string} windowId - The Airtop window id of the browser window.
70
+ * @param {Airtop.SessionClickHandlerRequestBody} request
71
+ * @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
72
+ *
73
+ * @example
74
+ * await client.windows.click("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
75
+ * elementDescription: "The login button"
76
+ * })
77
+ */
78
+ click(sessionId: string, windowId: string, request: Airtop.SessionClickHandlerRequestBody, requestOptions?: Windows.RequestOptions): Promise<Airtop.AiPromptResponse>;
79
+ /**
80
+ * @param {string} sessionId - The session id for the window.
81
+ * @param {string} windowId - The Airtop window id of the browser window.
82
+ * @param {Airtop.SessionHoverHandlerRequestBody} request
83
+ * @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
84
+ *
85
+ * @example
86
+ * await client.windows.hover("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
87
+ */
88
+ hover(sessionId: string, windowId: string, request?: Airtop.SessionHoverHandlerRequestBody, requestOptions?: Windows.RequestOptions): Promise<Airtop.AiPromptResponse>;
67
89
  /**
68
90
  * @param {string} sessionId - The session id for the window.
69
91
  * @param {string} windowId - The Airtop window id of the browser window to target with an Airtop AI prompt.
70
- * @param {Airtop.SessionContentPromptHandlerRequestBody} request
92
+ * @param {Airtop.SessionPageQueryHandlerRequestBody} request
93
+ * @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
94
+ *
95
+ * @example
96
+ * await client.windows.pageQuery("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
97
+ * prompt: "What is the main idea of this page?"
98
+ * })
99
+ */
100
+ pageQuery(sessionId: string, windowId: string, request: Airtop.SessionPageQueryHandlerRequestBody, requestOptions?: Windows.RequestOptions): Promise<Airtop.AiPromptResponse>;
101
+ /**
102
+ * This endpoint is deprecated. Please use the `pageQuery` endpoint instead.
103
+ *
104
+ * @param {string} sessionId - The session id for the window.
105
+ * @param {string} windowId - The Airtop window id of the browser window to target with an Airtop AI prompt.
106
+ * @param {Airtop.SessionPageQueryHandlerRequestBody} request
71
107
  * @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
72
108
  *
73
109
  * @example
@@ -75,7 +111,7 @@ export declare class Windows {
75
111
  * prompt: "What is the main idea of this page?"
76
112
  * })
77
113
  */
78
- promptContent(sessionId: string, windowId: string, request: Airtop.SessionContentPromptHandlerRequestBody, requestOptions?: Windows.RequestOptions): Promise<Airtop.AiPromptResponse>;
114
+ promptContent(sessionId: string, windowId: string, request: Airtop.SessionPageQueryHandlerRequestBody, requestOptions?: Windows.RequestOptions): Promise<Airtop.AiPromptResponse>;
79
115
  /**
80
116
  * @param {string} sessionId - The session id for the window.
81
117
  * @param {string} windowId - The Airtop window id of the browser window to scrape.
@@ -87,6 +123,8 @@ export declare class Windows {
87
123
  */
88
124
  scrapeContent(sessionId: string, windowId: string, request?: Airtop.ScrapeContentRequest, requestOptions?: Windows.RequestOptions): Promise<Airtop.ScrapeResponse>;
89
125
  /**
126
+ * This endpoint is deprecated. Please use the `pageQuery` endpoint and ask for a summary in the prompt instead.
127
+ *
90
128
  * @param {string} sessionId - The session id for the window.
91
129
  * @param {string} windowId - The Airtop window id of the browser window to summarize.
92
130
  * @param {Airtop.SessionSummaryHandlerRequestBody} request
@@ -96,5 +134,17 @@ export declare class Windows {
96
134
  * await client.windows.summarizeContent("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
97
135
  */
98
136
  summarizeContent(sessionId: string, windowId: string, request?: Airtop.SessionSummaryHandlerRequestBody, requestOptions?: Windows.RequestOptions): Promise<Airtop.AiPromptResponse>;
137
+ /**
138
+ * @param {string} sessionId - The session id for the window.
139
+ * @param {string} windowId - The Airtop window id of the browser window.
140
+ * @param {Airtop.SessionTypeHandlerRequestBody} request
141
+ * @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
142
+ *
143
+ * @example
144
+ * await client.windows.type("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
145
+ * text: "Example text"
146
+ * })
147
+ */
148
+ type(sessionId: string, windowId: string, request: Airtop.SessionTypeHandlerRequestBody, requestOptions?: Windows.RequestOptions): Promise<Airtop.AiPromptResponse>;
99
149
  protected _getAuthorizationHeader(): Promise<string>;
100
150
  }
@@ -66,8 +66,8 @@ class Windows {
66
66
  Authorization: yield this._getAuthorizationHeader(),
67
67
  "X-Fern-Language": "JavaScript",
68
68
  "X-Fern-SDK-Name": "@airtop/sdk",
69
- "X-Fern-SDK-Version": "0.1.4",
70
- "User-Agent": "@airtop/sdk/0.1.4",
69
+ "X-Fern-SDK-Version": "0.1.6",
70
+ "User-Agent": "@airtop/sdk/0.1.6",
71
71
  "X-Fern-Runtime": core.RUNTIME.type,
72
72
  "X-Fern-Runtime-Version": core.RUNTIME.version,
73
73
  },
@@ -140,8 +140,8 @@ class Windows {
140
140
  Authorization: yield this._getAuthorizationHeader(),
141
141
  "X-Fern-Language": "JavaScript",
142
142
  "X-Fern-SDK-Name": "@airtop/sdk",
143
- "X-Fern-SDK-Version": "0.1.4",
144
- "User-Agent": "@airtop/sdk/0.1.4",
143
+ "X-Fern-SDK-Version": "0.1.6",
144
+ "User-Agent": "@airtop/sdk/0.1.6",
145
145
  "X-Fern-Runtime": core.RUNTIME.type,
146
146
  "X-Fern-Runtime-Version": core.RUNTIME.version,
147
147
  },
@@ -203,8 +203,8 @@ class Windows {
203
203
  Authorization: yield this._getAuthorizationHeader(),
204
204
  "X-Fern-Language": "JavaScript",
205
205
  "X-Fern-SDK-Name": "@airtop/sdk",
206
- "X-Fern-SDK-Version": "0.1.4",
207
- "User-Agent": "@airtop/sdk/0.1.4",
206
+ "X-Fern-SDK-Version": "0.1.6",
207
+ "User-Agent": "@airtop/sdk/0.1.6",
208
208
  "X-Fern-Runtime": core.RUNTIME.type,
209
209
  "X-Fern-Runtime-Version": core.RUNTIME.version,
210
210
  },
@@ -263,8 +263,8 @@ class Windows {
263
263
  Authorization: yield this._getAuthorizationHeader(),
264
264
  "X-Fern-Language": "JavaScript",
265
265
  "X-Fern-SDK-Name": "@airtop/sdk",
266
- "X-Fern-SDK-Version": "0.1.4",
267
- "User-Agent": "@airtop/sdk/0.1.4",
266
+ "X-Fern-SDK-Version": "0.1.6",
267
+ "User-Agent": "@airtop/sdk/0.1.6",
268
268
  "X-Fern-Runtime": core.RUNTIME.type,
269
269
  "X-Fern-Runtime-Version": core.RUNTIME.version,
270
270
  },
@@ -304,10 +304,201 @@ class Windows {
304
304
  }
305
305
  });
306
306
  }
307
+ /**
308
+ * @param {string} sessionId - The session id for the window.
309
+ * @param {string} windowId - The Airtop window id of the browser window.
310
+ * @param {Airtop.SessionClickHandlerRequestBody} request
311
+ * @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
312
+ *
313
+ * @example
314
+ * await client.windows.click("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
315
+ * elementDescription: "The login button"
316
+ * })
317
+ */
318
+ click(sessionId, windowId, request, requestOptions) {
319
+ var _a, _b;
320
+ return __awaiter(this, void 0, void 0, function* () {
321
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
322
+ 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)}/click`),
323
+ method: "POST",
324
+ headers: {
325
+ Authorization: yield this._getAuthorizationHeader(),
326
+ "X-Fern-Language": "JavaScript",
327
+ "X-Fern-SDK-Name": "@airtop/sdk",
328
+ "X-Fern-SDK-Version": "0.1.6",
329
+ "User-Agent": "@airtop/sdk/0.1.6",
330
+ "X-Fern-Runtime": core.RUNTIME.type,
331
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
332
+ },
333
+ contentType: "application/json",
334
+ requestType: "json",
335
+ body: serializers.SessionClickHandlerRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
336
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
337
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
338
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
339
+ });
340
+ if (_response.ok) {
341
+ return serializers.AiPromptResponse.parseOrThrow(_response.body, {
342
+ unrecognizedObjectKeys: "passthrough",
343
+ allowUnrecognizedUnionMembers: true,
344
+ allowUnrecognizedEnumValues: true,
345
+ skipValidation: true,
346
+ breadcrumbsPrefix: ["response"],
347
+ });
348
+ }
349
+ if (_response.error.reason === "status-code") {
350
+ throw new errors.AirtopError({
351
+ statusCode: _response.error.statusCode,
352
+ body: _response.error.body,
353
+ });
354
+ }
355
+ switch (_response.error.reason) {
356
+ case "non-json":
357
+ throw new errors.AirtopError({
358
+ statusCode: _response.error.statusCode,
359
+ body: _response.error.rawBody,
360
+ });
361
+ case "timeout":
362
+ throw new errors.AirtopTimeoutError();
363
+ case "unknown":
364
+ throw new errors.AirtopError({
365
+ message: _response.error.errorMessage,
366
+ });
367
+ }
368
+ });
369
+ }
370
+ /**
371
+ * @param {string} sessionId - The session id for the window.
372
+ * @param {string} windowId - The Airtop window id of the browser window.
373
+ * @param {Airtop.SessionHoverHandlerRequestBody} request
374
+ * @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
375
+ *
376
+ * @example
377
+ * await client.windows.hover("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
378
+ */
379
+ hover(sessionId, windowId, request = {}, requestOptions) {
380
+ var _a, _b;
381
+ return __awaiter(this, void 0, void 0, function* () {
382
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
383
+ 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)}/hover`),
384
+ method: "POST",
385
+ headers: {
386
+ Authorization: yield this._getAuthorizationHeader(),
387
+ "X-Fern-Language": "JavaScript",
388
+ "X-Fern-SDK-Name": "@airtop/sdk",
389
+ "X-Fern-SDK-Version": "0.1.6",
390
+ "User-Agent": "@airtop/sdk/0.1.6",
391
+ "X-Fern-Runtime": core.RUNTIME.type,
392
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
393
+ },
394
+ contentType: "application/json",
395
+ requestType: "json",
396
+ body: serializers.SessionHoverHandlerRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
397
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
398
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
399
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
400
+ });
401
+ if (_response.ok) {
402
+ return serializers.AiPromptResponse.parseOrThrow(_response.body, {
403
+ unrecognizedObjectKeys: "passthrough",
404
+ allowUnrecognizedUnionMembers: true,
405
+ allowUnrecognizedEnumValues: true,
406
+ skipValidation: true,
407
+ breadcrumbsPrefix: ["response"],
408
+ });
409
+ }
410
+ if (_response.error.reason === "status-code") {
411
+ throw new errors.AirtopError({
412
+ statusCode: _response.error.statusCode,
413
+ body: _response.error.body,
414
+ });
415
+ }
416
+ switch (_response.error.reason) {
417
+ case "non-json":
418
+ throw new errors.AirtopError({
419
+ statusCode: _response.error.statusCode,
420
+ body: _response.error.rawBody,
421
+ });
422
+ case "timeout":
423
+ throw new errors.AirtopTimeoutError();
424
+ case "unknown":
425
+ throw new errors.AirtopError({
426
+ message: _response.error.errorMessage,
427
+ });
428
+ }
429
+ });
430
+ }
307
431
  /**
308
432
  * @param {string} sessionId - The session id for the window.
309
433
  * @param {string} windowId - The Airtop window id of the browser window to target with an Airtop AI prompt.
310
- * @param {Airtop.SessionContentPromptHandlerRequestBody} request
434
+ * @param {Airtop.SessionPageQueryHandlerRequestBody} request
435
+ * @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
436
+ *
437
+ * @example
438
+ * await client.windows.pageQuery("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
439
+ * prompt: "What is the main idea of this page?"
440
+ * })
441
+ */
442
+ pageQuery(sessionId, windowId, request, requestOptions) {
443
+ var _a, _b;
444
+ return __awaiter(this, void 0, void 0, function* () {
445
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
446
+ 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)}/page-query`),
447
+ method: "POST",
448
+ headers: {
449
+ Authorization: yield this._getAuthorizationHeader(),
450
+ "X-Fern-Language": "JavaScript",
451
+ "X-Fern-SDK-Name": "@airtop/sdk",
452
+ "X-Fern-SDK-Version": "0.1.6",
453
+ "User-Agent": "@airtop/sdk/0.1.6",
454
+ "X-Fern-Runtime": core.RUNTIME.type,
455
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
456
+ },
457
+ contentType: "application/json",
458
+ requestType: "json",
459
+ body: serializers.SessionPageQueryHandlerRequestBody.jsonOrThrow(request, {
460
+ unrecognizedObjectKeys: "strip",
461
+ }),
462
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
463
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
464
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
465
+ });
466
+ if (_response.ok) {
467
+ return serializers.AiPromptResponse.parseOrThrow(_response.body, {
468
+ unrecognizedObjectKeys: "passthrough",
469
+ allowUnrecognizedUnionMembers: true,
470
+ allowUnrecognizedEnumValues: true,
471
+ skipValidation: true,
472
+ breadcrumbsPrefix: ["response"],
473
+ });
474
+ }
475
+ if (_response.error.reason === "status-code") {
476
+ throw new errors.AirtopError({
477
+ statusCode: _response.error.statusCode,
478
+ body: _response.error.body,
479
+ });
480
+ }
481
+ switch (_response.error.reason) {
482
+ case "non-json":
483
+ throw new errors.AirtopError({
484
+ statusCode: _response.error.statusCode,
485
+ body: _response.error.rawBody,
486
+ });
487
+ case "timeout":
488
+ throw new errors.AirtopTimeoutError();
489
+ case "unknown":
490
+ throw new errors.AirtopError({
491
+ message: _response.error.errorMessage,
492
+ });
493
+ }
494
+ });
495
+ }
496
+ /**
497
+ * This endpoint is deprecated. Please use the `pageQuery` endpoint instead.
498
+ *
499
+ * @param {string} sessionId - The session id for the window.
500
+ * @param {string} windowId - The Airtop window id of the browser window to target with an Airtop AI prompt.
501
+ * @param {Airtop.SessionPageQueryHandlerRequestBody} request
311
502
  * @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
312
503
  *
313
504
  * @example
@@ -325,14 +516,14 @@ class Windows {
325
516
  Authorization: yield this._getAuthorizationHeader(),
326
517
  "X-Fern-Language": "JavaScript",
327
518
  "X-Fern-SDK-Name": "@airtop/sdk",
328
- "X-Fern-SDK-Version": "0.1.4",
329
- "User-Agent": "@airtop/sdk/0.1.4",
519
+ "X-Fern-SDK-Version": "0.1.6",
520
+ "User-Agent": "@airtop/sdk/0.1.6",
330
521
  "X-Fern-Runtime": core.RUNTIME.type,
331
522
  "X-Fern-Runtime-Version": core.RUNTIME.version,
332
523
  },
333
524
  contentType: "application/json",
334
525
  requestType: "json",
335
- body: serializers.SessionContentPromptHandlerRequestBody.jsonOrThrow(request, {
526
+ body: serializers.SessionPageQueryHandlerRequestBody.jsonOrThrow(request, {
336
527
  unrecognizedObjectKeys: "strip",
337
528
  }),
338
529
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -388,8 +579,8 @@ class Windows {
388
579
  Authorization: yield this._getAuthorizationHeader(),
389
580
  "X-Fern-Language": "JavaScript",
390
581
  "X-Fern-SDK-Name": "@airtop/sdk",
391
- "X-Fern-SDK-Version": "0.1.4",
392
- "User-Agent": "@airtop/sdk/0.1.4",
582
+ "X-Fern-SDK-Version": "0.1.6",
583
+ "User-Agent": "@airtop/sdk/0.1.6",
393
584
  "X-Fern-Runtime": core.RUNTIME.type,
394
585
  "X-Fern-Runtime-Version": core.RUNTIME.version,
395
586
  },
@@ -431,6 +622,8 @@ class Windows {
431
622
  });
432
623
  }
433
624
  /**
625
+ * This endpoint is deprecated. Please use the `pageQuery` endpoint and ask for a summary in the prompt instead.
626
+ *
434
627
  * @param {string} sessionId - The session id for the window.
435
628
  * @param {string} windowId - The Airtop window id of the browser window to summarize.
436
629
  * @param {Airtop.SessionSummaryHandlerRequestBody} request
@@ -449,8 +642,8 @@ class Windows {
449
642
  Authorization: yield this._getAuthorizationHeader(),
450
643
  "X-Fern-Language": "JavaScript",
451
644
  "X-Fern-SDK-Name": "@airtop/sdk",
452
- "X-Fern-SDK-Version": "0.1.4",
453
- "User-Agent": "@airtop/sdk/0.1.4",
645
+ "X-Fern-SDK-Version": "0.1.6",
646
+ "User-Agent": "@airtop/sdk/0.1.6",
454
647
  "X-Fern-Runtime": core.RUNTIME.type,
455
648
  "X-Fern-Runtime-Version": core.RUNTIME.version,
456
649
  },
@@ -493,6 +686,69 @@ class Windows {
493
686
  }
494
687
  });
495
688
  }
689
+ /**
690
+ * @param {string} sessionId - The session id for the window.
691
+ * @param {string} windowId - The Airtop window id of the browser window.
692
+ * @param {Airtop.SessionTypeHandlerRequestBody} request
693
+ * @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
694
+ *
695
+ * @example
696
+ * await client.windows.type("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
697
+ * text: "Example text"
698
+ * })
699
+ */
700
+ type(sessionId, windowId, request, requestOptions) {
701
+ var _a, _b;
702
+ return __awaiter(this, void 0, void 0, function* () {
703
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
704
+ 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)}/type`),
705
+ method: "POST",
706
+ headers: {
707
+ Authorization: yield this._getAuthorizationHeader(),
708
+ "X-Fern-Language": "JavaScript",
709
+ "X-Fern-SDK-Name": "@airtop/sdk",
710
+ "X-Fern-SDK-Version": "0.1.6",
711
+ "User-Agent": "@airtop/sdk/0.1.6",
712
+ "X-Fern-Runtime": core.RUNTIME.type,
713
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
714
+ },
715
+ contentType: "application/json",
716
+ requestType: "json",
717
+ body: serializers.SessionTypeHandlerRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
718
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
719
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
720
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
721
+ });
722
+ if (_response.ok) {
723
+ return serializers.AiPromptResponse.parseOrThrow(_response.body, {
724
+ unrecognizedObjectKeys: "passthrough",
725
+ allowUnrecognizedUnionMembers: true,
726
+ allowUnrecognizedEnumValues: true,
727
+ skipValidation: true,
728
+ breadcrumbsPrefix: ["response"],
729
+ });
730
+ }
731
+ if (_response.error.reason === "status-code") {
732
+ throw new errors.AirtopError({
733
+ statusCode: _response.error.statusCode,
734
+ body: _response.error.body,
735
+ });
736
+ }
737
+ switch (_response.error.reason) {
738
+ case "non-json":
739
+ throw new errors.AirtopError({
740
+ statusCode: _response.error.statusCode,
741
+ body: _response.error.rawBody,
742
+ });
743
+ case "timeout":
744
+ throw new errors.AirtopTimeoutError();
745
+ case "unknown":
746
+ throw new errors.AirtopError({
747
+ message: _response.error.errorMessage,
748
+ });
749
+ }
750
+ });
751
+ }
496
752
  _getAuthorizationHeader() {
497
753
  return __awaiter(this, void 0, void 0, function* () {
498
754
  return `Bearer ${yield core.Supplier.get(this._options.apiKey)}`;
@@ -0,0 +1,25 @@
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
+ * elementDescription: "The login button"
9
+ * }
10
+ */
11
+ export interface SessionClickHandlerRequestBody {
12
+ clientRequestId?: string;
13
+ /** Request configuration */
14
+ configuration?: Airtop.ClickConfig;
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
+ /** A natural language description of the element to click. */
18
+ elementDescription: string;
19
+ /**
20
+ * 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).
21
+ *
22
+ * This setting does not extend the maximum session duration provided at the time of session creation.
23
+ */
24
+ timeThresholdSeconds?: number;
25
+ }
@@ -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 SessionHoverHandlerRequestBody {
10
+ clientRequestId?: string;
11
+ /** Request configuration */
12
+ configuration?: Airtop.ClickConfig;
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
+ /** 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. */
16
+ elementDescription?: string;
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
+ }
@@ -1,12 +1,15 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
+ import * as Airtop from "../../../../index";
4
5
  /**
5
6
  * @example
6
7
  * {}
7
8
  */
8
9
  export interface SessionSummaryHandlerRequestBody {
9
10
  clientRequestId?: string;
11
+ /** Request configuration */
12
+ configuration?: Airtop.SummaryConfig;
10
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). */
11
14
  costThresholdCredits?: number;
12
15
  /** An optional prompt providing the Airtop AI model with additional direction or constraints about the summary (such as desired length). */
@@ -0,0 +1,29 @@
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
+ * text: "Example text"
9
+ * }
10
+ */
11
+ export interface SessionTypeHandlerRequestBody {
12
+ clientRequestId?: string;
13
+ /** Request configuration */
14
+ configuration?: Airtop.ClickConfig;
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
+ /** 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
+ elementDescription?: string;
19
+ /** If true, simulates pressing the Enter key after typing the text. */
20
+ pressEnterKey?: boolean;
21
+ /** The text to type into the browser window. */
22
+ text: string;
23
+ /**
24
+ * 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).
25
+ *
26
+ * This setting does not extend the maximum session duration provided at the time of session creation.
27
+ */
28
+ timeThresholdSeconds?: number;
29
+ }