Skip to content

Commit a2b9c8f

Browse files
feat: Say how many certificates the refresh PR body leaves out
Stainless-Generated-From: 51c99c87f1c4026fdfca6867b49b86893d9d9796
1 parent 2bd2b07 commit a2b9c8f

7 files changed

Lines changed: 191 additions & 8 deletions

File tree

‎.stats.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
configured_endpoints: 178
1+
configured_endpoints: 179

‎api.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,18 @@ Methods:
204204
- <code title="get /browsers/{id_or_name}/telemetry/events">client.browsers.telemetry.<a href="./src/resources/browsers/telemetry.ts">events</a>(idOrName, { ...params }) -> TelemetryEventsResponsesOffsetPagination</code>
205205
- <code title="get /browsers/{id_or_name}/telemetry/stream">client.browsers.telemetry.<a href="./src/resources/browsers/telemetry.ts">stream</a>(idOrName, { ...params }) -> TelemetryStreamResponse</code>
206206

207+
## LiveView
208+
209+
Types:
210+
211+
- <code><a href="./src/resources/browsers/live-view.ts">BrowserLiveView</a></code>
212+
- <code><a href="./src/resources/browsers/live-view.ts">BrowserLiveViewRequest</a></code>
213+
- <code><a href="./src/resources/browsers/live-view.ts">BrowserLiveViewScope</a></code>
214+
215+
Methods:
216+
217+
- <code title="post /browsers/{id_or_name}/live_view">client.browsers.liveView.<a href="./src/resources/browsers/live-view.ts">create</a>(idOrName, { ...params }) -> BrowserLiveView</code>
218+
207219
## Replays
208220

209221
Types:

‎src/resources/browsers/browsers.ts‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ import {
2020
ComputerTypeTextParams,
2121
ComputerWriteClipboardParams,
2222
} from './computer';
23+
import * as LiveViewAPI from './live-view';
24+
import {
25+
BrowserLiveView,
26+
BrowserLiveViewRequest,
27+
BrowserLiveViewScope,
28+
LiveView,
29+
LiveViewCreateParams,
30+
} from './live-view';
2331
import * as LogsAPI from './logs';
2432
import { LogStreamParams, Logs } from './logs';
2533
import * as ProcessAPI from './process';
@@ -161,6 +169,7 @@ import { browserFetch, type BrowserFetchInit } from '../../lib/browser-fetch';
161169

162170
export class Browsers extends APIResource {
163171
telemetry: TelemetryAPI.Telemetry = new TelemetryAPI.Telemetry(this._client);
172+
liveView: LiveViewAPI.LiveView = new LiveViewAPI.LiveView(this._client);
164173
replays: ReplaysAPI.Replays = new ReplaysAPI.Replays(this._client);
165174
fs: FsAPI.Fs = new FsAPI.Fs(this._client);
166175
process: ProcessAPI.Process = new ProcessAPI.Process(this._client);
@@ -2441,6 +2450,7 @@ export interface BrowserSaveProfileParams {
24412450
}
24422451

24432452
Browsers.Telemetry = TelemetryAPITelemetry;
2453+
Browsers.LiveView = LiveView;
24442454
Browsers.Replays = Replays;
24452455
Browsers.Fs = Fs;
24462456
Browsers.Process = Process;
@@ -2551,6 +2561,14 @@ export declare namespace Browsers {
25512561
type TelemetryStreamParams as TelemetryStreamParams,
25522562
};
25532563

2564+
export {
2565+
LiveView as LiveView,
2566+
type BrowserLiveView as BrowserLiveView,
2567+
type BrowserLiveViewRequest as BrowserLiveViewRequest,
2568+
type BrowserLiveViewScope as BrowserLiveViewScope,
2569+
type LiveViewCreateParams as LiveViewCreateParams,
2570+
};
2571+
25542572
export {
25552573
Replays as Replays,
25562574
type ReplayListResponse as ReplayListResponse,

‎src/resources/browsers/index.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ export {
7676
type FUploadZipParams,
7777
type FWriteFileParams,
7878
} from './fs/index';
79+
export {
80+
LiveView,
81+
type BrowserLiveView,
82+
type BrowserLiveViewRequest,
83+
type BrowserLiveViewScope,
84+
type LiveViewCreateParams,
85+
} from './live-view';
7986
export { Logs, type LogStreamParams } from './logs';
8087
export {
8188
Playwright,
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
import { APIResource } from '../../core/resource';
4+
import { APIPromise } from '../../core/api-promise';
5+
import { RequestOptions } from '../../internal/request-options';
6+
import { path } from '../../internal/utils/path';
7+
8+
/**
9+
* Create and manage browser sessions.
10+
*/
11+
export class LiveView extends APIResource {
12+
/**
13+
* Creates a live view URL for a headful browser that grants either read-only or
14+
* control access. The URL works only for the live view: it cannot connect to CDP,
15+
* WebDriver, or any other browser endpoint. A read-only URL shows the browser but
16+
* cannot send input, regardless of query parameters. The URL stays valid until the
17+
* browser is deleted, or until `ttl_seconds` elapse when set. For a browser
18+
* acquired from a pool, it stops working when the browser is released. Nothing is
19+
* stored, so a URL cannot be revoked before then.
20+
*
21+
* @example
22+
* ```ts
23+
* const browserLiveView =
24+
* await client.browsers.liveView.create(
25+
* 'htzv5orfit78e1m2biiifpbv',
26+
* );
27+
* ```
28+
*/
29+
create(
30+
idOrName: string,
31+
body: LiveViewCreateParams | null | undefined = {},
32+
options?: RequestOptions,
33+
): APIPromise<BrowserLiveView> {
34+
return this._client.post(path`/browsers/${idOrName}/live_view`, { body, ...options });
35+
}
36+
}
37+
38+
export interface BrowserLiveView {
39+
/**
40+
* `read` shows the browser without accepting input. `control` also lets the viewer
41+
* drive the browser through the live view.
42+
*/
43+
scope: BrowserLiveViewScope;
44+
45+
/**
46+
* Live view URL. Treat it as a credential.
47+
*/
48+
url: string;
49+
50+
/**
51+
* When the URL expires. Absent when it stays valid until the browser is deleted.
52+
*/
53+
expires_at?: string;
54+
}
55+
56+
export interface BrowserLiveViewRequest {
57+
/**
58+
* `read` shows the browser without accepting input. `control` also lets the viewer
59+
* drive the browser through the live view.
60+
*/
61+
scope?: BrowserLiveViewScope;
62+
63+
/**
64+
* Seconds until the URL expires. Omit to keep it valid until the browser is
65+
* deleted.
66+
*/
67+
ttl_seconds?: number;
68+
}
69+
70+
/**
71+
* `read` shows the browser without accepting input. `control` also lets the viewer
72+
* drive the browser through the live view.
73+
*/
74+
export type BrowserLiveViewScope = 'read' | 'control';
75+
76+
export interface LiveViewCreateParams {
77+
/**
78+
* `read` shows the browser without accepting input. `control` also lets the viewer
79+
* drive the browser through the live view.
80+
*/
81+
scope?: BrowserLiveViewScope;
82+
83+
/**
84+
* Seconds until the URL expires. Omit to keep it valid until the browser is
85+
* deleted.
86+
*/
87+
ttl_seconds?: number;
88+
}
89+
90+
export declare namespace LiveView {
91+
export {
92+
type BrowserLiveView as BrowserLiveView,
93+
type BrowserLiveViewRequest as BrowserLiveViewRequest,
94+
type BrowserLiveViewScope as BrowserLiveViewScope,
95+
type LiveViewCreateParams as LiveViewCreateParams,
96+
};
97+
}

‎src/resources/vaults/items.ts‎

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,9 +1170,10 @@ export interface CredentialVaultItem {
11701170
/**
11711171
* Kernel credentials advertise collect and fill when eligible. 1Password
11721172
* credentials advertise 1pw_create_access_request until a request is made,
1173-
* 1pw_access_request_status while its approval is pending, and 1pw_fill after
1174-
* access is granted. Managed auth credentials advertise fill while ready and
1175-
* nothing otherwise.
1173+
* 1pw_access_request_status while its approval is pending (and
1174+
* 1pw_create_access_request again once the 3-minute status-check window has
1175+
* passed), and 1pw_fill after access is granted. Managed auth credentials
1176+
* advertise fill while ready and nothing otherwise.
11761177
*/
11771178
available_operations: Array<CredentialVaultItem.AvailableOperation>;
11781179

@@ -1273,6 +1274,15 @@ export namespace CredentialVaultItem {
12731274
}
12741275

12751276
export interface OnePasswordAccessApprovalAction {
1277+
/**
1278+
* The access_request_reference value from url, for approving inside your own iOS
1279+
* or Android app with 1Password's action extension or authorization activity. Pass
1280+
* it unchanged; the grant comes back to your app, and 1pw_access_request_status
1281+
* records it in Kernel. Treat it like url, which carries the same request text,
1282+
* and keep it out of logs.
1283+
*/
1284+
access_request_reference: string;
1285+
12761286
/**
12771287
* Steps for the agent to hand approval to the human and poll the resulting
12781288
* decision.
@@ -1282,8 +1292,10 @@ export namespace CredentialVaultItem {
12821292
name: '1password_access_approval';
12831293

12841294
/**
1285-
* Native 1Password approval link. Present it to the account owner without
1286-
* modifying it; it does not grant access until they approve in their app.
1295+
* Native 1Password approval link. Present it to the account owner unchanged,
1296+
* except that you may append `&return_url=<URL-encoded URL>` so 1Password sends
1297+
* them back to your app after they decide (1Password 8.12.46 or later on iOS,
1298+
* Android and desktop). It does not grant access until they approve in their app.
12871299
*/
12881300
url: string;
12891301
}
@@ -2395,7 +2407,9 @@ export namespace OnePasswordCredentialVaultItemState {
23952407
has_autofill_token: boolean;
23962408

23972409
/**
2398-
* One of pending, resolved, denied, or failed.
2410+
* One of pending, resolved, denied, failed, expired, or unknown. expired returns
2411+
* the item to pending_authorization so access can be requested again; unknown is a
2412+
* state 1Password added later and is treated as failed.
23992413
*/
24002414
state: string;
24012415

@@ -4822,7 +4836,8 @@ export declare namespace ItemPerformOperationParams {
48224836
type: '1pw_access_request_status';
48234837

48244838
/**
4825-
* Body param
4839+
* Body param: How long to keep checking on the schedule. The call still waits for
4840+
* its first scheduled check, at most 20 seconds, when that comes later.
48264841
*/
48274842
timeout_seconds?: number;
48284843
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
import Kernel from '@onkernel/sdk';
4+
5+
const client = new Kernel({
6+
apiKey: 'My API Key',
7+
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
8+
});
9+
10+
describe('resource liveView', () => {
11+
// Mock server tests are disabled
12+
test.skip('create', async () => {
13+
const responsePromise = client.browsers.liveView.create('htzv5orfit78e1m2biiifpbv');
14+
const rawResponse = await responsePromise.asResponse();
15+
expect(rawResponse).toBeInstanceOf(Response);
16+
const response = await responsePromise;
17+
expect(response).not.toBeInstanceOf(Response);
18+
const dataAndResponse = await responsePromise.withResponse();
19+
expect(dataAndResponse.data).toBe(response);
20+
expect(dataAndResponse.response).toBe(rawResponse);
21+
});
22+
23+
// Mock server tests are disabled
24+
test.skip('create: request options and params are passed correctly', async () => {
25+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
26+
await expect(
27+
client.browsers.liveView.create(
28+
'htzv5orfit78e1m2biiifpbv',
29+
{ scope: 'read', ttl_seconds: 3600 },
30+
{ path: '/_stainless_unknown_path' },
31+
),
32+
).rejects.toThrow(Kernel.NotFoundError);
33+
});
34+
});

0 commit comments

Comments
 (0)