@airtop/sdk 0.1.41 → 0.1.42-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.
Files changed (235) hide show
  1. package/README.md +9 -10
  2. package/api/resources/automations/client/Client.js +4 -4
  3. package/api/resources/files/client/Client.js +5 -5
  4. package/api/resources/files/client/requests/CreateFileRestInputV1.d.ts +1 -1
  5. package/api/resources/profiles/client/Client.js +1 -1
  6. package/api/resources/requests/client/Client.js +1 -1
  7. package/api/resources/sessions/client/Client.js +6 -6
  8. package/api/resources/sessions/types/SessionsEventsResponse.d.ts +4 -4
  9. package/api/resources/sessions/types/index.d.ts +1 -1
  10. package/api/resources/sessions/types/index.js +1 -1
  11. package/api/resources/windows/client/Client.d.ts +233 -5
  12. package/api/resources/windows/client/Client.js +1173 -214
  13. package/api/resources/windows/client/requests/ActRequest.d.ts +30 -0
  14. package/api/resources/windows/client/requests/ActRequest.js +5 -0
  15. package/api/resources/windows/client/requests/AsyncClickRequest.d.ts +29 -0
  16. package/api/resources/windows/client/requests/AsyncClickRequest.js +5 -0
  17. package/api/resources/windows/client/requests/AsyncFileInputRequest.d.ts +33 -0
  18. package/api/resources/windows/client/requests/AsyncFileInputRequest.js +5 -0
  19. package/api/resources/windows/client/requests/AsyncHoverRequest.d.ts +27 -0
  20. package/api/resources/windows/client/requests/AsyncHoverRequest.js +5 -0
  21. package/api/resources/windows/client/requests/AsyncMonitorRequest.d.ts +27 -0
  22. package/api/resources/windows/client/requests/AsyncMonitorRequest.js +5 -0
  23. package/api/resources/windows/client/requests/AsyncPageQueryRequest.d.ts +29 -0
  24. package/api/resources/windows/client/requests/AsyncPageQueryRequest.js +5 -0
  25. package/api/resources/windows/client/requests/AsyncPaginatedExtractionRequest.d.ts +27 -0
  26. package/api/resources/windows/client/requests/AsyncPaginatedExtractionRequest.js +5 -0
  27. package/api/resources/windows/client/requests/AsyncPromptContentRequest.d.ts +29 -0
  28. package/api/resources/windows/client/requests/AsyncPromptContentRequest.js +5 -0
  29. package/api/resources/windows/client/requests/AsyncScreenshotRequest.d.ts +23 -0
  30. package/api/resources/windows/client/requests/AsyncScreenshotRequest.js +5 -0
  31. package/api/resources/windows/client/requests/AsyncSummarizeContentRequest.d.ts +25 -0
  32. package/api/resources/windows/client/requests/AsyncSummarizeContentRequest.js +5 -0
  33. package/api/resources/windows/client/requests/AsyncTypeRequest.d.ts +37 -0
  34. package/api/resources/windows/client/requests/AsyncTypeRequest.js +5 -0
  35. package/api/resources/windows/client/requests/ExtractRequest.d.ts +30 -0
  36. package/api/resources/windows/client/requests/ExtractRequest.js +5 -0
  37. package/api/resources/windows/client/requests/FindManyRequest.d.ts +30 -0
  38. package/api/resources/windows/client/requests/FindManyRequest.js +5 -0
  39. package/api/resources/windows/client/requests/FindOneRequest.d.ts +30 -0
  40. package/api/resources/windows/client/requests/FindOneRequest.js +5 -0
  41. package/api/resources/windows/client/requests/LlmRequest.d.ts +25 -0
  42. package/api/resources/windows/client/requests/LlmRequest.js +5 -0
  43. package/api/resources/windows/client/requests/OperatorPromptV1Body.d.ts +25 -0
  44. package/api/resources/windows/client/requests/OperatorPromptV1Body.js +5 -0
  45. package/api/resources/windows/client/requests/SessionFileInputHandlerRequestBody.d.ts +4 -4
  46. package/api/resources/windows/client/requests/WaitForPageRequest.d.ts +23 -0
  47. package/api/resources/windows/client/requests/WaitForPageRequest.js +5 -0
  48. package/api/resources/windows/client/requests/index.d.ts +17 -0
  49. package/api/resources/windows/types/WaitForPageRequestTargetStatus.d.ts +11 -0
  50. package/api/resources/windows/types/WaitForPageRequestTargetStatus.js +10 -0
  51. package/api/resources/windows/types/index.d.ts +1 -0
  52. package/api/resources/windows/types/index.js +1 -0
  53. package/api/types/AsyncOperatorPromptResponseEnvelope.d.ts +9 -0
  54. package/api/types/AsyncOperatorPromptResponseEnvelope.js +5 -0
  55. package/api/types/FileEventData.d.ts +7 -0
  56. package/api/types/FileEventData.js +5 -0
  57. package/api/types/FileEventMessage.d.ts +2 -1
  58. package/api/types/index.d.ts +2 -0
  59. package/api/types/index.js +2 -0
  60. package/dist/api/resources/automations/client/Client.js +4 -4
  61. package/dist/api/resources/files/client/Client.js +5 -5
  62. package/dist/api/resources/files/client/requests/CreateFileRestInputV1.d.ts +1 -1
  63. package/dist/api/resources/profiles/client/Client.js +1 -1
  64. package/dist/api/resources/requests/client/Client.js +1 -1
  65. package/dist/api/resources/sessions/client/Client.js +6 -6
  66. package/dist/api/resources/sessions/types/SessionsEventsResponse.d.ts +4 -4
  67. package/dist/api/resources/sessions/types/index.d.ts +1 -1
  68. package/dist/api/resources/sessions/types/index.js +1 -1
  69. package/dist/api/resources/windows/client/Client.d.ts +233 -5
  70. package/dist/api/resources/windows/client/Client.js +1173 -214
  71. package/dist/api/resources/windows/client/requests/ActRequest.d.ts +30 -0
  72. package/dist/api/resources/windows/client/requests/ActRequest.js +5 -0
  73. package/dist/api/resources/windows/client/requests/AsyncClickRequest.d.ts +29 -0
  74. package/dist/api/resources/windows/client/requests/AsyncClickRequest.js +5 -0
  75. package/dist/api/resources/windows/client/requests/AsyncFileInputRequest.d.ts +33 -0
  76. package/dist/api/resources/windows/client/requests/AsyncFileInputRequest.js +5 -0
  77. package/dist/api/resources/windows/client/requests/AsyncHoverRequest.d.ts +27 -0
  78. package/dist/api/resources/windows/client/requests/AsyncHoverRequest.js +5 -0
  79. package/dist/api/resources/windows/client/requests/AsyncMonitorRequest.d.ts +27 -0
  80. package/dist/api/resources/windows/client/requests/AsyncMonitorRequest.js +5 -0
  81. package/dist/api/resources/windows/client/requests/AsyncPageQueryRequest.d.ts +29 -0
  82. package/dist/api/resources/windows/client/requests/AsyncPageQueryRequest.js +5 -0
  83. package/dist/api/resources/windows/client/requests/AsyncPaginatedExtractionRequest.d.ts +27 -0
  84. package/dist/api/resources/windows/client/requests/AsyncPaginatedExtractionRequest.js +5 -0
  85. package/dist/api/resources/windows/client/requests/AsyncPromptContentRequest.d.ts +29 -0
  86. package/dist/api/resources/windows/client/requests/AsyncPromptContentRequest.js +5 -0
  87. package/dist/api/resources/windows/client/requests/AsyncScreenshotRequest.d.ts +23 -0
  88. package/dist/api/resources/windows/client/requests/AsyncScreenshotRequest.js +5 -0
  89. package/dist/api/resources/windows/client/requests/AsyncSummarizeContentRequest.d.ts +25 -0
  90. package/dist/api/resources/windows/client/requests/AsyncSummarizeContentRequest.js +5 -0
  91. package/dist/api/resources/windows/client/requests/AsyncTypeRequest.d.ts +37 -0
  92. package/dist/api/resources/windows/client/requests/AsyncTypeRequest.js +5 -0
  93. package/dist/api/resources/windows/client/requests/ExtractRequest.d.ts +30 -0
  94. package/dist/api/resources/windows/client/requests/ExtractRequest.js +5 -0
  95. package/dist/api/resources/windows/client/requests/FindManyRequest.d.ts +30 -0
  96. package/dist/api/resources/windows/client/requests/FindManyRequest.js +5 -0
  97. package/dist/api/resources/windows/client/requests/FindOneRequest.d.ts +30 -0
  98. package/dist/api/resources/windows/client/requests/FindOneRequest.js +5 -0
  99. package/dist/api/resources/windows/client/requests/LlmRequest.d.ts +25 -0
  100. package/dist/api/resources/windows/client/requests/LlmRequest.js +5 -0
  101. package/dist/api/resources/windows/client/requests/OperatorPromptV1Body.d.ts +25 -0
  102. package/dist/api/resources/windows/client/requests/OperatorPromptV1Body.js +5 -0
  103. package/dist/api/resources/windows/client/requests/SessionFileInputHandlerRequestBody.d.ts +4 -4
  104. package/dist/api/resources/windows/client/requests/WaitForPageRequest.d.ts +23 -0
  105. package/dist/api/resources/windows/client/requests/WaitForPageRequest.js +5 -0
  106. package/dist/api/resources/windows/client/requests/index.d.ts +17 -0
  107. package/dist/api/resources/windows/types/WaitForPageRequestTargetStatus.d.ts +11 -0
  108. package/dist/api/resources/windows/types/WaitForPageRequestTargetStatus.js +10 -0
  109. package/dist/api/resources/windows/types/index.d.ts +1 -0
  110. package/dist/api/resources/windows/types/index.js +1 -0
  111. package/dist/api/types/AsyncOperatorPromptResponseEnvelope.d.ts +9 -0
  112. package/dist/api/types/AsyncOperatorPromptResponseEnvelope.js +5 -0
  113. package/dist/api/types/FileEventData.d.ts +7 -0
  114. package/dist/api/types/FileEventData.js +5 -0
  115. package/dist/api/types/FileEventMessage.d.ts +2 -1
  116. package/dist/api/types/index.d.ts +2 -0
  117. package/dist/api/types/index.js +2 -0
  118. package/dist/serialization/resources/sessions/types/SessionsEventsResponse.d.ts +5 -5
  119. package/dist/serialization/resources/sessions/types/SessionsEventsResponse.js +2 -2
  120. package/dist/serialization/resources/sessions/types/index.d.ts +1 -1
  121. package/dist/serialization/resources/sessions/types/index.js +1 -1
  122. package/dist/serialization/resources/windows/client/requests/ActRequest.d.ts +19 -0
  123. package/dist/serialization/resources/windows/client/requests/ActRequest.js +50 -0
  124. package/dist/serialization/resources/windows/client/requests/AsyncClickRequest.d.ts +20 -0
  125. package/dist/serialization/resources/windows/client/requests/AsyncClickRequest.js +51 -0
  126. package/dist/serialization/resources/windows/client/requests/AsyncFileInputRequest.d.ts +23 -0
  127. package/dist/serialization/resources/windows/client/requests/AsyncFileInputRequest.js +54 -0
  128. package/dist/serialization/resources/windows/client/requests/AsyncHoverRequest.d.ts +19 -0
  129. package/dist/serialization/resources/windows/client/requests/AsyncHoverRequest.js +50 -0
  130. package/dist/serialization/resources/windows/client/requests/AsyncMonitorRequest.d.ts +19 -0
  131. package/dist/serialization/resources/windows/client/requests/AsyncMonitorRequest.js +50 -0
  132. package/dist/serialization/resources/windows/client/requests/AsyncPageQueryRequest.d.ts +20 -0
  133. package/dist/serialization/resources/windows/client/requests/AsyncPageQueryRequest.js +51 -0
  134. package/dist/serialization/resources/windows/client/requests/AsyncPaginatedExtractionRequest.d.ts +19 -0
  135. package/dist/serialization/resources/windows/client/requests/AsyncPaginatedExtractionRequest.js +50 -0
  136. package/dist/serialization/resources/windows/client/requests/AsyncPromptContentRequest.d.ts +20 -0
  137. package/dist/serialization/resources/windows/client/requests/AsyncPromptContentRequest.js +51 -0
  138. package/dist/serialization/resources/windows/client/requests/AsyncScreenshotRequest.d.ts +18 -0
  139. package/dist/serialization/resources/windows/client/requests/AsyncScreenshotRequest.js +49 -0
  140. package/dist/serialization/resources/windows/client/requests/AsyncSummarizeContentRequest.d.ts +19 -0
  141. package/dist/serialization/resources/windows/client/requests/AsyncSummarizeContentRequest.js +50 -0
  142. package/dist/serialization/resources/windows/client/requests/AsyncTypeRequest.d.ts +24 -0
  143. package/dist/serialization/resources/windows/client/requests/AsyncTypeRequest.js +55 -0
  144. package/dist/serialization/resources/windows/client/requests/ExtractRequest.d.ts +19 -0
  145. package/dist/serialization/resources/windows/client/requests/ExtractRequest.js +50 -0
  146. package/dist/serialization/resources/windows/client/requests/FindManyRequest.d.ts +19 -0
  147. package/dist/serialization/resources/windows/client/requests/FindManyRequest.js +50 -0
  148. package/dist/serialization/resources/windows/client/requests/FindOneRequest.d.ts +19 -0
  149. package/dist/serialization/resources/windows/client/requests/FindOneRequest.js +50 -0
  150. package/dist/serialization/resources/windows/client/requests/LlmRequest.d.ts +17 -0
  151. package/dist/serialization/resources/windows/client/requests/LlmRequest.js +48 -0
  152. package/dist/serialization/resources/windows/client/requests/OperatorPromptV1Body.d.ts +17 -0
  153. package/dist/serialization/resources/windows/client/requests/OperatorPromptV1Body.js +48 -0
  154. package/dist/serialization/resources/windows/client/requests/SessionFileInputHandlerRequestBody.d.ts +2 -1
  155. package/dist/serialization/resources/windows/client/requests/SessionFileInputHandlerRequestBody.js +2 -1
  156. package/dist/serialization/resources/windows/client/requests/WaitForPageRequest.d.ts +18 -0
  157. package/dist/serialization/resources/windows/client/requests/WaitForPageRequest.js +49 -0
  158. package/dist/serialization/resources/windows/client/requests/index.d.ts +17 -0
  159. package/dist/serialization/resources/windows/client/requests/index.js +35 -1
  160. package/dist/serialization/resources/windows/types/WaitForPageRequestTargetStatus.d.ts +10 -0
  161. package/dist/serialization/resources/windows/types/WaitForPageRequestTargetStatus.js +41 -0
  162. package/dist/serialization/resources/windows/types/index.d.ts +1 -0
  163. package/dist/serialization/resources/windows/types/index.js +1 -0
  164. package/dist/serialization/types/AsyncOperatorPromptResponseEnvelope.d.ts +15 -0
  165. package/dist/serialization/types/AsyncOperatorPromptResponseEnvelope.js +46 -0
  166. package/dist/serialization/types/FileEventData.d.ts +13 -0
  167. package/dist/serialization/types/FileEventData.js +44 -0
  168. package/dist/serialization/types/FileEventMessage.d.ts +2 -1
  169. package/dist/serialization/types/FileEventMessage.js +2 -1
  170. package/dist/serialization/types/index.d.ts +2 -0
  171. package/dist/serialization/types/index.js +2 -0
  172. package/dist/utils/upload.js +12 -7
  173. package/dist/version.d.ts +1 -1
  174. package/dist/version.js +1 -1
  175. package/dist/wrapper/AirtopSessions.js +12 -5
  176. package/package.json +1 -1
  177. package/reference.md +1457 -144
  178. package/serialization/resources/sessions/types/SessionsEventsResponse.d.ts +5 -5
  179. package/serialization/resources/sessions/types/SessionsEventsResponse.js +2 -2
  180. package/serialization/resources/sessions/types/index.d.ts +1 -1
  181. package/serialization/resources/sessions/types/index.js +1 -1
  182. package/serialization/resources/windows/client/requests/ActRequest.d.ts +19 -0
  183. package/serialization/resources/windows/client/requests/ActRequest.js +50 -0
  184. package/serialization/resources/windows/client/requests/AsyncClickRequest.d.ts +20 -0
  185. package/serialization/resources/windows/client/requests/AsyncClickRequest.js +51 -0
  186. package/serialization/resources/windows/client/requests/AsyncFileInputRequest.d.ts +23 -0
  187. package/serialization/resources/windows/client/requests/AsyncFileInputRequest.js +54 -0
  188. package/serialization/resources/windows/client/requests/AsyncHoverRequest.d.ts +19 -0
  189. package/serialization/resources/windows/client/requests/AsyncHoverRequest.js +50 -0
  190. package/serialization/resources/windows/client/requests/AsyncMonitorRequest.d.ts +19 -0
  191. package/serialization/resources/windows/client/requests/AsyncMonitorRequest.js +50 -0
  192. package/serialization/resources/windows/client/requests/AsyncPageQueryRequest.d.ts +20 -0
  193. package/serialization/resources/windows/client/requests/AsyncPageQueryRequest.js +51 -0
  194. package/serialization/resources/windows/client/requests/AsyncPaginatedExtractionRequest.d.ts +19 -0
  195. package/serialization/resources/windows/client/requests/AsyncPaginatedExtractionRequest.js +50 -0
  196. package/serialization/resources/windows/client/requests/AsyncPromptContentRequest.d.ts +20 -0
  197. package/serialization/resources/windows/client/requests/AsyncPromptContentRequest.js +51 -0
  198. package/serialization/resources/windows/client/requests/AsyncScreenshotRequest.d.ts +18 -0
  199. package/serialization/resources/windows/client/requests/AsyncScreenshotRequest.js +49 -0
  200. package/serialization/resources/windows/client/requests/AsyncSummarizeContentRequest.d.ts +19 -0
  201. package/serialization/resources/windows/client/requests/AsyncSummarizeContentRequest.js +50 -0
  202. package/serialization/resources/windows/client/requests/AsyncTypeRequest.d.ts +24 -0
  203. package/serialization/resources/windows/client/requests/AsyncTypeRequest.js +55 -0
  204. package/serialization/resources/windows/client/requests/ExtractRequest.d.ts +19 -0
  205. package/serialization/resources/windows/client/requests/ExtractRequest.js +50 -0
  206. package/serialization/resources/windows/client/requests/FindManyRequest.d.ts +19 -0
  207. package/serialization/resources/windows/client/requests/FindManyRequest.js +50 -0
  208. package/serialization/resources/windows/client/requests/FindOneRequest.d.ts +19 -0
  209. package/serialization/resources/windows/client/requests/FindOneRequest.js +50 -0
  210. package/serialization/resources/windows/client/requests/LlmRequest.d.ts +17 -0
  211. package/serialization/resources/windows/client/requests/LlmRequest.js +48 -0
  212. package/serialization/resources/windows/client/requests/OperatorPromptV1Body.d.ts +17 -0
  213. package/serialization/resources/windows/client/requests/OperatorPromptV1Body.js +48 -0
  214. package/serialization/resources/windows/client/requests/SessionFileInputHandlerRequestBody.d.ts +2 -1
  215. package/serialization/resources/windows/client/requests/SessionFileInputHandlerRequestBody.js +2 -1
  216. package/serialization/resources/windows/client/requests/WaitForPageRequest.d.ts +18 -0
  217. package/serialization/resources/windows/client/requests/WaitForPageRequest.js +49 -0
  218. package/serialization/resources/windows/client/requests/index.d.ts +17 -0
  219. package/serialization/resources/windows/client/requests/index.js +35 -1
  220. package/serialization/resources/windows/types/WaitForPageRequestTargetStatus.d.ts +10 -0
  221. package/serialization/resources/windows/types/WaitForPageRequestTargetStatus.js +41 -0
  222. package/serialization/resources/windows/types/index.d.ts +1 -0
  223. package/serialization/resources/windows/types/index.js +1 -0
  224. package/serialization/types/AsyncOperatorPromptResponseEnvelope.d.ts +15 -0
  225. package/serialization/types/AsyncOperatorPromptResponseEnvelope.js +46 -0
  226. package/serialization/types/FileEventData.d.ts +13 -0
  227. package/serialization/types/FileEventData.js +44 -0
  228. package/serialization/types/FileEventMessage.d.ts +2 -1
  229. package/serialization/types/FileEventMessage.js +2 -1
  230. package/serialization/types/index.d.ts +2 -0
  231. package/serialization/types/index.js +2 -0
  232. package/utils/upload.js +12 -7
  233. package/version.d.ts +1 -1
  234. package/version.js +1 -1
  235. package/wrapper/AirtopSessions.js +12 -5
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.1.41";
4
+ exports.SDK_VERSION = "0.1.42-beta0";
@@ -336,6 +336,7 @@ class AirtopSessions extends Client_1.Sessions {
336
336
  */
337
337
  waitForUploadAvailable(sessionId_1, fileId_1) {
338
338
  return __awaiter(this, arguments, void 0, function* (sessionId, fileId, timeoutSeconds = 300) {
339
+ this.log(`waiting for uploaded file to be available on session: ${sessionId} ${fileId}`);
339
340
  // Create a promise that resolves to null after the timeout
340
341
  const timeoutPromise = new Promise((resolve) => {
341
342
  setTimeout(() => resolve(null), timeoutSeconds * 1000);
@@ -351,9 +352,15 @@ class AirtopSessions extends Client_1.Sessions {
351
352
  const event = _c;
352
353
  const e = event;
353
354
  if (e.event === 'file_upload_status') {
354
- this.log(`file_upload_status message received:\n${JSON.stringify(event, null, 2)}`);
355
- if (e.status === 'available' && e.fileId === fileId) {
356
- return event;
355
+ if (e.fileId === fileId) {
356
+ if (e.status === 'available') {
357
+ this.log(`uploaded file is now available on session: ${sessionId} ${fileId}`);
358
+ return event;
359
+ }
360
+ if (e.status === 'upload_failed') {
361
+ this.log(`upload failed: ${sessionId} ${fileId}`);
362
+ throw new Error(`upload failed: ${e.eventData.error}`);
363
+ }
357
364
  }
358
365
  }
359
366
  }
@@ -409,7 +416,7 @@ class AirtopSessions extends Client_1.Sessions {
409
416
  }
410
417
  lastCallbackPromise = lastCallbackPromise
411
418
  .then(() => callback(msg))
412
- .catch(error => this.log(`Error in captcha callback: ${error}`));
419
+ .catch((error) => this.log(`Error in captcha callback: ${error}`));
413
420
  }
414
421
  }
415
422
  }
@@ -420,7 +427,7 @@ class AirtopSessions extends Client_1.Sessions {
420
427
  }
421
428
  finally { if (e_5) throw e_5.error; }
422
429
  }
423
- }))().catch(error => {
430
+ }))().catch((error) => {
424
431
  if (error.name !== 'AbortError') {
425
432
  this.log(`Error in event processing: ${error}`);
426
433
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@airtop/sdk",
3
- "version": "0.1.41",
3
+ "version": "0.1.42-beta0",
4
4
  "private": false,
5
5
  "repository": "https://github.com/airtop-ai/airtop-node-sdk",
6
6
  "main": "./index.js",