@onkernel/sdk 0.95.0 → 0.97.0
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/CHANGELOG.md +15 -0
- package/client.d.mts +3 -3
- package/client.d.mts.map +1 -1
- package/client.d.ts +3 -3
- package/client.d.ts.map +1 -1
- package/client.js +3 -3
- package/client.js.map +1 -1
- package/client.mjs +3 -3
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/auth/connections.d.mts +5 -3
- package/resources/auth/connections.d.mts.map +1 -1
- package/resources/auth/connections.d.ts +5 -3
- package/resources/auth/connections.d.ts.map +1 -1
- package/resources/browsers/browsers.d.mts +2 -2
- package/resources/browsers/browsers.d.mts.map +1 -1
- package/resources/browsers/browsers.d.ts +2 -2
- package/resources/browsers/browsers.d.ts.map +1 -1
- package/resources/browsers/browsers.js.map +1 -1
- package/resources/browsers/browsers.mjs.map +1 -1
- package/resources/browsers/index.d.mts +1 -1
- package/resources/browsers/index.d.mts.map +1 -1
- package/resources/browsers/index.d.ts +1 -1
- package/resources/browsers/index.d.ts.map +1 -1
- package/resources/browsers/index.js.map +1 -1
- package/resources/browsers/index.mjs.map +1 -1
- package/resources/browsers/telemetry.d.mts +154 -8
- package/resources/browsers/telemetry.d.mts.map +1 -1
- package/resources/browsers/telemetry.d.ts +154 -8
- package/resources/browsers/telemetry.d.ts.map +1 -1
- package/resources/config-registry/analyses.d.mts +45 -0
- package/resources/config-registry/analyses.d.mts.map +1 -0
- package/resources/config-registry/analyses.d.ts +45 -0
- package/resources/config-registry/analyses.d.ts.map +1 -0
- package/resources/config-registry/analyses.js +41 -0
- package/resources/config-registry/analyses.js.map +1 -0
- package/resources/config-registry/analyses.mjs +37 -0
- package/resources/config-registry/analyses.mjs.map +1 -0
- package/resources/{site-configs.d.ts → config-registry/config-registry.d.mts} +62 -70
- package/resources/config-registry/config-registry.d.mts.map +1 -0
- package/resources/{site-configs.d.mts → config-registry/config-registry.d.ts} +62 -70
- package/resources/config-registry/config-registry.d.ts.map +1 -0
- package/resources/config-registry/config-registry.js +69 -0
- package/resources/config-registry/config-registry.js.map +1 -0
- package/resources/config-registry/config-registry.mjs +64 -0
- package/resources/config-registry/config-registry.mjs.map +1 -0
- package/resources/config-registry/index.d.mts +3 -0
- package/resources/config-registry/index.d.mts.map +1 -0
- package/resources/config-registry/index.d.ts +3 -0
- package/resources/config-registry/index.d.ts.map +1 -0
- package/resources/config-registry/index.js +9 -0
- package/resources/config-registry/index.js.map +1 -0
- package/resources/config-registry/index.mjs +4 -0
- package/resources/config-registry/index.mjs.map +1 -0
- package/resources/config-registry.d.mts +2 -0
- package/resources/config-registry.d.mts.map +1 -0
- package/resources/config-registry.d.ts +2 -0
- package/resources/config-registry.d.ts.map +1 -0
- package/resources/config-registry.js +6 -0
- package/resources/config-registry.js.map +1 -0
- package/resources/config-registry.mjs +3 -0
- package/resources/config-registry.mjs.map +1 -0
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/src/client.ts +28 -32
- package/src/resources/auth/connections.ts +5 -2
- package/src/resources/browsers/browsers.ts +4 -0
- package/src/resources/browsers/index.ts +2 -0
- package/src/resources/browsers/telemetry.ts +202 -7
- package/src/resources/config-registry/analyses.ts +63 -0
- package/src/resources/{site-configs.ts → config-registry/config-registry.ts} +77 -90
- package/src/resources/config-registry/index.ts +25 -0
- package/src/resources/config-registry.ts +3 -0
- package/src/resources/index.ts +22 -23
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/site-configs.d.mts.map +0 -1
- package/resources/site-configs.d.ts.map +0 -1
- package/resources/site-configs.js +0 -88
- package/resources/site-configs.js.map +0 -1
- package/resources/site-configs.mjs +0 -84
- package/resources/site-configs.mjs.map +0 -1
|
@@ -192,6 +192,99 @@ export namespace BrowserCallStack {
|
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
+
/**
|
|
196
|
+
* A visible captcha challenge reached a terminal outcome.
|
|
197
|
+
*/
|
|
198
|
+
export interface BrowserCaptchaChallengeResultEvent {
|
|
199
|
+
category: 'captcha';
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Per-challenge payload. This event is emitted once per challenge and determines
|
|
203
|
+
* its overall outcome; captcha_solve_started and captcha_solve_result describe
|
|
204
|
+
* individual tasks and may occur multiple times within the challenge.
|
|
205
|
+
*/
|
|
206
|
+
data: BrowserCaptchaChallengeResultEvent.Data;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Provenance metadata identifying which producer emitted the event.
|
|
210
|
+
*/
|
|
211
|
+
source: BrowserEventSource;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Event timestamp in Unix microseconds.
|
|
215
|
+
*/
|
|
216
|
+
ts: number;
|
|
217
|
+
|
|
218
|
+
type: 'captcha_challenge_result';
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* True if the data field was truncated due to size limits.
|
|
222
|
+
*/
|
|
223
|
+
truncated?: boolean;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export namespace BrowserCaptchaChallengeResultEvent {
|
|
227
|
+
/**
|
|
228
|
+
* Per-challenge payload. This event is emitted once per challenge and determines
|
|
229
|
+
* its overall outcome; captcha_solve_started and captcha_solve_result describe
|
|
230
|
+
* individual tasks and may occur multiple times within the challenge.
|
|
231
|
+
*/
|
|
232
|
+
export interface Data {
|
|
233
|
+
/**
|
|
234
|
+
* Captcha kind. Enterprise reCAPTCHA variants are grouped into their version
|
|
235
|
+
* bucket (recaptcha_v2 or recaptcha_v3), press-and-hold challenges use
|
|
236
|
+
* press_and_hold, and unlisted kinds use other.
|
|
237
|
+
*/
|
|
238
|
+
captcha_type:
|
|
239
|
+
| 'hcaptcha'
|
|
240
|
+
| 'recaptcha_v2'
|
|
241
|
+
| 'recaptcha_v3'
|
|
242
|
+
| 'turnstile'
|
|
243
|
+
| 'geetest'
|
|
244
|
+
| 'press_and_hold'
|
|
245
|
+
| 'other';
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Opaque identifier shared by events for one visible challenge. An image-grid
|
|
249
|
+
* captcha may create multiple task_id values for one challenge_id. The same value
|
|
250
|
+
* may continue across a page reload when the challenge episode continues. It does
|
|
251
|
+
* not indicate task ordering or challenge completion.
|
|
252
|
+
*/
|
|
253
|
+
challenge_id: string;
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Wall-clock duration from the challenge appearing to its terminal outcome,
|
|
257
|
+
* covering every solver attempt in between.
|
|
258
|
+
*/
|
|
259
|
+
duration_ms: number;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Terminal outcome of the visible challenge. solved: the page observed the
|
|
263
|
+
* challenge clear after a solver attempt. failure: a terminal solver failure
|
|
264
|
+
* occurred, or all attempts ended while the challenge remained. timeout: the
|
|
265
|
+
* challenge-level wait budget expired while the challenge remained. abandoned:
|
|
266
|
+
* observation ended without an attributable terminal challenge outcome. This
|
|
267
|
+
* includes a dismissed widget or page unload without a solved signal or terminal
|
|
268
|
+
* solver outcome, and a token appearing while multiple same-provider challenges
|
|
269
|
+
* are open, because the producer cannot attribute that token to this visible
|
|
270
|
+
* challenge. A captcha_solve_result with the same challenge_id may therefore
|
|
271
|
+
* report success while the challenge result reports abandoned. A solved challenge
|
|
272
|
+
* does not prove the site accepted the token or that the guarded action succeeded.
|
|
273
|
+
*/
|
|
274
|
+
status: 'solved' | 'failure' | 'timeout' | 'abandoned';
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Host of the page where the challenge appeared.
|
|
278
|
+
*/
|
|
279
|
+
website_host?: string;
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Path of the page where the challenge appeared. Query string excluded.
|
|
283
|
+
*/
|
|
284
|
+
website_path?: string;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
195
288
|
/**
|
|
196
289
|
* A captcha solve attempt reached a terminal outcome.
|
|
197
290
|
*/
|
|
@@ -221,13 +314,23 @@ export interface BrowserCaptchaSolveResultEvent {
|
|
|
221
314
|
export namespace BrowserCaptchaSolveResultEvent {
|
|
222
315
|
export interface Data {
|
|
223
316
|
/**
|
|
224
|
-
* Captcha
|
|
225
|
-
*
|
|
226
|
-
|
|
227
|
-
|
|
317
|
+
* Captcha kind. Enterprise reCAPTCHA variants are grouped into their version
|
|
318
|
+
* bucket (recaptcha_v2 or recaptcha_v3), press-and-hold challenges use
|
|
319
|
+
* press_and_hold, and unlisted kinds use other.
|
|
320
|
+
*/
|
|
321
|
+
captcha_type:
|
|
322
|
+
| 'hcaptcha'
|
|
323
|
+
| 'recaptcha_v2'
|
|
324
|
+
| 'recaptcha_v3'
|
|
325
|
+
| 'turnstile'
|
|
326
|
+
| 'geetest'
|
|
327
|
+
| 'press_and_hold'
|
|
328
|
+
| 'other';
|
|
228
329
|
|
|
229
330
|
/**
|
|
230
|
-
* Wall-clock duration from solve start to terminal outcome.
|
|
331
|
+
* Wall-clock duration from solve start to terminal outcome. Authoritative solve
|
|
332
|
+
* timing; do not derive it from the gap to a captcha_solve_started event, whose
|
|
333
|
+
* delivery and ordering are not guaranteed.
|
|
231
334
|
*/
|
|
232
335
|
duration_ms: number;
|
|
233
336
|
|
|
@@ -239,6 +342,14 @@ export namespace BrowserCaptchaSolveResultEvent {
|
|
|
239
342
|
*/
|
|
240
343
|
status: 'success' | 'failure' | 'timeout' | 'abandoned';
|
|
241
344
|
|
|
345
|
+
/**
|
|
346
|
+
* Opaque identifier shared by events for one visible challenge. An image-grid
|
|
347
|
+
* captcha may create multiple task_id values for one challenge_id. The same value
|
|
348
|
+
* may continue across a page reload when the challenge episode continues. It does
|
|
349
|
+
* not indicate task ordering or challenge completion.
|
|
350
|
+
*/
|
|
351
|
+
challenge_id?: string;
|
|
352
|
+
|
|
242
353
|
/**
|
|
243
354
|
* Solver-specific error code on failure (e.g. ERROR_CAPTCHA_UNSOLVABLE). Absent on
|
|
244
355
|
* success.
|
|
@@ -246,7 +357,7 @@ export namespace BrowserCaptchaSolveResultEvent {
|
|
|
246
357
|
error_code?: string;
|
|
247
358
|
|
|
248
359
|
/**
|
|
249
|
-
*
|
|
360
|
+
* Opaque identifier shared with the matching captcha_solve_started.
|
|
250
361
|
*/
|
|
251
362
|
task_id?: string;
|
|
252
363
|
|
|
@@ -262,6 +373,86 @@ export namespace BrowserCaptchaSolveResultEvent {
|
|
|
262
373
|
}
|
|
263
374
|
}
|
|
264
375
|
|
|
376
|
+
/**
|
|
377
|
+
* A captcha solver accepted a task.
|
|
378
|
+
*/
|
|
379
|
+
export interface BrowserCaptchaSolveStartedEvent {
|
|
380
|
+
category: 'captcha';
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Per-task payload. A visible challenge may create multiple tasks. When present,
|
|
384
|
+
* task_id correlates this event with a captcha_solve_result, while challenge_id
|
|
385
|
+
* groups tasks from the same challenge. Events may arrive out of order or be
|
|
386
|
+
* absent, so their arrival does not indicate current solve state.
|
|
387
|
+
*/
|
|
388
|
+
data: BrowserCaptchaSolveStartedEvent.Data;
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Provenance metadata identifying which producer emitted the event.
|
|
392
|
+
*/
|
|
393
|
+
source: BrowserEventSource;
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Event timestamp in Unix microseconds.
|
|
397
|
+
*/
|
|
398
|
+
ts: number;
|
|
399
|
+
|
|
400
|
+
type: 'captcha_solve_started';
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* True if the data field was truncated due to size limits.
|
|
404
|
+
*/
|
|
405
|
+
truncated?: boolean;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
export namespace BrowserCaptchaSolveStartedEvent {
|
|
409
|
+
/**
|
|
410
|
+
* Per-task payload. A visible challenge may create multiple tasks. When present,
|
|
411
|
+
* task_id correlates this event with a captcha_solve_result, while challenge_id
|
|
412
|
+
* groups tasks from the same challenge. Events may arrive out of order or be
|
|
413
|
+
* absent, so their arrival does not indicate current solve state.
|
|
414
|
+
*/
|
|
415
|
+
export interface Data {
|
|
416
|
+
/**
|
|
417
|
+
* Captcha kind. Enterprise reCAPTCHA variants are grouped into their version
|
|
418
|
+
* bucket (recaptcha_v2 or recaptcha_v3), press-and-hold challenges use
|
|
419
|
+
* press_and_hold, and unlisted kinds use other.
|
|
420
|
+
*/
|
|
421
|
+
captcha_type:
|
|
422
|
+
| 'hcaptcha'
|
|
423
|
+
| 'recaptcha_v2'
|
|
424
|
+
| 'recaptcha_v3'
|
|
425
|
+
| 'turnstile'
|
|
426
|
+
| 'geetest'
|
|
427
|
+
| 'press_and_hold'
|
|
428
|
+
| 'other';
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* Opaque identifier shared by events for one visible challenge. An image-grid
|
|
432
|
+
* captcha may create multiple task_id values for one challenge_id. The same value
|
|
433
|
+
* may continue across a page reload when the challenge episode continues. It does
|
|
434
|
+
* not indicate task ordering or challenge completion.
|
|
435
|
+
*/
|
|
436
|
+
challenge_id?: string;
|
|
437
|
+
|
|
438
|
+
/**
|
|
439
|
+
* Opaque identifier shared with the matching captcha_solve_result.
|
|
440
|
+
*/
|
|
441
|
+
task_id?: string;
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* Host of the page where the captcha is being solved. May be empty for solver
|
|
445
|
+
* tasks that carry no page URL.
|
|
446
|
+
*/
|
|
447
|
+
website_host?: string;
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* Path of the page where the captcha is being solved. Query string excluded.
|
|
451
|
+
*/
|
|
452
|
+
website_path?: string;
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
|
|
265
456
|
/**
|
|
266
457
|
* A browser-control command a client sent over the CDP WebSocket proxy: input
|
|
267
458
|
* gestures, navigation, dialog handling, file selection and screenshots.
|
|
@@ -4346,7 +4537,7 @@ export namespace BrowserSystemOomKillEvent {
|
|
|
4346
4537
|
*/
|
|
4347
4538
|
export interface BrowserTelemetryCategoriesConfig {
|
|
4348
4539
|
/**
|
|
4349
|
-
* Captcha
|
|
4540
|
+
* Captcha solver tasks and visible challenge outcomes. On by default.
|
|
4350
4541
|
*/
|
|
4351
4542
|
captcha?: BrowserTelemetryCategoryConfig;
|
|
4352
4543
|
|
|
@@ -4516,7 +4707,9 @@ export type BrowserTelemetryEvent =
|
|
|
4516
4707
|
| BrowserCdpDisconnectEvent
|
|
4517
4708
|
| BrowserLiveViewConnectEvent
|
|
4518
4709
|
| BrowserLiveViewDisconnectEvent
|
|
4710
|
+
| BrowserCaptchaSolveStartedEvent
|
|
4519
4711
|
| BrowserCaptchaSolveResultEvent
|
|
4712
|
+
| BrowserCaptchaChallengeResultEvent
|
|
4520
4713
|
| BrowserSystemOomKillEvent
|
|
4521
4714
|
| BrowserServiceCrashedEvent;
|
|
4522
4715
|
|
|
@@ -4660,7 +4853,9 @@ export declare namespace Telemetry {
|
|
|
4660
4853
|
export {
|
|
4661
4854
|
type BrowserAPICallEvent as BrowserAPICallEvent,
|
|
4662
4855
|
type BrowserCallStack as BrowserCallStack,
|
|
4856
|
+
type BrowserCaptchaChallengeResultEvent as BrowserCaptchaChallengeResultEvent,
|
|
4663
4857
|
type BrowserCaptchaSolveResultEvent as BrowserCaptchaSolveResultEvent,
|
|
4858
|
+
type BrowserCaptchaSolveStartedEvent as BrowserCaptchaSolveStartedEvent,
|
|
4664
4859
|
type BrowserCdpCommandEvent as BrowserCdpCommandEvent,
|
|
4665
4860
|
type BrowserCdpCommandMethod as BrowserCdpCommandMethod,
|
|
4666
4861
|
type BrowserCdpConnectEvent as BrowserCdpConnectEvent,
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import * as ConfigRegistryAPI from './config-registry';
|
|
5
|
+
import { AnalysisSummariesOffsetPagination } from './config-registry';
|
|
6
|
+
import { APIPromise } from '../../core/api-promise';
|
|
7
|
+
import { OffsetPagination, type OffsetPaginationParams, PagePromise } from '../../core/pagination';
|
|
8
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
9
|
+
import { path } from '../../internal/utils/path';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Resolve browser and proxy recommendations for bot-protected sites.
|
|
13
|
+
*/
|
|
14
|
+
export class Analyses extends APIResource {
|
|
15
|
+
/**
|
|
16
|
+
* Returns a project-scoped historical analysis and the recommendation outcome
|
|
17
|
+
* concluded by that run. Later knowledge does not change this response.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* const configRegistryResponse =
|
|
22
|
+
* await client.configRegistry.analyses.retrieve('id');
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<ConfigRegistryAPI.ConfigRegistryResponse> {
|
|
26
|
+
return this._client.get(path`/config-registry/analyses/${id}`, options);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Lists analyses for the selected project, newest first.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* // Automatically fetches more pages as needed.
|
|
35
|
+
* for await (const analysisSummary of client.configRegistry.analyses.list()) {
|
|
36
|
+
* // ...
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
list(
|
|
41
|
+
query: AnalysisListParams | null | undefined = {},
|
|
42
|
+
options?: RequestOptions,
|
|
43
|
+
): PagePromise<AnalysisSummariesOffsetPagination, ConfigRegistryAPI.AnalysisSummary> {
|
|
44
|
+
return this._client.getAPIList(
|
|
45
|
+
'/config-registry/analyses',
|
|
46
|
+
OffsetPagination<ConfigRegistryAPI.AnalysisSummary>,
|
|
47
|
+
{ query, ...options },
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface AnalysisListParams extends OffsetPaginationParams {
|
|
53
|
+
/**
|
|
54
|
+
* Case-insensitive substring search over requested URLs.
|
|
55
|
+
*/
|
|
56
|
+
search?: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export declare namespace Analyses {
|
|
60
|
+
export { type AnalysisListParams as AnalysisListParams };
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export { type AnalysisSummariesOffsetPagination };
|
|
@@ -1,47 +1,18 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '
|
|
4
|
-
import * as Shared from '
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import * as Shared from '../shared';
|
|
5
|
+
import * as AnalysesAPI from './analyses';
|
|
6
|
+
import { Analyses, AnalysisListParams } from './analyses';
|
|
7
|
+
import { APIPromise } from '../../core/api-promise';
|
|
8
|
+
import { OffsetPagination, type OffsetPaginationParams, PagePromise } from '../../core/pagination';
|
|
9
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Resolve browser and proxy recommendations for bot-protected sites.
|
|
12
13
|
*/
|
|
13
|
-
export class
|
|
14
|
-
|
|
15
|
-
* Returns a project-scoped historical analysis and the recommendation outcome
|
|
16
|
-
* concluded by that run. Later knowledge does not change this response.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```ts
|
|
20
|
-
* const siteConfigResponse =
|
|
21
|
-
* await client.siteConfigs.retrieve('id');
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
retrieve(id: string, options?: RequestOptions): APIPromise<SiteConfigResponse> {
|
|
25
|
-
return this._client.get(path`/site-configs/${id}`, options);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Lists analyses for the selected project, newest first.
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* ```ts
|
|
33
|
-
* // Automatically fetches more pages as needed.
|
|
34
|
-
* for await (const analysisSummary of client.siteConfigs.list()) {
|
|
35
|
-
* // ...
|
|
36
|
-
* }
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
list(
|
|
40
|
-
query: SiteConfigListParams | null | undefined = {},
|
|
41
|
-
options?: RequestOptions,
|
|
42
|
-
): PagePromise<AnalysisSummariesOffsetPagination, AnalysisSummary> {
|
|
43
|
-
return this._client.getAPIList('/site-configs', OffsetPagination<AnalysisSummary>, { query, ...options });
|
|
44
|
-
}
|
|
14
|
+
export class ConfigRegistry extends APIResource {
|
|
15
|
+
analyses: AnalysesAPI.Analyses = new AnalysesAPI.Analyses(this._client);
|
|
45
16
|
|
|
46
17
|
/**
|
|
47
18
|
* Lists unique domains previously analyzed by the selected project with their
|
|
@@ -50,16 +21,16 @@ export class SiteConfigs extends APIResource {
|
|
|
50
21
|
* @example
|
|
51
22
|
* ```ts
|
|
52
23
|
* // Automatically fetches more pages as needed.
|
|
53
|
-
* for await (const recommendationSummary of client.
|
|
24
|
+
* for await (const recommendationSummary of client.configRegistry.list()) {
|
|
54
25
|
* // ...
|
|
55
26
|
* }
|
|
56
27
|
* ```
|
|
57
28
|
*/
|
|
58
|
-
|
|
59
|
-
query:
|
|
29
|
+
list(
|
|
30
|
+
query: ConfigRegistryListParams | null | undefined = {},
|
|
60
31
|
options?: RequestOptions,
|
|
61
32
|
): PagePromise<RecommendationSummariesOffsetPagination, RecommendationSummary> {
|
|
62
|
-
return this._client.getAPIList('/
|
|
33
|
+
return this._client.getAPIList('/config-registry', OffsetPagination<RecommendationSummary>, {
|
|
63
34
|
query,
|
|
64
35
|
...options,
|
|
65
36
|
});
|
|
@@ -67,40 +38,41 @@ export class SiteConfigs extends APIResource {
|
|
|
67
38
|
|
|
68
39
|
/**
|
|
69
40
|
* Returns current global knowledge without resolving DNS, creating an analysis, or
|
|
70
|
-
* updating
|
|
41
|
+
* updating config registry data.
|
|
71
42
|
*
|
|
72
43
|
* @example
|
|
73
44
|
* ```ts
|
|
74
|
-
* const lookupResponse = await client.
|
|
45
|
+
* const lookupResponse = await client.configRegistry.lookup({
|
|
75
46
|
* url: 'https://example.com',
|
|
76
47
|
* });
|
|
77
48
|
* ```
|
|
78
49
|
*/
|
|
79
|
-
lookup(body:
|
|
80
|
-
return this._client.post('/
|
|
50
|
+
lookup(body: ConfigRegistryLookupParams, options?: RequestOptions): APIPromise<LookupResponse> {
|
|
51
|
+
return this._client.post('/config-registry/lookup', { body, ...options });
|
|
81
52
|
}
|
|
82
53
|
|
|
83
54
|
/**
|
|
84
55
|
* Explicitly starts or retries a project-scoped background analysis while
|
|
85
|
-
* preserving current global knowledge when available. Use
|
|
86
|
-
* for side-effect-free reads.
|
|
56
|
+
* preserving current global knowledge when available. Use
|
|
57
|
+
* `/config-registry/lookup` for side-effect-free reads.
|
|
87
58
|
*
|
|
88
59
|
* @example
|
|
89
60
|
* ```ts
|
|
90
|
-
* const
|
|
91
|
-
*
|
|
92
|
-
*
|
|
61
|
+
* const configRegistryResponse =
|
|
62
|
+
* await client.configRegistry.resolve({
|
|
63
|
+
* url: 'https://example.com',
|
|
64
|
+
* });
|
|
93
65
|
* ```
|
|
94
66
|
*/
|
|
95
|
-
resolve(body:
|
|
96
|
-
return this._client.post('/
|
|
67
|
+
resolve(body: ConfigRegistryResolveParams, options?: RequestOptions): APIPromise<ConfigRegistryResponse> {
|
|
68
|
+
return this._client.post('/config-registry/resolve', { body, ...options });
|
|
97
69
|
}
|
|
98
70
|
}
|
|
99
71
|
|
|
100
|
-
export type AnalysisSummariesOffsetPagination = OffsetPagination<AnalysisSummary>;
|
|
101
|
-
|
|
102
72
|
export type RecommendationSummariesOffsetPagination = OffsetPagination<RecommendationSummary>;
|
|
103
73
|
|
|
74
|
+
export type AnalysisSummariesOffsetPagination = OffsetPagination<AnalysisSummary>;
|
|
75
|
+
|
|
104
76
|
export interface Analysis {
|
|
105
77
|
/**
|
|
106
78
|
* Discovery run ID used to poll analysis status.
|
|
@@ -124,7 +96,7 @@ export interface Analysis {
|
|
|
124
96
|
finished_at: string | null;
|
|
125
97
|
|
|
126
98
|
/**
|
|
127
|
-
* Lifecycle status of
|
|
99
|
+
* Lifecycle status of a background analysis.
|
|
128
100
|
*/
|
|
129
101
|
status: 'running' | 'completed' | 'failed' | 'canceled';
|
|
130
102
|
}
|
|
@@ -162,6 +134,21 @@ export interface Browser {
|
|
|
162
134
|
viewport: Shared.BrowserViewport;
|
|
163
135
|
}
|
|
164
136
|
|
|
137
|
+
export interface ConfigRegistryResponse {
|
|
138
|
+
/**
|
|
139
|
+
* Pollable analysis after workflow submission is acknowledged. Null when no
|
|
140
|
+
* refresh was submitted.
|
|
141
|
+
*/
|
|
142
|
+
analysis: Analysis | null;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* A recommendation or a structured no-recommendation result.
|
|
146
|
+
*/
|
|
147
|
+
recommendation: RecommendationResult | null;
|
|
148
|
+
|
|
149
|
+
target: Target;
|
|
150
|
+
}
|
|
151
|
+
|
|
165
152
|
export interface Evidence {
|
|
166
153
|
accessed: number;
|
|
167
154
|
|
|
@@ -216,8 +203,7 @@ export interface LookupResponse {
|
|
|
216
203
|
|
|
217
204
|
export interface NoRecommendation {
|
|
218
205
|
/**
|
|
219
|
-
* Machine-readable reason Kernel cannot currently provide a
|
|
220
|
-
* recommendation.
|
|
206
|
+
* Machine-readable reason Kernel cannot currently provide a config recommendation.
|
|
221
207
|
*/
|
|
222
208
|
code: 'proxy_restricted' | 'no_working_configuration' | 'inconclusive';
|
|
223
209
|
|
|
@@ -232,13 +218,13 @@ export interface NoRecommendation {
|
|
|
232
218
|
/**
|
|
233
219
|
* Proxy recipe for the recommended browser.
|
|
234
220
|
*/
|
|
235
|
-
export type Proxy = Proxy.
|
|
221
|
+
export type Proxy = Proxy.ConfigRegistryDirectProxy | Proxy.ConfigRegistryManagedProxy;
|
|
236
222
|
|
|
237
223
|
export namespace Proxy {
|
|
238
224
|
/**
|
|
239
225
|
* Direct egress recipe. Pass `{ "mode": "direct" }` as the browser's `proxy`.
|
|
240
226
|
*/
|
|
241
|
-
export interface
|
|
227
|
+
export interface ConfigRegistryDirectProxy {
|
|
242
228
|
mode: 'direct';
|
|
243
229
|
}
|
|
244
230
|
|
|
@@ -247,16 +233,16 @@ export namespace Proxy {
|
|
|
247
233
|
* create the resource once, retain its ID, and reuse that ID as the browser's
|
|
248
234
|
* `proxy.id`. Do not submit this recipe before every browser session.
|
|
249
235
|
*/
|
|
250
|
-
export interface
|
|
236
|
+
export interface ConfigRegistryManagedProxy {
|
|
251
237
|
/**
|
|
252
238
|
* Configuration for routing traffic through a proxy.
|
|
253
239
|
*/
|
|
254
|
-
create:
|
|
240
|
+
create: ConfigRegistryManagedProxy.Create;
|
|
255
241
|
|
|
256
242
|
mode: 'managed';
|
|
257
243
|
}
|
|
258
244
|
|
|
259
|
-
export namespace
|
|
245
|
+
export namespace ConfigRegistryManagedProxy {
|
|
260
246
|
/**
|
|
261
247
|
* Configuration for routing traffic through a proxy.
|
|
262
248
|
*/
|
|
@@ -444,6 +430,16 @@ export interface Recommendation {
|
|
|
444
430
|
export type RecommendationResult = Recommendation | NoRecommendation;
|
|
445
431
|
|
|
446
432
|
export interface RecommendationSummary {
|
|
433
|
+
/**
|
|
434
|
+
* ID of the most recently requested analysis for this domain.
|
|
435
|
+
*/
|
|
436
|
+
analysis_id: string;
|
|
437
|
+
|
|
438
|
+
/**
|
|
439
|
+
* Lifecycle status of the most recently requested analysis for this domain.
|
|
440
|
+
*/
|
|
441
|
+
analysis_status: 'running' | 'completed' | 'failed' | 'canceled';
|
|
442
|
+
|
|
447
443
|
/**
|
|
448
444
|
* Most recent time the selected project requested an analysis for this domain.
|
|
449
445
|
*/
|
|
@@ -485,21 +481,6 @@ export interface ResolveRequest {
|
|
|
485
481
|
allowed_proxy_countries?: Array<string>;
|
|
486
482
|
}
|
|
487
483
|
|
|
488
|
-
export interface SiteConfigResponse {
|
|
489
|
-
/**
|
|
490
|
-
* Pollable analysis after workflow submission is acknowledged. Null when no
|
|
491
|
-
* refresh was submitted.
|
|
492
|
-
*/
|
|
493
|
-
analysis: Analysis | null;
|
|
494
|
-
|
|
495
|
-
/**
|
|
496
|
-
* A recommendation or a structured no-recommendation result.
|
|
497
|
-
*/
|
|
498
|
-
recommendation: RecommendationResult | null;
|
|
499
|
-
|
|
500
|
-
target: Target;
|
|
501
|
-
}
|
|
502
|
-
|
|
503
484
|
export interface Target {
|
|
504
485
|
/**
|
|
505
486
|
* Registrable domain.
|
|
@@ -517,15 +498,19 @@ export interface Target {
|
|
|
517
498
|
normalized: string;
|
|
518
499
|
}
|
|
519
500
|
|
|
520
|
-
export interface
|
|
501
|
+
export interface ConfigRegistryListParams extends OffsetPaginationParams {
|
|
502
|
+
/**
|
|
503
|
+
* Case-insensitive domain search. Full URLs are reduced to their registrable
|
|
504
|
+
* domain.
|
|
505
|
+
*/
|
|
506
|
+
search?: string;
|
|
521
507
|
|
|
522
|
-
|
|
523
|
-
sort_by?: 'target' | 'recommended_config' | 'last_requested_at' | 'success_rate';
|
|
508
|
+
sort_by?: 'target' | 'analysis_status' | 'recommended_config' | 'last_requested_at' | 'success_rate';
|
|
524
509
|
|
|
525
510
|
sort_order?: 'asc' | 'desc';
|
|
526
511
|
}
|
|
527
512
|
|
|
528
|
-
export interface
|
|
513
|
+
export interface ConfigRegistryLookupParams {
|
|
529
514
|
/**
|
|
530
515
|
* Public HTTP(S) URL to look up.
|
|
531
516
|
*/
|
|
@@ -538,7 +523,7 @@ export interface SiteConfigLookupParams {
|
|
|
538
523
|
allowed_proxy_countries?: Array<string>;
|
|
539
524
|
}
|
|
540
525
|
|
|
541
|
-
export interface
|
|
526
|
+
export interface ConfigRegistryResolveParams {
|
|
542
527
|
/**
|
|
543
528
|
* Public HTTP(S) URL to refresh.
|
|
544
529
|
*/
|
|
@@ -552,11 +537,14 @@ export interface SiteConfigResolveParams {
|
|
|
552
537
|
allowed_proxy_countries?: Array<string>;
|
|
553
538
|
}
|
|
554
539
|
|
|
555
|
-
|
|
540
|
+
ConfigRegistry.Analyses = Analyses;
|
|
541
|
+
|
|
542
|
+
export declare namespace ConfigRegistry {
|
|
556
543
|
export {
|
|
557
544
|
type Analysis as Analysis,
|
|
558
545
|
type AnalysisSummary as AnalysisSummary,
|
|
559
546
|
type Browser as Browser,
|
|
547
|
+
type ConfigRegistryResponse as ConfigRegistryResponse,
|
|
560
548
|
type Evidence as Evidence,
|
|
561
549
|
type LookupRequest as LookupRequest,
|
|
562
550
|
type LookupResponse as LookupResponse,
|
|
@@ -566,13 +554,12 @@ export declare namespace SiteConfigs {
|
|
|
566
554
|
type RecommendationResult as RecommendationResult,
|
|
567
555
|
type RecommendationSummary as RecommendationSummary,
|
|
568
556
|
type ResolveRequest as ResolveRequest,
|
|
569
|
-
type SiteConfigResponse as SiteConfigResponse,
|
|
570
557
|
type Target as Target,
|
|
571
|
-
type AnalysisSummariesOffsetPagination as AnalysisSummariesOffsetPagination,
|
|
572
558
|
type RecommendationSummariesOffsetPagination as RecommendationSummariesOffsetPagination,
|
|
573
|
-
type
|
|
574
|
-
type
|
|
575
|
-
type
|
|
576
|
-
type SiteConfigResolveParams as SiteConfigResolveParams,
|
|
559
|
+
type ConfigRegistryListParams as ConfigRegistryListParams,
|
|
560
|
+
type ConfigRegistryLookupParams as ConfigRegistryLookupParams,
|
|
561
|
+
type ConfigRegistryResolveParams as ConfigRegistryResolveParams,
|
|
577
562
|
};
|
|
563
|
+
|
|
564
|
+
export { Analyses as Analyses, type AnalysisListParams as AnalysisListParams };
|
|
578
565
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export { Analyses, type AnalysisListParams } from './analyses';
|
|
4
|
+
export {
|
|
5
|
+
ConfigRegistry,
|
|
6
|
+
type Analysis,
|
|
7
|
+
type AnalysisSummary,
|
|
8
|
+
type Browser,
|
|
9
|
+
type ConfigRegistryResponse,
|
|
10
|
+
type Evidence,
|
|
11
|
+
type LookupRequest,
|
|
12
|
+
type LookupResponse,
|
|
13
|
+
type NoRecommendation,
|
|
14
|
+
type Proxy,
|
|
15
|
+
type Recommendation,
|
|
16
|
+
type RecommendationResult,
|
|
17
|
+
type RecommendationSummary,
|
|
18
|
+
type ResolveRequest,
|
|
19
|
+
type Target,
|
|
20
|
+
type ConfigRegistryListParams,
|
|
21
|
+
type ConfigRegistryLookupParams,
|
|
22
|
+
type ConfigRegistryResolveParams,
|
|
23
|
+
type AnalysisSummariesOffsetPagination,
|
|
24
|
+
type RecommendationSummariesOffsetPagination,
|
|
25
|
+
} from './config-registry';
|