@airtop/sdk 0.0.8 → 0.0.10-a
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/api/index.d.ts +1 -1
- package/api/index.js +1 -1
- package/api/resources/index.d.ts +2 -1
- package/api/resources/index.js +3 -2
- package/api/resources/profiles/client/Client.js +4 -4
- package/api/resources/sessions/client/Client.d.ts +11 -4
- package/api/resources/sessions/client/Client.js +117 -13
- package/api/resources/sessions/client/requests/SessionsListRequest.d.ts +18 -2
- package/api/resources/sessions/index.d.ts +1 -0
- package/api/resources/sessions/index.js +1 -0
- package/api/resources/sessions/types/SessionsEventsResponse.d.ts +16 -0
- package/api/resources/sessions/types/SessionsEventsResponseError.d.ts +11 -0
- package/api/resources/sessions/types/SessionsEventsResponseStatus.d.ts +11 -0
- package/api/resources/sessions/types/SessionsEventsResponseStatus.js +5 -0
- package/api/resources/sessions/types/SessionsListRequestStatus.d.ts +13 -0
- package/api/resources/sessions/types/SessionsListRequestStatus.js +12 -0
- package/api/resources/sessions/types/index.d.ts +4 -0
- package/api/resources/sessions/types/index.js +20 -0
- package/api/resources/windows/client/Client.d.ts +1 -1
- package/api/resources/windows/client/Client.js +10 -10
- package/api/types/ErrorMessage.d.ts +11 -0
- package/api/types/ErrorMessage.js +5 -0
- package/api/types/ExternalProfileV1.d.ts +0 -2
- package/api/types/Pagination.d.ts +13 -0
- package/api/types/Pagination.js +5 -0
- package/api/types/SessionsWithPagination.d.ts +10 -0
- package/api/types/SessionsWithPagination.js +5 -0
- package/api/types/{ListExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper.d.ts → SessionsWithPaginationEnvelopeDefaultMetaWrapper.d.ts} +2 -2
- package/api/types/SessionsWithPaginationEnvelopeDefaultMetaWrapper.js +5 -0
- package/api/types/StatusMessage.d.ts +14 -0
- package/api/types/StatusMessage.js +5 -0
- package/api/types/StatusMessageStatus.d.ts +13 -0
- package/api/types/StatusMessageStatus.js +12 -0
- package/api/types/Window.d.ts +0 -2
- package/api/types/index.d.ts +6 -1
- package/api/types/index.js +6 -1
- package/core/index.d.ts +1 -0
- package/core/index.js +1 -0
- package/core/streaming-fetcher/Stream.d.ts +48 -0
- package/core/streaming-fetcher/Stream.js +170 -0
- package/core/streaming-fetcher/index.d.ts +1 -0
- package/core/streaming-fetcher/index.js +5 -0
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.js +1 -1
- package/dist/api/resources/index.d.ts +2 -1
- package/dist/api/resources/index.js +3 -2
- package/dist/api/resources/profiles/client/Client.js +4 -4
- package/dist/api/resources/sessions/client/Client.d.ts +11 -4
- package/dist/api/resources/sessions/client/Client.js +117 -13
- package/dist/api/resources/sessions/client/requests/SessionsListRequest.d.ts +18 -2
- package/dist/api/resources/sessions/index.d.ts +1 -0
- package/dist/api/resources/sessions/index.js +1 -0
- package/dist/api/resources/sessions/types/SessionsEventsResponse.d.ts +16 -0
- package/dist/api/resources/sessions/types/SessionsEventsResponse.js +5 -0
- package/dist/api/resources/sessions/types/SessionsEventsResponseError.d.ts +11 -0
- package/dist/api/resources/sessions/types/SessionsEventsResponseError.js +5 -0
- package/dist/api/resources/sessions/types/SessionsEventsResponseStatus.d.ts +11 -0
- package/dist/api/resources/sessions/types/SessionsEventsResponseStatus.js +5 -0
- package/dist/api/resources/sessions/types/SessionsListRequestStatus.d.ts +13 -0
- package/dist/api/resources/sessions/types/SessionsListRequestStatus.js +12 -0
- package/dist/api/resources/sessions/types/index.d.ts +4 -0
- package/dist/api/resources/sessions/types/index.js +20 -0
- package/dist/api/resources/windows/client/Client.d.ts +1 -1
- package/dist/api/resources/windows/client/Client.js +10 -10
- package/dist/api/types/ErrorMessage.d.ts +11 -0
- package/dist/api/types/ErrorMessage.js +5 -0
- package/dist/api/types/ExternalProfileV1.d.ts +0 -2
- package/dist/api/types/Pagination.d.ts +13 -0
- package/dist/api/types/Pagination.js +5 -0
- package/dist/api/types/SessionsWithPagination.d.ts +10 -0
- package/dist/api/types/SessionsWithPagination.js +5 -0
- package/dist/api/types/{ListExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper.d.ts → SessionsWithPaginationEnvelopeDefaultMetaWrapper.d.ts} +2 -2
- package/dist/api/types/SessionsWithPaginationEnvelopeDefaultMetaWrapper.js +5 -0
- package/dist/api/types/StatusMessage.d.ts +14 -0
- package/dist/api/types/StatusMessage.js +5 -0
- package/dist/api/types/StatusMessageStatus.d.ts +13 -0
- package/dist/api/types/StatusMessageStatus.js +12 -0
- package/dist/api/types/Window.d.ts +0 -2
- package/dist/api/types/index.d.ts +6 -1
- package/dist/api/types/index.js +6 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +1 -0
- package/dist/core/streaming-fetcher/Stream.d.ts +48 -0
- package/dist/core/streaming-fetcher/Stream.js +170 -0
- package/dist/core/streaming-fetcher/index.d.ts +1 -0
- package/dist/core/streaming-fetcher/index.js +5 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +4 -3
- package/dist/serialization/index.d.ts +1 -1
- package/dist/serialization/index.js +1 -1
- package/dist/serialization/resources/index.d.ts +1 -0
- package/dist/serialization/resources/index.js +1 -0
- package/dist/serialization/resources/sessions/index.d.ts +1 -0
- package/dist/serialization/resources/sessions/index.js +1 -0
- package/dist/serialization/resources/sessions/types/SessionsEventsResponse.d.ts +18 -0
- package/dist/serialization/resources/sessions/types/SessionsEventsResponse.js +41 -0
- package/dist/serialization/resources/sessions/types/SessionsEventsResponseError.d.ts +15 -0
- package/dist/serialization/resources/sessions/types/SessionsEventsResponseError.js +36 -0
- package/dist/serialization/resources/sessions/types/SessionsEventsResponseStatus.d.ts +15 -0
- package/dist/serialization/resources/sessions/types/SessionsEventsResponseStatus.js +36 -0
- package/dist/serialization/resources/sessions/types/SessionsListRequestStatus.d.ts +10 -0
- package/dist/serialization/resources/sessions/types/SessionsListRequestStatus.js +31 -0
- package/dist/serialization/resources/sessions/types/index.d.ts +4 -0
- package/dist/serialization/resources/sessions/types/index.js +20 -0
- package/dist/serialization/types/ErrorMessage.d.ts +14 -0
- package/dist/serialization/types/ErrorMessage.js +35 -0
- package/dist/serialization/types/ExternalProfileV1.d.ts +0 -1
- package/dist/serialization/types/ExternalProfileV1.js +0 -1
- package/dist/serialization/types/Pagination.d.ts +19 -0
- package/dist/serialization/types/Pagination.js +40 -0
- package/dist/serialization/types/SessionsWithPagination.d.ts +15 -0
- package/dist/serialization/types/SessionsWithPagination.js +36 -0
- package/dist/serialization/types/SessionsWithPaginationEnvelopeDefaultMetaWrapper.d.ts +18 -0
- package/dist/serialization/types/{ListExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper.js → SessionsWithPaginationEnvelopeDefaultMetaWrapper.js} +4 -4
- package/dist/serialization/types/StatusMessage.d.ts +16 -0
- package/dist/serialization/types/StatusMessage.js +37 -0
- package/dist/serialization/types/StatusMessageStatus.d.ts +10 -0
- package/dist/serialization/types/StatusMessageStatus.js +31 -0
- package/dist/serialization/types/Window.d.ts +0 -1
- package/dist/serialization/types/Window.js +0 -1
- package/dist/serialization/types/index.d.ts +6 -1
- package/dist/serialization/types/index.js +6 -1
- package/dist/wrapper/AirtopClient.d.ts +19 -0
- package/dist/wrapper/AirtopClient.js +32 -0
- package/dist/wrapper/AirtopSessions.d.ts +24 -0
- package/dist/wrapper/AirtopSessions.js +93 -0
- package/dist/wrapper/AirtopWindows.d.ts +18 -0
- package/dist/wrapper/AirtopWindows.js +65 -0
- package/index.d.ts +2 -1
- package/index.js +4 -3
- package/package.json +7 -3
- package/reference.md +71 -5
- package/serialization/index.d.ts +1 -1
- package/serialization/index.js +1 -1
- package/serialization/resources/index.d.ts +1 -0
- package/serialization/resources/index.js +1 -0
- package/serialization/resources/sessions/index.d.ts +1 -0
- package/serialization/resources/sessions/index.js +1 -0
- package/serialization/resources/sessions/types/SessionsEventsResponse.d.ts +18 -0
- package/serialization/resources/sessions/types/SessionsEventsResponse.js +41 -0
- package/serialization/resources/sessions/types/SessionsEventsResponseError.d.ts +15 -0
- package/serialization/resources/sessions/types/SessionsEventsResponseError.js +36 -0
- package/serialization/resources/sessions/types/SessionsEventsResponseStatus.d.ts +15 -0
- package/serialization/resources/sessions/types/SessionsEventsResponseStatus.js +36 -0
- package/serialization/resources/sessions/types/SessionsListRequestStatus.d.ts +10 -0
- package/serialization/resources/sessions/types/SessionsListRequestStatus.js +31 -0
- package/serialization/resources/sessions/types/index.d.ts +4 -0
- package/serialization/resources/sessions/types/index.js +20 -0
- package/serialization/types/ErrorMessage.d.ts +14 -0
- package/serialization/types/ErrorMessage.js +35 -0
- package/serialization/types/ExternalProfileV1.d.ts +0 -1
- package/serialization/types/ExternalProfileV1.js +0 -1
- package/serialization/types/Pagination.d.ts +19 -0
- package/serialization/types/Pagination.js +40 -0
- package/serialization/types/SessionsWithPagination.d.ts +15 -0
- package/serialization/types/SessionsWithPagination.js +36 -0
- package/serialization/types/SessionsWithPaginationEnvelopeDefaultMetaWrapper.d.ts +18 -0
- package/serialization/types/{ListExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper.js → SessionsWithPaginationEnvelopeDefaultMetaWrapper.js} +4 -4
- package/serialization/types/StatusMessage.d.ts +16 -0
- package/serialization/types/StatusMessage.js +37 -0
- package/serialization/types/StatusMessageStatus.d.ts +10 -0
- package/serialization/types/StatusMessageStatus.js +31 -0
- package/serialization/types/Window.d.ts +0 -1
- package/serialization/types/Window.js +0 -1
- package/serialization/types/index.d.ts +6 -1
- package/serialization/types/index.js +6 -1
- package/wrapper/AirtopClient.d.ts +19 -0
- package/wrapper/AirtopClient.js +32 -0
- package/wrapper/AirtopSessions.d.ts +24 -0
- package/wrapper/AirtopSessions.js +93 -0
- package/wrapper/AirtopWindows.d.ts +18 -0
- package/wrapper/AirtopWindows.js +65 -0
- package/dist/serialization/types/ListExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper.d.ts +0 -18
- package/serialization/types/ListExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper.d.ts +0 -18
- /package/api/{types/ListExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper.js → resources/sessions/types/SessionsEventsResponse.js} +0 -0
- /package/{dist/api/types/ListExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper.js → api/resources/sessions/types/SessionsEventsResponseError.js} +0 -0
@@ -0,0 +1,37 @@
|
|
1
|
+
"use strict";
|
2
|
+
/**
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
4
|
+
*/
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
6
|
+
if (k2 === undefined) k2 = k;
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
10
|
+
}
|
11
|
+
Object.defineProperty(o, k2, desc);
|
12
|
+
}) : (function(o, m, k, k2) {
|
13
|
+
if (k2 === undefined) k2 = k;
|
14
|
+
o[k2] = m[k];
|
15
|
+
}));
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
18
|
+
}) : function(o, v) {
|
19
|
+
o["default"] = v;
|
20
|
+
});
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
22
|
+
if (mod && mod.__esModule) return mod;
|
23
|
+
var result = {};
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
25
|
+
__setModuleDefault(result, mod);
|
26
|
+
return result;
|
27
|
+
};
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
29
|
+
exports.StatusMessage = void 0;
|
30
|
+
const core = __importStar(require("../../core"));
|
31
|
+
const StatusMessageStatus_1 = require("./StatusMessageStatus");
|
32
|
+
exports.StatusMessage = core.serialization.object({
|
33
|
+
event: core.serialization.string(),
|
34
|
+
eventTimeMillis: core.serialization.number(),
|
35
|
+
id: core.serialization.string(),
|
36
|
+
status: StatusMessageStatus_1.StatusMessageStatus,
|
37
|
+
});
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/**
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
3
|
+
*/
|
4
|
+
import * as serializers from "../index";
|
5
|
+
import * as Airtop from "../../api/index";
|
6
|
+
import * as core from "../../core";
|
7
|
+
export declare const StatusMessageStatus: core.serialization.Schema<serializers.StatusMessageStatus.Raw, Airtop.StatusMessageStatus>;
|
8
|
+
export declare namespace StatusMessageStatus {
|
9
|
+
type Raw = "awaitingCapacity" | "initializing" | "running" | "ended";
|
10
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
"use strict";
|
2
|
+
/**
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
4
|
+
*/
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
6
|
+
if (k2 === undefined) k2 = k;
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
10
|
+
}
|
11
|
+
Object.defineProperty(o, k2, desc);
|
12
|
+
}) : (function(o, m, k, k2) {
|
13
|
+
if (k2 === undefined) k2 = k;
|
14
|
+
o[k2] = m[k];
|
15
|
+
}));
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
18
|
+
}) : function(o, v) {
|
19
|
+
o["default"] = v;
|
20
|
+
});
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
22
|
+
if (mod && mod.__esModule) return mod;
|
23
|
+
var result = {};
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
25
|
+
__setModuleDefault(result, mod);
|
26
|
+
return result;
|
27
|
+
};
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
29
|
+
exports.StatusMessageStatus = void 0;
|
30
|
+
const core = __importStar(require("../../core"));
|
31
|
+
exports.StatusMessageStatus = core.serialization.enum_(["awaitingCapacity", "initializing", "running", "ended"]);
|
@@ -3,6 +3,7 @@ export * from "./AiResponseEnvelopeExternalSessionAiResponseMetadataWrapper";
|
|
3
3
|
export * from "./ClientProvidedResponseMetadata";
|
4
4
|
export * from "./DefaultMetaWrapper";
|
5
5
|
export * from "./ErrorEnvelope";
|
6
|
+
export * from "./ErrorMessage";
|
6
7
|
export * from "./ExternalProfileV1";
|
7
8
|
export * from "./ExternalSessionAiResponseMetadataStatus";
|
8
9
|
export * from "./ExternalSessionAiResponseMetadata";
|
@@ -12,11 +13,15 @@ export * from "./ExternalSessionWithConnectionInfo";
|
|
12
13
|
export * from "./ExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper";
|
13
14
|
export * from "./Issue";
|
14
15
|
export * from "./ListExternalProfileV1EnvelopeDefaultMetaWrapper";
|
15
|
-
export * from "./
|
16
|
+
export * from "./Pagination";
|
16
17
|
export * from "./ScrapeResponseContent";
|
17
18
|
export * from "./ScrapeResponseEnvelope";
|
18
19
|
export * from "./ScrapeResponseEnvelopeExternalSessionAiResponseMetadataWrapper";
|
19
20
|
export * from "./ScrapeResponseOutput";
|
20
21
|
export * from "./SessionConfigV1";
|
22
|
+
export * from "./SessionsWithPagination";
|
23
|
+
export * from "./SessionsWithPaginationEnvelopeDefaultMetaWrapper";
|
24
|
+
export * from "./StatusMessageStatus";
|
25
|
+
export * from "./StatusMessage";
|
21
26
|
export * from "./Window";
|
22
27
|
export * from "./WindowEnvelopeDefaultMetaWrapper";
|
@@ -19,6 +19,7 @@ __exportStar(require("./AiResponseEnvelopeExternalSessionAiResponseMetadataWrapp
|
|
19
19
|
__exportStar(require("./ClientProvidedResponseMetadata"), exports);
|
20
20
|
__exportStar(require("./DefaultMetaWrapper"), exports);
|
21
21
|
__exportStar(require("./ErrorEnvelope"), exports);
|
22
|
+
__exportStar(require("./ErrorMessage"), exports);
|
22
23
|
__exportStar(require("./ExternalProfileV1"), exports);
|
23
24
|
__exportStar(require("./ExternalSessionAiResponseMetadataStatus"), exports);
|
24
25
|
__exportStar(require("./ExternalSessionAiResponseMetadata"), exports);
|
@@ -28,11 +29,15 @@ __exportStar(require("./ExternalSessionWithConnectionInfo"), exports);
|
|
28
29
|
__exportStar(require("./ExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper"), exports);
|
29
30
|
__exportStar(require("./Issue"), exports);
|
30
31
|
__exportStar(require("./ListExternalProfileV1EnvelopeDefaultMetaWrapper"), exports);
|
31
|
-
__exportStar(require("./
|
32
|
+
__exportStar(require("./Pagination"), exports);
|
32
33
|
__exportStar(require("./ScrapeResponseContent"), exports);
|
33
34
|
__exportStar(require("./ScrapeResponseEnvelope"), exports);
|
34
35
|
__exportStar(require("./ScrapeResponseEnvelopeExternalSessionAiResponseMetadataWrapper"), exports);
|
35
36
|
__exportStar(require("./ScrapeResponseOutput"), exports);
|
36
37
|
__exportStar(require("./SessionConfigV1"), exports);
|
38
|
+
__exportStar(require("./SessionsWithPagination"), exports);
|
39
|
+
__exportStar(require("./SessionsWithPaginationEnvelopeDefaultMetaWrapper"), exports);
|
40
|
+
__exportStar(require("./StatusMessageStatus"), exports);
|
41
|
+
__exportStar(require("./StatusMessage"), exports);
|
37
42
|
__exportStar(require("./Window"), exports);
|
38
43
|
__exportStar(require("./WindowEnvelopeDefaultMetaWrapper"), exports);
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { AirtopClient as FernClient } from '../Client';
|
2
|
+
import { AirtopWindows } from './AirtopWindows';
|
3
|
+
import { AirtopSessions } from './AirtopSessions';
|
4
|
+
declare type AugmentedOptions = FernClient.Options & {
|
5
|
+
debug?: boolean;
|
6
|
+
};
|
7
|
+
export declare class AirtopClient {
|
8
|
+
debug: boolean;
|
9
|
+
private _client;
|
10
|
+
private _windowsWrapper;
|
11
|
+
private _sessionsWrapper;
|
12
|
+
constructor(options?: AugmentedOptions);
|
13
|
+
get windows(): AirtopWindows;
|
14
|
+
get sessions(): AirtopSessions;
|
15
|
+
get profiles(): import("../api/resources/profiles/client/Client").Profiles;
|
16
|
+
log(message: string): void;
|
17
|
+
error(err: any): void;
|
18
|
+
}
|
19
|
+
export {};
|
@@ -0,0 +1,32 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.AirtopClient = void 0;
|
4
|
+
const Client_1 = require("../Client"); // alias the Fern generated client
|
5
|
+
const AirtopWindows_1 = require("./AirtopWindows");
|
6
|
+
const AirtopSessions_1 = require("./AirtopSessions");
|
7
|
+
class AirtopClient {
|
8
|
+
constructor(options) {
|
9
|
+
this._client = new Client_1.AirtopClient(options);
|
10
|
+
this.debug = (options === null || options === void 0 ? void 0 : options.debug) || false;
|
11
|
+
this._windowsWrapper = new AirtopWindows_1.AirtopWindows(this._client);
|
12
|
+
this._sessionsWrapper = new AirtopSessions_1.AirtopSessions(this._client, options === null || options === void 0 ? void 0 : options.debug);
|
13
|
+
}
|
14
|
+
get windows() {
|
15
|
+
return this._windowsWrapper;
|
16
|
+
}
|
17
|
+
get sessions() {
|
18
|
+
return this._sessionsWrapper;
|
19
|
+
}
|
20
|
+
get profiles() {
|
21
|
+
return this._client.profiles;
|
22
|
+
}
|
23
|
+
log(message) {
|
24
|
+
if (this.debug) {
|
25
|
+
console.log(message);
|
26
|
+
}
|
27
|
+
}
|
28
|
+
error(err) {
|
29
|
+
console.error(err);
|
30
|
+
}
|
31
|
+
}
|
32
|
+
exports.AirtopClient = AirtopClient;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { AirtopClient as FernClient } from '../Client';
|
2
|
+
import * as Airtop from '../api';
|
3
|
+
import * as core from '../core';
|
4
|
+
import { Sessions as SessionsNamespace } from '../api/resources/sessions/client/Client';
|
5
|
+
export interface AirtopSessionConfigV1 extends Airtop.SessionConfigV1 {
|
6
|
+
skipWaitSessionReady?: boolean;
|
7
|
+
}
|
8
|
+
export interface AirtopSessionRestInputV1 {
|
9
|
+
/** Session configuration */
|
10
|
+
configuration?: AirtopSessionConfigV1;
|
11
|
+
}
|
12
|
+
export declare class AirtopSessions {
|
13
|
+
private airtopClient;
|
14
|
+
private debug;
|
15
|
+
private _sessions;
|
16
|
+
constructor(airtopClient: FernClient, debug?: boolean);
|
17
|
+
log(message: any): void;
|
18
|
+
list(request?: Airtop.SessionsListRequest, requestOptions?: SessionsNamespace.RequestOptions): Promise<Airtop.SessionsWithPaginationEnvelopeDefaultMetaWrapper>;
|
19
|
+
create(request?: AirtopSessionRestInputV1, requestOptions?: SessionsNamespace.RequestOptions): Promise<Airtop.ExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper>;
|
20
|
+
waitForSessionReady(id: string, requestOptions?: SessionsNamespace.RequestOptions): Promise<Airtop.SessionsEventsResponse | null>;
|
21
|
+
getInfo(id: string, requestOptions?: SessionsNamespace.RequestOptions): Promise<Airtop.ExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper>;
|
22
|
+
terminate(id: string, requestOptions?: SessionsNamespace.RequestOptions): Promise<void>;
|
23
|
+
events(id: string, requestOptions?: SessionsNamespace.RequestOptions): Promise<core.Stream<Airtop.SessionsEventsResponse>>;
|
24
|
+
}
|
@@ -0,0 +1,93 @@
|
|
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
|
+
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
12
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
13
|
+
var m = o[Symbol.asyncIterator], i;
|
14
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
15
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
16
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
17
|
+
};
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
19
|
+
exports.AirtopSessions = void 0;
|
20
|
+
class AirtopSessions {
|
21
|
+
constructor(airtopClient, debug = false) {
|
22
|
+
this.airtopClient = airtopClient;
|
23
|
+
this.debug = debug;
|
24
|
+
this._sessions = airtopClient.sessions;
|
25
|
+
}
|
26
|
+
log(message) {
|
27
|
+
if (this.debug) {
|
28
|
+
console.log(message);
|
29
|
+
}
|
30
|
+
}
|
31
|
+
list(request, requestOptions) {
|
32
|
+
return this._sessions.list(request, requestOptions);
|
33
|
+
}
|
34
|
+
create(request, requestOptions) {
|
35
|
+
var _a;
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
37
|
+
const createSessionResponse = yield this._sessions.create(request, requestOptions);
|
38
|
+
if (!createSessionResponse.data) {
|
39
|
+
throw new Error(`Error creating browser session`);
|
40
|
+
}
|
41
|
+
if ((_a = request === null || request === void 0 ? void 0 : request.configuration) === null || _a === void 0 ? void 0 : _a.skipWaitSessionReady) {
|
42
|
+
return createSessionResponse;
|
43
|
+
}
|
44
|
+
this.log('session created:\n' + JSON.stringify(createSessionResponse, null, 2));
|
45
|
+
try {
|
46
|
+
const event = yield this.waitForSessionReady(createSessionResponse.data.id, requestOptions);
|
47
|
+
if (!event) {
|
48
|
+
this.log('No browser created, timed out?');
|
49
|
+
throw new Error(`Waiting for session ready timed out`);
|
50
|
+
}
|
51
|
+
return this.getInfo(createSessionResponse.data.id, requestOptions);
|
52
|
+
}
|
53
|
+
catch (e) {
|
54
|
+
this.log(e);
|
55
|
+
throw new Error(`Error creating a new browser ${e}`);
|
56
|
+
}
|
57
|
+
});
|
58
|
+
}
|
59
|
+
waitForSessionReady(id, requestOptions) {
|
60
|
+
var e_1, _a;
|
61
|
+
return __awaiter(this, void 0, void 0, function* () {
|
62
|
+
const sessionEvents = yield this.events(id, Object.assign({ timeoutInSeconds: 60 }, (requestOptions || {})));
|
63
|
+
try {
|
64
|
+
for (var sessionEvents_1 = __asyncValues(sessionEvents), sessionEvents_1_1; sessionEvents_1_1 = yield sessionEvents_1.next(), !sessionEvents_1_1.done;) {
|
65
|
+
const event = sessionEvents_1_1.value;
|
66
|
+
this.log('status message received:\n' + JSON.stringify(event, null, 2));
|
67
|
+
const e = event;
|
68
|
+
if (e.event === 'status' && e.status === 'running') {
|
69
|
+
return event;
|
70
|
+
}
|
71
|
+
}
|
72
|
+
}
|
73
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
74
|
+
finally {
|
75
|
+
try {
|
76
|
+
if (sessionEvents_1_1 && !sessionEvents_1_1.done && (_a = sessionEvents_1.return)) yield _a.call(sessionEvents_1);
|
77
|
+
}
|
78
|
+
finally { if (e_1) throw e_1.error; }
|
79
|
+
}
|
80
|
+
return null;
|
81
|
+
});
|
82
|
+
}
|
83
|
+
getInfo(id, requestOptions) {
|
84
|
+
return this._sessions.getinfo(id, requestOptions);
|
85
|
+
}
|
86
|
+
terminate(id, requestOptions) {
|
87
|
+
return this._sessions.terminate(id, requestOptions);
|
88
|
+
}
|
89
|
+
events(id, requestOptions) {
|
90
|
+
return this._sessions.events(id, requestOptions);
|
91
|
+
}
|
92
|
+
}
|
93
|
+
exports.AirtopSessions = AirtopSessions;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { Page as PuppeteerPage } from 'puppeteer';
|
2
|
+
import { Page as PlaywrightPage } from 'playwright';
|
3
|
+
import { WebDriver } from 'selenium-webdriver';
|
4
|
+
import { AirtopClient as FernClient } from '../Client';
|
5
|
+
import * as Airtop from '../api';
|
6
|
+
import { Windows as WindowsNamespace } from '../api/resources/windows/client/Client';
|
7
|
+
export declare class AirtopWindows {
|
8
|
+
private airtopClient;
|
9
|
+
private _windows;
|
10
|
+
constructor(airtopClient: FernClient);
|
11
|
+
getWindowInfo(sessionId: string, windowId: string, request?: Airtop.GetWindowInfoRequest, requestOptions?: WindowsNamespace.RequestOptions): Promise<Airtop.WindowEnvelopeDefaultMetaWrapper>;
|
12
|
+
promptContent(sessionId: string, windowId: string, request: Airtop.PromptContentRequest, requestOptions?: WindowsNamespace.RequestOptions): Promise<Airtop.AiResponseEnvelopeExternalSessionAiResponseMetadataWrapper>;
|
13
|
+
scrapeContent(sessionId: string, windowId: string, requestOptions?: Airtop.ScrapeContentRequest): Promise<Airtop.ScrapeResponseEnvelopeExternalSessionAiResponseMetadataWrapper>;
|
14
|
+
summarizeContent(sessionId: string, windowId: string, request?: Airtop.SummarizeContentRequest, requestOptions?: WindowsNamespace.RequestOptions): Promise<Airtop.AiResponseEnvelopeExternalSessionAiResponseMetadataWrapper>;
|
15
|
+
getWindowInfoForPuppeteerPage(sessionId: string, page: PuppeteerPage, request?: Airtop.GetWindowInfoRequest, requestOptions?: WindowsNamespace.RequestOptions): Promise<Airtop.WindowEnvelopeDefaultMetaWrapper>;
|
16
|
+
getWindowInfoForPlaywrightPage(sessionId: string, page: PlaywrightPage, request?: Airtop.GetWindowInfoRequest, requestOptions?: WindowsNamespace.RequestOptions): Promise<Airtop.WindowEnvelopeDefaultMetaWrapper>;
|
17
|
+
getWindowInfoForSeleniumDriver(sessionId: string, driver: WebDriver, request?: Airtop.GetWindowInfoRequest, requestOptions?: WindowsNamespace.RequestOptions): Promise<Airtop.WindowEnvelopeDefaultMetaWrapper>;
|
18
|
+
}
|
@@ -0,0 +1,65 @@
|
|
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.AirtopWindows = void 0;
|
13
|
+
class AirtopWindows {
|
14
|
+
constructor(airtopClient) {
|
15
|
+
this.airtopClient = airtopClient;
|
16
|
+
this._windows = airtopClient.windows;
|
17
|
+
}
|
18
|
+
getWindowInfo(sessionId, windowId, request, requestOptions) {
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
20
|
+
return this._windows.getWindowInfo(sessionId, windowId, request, requestOptions);
|
21
|
+
});
|
22
|
+
}
|
23
|
+
promptContent(sessionId, windowId, request, requestOptions) {
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
25
|
+
return this._windows.promptContent(sessionId, windowId, request, requestOptions);
|
26
|
+
});
|
27
|
+
}
|
28
|
+
scrapeContent(sessionId, windowId, requestOptions) {
|
29
|
+
return this._windows.scrapeContent(sessionId, windowId, requestOptions);
|
30
|
+
}
|
31
|
+
summarizeContent(sessionId, windowId, request, requestOptions) {
|
32
|
+
return this._windows.summarizeContent(sessionId, windowId, request, requestOptions);
|
33
|
+
}
|
34
|
+
getWindowInfoForPuppeteerPage(sessionId, page, request, requestOptions) {
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
36
|
+
const targetId = yield page.mainFrame()._id;
|
37
|
+
return yield this.getWindowInfo(sessionId, targetId, request, requestOptions);
|
38
|
+
});
|
39
|
+
}
|
40
|
+
getWindowInfoForPlaywrightPage(sessionId, page, request, requestOptions) {
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
42
|
+
// Retrieve target information
|
43
|
+
const cdpSession = yield page.context().newCDPSession(page);
|
44
|
+
const { targetInfo } = yield cdpSession.send('Target.getTargetInfo');
|
45
|
+
const targetId = targetInfo.targetId;
|
46
|
+
if (!targetId) {
|
47
|
+
throw new Error('TargetId not found');
|
48
|
+
}
|
49
|
+
return yield this.getWindowInfo(sessionId, targetId, request, requestOptions);
|
50
|
+
});
|
51
|
+
}
|
52
|
+
getWindowInfoForSeleniumDriver(sessionId, driver, request, requestOptions) {
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
54
|
+
const cdpSession = yield driver.createCDPConnection('page');
|
55
|
+
// Fetch the available targets using the Target domain
|
56
|
+
const { targetInfo } = yield cdpSession.send('Target.getTargetInfo');
|
57
|
+
const targetId = targetInfo.targetId;
|
58
|
+
if (!targetId) {
|
59
|
+
throw new Error('TargetId not found');
|
60
|
+
}
|
61
|
+
return yield this.getWindowInfo(sessionId, targetId, request, requestOptions);
|
62
|
+
});
|
63
|
+
}
|
64
|
+
}
|
65
|
+
exports.AirtopWindows = AirtopWindows;
|
@@ -1,18 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
3
|
-
*/
|
4
|
-
import * as serializers from "../index";
|
5
|
-
import * as Airtop from "../../api/index";
|
6
|
-
import * as core from "../../core";
|
7
|
-
import { ExternalSessionWithConnectionInfo } from "./ExternalSessionWithConnectionInfo";
|
8
|
-
import { Issue } from "./Issue";
|
9
|
-
import { DefaultMetaWrapper } from "./DefaultMetaWrapper";
|
10
|
-
export declare const ListExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper: core.serialization.ObjectSchema<serializers.ListExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper.Raw, Airtop.ListExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper>;
|
11
|
-
export declare namespace ListExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper {
|
12
|
-
interface Raw {
|
13
|
-
data?: ExternalSessionWithConnectionInfo.Raw[] | null;
|
14
|
-
errors?: Issue.Raw[] | null;
|
15
|
-
meta: DefaultMetaWrapper.Raw;
|
16
|
-
warnings?: Issue.Raw[] | null;
|
17
|
-
}
|
18
|
-
}
|
package/serialization/types/ListExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper.d.ts
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
3
|
-
*/
|
4
|
-
import * as serializers from "../index";
|
5
|
-
import * as Airtop from "../../api/index";
|
6
|
-
import * as core from "../../core";
|
7
|
-
import { ExternalSessionWithConnectionInfo } from "./ExternalSessionWithConnectionInfo";
|
8
|
-
import { Issue } from "./Issue";
|
9
|
-
import { DefaultMetaWrapper } from "./DefaultMetaWrapper";
|
10
|
-
export declare const ListExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper: core.serialization.ObjectSchema<serializers.ListExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper.Raw, Airtop.ListExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper>;
|
11
|
-
export declare namespace ListExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper {
|
12
|
-
interface Raw {
|
13
|
-
data?: ExternalSessionWithConnectionInfo.Raw[] | null;
|
14
|
-
errors?: Issue.Raw[] | null;
|
15
|
-
meta: DefaultMetaWrapper.Raw;
|
16
|
-
warnings?: Issue.Raw[] | null;
|
17
|
-
}
|
18
|
-
}
|
File without changes
|