@airtop/sdk 0.1.6 → 0.1.8

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 (164) hide show
  1. package/Client.d.ts +3 -3
  2. package/Client.js +9 -9
  3. package/README.md +6 -6
  4. package/api/resources/index.d.ts +3 -3
  5. package/api/resources/index.js +4 -4
  6. package/api/resources/profiles/client/Client.js +4 -4
  7. package/api/resources/sessions/client/Client.js +10 -10
  8. package/api/resources/windows/client/Client.d.ts +3 -3
  9. package/api/resources/windows/client/Client.js +25 -25
  10. package/api/resources/windows/client/requests/CreateWindowInputV1Body.d.ts +1 -1
  11. package/api/resources/windows/client/requests/WindowLoadUrlV1Body.d.ts +1 -1
  12. package/api/resources/windows/types/CreateWindowInputV1BodyWaitUntil.d.ts +3 -2
  13. package/api/resources/windows/types/CreateWindowInputV1BodyWaitUntil.js +1 -0
  14. package/api/resources/windows/types/WindowLoadUrlV1BodyWaitUntil.d.ts +3 -2
  15. package/api/resources/windows/types/WindowLoadUrlV1BodyWaitUntil.js +1 -0
  16. package/api/types/ClickConfig.d.ts +5 -1
  17. package/api/types/Issue.d.ts +2 -0
  18. package/{dist/api/types/EmptyResponseJson.d.ts → api/types/OperationOutcome.d.ts} +1 -1
  19. package/api/types/{EmptyResponse.d.ts → OperationOutcomeResponse.d.ts} +3 -3
  20. package/api/types/PageQueryConfig.d.ts +3 -0
  21. package/api/types/SummaryConfig.d.ts +2 -0
  22. package/api/types/VisualAnalysisConfig.d.ts +12 -0
  23. package/api/types/VisualAnalysisConfigPartitionDirection.d.ts +12 -0
  24. package/api/types/VisualAnalysisConfigPartitionDirection.js +11 -0
  25. package/api/types/VisualAnalysisConfigScope.d.ts +11 -0
  26. package/api/types/VisualAnalysisConfigScope.js +10 -0
  27. package/api/types/index.d.ts +5 -4
  28. package/api/types/index.js +5 -4
  29. package/dist/Client.d.ts +3 -3
  30. package/dist/Client.js +9 -9
  31. package/dist/api/resources/index.d.ts +3 -3
  32. package/dist/api/resources/index.js +4 -4
  33. package/dist/api/resources/profiles/client/Client.js +4 -4
  34. package/dist/api/resources/sessions/client/Client.js +10 -10
  35. package/dist/api/resources/windows/client/Client.d.ts +3 -3
  36. package/dist/api/resources/windows/client/Client.js +25 -25
  37. package/dist/api/resources/windows/client/requests/CreateWindowInputV1Body.d.ts +1 -1
  38. package/dist/api/resources/windows/client/requests/WindowLoadUrlV1Body.d.ts +1 -1
  39. package/dist/api/resources/windows/types/CreateWindowInputV1BodyWaitUntil.d.ts +3 -2
  40. package/dist/api/resources/windows/types/CreateWindowInputV1BodyWaitUntil.js +1 -0
  41. package/dist/api/resources/windows/types/WindowLoadUrlV1BodyWaitUntil.d.ts +3 -2
  42. package/dist/api/resources/windows/types/WindowLoadUrlV1BodyWaitUntil.js +1 -0
  43. package/dist/api/types/ClickConfig.d.ts +5 -1
  44. package/dist/api/types/Issue.d.ts +2 -0
  45. package/{api/types/EmptyResponseJson.d.ts → dist/api/types/OperationOutcome.d.ts} +1 -1
  46. package/dist/api/types/{EmptyResponse.d.ts → OperationOutcomeResponse.d.ts} +3 -3
  47. package/dist/api/types/PageQueryConfig.d.ts +3 -0
  48. package/dist/api/types/SummaryConfig.d.ts +2 -0
  49. package/dist/api/types/VisualAnalysisConfig.d.ts +12 -0
  50. package/dist/api/types/VisualAnalysisConfigPartitionDirection.d.ts +12 -0
  51. package/dist/api/types/VisualAnalysisConfigPartitionDirection.js +11 -0
  52. package/dist/api/types/VisualAnalysisConfigScope.d.ts +11 -0
  53. package/dist/api/types/VisualAnalysisConfigScope.js +10 -0
  54. package/dist/api/types/index.d.ts +5 -4
  55. package/dist/api/types/index.js +5 -4
  56. package/dist/index.d.ts +1 -0
  57. package/dist/index.js +4 -0
  58. package/dist/serialization/resources/index.d.ts +3 -3
  59. package/dist/serialization/resources/index.js +4 -4
  60. package/dist/serialization/resources/windows/types/CreateWindowInputV1BodyWaitUntil.d.ts +1 -1
  61. package/dist/serialization/resources/windows/types/CreateWindowInputV1BodyWaitUntil.js +1 -1
  62. package/dist/serialization/resources/windows/types/WindowLoadUrlV1BodyWaitUntil.d.ts +1 -1
  63. package/dist/serialization/resources/windows/types/WindowLoadUrlV1BodyWaitUntil.js +1 -1
  64. package/dist/serialization/types/ClickConfig.d.ts +5 -2
  65. package/dist/serialization/types/ClickConfig.js +4 -1
  66. package/dist/serialization/types/Issue.d.ts +1 -0
  67. package/dist/serialization/types/Issue.js +1 -0
  68. package/{serialization/types/EmptyResponseJson.d.ts → dist/serialization/types/OperationOutcome.d.ts} +2 -2
  69. package/{serialization/types/EmptyResponseJson.js → dist/serialization/types/OperationOutcome.js} +2 -2
  70. package/dist/serialization/types/OperationOutcomeResponse.d.ts +18 -0
  71. package/dist/serialization/types/{EmptyResponse.js → OperationOutcomeResponse.js} +6 -6
  72. package/dist/serialization/types/PageQueryConfig.d.ts +2 -0
  73. package/dist/serialization/types/PageQueryConfig.js +2 -0
  74. package/dist/serialization/types/SummaryConfig.d.ts +2 -0
  75. package/dist/serialization/types/SummaryConfig.js +2 -0
  76. package/dist/serialization/types/VisualAnalysisConfig.d.ts +16 -0
  77. package/dist/serialization/types/{EnvelopeStatusDefaultMeta.js → VisualAnalysisConfig.js} +7 -5
  78. package/dist/serialization/types/VisualAnalysisConfigPartitionDirection.d.ts +10 -0
  79. package/dist/serialization/types/VisualAnalysisConfigPartitionDirection.js +31 -0
  80. package/dist/serialization/types/VisualAnalysisConfigScope.d.ts +10 -0
  81. package/dist/serialization/types/{EnvelopeStatusDefaultMetaStatus.js → VisualAnalysisConfigScope.js} +2 -2
  82. package/dist/serialization/types/index.d.ts +5 -4
  83. package/dist/serialization/types/index.js +5 -4
  84. package/dist/utils/batch-operate/SessionQueue.d.ts +46 -0
  85. package/dist/utils/batch-operate/SessionQueue.js +223 -0
  86. package/dist/utils/batch-operate/WindowQueue.d.ts +25 -0
  87. package/dist/utils/batch-operate/WindowQueue.js +201 -0
  88. package/dist/utils/batch-operate/batch-util.d.ts +3 -0
  89. package/dist/utils/batch-operate/batch-util.js +51 -0
  90. package/dist/utils/batch-operate/helpers.d.ts +2 -0
  91. package/dist/utils/batch-operate/helpers.js +19 -0
  92. package/dist/utils/batch-operate/types.d.ts +29 -0
  93. package/dist/utils/batch-operate/types.js +2 -0
  94. package/dist/utils/index.d.ts +2 -0
  95. package/dist/utils/index.js +18 -0
  96. package/dist/wrapper/AirtopClient.d.ts +3 -0
  97. package/dist/wrapper/AirtopClient.js +16 -0
  98. package/dist/wrapper/AirtopWindows.d.ts +34 -0
  99. package/dist/wrapper/AirtopWindows.js +55 -0
  100. package/index.d.ts +1 -0
  101. package/index.js +4 -0
  102. package/package.json +3 -2
  103. package/reference.md +243 -243
  104. package/serialization/resources/index.d.ts +3 -3
  105. package/serialization/resources/index.js +4 -4
  106. package/serialization/resources/windows/types/CreateWindowInputV1BodyWaitUntil.d.ts +1 -1
  107. package/serialization/resources/windows/types/CreateWindowInputV1BodyWaitUntil.js +1 -1
  108. package/serialization/resources/windows/types/WindowLoadUrlV1BodyWaitUntil.d.ts +1 -1
  109. package/serialization/resources/windows/types/WindowLoadUrlV1BodyWaitUntil.js +1 -1
  110. package/serialization/types/ClickConfig.d.ts +5 -2
  111. package/serialization/types/ClickConfig.js +4 -1
  112. package/serialization/types/Issue.d.ts +1 -0
  113. package/serialization/types/Issue.js +1 -0
  114. package/{dist/serialization/types/EmptyResponseJson.d.ts → serialization/types/OperationOutcome.d.ts} +2 -2
  115. package/{dist/serialization/types/EmptyResponseJson.js → serialization/types/OperationOutcome.js} +2 -2
  116. package/serialization/types/OperationOutcomeResponse.d.ts +18 -0
  117. package/serialization/types/{EmptyResponse.js → OperationOutcomeResponse.js} +6 -6
  118. package/serialization/types/PageQueryConfig.d.ts +2 -0
  119. package/serialization/types/PageQueryConfig.js +2 -0
  120. package/serialization/types/SummaryConfig.d.ts +2 -0
  121. package/serialization/types/SummaryConfig.js +2 -0
  122. package/serialization/types/VisualAnalysisConfig.d.ts +16 -0
  123. package/serialization/types/VisualAnalysisConfig.js +37 -0
  124. package/serialization/types/VisualAnalysisConfigPartitionDirection.d.ts +10 -0
  125. package/serialization/types/VisualAnalysisConfigPartitionDirection.js +31 -0
  126. package/serialization/types/VisualAnalysisConfigScope.d.ts +10 -0
  127. package/serialization/types/{EnvelopeStatusDefaultMetaStatus.js → VisualAnalysisConfigScope.js} +2 -2
  128. package/serialization/types/index.d.ts +5 -4
  129. package/serialization/types/index.js +5 -4
  130. package/utils/batch-operate/SessionQueue.d.ts +46 -0
  131. package/utils/batch-operate/SessionQueue.js +223 -0
  132. package/utils/batch-operate/WindowQueue.d.ts +25 -0
  133. package/utils/batch-operate/WindowQueue.js +201 -0
  134. package/utils/batch-operate/batch-util.d.ts +3 -0
  135. package/utils/batch-operate/batch-util.js +51 -0
  136. package/utils/batch-operate/helpers.d.ts +2 -0
  137. package/utils/batch-operate/helpers.js +19 -0
  138. package/utils/batch-operate/types.d.ts +29 -0
  139. package/utils/batch-operate/types.js +2 -0
  140. package/utils/index.d.ts +2 -0
  141. package/utils/index.js +18 -0
  142. package/wrapper/AirtopClient.d.ts +3 -0
  143. package/wrapper/AirtopClient.js +16 -0
  144. package/wrapper/AirtopWindows.d.ts +34 -0
  145. package/wrapper/AirtopWindows.js +55 -0
  146. package/api/types/EnvelopeStatusDefaultMeta.d.ts +0 -8
  147. package/api/types/EnvelopeStatusDefaultMetaStatus.d.ts +0 -9
  148. package/api/types/EnvelopeStatusDefaultMetaStatus.js +0 -11
  149. package/dist/api/types/EnvelopeStatusDefaultMeta.d.ts +0 -8
  150. package/dist/api/types/EnvelopeStatusDefaultMetaStatus.d.ts +0 -9
  151. package/dist/api/types/EnvelopeStatusDefaultMetaStatus.js +0 -11
  152. package/dist/serialization/types/EmptyResponse.d.ts +0 -18
  153. package/dist/serialization/types/EnvelopeStatusDefaultMeta.d.ts +0 -14
  154. package/dist/serialization/types/EnvelopeStatusDefaultMetaStatus.d.ts +0 -10
  155. package/serialization/types/EmptyResponse.d.ts +0 -18
  156. package/serialization/types/EnvelopeStatusDefaultMeta.d.ts +0 -14
  157. package/serialization/types/EnvelopeStatusDefaultMeta.js +0 -35
  158. package/serialization/types/EnvelopeStatusDefaultMetaStatus.d.ts +0 -10
  159. /package/api/types/{EmptyResponse.js → OperationOutcome.js} +0 -0
  160. /package/api/types/{EmptyResponseJson.js → OperationOutcomeResponse.js} +0 -0
  161. /package/api/types/{EnvelopeStatusDefaultMeta.js → VisualAnalysisConfig.js} +0 -0
  162. /package/dist/api/types/{EmptyResponse.js → OperationOutcome.js} +0 -0
  163. /package/dist/api/types/{EmptyResponseJson.js → OperationOutcomeResponse.js} +0 -0
  164. /package/dist/api/types/{EnvelopeStatusDefaultMeta.js → VisualAnalysisConfig.js} +0 -0
@@ -80,6 +80,40 @@ export declare class AirtopWindows extends WindowsClass {
80
80
  }, requestOptions?: WindowsNamespace.RequestOptions): Promise<Airtop.AiPromptResponse>;
81
81
  getWindowInfoForPuppeteerPage(session: Airtop.ExternalSessionWithConnectionInfo, page: puppeteer.Page, request?: Airtop.GetWindowInfoRequest, requestOptions?: WindowsNamespace.RequestOptions): Promise<Airtop.WindowResponse>;
82
82
  getWindowInfoForPlaywrightPage(session: Airtop.ExternalSessionWithConnectionInfo, page: playwright.Page, request?: Airtop.GetWindowInfoRequest, requestOptions?: WindowsNamespace.RequestOptions): Promise<Airtop.WindowResponse>;
83
+ /**
84
+ * @param {string} sessionId - The session id for the window.
85
+ * @param {string} windowId - The Airtop window id of the browser window.
86
+ * @param {Airtop.SessionClickHandlerRequestBody} request
87
+ * @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
88
+ *
89
+ * @example
90
+ * await client.windows.click("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
91
+ * elementDescription: "The login button"
92
+ * })
93
+ */
94
+ click(sessionId: string, windowId: string, request: Airtop.SessionClickHandlerRequestBody, requestOptions?: WindowsNamespace.RequestOptions): Promise<Airtop.AiPromptResponse>;
95
+ /**
96
+ * @param {string} sessionId - The session id for the window.
97
+ * @param {string} windowId - The Airtop window id of the browser window.
98
+ * @param {Airtop.SessionHoverHandlerRequestBody} request
99
+ * @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
100
+ *
101
+ * @example
102
+ * await client.windows.hover("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
103
+ */
104
+ hover(sessionId: string, windowId: string, request?: Airtop.SessionHoverHandlerRequestBody, requestOptions?: WindowsNamespace.RequestOptions): Promise<Airtop.AiPromptResponse>;
105
+ /**
106
+ * @param {string} sessionId - The session id for the window.
107
+ * @param {string} windowId - The Airtop window id of the browser window.
108
+ * @param {Airtop.SessionTypeHandlerRequestBody} request
109
+ * @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
110
+ *
111
+ * @example
112
+ * await client.windows.type("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
113
+ * text: "Example text"
114
+ * })
115
+ */
116
+ type(sessionId: string, windowId: string, request: Airtop.SessionTypeHandlerRequestBody, requestOptions?: WindowsNamespace.RequestOptions): Promise<Airtop.AiPromptResponse>;
83
117
  private executeSeleniumCDPCommand;
84
118
  getWindowInfoForSeleniumDriver(session: Airtop.ExternalSessionWithConnectionInfo, driver: seleniumWebdriver.WebDriver, request?: Airtop.GetWindowInfoRequest, requestOptions?: WindowsNamespace.RequestOptions): Promise<Airtop.WindowResponse>;
85
119
  }
@@ -135,6 +135,61 @@ class AirtopWindows extends Client_1.Windows {
135
135
  return yield this.getWindowInfo(session.id, targetId, request, requestOptions);
136
136
  });
137
137
  }
138
+ /**
139
+ * @param {string} sessionId - The session id for the window.
140
+ * @param {string} windowId - The Airtop window id of the browser window.
141
+ * @param {Airtop.SessionClickHandlerRequestBody} request
142
+ * @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
143
+ *
144
+ * @example
145
+ * await client.windows.click("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
146
+ * elementDescription: "The login button"
147
+ * })
148
+ */
149
+ click(sessionId, windowId, request, requestOptions) {
150
+ const _super = Object.create(null, {
151
+ click: { get: () => super.click }
152
+ });
153
+ return __awaiter(this, void 0, void 0, function* () {
154
+ return _super.click.call(this, sessionId, windowId, request, Object.assign(Object.assign({ timeoutInSeconds: 600 }, requestOptions), { maxRetries: 0 }));
155
+ });
156
+ }
157
+ /**
158
+ * @param {string} sessionId - The session id for the window.
159
+ * @param {string} windowId - The Airtop window id of the browser window.
160
+ * @param {Airtop.SessionHoverHandlerRequestBody} request
161
+ * @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
162
+ *
163
+ * @example
164
+ * await client.windows.hover("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
165
+ */
166
+ hover(sessionId, windowId, request = {}, requestOptions) {
167
+ const _super = Object.create(null, {
168
+ hover: { get: () => super.hover }
169
+ });
170
+ return __awaiter(this, void 0, void 0, function* () {
171
+ return _super.hover.call(this, sessionId, windowId, request, Object.assign(Object.assign({ timeoutInSeconds: 600 }, requestOptions), { maxRetries: 0 }));
172
+ });
173
+ }
174
+ /**
175
+ * @param {string} sessionId - The session id for the window.
176
+ * @param {string} windowId - The Airtop window id of the browser window.
177
+ * @param {Airtop.SessionTypeHandlerRequestBody} request
178
+ * @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
179
+ *
180
+ * @example
181
+ * await client.windows.type("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
182
+ * text: "Example text"
183
+ * })
184
+ */
185
+ type(sessionId, windowId, request, requestOptions) {
186
+ const _super = Object.create(null, {
187
+ type: { get: () => super.type }
188
+ });
189
+ return __awaiter(this, void 0, void 0, function* () {
190
+ return _super.type.call(this, sessionId, windowId, request, Object.assign(Object.assign({ timeoutInSeconds: 600 }, requestOptions), { maxRetries: 0 }));
191
+ });
192
+ }
138
193
  executeSeleniumCDPCommand(driver, session, apiKey) {
139
194
  return __awaiter(this, void 0, void 0, function* () {
140
195
  // Get the current WebDriver session ID
package/index.d.ts CHANGED
@@ -4,3 +4,4 @@ export { AirtopEnvironment } from "./environments";
4
4
  export { AirtopError, AirtopTimeoutError } from "./errors";
5
5
  export { AirtopClient } from './wrapper/AirtopClient';
6
6
  export { LiveViewEventName, LiveViewMessage } from './live-view/types';
7
+ export * from './utils';
package/index.js CHANGED
@@ -22,6 +22,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
+ };
25
28
  Object.defineProperty(exports, "__esModule", { value: true });
26
29
  exports.LiveViewEventName = exports.AirtopClient = exports.AirtopTimeoutError = exports.AirtopError = exports.AirtopEnvironment = exports.Resources = exports.Airtop = void 0;
27
30
  exports.Airtop = __importStar(require("./api"));
@@ -35,3 +38,4 @@ var AirtopClient_1 = require("./wrapper/AirtopClient");
35
38
  Object.defineProperty(exports, "AirtopClient", { enumerable: true, get: function () { return AirtopClient_1.AirtopClient; } });
36
39
  var types_1 = require("./live-view/types");
37
40
  Object.defineProperty(exports, "LiveViewEventName", { enumerable: true, get: function () { return types_1.LiveViewEventName; } });
41
+ __exportStar(require("./utils"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@airtop/sdk",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "private": false,
5
5
  "repository": "https://github.com/airtop-ai/airtop-node-sdk",
6
6
  "main": "./index.js",
@@ -18,7 +18,8 @@
18
18
  "formdata-node": "^6.0.3",
19
19
  "node-fetch": "2.7.0",
20
20
  "qs": "6.11.2",
21
- "js-base64": "3.7.2"
21
+ "js-base64": "3.7.2",
22
+ "async-mutex": "0.5.0"
22
23
  },
23
24
  "devDependencies": {
24
25
  "@types/url-join": "4.0.1",