@airtop/sdk 0.1.5 → 0.1.7

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 (199) 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 +37 -3
  9. package/api/resources/windows/client/Client.js +206 -19
  10. package/api/resources/windows/client/requests/CreateWindowInputV1Body.d.ts +1 -1
  11. package/api/resources/windows/client/requests/SessionClickHandlerRequestBody.d.ts +25 -0
  12. package/api/resources/windows/client/requests/SessionHoverHandlerRequestBody.d.ts +23 -0
  13. package/api/resources/windows/client/requests/SessionTypeHandlerRequestBody.d.ts +29 -0
  14. package/api/resources/windows/client/requests/WindowLoadUrlV1Body.d.ts +1 -1
  15. package/api/resources/windows/client/requests/index.d.ts +3 -0
  16. package/api/resources/windows/types/CreateWindowInputV1BodyWaitUntil.d.ts +3 -2
  17. package/api/resources/windows/types/CreateWindowInputV1BodyWaitUntil.js +1 -0
  18. package/api/resources/windows/types/WindowLoadUrlV1BodyWaitUntil.d.ts +3 -2
  19. package/api/resources/windows/types/WindowLoadUrlV1BodyWaitUntil.js +1 -0
  20. package/api/types/ClickConfig.d.ts +8 -0
  21. package/api/types/CustomProxy.d.ts +1 -1
  22. package/api/types/Issue.d.ts +2 -0
  23. package/{dist/api/types/EmptyResponseJson.d.ts → api/types/OperationOutcome.d.ts} +1 -1
  24. package/api/types/{EmptyResponse.d.ts → OperationOutcomeResponse.d.ts} +3 -3
  25. package/api/types/PageQueryConfig.d.ts +3 -0
  26. package/api/types/SessionConfigV1Proxy.d.ts +4 -1
  27. package/api/types/SummaryConfig.d.ts +2 -0
  28. package/api/types/VisualAnalysisConfig.d.ts +12 -0
  29. package/api/types/VisualAnalysisConfig.js +5 -0
  30. package/api/types/VisualAnalysisConfigPartitionDirection.d.ts +12 -0
  31. package/api/types/VisualAnalysisConfigPartitionDirection.js +11 -0
  32. package/api/types/VisualAnalysisConfigScope.d.ts +11 -0
  33. package/api/types/VisualAnalysisConfigScope.js +10 -0
  34. package/api/types/index.d.ts +6 -4
  35. package/api/types/index.js +6 -4
  36. package/dist/Client.d.ts +3 -3
  37. package/dist/Client.js +9 -9
  38. package/dist/api/resources/index.d.ts +3 -3
  39. package/dist/api/resources/index.js +4 -4
  40. package/dist/api/resources/profiles/client/Client.js +4 -4
  41. package/dist/api/resources/sessions/client/Client.js +10 -10
  42. package/dist/api/resources/windows/client/Client.d.ts +37 -3
  43. package/dist/api/resources/windows/client/Client.js +206 -19
  44. package/dist/api/resources/windows/client/requests/CreateWindowInputV1Body.d.ts +1 -1
  45. package/dist/api/resources/windows/client/requests/SessionClickHandlerRequestBody.d.ts +25 -0
  46. package/dist/api/resources/windows/client/requests/SessionClickHandlerRequestBody.js +5 -0
  47. package/dist/api/resources/windows/client/requests/SessionHoverHandlerRequestBody.d.ts +23 -0
  48. package/dist/api/resources/windows/client/requests/SessionHoverHandlerRequestBody.js +5 -0
  49. package/dist/api/resources/windows/client/requests/SessionTypeHandlerRequestBody.d.ts +29 -0
  50. package/dist/api/resources/windows/client/requests/SessionTypeHandlerRequestBody.js +5 -0
  51. package/dist/api/resources/windows/client/requests/WindowLoadUrlV1Body.d.ts +1 -1
  52. package/dist/api/resources/windows/client/requests/index.d.ts +3 -0
  53. package/dist/api/resources/windows/types/CreateWindowInputV1BodyWaitUntil.d.ts +3 -2
  54. package/dist/api/resources/windows/types/CreateWindowInputV1BodyWaitUntil.js +1 -0
  55. package/dist/api/resources/windows/types/WindowLoadUrlV1BodyWaitUntil.d.ts +3 -2
  56. package/dist/api/resources/windows/types/WindowLoadUrlV1BodyWaitUntil.js +1 -0
  57. package/dist/api/types/ClickConfig.d.ts +8 -0
  58. package/dist/api/types/ClickConfig.js +5 -0
  59. package/dist/api/types/CustomProxy.d.ts +1 -1
  60. package/dist/api/types/Issue.d.ts +2 -0
  61. package/{api/types/EmptyResponseJson.d.ts → dist/api/types/OperationOutcome.d.ts} +1 -1
  62. package/dist/api/types/OperationOutcome.js +5 -0
  63. package/dist/api/types/{EmptyResponse.d.ts → OperationOutcomeResponse.d.ts} +3 -3
  64. package/dist/api/types/OperationOutcomeResponse.js +5 -0
  65. package/dist/api/types/PageQueryConfig.d.ts +3 -0
  66. package/dist/api/types/SessionConfigV1Proxy.d.ts +4 -1
  67. package/dist/api/types/SummaryConfig.d.ts +2 -0
  68. package/dist/api/types/VisualAnalysisConfig.d.ts +12 -0
  69. package/dist/api/types/VisualAnalysisConfig.js +5 -0
  70. package/dist/api/types/VisualAnalysisConfigPartitionDirection.d.ts +12 -0
  71. package/dist/api/types/VisualAnalysisConfigPartitionDirection.js +11 -0
  72. package/dist/api/types/VisualAnalysisConfigScope.d.ts +11 -0
  73. package/dist/api/types/VisualAnalysisConfigScope.js +10 -0
  74. package/dist/api/types/index.d.ts +6 -4
  75. package/dist/api/types/index.js +6 -4
  76. package/dist/index.d.ts +1 -0
  77. package/dist/index.js +4 -0
  78. package/dist/serialization/resources/index.d.ts +3 -3
  79. package/dist/serialization/resources/index.js +4 -4
  80. package/dist/serialization/resources/windows/client/requests/SessionClickHandlerRequestBody.d.ts +17 -0
  81. package/{serialization/types/EnvelopeStatusDefaultMeta.js → dist/serialization/resources/windows/client/requests/SessionClickHandlerRequestBody.js} +9 -6
  82. package/dist/serialization/resources/windows/client/requests/SessionHoverHandlerRequestBody.d.ts +17 -0
  83. package/dist/serialization/resources/windows/client/requests/SessionHoverHandlerRequestBody.js +38 -0
  84. package/dist/serialization/resources/windows/client/requests/SessionTypeHandlerRequestBody.d.ts +19 -0
  85. package/dist/serialization/resources/windows/client/requests/SessionTypeHandlerRequestBody.js +40 -0
  86. package/dist/serialization/resources/windows/client/requests/index.d.ts +3 -0
  87. package/dist/serialization/resources/windows/client/requests/index.js +7 -1
  88. package/dist/serialization/resources/windows/types/CreateWindowInputV1BodyWaitUntil.d.ts +1 -1
  89. package/dist/serialization/resources/windows/types/CreateWindowInputV1BodyWaitUntil.js +1 -1
  90. package/dist/serialization/resources/windows/types/WindowLoadUrlV1BodyWaitUntil.d.ts +1 -1
  91. package/dist/serialization/resources/windows/types/WindowLoadUrlV1BodyWaitUntil.js +1 -1
  92. package/dist/serialization/types/ClickConfig.d.ts +13 -0
  93. package/dist/serialization/types/ClickConfig.js +34 -0
  94. package/dist/serialization/types/Issue.d.ts +1 -0
  95. package/dist/serialization/types/Issue.js +1 -0
  96. package/{serialization/types/EmptyResponseJson.d.ts → dist/serialization/types/OperationOutcome.d.ts} +2 -2
  97. package/{serialization/types/EmptyResponseJson.js → dist/serialization/types/OperationOutcome.js} +2 -2
  98. package/dist/serialization/types/OperationOutcomeResponse.d.ts +18 -0
  99. package/dist/serialization/types/{EmptyResponse.js → OperationOutcomeResponse.js} +6 -6
  100. package/dist/serialization/types/PageQueryConfig.d.ts +2 -0
  101. package/dist/serialization/types/PageQueryConfig.js +2 -0
  102. package/dist/serialization/types/SessionConfigV1Proxy.d.ts +1 -1
  103. package/dist/serialization/types/SessionConfigV1Proxy.js +5 -1
  104. package/dist/serialization/types/SummaryConfig.d.ts +2 -0
  105. package/dist/serialization/types/SummaryConfig.js +2 -0
  106. package/dist/serialization/types/VisualAnalysisConfig.d.ts +16 -0
  107. package/dist/serialization/types/{EnvelopeStatusDefaultMeta.js → VisualAnalysisConfig.js} +7 -5
  108. package/dist/serialization/types/VisualAnalysisConfigPartitionDirection.d.ts +10 -0
  109. package/dist/serialization/types/VisualAnalysisConfigPartitionDirection.js +31 -0
  110. package/dist/serialization/types/VisualAnalysisConfigScope.d.ts +10 -0
  111. package/dist/serialization/types/{EnvelopeStatusDefaultMetaStatus.js → VisualAnalysisConfigScope.js} +2 -2
  112. package/dist/serialization/types/index.d.ts +6 -4
  113. package/dist/serialization/types/index.js +6 -4
  114. package/dist/utils/batch-operate/SessionQueue.d.ts +46 -0
  115. package/dist/utils/batch-operate/SessionQueue.js +223 -0
  116. package/dist/utils/batch-operate/WindowQueue.d.ts +25 -0
  117. package/dist/utils/batch-operate/WindowQueue.js +201 -0
  118. package/dist/utils/batch-operate/batch-util.d.ts +3 -0
  119. package/dist/utils/batch-operate/batch-util.js +51 -0
  120. package/dist/utils/batch-operate/helpers.d.ts +2 -0
  121. package/dist/utils/batch-operate/helpers.js +19 -0
  122. package/dist/utils/batch-operate/types.d.ts +29 -0
  123. package/dist/utils/batch-operate/types.js +2 -0
  124. package/dist/utils/index.d.ts +2 -0
  125. package/dist/utils/index.js +18 -0
  126. package/dist/wrapper/AirtopClient.d.ts +3 -0
  127. package/dist/wrapper/AirtopClient.js +16 -0
  128. package/index.d.ts +1 -0
  129. package/index.js +4 -0
  130. package/package.json +3 -2
  131. package/reference.md +344 -148
  132. package/serialization/resources/index.d.ts +3 -3
  133. package/serialization/resources/index.js +4 -4
  134. package/serialization/resources/windows/client/requests/SessionClickHandlerRequestBody.d.ts +17 -0
  135. package/serialization/resources/windows/client/requests/SessionClickHandlerRequestBody.js +38 -0
  136. package/serialization/resources/windows/client/requests/SessionHoverHandlerRequestBody.d.ts +17 -0
  137. package/serialization/resources/windows/client/requests/SessionHoverHandlerRequestBody.js +38 -0
  138. package/serialization/resources/windows/client/requests/SessionTypeHandlerRequestBody.d.ts +19 -0
  139. package/serialization/resources/windows/client/requests/SessionTypeHandlerRequestBody.js +40 -0
  140. package/serialization/resources/windows/client/requests/index.d.ts +3 -0
  141. package/serialization/resources/windows/client/requests/index.js +7 -1
  142. package/serialization/resources/windows/types/CreateWindowInputV1BodyWaitUntil.d.ts +1 -1
  143. package/serialization/resources/windows/types/CreateWindowInputV1BodyWaitUntil.js +1 -1
  144. package/serialization/resources/windows/types/WindowLoadUrlV1BodyWaitUntil.d.ts +1 -1
  145. package/serialization/resources/windows/types/WindowLoadUrlV1BodyWaitUntil.js +1 -1
  146. package/serialization/types/ClickConfig.d.ts +13 -0
  147. package/serialization/types/ClickConfig.js +34 -0
  148. package/serialization/types/Issue.d.ts +1 -0
  149. package/serialization/types/Issue.js +1 -0
  150. package/{dist/serialization/types/EmptyResponseJson.d.ts → serialization/types/OperationOutcome.d.ts} +2 -2
  151. package/{dist/serialization/types/EmptyResponseJson.js → serialization/types/OperationOutcome.js} +2 -2
  152. package/serialization/types/OperationOutcomeResponse.d.ts +18 -0
  153. package/serialization/types/{EmptyResponse.js → OperationOutcomeResponse.js} +6 -6
  154. package/serialization/types/PageQueryConfig.d.ts +2 -0
  155. package/serialization/types/PageQueryConfig.js +2 -0
  156. package/serialization/types/SessionConfigV1Proxy.d.ts +1 -1
  157. package/serialization/types/SessionConfigV1Proxy.js +5 -1
  158. package/serialization/types/SummaryConfig.d.ts +2 -0
  159. package/serialization/types/SummaryConfig.js +2 -0
  160. package/serialization/types/VisualAnalysisConfig.d.ts +16 -0
  161. package/serialization/types/VisualAnalysisConfig.js +37 -0
  162. package/serialization/types/VisualAnalysisConfigPartitionDirection.d.ts +10 -0
  163. package/serialization/types/VisualAnalysisConfigPartitionDirection.js +31 -0
  164. package/serialization/types/VisualAnalysisConfigScope.d.ts +10 -0
  165. package/serialization/types/{EnvelopeStatusDefaultMetaStatus.js → VisualAnalysisConfigScope.js} +2 -2
  166. package/serialization/types/index.d.ts +6 -4
  167. package/serialization/types/index.js +6 -4
  168. package/utils/batch-operate/SessionQueue.d.ts +46 -0
  169. package/utils/batch-operate/SessionQueue.js +223 -0
  170. package/utils/batch-operate/WindowQueue.d.ts +25 -0
  171. package/utils/batch-operate/WindowQueue.js +201 -0
  172. package/utils/batch-operate/batch-util.d.ts +3 -0
  173. package/utils/batch-operate/batch-util.js +51 -0
  174. package/utils/batch-operate/helpers.d.ts +2 -0
  175. package/utils/batch-operate/helpers.js +19 -0
  176. package/utils/batch-operate/types.d.ts +29 -0
  177. package/utils/batch-operate/types.js +2 -0
  178. package/utils/index.d.ts +2 -0
  179. package/utils/index.js +18 -0
  180. package/wrapper/AirtopClient.d.ts +3 -0
  181. package/wrapper/AirtopClient.js +16 -0
  182. package/api/types/EnvelopeStatusDefaultMeta.d.ts +0 -8
  183. package/api/types/EnvelopeStatusDefaultMetaStatus.d.ts +0 -9
  184. package/api/types/EnvelopeStatusDefaultMetaStatus.js +0 -11
  185. package/dist/api/types/EnvelopeStatusDefaultMeta.d.ts +0 -8
  186. package/dist/api/types/EnvelopeStatusDefaultMetaStatus.d.ts +0 -9
  187. package/dist/api/types/EnvelopeStatusDefaultMetaStatus.js +0 -11
  188. package/dist/serialization/types/EmptyResponse.d.ts +0 -18
  189. package/dist/serialization/types/EnvelopeStatusDefaultMeta.d.ts +0 -14
  190. package/dist/serialization/types/EnvelopeStatusDefaultMetaStatus.d.ts +0 -10
  191. package/serialization/types/EmptyResponse.d.ts +0 -18
  192. package/serialization/types/EnvelopeStatusDefaultMeta.d.ts +0 -14
  193. package/serialization/types/EnvelopeStatusDefaultMetaStatus.d.ts +0 -10
  194. /package/api/{types/EmptyResponse.js → resources/windows/client/requests/SessionClickHandlerRequestBody.js} +0 -0
  195. /package/api/{types/EmptyResponseJson.js → resources/windows/client/requests/SessionHoverHandlerRequestBody.js} +0 -0
  196. /package/api/{types/EnvelopeStatusDefaultMeta.js → resources/windows/client/requests/SessionTypeHandlerRequestBody.js} +0 -0
  197. /package/{dist/api/types/EmptyResponse.js → api/types/ClickConfig.js} +0 -0
  198. /package/{dist/api/types/EmptyResponseJson.js → api/types/OperationOutcome.js} +0 -0
  199. /package/{dist/api/types/EnvelopeStatusDefaultMeta.js → api/types/OperationOutcomeResponse.js} +0 -0
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.batchOperate = void 0;
13
+ const node_events_1 = require("node:events");
14
+ const helpers_1 = require("./helpers");
15
+ const SessionQueue_1 = require("./SessionQueue");
16
+ const DEFAULT_MAX_WINDOWS_PER_SESSION = 1;
17
+ const DEFAULT_MAX_CONCURRENT_SESSIONS = 30;
18
+ const batchOperate = (urls, operation, // operation to invoke on each url
19
+ client, config) => __awaiter(void 0, void 0, void 0, function* () {
20
+ // Validate the urls before proceeding
21
+ if (!Array.isArray(urls)) {
22
+ throw new Error("Please provide a valid list of urls");
23
+ }
24
+ for (const url of urls) {
25
+ if (!url || typeof url !== "object" || !("url" in url)) {
26
+ throw new Error("Please provide a valid list of urls");
27
+ }
28
+ }
29
+ const runEmitter = new node_events_1.EventEmitter();
30
+ const { maxConcurrentSessions = DEFAULT_MAX_CONCURRENT_SESSIONS, maxWindowsPerSession = DEFAULT_MAX_WINDOWS_PER_SESSION, sessionConfig, onError, } = config !== null && config !== void 0 ? config : {};
31
+ // Set the maximum number of listeners to accommodate all concurrent sessions and windows
32
+ runEmitter.setMaxListeners(maxConcurrentSessions + (maxConcurrentSessions * maxWindowsPerSession) + 1);
33
+ // Split the urls into batches
34
+ const initialBatches = (0, helpers_1.distributeUrlsToBatches)(urls, maxConcurrentSessions);
35
+ const sessionQueue = new SessionQueue_1.SessionQueue({
36
+ maxConcurrentSessions,
37
+ runEmitter,
38
+ maxWindowsPerSession,
39
+ initialBatches,
40
+ operation,
41
+ client,
42
+ sessionConfig,
43
+ onError,
44
+ });
45
+ runEmitter.on("addUrls", (additionalUrls) => {
46
+ sessionQueue.addUrlsToBatchQueue(additionalUrls);
47
+ });
48
+ yield sessionQueue.processInitialBatches();
49
+ return yield sessionQueue.waitForProcessingToComplete();
50
+ });
51
+ exports.batchOperate = batchOperate;
@@ -0,0 +1,2 @@
1
+ import type { BatchOperationUrl } from "./types";
2
+ export declare const distributeUrlsToBatches: (urls: BatchOperationUrl[], maxConcurrentSessions: number) => BatchOperationUrl[][];
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.distributeUrlsToBatches = void 0;
4
+ const distributeUrlsToBatches = (urls, maxConcurrentSessions) => {
5
+ if (urls.length === 0)
6
+ return [];
7
+ // Calculate optimal number of batches
8
+ const batchCount = Math.min(maxConcurrentSessions, urls.length);
9
+ const batches = Array.from({ length: batchCount }, () => []);
10
+ urls.forEach((url, index) => {
11
+ const batchIndex = index % batchCount;
12
+ if (!batches[batchIndex]) {
13
+ batches[batchIndex] = [];
14
+ }
15
+ batches[batchIndex].push(url);
16
+ });
17
+ return batches;
18
+ };
19
+ exports.distributeUrlsToBatches = distributeUrlsToBatches;
@@ -0,0 +1,29 @@
1
+ import type { AirtopSessionConfigV1 } from "wrapper/AirtopSessions";
2
+ export declare type BatchOperateConfig = {
3
+ maxConcurrentSessions?: number;
4
+ maxWindowsPerSession?: number;
5
+ sessionConfig?: AirtopSessionConfigV1;
6
+ onError?: (error: BatchOperationError) => Promise<void>;
7
+ };
8
+ export declare type BatchOperationUrl = {
9
+ url: string;
10
+ context?: Record<string, unknown>;
11
+ };
12
+ export declare type BatchOperationInput = {
13
+ windowId: string;
14
+ sessionId: string;
15
+ liveViewUrl: string;
16
+ operationUrl: BatchOperationUrl;
17
+ };
18
+ export declare type BatchOperationResponse<T> = {
19
+ shouldHaltBatch?: boolean;
20
+ additionalUrls?: BatchOperationUrl[];
21
+ data?: T;
22
+ };
23
+ export declare type BatchOperationError = {
24
+ error: Error | string;
25
+ operationUrls: BatchOperationUrl[];
26
+ sessionId?: string;
27
+ windowId?: string;
28
+ liveViewUrl?: string;
29
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from "./batch-operate/batch-util";
2
+ export * from "./batch-operate/types";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./batch-operate/batch-util"), exports);
18
+ __exportStar(require("./batch-operate/types"), exports);
@@ -1,6 +1,7 @@
1
1
  import { AirtopClient as FernClient } from '../Client';
2
2
  import { AirtopSessions } from './AirtopSessions';
3
3
  import { AirtopWindows } from './AirtopWindows';
4
+ import { type BatchOperateConfig, type BatchOperationInput, type BatchOperationResponse, type BatchOperationUrl } from "../utils";
4
5
  declare type AugmentedOptions = FernClient.Options & {
5
6
  debug?: boolean;
6
7
  };
@@ -15,6 +16,8 @@ export declare class AirtopClient {
15
16
  get windows(): AirtopWindows;
16
17
  get profiles(): import("../api/resources/profiles/client/Client").Profiles;
17
18
  log(message: string): void;
19
+ warn(message: string): void;
18
20
  error(err: any): void;
21
+ batchOperate: <T>(urls: BatchOperationUrl[], operation: (input: BatchOperationInput) => Promise<BatchOperationResponse<T>>, config?: BatchOperateConfig | undefined) => Promise<T[]>;
19
22
  }
20
23
  export {};
@@ -1,12 +1,25 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
12
  exports.AirtopClient = void 0;
4
13
  const Client_1 = require("../Client"); // alias the Fern generated client
5
14
  const AirtopSessions_1 = require("./AirtopSessions");
6
15
  const AirtopWindows_1 = require("./AirtopWindows");
16
+ const utils_1 = require("../utils");
7
17
  class AirtopClient {
8
18
  constructor(_options) {
9
19
  this._options = _options;
20
+ this.batchOperate = (urls, operation, config) => __awaiter(this, void 0, void 0, function* () {
21
+ return yield (0, utils_1.batchOperate)(urls, operation, this, config);
22
+ });
10
23
  this._client = new Client_1.AirtopClient(_options);
11
24
  this.debug = (_options === null || _options === void 0 ? void 0 : _options.debug) || false;
12
25
  }
@@ -26,6 +39,9 @@ class AirtopClient {
26
39
  console.log(message);
27
40
  }
28
41
  }
42
+ warn(message) {
43
+ console.warn(message);
44
+ }
29
45
  error(err) {
30
46
  console.error(err);
31
47
  }
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.5",
3
+ "version": "0.1.7",
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",