@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.
Files changed (176) hide show
  1. package/api/index.d.ts +1 -1
  2. package/api/index.js +1 -1
  3. package/api/resources/index.d.ts +2 -1
  4. package/api/resources/index.js +3 -2
  5. package/api/resources/profiles/client/Client.js +4 -4
  6. package/api/resources/sessions/client/Client.d.ts +11 -4
  7. package/api/resources/sessions/client/Client.js +117 -13
  8. package/api/resources/sessions/client/requests/SessionsListRequest.d.ts +18 -2
  9. package/api/resources/sessions/index.d.ts +1 -0
  10. package/api/resources/sessions/index.js +1 -0
  11. package/api/resources/sessions/types/SessionsEventsResponse.d.ts +16 -0
  12. package/api/resources/sessions/types/SessionsEventsResponseError.d.ts +11 -0
  13. package/api/resources/sessions/types/SessionsEventsResponseStatus.d.ts +11 -0
  14. package/api/resources/sessions/types/SessionsEventsResponseStatus.js +5 -0
  15. package/api/resources/sessions/types/SessionsListRequestStatus.d.ts +13 -0
  16. package/api/resources/sessions/types/SessionsListRequestStatus.js +12 -0
  17. package/api/resources/sessions/types/index.d.ts +4 -0
  18. package/api/resources/sessions/types/index.js +20 -0
  19. package/api/resources/windows/client/Client.d.ts +1 -1
  20. package/api/resources/windows/client/Client.js +10 -10
  21. package/api/types/ErrorMessage.d.ts +11 -0
  22. package/api/types/ErrorMessage.js +5 -0
  23. package/api/types/ExternalProfileV1.d.ts +0 -2
  24. package/api/types/Pagination.d.ts +13 -0
  25. package/api/types/Pagination.js +5 -0
  26. package/api/types/SessionsWithPagination.d.ts +10 -0
  27. package/api/types/SessionsWithPagination.js +5 -0
  28. package/api/types/{ListExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper.d.ts → SessionsWithPaginationEnvelopeDefaultMetaWrapper.d.ts} +2 -2
  29. package/api/types/SessionsWithPaginationEnvelopeDefaultMetaWrapper.js +5 -0
  30. package/api/types/StatusMessage.d.ts +14 -0
  31. package/api/types/StatusMessage.js +5 -0
  32. package/api/types/StatusMessageStatus.d.ts +13 -0
  33. package/api/types/StatusMessageStatus.js +12 -0
  34. package/api/types/Window.d.ts +0 -2
  35. package/api/types/index.d.ts +6 -1
  36. package/api/types/index.js +6 -1
  37. package/core/index.d.ts +1 -0
  38. package/core/index.js +1 -0
  39. package/core/streaming-fetcher/Stream.d.ts +48 -0
  40. package/core/streaming-fetcher/Stream.js +170 -0
  41. package/core/streaming-fetcher/index.d.ts +1 -0
  42. package/core/streaming-fetcher/index.js +5 -0
  43. package/dist/api/index.d.ts +1 -1
  44. package/dist/api/index.js +1 -1
  45. package/dist/api/resources/index.d.ts +2 -1
  46. package/dist/api/resources/index.js +3 -2
  47. package/dist/api/resources/profiles/client/Client.js +4 -4
  48. package/dist/api/resources/sessions/client/Client.d.ts +11 -4
  49. package/dist/api/resources/sessions/client/Client.js +117 -13
  50. package/dist/api/resources/sessions/client/requests/SessionsListRequest.d.ts +18 -2
  51. package/dist/api/resources/sessions/index.d.ts +1 -0
  52. package/dist/api/resources/sessions/index.js +1 -0
  53. package/dist/api/resources/sessions/types/SessionsEventsResponse.d.ts +16 -0
  54. package/dist/api/resources/sessions/types/SessionsEventsResponse.js +5 -0
  55. package/dist/api/resources/sessions/types/SessionsEventsResponseError.d.ts +11 -0
  56. package/dist/api/resources/sessions/types/SessionsEventsResponseError.js +5 -0
  57. package/dist/api/resources/sessions/types/SessionsEventsResponseStatus.d.ts +11 -0
  58. package/dist/api/resources/sessions/types/SessionsEventsResponseStatus.js +5 -0
  59. package/dist/api/resources/sessions/types/SessionsListRequestStatus.d.ts +13 -0
  60. package/dist/api/resources/sessions/types/SessionsListRequestStatus.js +12 -0
  61. package/dist/api/resources/sessions/types/index.d.ts +4 -0
  62. package/dist/api/resources/sessions/types/index.js +20 -0
  63. package/dist/api/resources/windows/client/Client.d.ts +1 -1
  64. package/dist/api/resources/windows/client/Client.js +10 -10
  65. package/dist/api/types/ErrorMessage.d.ts +11 -0
  66. package/dist/api/types/ErrorMessage.js +5 -0
  67. package/dist/api/types/ExternalProfileV1.d.ts +0 -2
  68. package/dist/api/types/Pagination.d.ts +13 -0
  69. package/dist/api/types/Pagination.js +5 -0
  70. package/dist/api/types/SessionsWithPagination.d.ts +10 -0
  71. package/dist/api/types/SessionsWithPagination.js +5 -0
  72. package/dist/api/types/{ListExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper.d.ts → SessionsWithPaginationEnvelopeDefaultMetaWrapper.d.ts} +2 -2
  73. package/dist/api/types/SessionsWithPaginationEnvelopeDefaultMetaWrapper.js +5 -0
  74. package/dist/api/types/StatusMessage.d.ts +14 -0
  75. package/dist/api/types/StatusMessage.js +5 -0
  76. package/dist/api/types/StatusMessageStatus.d.ts +13 -0
  77. package/dist/api/types/StatusMessageStatus.js +12 -0
  78. package/dist/api/types/Window.d.ts +0 -2
  79. package/dist/api/types/index.d.ts +6 -1
  80. package/dist/api/types/index.js +6 -1
  81. package/dist/core/index.d.ts +1 -0
  82. package/dist/core/index.js +1 -0
  83. package/dist/core/streaming-fetcher/Stream.d.ts +48 -0
  84. package/dist/core/streaming-fetcher/Stream.js +170 -0
  85. package/dist/core/streaming-fetcher/index.d.ts +1 -0
  86. package/dist/core/streaming-fetcher/index.js +5 -0
  87. package/dist/index.d.ts +2 -1
  88. package/dist/index.js +4 -3
  89. package/dist/serialization/index.d.ts +1 -1
  90. package/dist/serialization/index.js +1 -1
  91. package/dist/serialization/resources/index.d.ts +1 -0
  92. package/dist/serialization/resources/index.js +1 -0
  93. package/dist/serialization/resources/sessions/index.d.ts +1 -0
  94. package/dist/serialization/resources/sessions/index.js +1 -0
  95. package/dist/serialization/resources/sessions/types/SessionsEventsResponse.d.ts +18 -0
  96. package/dist/serialization/resources/sessions/types/SessionsEventsResponse.js +41 -0
  97. package/dist/serialization/resources/sessions/types/SessionsEventsResponseError.d.ts +15 -0
  98. package/dist/serialization/resources/sessions/types/SessionsEventsResponseError.js +36 -0
  99. package/dist/serialization/resources/sessions/types/SessionsEventsResponseStatus.d.ts +15 -0
  100. package/dist/serialization/resources/sessions/types/SessionsEventsResponseStatus.js +36 -0
  101. package/dist/serialization/resources/sessions/types/SessionsListRequestStatus.d.ts +10 -0
  102. package/dist/serialization/resources/sessions/types/SessionsListRequestStatus.js +31 -0
  103. package/dist/serialization/resources/sessions/types/index.d.ts +4 -0
  104. package/dist/serialization/resources/sessions/types/index.js +20 -0
  105. package/dist/serialization/types/ErrorMessage.d.ts +14 -0
  106. package/dist/serialization/types/ErrorMessage.js +35 -0
  107. package/dist/serialization/types/ExternalProfileV1.d.ts +0 -1
  108. package/dist/serialization/types/ExternalProfileV1.js +0 -1
  109. package/dist/serialization/types/Pagination.d.ts +19 -0
  110. package/dist/serialization/types/Pagination.js +40 -0
  111. package/dist/serialization/types/SessionsWithPagination.d.ts +15 -0
  112. package/dist/serialization/types/SessionsWithPagination.js +36 -0
  113. package/dist/serialization/types/SessionsWithPaginationEnvelopeDefaultMetaWrapper.d.ts +18 -0
  114. package/dist/serialization/types/{ListExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper.js → SessionsWithPaginationEnvelopeDefaultMetaWrapper.js} +4 -4
  115. package/dist/serialization/types/StatusMessage.d.ts +16 -0
  116. package/dist/serialization/types/StatusMessage.js +37 -0
  117. package/dist/serialization/types/StatusMessageStatus.d.ts +10 -0
  118. package/dist/serialization/types/StatusMessageStatus.js +31 -0
  119. package/dist/serialization/types/Window.d.ts +0 -1
  120. package/dist/serialization/types/Window.js +0 -1
  121. package/dist/serialization/types/index.d.ts +6 -1
  122. package/dist/serialization/types/index.js +6 -1
  123. package/dist/wrapper/AirtopClient.d.ts +19 -0
  124. package/dist/wrapper/AirtopClient.js +32 -0
  125. package/dist/wrapper/AirtopSessions.d.ts +24 -0
  126. package/dist/wrapper/AirtopSessions.js +93 -0
  127. package/dist/wrapper/AirtopWindows.d.ts +18 -0
  128. package/dist/wrapper/AirtopWindows.js +65 -0
  129. package/index.d.ts +2 -1
  130. package/index.js +4 -3
  131. package/package.json +7 -3
  132. package/reference.md +71 -5
  133. package/serialization/index.d.ts +1 -1
  134. package/serialization/index.js +1 -1
  135. package/serialization/resources/index.d.ts +1 -0
  136. package/serialization/resources/index.js +1 -0
  137. package/serialization/resources/sessions/index.d.ts +1 -0
  138. package/serialization/resources/sessions/index.js +1 -0
  139. package/serialization/resources/sessions/types/SessionsEventsResponse.d.ts +18 -0
  140. package/serialization/resources/sessions/types/SessionsEventsResponse.js +41 -0
  141. package/serialization/resources/sessions/types/SessionsEventsResponseError.d.ts +15 -0
  142. package/serialization/resources/sessions/types/SessionsEventsResponseError.js +36 -0
  143. package/serialization/resources/sessions/types/SessionsEventsResponseStatus.d.ts +15 -0
  144. package/serialization/resources/sessions/types/SessionsEventsResponseStatus.js +36 -0
  145. package/serialization/resources/sessions/types/SessionsListRequestStatus.d.ts +10 -0
  146. package/serialization/resources/sessions/types/SessionsListRequestStatus.js +31 -0
  147. package/serialization/resources/sessions/types/index.d.ts +4 -0
  148. package/serialization/resources/sessions/types/index.js +20 -0
  149. package/serialization/types/ErrorMessage.d.ts +14 -0
  150. package/serialization/types/ErrorMessage.js +35 -0
  151. package/serialization/types/ExternalProfileV1.d.ts +0 -1
  152. package/serialization/types/ExternalProfileV1.js +0 -1
  153. package/serialization/types/Pagination.d.ts +19 -0
  154. package/serialization/types/Pagination.js +40 -0
  155. package/serialization/types/SessionsWithPagination.d.ts +15 -0
  156. package/serialization/types/SessionsWithPagination.js +36 -0
  157. package/serialization/types/SessionsWithPaginationEnvelopeDefaultMetaWrapper.d.ts +18 -0
  158. package/serialization/types/{ListExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper.js → SessionsWithPaginationEnvelopeDefaultMetaWrapper.js} +4 -4
  159. package/serialization/types/StatusMessage.d.ts +16 -0
  160. package/serialization/types/StatusMessage.js +37 -0
  161. package/serialization/types/StatusMessageStatus.d.ts +10 -0
  162. package/serialization/types/StatusMessageStatus.js +31 -0
  163. package/serialization/types/Window.d.ts +0 -1
  164. package/serialization/types/Window.js +0 -1
  165. package/serialization/types/index.d.ts +6 -1
  166. package/serialization/types/index.js +6 -1
  167. package/wrapper/AirtopClient.d.ts +19 -0
  168. package/wrapper/AirtopClient.js +32 -0
  169. package/wrapper/AirtopSessions.d.ts +24 -0
  170. package/wrapper/AirtopSessions.js +93 -0
  171. package/wrapper/AirtopWindows.d.ts +18 -0
  172. package/wrapper/AirtopWindows.js +65 -0
  173. package/dist/serialization/types/ListExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper.d.ts +0 -18
  174. package/serialization/types/ListExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper.d.ts +0 -18
  175. /package/api/{types/ListExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper.js → resources/sessions/types/SessionsEventsResponse.js} +0 -0
  176. /package/{dist/api/types/ListExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper.js → api/resources/sessions/types/SessionsEventsResponseError.js} +0 -0
package/api/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
+ export * from "./resources";
1
2
  export * from "./types";
2
3
  export * from "./errors";
3
- export * from "./resources";
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);
@@ -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";
@@ -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.sessions = exports.profiles = void 0;
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.8",
81
- "User-Agent": "@airtop/sdk/0.0.8",
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.8",
152
- "User-Agent": "@airtop/sdk/0.0.8",
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.ListExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper>;
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 - UUID of the session to get
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 - UUID of the session to delete
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.8",
86
- "User-Agent": "@airtop/sdk/0.0.8",
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.ListExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper.parseOrThrow(_response.body, {
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.8",
172
- "User-Agent": "@airtop/sdk/0.0.8",
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 - UUID of the session to get
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.8",
237
- "User-Agent": "@airtop/sdk/0.0.8",
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 - UUID of the session to delete
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.8",
324
- "User-Agent": "@airtop/sdk/0.0.8",
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 UUIDs of the session to get
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
  }
@@ -1 +1,2 @@
1
+ export * from "./types";
1
2
  export * from "./client";
@@ -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,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,4 @@
1
+ export * from "./SessionsListRequestStatus";
2
+ export * from "./SessionsEventsResponseStatus";
3
+ export * from "./SessionsEventsResponseError";
4
+ export * from "./SessionsEventsResponse";
@@ -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 - UUID of the session that owns the window
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 - UUID of the session that owns the window
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)}/get-window-info`),
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.8",
84
- "User-Agent": "@airtop/sdk/0.0.8",
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.8",
147
- "User-Agent": "@airtop/sdk/0.0.8",
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.8",
208
- "User-Agent": "@airtop/sdk/0.0.8",
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.8",
269
- "User-Agent": "@airtop/sdk/0.0.8",
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,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface ErrorMessage {
5
+ /** Error code */
6
+ code: string;
7
+ /** Event name */
8
+ event: string;
9
+ /** Error message */
10
+ message: string;
11
+ }
@@ -0,0 +1,5 @@
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,6 +6,4 @@ export interface ExternalProfileV1 {
6
6
  profileId: string;
7
7
  /** Status of the profile */
8
8
  status?: string;
9
- /** URI to upload profile data to */
10
- uploadUri?: string;
11
9
  }
@@ -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,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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 ListExternalSessionWithConnectionInfoEnvelopeDefaultMetaWrapper {
6
- data?: Airtop.ExternalSessionWithConnectionInfo[];
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,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });