@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
package/api/index.d.ts
CHANGED
package/api/index.js
CHANGED
@@ -14,6 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
15
|
};
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
__exportStar(require("./resources"), exports);
|
17
18
|
__exportStar(require("./types"), exports);
|
18
19
|
__exportStar(require("./errors"), exports);
|
19
|
-
__exportStar(require("./resources"), exports);
|
package/api/resources/index.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
export * as profiles from "./profiles";
|
2
1
|
export * as sessions from "./sessions";
|
2
|
+
export * from "./sessions/types";
|
3
|
+
export * as profiles from "./profiles";
|
3
4
|
export * as windows from "./windows";
|
4
5
|
export * from "./profiles/client/requests";
|
5
6
|
export * from "./sessions/client/requests";
|
package/api/resources/index.js
CHANGED
@@ -26,9 +26,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
26
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
27
27
|
};
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
29
|
-
exports.windows = exports.
|
30
|
-
exports.profiles = __importStar(require("./profiles"));
|
29
|
+
exports.windows = exports.profiles = exports.sessions = void 0;
|
31
30
|
exports.sessions = __importStar(require("./sessions"));
|
31
|
+
__exportStar(require("./sessions/types"), exports);
|
32
|
+
exports.profiles = __importStar(require("./profiles"));
|
32
33
|
exports.windows = __importStar(require("./windows"));
|
33
34
|
__exportStar(require("./profiles/client/requests"), exports);
|
34
35
|
__exportStar(require("./sessions/client/requests"), exports);
|
@@ -77,8 +77,8 @@ class Profiles {
|
|
77
77
|
Authorization: yield this._getAuthorizationHeader(),
|
78
78
|
"X-Fern-Language": "JavaScript",
|
79
79
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
80
|
-
"X-Fern-SDK-Version": "0.0.
|
81
|
-
"User-Agent": "@airtop/sdk/0.0.
|
80
|
+
"X-Fern-SDK-Version": "0.0.10-a",
|
81
|
+
"User-Agent": "@airtop/sdk/0.0.10-a",
|
82
82
|
"X-Fern-Runtime": core.RUNTIME.type,
|
83
83
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
84
84
|
},
|
@@ -148,8 +148,8 @@ class Profiles {
|
|
148
148
|
Authorization: yield this._getAuthorizationHeader(),
|
149
149
|
"X-Fern-Language": "JavaScript",
|
150
150
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
151
|
-
"X-Fern-SDK-Version": "0.0.
|
152
|
-
"User-Agent": "@airtop/sdk/0.0.
|
151
|
+
"X-Fern-SDK-Version": "0.0.10-a",
|
152
|
+
"User-Agent": "@airtop/sdk/0.0.10-a",
|
153
153
|
"X-Fern-Runtime": core.RUNTIME.type,
|
154
154
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
155
155
|
},
|
@@ -33,9 +33,12 @@ export declare class Sessions {
|
|
33
33
|
* @throws {@link Airtop.InternalServerError}
|
34
34
|
*
|
35
35
|
* @example
|
36
|
-
* await client.sessions.list(
|
36
|
+
* await client.sessions.list({
|
37
|
+
* offset: 1,
|
38
|
+
* limit: 10
|
39
|
+
* })
|
37
40
|
*/
|
38
|
-
list(request?: Airtop.SessionsListRequest, requestOptions?: Sessions.RequestOptions): Promise<Airtop.
|
41
|
+
list(request?: Airtop.SessionsListRequest, requestOptions?: Sessions.RequestOptions): Promise<Airtop.SessionsWithPaginationEnvelopeDefaultMetaWrapper>;
|
39
42
|
/**
|
40
43
|
* @param {Airtop.SessionRestInputV1} request
|
41
44
|
* @param {Sessions.RequestOptions} requestOptions - Request-specific configuration.
|
@@ -47,7 +50,7 @@ export declare class Sessions {
|
|
47
50
|
/**
|
48
51
|
* Get a session by ID
|
49
52
|
*
|
50
|
-
* @param {string} id -
|
53
|
+
* @param {string} id - Id of the session to get
|
51
54
|
* @param {Sessions.RequestOptions} requestOptions - Request-specific configuration.
|
52
55
|
*
|
53
56
|
* @throws {@link Airtop.NotFoundError}
|
@@ -61,12 +64,16 @@ export declare class Sessions {
|
|
61
64
|
/**
|
62
65
|
* Ends a session by ID. If a given session id does not exist within the organization, it is ignored.
|
63
66
|
*
|
64
|
-
* @param {string} id -
|
67
|
+
* @param {string} id - ID of the session to delete
|
65
68
|
* @param {Sessions.RequestOptions} requestOptions - Request-specific configuration.
|
66
69
|
*
|
67
70
|
* @example
|
68
71
|
* await client.sessions.terminate("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b")
|
69
72
|
*/
|
70
73
|
terminate(id: string, requestOptions?: Sessions.RequestOptions): Promise<void>;
|
74
|
+
/**
|
75
|
+
* Get a session event stream for a given session ID
|
76
|
+
*/
|
77
|
+
events(id: string, requestOptions?: Sessions.RequestOptions): Promise<core.Stream<Airtop.SessionsEventsResponse>>;
|
71
78
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
72
79
|
}
|
@@ -60,12 +60,15 @@ class Sessions {
|
|
60
60
|
* @throws {@link Airtop.InternalServerError}
|
61
61
|
*
|
62
62
|
* @example
|
63
|
-
* await client.sessions.list(
|
63
|
+
* await client.sessions.list({
|
64
|
+
* offset: 1,
|
65
|
+
* limit: 10
|
66
|
+
* })
|
64
67
|
*/
|
65
68
|
list(request = {}, requestOptions) {
|
66
69
|
var _a, _b;
|
67
70
|
return __awaiter(this, void 0, void 0, function* () {
|
68
|
-
const { sessionIds } = request;
|
71
|
+
const { sessionIds, status, offset, limit } = request;
|
69
72
|
const _queryParams = {};
|
70
73
|
if (sessionIds != null) {
|
71
74
|
if (Array.isArray(sessionIds)) {
|
@@ -75,6 +78,15 @@ class Sessions {
|
|
75
78
|
_queryParams["sessionIds"] = sessionIds;
|
76
79
|
}
|
77
80
|
}
|
81
|
+
if (status != null) {
|
82
|
+
_queryParams["status"] = status;
|
83
|
+
}
|
84
|
+
if (offset != null) {
|
85
|
+
_queryParams["offset"] = offset.toString();
|
86
|
+
}
|
87
|
+
if (limit != null) {
|
88
|
+
_queryParams["limit"] = limit.toString();
|
89
|
+
}
|
78
90
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
79
91
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AirtopEnvironment.Default, "sessions"),
|
80
92
|
method: "GET",
|
@@ -82,8 +94,8 @@ class Sessions {
|
|
82
94
|
Authorization: yield this._getAuthorizationHeader(),
|
83
95
|
"X-Fern-Language": "JavaScript",
|
84
96
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
85
|
-
"X-Fern-SDK-Version": "0.0.
|
86
|
-
"User-Agent": "@airtop/sdk/0.0.
|
97
|
+
"X-Fern-SDK-Version": "0.0.10-a",
|
98
|
+
"User-Agent": "@airtop/sdk/0.0.10-a",
|
87
99
|
"X-Fern-Runtime": core.RUNTIME.type,
|
88
100
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
89
101
|
},
|
@@ -95,7 +107,7 @@ class Sessions {
|
|
95
107
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
96
108
|
});
|
97
109
|
if (_response.ok) {
|
98
|
-
return serializers.
|
110
|
+
return serializers.SessionsWithPaginationEnvelopeDefaultMetaWrapper.parseOrThrow(_response.body, {
|
99
111
|
unrecognizedObjectKeys: "passthrough",
|
100
112
|
allowUnrecognizedUnionMembers: true,
|
101
113
|
allowUnrecognizedEnumValues: true,
|
@@ -168,8 +180,8 @@ class Sessions {
|
|
168
180
|
Authorization: yield this._getAuthorizationHeader(),
|
169
181
|
"X-Fern-Language": "JavaScript",
|
170
182
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
171
|
-
"X-Fern-SDK-Version": "0.0.
|
172
|
-
"User-Agent": "@airtop/sdk/0.0.
|
183
|
+
"X-Fern-SDK-Version": "0.0.10-a",
|
184
|
+
"User-Agent": "@airtop/sdk/0.0.10-a",
|
173
185
|
"X-Fern-Runtime": core.RUNTIME.type,
|
174
186
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
175
187
|
},
|
@@ -213,7 +225,7 @@ class Sessions {
|
|
213
225
|
/**
|
214
226
|
* Get a session by ID
|
215
227
|
*
|
216
|
-
* @param {string} id -
|
228
|
+
* @param {string} id - Id of the session to get
|
217
229
|
* @param {Sessions.RequestOptions} requestOptions - Request-specific configuration.
|
218
230
|
*
|
219
231
|
* @throws {@link Airtop.NotFoundError}
|
@@ -233,8 +245,8 @@ class Sessions {
|
|
233
245
|
Authorization: yield this._getAuthorizationHeader(),
|
234
246
|
"X-Fern-Language": "JavaScript",
|
235
247
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
236
|
-
"X-Fern-SDK-Version": "0.0.
|
237
|
-
"User-Agent": "@airtop/sdk/0.0.
|
248
|
+
"X-Fern-SDK-Version": "0.0.10-a",
|
249
|
+
"User-Agent": "@airtop/sdk/0.0.10-a",
|
238
250
|
"X-Fern-Runtime": core.RUNTIME.type,
|
239
251
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
240
252
|
},
|
@@ -304,7 +316,7 @@ class Sessions {
|
|
304
316
|
/**
|
305
317
|
* Ends a session by ID. If a given session id does not exist within the organization, it is ignored.
|
306
318
|
*
|
307
|
-
* @param {string} id -
|
319
|
+
* @param {string} id - ID of the session to delete
|
308
320
|
* @param {Sessions.RequestOptions} requestOptions - Request-specific configuration.
|
309
321
|
*
|
310
322
|
* @example
|
@@ -320,8 +332,8 @@ class Sessions {
|
|
320
332
|
Authorization: yield this._getAuthorizationHeader(),
|
321
333
|
"X-Fern-Language": "JavaScript",
|
322
334
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
323
|
-
"X-Fern-SDK-Version": "0.0.
|
324
|
-
"User-Agent": "@airtop/sdk/0.0.
|
335
|
+
"X-Fern-SDK-Version": "0.0.10-a",
|
336
|
+
"User-Agent": "@airtop/sdk/0.0.10-a",
|
325
337
|
"X-Fern-Runtime": core.RUNTIME.type,
|
326
338
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
327
339
|
},
|
@@ -355,6 +367,98 @@ class Sessions {
|
|
355
367
|
}
|
356
368
|
});
|
357
369
|
}
|
370
|
+
/**
|
371
|
+
* Get a session event stream for a given session ID
|
372
|
+
*/
|
373
|
+
events(id, requestOptions) {
|
374
|
+
var _a, _b;
|
375
|
+
return __awaiter(this, void 0, void 0, function* () {
|
376
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
377
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(id)}/events`),
|
378
|
+
method: "GET",
|
379
|
+
headers: {
|
380
|
+
Authorization: yield this._getAuthorizationHeader(),
|
381
|
+
"X-Fern-Language": "JavaScript",
|
382
|
+
"X-Fern-SDK-Name": "@airtop/sdk",
|
383
|
+
"X-Fern-SDK-Version": "0.0.10-a",
|
384
|
+
"User-Agent": "@airtop/sdk/0.0.10-a",
|
385
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
386
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
387
|
+
},
|
388
|
+
contentType: "application/json",
|
389
|
+
requestType: "json",
|
390
|
+
responseType: "sse",
|
391
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
392
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
393
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
394
|
+
});
|
395
|
+
if (_response.ok) {
|
396
|
+
return new core.Stream({
|
397
|
+
stream: _response.body,
|
398
|
+
parse: (data) => __awaiter(this, void 0, void 0, function* () {
|
399
|
+
return serializers.SessionsEventsResponse.parseOrThrow(data, {
|
400
|
+
unrecognizedObjectKeys: "passthrough",
|
401
|
+
allowUnrecognizedUnionMembers: true,
|
402
|
+
allowUnrecognizedEnumValues: true,
|
403
|
+
skipValidation: true,
|
404
|
+
breadcrumbsPrefix: ["response"],
|
405
|
+
});
|
406
|
+
}),
|
407
|
+
signal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
408
|
+
eventShape: {
|
409
|
+
type: "sse",
|
410
|
+
streamTerminator: "[DONE]",
|
411
|
+
},
|
412
|
+
});
|
413
|
+
}
|
414
|
+
if (_response.error.reason === "status-code") {
|
415
|
+
switch (_response.error.statusCode) {
|
416
|
+
case 404:
|
417
|
+
throw new Airtop.NotFoundError(serializers.ErrorEnvelope.parseOrThrow(_response.error.body, {
|
418
|
+
unrecognizedObjectKeys: "passthrough",
|
419
|
+
allowUnrecognizedUnionMembers: true,
|
420
|
+
allowUnrecognizedEnumValues: true,
|
421
|
+
skipValidation: true,
|
422
|
+
breadcrumbsPrefix: ["response"],
|
423
|
+
}));
|
424
|
+
case 422:
|
425
|
+
throw new Airtop.UnprocessableEntityError(serializers.ErrorEnvelope.parseOrThrow(_response.error.body, {
|
426
|
+
unrecognizedObjectKeys: "passthrough",
|
427
|
+
allowUnrecognizedUnionMembers: true,
|
428
|
+
allowUnrecognizedEnumValues: true,
|
429
|
+
skipValidation: true,
|
430
|
+
breadcrumbsPrefix: ["response"],
|
431
|
+
}));
|
432
|
+
case 500:
|
433
|
+
throw new Airtop.InternalServerError(serializers.ErrorEnvelope.parseOrThrow(_response.error.body, {
|
434
|
+
unrecognizedObjectKeys: "passthrough",
|
435
|
+
allowUnrecognizedUnionMembers: true,
|
436
|
+
allowUnrecognizedEnumValues: true,
|
437
|
+
skipValidation: true,
|
438
|
+
breadcrumbsPrefix: ["response"],
|
439
|
+
}));
|
440
|
+
default:
|
441
|
+
throw new errors.AirtopError({
|
442
|
+
statusCode: _response.error.statusCode,
|
443
|
+
body: _response.error.body,
|
444
|
+
});
|
445
|
+
}
|
446
|
+
}
|
447
|
+
switch (_response.error.reason) {
|
448
|
+
case "non-json":
|
449
|
+
throw new errors.AirtopError({
|
450
|
+
statusCode: _response.error.statusCode,
|
451
|
+
body: _response.error.rawBody,
|
452
|
+
});
|
453
|
+
case "timeout":
|
454
|
+
throw new errors.AirtopTimeoutError();
|
455
|
+
case "unknown":
|
456
|
+
throw new errors.AirtopError({
|
457
|
+
message: _response.error.errorMessage,
|
458
|
+
});
|
459
|
+
}
|
460
|
+
});
|
461
|
+
}
|
358
462
|
_getAuthorizationHeader() {
|
359
463
|
return __awaiter(this, void 0, void 0, function* () {
|
360
464
|
const bearer = yield core.Supplier.get(this._options.apiKey);
|
@@ -1,13 +1,29 @@
|
|
1
1
|
/**
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
3
3
|
*/
|
4
|
+
import * as Airtop from "../../../../index";
|
4
5
|
/**
|
5
6
|
* @example
|
6
|
-
* {
|
7
|
+
* {
|
8
|
+
* offset: 1,
|
9
|
+
* limit: 10
|
10
|
+
* }
|
7
11
|
*/
|
8
12
|
export interface SessionsListRequest {
|
9
13
|
/**
|
10
|
-
* a comma separated list of
|
14
|
+
* a comma separated list of IDs of the session to get
|
11
15
|
*/
|
12
16
|
sessionIds?: string | string[];
|
17
|
+
/**
|
18
|
+
* status of the session to get
|
19
|
+
*/
|
20
|
+
status?: Airtop.SessionsListRequestStatus;
|
21
|
+
/**
|
22
|
+
* offset for pagination
|
23
|
+
*/
|
24
|
+
offset?: number;
|
25
|
+
/**
|
26
|
+
* limit for pagination
|
27
|
+
*/
|
28
|
+
limit?: number;
|
13
29
|
}
|
@@ -14,4 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
15
|
};
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
__exportStar(require("./types"), exports);
|
17
18
|
__exportStar(require("./client"), exports);
|
@@ -0,0 +1,16 @@
|
|
1
|
+
/**
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
3
|
+
*/
|
4
|
+
import * as Airtop from "../../../index";
|
5
|
+
/**
|
6
|
+
* Each oneOf object in the array represents one possible Server Sent Events (SSE) message, serialized as UTF-8 text according to the SSE specification.
|
7
|
+
*/
|
8
|
+
export declare type SessionsEventsResponse = Airtop.SessionsEventsResponse.Status | Airtop.SessionsEventsResponse.Error_;
|
9
|
+
export declare namespace SessionsEventsResponse {
|
10
|
+
interface Status extends Airtop.SessionsEventsResponseStatus {
|
11
|
+
event: "status";
|
12
|
+
}
|
13
|
+
interface Error_ extends Airtop.SessionsEventsResponseError {
|
14
|
+
event: "error";
|
15
|
+
}
|
16
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
/**
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
3
|
+
*/
|
4
|
+
import * as Airtop from "../../../index";
|
5
|
+
export interface SessionsEventsResponseError {
|
6
|
+
data: Airtop.ErrorMessage;
|
7
|
+
/** The event ID. */
|
8
|
+
id?: number;
|
9
|
+
/** The retry time in milliseconds. */
|
10
|
+
retry?: number;
|
11
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
/**
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
3
|
+
*/
|
4
|
+
import * as Airtop from "../../../index";
|
5
|
+
export interface SessionsEventsResponseStatus {
|
6
|
+
data: Airtop.StatusMessage;
|
7
|
+
/** The event ID. */
|
8
|
+
id?: number;
|
9
|
+
/** The retry time in milliseconds. */
|
10
|
+
retry?: number;
|
11
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/**
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
3
|
+
*/
|
4
|
+
/**
|
5
|
+
* status of the session to get
|
6
|
+
*/
|
7
|
+
export declare type SessionsListRequestStatus = "awaiting_capacity" | "initializing" | "running" | "ended";
|
8
|
+
export declare const SessionsListRequestStatus: {
|
9
|
+
readonly AwaitingCapacity: "awaiting_capacity";
|
10
|
+
readonly Initializing: "initializing";
|
11
|
+
readonly Running: "running";
|
12
|
+
readonly Ended: "ended";
|
13
|
+
};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
/**
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
4
|
+
*/
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.SessionsListRequestStatus = void 0;
|
7
|
+
exports.SessionsListRequestStatus = {
|
8
|
+
AwaitingCapacity: "awaiting_capacity",
|
9
|
+
Initializing: "initializing",
|
10
|
+
Running: "running",
|
11
|
+
Ended: "ended",
|
12
|
+
};
|
@@ -0,0 +1,20 @@
|
|
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("./SessionsListRequestStatus"), exports);
|
18
|
+
__exportStar(require("./SessionsEventsResponseStatus"), exports);
|
19
|
+
__exportStar(require("./SessionsEventsResponseError"), exports);
|
20
|
+
__exportStar(require("./SessionsEventsResponse"), exports);
|
@@ -23,7 +23,7 @@ export declare class Windows {
|
|
23
23
|
protected readonly _options: Windows.Options;
|
24
24
|
constructor(_options?: Windows.Options);
|
25
25
|
/**
|
26
|
-
* @param {string} sessionId -
|
26
|
+
* @param {string} sessionId - ID of the session that owns the window
|
27
27
|
* @param {string} windowId - id of the browser window, either the windowId (uuid) or targetId (simple string)
|
28
28
|
* @param {Airtop.GetWindowInfoRequest} request
|
29
29
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
@@ -49,7 +49,7 @@ class Windows {
|
|
49
49
|
this._options = _options;
|
50
50
|
}
|
51
51
|
/**
|
52
|
-
* @param {string} sessionId -
|
52
|
+
* @param {string} sessionId - ID of the session that owns the window
|
53
53
|
* @param {string} windowId - id of the browser window, either the windowId (uuid) or targetId (simple string)
|
54
54
|
* @param {Airtop.GetWindowInfoRequest} request
|
55
55
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
@@ -74,14 +74,14 @@ class Windows {
|
|
74
74
|
_queryParams["Screen resolution"] = screenResolution;
|
75
75
|
}
|
76
76
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
77
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}
|
77
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}`),
|
78
78
|
method: "GET",
|
79
79
|
headers: {
|
80
80
|
Authorization: yield this._getAuthorizationHeader(),
|
81
81
|
"X-Fern-Language": "JavaScript",
|
82
82
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
83
|
-
"X-Fern-SDK-Version": "0.0.
|
84
|
-
"User-Agent": "@airtop/sdk/0.0.
|
83
|
+
"X-Fern-SDK-Version": "0.0.10-a",
|
84
|
+
"User-Agent": "@airtop/sdk/0.0.10-a",
|
85
85
|
"X-Fern-Runtime": core.RUNTIME.type,
|
86
86
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
87
87
|
},
|
@@ -143,8 +143,8 @@ class Windows {
|
|
143
143
|
Authorization: yield this._getAuthorizationHeader(),
|
144
144
|
"X-Fern-Language": "JavaScript",
|
145
145
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
146
|
-
"X-Fern-SDK-Version": "0.0.
|
147
|
-
"User-Agent": "@airtop/sdk/0.0.
|
146
|
+
"X-Fern-SDK-Version": "0.0.10-a",
|
147
|
+
"User-Agent": "@airtop/sdk/0.0.10-a",
|
148
148
|
"X-Fern-Runtime": core.RUNTIME.type,
|
149
149
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
150
150
|
},
|
@@ -204,8 +204,8 @@ class Windows {
|
|
204
204
|
Authorization: yield this._getAuthorizationHeader(),
|
205
205
|
"X-Fern-Language": "JavaScript",
|
206
206
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
207
|
-
"X-Fern-SDK-Version": "0.0.
|
208
|
-
"User-Agent": "@airtop/sdk/0.0.
|
207
|
+
"X-Fern-SDK-Version": "0.0.10-a",
|
208
|
+
"User-Agent": "@airtop/sdk/0.0.10-a",
|
209
209
|
"X-Fern-Runtime": core.RUNTIME.type,
|
210
210
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
211
211
|
},
|
@@ -265,8 +265,8 @@ class Windows {
|
|
265
265
|
Authorization: yield this._getAuthorizationHeader(),
|
266
266
|
"X-Fern-Language": "JavaScript",
|
267
267
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
268
|
-
"X-Fern-SDK-Version": "0.0.
|
269
|
-
"User-Agent": "@airtop/sdk/0.0.
|
268
|
+
"X-Fern-SDK-Version": "0.0.10-a",
|
269
|
+
"User-Agent": "@airtop/sdk/0.0.10-a",
|
270
270
|
"X-Fern-Runtime": core.RUNTIME.type,
|
271
271
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
272
272
|
},
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/**
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
3
|
+
*/
|
4
|
+
export interface Pagination {
|
5
|
+
currentLimit: number;
|
6
|
+
currentPage: number;
|
7
|
+
finalCount: number;
|
8
|
+
hasMore: boolean;
|
9
|
+
initialCount: number;
|
10
|
+
nextOffset: number;
|
11
|
+
numberOfPages: number;
|
12
|
+
totalItems: number;
|
13
|
+
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/**
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
3
|
+
*/
|
4
|
+
import * as Airtop from "../index";
|
5
|
+
export interface SessionsWithPagination {
|
6
|
+
/** Pagination info */
|
7
|
+
pagination: Airtop.Pagination;
|
8
|
+
/** List of sessions */
|
9
|
+
sessions?: Airtop.ExternalSessionWithConnectionInfo[];
|
10
|
+
}
|
@@ -2,8 +2,8 @@
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
3
3
|
*/
|
4
4
|
import * as Airtop from "../index";
|
5
|
-
export interface
|
6
|
-
data
|
5
|
+
export interface SessionsWithPaginationEnvelopeDefaultMetaWrapper {
|
6
|
+
data: Airtop.SessionsWithPagination;
|
7
7
|
errors?: Airtop.Issue[];
|
8
8
|
meta: Airtop.DefaultMetaWrapper;
|
9
9
|
warnings?: Airtop.Issue[];
|
@@ -0,0 +1,14 @@
|
|
1
|
+
/**
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
3
|
+
*/
|
4
|
+
import * as Airtop from "../index";
|
5
|
+
export interface StatusMessage {
|
6
|
+
/** Event name */
|
7
|
+
event: string;
|
8
|
+
/** Time of the event in milliseconds since epoch */
|
9
|
+
eventTimeMillis: number;
|
10
|
+
/** ID of the session */
|
11
|
+
id: string;
|
12
|
+
/** Status of the session */
|
13
|
+
status: Airtop.StatusMessageStatus;
|
14
|
+
}
|