@onkernel/sdk 0.106.0 → 0.108.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 +16 -0
- package/client.d.mts +2 -5
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -5
- package/client.d.ts.map +1 -1
- package/client.js +0 -3
- package/client.js.map +1 -1
- package/client.mjs +0 -3
- package/client.mjs.map +1 -1
- package/lib/config-registry-wait.d.mts +12 -0
- package/lib/config-registry-wait.d.mts.map +1 -0
- package/lib/config-registry-wait.d.ts +12 -0
- package/lib/config-registry-wait.d.ts.map +1 -0
- package/lib/config-registry-wait.js +99 -0
- package/lib/config-registry-wait.js.map +1 -0
- package/lib/config-registry-wait.mjs +96 -0
- package/lib/config-registry-wait.mjs.map +1 -0
- package/package.json +1 -1
- package/resources/browsers/browsers.d.mts +124 -4
- package/resources/browsers/browsers.d.mts.map +1 -1
- package/resources/browsers/browsers.d.ts +124 -4
- package/resources/browsers/browsers.d.ts.map +1 -1
- package/resources/browsers/browsers.js +26 -3
- package/resources/browsers/browsers.js.map +1 -1
- package/resources/browsers/browsers.mjs +26 -3
- 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/config-registry/analyses.d.mts +11 -2
- package/resources/config-registry/analyses.d.mts.map +1 -1
- package/resources/config-registry/analyses.d.ts +11 -2
- package/resources/config-registry/analyses.d.ts.map +1 -1
- package/resources/config-registry/analyses.js +11 -0
- package/resources/config-registry/analyses.js.map +1 -1
- package/resources/config-registry/analyses.mjs +11 -0
- package/resources/config-registry/analyses.mjs.map +1 -1
- package/resources/config-registry/config-registry.d.mts +1 -1
- package/resources/config-registry/config-registry.d.mts.map +1 -1
- package/resources/config-registry/config-registry.d.ts +1 -1
- package/resources/config-registry/config-registry.d.ts.map +1 -1
- package/resources/config-registry/index.d.mts +1 -1
- package/resources/config-registry/index.d.mts.map +1 -1
- package/resources/config-registry/index.d.ts +1 -1
- package/resources/config-registry/index.d.ts.map +1 -1
- package/resources/config-registry/index.js.map +1 -1
- package/resources/config-registry/index.mjs.map +1 -1
- 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.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/vaults/items.d.mts +6 -3
- package/resources/vaults/items.d.mts.map +1 -1
- package/resources/vaults/items.d.ts +6 -3
- package/resources/vaults/items.d.ts.map +1 -1
- package/resources/vaults/items.js +4 -2
- package/resources/vaults/items.js.map +1 -1
- package/resources/vaults/items.mjs +4 -2
- package/resources/vaults/items.mjs.map +1 -1
- package/src/client.ts +12 -3
- package/src/lib/config-registry-wait.ts +133 -0
- package/src/resources/browsers/browsers.ts +153 -3
- package/src/resources/browsers/index.ts +6 -0
- package/src/resources/config-registry/analyses.ts +23 -2
- package/src/resources/config-registry/config-registry.ts +1 -1
- package/src/resources/config-registry/index.ts +1 -1
- package/src/resources/index.ts +6 -0
- package/src/resources/vaults/items.ts +6 -3
- 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
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { APIConnectionTimeoutError, APIUserAbortError, KernelError } from '../core/error';
|
|
2
|
+
import { buildHeaders } from '../internal/headers';
|
|
3
|
+
import type { RequestOptions } from '../internal/request-options';
|
|
4
|
+
import type { ConfigRegistryResponse } from '../resources/config-registry/config-registry';
|
|
5
|
+
|
|
6
|
+
const defaultPollIntervalMs = 5_000;
|
|
7
|
+
const terminalStatuses = new Set(['completed', 'failed', 'canceled', 'expired']);
|
|
8
|
+
|
|
9
|
+
export type ConfigRegistryAnalysisWaitOptions = Pick<
|
|
10
|
+
RequestOptions,
|
|
11
|
+
'headers' | 'maxRetries' | 'timeout' | 'fetchOptions' | 'signal' | 'defaultBaseURL'
|
|
12
|
+
> & {
|
|
13
|
+
pollIntervalMs?: number;
|
|
14
|
+
maxWaitMs?: number | null;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
type AnalysisRetriever = {
|
|
18
|
+
retrieve(id: string, options?: RequestOptions): Promise<ConfigRegistryResponse>;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const timeoutError = (id: string, polls: number, lastStatus: string | undefined, startedAt: number) =>
|
|
22
|
+
new APIConnectionTimeoutError({
|
|
23
|
+
message: `Timed out waiting for config registry analysis ${JSON.stringify(id)} after ${(
|
|
24
|
+
performance.now() - startedAt
|
|
25
|
+
).toFixed(0)}ms and ${polls} polls; last status was ${JSON.stringify(lastStatus)}`,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const wait = (ms: number, signal?: AbortSignal | null): Promise<void> => {
|
|
29
|
+
if (signal?.aborted) {
|
|
30
|
+
return Promise.reject(new APIUserAbortError());
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return new Promise((resolve, reject) => {
|
|
34
|
+
let settled = false;
|
|
35
|
+
const finish = (error?: Error) => {
|
|
36
|
+
if (settled) return;
|
|
37
|
+
settled = true;
|
|
38
|
+
clearTimeout(timer);
|
|
39
|
+
signal?.removeEventListener('abort', onAbort);
|
|
40
|
+
if (error) reject(error);
|
|
41
|
+
else resolve();
|
|
42
|
+
};
|
|
43
|
+
const onAbort = () => finish(new APIUserAbortError());
|
|
44
|
+
const timer = setTimeout(() => finish(), ms);
|
|
45
|
+
signal?.addEventListener('abort', onAbort, { once: true });
|
|
46
|
+
if (signal?.aborted) onAbort();
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const analysisFinished = (response: ConfigRegistryResponse, requestedID: string): [boolean, string] => {
|
|
51
|
+
const analysis = response.analysis;
|
|
52
|
+
if (!analysis || typeof analysis !== 'object') {
|
|
53
|
+
throw new KernelError(
|
|
54
|
+
`Config registry response for ${JSON.stringify(requestedID)} is missing an analysis`,
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
if (typeof analysis.id !== 'string' || !analysis.id) {
|
|
58
|
+
throw new KernelError(
|
|
59
|
+
`Config registry response for ${JSON.stringify(requestedID)} has no valid analysis ID`,
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
if (analysis.id !== requestedID) {
|
|
63
|
+
throw new KernelError(
|
|
64
|
+
`Config registry response for ${JSON.stringify(requestedID)} returned analysis ${JSON.stringify(
|
|
65
|
+
analysis.id,
|
|
66
|
+
)}`,
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
if (typeof analysis.status !== 'string' || !analysis.status) {
|
|
70
|
+
throw new KernelError(`Config registry analysis ${JSON.stringify(requestedID)} has no valid status`);
|
|
71
|
+
}
|
|
72
|
+
if (!Object.prototype.hasOwnProperty.call(analysis, 'finished_at')) {
|
|
73
|
+
throw new KernelError(`Config registry analysis ${JSON.stringify(requestedID)} is missing finished_at`);
|
|
74
|
+
}
|
|
75
|
+
if (
|
|
76
|
+
analysis.finished_at !== null &&
|
|
77
|
+
(typeof analysis.finished_at !== 'string' || Number.isNaN(Date.parse(analysis.finished_at)))
|
|
78
|
+
) {
|
|
79
|
+
throw new KernelError(
|
|
80
|
+
`Config registry analysis ${JSON.stringify(requestedID)} has an invalid finished_at`,
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return [analysis.finished_at !== null || terminalStatuses.has(analysis.status), analysis.status];
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export async function waitForConfigRegistryAnalysis(
|
|
88
|
+
resource: AnalysisRetriever,
|
|
89
|
+
id: string,
|
|
90
|
+
options: ConfigRegistryAnalysisWaitOptions = {},
|
|
91
|
+
): Promise<ConfigRegistryResponse> {
|
|
92
|
+
if (!id) {
|
|
93
|
+
throw new TypeError('id must be non-empty');
|
|
94
|
+
}
|
|
95
|
+
const { pollIntervalMs = defaultPollIntervalMs, maxWaitMs, ...requestOptions } = options;
|
|
96
|
+
if (!Number.isFinite(pollIntervalMs) || pollIntervalMs <= 0) {
|
|
97
|
+
throw new RangeError('pollIntervalMs must be finite and positive');
|
|
98
|
+
}
|
|
99
|
+
if (maxWaitMs != null && (!Number.isFinite(maxWaitMs) || maxWaitMs < 0)) {
|
|
100
|
+
throw new RangeError('maxWaitMs must be finite and non-negative');
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const startedAt = performance.now();
|
|
104
|
+
const deadline = maxWaitMs == null ? undefined : startedAt + maxWaitMs;
|
|
105
|
+
const retrieveOptions: RequestOptions = {
|
|
106
|
+
...requestOptions,
|
|
107
|
+
headers: buildHeaders([requestOptions.headers, { 'X-Stainless-Poll-Helper': 'true' }]),
|
|
108
|
+
};
|
|
109
|
+
let polls = 0;
|
|
110
|
+
let lastStatus: string | undefined;
|
|
111
|
+
|
|
112
|
+
while (true) {
|
|
113
|
+
if (polls > 0 && deadline !== undefined && performance.now() >= deadline) {
|
|
114
|
+
throw timeoutError(id, polls, lastStatus, startedAt);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// oxlint-disable-next-line no-await-in-loop -- each retrieval determines whether another poll is needed.
|
|
118
|
+
const response = await resource.retrieve(id, retrieveOptions);
|
|
119
|
+
polls += 1;
|
|
120
|
+
const [finished, status] = analysisFinished(response, id);
|
|
121
|
+
lastStatus = status;
|
|
122
|
+
if (finished) return response;
|
|
123
|
+
|
|
124
|
+
let delay = pollIntervalMs * (0.9 + Math.random() * 0.2);
|
|
125
|
+
if (deadline !== undefined) {
|
|
126
|
+
const remaining = deadline - performance.now();
|
|
127
|
+
if (remaining <= 0) throw timeoutError(id, polls, lastStatus, startedAt);
|
|
128
|
+
delay = Math.min(delay, remaining);
|
|
129
|
+
}
|
|
130
|
+
// oxlint-disable-next-line no-await-in-loop -- cancellation and the polling deadline must cover the delay.
|
|
131
|
+
await wait(delay, requestOptions.signal);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -149,9 +149,6 @@ import { multipartFormRequestOptions } from '../../internal/uploads';
|
|
|
149
149
|
import { path } from '../../internal/utils/path';
|
|
150
150
|
import { browserFetch, type BrowserFetchInit } from '../../lib/browser-fetch';
|
|
151
151
|
|
|
152
|
-
/**
|
|
153
|
-
* Create and manage browser sessions.
|
|
154
|
-
*/
|
|
155
152
|
export class Browsers extends APIResource {
|
|
156
153
|
telemetry: TelemetryAPI.Telemetry = new TelemetryAPI.Telemetry(this._client);
|
|
157
154
|
replays: ReplaysAPI.Replays = new ReplaysAPI.Replays(this._client);
|
|
@@ -306,6 +303,33 @@ export class Browsers extends APIResource {
|
|
|
306
303
|
),
|
|
307
304
|
);
|
|
308
305
|
}
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Execute JavaScript in a persistent Node.js runtime inside the browser VM.
|
|
309
|
+
* Top-level bindings, closures, mutations, and dynamically imported modules
|
|
310
|
+
* persist across calls until the REPL is reset or replaced. Start with
|
|
311
|
+
* `repl.help()` to list available methods, or call `repl.help("click")` for
|
|
312
|
+
* detailed help.
|
|
313
|
+
*
|
|
314
|
+
* Expression values are ignored. Emit ordered text or image output with
|
|
315
|
+
* `repl.write(...)`, console methods, or `repl.emitImage(...)`. The runtime also
|
|
316
|
+
* exposes browser-control helpers, WebMCP, Patchright, Playwright, and raw CDP.
|
|
317
|
+
*
|
|
318
|
+
* Executions are serialized. A timeout, crash, OOM, or protocol failure terminates
|
|
319
|
+
* the REPL and changes its `repl_id`. This is unrestricted code execution inside
|
|
320
|
+
* the browser VM and is not sandboxed.
|
|
321
|
+
*
|
|
322
|
+
* @example
|
|
323
|
+
* ```ts
|
|
324
|
+
* const browserReplResult = await client.browsers.repl(
|
|
325
|
+
* 'htzv5orfit78e1m2biiifpbv',
|
|
326
|
+
* { code: 'code' },
|
|
327
|
+
* );
|
|
328
|
+
* ```
|
|
329
|
+
*/
|
|
330
|
+
repl(idOrName: string, body: BrowserReplParams, options?: RequestOptions): APIPromise<BrowserReplResult> {
|
|
331
|
+
return this._client.post(path`/browsers/${idOrName}/repl`, { body, ...options });
|
|
332
|
+
}
|
|
309
333
|
}
|
|
310
334
|
|
|
311
335
|
export type BrowserListResponsesOffsetPagination = OffsetPagination<BrowserListResponse>;
|
|
@@ -434,6 +458,104 @@ export interface BrowserProxyConfig {
|
|
|
434
458
|
*/
|
|
435
459
|
export type BrowserProxyMode = 'direct' | 'default';
|
|
436
460
|
|
|
461
|
+
/**
|
|
462
|
+
* Ordered discriminated union of Browser REPL output items.
|
|
463
|
+
*/
|
|
464
|
+
export type BrowserReplContent = BrowserReplTextContent | BrowserReplImageContent;
|
|
465
|
+
|
|
466
|
+
export interface BrowserReplImageContent {
|
|
467
|
+
data_b64: string;
|
|
468
|
+
|
|
469
|
+
mime_type: string;
|
|
470
|
+
|
|
471
|
+
type: 'image';
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* Request to execute code in the persistent Browser REPL.
|
|
476
|
+
*/
|
|
477
|
+
export interface BrowserReplRequest {
|
|
478
|
+
/**
|
|
479
|
+
* JavaScript evaluated in a persistent Node.js runtime. Top-level bindings persist
|
|
480
|
+
* until the browser VM's API process exits, the REPL is reset, or the REPL is
|
|
481
|
+
* terminated after a crash or timeout. Static top-level imports are unsupported;
|
|
482
|
+
* use dynamic `import()`. Expression values are ignored; emit output with
|
|
483
|
+
* `repl.write(...)`, console methods, or `repl.emitImage(...)`. May be empty only
|
|
484
|
+
* when `reset` is true.
|
|
485
|
+
*/
|
|
486
|
+
code: string;
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* Terminate the current REPL, start a fresh one, and then evaluate code.
|
|
490
|
+
*/
|
|
491
|
+
reset?: boolean;
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* Maximum execution time in seconds. Default is 60.
|
|
495
|
+
*/
|
|
496
|
+
timeout_sec?: number;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* Result of Browser REPL code execution.
|
|
501
|
+
*/
|
|
502
|
+
export interface BrowserReplResult {
|
|
503
|
+
/**
|
|
504
|
+
* CUID2 identifying the exact state-holding REPL process used for this execution.
|
|
505
|
+
* Stable across calls and Chromium reconnects; changes after an API restart,
|
|
506
|
+
* explicit reset, execution timeout, or REPL crash.
|
|
507
|
+
*/
|
|
508
|
+
repl_id: string;
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* Whether the code executed successfully.
|
|
512
|
+
*/
|
|
513
|
+
success: boolean;
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* Optional ordered text/image output produced by the execution.
|
|
517
|
+
*/
|
|
518
|
+
content?: Array<BrowserReplContent>;
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* True if text or image output was dropped or truncated due to response limits.
|
|
522
|
+
*/
|
|
523
|
+
content_truncated?: boolean;
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* Wall-clock execution time in milliseconds.
|
|
527
|
+
*/
|
|
528
|
+
duration_ms?: number;
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* Error message if execution failed.
|
|
532
|
+
*/
|
|
533
|
+
error?: string;
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* True if the REPL identified by `repl_id` was terminated by this request. The
|
|
537
|
+
* next request lazily starts a fresh REPL with a new `repl_id`.
|
|
538
|
+
*/
|
|
539
|
+
repl_terminated?: boolean;
|
|
540
|
+
|
|
541
|
+
/**
|
|
542
|
+
* Stack trace if execution failed.
|
|
543
|
+
*/
|
|
544
|
+
stack?: string;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
export interface BrowserReplTextContent {
|
|
548
|
+
/**
|
|
549
|
+
* `write` is emitted by `repl.write`; `stdout` and `stderr` are emitted by console
|
|
550
|
+
* methods.
|
|
551
|
+
*/
|
|
552
|
+
channel: 'write' | 'stdout' | 'stderr';
|
|
553
|
+
|
|
554
|
+
text: string;
|
|
555
|
+
|
|
556
|
+
type: 'text';
|
|
557
|
+
}
|
|
558
|
+
|
|
437
559
|
/**
|
|
438
560
|
* Session usage metrics.
|
|
439
561
|
*/
|
|
@@ -1703,6 +1825,28 @@ export namespace BrowserLoadExtensionsParams {
|
|
|
1703
1825
|
}
|
|
1704
1826
|
}
|
|
1705
1827
|
|
|
1828
|
+
export interface BrowserReplParams {
|
|
1829
|
+
/**
|
|
1830
|
+
* JavaScript evaluated in a persistent Node.js runtime. Top-level bindings persist
|
|
1831
|
+
* until the browser VM's API process exits, the REPL is reset, or the REPL is
|
|
1832
|
+
* terminated after a crash or timeout. Static top-level imports are unsupported;
|
|
1833
|
+
* use dynamic `import()`. Expression values are ignored; emit output with
|
|
1834
|
+
* `repl.write(...)`, console methods, or `repl.emitImage(...)`. May be empty only
|
|
1835
|
+
* when `reset` is true.
|
|
1836
|
+
*/
|
|
1837
|
+
code: string;
|
|
1838
|
+
|
|
1839
|
+
/**
|
|
1840
|
+
* Terminate the current REPL, start a fresh one, and then evaluate code.
|
|
1841
|
+
*/
|
|
1842
|
+
reset?: boolean;
|
|
1843
|
+
|
|
1844
|
+
/**
|
|
1845
|
+
* Maximum execution time in seconds. Default is 60.
|
|
1846
|
+
*/
|
|
1847
|
+
timeout_sec?: number;
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1706
1850
|
Browsers.Telemetry = TelemetryAPITelemetry;
|
|
1707
1851
|
Browsers.Replays = Replays;
|
|
1708
1852
|
Browsers.Fs = Fs;
|
|
@@ -1721,6 +1865,11 @@ export declare namespace Browsers {
|
|
|
1721
1865
|
type BrowserProxy as BrowserProxy,
|
|
1722
1866
|
type BrowserProxyConfig as BrowserProxyConfig,
|
|
1723
1867
|
type BrowserProxyMode as BrowserProxyMode,
|
|
1868
|
+
type BrowserReplContent as BrowserReplContent,
|
|
1869
|
+
type BrowserReplImageContent as BrowserReplImageContent,
|
|
1870
|
+
type BrowserReplRequest as BrowserReplRequest,
|
|
1871
|
+
type BrowserReplResult as BrowserReplResult,
|
|
1872
|
+
type BrowserReplTextContent as BrowserReplTextContent,
|
|
1724
1873
|
type BrowserUsage as BrowserUsage,
|
|
1725
1874
|
type Profile as Profile,
|
|
1726
1875
|
type Tags as Tags,
|
|
@@ -1737,6 +1886,7 @@ export declare namespace Browsers {
|
|
|
1737
1886
|
type BrowserListParams as BrowserListParams,
|
|
1738
1887
|
type BrowserCurlParams as BrowserCurlParams,
|
|
1739
1888
|
type BrowserLoadExtensionsParams as BrowserLoadExtensionsParams,
|
|
1889
|
+
type BrowserReplParams as BrowserReplParams,
|
|
1740
1890
|
};
|
|
1741
1891
|
|
|
1742
1892
|
export {
|
|
@@ -9,6 +9,11 @@ export {
|
|
|
9
9
|
type BrowserProxy,
|
|
10
10
|
type BrowserProxyConfig,
|
|
11
11
|
type BrowserProxyMode,
|
|
12
|
+
type BrowserReplContent,
|
|
13
|
+
type BrowserReplImageContent,
|
|
14
|
+
type BrowserReplRequest,
|
|
15
|
+
type BrowserReplResult,
|
|
16
|
+
type BrowserReplTextContent,
|
|
12
17
|
type BrowserUsage,
|
|
13
18
|
type Profile,
|
|
14
19
|
type Tags,
|
|
@@ -24,6 +29,7 @@ export {
|
|
|
24
29
|
type BrowserListParams,
|
|
25
30
|
type BrowserCurlParams,
|
|
26
31
|
type BrowserLoadExtensionsParams,
|
|
32
|
+
type BrowserReplParams,
|
|
27
33
|
type ProfilesOffsetPagination,
|
|
28
34
|
type BrowserListResponsesOffsetPagination,
|
|
29
35
|
} from './browsers';
|
|
@@ -7,6 +7,10 @@ import { APIPromise } from '../../core/api-promise';
|
|
|
7
7
|
import { OffsetPagination, type OffsetPaginationParams, PagePromise } from '../../core/pagination';
|
|
8
8
|
import { RequestOptions } from '../../internal/request-options';
|
|
9
9
|
import { path } from '../../internal/utils/path';
|
|
10
|
+
import {
|
|
11
|
+
waitForConfigRegistryAnalysis,
|
|
12
|
+
type ConfigRegistryAnalysisWaitOptions,
|
|
13
|
+
} from '../../lib/config-registry-wait';
|
|
10
14
|
|
|
11
15
|
/**
|
|
12
16
|
* Resolve browser and proxy recommendations for bot-protected sites.
|
|
@@ -26,6 +30,20 @@ export class Analyses extends APIResource {
|
|
|
26
30
|
return this._client.get(path`/config-registry/analyses/${id}`, options);
|
|
27
31
|
}
|
|
28
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Wait for an analysis to finish and return its complete result.
|
|
35
|
+
*
|
|
36
|
+
* The first retrieval happens immediately. `maxWaitMs` is a soft polling
|
|
37
|
+
* deadline: an in-flight request and its normal retries may finish after it.
|
|
38
|
+
* Timing out or aborting does not cancel the remote analysis.
|
|
39
|
+
*/
|
|
40
|
+
async waitForResult(
|
|
41
|
+
id: string,
|
|
42
|
+
options?: ConfigRegistryAnalysisWaitOptions,
|
|
43
|
+
): Promise<ConfigRegistryAPI.ConfigRegistryResponse> {
|
|
44
|
+
return await waitForConfigRegistryAnalysis(this, id, options);
|
|
45
|
+
}
|
|
46
|
+
|
|
29
47
|
/**
|
|
30
48
|
* Lists analyses for the selected project, newest first.
|
|
31
49
|
*
|
|
@@ -73,7 +91,10 @@ export interface AnalysisListParams extends OffsetPaginationParams {
|
|
|
73
91
|
}
|
|
74
92
|
|
|
75
93
|
export declare namespace Analyses {
|
|
76
|
-
export {
|
|
94
|
+
export {
|
|
95
|
+
type AnalysisListParams as AnalysisListParams,
|
|
96
|
+
type ConfigRegistryAnalysisWaitOptions as ConfigRegistryAnalysisWaitOptions,
|
|
97
|
+
};
|
|
77
98
|
}
|
|
78
99
|
|
|
79
|
-
export { type AnalysisSummariesOffsetPagination };
|
|
100
|
+
export { type AnalysisSummariesOffsetPagination, type ConfigRegistryAnalysisWaitOptions };
|
|
@@ -261,7 +261,7 @@ export interface NoRecommendation {
|
|
|
261
261
|
/**
|
|
262
262
|
* Machine-readable reason Kernel cannot currently provide a config recommendation.
|
|
263
263
|
*/
|
|
264
|
-
code: 'proxy_restricted' | 'no_working_configuration' | 'inconclusive';
|
|
264
|
+
code: 'proxy_restricted' | 'target_not_evaluable' | 'no_working_configuration' | 'inconclusive';
|
|
265
265
|
|
|
266
266
|
/**
|
|
267
267
|
* Human-readable explanation suitable for display.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
export { Analyses, type AnalysisListParams } from './analyses';
|
|
3
|
+
export { Analyses, type AnalysisListParams, type ConfigRegistryAnalysisWaitOptions } from './analyses';
|
|
4
4
|
export {
|
|
5
5
|
ConfigRegistry,
|
|
6
6
|
type Analysis,
|
package/src/resources/index.ts
CHANGED
|
@@ -47,6 +47,11 @@ export {
|
|
|
47
47
|
type BrowserProxy,
|
|
48
48
|
type BrowserProxyConfig,
|
|
49
49
|
type BrowserProxyMode,
|
|
50
|
+
type BrowserReplContent,
|
|
51
|
+
type BrowserReplImageContent,
|
|
52
|
+
type BrowserReplRequest,
|
|
53
|
+
type BrowserReplResult,
|
|
54
|
+
type BrowserReplTextContent,
|
|
50
55
|
type BrowserUsage,
|
|
51
56
|
type Profile,
|
|
52
57
|
type Tags,
|
|
@@ -62,6 +67,7 @@ export {
|
|
|
62
67
|
type BrowserListParams,
|
|
63
68
|
type BrowserCurlParams,
|
|
64
69
|
type BrowserLoadExtensionsParams,
|
|
70
|
+
type BrowserReplParams,
|
|
65
71
|
type ProfilesOffsetPagination,
|
|
66
72
|
type BrowserListResponsesOffsetPagination,
|
|
67
73
|
} from './browsers/browsers';
|
|
@@ -133,8 +133,10 @@ export class Items extends APIResource {
|
|
|
133
133
|
* device approval before native Square Pay. Keep the returned approval page open,
|
|
134
134
|
* poll until ready_to_submit, then submit before preparation.expires_at. Unused
|
|
135
135
|
* preparations expire automatically and cannot be reused. If spend-request
|
|
136
|
-
* creation is
|
|
137
|
-
*
|
|
136
|
+
* creation is rejected with a non-retryable provider error, the card item is
|
|
137
|
+
* deleted and the provider's error code and message are returned. Rate limits
|
|
138
|
+
* return HTTP 429 and retain the card item; stop, back off, and retry the same
|
|
139
|
+
* authorize operation.
|
|
138
140
|
*
|
|
139
141
|
* Fill returns a value-free execution result. Validation failures before writing
|
|
140
142
|
* return 400 (invalid request or targets), 403 (access or destination denied), 404
|
|
@@ -316,7 +318,8 @@ export namespace CardVaultItemSpec {
|
|
|
316
318
|
*/
|
|
317
319
|
export interface LinkCardVaultItemSpec {
|
|
318
320
|
/**
|
|
319
|
-
* Integer amount in minor currency units.
|
|
321
|
+
* Integer amount in minor currency units. Link permits at most 50000 per spend
|
|
322
|
+
* request.
|
|
320
323
|
*/
|
|
321
324
|
amount: number;
|
|
322
325
|
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.108.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.108.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.108.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.108.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|