@airtop/sdk 0.1.8 → 0.1.11
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/resources/profiles/client/Client.js +4 -4
- package/api/resources/sessions/client/Client.d.ts +9 -0
- package/api/resources/sessions/client/Client.js +63 -10
- package/api/resources/windows/client/Client.d.ts +10 -0
- package/api/resources/windows/client/Client.js +85 -22
- package/api/resources/windows/client/requests/SessionPaginatedExtractionHandlerRequestBody.d.ts +23 -0
- package/api/resources/windows/client/requests/SessionPaginatedExtractionHandlerRequestBody.js +5 -0
- package/api/resources/windows/client/requests/index.d.ts +1 -0
- package/api/types/ExternalProfileV1.d.ts +1 -1
- package/api/types/PaginatedExtractionConfig.d.ts +11 -0
- package/api/types/PaginatedExtractionConfig.js +5 -0
- package/api/types/SessionConfigV1.d.ts +2 -0
- package/api/types/SessionConfigV1ProxyItem.d.ts +1 -1
- package/api/types/SessionPageQueryHandlerRequestBody.d.ts +2 -2
- package/api/types/StatusMessageStatus.d.ts +3 -1
- package/api/types/StatusMessageStatus.js +2 -0
- package/api/types/index.d.ts +1 -0
- package/api/types/index.js +1 -0
- package/dist/api/resources/profiles/client/Client.js +4 -4
- package/dist/api/resources/sessions/client/Client.d.ts +9 -0
- package/dist/api/resources/sessions/client/Client.js +63 -10
- package/dist/api/resources/windows/client/Client.d.ts +10 -0
- package/dist/api/resources/windows/client/Client.js +85 -22
- package/dist/api/resources/windows/client/requests/SessionPaginatedExtractionHandlerRequestBody.d.ts +23 -0
- package/dist/api/resources/windows/client/requests/SessionPaginatedExtractionHandlerRequestBody.js +5 -0
- package/dist/api/resources/windows/client/requests/index.d.ts +1 -0
- package/dist/api/types/ExternalProfileV1.d.ts +1 -1
- package/dist/api/types/PaginatedExtractionConfig.d.ts +11 -0
- package/dist/api/types/PaginatedExtractionConfig.js +5 -0
- package/dist/api/types/SessionConfigV1.d.ts +2 -0
- package/dist/api/types/SessionConfigV1ProxyItem.d.ts +1 -1
- package/dist/api/types/SessionPageQueryHandlerRequestBody.d.ts +2 -2
- package/dist/api/types/StatusMessageStatus.d.ts +3 -1
- package/dist/api/types/StatusMessageStatus.js +2 -0
- package/dist/api/types/index.d.ts +1 -0
- package/dist/api/types/index.js +1 -0
- package/dist/serialization/resources/windows/client/requests/SessionPaginatedExtractionHandlerRequestBody.d.ts +17 -0
- package/dist/serialization/resources/windows/client/requests/SessionPaginatedExtractionHandlerRequestBody.js +38 -0
- package/dist/serialization/resources/windows/client/requests/index.d.ts +1 -0
- package/dist/serialization/resources/windows/client/requests/index.js +3 -1
- package/dist/serialization/types/PaginatedExtractionConfig.d.ts +14 -0
- package/dist/serialization/types/PaginatedExtractionConfig.js +35 -0
- package/dist/serialization/types/SessionConfigV1.d.ts +1 -0
- package/dist/serialization/types/SessionConfigV1.js +1 -0
- package/dist/serialization/types/StatusMessageStatus.d.ts +1 -1
- package/dist/serialization/types/StatusMessageStatus.js +1 -1
- package/dist/serialization/types/index.d.ts +1 -0
- package/dist/serialization/types/index.js +1 -0
- package/dist/utils/batch-operate/SessionQueue.d.ts +2 -3
- package/dist/utils/batch-operate/WindowQueue.d.ts +2 -3
- package/dist/utils/batch-operate/batch-util.d.ts +1 -1
- package/dist/utils/batch-operate/batch-util.js +2 -4
- package/dist/utils/batch-operate/types.d.ts +1 -1
- package/dist/wrapper/AirtopClient.d.ts +2 -0
- package/dist/wrapper/AirtopClient.js +36 -0
- package/package.json +3 -2
- package/reference.md +75 -15
- package/serialization/resources/windows/client/requests/SessionPaginatedExtractionHandlerRequestBody.d.ts +17 -0
- package/serialization/resources/windows/client/requests/SessionPaginatedExtractionHandlerRequestBody.js +38 -0
- package/serialization/resources/windows/client/requests/index.d.ts +1 -0
- package/serialization/resources/windows/client/requests/index.js +3 -1
- package/serialization/types/PaginatedExtractionConfig.d.ts +14 -0
- package/serialization/types/PaginatedExtractionConfig.js +35 -0
- package/serialization/types/SessionConfigV1.d.ts +1 -0
- package/serialization/types/SessionConfigV1.js +1 -0
- package/serialization/types/StatusMessageStatus.d.ts +1 -1
- package/serialization/types/StatusMessageStatus.js +1 -1
- package/serialization/types/index.d.ts +1 -0
- package/serialization/types/index.js +1 -0
- package/utils/batch-operate/SessionQueue.d.ts +2 -3
- package/utils/batch-operate/WindowQueue.d.ts +2 -3
- package/utils/batch-operate/batch-util.d.ts +1 -1
- package/utils/batch-operate/batch-util.js +2 -4
- package/utils/batch-operate/types.d.ts +1 -1
- package/wrapper/AirtopClient.d.ts +2 -0
- package/wrapper/AirtopClient.js +36 -0
@@ -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.1.
|
81
|
-
"User-Agent": "@airtop/sdk/0.1.
|
80
|
+
"X-Fern-SDK-Version": "0.1.11",
|
81
|
+
"User-Agent": "@airtop/sdk/0.1.11",
|
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.1.
|
152
|
-
"User-Agent": "@airtop/sdk/0.1.
|
151
|
+
"X-Fern-SDK-Version": "0.1.11",
|
152
|
+
"User-Agent": "@airtop/sdk/0.1.11",
|
153
153
|
"X-Fern-Runtime": core.RUNTIME.type,
|
154
154
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
155
155
|
},
|
@@ -75,5 +75,14 @@ export declare class Sessions {
|
|
75
75
|
* Get a session event stream for a given session ID
|
76
76
|
*/
|
77
77
|
events(id: string, requestOptions?: Sessions.RequestOptions): Promise<core.Stream<Airtop.SessionsEventsResponse>>;
|
78
|
+
/**
|
79
|
+
* @param {string} sessionId - ID of the session that owns the window.
|
80
|
+
* @param {string} profileName - Name under which to save the profile.
|
81
|
+
* @param {Sessions.RequestOptions} requestOptions - Request-specific configuration.
|
82
|
+
*
|
83
|
+
* @example
|
84
|
+
* await client.sessions.saveProfileOnTermination("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "myProfile")
|
85
|
+
*/
|
86
|
+
saveProfileOnTermination(sessionId: string, profileName: string, requestOptions?: Sessions.RequestOptions): Promise<void>;
|
78
87
|
protected _getAuthorizationHeader(): Promise<string>;
|
79
88
|
}
|
@@ -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.
|
98
|
-
"User-Agent": "@airtop/sdk/0.1.
|
97
|
+
"X-Fern-SDK-Version": "0.1.11",
|
98
|
+
"User-Agent": "@airtop/sdk/0.1.11",
|
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.
|
184
|
-
"User-Agent": "@airtop/sdk/0.1.
|
183
|
+
"X-Fern-SDK-Version": "0.1.11",
|
184
|
+
"User-Agent": "@airtop/sdk/0.1.11",
|
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.
|
249
|
-
"User-Agent": "@airtop/sdk/0.1.
|
248
|
+
"X-Fern-SDK-Version": "0.1.11",
|
249
|
+
"User-Agent": "@airtop/sdk/0.1.11",
|
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.
|
336
|
-
"User-Agent": "@airtop/sdk/0.1.
|
335
|
+
"X-Fern-SDK-Version": "0.1.11",
|
336
|
+
"User-Agent": "@airtop/sdk/0.1.11",
|
337
337
|
"X-Fern-Runtime": core.RUNTIME.type,
|
338
338
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
339
339
|
},
|
@@ -380,8 +380,8 @@ class Sessions {
|
|
380
380
|
Authorization: yield this._getAuthorizationHeader(),
|
381
381
|
"X-Fern-Language": "JavaScript",
|
382
382
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
383
|
-
"X-Fern-SDK-Version": "0.1.
|
384
|
-
"User-Agent": "@airtop/sdk/0.1.
|
383
|
+
"X-Fern-SDK-Version": "0.1.11",
|
384
|
+
"User-Agent": "@airtop/sdk/0.1.11",
|
385
385
|
"X-Fern-Runtime": core.RUNTIME.type,
|
386
386
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
387
387
|
},
|
@@ -459,6 +459,59 @@ class Sessions {
|
|
459
459
|
}
|
460
460
|
});
|
461
461
|
}
|
462
|
+
/**
|
463
|
+
* @param {string} sessionId - ID of the session that owns the window.
|
464
|
+
* @param {string} profileName - Name under which to save the profile.
|
465
|
+
* @param {Sessions.RequestOptions} requestOptions - Request-specific configuration.
|
466
|
+
*
|
467
|
+
* @example
|
468
|
+
* await client.sessions.saveProfileOnTermination("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "myProfile")
|
469
|
+
*/
|
470
|
+
saveProfileOnTermination(sessionId, profileName, requestOptions) {
|
471
|
+
var _a, _b;
|
472
|
+
return __awaiter(this, void 0, void 0, function* () {
|
473
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
474
|
+
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)}/save-profile-on-termination/${encodeURIComponent(profileName)}`),
|
475
|
+
method: "PUT",
|
476
|
+
headers: {
|
477
|
+
Authorization: yield this._getAuthorizationHeader(),
|
478
|
+
"X-Fern-Language": "JavaScript",
|
479
|
+
"X-Fern-SDK-Name": "@airtop/sdk",
|
480
|
+
"X-Fern-SDK-Version": "0.1.11",
|
481
|
+
"User-Agent": "@airtop/sdk/0.1.11",
|
482
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
483
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
484
|
+
},
|
485
|
+
contentType: "application/json",
|
486
|
+
requestType: "json",
|
487
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
488
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
489
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
490
|
+
});
|
491
|
+
if (_response.ok) {
|
492
|
+
return;
|
493
|
+
}
|
494
|
+
if (_response.error.reason === "status-code") {
|
495
|
+
throw new errors.AirtopError({
|
496
|
+
statusCode: _response.error.statusCode,
|
497
|
+
body: _response.error.body,
|
498
|
+
});
|
499
|
+
}
|
500
|
+
switch (_response.error.reason) {
|
501
|
+
case "non-json":
|
502
|
+
throw new errors.AirtopError({
|
503
|
+
statusCode: _response.error.statusCode,
|
504
|
+
body: _response.error.rawBody,
|
505
|
+
});
|
506
|
+
case "timeout":
|
507
|
+
throw new errors.AirtopTimeoutError();
|
508
|
+
case "unknown":
|
509
|
+
throw new errors.AirtopError({
|
510
|
+
message: _response.error.errorMessage,
|
511
|
+
});
|
512
|
+
}
|
513
|
+
});
|
514
|
+
}
|
462
515
|
_getAuthorizationHeader() {
|
463
516
|
return __awaiter(this, void 0, void 0, function* () {
|
464
517
|
return `Bearer ${yield core.Supplier.get(this._options.apiKey)}`;
|
@@ -98,6 +98,16 @@ export declare class Windows {
|
|
98
98
|
* })
|
99
99
|
*/
|
100
100
|
pageQuery(sessionId: string, windowId: string, request: Airtop.SessionPageQueryHandlerRequestBody, requestOptions?: Windows.RequestOptions): Promise<Airtop.AiPromptResponse>;
|
101
|
+
/**
|
102
|
+
* @param {string} sessionId - The session id for the window.
|
103
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
104
|
+
* @param {Airtop.SessionPaginatedExtractionHandlerRequestBody} request
|
105
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
106
|
+
*
|
107
|
+
* @example
|
108
|
+
* await client.windows.paginatedExtraction("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
109
|
+
*/
|
110
|
+
paginatedExtraction(sessionId: string, windowId: string, request?: Airtop.SessionPaginatedExtractionHandlerRequestBody, requestOptions?: Windows.RequestOptions): Promise<Airtop.AiPromptResponse>;
|
101
111
|
/**
|
102
112
|
* This endpoint is deprecated. Please use the `pageQuery` endpoint instead.
|
103
113
|
*
|
@@ -66,8 +66,8 @@ class Windows {
|
|
66
66
|
Authorization: yield this._getAuthorizationHeader(),
|
67
67
|
"X-Fern-Language": "JavaScript",
|
68
68
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
69
|
-
"X-Fern-SDK-Version": "0.1.
|
70
|
-
"User-Agent": "@airtop/sdk/0.1.
|
69
|
+
"X-Fern-SDK-Version": "0.1.11",
|
70
|
+
"User-Agent": "@airtop/sdk/0.1.11",
|
71
71
|
"X-Fern-Runtime": core.RUNTIME.type,
|
72
72
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
73
73
|
},
|
@@ -140,8 +140,8 @@ class Windows {
|
|
140
140
|
Authorization: yield this._getAuthorizationHeader(),
|
141
141
|
"X-Fern-Language": "JavaScript",
|
142
142
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
143
|
-
"X-Fern-SDK-Version": "0.1.
|
144
|
-
"User-Agent": "@airtop/sdk/0.1.
|
143
|
+
"X-Fern-SDK-Version": "0.1.11",
|
144
|
+
"User-Agent": "@airtop/sdk/0.1.11",
|
145
145
|
"X-Fern-Runtime": core.RUNTIME.type,
|
146
146
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
147
147
|
},
|
@@ -203,8 +203,8 @@ class Windows {
|
|
203
203
|
Authorization: yield this._getAuthorizationHeader(),
|
204
204
|
"X-Fern-Language": "JavaScript",
|
205
205
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
206
|
-
"X-Fern-SDK-Version": "0.1.
|
207
|
-
"User-Agent": "@airtop/sdk/0.1.
|
206
|
+
"X-Fern-SDK-Version": "0.1.11",
|
207
|
+
"User-Agent": "@airtop/sdk/0.1.11",
|
208
208
|
"X-Fern-Runtime": core.RUNTIME.type,
|
209
209
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
210
210
|
},
|
@@ -263,8 +263,8 @@ class Windows {
|
|
263
263
|
Authorization: yield this._getAuthorizationHeader(),
|
264
264
|
"X-Fern-Language": "JavaScript",
|
265
265
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
266
|
-
"X-Fern-SDK-Version": "0.1.
|
267
|
-
"User-Agent": "@airtop/sdk/0.1.
|
266
|
+
"X-Fern-SDK-Version": "0.1.11",
|
267
|
+
"User-Agent": "@airtop/sdk/0.1.11",
|
268
268
|
"X-Fern-Runtime": core.RUNTIME.type,
|
269
269
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
270
270
|
},
|
@@ -325,8 +325,8 @@ class Windows {
|
|
325
325
|
Authorization: yield this._getAuthorizationHeader(),
|
326
326
|
"X-Fern-Language": "JavaScript",
|
327
327
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
328
|
-
"X-Fern-SDK-Version": "0.1.
|
329
|
-
"User-Agent": "@airtop/sdk/0.1.
|
328
|
+
"X-Fern-SDK-Version": "0.1.11",
|
329
|
+
"User-Agent": "@airtop/sdk/0.1.11",
|
330
330
|
"X-Fern-Runtime": core.RUNTIME.type,
|
331
331
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
332
332
|
},
|
@@ -386,8 +386,8 @@ class Windows {
|
|
386
386
|
Authorization: yield this._getAuthorizationHeader(),
|
387
387
|
"X-Fern-Language": "JavaScript",
|
388
388
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
389
|
-
"X-Fern-SDK-Version": "0.1.
|
390
|
-
"User-Agent": "@airtop/sdk/0.1.
|
389
|
+
"X-Fern-SDK-Version": "0.1.11",
|
390
|
+
"User-Agent": "@airtop/sdk/0.1.11",
|
391
391
|
"X-Fern-Runtime": core.RUNTIME.type,
|
392
392
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
393
393
|
},
|
@@ -449,8 +449,8 @@ class Windows {
|
|
449
449
|
Authorization: yield this._getAuthorizationHeader(),
|
450
450
|
"X-Fern-Language": "JavaScript",
|
451
451
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
452
|
-
"X-Fern-SDK-Version": "0.1.
|
453
|
-
"User-Agent": "@airtop/sdk/0.1.
|
452
|
+
"X-Fern-SDK-Version": "0.1.11",
|
453
|
+
"User-Agent": "@airtop/sdk/0.1.11",
|
454
454
|
"X-Fern-Runtime": core.RUNTIME.type,
|
455
455
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
456
456
|
},
|
@@ -493,6 +493,69 @@ class Windows {
|
|
493
493
|
}
|
494
494
|
});
|
495
495
|
}
|
496
|
+
/**
|
497
|
+
* @param {string} sessionId - The session id for the window.
|
498
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
499
|
+
* @param {Airtop.SessionPaginatedExtractionHandlerRequestBody} request
|
500
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
501
|
+
*
|
502
|
+
* @example
|
503
|
+
* await client.windows.paginatedExtraction("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
504
|
+
*/
|
505
|
+
paginatedExtraction(sessionId, windowId, request = {}, requestOptions) {
|
506
|
+
var _a, _b;
|
507
|
+
return __awaiter(this, void 0, void 0, function* () {
|
508
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
509
|
+
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)}/paginated-extraction`),
|
510
|
+
method: "POST",
|
511
|
+
headers: {
|
512
|
+
Authorization: yield this._getAuthorizationHeader(),
|
513
|
+
"X-Fern-Language": "JavaScript",
|
514
|
+
"X-Fern-SDK-Name": "@airtop/sdk",
|
515
|
+
"X-Fern-SDK-Version": "0.1.11",
|
516
|
+
"User-Agent": "@airtop/sdk/0.1.11",
|
517
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
518
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
519
|
+
},
|
520
|
+
contentType: "application/json",
|
521
|
+
requestType: "json",
|
522
|
+
body: serializers.SessionPaginatedExtractionHandlerRequestBody.jsonOrThrow(request, {
|
523
|
+
unrecognizedObjectKeys: "strip",
|
524
|
+
}),
|
525
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
526
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
527
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
528
|
+
});
|
529
|
+
if (_response.ok) {
|
530
|
+
return serializers.AiPromptResponse.parseOrThrow(_response.body, {
|
531
|
+
unrecognizedObjectKeys: "passthrough",
|
532
|
+
allowUnrecognizedUnionMembers: true,
|
533
|
+
allowUnrecognizedEnumValues: true,
|
534
|
+
skipValidation: true,
|
535
|
+
breadcrumbsPrefix: ["response"],
|
536
|
+
});
|
537
|
+
}
|
538
|
+
if (_response.error.reason === "status-code") {
|
539
|
+
throw new errors.AirtopError({
|
540
|
+
statusCode: _response.error.statusCode,
|
541
|
+
body: _response.error.body,
|
542
|
+
});
|
543
|
+
}
|
544
|
+
switch (_response.error.reason) {
|
545
|
+
case "non-json":
|
546
|
+
throw new errors.AirtopError({
|
547
|
+
statusCode: _response.error.statusCode,
|
548
|
+
body: _response.error.rawBody,
|
549
|
+
});
|
550
|
+
case "timeout":
|
551
|
+
throw new errors.AirtopTimeoutError();
|
552
|
+
case "unknown":
|
553
|
+
throw new errors.AirtopError({
|
554
|
+
message: _response.error.errorMessage,
|
555
|
+
});
|
556
|
+
}
|
557
|
+
});
|
558
|
+
}
|
496
559
|
/**
|
497
560
|
* This endpoint is deprecated. Please use the `pageQuery` endpoint instead.
|
498
561
|
*
|
@@ -516,8 +579,8 @@ class Windows {
|
|
516
579
|
Authorization: yield this._getAuthorizationHeader(),
|
517
580
|
"X-Fern-Language": "JavaScript",
|
518
581
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
519
|
-
"X-Fern-SDK-Version": "0.1.
|
520
|
-
"User-Agent": "@airtop/sdk/0.1.
|
582
|
+
"X-Fern-SDK-Version": "0.1.11",
|
583
|
+
"User-Agent": "@airtop/sdk/0.1.11",
|
521
584
|
"X-Fern-Runtime": core.RUNTIME.type,
|
522
585
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
523
586
|
},
|
@@ -579,8 +642,8 @@ class Windows {
|
|
579
642
|
Authorization: yield this._getAuthorizationHeader(),
|
580
643
|
"X-Fern-Language": "JavaScript",
|
581
644
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
582
|
-
"X-Fern-SDK-Version": "0.1.
|
583
|
-
"User-Agent": "@airtop/sdk/0.1.
|
645
|
+
"X-Fern-SDK-Version": "0.1.11",
|
646
|
+
"User-Agent": "@airtop/sdk/0.1.11",
|
584
647
|
"X-Fern-Runtime": core.RUNTIME.type,
|
585
648
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
586
649
|
},
|
@@ -642,8 +705,8 @@ class Windows {
|
|
642
705
|
Authorization: yield this._getAuthorizationHeader(),
|
643
706
|
"X-Fern-Language": "JavaScript",
|
644
707
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
645
|
-
"X-Fern-SDK-Version": "0.1.
|
646
|
-
"User-Agent": "@airtop/sdk/0.1.
|
708
|
+
"X-Fern-SDK-Version": "0.1.11",
|
709
|
+
"User-Agent": "@airtop/sdk/0.1.11",
|
647
710
|
"X-Fern-Runtime": core.RUNTIME.type,
|
648
711
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
649
712
|
},
|
@@ -707,8 +770,8 @@ class Windows {
|
|
707
770
|
Authorization: yield this._getAuthorizationHeader(),
|
708
771
|
"X-Fern-Language": "JavaScript",
|
709
772
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
710
|
-
"X-Fern-SDK-Version": "0.1.
|
711
|
-
"User-Agent": "@airtop/sdk/0.1.
|
773
|
+
"X-Fern-SDK-Version": "0.1.11",
|
774
|
+
"User-Agent": "@airtop/sdk/0.1.11",
|
712
775
|
"X-Fern-Runtime": core.RUNTIME.type,
|
713
776
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
714
777
|
},
|
package/api/resources/windows/client/requests/SessionPaginatedExtractionHandlerRequestBody.d.ts
ADDED
@@ -0,0 +1,23 @@
|
|
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 SessionPaginatedExtractionHandlerRequestBody {
|
10
|
+
clientRequestId?: string;
|
11
|
+
/** Request configuration */
|
12
|
+
configuration?: Airtop.PaginatedExtractionConfig;
|
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
|
+
/** A prompt providing the Airtop AI model with additional direction or constraints about the page and the details you want to extract from the page. */
|
16
|
+
prompt?: string;
|
17
|
+
/**
|
18
|
+
* 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).
|
19
|
+
*
|
20
|
+
* This setting does not extend the maximum session duration provided at the time of session creation.
|
21
|
+
*/
|
22
|
+
timeThresholdSeconds?: number;
|
23
|
+
}
|
@@ -3,6 +3,7 @@ export { type GetWindowInfoRequest } from "./GetWindowInfoRequest";
|
|
3
3
|
export { type WindowLoadUrlV1Body } from "./WindowLoadUrlV1Body";
|
4
4
|
export { type SessionClickHandlerRequestBody } from "./SessionClickHandlerRequestBody";
|
5
5
|
export { type SessionHoverHandlerRequestBody } from "./SessionHoverHandlerRequestBody";
|
6
|
+
export { type SessionPaginatedExtractionHandlerRequestBody } from "./SessionPaginatedExtractionHandlerRequestBody";
|
6
7
|
export { type ScrapeContentRequest } from "./ScrapeContentRequest";
|
7
8
|
export { type SessionSummaryHandlerRequestBody } from "./SessionSummaryHandlerRequestBody";
|
8
9
|
export { type SessionTypeHandlerRequestBody } from "./SessionTypeHandlerRequestBody";
|
@@ -0,0 +1,11 @@
|
|
1
|
+
/**
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
3
|
+
*/
|
4
|
+
export interface PaginatedExtractionConfig {
|
5
|
+
/** The mode to use for interaction. If set to 'auto', Airtop AI will automatically choose the most cost-effective interaction mode. If set to 'accurate', Airtop AI will use the most accurate interaction mode. If set to 'cost-efficient', Airtop AI will use the most cost-effective interaction mode. */
|
6
|
+
interactionMode?: string;
|
7
|
+
/** JSON schema defining the structure of the output. If not provided, the format of the output might vary. */
|
8
|
+
outputSchema?: string;
|
9
|
+
/** The mode to use for pagination. If set to 'auto', Airtop AI will automatically look for pagination links first and then attempt infinite scrolling to load more content. If set to 'paginated', Airtop AI will follow pagination links to load more content. If set to 'infinite-scroll', Airtop AI will scroll the page to load more content. */
|
10
|
+
paginationMode?: string;
|
11
|
+
}
|
@@ -5,6 +5,8 @@ import * as Airtop from "../index";
|
|
5
5
|
export interface SessionConfigV1 {
|
6
6
|
/** Id of a profile to load into the session. */
|
7
7
|
baseProfileId?: string;
|
8
|
+
/** - */
|
9
|
+
extensionIds?: string[];
|
8
10
|
/** Persist the profile. */
|
9
11
|
persistProfile?: boolean;
|
10
12
|
/** Proxy configuration. */
|
@@ -3,7 +3,7 @@
|
|
3
3
|
*/
|
4
4
|
import * as Airtop from "../index";
|
5
5
|
/**
|
6
|
-
* You can set multiple proxies. You associate each proxy with a domain pattern. If the domain matches the pattern, the proxy is used. Pattern can contain '?' to match any single character, and '
|
6
|
+
* You can set multiple proxies. You associate each proxy with a domain pattern. If the domain matches the pattern, the proxy is used. Pattern can contain '?' to match any single character, and '*' to match any sequence of characters. For example, '*.example.com' will match 'www.example.com' and 'sub.example.com'
|
7
7
|
*/
|
8
8
|
export interface SessionConfigV1ProxyItem {
|
9
9
|
domainPattern: string;
|
@@ -6,14 +6,14 @@ export interface SessionPageQueryHandlerRequestBody {
|
|
6
6
|
clientRequestId?: string;
|
7
7
|
/** Request configuration */
|
8
8
|
configuration?: Airtop.PageQueryConfig;
|
9
|
-
/** A credit threshold that, once exceeded, will cause the operation to be cancelled. Note that this is
|
9
|
+
/** 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). */
|
10
10
|
costThresholdCredits?: number;
|
11
11
|
/** Make a best effort attempt to load more content items than are originally displayed on the page, e.g. by following pagination links, clicking controls to load more content, utilizing infinite scrolling, etc. This can be quite a bit more costly, but may be necessary for sites that require additional interaction to show the needed results. You can provide constraints in your prompt (e.g. on the total number of pages or results to consider). */
|
12
12
|
followPaginationLinks?: boolean;
|
13
13
|
/** The prompt to submit about the content in the browser window. */
|
14
14
|
prompt: string;
|
15
15
|
/**
|
16
|
-
* A time threshold in seconds that, once exceeded, will cause the operation to be cancelled. Note that this is
|
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
17
|
*
|
18
18
|
* This setting does not extend the maximum session duration provided at the time of session creation.
|
19
19
|
*/
|
@@ -4,10 +4,12 @@
|
|
4
4
|
/**
|
5
5
|
* Status of the session
|
6
6
|
*/
|
7
|
-
export declare type StatusMessageStatus = "awaitingCapacity" | "initializing" | "running" | "ended";
|
7
|
+
export declare type StatusMessageStatus = "awaitingCapacity" | "initializing" | "running" | "ended" | "error" | "disconnected";
|
8
8
|
export declare const StatusMessageStatus: {
|
9
9
|
readonly AwaitingCapacity: "awaitingCapacity";
|
10
10
|
readonly Initializing: "initializing";
|
11
11
|
readonly Running: "running";
|
12
12
|
readonly Ended: "ended";
|
13
|
+
readonly Error: "error";
|
14
|
+
readonly Disconnected: "disconnected";
|
13
15
|
};
|
package/api/types/index.d.ts
CHANGED
@@ -17,6 +17,7 @@ export * from "./OperationOutcome";
|
|
17
17
|
export * from "./OperationOutcomeResponse";
|
18
18
|
export * from "./PageQueryConfig";
|
19
19
|
export * from "./PageQueryExperimentalConfig";
|
20
|
+
export * from "./PaginatedExtractionConfig";
|
20
21
|
export * from "./Pagination";
|
21
22
|
export * from "./ProfilesResponse";
|
22
23
|
export * from "./ScrapeResponse";
|
package/api/types/index.js
CHANGED
@@ -33,6 +33,7 @@ __exportStar(require("./OperationOutcome"), exports);
|
|
33
33
|
__exportStar(require("./OperationOutcomeResponse"), exports);
|
34
34
|
__exportStar(require("./PageQueryConfig"), exports);
|
35
35
|
__exportStar(require("./PageQueryExperimentalConfig"), exports);
|
36
|
+
__exportStar(require("./PaginatedExtractionConfig"), exports);
|
36
37
|
__exportStar(require("./Pagination"), exports);
|
37
38
|
__exportStar(require("./ProfilesResponse"), exports);
|
38
39
|
__exportStar(require("./ScrapeResponse"), 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.1.
|
81
|
-
"User-Agent": "@airtop/sdk/0.1.
|
80
|
+
"X-Fern-SDK-Version": "0.1.11",
|
81
|
+
"User-Agent": "@airtop/sdk/0.1.11",
|
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.1.
|
152
|
-
"User-Agent": "@airtop/sdk/0.1.
|
151
|
+
"X-Fern-SDK-Version": "0.1.11",
|
152
|
+
"User-Agent": "@airtop/sdk/0.1.11",
|
153
153
|
"X-Fern-Runtime": core.RUNTIME.type,
|
154
154
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
155
155
|
},
|
@@ -75,5 +75,14 @@ export declare class Sessions {
|
|
75
75
|
* Get a session event stream for a given session ID
|
76
76
|
*/
|
77
77
|
events(id: string, requestOptions?: Sessions.RequestOptions): Promise<core.Stream<Airtop.SessionsEventsResponse>>;
|
78
|
+
/**
|
79
|
+
* @param {string} sessionId - ID of the session that owns the window.
|
80
|
+
* @param {string} profileName - Name under which to save the profile.
|
81
|
+
* @param {Sessions.RequestOptions} requestOptions - Request-specific configuration.
|
82
|
+
*
|
83
|
+
* @example
|
84
|
+
* await client.sessions.saveProfileOnTermination("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "myProfile")
|
85
|
+
*/
|
86
|
+
saveProfileOnTermination(sessionId: string, profileName: string, requestOptions?: Sessions.RequestOptions): Promise<void>;
|
78
87
|
protected _getAuthorizationHeader(): Promise<string>;
|
79
88
|
}
|