@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.
- package/Client.d.ts +3 -3
- package/Client.js +9 -9
- package/README.md +6 -6
- package/api/resources/index.d.ts +3 -3
- package/api/resources/index.js +4 -4
- package/api/resources/profiles/client/Client.js +4 -4
- package/api/resources/sessions/client/Client.js +10 -10
- package/api/resources/windows/client/Client.d.ts +37 -3
- package/api/resources/windows/client/Client.js +206 -19
- package/api/resources/windows/client/requests/CreateWindowInputV1Body.d.ts +1 -1
- package/api/resources/windows/client/requests/SessionClickHandlerRequestBody.d.ts +25 -0
- package/api/resources/windows/client/requests/SessionHoverHandlerRequestBody.d.ts +23 -0
- package/api/resources/windows/client/requests/SessionTypeHandlerRequestBody.d.ts +29 -0
- package/api/resources/windows/client/requests/WindowLoadUrlV1Body.d.ts +1 -1
- package/api/resources/windows/client/requests/index.d.ts +3 -0
- package/api/resources/windows/types/CreateWindowInputV1BodyWaitUntil.d.ts +3 -2
- package/api/resources/windows/types/CreateWindowInputV1BodyWaitUntil.js +1 -0
- package/api/resources/windows/types/WindowLoadUrlV1BodyWaitUntil.d.ts +3 -2
- package/api/resources/windows/types/WindowLoadUrlV1BodyWaitUntil.js +1 -0
- package/api/types/ClickConfig.d.ts +8 -0
- package/api/types/CustomProxy.d.ts +1 -1
- package/api/types/Issue.d.ts +2 -0
- package/{dist/api/types/EmptyResponseJson.d.ts → api/types/OperationOutcome.d.ts} +1 -1
- package/api/types/{EmptyResponse.d.ts → OperationOutcomeResponse.d.ts} +3 -3
- package/api/types/PageQueryConfig.d.ts +3 -0
- package/api/types/SessionConfigV1Proxy.d.ts +4 -1
- package/api/types/SummaryConfig.d.ts +2 -0
- package/api/types/VisualAnalysisConfig.d.ts +12 -0
- package/api/types/VisualAnalysisConfig.js +5 -0
- package/api/types/VisualAnalysisConfigPartitionDirection.d.ts +12 -0
- package/api/types/VisualAnalysisConfigPartitionDirection.js +11 -0
- package/api/types/VisualAnalysisConfigScope.d.ts +11 -0
- package/api/types/VisualAnalysisConfigScope.js +10 -0
- package/api/types/index.d.ts +6 -4
- package/api/types/index.js +6 -4
- package/dist/Client.d.ts +3 -3
- package/dist/Client.js +9 -9
- package/dist/api/resources/index.d.ts +3 -3
- package/dist/api/resources/index.js +4 -4
- package/dist/api/resources/profiles/client/Client.js +4 -4
- package/dist/api/resources/sessions/client/Client.js +10 -10
- package/dist/api/resources/windows/client/Client.d.ts +37 -3
- package/dist/api/resources/windows/client/Client.js +206 -19
- package/dist/api/resources/windows/client/requests/CreateWindowInputV1Body.d.ts +1 -1
- package/dist/api/resources/windows/client/requests/SessionClickHandlerRequestBody.d.ts +25 -0
- package/dist/api/resources/windows/client/requests/SessionClickHandlerRequestBody.js +5 -0
- package/dist/api/resources/windows/client/requests/SessionHoverHandlerRequestBody.d.ts +23 -0
- package/dist/api/resources/windows/client/requests/SessionHoverHandlerRequestBody.js +5 -0
- package/dist/api/resources/windows/client/requests/SessionTypeHandlerRequestBody.d.ts +29 -0
- package/dist/api/resources/windows/client/requests/SessionTypeHandlerRequestBody.js +5 -0
- package/dist/api/resources/windows/client/requests/WindowLoadUrlV1Body.d.ts +1 -1
- package/dist/api/resources/windows/client/requests/index.d.ts +3 -0
- package/dist/api/resources/windows/types/CreateWindowInputV1BodyWaitUntil.d.ts +3 -2
- package/dist/api/resources/windows/types/CreateWindowInputV1BodyWaitUntil.js +1 -0
- package/dist/api/resources/windows/types/WindowLoadUrlV1BodyWaitUntil.d.ts +3 -2
- package/dist/api/resources/windows/types/WindowLoadUrlV1BodyWaitUntil.js +1 -0
- package/dist/api/types/ClickConfig.d.ts +8 -0
- package/dist/api/types/ClickConfig.js +5 -0
- package/dist/api/types/CustomProxy.d.ts +1 -1
- package/dist/api/types/Issue.d.ts +2 -0
- package/{api/types/EmptyResponseJson.d.ts → dist/api/types/OperationOutcome.d.ts} +1 -1
- package/dist/api/types/OperationOutcome.js +5 -0
- package/dist/api/types/{EmptyResponse.d.ts → OperationOutcomeResponse.d.ts} +3 -3
- package/dist/api/types/OperationOutcomeResponse.js +5 -0
- package/dist/api/types/PageQueryConfig.d.ts +3 -0
- package/dist/api/types/SessionConfigV1Proxy.d.ts +4 -1
- package/dist/api/types/SummaryConfig.d.ts +2 -0
- package/dist/api/types/VisualAnalysisConfig.d.ts +12 -0
- package/dist/api/types/VisualAnalysisConfig.js +5 -0
- package/dist/api/types/VisualAnalysisConfigPartitionDirection.d.ts +12 -0
- package/dist/api/types/VisualAnalysisConfigPartitionDirection.js +11 -0
- package/dist/api/types/VisualAnalysisConfigScope.d.ts +11 -0
- package/dist/api/types/VisualAnalysisConfigScope.js +10 -0
- package/dist/api/types/index.d.ts +6 -4
- package/dist/api/types/index.js +6 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -0
- package/dist/serialization/resources/index.d.ts +3 -3
- package/dist/serialization/resources/index.js +4 -4
- package/dist/serialization/resources/windows/client/requests/SessionClickHandlerRequestBody.d.ts +17 -0
- package/{serialization/types/EnvelopeStatusDefaultMeta.js → dist/serialization/resources/windows/client/requests/SessionClickHandlerRequestBody.js} +9 -6
- package/dist/serialization/resources/windows/client/requests/SessionHoverHandlerRequestBody.d.ts +17 -0
- package/dist/serialization/resources/windows/client/requests/SessionHoverHandlerRequestBody.js +38 -0
- package/dist/serialization/resources/windows/client/requests/SessionTypeHandlerRequestBody.d.ts +19 -0
- package/dist/serialization/resources/windows/client/requests/SessionTypeHandlerRequestBody.js +40 -0
- package/dist/serialization/resources/windows/client/requests/index.d.ts +3 -0
- package/dist/serialization/resources/windows/client/requests/index.js +7 -1
- package/dist/serialization/resources/windows/types/CreateWindowInputV1BodyWaitUntil.d.ts +1 -1
- package/dist/serialization/resources/windows/types/CreateWindowInputV1BodyWaitUntil.js +1 -1
- package/dist/serialization/resources/windows/types/WindowLoadUrlV1BodyWaitUntil.d.ts +1 -1
- package/dist/serialization/resources/windows/types/WindowLoadUrlV1BodyWaitUntil.js +1 -1
- package/dist/serialization/types/ClickConfig.d.ts +13 -0
- package/dist/serialization/types/ClickConfig.js +34 -0
- package/dist/serialization/types/Issue.d.ts +1 -0
- package/dist/serialization/types/Issue.js +1 -0
- package/{serialization/types/EmptyResponseJson.d.ts → dist/serialization/types/OperationOutcome.d.ts} +2 -2
- package/{serialization/types/EmptyResponseJson.js → dist/serialization/types/OperationOutcome.js} +2 -2
- package/dist/serialization/types/OperationOutcomeResponse.d.ts +18 -0
- package/dist/serialization/types/{EmptyResponse.js → OperationOutcomeResponse.js} +6 -6
- package/dist/serialization/types/PageQueryConfig.d.ts +2 -0
- package/dist/serialization/types/PageQueryConfig.js +2 -0
- package/dist/serialization/types/SessionConfigV1Proxy.d.ts +1 -1
- package/dist/serialization/types/SessionConfigV1Proxy.js +5 -1
- package/dist/serialization/types/SummaryConfig.d.ts +2 -0
- package/dist/serialization/types/SummaryConfig.js +2 -0
- package/dist/serialization/types/VisualAnalysisConfig.d.ts +16 -0
- package/dist/serialization/types/{EnvelopeStatusDefaultMeta.js → VisualAnalysisConfig.js} +7 -5
- package/dist/serialization/types/VisualAnalysisConfigPartitionDirection.d.ts +10 -0
- package/dist/serialization/types/VisualAnalysisConfigPartitionDirection.js +31 -0
- package/dist/serialization/types/VisualAnalysisConfigScope.d.ts +10 -0
- package/dist/serialization/types/{EnvelopeStatusDefaultMetaStatus.js → VisualAnalysisConfigScope.js} +2 -2
- package/dist/serialization/types/index.d.ts +6 -4
- package/dist/serialization/types/index.js +6 -4
- package/dist/utils/batch-operate/SessionQueue.d.ts +46 -0
- package/dist/utils/batch-operate/SessionQueue.js +223 -0
- package/dist/utils/batch-operate/WindowQueue.d.ts +25 -0
- package/dist/utils/batch-operate/WindowQueue.js +201 -0
- package/dist/utils/batch-operate/batch-util.d.ts +3 -0
- package/dist/utils/batch-operate/batch-util.js +51 -0
- package/dist/utils/batch-operate/helpers.d.ts +2 -0
- package/dist/utils/batch-operate/helpers.js +19 -0
- package/dist/utils/batch-operate/types.d.ts +29 -0
- package/dist/utils/batch-operate/types.js +2 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +18 -0
- package/dist/wrapper/AirtopClient.d.ts +3 -0
- package/dist/wrapper/AirtopClient.js +16 -0
- package/index.d.ts +1 -0
- package/index.js +4 -0
- package/package.json +3 -2
- package/reference.md +344 -148
- package/serialization/resources/index.d.ts +3 -3
- package/serialization/resources/index.js +4 -4
- package/serialization/resources/windows/client/requests/SessionClickHandlerRequestBody.d.ts +17 -0
- package/serialization/resources/windows/client/requests/SessionClickHandlerRequestBody.js +38 -0
- package/serialization/resources/windows/client/requests/SessionHoverHandlerRequestBody.d.ts +17 -0
- package/serialization/resources/windows/client/requests/SessionHoverHandlerRequestBody.js +38 -0
- package/serialization/resources/windows/client/requests/SessionTypeHandlerRequestBody.d.ts +19 -0
- package/serialization/resources/windows/client/requests/SessionTypeHandlerRequestBody.js +40 -0
- package/serialization/resources/windows/client/requests/index.d.ts +3 -0
- package/serialization/resources/windows/client/requests/index.js +7 -1
- package/serialization/resources/windows/types/CreateWindowInputV1BodyWaitUntil.d.ts +1 -1
- package/serialization/resources/windows/types/CreateWindowInputV1BodyWaitUntil.js +1 -1
- package/serialization/resources/windows/types/WindowLoadUrlV1BodyWaitUntil.d.ts +1 -1
- package/serialization/resources/windows/types/WindowLoadUrlV1BodyWaitUntil.js +1 -1
- package/serialization/types/ClickConfig.d.ts +13 -0
- package/serialization/types/ClickConfig.js +34 -0
- package/serialization/types/Issue.d.ts +1 -0
- package/serialization/types/Issue.js +1 -0
- package/{dist/serialization/types/EmptyResponseJson.d.ts → serialization/types/OperationOutcome.d.ts} +2 -2
- package/{dist/serialization/types/EmptyResponseJson.js → serialization/types/OperationOutcome.js} +2 -2
- package/serialization/types/OperationOutcomeResponse.d.ts +18 -0
- package/serialization/types/{EmptyResponse.js → OperationOutcomeResponse.js} +6 -6
- package/serialization/types/PageQueryConfig.d.ts +2 -0
- package/serialization/types/PageQueryConfig.js +2 -0
- package/serialization/types/SessionConfigV1Proxy.d.ts +1 -1
- package/serialization/types/SessionConfigV1Proxy.js +5 -1
- package/serialization/types/SummaryConfig.d.ts +2 -0
- package/serialization/types/SummaryConfig.js +2 -0
- package/serialization/types/VisualAnalysisConfig.d.ts +16 -0
- package/serialization/types/VisualAnalysisConfig.js +37 -0
- package/serialization/types/VisualAnalysisConfigPartitionDirection.d.ts +10 -0
- package/serialization/types/VisualAnalysisConfigPartitionDirection.js +31 -0
- package/serialization/types/VisualAnalysisConfigScope.d.ts +10 -0
- package/serialization/types/{EnvelopeStatusDefaultMetaStatus.js → VisualAnalysisConfigScope.js} +2 -2
- package/serialization/types/index.d.ts +6 -4
- package/serialization/types/index.js +6 -4
- package/utils/batch-operate/SessionQueue.d.ts +46 -0
- package/utils/batch-operate/SessionQueue.js +223 -0
- package/utils/batch-operate/WindowQueue.d.ts +25 -0
- package/utils/batch-operate/WindowQueue.js +201 -0
- package/utils/batch-operate/batch-util.d.ts +3 -0
- package/utils/batch-operate/batch-util.js +51 -0
- package/utils/batch-operate/helpers.d.ts +2 -0
- package/utils/batch-operate/helpers.js +19 -0
- package/utils/batch-operate/types.d.ts +29 -0
- package/utils/batch-operate/types.js +2 -0
- package/utils/index.d.ts +2 -0
- package/utils/index.js +18 -0
- package/wrapper/AirtopClient.d.ts +3 -0
- package/wrapper/AirtopClient.js +16 -0
- package/api/types/EnvelopeStatusDefaultMeta.d.ts +0 -8
- package/api/types/EnvelopeStatusDefaultMetaStatus.d.ts +0 -9
- package/api/types/EnvelopeStatusDefaultMetaStatus.js +0 -11
- package/dist/api/types/EnvelopeStatusDefaultMeta.d.ts +0 -8
- package/dist/api/types/EnvelopeStatusDefaultMetaStatus.d.ts +0 -9
- package/dist/api/types/EnvelopeStatusDefaultMetaStatus.js +0 -11
- package/dist/serialization/types/EmptyResponse.d.ts +0 -18
- package/dist/serialization/types/EnvelopeStatusDefaultMeta.d.ts +0 -14
- package/dist/serialization/types/EnvelopeStatusDefaultMetaStatus.d.ts +0 -10
- package/serialization/types/EmptyResponse.d.ts +0 -18
- package/serialization/types/EnvelopeStatusDefaultMeta.d.ts +0 -14
- package/serialization/types/EnvelopeStatusDefaultMetaStatus.d.ts +0 -10
- /package/api/{types/EmptyResponse.js → resources/windows/client/requests/SessionClickHandlerRequestBody.js} +0 -0
- /package/api/{types/EmptyResponseJson.js → resources/windows/client/requests/SessionHoverHandlerRequestBody.js} +0 -0
- /package/api/{types/EnvelopeStatusDefaultMeta.js → resources/windows/client/requests/SessionTypeHandlerRequestBody.js} +0 -0
- /package/{dist/api/types/EmptyResponse.js → api/types/ClickConfig.js} +0 -0
- /package/{dist/api/types/EmptyResponseJson.js → api/types/OperationOutcome.js} +0 -0
- /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,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,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
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.
|
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",
|