@airtop/sdk 0.1.13 → 0.1.14

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 (110) hide show
  1. package/api/resources/profiles/client/Client.d.ts +0 -10
  2. package/api/resources/profiles/client/Client.js +2 -82
  3. package/api/resources/profiles/client/requests/index.d.ts +0 -1
  4. package/api/resources/sessions/client/Client.js +12 -12
  5. package/api/resources/sessions/types/SessionsEventsResponse.d.ts +4 -4
  6. package/api/resources/sessions/types/index.d.ts +1 -1
  7. package/api/resources/sessions/types/index.js +1 -1
  8. package/api/resources/windows/client/Client.d.ts +32 -0
  9. package/api/resources/windows/client/Client.js +109 -24
  10. package/api/resources/windows/client/requests/SessionScreenshotHandlerRequestBody.d.ts +21 -0
  11. package/api/resources/windows/client/requests/SessionTypeHandlerRequestBody.d.ts +4 -0
  12. package/api/resources/windows/client/requests/index.d.ts +1 -0
  13. package/api/types/ExternalSessionAiResponseMetadata.d.ts +2 -0
  14. package/api/types/ScreenshotConfig.d.ts +13 -0
  15. package/api/types/ScreenshotMetadata.d.ts +7 -0
  16. package/api/types/ScreenshotRequestConfig.d.ts +8 -0
  17. package/api/types/VisualAnalysisConfig.d.ts +5 -1
  18. package/api/types/VisualAnalysisConfigScope.d.ts +4 -2
  19. package/api/types/VisualAnalysisConfigScope.js +2 -0
  20. package/api/types/index.d.ts +3 -2
  21. package/api/types/index.js +3 -2
  22. package/dist/api/resources/profiles/client/Client.d.ts +0 -10
  23. package/dist/api/resources/profiles/client/Client.js +2 -82
  24. package/dist/api/resources/profiles/client/requests/index.d.ts +0 -1
  25. package/dist/api/resources/sessions/client/Client.js +12 -12
  26. package/dist/api/resources/sessions/types/SessionsEventsResponse.d.ts +4 -4
  27. package/dist/api/resources/sessions/types/index.d.ts +1 -1
  28. package/dist/api/resources/sessions/types/index.js +1 -1
  29. package/dist/api/resources/windows/client/Client.d.ts +32 -0
  30. package/dist/api/resources/windows/client/Client.js +109 -24
  31. package/dist/api/resources/windows/client/requests/SessionScreenshotHandlerRequestBody.d.ts +21 -0
  32. package/dist/api/resources/windows/client/requests/SessionTypeHandlerRequestBody.d.ts +4 -0
  33. package/dist/api/resources/windows/client/requests/index.d.ts +1 -0
  34. package/dist/api/types/ExternalSessionAiResponseMetadata.d.ts +2 -0
  35. package/dist/api/types/ScreenshotConfig.d.ts +13 -0
  36. package/dist/api/types/ScreenshotMetadata.d.ts +7 -0
  37. package/dist/api/types/ScreenshotMetadata.js +5 -0
  38. package/dist/api/types/ScreenshotRequestConfig.d.ts +8 -0
  39. package/dist/api/types/ScreenshotRequestConfig.js +5 -0
  40. package/dist/api/types/VisualAnalysisConfig.d.ts +5 -1
  41. package/dist/api/types/VisualAnalysisConfigScope.d.ts +4 -2
  42. package/dist/api/types/VisualAnalysisConfigScope.js +2 -0
  43. package/dist/api/types/index.d.ts +3 -2
  44. package/dist/api/types/index.js +3 -2
  45. package/dist/serialization/resources/sessions/types/SessionsEventsResponse.d.ts +5 -5
  46. package/dist/serialization/resources/sessions/types/SessionsEventsResponse.js +2 -2
  47. package/dist/serialization/resources/sessions/types/index.d.ts +1 -1
  48. package/dist/serialization/resources/sessions/types/index.js +1 -1
  49. package/dist/serialization/resources/windows/client/requests/SessionScreenshotHandlerRequestBody.d.ts +16 -0
  50. package/dist/serialization/resources/windows/client/requests/SessionScreenshotHandlerRequestBody.js +37 -0
  51. package/dist/serialization/resources/windows/client/requests/SessionTypeHandlerRequestBody.d.ts +2 -0
  52. package/dist/serialization/resources/windows/client/requests/SessionTypeHandlerRequestBody.js +2 -0
  53. package/dist/serialization/resources/windows/client/requests/index.d.ts +1 -0
  54. package/dist/serialization/resources/windows/client/requests/index.js +3 -1
  55. package/dist/serialization/types/ExternalSessionAiResponseMetadata.d.ts +2 -0
  56. package/dist/serialization/types/ExternalSessionAiResponseMetadata.js +2 -0
  57. package/dist/serialization/types/ScreenshotConfig.d.ts +15 -0
  58. package/dist/serialization/types/{ProfilesResponse.js → ScreenshotConfig.js} +6 -9
  59. package/dist/serialization/types/ScreenshotMetadata.d.ts +12 -0
  60. package/dist/serialization/types/{ExternalProfileV1.js → ScreenshotMetadata.js} +3 -5
  61. package/dist/serialization/types/ScreenshotRequestConfig.d.ts +13 -0
  62. package/{serialization/types/ExternalProfileV1.js → dist/serialization/types/ScreenshotRequestConfig.js} +4 -5
  63. package/dist/serialization/types/VisualAnalysisConfig.d.ts +2 -0
  64. package/dist/serialization/types/VisualAnalysisConfig.js +2 -0
  65. package/dist/serialization/types/VisualAnalysisConfigScope.d.ts +1 -1
  66. package/dist/serialization/types/VisualAnalysisConfigScope.js +1 -1
  67. package/dist/serialization/types/index.d.ts +3 -2
  68. package/dist/serialization/types/index.js +3 -2
  69. package/package.json +1 -1
  70. package/reference.md +184 -18
  71. package/serialization/resources/sessions/types/SessionsEventsResponse.d.ts +5 -5
  72. package/serialization/resources/sessions/types/SessionsEventsResponse.js +2 -2
  73. package/serialization/resources/sessions/types/index.d.ts +1 -1
  74. package/serialization/resources/sessions/types/index.js +1 -1
  75. package/serialization/resources/windows/client/requests/SessionScreenshotHandlerRequestBody.d.ts +16 -0
  76. package/serialization/resources/windows/client/requests/SessionScreenshotHandlerRequestBody.js +37 -0
  77. package/serialization/resources/windows/client/requests/SessionTypeHandlerRequestBody.d.ts +2 -0
  78. package/serialization/resources/windows/client/requests/SessionTypeHandlerRequestBody.js +2 -0
  79. package/serialization/resources/windows/client/requests/index.d.ts +1 -0
  80. package/serialization/resources/windows/client/requests/index.js +3 -1
  81. package/serialization/types/ExternalSessionAiResponseMetadata.d.ts +2 -0
  82. package/serialization/types/ExternalSessionAiResponseMetadata.js +2 -0
  83. package/serialization/types/ScreenshotConfig.d.ts +15 -0
  84. package/serialization/types/{ProfilesResponse.js → ScreenshotConfig.js} +6 -9
  85. package/serialization/types/ScreenshotMetadata.d.ts +12 -0
  86. package/serialization/types/ScreenshotMetadata.js +33 -0
  87. package/serialization/types/ScreenshotRequestConfig.d.ts +13 -0
  88. package/serialization/types/ScreenshotRequestConfig.js +34 -0
  89. package/serialization/types/VisualAnalysisConfig.d.ts +2 -0
  90. package/serialization/types/VisualAnalysisConfig.js +2 -0
  91. package/serialization/types/VisualAnalysisConfigScope.d.ts +1 -1
  92. package/serialization/types/VisualAnalysisConfigScope.js +1 -1
  93. package/serialization/types/index.d.ts +3 -2
  94. package/serialization/types/index.js +3 -2
  95. package/api/resources/profiles/client/requests/ProfilesGetRequest.d.ts +0 -17
  96. package/api/types/ExternalProfileV1.d.ts +0 -11
  97. package/api/types/ProfilesResponse.d.ts +0 -10
  98. package/dist/api/resources/profiles/client/requests/ProfilesGetRequest.d.ts +0 -17
  99. package/dist/api/types/ExternalProfileV1.d.ts +0 -11
  100. package/dist/api/types/ProfilesResponse.d.ts +0 -10
  101. package/dist/serialization/types/ExternalProfileV1.d.ts +0 -14
  102. package/dist/serialization/types/ProfilesResponse.d.ts +0 -18
  103. package/serialization/types/ExternalProfileV1.d.ts +0 -14
  104. package/serialization/types/ProfilesResponse.d.ts +0 -18
  105. /package/api/resources/{profiles/client/requests/ProfilesGetRequest.js → windows/client/requests/SessionScreenshotHandlerRequestBody.js} +0 -0
  106. /package/api/types/{ExternalProfileV1.js → ScreenshotConfig.js} +0 -0
  107. /package/api/types/{ProfilesResponse.js → ScreenshotMetadata.js} +0 -0
  108. /package/{dist/api/resources/profiles/client/requests/ProfilesGetRequest.js → api/types/ScreenshotRequestConfig.js} +0 -0
  109. /package/dist/api/{types/ExternalProfileV1.js → resources/windows/client/requests/SessionScreenshotHandlerRequestBody.js} +0 -0
  110. /package/dist/api/types/{ProfilesResponse.js → ScreenshotConfig.js} +0 -0
@@ -22,16 +22,6 @@ export declare namespace Profiles {
22
22
  export declare class Profiles {
23
23
  protected readonly _options: Profiles.Options;
24
24
  constructor(_options: Profiles.Options);
25
- /**
26
- * Get profiles matching by id
27
- *
28
- * @param {Airtop.ProfilesGetRequest} request
29
- * @param {Profiles.RequestOptions} requestOptions - Request-specific configuration.
30
- *
31
- * @example
32
- * await client.profiles.get()
33
- */
34
- get(request?: Airtop.ProfilesGetRequest, requestOptions?: Profiles.RequestOptions): Promise<Airtop.ProfilesResponse>;
35
25
  /**
36
26
  * Delete profiles matching by id
37
27
  *
@@ -42,91 +42,11 @@ exports.Profiles = void 0;
42
42
  const environments = __importStar(require("../../../../environments"));
43
43
  const core = __importStar(require("../../../../core"));
44
44
  const url_join_1 = __importDefault(require("url-join"));
45
- const serializers = __importStar(require("../../../../serialization/index"));
46
45
  const errors = __importStar(require("../../../../errors/index"));
47
46
  class Profiles {
48
47
  constructor(_options) {
49
48
  this._options = _options;
50
49
  }
51
- /**
52
- * Get profiles matching by id
53
- *
54
- * @param {Airtop.ProfilesGetRequest} request
55
- * @param {Profiles.RequestOptions} requestOptions - Request-specific configuration.
56
- *
57
- * @example
58
- * await client.profiles.get()
59
- */
60
- get(request = {}, requestOptions) {
61
- var _a, _b;
62
- return __awaiter(this, void 0, void 0, function* () {
63
- const { profileIds, profileNames } = request;
64
- const _queryParams = {};
65
- if (profileIds != null) {
66
- if (Array.isArray(profileIds)) {
67
- _queryParams["profileIds"] = profileIds.map((item) => item);
68
- }
69
- else {
70
- _queryParams["profileIds"] = profileIds;
71
- }
72
- }
73
- if (profileNames != null) {
74
- if (Array.isArray(profileNames)) {
75
- _queryParams["profileNames"] = profileNames.map((item) => item);
76
- }
77
- else {
78
- _queryParams["profileNames"] = profileNames;
79
- }
80
- }
81
- const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
82
- url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.AirtopEnvironment.Default, "profiles"),
83
- method: "GET",
84
- headers: {
85
- Authorization: yield this._getAuthorizationHeader(),
86
- "X-Fern-Language": "JavaScript",
87
- "X-Fern-SDK-Name": "@airtop/sdk",
88
- "X-Fern-SDK-Version": "0.1.13",
89
- "User-Agent": "@airtop/sdk/0.1.13",
90
- "X-Fern-Runtime": core.RUNTIME.type,
91
- "X-Fern-Runtime-Version": core.RUNTIME.version,
92
- },
93
- contentType: "application/json",
94
- queryParameters: _queryParams,
95
- requestType: "json",
96
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
97
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
98
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
99
- });
100
- if (_response.ok) {
101
- return serializers.ProfilesResponse.parseOrThrow(_response.body, {
102
- unrecognizedObjectKeys: "passthrough",
103
- allowUnrecognizedUnionMembers: true,
104
- allowUnrecognizedEnumValues: true,
105
- skipValidation: true,
106
- breadcrumbsPrefix: ["response"],
107
- });
108
- }
109
- if (_response.error.reason === "status-code") {
110
- throw new errors.AirtopError({
111
- statusCode: _response.error.statusCode,
112
- body: _response.error.body,
113
- });
114
- }
115
- switch (_response.error.reason) {
116
- case "non-json":
117
- throw new errors.AirtopError({
118
- statusCode: _response.error.statusCode,
119
- body: _response.error.rawBody,
120
- });
121
- case "timeout":
122
- throw new errors.AirtopTimeoutError();
123
- case "unknown":
124
- throw new errors.AirtopError({
125
- message: _response.error.errorMessage,
126
- });
127
- }
128
- });
129
- }
130
50
  /**
131
51
  * Delete profiles matching by id
132
52
  *
@@ -164,8 +84,8 @@ class Profiles {
164
84
  Authorization: yield this._getAuthorizationHeader(),
165
85
  "X-Fern-Language": "JavaScript",
166
86
  "X-Fern-SDK-Name": "@airtop/sdk",
167
- "X-Fern-SDK-Version": "0.1.13",
168
- "User-Agent": "@airtop/sdk/0.1.13",
87
+ "X-Fern-SDK-Version": "0.1.14",
88
+ "User-Agent": "@airtop/sdk/0.1.14",
169
89
  "X-Fern-Runtime": core.RUNTIME.type,
170
90
  "X-Fern-Runtime-Version": core.RUNTIME.version,
171
91
  },
@@ -1,2 +1 @@
1
- export { type ProfilesGetRequest } from "./ProfilesGetRequest";
2
1
  export { type ProfilesDeleteRequest } from "./ProfilesDeleteRequest";
@@ -94,8 +94,8 @@ class Sessions {
94
94
  Authorization: yield this._getAuthorizationHeader(),
95
95
  "X-Fern-Language": "JavaScript",
96
96
  "X-Fern-SDK-Name": "@airtop/sdk",
97
- "X-Fern-SDK-Version": "0.1.13",
98
- "User-Agent": "@airtop/sdk/0.1.13",
97
+ "X-Fern-SDK-Version": "0.1.14",
98
+ "User-Agent": "@airtop/sdk/0.1.14",
99
99
  "X-Fern-Runtime": core.RUNTIME.type,
100
100
  "X-Fern-Runtime-Version": core.RUNTIME.version,
101
101
  },
@@ -180,8 +180,8 @@ class Sessions {
180
180
  Authorization: yield this._getAuthorizationHeader(),
181
181
  "X-Fern-Language": "JavaScript",
182
182
  "X-Fern-SDK-Name": "@airtop/sdk",
183
- "X-Fern-SDK-Version": "0.1.13",
184
- "User-Agent": "@airtop/sdk/0.1.13",
183
+ "X-Fern-SDK-Version": "0.1.14",
184
+ "User-Agent": "@airtop/sdk/0.1.14",
185
185
  "X-Fern-Runtime": core.RUNTIME.type,
186
186
  "X-Fern-Runtime-Version": core.RUNTIME.version,
187
187
  },
@@ -245,8 +245,8 @@ class Sessions {
245
245
  Authorization: yield this._getAuthorizationHeader(),
246
246
  "X-Fern-Language": "JavaScript",
247
247
  "X-Fern-SDK-Name": "@airtop/sdk",
248
- "X-Fern-SDK-Version": "0.1.13",
249
- "User-Agent": "@airtop/sdk/0.1.13",
248
+ "X-Fern-SDK-Version": "0.1.14",
249
+ "User-Agent": "@airtop/sdk/0.1.14",
250
250
  "X-Fern-Runtime": core.RUNTIME.type,
251
251
  "X-Fern-Runtime-Version": core.RUNTIME.version,
252
252
  },
@@ -332,8 +332,8 @@ class Sessions {
332
332
  Authorization: yield this._getAuthorizationHeader(),
333
333
  "X-Fern-Language": "JavaScript",
334
334
  "X-Fern-SDK-Name": "@airtop/sdk",
335
- "X-Fern-SDK-Version": "0.1.13",
336
- "User-Agent": "@airtop/sdk/0.1.13",
335
+ "X-Fern-SDK-Version": "0.1.14",
336
+ "User-Agent": "@airtop/sdk/0.1.14",
337
337
  "X-Fern-Runtime": core.RUNTIME.type,
338
338
  "X-Fern-Runtime-Version": core.RUNTIME.version,
339
339
  },
@@ -388,8 +388,8 @@ class Sessions {
388
388
  Authorization: yield this._getAuthorizationHeader(),
389
389
  "X-Fern-Language": "JavaScript",
390
390
  "X-Fern-SDK-Name": "@airtop/sdk",
391
- "X-Fern-SDK-Version": "0.1.13",
392
- "User-Agent": "@airtop/sdk/0.1.13",
391
+ "X-Fern-SDK-Version": "0.1.14",
392
+ "User-Agent": "@airtop/sdk/0.1.14",
393
393
  "X-Fern-Runtime": core.RUNTIME.type,
394
394
  "X-Fern-Runtime-Version": core.RUNTIME.version,
395
395
  },
@@ -486,8 +486,8 @@ class Sessions {
486
486
  Authorization: yield this._getAuthorizationHeader(),
487
487
  "X-Fern-Language": "JavaScript",
488
488
  "X-Fern-SDK-Name": "@airtop/sdk",
489
- "X-Fern-SDK-Version": "0.1.13",
490
- "User-Agent": "@airtop/sdk/0.1.13",
489
+ "X-Fern-SDK-Version": "0.1.14",
490
+ "User-Agent": "@airtop/sdk/0.1.14",
491
491
  "X-Fern-Runtime": core.RUNTIME.type,
492
492
  "X-Fern-Runtime-Version": core.RUNTIME.version,
493
493
  },
@@ -5,8 +5,11 @@ import * as Airtop from "../../../index";
5
5
  /**
6
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
7
  */
8
- export declare type SessionsEventsResponse = Airtop.SessionsEventsResponse.Status | Airtop.SessionsEventsResponse.Error_ | Airtop.SessionsEventsResponse.WindowEvent | Airtop.SessionsEventsResponse.SessionEvent;
8
+ export declare type SessionsEventsResponse = Airtop.SessionsEventsResponse.SessionEvent | Airtop.SessionsEventsResponse.Status | Airtop.SessionsEventsResponse.Error_ | Airtop.SessionsEventsResponse.WindowEvent;
9
9
  export declare namespace SessionsEventsResponse {
10
+ interface SessionEvent extends Airtop.SessionsEventsResponseSessionEvent {
11
+ event: "sessionEvent";
12
+ }
10
13
  interface Status extends Airtop.SessionsEventsResponseStatus {
11
14
  event: "status";
12
15
  }
@@ -16,7 +19,4 @@ export declare namespace SessionsEventsResponse {
16
19
  interface WindowEvent extends Airtop.SessionsEventsResponseWindowEvent {
17
20
  event: "windowEvent";
18
21
  }
19
- interface SessionEvent extends Airtop.SessionsEventsResponseSessionEvent {
20
- event: "sessionEvent";
21
- }
22
22
  }
@@ -1,6 +1,6 @@
1
1
  export * from "./SessionsListRequestStatus";
2
+ export * from "./SessionsEventsResponseSessionEvent";
2
3
  export * from "./SessionsEventsResponseStatus";
3
4
  export * from "./SessionsEventsResponseError";
4
5
  export * from "./SessionsEventsResponseWindowEvent";
5
- export * from "./SessionsEventsResponseSessionEvent";
6
6
  export * from "./SessionsEventsResponse";
@@ -15,8 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./SessionsListRequestStatus"), exports);
18
+ __exportStar(require("./SessionsEventsResponseSessionEvent"), exports);
18
19
  __exportStar(require("./SessionsEventsResponseStatus"), exports);
19
20
  __exportStar(require("./SessionsEventsResponseError"), exports);
20
21
  __exportStar(require("./SessionsEventsResponseWindowEvent"), exports);
21
- __exportStar(require("./SessionsEventsResponseSessionEvent"), exports);
22
22
  __exportStar(require("./SessionsEventsResponse"), exports);
@@ -23,6 +23,8 @@ export declare class Windows {
23
23
  protected readonly _options: Windows.Options;
24
24
  constructor(_options: Windows.Options);
25
25
  /**
26
+ * Creates a new browser window in a session. Optionally, you can specify a url to load on the window upon creation.
27
+ *
26
28
  * @param {string} sessionId - ID of the session that owns the window.
27
29
  * @param {Airtop.CreateWindowInputV1Body} request
28
30
  * @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
@@ -32,6 +34,8 @@ export declare class Windows {
32
34
  */
33
35
  create(sessionId: string, request?: Airtop.CreateWindowInputV1Body, requestOptions?: Windows.RequestOptions): Promise<Airtop.WindowIdResponse>;
34
36
  /**
37
+ * Get information about a browser window in a session, including the live view url.
38
+ *
35
39
  * @param {string} sessionId - ID of the session that owns the window.
36
40
  * @param {string} windowId - ID of the browser window, which can either be a normal AirTop windowId or a [CDP TargetId](https://chromedevtools.github.io/devtools-protocol/tot/Target/#type-TargetID) from a browser automation library like Puppeteer (typically associated with the page or main frame). Our SDKs will handle retrieving a TargetId for you from various popular browser automation libraries, but we also have details in our guides on how to do it manually.
37
41
  * @param {Airtop.GetWindowInfoRequest} request
@@ -44,6 +48,8 @@ export declare class Windows {
44
48
  */
45
49
  getWindowInfo(sessionId: string, windowId: string, request?: Airtop.GetWindowInfoRequest, requestOptions?: Windows.RequestOptions): Promise<Airtop.WindowResponse>;
46
50
  /**
51
+ * Loads a specified url on a given window
52
+ *
47
53
  * @param {string} sessionId - ID of the session that owns the window.
48
54
  * @param {string} windowId - Airtop window ID of the browser window.
49
55
  * @param {Airtop.WindowLoadUrlV1Body} request
@@ -56,6 +62,8 @@ export declare class Windows {
56
62
  */
57
63
  loadUrl(sessionId: string, windowId: string, request: Airtop.WindowLoadUrlV1Body, requestOptions?: Windows.RequestOptions): Promise<Airtop.OperationOutcomeResponse>;
58
64
  /**
65
+ * Closes a browser window in a session
66
+ *
59
67
  * @param {string} sessionId - ID of the session that owns the window.
60
68
  * @param {string} windowId - Airtop window ID of the browser window.
61
69
  * @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
@@ -65,6 +73,8 @@ export declare class Windows {
65
73
  */
66
74
  close(sessionId: string, windowId: string, requestOptions?: Windows.RequestOptions): Promise<Airtop.WindowIdResponse>;
67
75
  /**
76
+ * Execute a click interaction in a specific browser window
77
+ *
68
78
  * @param {string} sessionId - The session id for the window.
69
79
  * @param {string} windowId - The Airtop window id of the browser window.
70
80
  * @param {Airtop.SessionClickHandlerRequestBody} request
@@ -77,6 +87,8 @@ export declare class Windows {
77
87
  */
78
88
  click(sessionId: string, windowId: string, request: Airtop.SessionClickHandlerRequestBody, requestOptions?: Windows.RequestOptions): Promise<Airtop.AiPromptResponse>;
79
89
  /**
90
+ * Execute a hover interaction in a specific browser window
91
+ *
80
92
  * @param {string} sessionId - The session id for the window.
81
93
  * @param {string} windowId - The Airtop window id of the browser window.
82
94
  * @param {Airtop.SessionHoverHandlerRequestBody} request
@@ -87,6 +99,8 @@ export declare class Windows {
87
99
  */
88
100
  hover(sessionId: string, windowId: string, request?: Airtop.SessionHoverHandlerRequestBody, requestOptions?: Windows.RequestOptions): Promise<Airtop.AiPromptResponse>;
89
101
  /**
102
+ * Submit a prompt that queries the content of a specific browser window. You may extract content from the page, or ask a question about the page and allow the AI to answer it (ex. Is the user logged in?).
103
+ *
90
104
  * @param {string} sessionId - The session id for the window.
91
105
  * @param {string} windowId - The Airtop window id of the browser window.
92
106
  * @param {Airtop.SessionPageQueryHandlerRequestBody} request
@@ -99,6 +113,8 @@ export declare class Windows {
99
113
  */
100
114
  pageQuery(sessionId: string, windowId: string, request: Airtop.SessionPageQueryHandlerRequestBody, requestOptions?: Windows.RequestOptions): Promise<Airtop.AiPromptResponse>;
101
115
  /**
116
+ * Submit a prompt that queries the content of a specific browser window and paginates through pages to return a list of results.
117
+ *
102
118
  * @param {string} sessionId - The session id for the window.
103
119
  * @param {string} windowId - The Airtop window id of the browser window.
104
120
  * @param {Airtop.SessionPaginatedExtractionHandlerRequestBody} request
@@ -123,6 +139,8 @@ export declare class Windows {
123
139
  */
124
140
  promptContent(sessionId: string, windowId: string, request: Airtop.SessionPageQueryHandlerRequestBody, requestOptions?: Windows.RequestOptions): Promise<Airtop.AiPromptResponse>;
125
141
  /**
142
+ * Scrape a window and return the content as markdown
143
+ *
126
144
  * @param {string} sessionId - The session id for the window.
127
145
  * @param {string} windowId - The Airtop window id of the browser window to scrape.
128
146
  * @param {Airtop.ScrapeContentRequest} request
@@ -132,6 +150,18 @@ export declare class Windows {
132
150
  * await client.windows.scrapeContent("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
133
151
  */
134
152
  scrapeContent(sessionId: string, windowId: string, request?: Airtop.ScrapeContentRequest, requestOptions?: Windows.RequestOptions): Promise<Airtop.ScrapeResponse>;
153
+ /**
154
+ * Take a screenshot of a browser window
155
+ *
156
+ * @param {string} sessionId - The session id for the window.
157
+ * @param {string} windowId - The Airtop window id of the browser window.
158
+ * @param {Airtop.SessionScreenshotHandlerRequestBody} request
159
+ * @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
160
+ *
161
+ * @example
162
+ * await client.windows.screenshot("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
163
+ */
164
+ screenshot(sessionId: string, windowId: string, request?: Airtop.SessionScreenshotHandlerRequestBody, requestOptions?: Windows.RequestOptions): Promise<Airtop.AiPromptResponse>;
135
165
  /**
136
166
  * This endpoint is deprecated. Please use the `pageQuery` endpoint and ask for a summary in the prompt instead.
137
167
  *
@@ -145,6 +175,8 @@ export declare class Windows {
145
175
  */
146
176
  summarizeContent(sessionId: string, windowId: string, request?: Airtop.SessionSummaryHandlerRequestBody, requestOptions?: Windows.RequestOptions): Promise<Airtop.AiPromptResponse>;
147
177
  /**
178
+ * Execute a type interaction in a specific browser window
179
+ *
148
180
  * @param {string} sessionId - The session id for the window.
149
181
  * @param {string} windowId - The Airtop window id of the browser window.
150
182
  * @param {Airtop.SessionTypeHandlerRequestBody} request
@@ -49,6 +49,8 @@ class Windows {
49
49
  this._options = _options;
50
50
  }
51
51
  /**
52
+ * Creates a new browser window in a session. Optionally, you can specify a url to load on the window upon creation.
53
+ *
52
54
  * @param {string} sessionId - ID of the session that owns the window.
53
55
  * @param {Airtop.CreateWindowInputV1Body} request
54
56
  * @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
@@ -66,8 +68,8 @@ class Windows {
66
68
  Authorization: yield this._getAuthorizationHeader(),
67
69
  "X-Fern-Language": "JavaScript",
68
70
  "X-Fern-SDK-Name": "@airtop/sdk",
69
- "X-Fern-SDK-Version": "0.1.13",
70
- "User-Agent": "@airtop/sdk/0.1.13",
71
+ "X-Fern-SDK-Version": "0.1.14",
72
+ "User-Agent": "@airtop/sdk/0.1.14",
71
73
  "X-Fern-Runtime": core.RUNTIME.type,
72
74
  "X-Fern-Runtime-Version": core.RUNTIME.version,
73
75
  },
@@ -109,6 +111,8 @@ class Windows {
109
111
  });
110
112
  }
111
113
  /**
114
+ * Get information about a browser window in a session, including the live view url.
115
+ *
112
116
  * @param {string} sessionId - ID of the session that owns the window.
113
117
  * @param {string} windowId - ID of the browser window, which can either be a normal AirTop windowId or a [CDP TargetId](https://chromedevtools.github.io/devtools-protocol/tot/Target/#type-TargetID) from a browser automation library like Puppeteer (typically associated with the page or main frame). Our SDKs will handle retrieving a TargetId for you from various popular browser automation libraries, but we also have details in our guides on how to do it manually.
114
118
  * @param {Airtop.GetWindowInfoRequest} request
@@ -140,8 +144,8 @@ class Windows {
140
144
  Authorization: yield this._getAuthorizationHeader(),
141
145
  "X-Fern-Language": "JavaScript",
142
146
  "X-Fern-SDK-Name": "@airtop/sdk",
143
- "X-Fern-SDK-Version": "0.1.13",
144
- "User-Agent": "@airtop/sdk/0.1.13",
147
+ "X-Fern-SDK-Version": "0.1.14",
148
+ "User-Agent": "@airtop/sdk/0.1.14",
145
149
  "X-Fern-Runtime": core.RUNTIME.type,
146
150
  "X-Fern-Runtime-Version": core.RUNTIME.version,
147
151
  },
@@ -183,6 +187,8 @@ class Windows {
183
187
  });
184
188
  }
185
189
  /**
190
+ * Loads a specified url on a given window
191
+ *
186
192
  * @param {string} sessionId - ID of the session that owns the window.
187
193
  * @param {string} windowId - Airtop window ID of the browser window.
188
194
  * @param {Airtop.WindowLoadUrlV1Body} request
@@ -203,8 +209,8 @@ class Windows {
203
209
  Authorization: yield this._getAuthorizationHeader(),
204
210
  "X-Fern-Language": "JavaScript",
205
211
  "X-Fern-SDK-Name": "@airtop/sdk",
206
- "X-Fern-SDK-Version": "0.1.13",
207
- "User-Agent": "@airtop/sdk/0.1.13",
212
+ "X-Fern-SDK-Version": "0.1.14",
213
+ "User-Agent": "@airtop/sdk/0.1.14",
208
214
  "X-Fern-Runtime": core.RUNTIME.type,
209
215
  "X-Fern-Runtime-Version": core.RUNTIME.version,
210
216
  },
@@ -246,6 +252,8 @@ class Windows {
246
252
  });
247
253
  }
248
254
  /**
255
+ * Closes a browser window in a session
256
+ *
249
257
  * @param {string} sessionId - ID of the session that owns the window.
250
258
  * @param {string} windowId - Airtop window ID of the browser window.
251
259
  * @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
@@ -263,8 +271,8 @@ class Windows {
263
271
  Authorization: yield this._getAuthorizationHeader(),
264
272
  "X-Fern-Language": "JavaScript",
265
273
  "X-Fern-SDK-Name": "@airtop/sdk",
266
- "X-Fern-SDK-Version": "0.1.13",
267
- "User-Agent": "@airtop/sdk/0.1.13",
274
+ "X-Fern-SDK-Version": "0.1.14",
275
+ "User-Agent": "@airtop/sdk/0.1.14",
268
276
  "X-Fern-Runtime": core.RUNTIME.type,
269
277
  "X-Fern-Runtime-Version": core.RUNTIME.version,
270
278
  },
@@ -305,6 +313,8 @@ class Windows {
305
313
  });
306
314
  }
307
315
  /**
316
+ * Execute a click interaction in a specific browser window
317
+ *
308
318
  * @param {string} sessionId - The session id for the window.
309
319
  * @param {string} windowId - The Airtop window id of the browser window.
310
320
  * @param {Airtop.SessionClickHandlerRequestBody} request
@@ -325,8 +335,8 @@ class Windows {
325
335
  Authorization: yield this._getAuthorizationHeader(),
326
336
  "X-Fern-Language": "JavaScript",
327
337
  "X-Fern-SDK-Name": "@airtop/sdk",
328
- "X-Fern-SDK-Version": "0.1.13",
329
- "User-Agent": "@airtop/sdk/0.1.13",
338
+ "X-Fern-SDK-Version": "0.1.14",
339
+ "User-Agent": "@airtop/sdk/0.1.14",
330
340
  "X-Fern-Runtime": core.RUNTIME.type,
331
341
  "X-Fern-Runtime-Version": core.RUNTIME.version,
332
342
  },
@@ -368,6 +378,8 @@ class Windows {
368
378
  });
369
379
  }
370
380
  /**
381
+ * Execute a hover interaction in a specific browser window
382
+ *
371
383
  * @param {string} sessionId - The session id for the window.
372
384
  * @param {string} windowId - The Airtop window id of the browser window.
373
385
  * @param {Airtop.SessionHoverHandlerRequestBody} request
@@ -386,8 +398,8 @@ class Windows {
386
398
  Authorization: yield this._getAuthorizationHeader(),
387
399
  "X-Fern-Language": "JavaScript",
388
400
  "X-Fern-SDK-Name": "@airtop/sdk",
389
- "X-Fern-SDK-Version": "0.1.13",
390
- "User-Agent": "@airtop/sdk/0.1.13",
401
+ "X-Fern-SDK-Version": "0.1.14",
402
+ "User-Agent": "@airtop/sdk/0.1.14",
391
403
  "X-Fern-Runtime": core.RUNTIME.type,
392
404
  "X-Fern-Runtime-Version": core.RUNTIME.version,
393
405
  },
@@ -429,6 +441,8 @@ class Windows {
429
441
  });
430
442
  }
431
443
  /**
444
+ * Submit a prompt that queries the content of a specific browser window. You may extract content from the page, or ask a question about the page and allow the AI to answer it (ex. Is the user logged in?).
445
+ *
432
446
  * @param {string} sessionId - The session id for the window.
433
447
  * @param {string} windowId - The Airtop window id of the browser window.
434
448
  * @param {Airtop.SessionPageQueryHandlerRequestBody} request
@@ -449,8 +463,8 @@ class Windows {
449
463
  Authorization: yield this._getAuthorizationHeader(),
450
464
  "X-Fern-Language": "JavaScript",
451
465
  "X-Fern-SDK-Name": "@airtop/sdk",
452
- "X-Fern-SDK-Version": "0.1.13",
453
- "User-Agent": "@airtop/sdk/0.1.13",
466
+ "X-Fern-SDK-Version": "0.1.14",
467
+ "User-Agent": "@airtop/sdk/0.1.14",
454
468
  "X-Fern-Runtime": core.RUNTIME.type,
455
469
  "X-Fern-Runtime-Version": core.RUNTIME.version,
456
470
  },
@@ -494,6 +508,8 @@ class Windows {
494
508
  });
495
509
  }
496
510
  /**
511
+ * Submit a prompt that queries the content of a specific browser window and paginates through pages to return a list of results.
512
+ *
497
513
  * @param {string} sessionId - The session id for the window.
498
514
  * @param {string} windowId - The Airtop window id of the browser window.
499
515
  * @param {Airtop.SessionPaginatedExtractionHandlerRequestBody} request
@@ -512,8 +528,8 @@ class Windows {
512
528
  Authorization: yield this._getAuthorizationHeader(),
513
529
  "X-Fern-Language": "JavaScript",
514
530
  "X-Fern-SDK-Name": "@airtop/sdk",
515
- "X-Fern-SDK-Version": "0.1.13",
516
- "User-Agent": "@airtop/sdk/0.1.13",
531
+ "X-Fern-SDK-Version": "0.1.14",
532
+ "User-Agent": "@airtop/sdk/0.1.14",
517
533
  "X-Fern-Runtime": core.RUNTIME.type,
518
534
  "X-Fern-Runtime-Version": core.RUNTIME.version,
519
535
  },
@@ -579,8 +595,8 @@ class Windows {
579
595
  Authorization: yield this._getAuthorizationHeader(),
580
596
  "X-Fern-Language": "JavaScript",
581
597
  "X-Fern-SDK-Name": "@airtop/sdk",
582
- "X-Fern-SDK-Version": "0.1.13",
583
- "User-Agent": "@airtop/sdk/0.1.13",
598
+ "X-Fern-SDK-Version": "0.1.14",
599
+ "User-Agent": "@airtop/sdk/0.1.14",
584
600
  "X-Fern-Runtime": core.RUNTIME.type,
585
601
  "X-Fern-Runtime-Version": core.RUNTIME.version,
586
602
  },
@@ -624,6 +640,8 @@ class Windows {
624
640
  });
625
641
  }
626
642
  /**
643
+ * Scrape a window and return the content as markdown
644
+ *
627
645
  * @param {string} sessionId - The session id for the window.
628
646
  * @param {string} windowId - The Airtop window id of the browser window to scrape.
629
647
  * @param {Airtop.ScrapeContentRequest} request
@@ -642,8 +660,8 @@ class Windows {
642
660
  Authorization: yield this._getAuthorizationHeader(),
643
661
  "X-Fern-Language": "JavaScript",
644
662
  "X-Fern-SDK-Name": "@airtop/sdk",
645
- "X-Fern-SDK-Version": "0.1.13",
646
- "User-Agent": "@airtop/sdk/0.1.13",
663
+ "X-Fern-SDK-Version": "0.1.14",
664
+ "User-Agent": "@airtop/sdk/0.1.14",
647
665
  "X-Fern-Runtime": core.RUNTIME.type,
648
666
  "X-Fern-Runtime-Version": core.RUNTIME.version,
649
667
  },
@@ -684,6 +702,71 @@ class Windows {
684
702
  }
685
703
  });
686
704
  }
705
+ /**
706
+ * Take a screenshot of a browser window
707
+ *
708
+ * @param {string} sessionId - The session id for the window.
709
+ * @param {string} windowId - The Airtop window id of the browser window.
710
+ * @param {Airtop.SessionScreenshotHandlerRequestBody} request
711
+ * @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
712
+ *
713
+ * @example
714
+ * await client.windows.screenshot("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
715
+ */
716
+ screenshot(sessionId, windowId, request = {}, requestOptions) {
717
+ var _a, _b;
718
+ return __awaiter(this, void 0, void 0, function* () {
719
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
720
+ 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)}/screenshot`),
721
+ method: "POST",
722
+ headers: {
723
+ Authorization: yield this._getAuthorizationHeader(),
724
+ "X-Fern-Language": "JavaScript",
725
+ "X-Fern-SDK-Name": "@airtop/sdk",
726
+ "X-Fern-SDK-Version": "0.1.14",
727
+ "User-Agent": "@airtop/sdk/0.1.14",
728
+ "X-Fern-Runtime": core.RUNTIME.type,
729
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
730
+ },
731
+ contentType: "application/json",
732
+ requestType: "json",
733
+ body: serializers.SessionScreenshotHandlerRequestBody.jsonOrThrow(request, {
734
+ unrecognizedObjectKeys: "strip",
735
+ }),
736
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
737
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
738
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
739
+ });
740
+ if (_response.ok) {
741
+ return serializers.AiPromptResponse.parseOrThrow(_response.body, {
742
+ unrecognizedObjectKeys: "passthrough",
743
+ allowUnrecognizedUnionMembers: true,
744
+ allowUnrecognizedEnumValues: true,
745
+ skipValidation: true,
746
+ breadcrumbsPrefix: ["response"],
747
+ });
748
+ }
749
+ if (_response.error.reason === "status-code") {
750
+ throw new errors.AirtopError({
751
+ statusCode: _response.error.statusCode,
752
+ body: _response.error.body,
753
+ });
754
+ }
755
+ switch (_response.error.reason) {
756
+ case "non-json":
757
+ throw new errors.AirtopError({
758
+ statusCode: _response.error.statusCode,
759
+ body: _response.error.rawBody,
760
+ });
761
+ case "timeout":
762
+ throw new errors.AirtopTimeoutError();
763
+ case "unknown":
764
+ throw new errors.AirtopError({
765
+ message: _response.error.errorMessage,
766
+ });
767
+ }
768
+ });
769
+ }
687
770
  /**
688
771
  * This endpoint is deprecated. Please use the `pageQuery` endpoint and ask for a summary in the prompt instead.
689
772
  *
@@ -705,8 +788,8 @@ class Windows {
705
788
  Authorization: yield this._getAuthorizationHeader(),
706
789
  "X-Fern-Language": "JavaScript",
707
790
  "X-Fern-SDK-Name": "@airtop/sdk",
708
- "X-Fern-SDK-Version": "0.1.13",
709
- "User-Agent": "@airtop/sdk/0.1.13",
791
+ "X-Fern-SDK-Version": "0.1.14",
792
+ "User-Agent": "@airtop/sdk/0.1.14",
710
793
  "X-Fern-Runtime": core.RUNTIME.type,
711
794
  "X-Fern-Runtime-Version": core.RUNTIME.version,
712
795
  },
@@ -750,6 +833,8 @@ class Windows {
750
833
  });
751
834
  }
752
835
  /**
836
+ * Execute a type interaction in a specific browser window
837
+ *
753
838
  * @param {string} sessionId - The session id for the window.
754
839
  * @param {string} windowId - The Airtop window id of the browser window.
755
840
  * @param {Airtop.SessionTypeHandlerRequestBody} request
@@ -770,8 +855,8 @@ class Windows {
770
855
  Authorization: yield this._getAuthorizationHeader(),
771
856
  "X-Fern-Language": "JavaScript",
772
857
  "X-Fern-SDK-Name": "@airtop/sdk",
773
- "X-Fern-SDK-Version": "0.1.13",
774
- "User-Agent": "@airtop/sdk/0.1.13",
858
+ "X-Fern-SDK-Version": "0.1.14",
859
+ "User-Agent": "@airtop/sdk/0.1.14",
775
860
  "X-Fern-Runtime": core.RUNTIME.type,
776
861
  "X-Fern-Runtime-Version": core.RUNTIME.version,
777
862
  },
@@ -0,0 +1,21 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Airtop from "../../../../index";
5
+ /**
6
+ * @example
7
+ * {}
8
+ */
9
+ export interface SessionScreenshotHandlerRequestBody {
10
+ clientRequestId?: string;
11
+ /** Request configuration */
12
+ configuration?: Airtop.ScreenshotRequestConfig;
13
+ /** A credit threshold that, once exceeded, will cause the operation to be cancelled. Note that this is *not* a hard limit, but a threshold that is checked periodically during the course of fulfilling the request. A default threshold is used if not specified, but you can use this option to increase or decrease as needed. Set to 0 to disable this feature entirely (not recommended). */
14
+ costThresholdCredits?: number;
15
+ /**
16
+ * A time threshold in seconds that, once exceeded, will cause the operation to be cancelled. Note that this is *not* a hard limit, but a threshold that is checked periodically during the course of fulfilling the request. A default threshold is used if not specified, but you can use this option to increase or decrease as needed. Set to 0 to disable this feature entirely (not recommended).
17
+ *
18
+ * This setting does not extend the maximum session duration provided at the time of session creation.
19
+ */
20
+ timeThresholdSeconds?: number;
21
+ }