@onkernel/sdk 0.24.0 → 0.26.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 +38 -0
- package/LICENSE +1 -1
- package/README.md +9 -4
- package/client.d.mts +6 -6
- package/client.d.mts.map +1 -1
- package/client.d.ts +6 -6
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/package.json +2 -2
- package/resources/agents/agents.d.mts +2 -2
- package/resources/agents/agents.d.mts.map +1 -1
- package/resources/agents/agents.d.ts +2 -2
- package/resources/agents/agents.d.ts.map +1 -1
- package/resources/agents/agents.js.map +1 -1
- package/resources/agents/agents.mjs.map +1 -1
- package/resources/agents/auth/auth.d.mts +135 -126
- package/resources/agents/auth/auth.d.mts.map +1 -1
- package/resources/agents/auth/auth.d.ts +135 -126
- package/resources/agents/auth/auth.d.ts.map +1 -1
- package/resources/agents/auth/auth.js +2 -18
- package/resources/agents/auth/auth.js.map +1 -1
- package/resources/agents/auth/auth.mjs +2 -18
- package/resources/agents/auth/auth.mjs.map +1 -1
- package/resources/agents/auth/index.d.mts +2 -2
- package/resources/agents/auth/index.d.mts.map +1 -1
- package/resources/agents/auth/index.d.ts +2 -2
- package/resources/agents/auth/index.d.ts.map +1 -1
- package/resources/agents/auth/index.js.map +1 -1
- package/resources/agents/auth/index.mjs.map +1 -1
- package/resources/agents/auth/invocations.d.mts +28 -33
- package/resources/agents/auth/invocations.d.mts.map +1 -1
- package/resources/agents/auth/invocations.d.ts +28 -33
- package/resources/agents/auth/invocations.d.ts.map +1 -1
- package/resources/agents/auth/invocations.js +5 -20
- package/resources/agents/auth/invocations.js.map +1 -1
- package/resources/agents/auth/invocations.mjs +5 -20
- package/resources/agents/auth/invocations.mjs.map +1 -1
- package/resources/agents/index.d.mts +1 -1
- package/resources/agents/index.d.mts.map +1 -1
- package/resources/agents/index.d.ts +1 -1
- package/resources/agents/index.d.ts.map +1 -1
- package/resources/agents/index.js.map +1 -1
- package/resources/agents/index.mjs.map +1 -1
- package/resources/browsers/browsers.d.mts +84 -3
- package/resources/browsers/browsers.d.mts.map +1 -1
- package/resources/browsers/browsers.d.ts +84 -3
- package/resources/browsers/browsers.d.ts.map +1 -1
- package/resources/browsers/browsers.js +13 -0
- package/resources/browsers/browsers.js.map +1 -1
- package/resources/browsers/browsers.mjs +13 -0
- package/resources/browsers/browsers.mjs.map +1 -1
- package/resources/browsers/index.d.mts +2 -2
- package/resources/browsers/index.d.mts.map +1 -1
- package/resources/browsers/index.d.ts +2 -2
- 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/process.d.mts +52 -1
- package/resources/browsers/process.d.mts.map +1 -1
- package/resources/browsers/process.d.ts +52 -1
- package/resources/browsers/process.d.ts.map +1 -1
- package/resources/browsers/process.js +19 -0
- package/resources/browsers/process.js.map +1 -1
- package/resources/browsers/process.mjs +19 -0
- package/resources/browsers/process.mjs.map +1 -1
- package/resources/credentials.d.mts +107 -16
- package/resources/credentials.d.mts.map +1 -1
- package/resources/credentials.d.ts +107 -16
- package/resources/credentials.d.ts.map +1 -1
- package/resources/credentials.js +33 -14
- package/resources/credentials.js.map +1 -1
- package/resources/credentials.mjs +33 -14
- package/resources/credentials.mjs.map +1 -1
- package/resources/index.d.mts +3 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/proxies.d.mts +153 -1
- package/resources/proxies.d.mts.map +1 -1
- package/resources/proxies.d.ts +153 -1
- package/resources/proxies.d.ts.map +1 -1
- package/resources/proxies.js +6 -0
- package/resources/proxies.js.map +1 -1
- package/resources/proxies.mjs +6 -0
- package/resources/proxies.mjs.map +1 -1
- package/src/client.ts +8 -0
- package/src/resources/agents/agents.ts +0 -4
- package/src/resources/agents/auth/auth.ts +146 -136
- package/src/resources/agents/auth/index.ts +0 -3
- package/src/resources/agents/auth/invocations.ts +31 -39
- package/src/resources/agents/index.ts +0 -2
- package/src/resources/browsers/browsers.ts +104 -0
- package/src/resources/browsers/index.ts +4 -0
- package/src/resources/browsers/process.ts +68 -0
- package/src/resources/credentials.ts +127 -18
- package/src/resources/index.ts +4 -0
- package/src/resources/proxies.ts +248 -0
- 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
|
@@ -26,6 +26,8 @@ import {
|
|
|
26
26
|
ProcessExecResponse,
|
|
27
27
|
ProcessKillParams,
|
|
28
28
|
ProcessKillResponse,
|
|
29
|
+
ProcessResizeParams,
|
|
30
|
+
ProcessResizeResponse,
|
|
29
31
|
ProcessSpawnParams,
|
|
30
32
|
ProcessSpawnResponse,
|
|
31
33
|
ProcessStatusParams,
|
|
@@ -107,6 +109,20 @@ export class Browsers extends APIResource {
|
|
|
107
109
|
return this._client.get(path`/browsers/${id}`, options);
|
|
108
110
|
}
|
|
109
111
|
|
|
112
|
+
/**
|
|
113
|
+
* Update a browser session.
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```ts
|
|
117
|
+
* const browser = await client.browsers.update(
|
|
118
|
+
* 'htzv5orfit78e1m2biiifpbv',
|
|
119
|
+
* );
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
update(id: string, body: BrowserUpdateParams, options?: RequestOptions): APIPromise<BrowserUpdateResponse> {
|
|
123
|
+
return this._client.patch(path`/browsers/${id}`, { body, ...options });
|
|
124
|
+
}
|
|
125
|
+
|
|
110
126
|
/**
|
|
111
127
|
* List all browser sessions with pagination support. Use include_deleted=true to
|
|
112
128
|
* include soft-deleted sessions in the results.
|
|
@@ -380,6 +396,82 @@ export interface BrowserRetrieveResponse {
|
|
|
380
396
|
viewport?: Shared.BrowserViewport;
|
|
381
397
|
}
|
|
382
398
|
|
|
399
|
+
export interface BrowserUpdateResponse {
|
|
400
|
+
/**
|
|
401
|
+
* Websocket URL for Chrome DevTools Protocol connections to the browser session
|
|
402
|
+
*/
|
|
403
|
+
cdp_ws_url: string;
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* When the browser session was created.
|
|
407
|
+
*/
|
|
408
|
+
created_at: string;
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* Whether the browser session is running in headless mode.
|
|
412
|
+
*/
|
|
413
|
+
headless: boolean;
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* Unique identifier for the browser session
|
|
417
|
+
*/
|
|
418
|
+
session_id: string;
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* Whether the browser session is running in stealth mode.
|
|
422
|
+
*/
|
|
423
|
+
stealth: boolean;
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* The number of seconds of inactivity before the browser session is terminated.
|
|
427
|
+
*/
|
|
428
|
+
timeout_seconds: number;
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* Remote URL for live viewing the browser session. Only available for non-headless
|
|
432
|
+
* browsers.
|
|
433
|
+
*/
|
|
434
|
+
browser_live_view_url?: string;
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* When the browser session was soft-deleted. Only present for deleted sessions.
|
|
438
|
+
*/
|
|
439
|
+
deleted_at?: string;
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Whether the browser session is running in kiosk mode.
|
|
443
|
+
*/
|
|
444
|
+
kiosk_mode?: boolean;
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* @deprecated DEPRECATED: Use timeout_seconds (up to 72 hours) and Profiles
|
|
448
|
+
* instead.
|
|
449
|
+
*/
|
|
450
|
+
persistence?: BrowserPersistence;
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* Browser profile metadata.
|
|
454
|
+
*/
|
|
455
|
+
profile?: Profile;
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* ID of the proxy associated with this browser session, if any.
|
|
459
|
+
*/
|
|
460
|
+
proxy_id?: string;
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Initial browser window size in pixels with optional refresh rate. If omitted,
|
|
464
|
+
* image defaults apply (1920x1080@25). Only specific viewport configurations are
|
|
465
|
+
* supported. The server will reject unsupported combinations. Supported
|
|
466
|
+
* resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25,
|
|
467
|
+
* 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will be
|
|
468
|
+
* automatically determined from the width and height if they match a supported
|
|
469
|
+
* configuration exactly. Note: Higher resolutions may affect the responsiveness of
|
|
470
|
+
* live view browser
|
|
471
|
+
*/
|
|
472
|
+
viewport?: Shared.BrowserViewport;
|
|
473
|
+
}
|
|
474
|
+
|
|
383
475
|
export interface BrowserListResponse {
|
|
384
476
|
/**
|
|
385
477
|
* Websocket URL for Chrome DevTools Protocol connections to the browser session
|
|
@@ -526,6 +618,14 @@ export interface BrowserCreateParams {
|
|
|
526
618
|
viewport?: Shared.BrowserViewport;
|
|
527
619
|
}
|
|
528
620
|
|
|
621
|
+
export interface BrowserUpdateParams {
|
|
622
|
+
/**
|
|
623
|
+
* ID of the proxy to use. Omit to leave unchanged, set to empty string to remove
|
|
624
|
+
* proxy.
|
|
625
|
+
*/
|
|
626
|
+
proxy_id?: string | null;
|
|
627
|
+
}
|
|
628
|
+
|
|
529
629
|
export interface BrowserListParams extends OffsetPaginationParams {
|
|
530
630
|
/**
|
|
531
631
|
* When true, includes soft-deleted browser sessions in the results alongside
|
|
@@ -576,9 +676,11 @@ export declare namespace Browsers {
|
|
|
576
676
|
type Profile as Profile,
|
|
577
677
|
type BrowserCreateResponse as BrowserCreateResponse,
|
|
578
678
|
type BrowserRetrieveResponse as BrowserRetrieveResponse,
|
|
679
|
+
type BrowserUpdateResponse as BrowserUpdateResponse,
|
|
579
680
|
type BrowserListResponse as BrowserListResponse,
|
|
580
681
|
type BrowserListResponsesOffsetPagination as BrowserListResponsesOffsetPagination,
|
|
581
682
|
type BrowserCreateParams as BrowserCreateParams,
|
|
683
|
+
type BrowserUpdateParams as BrowserUpdateParams,
|
|
582
684
|
type BrowserListParams as BrowserListParams,
|
|
583
685
|
type BrowserDeleteParams as BrowserDeleteParams,
|
|
584
686
|
type BrowserLoadExtensionsParams as BrowserLoadExtensionsParams,
|
|
@@ -615,12 +717,14 @@ export declare namespace Browsers {
|
|
|
615
717
|
Process as Process,
|
|
616
718
|
type ProcessExecResponse as ProcessExecResponse,
|
|
617
719
|
type ProcessKillResponse as ProcessKillResponse,
|
|
720
|
+
type ProcessResizeResponse as ProcessResizeResponse,
|
|
618
721
|
type ProcessSpawnResponse as ProcessSpawnResponse,
|
|
619
722
|
type ProcessStatusResponse as ProcessStatusResponse,
|
|
620
723
|
type ProcessStdinResponse as ProcessStdinResponse,
|
|
621
724
|
type ProcessStdoutStreamResponse as ProcessStdoutStreamResponse,
|
|
622
725
|
type ProcessExecParams as ProcessExecParams,
|
|
623
726
|
type ProcessKillParams as ProcessKillParams,
|
|
727
|
+
type ProcessResizeParams as ProcessResizeParams,
|
|
624
728
|
type ProcessSpawnParams as ProcessSpawnParams,
|
|
625
729
|
type ProcessStatusParams as ProcessStatusParams,
|
|
626
730
|
type ProcessStdinParams as ProcessStdinParams,
|
|
@@ -6,8 +6,10 @@ export {
|
|
|
6
6
|
type Profile,
|
|
7
7
|
type BrowserCreateResponse,
|
|
8
8
|
type BrowserRetrieveResponse,
|
|
9
|
+
type BrowserUpdateResponse,
|
|
9
10
|
type BrowserListResponse,
|
|
10
11
|
type BrowserCreateParams,
|
|
12
|
+
type BrowserUpdateParams,
|
|
11
13
|
type BrowserListParams,
|
|
12
14
|
type BrowserDeleteParams,
|
|
13
15
|
type BrowserLoadExtensionsParams,
|
|
@@ -48,12 +50,14 @@ export {
|
|
|
48
50
|
Process,
|
|
49
51
|
type ProcessExecResponse,
|
|
50
52
|
type ProcessKillResponse,
|
|
53
|
+
type ProcessResizeResponse,
|
|
51
54
|
type ProcessSpawnResponse,
|
|
52
55
|
type ProcessStatusResponse,
|
|
53
56
|
type ProcessStdinResponse,
|
|
54
57
|
type ProcessStdoutStreamResponse,
|
|
55
58
|
type ProcessExecParams,
|
|
56
59
|
type ProcessKillParams,
|
|
60
|
+
type ProcessResizeParams,
|
|
57
61
|
type ProcessSpawnParams,
|
|
58
62
|
type ProcessStatusParams,
|
|
59
63
|
type ProcessStdinParams,
|
|
@@ -42,6 +42,30 @@ export class Process extends APIResource {
|
|
|
42
42
|
return this._client.post(path`/browsers/${id}/process/${processID}/kill`, { body, ...options });
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
/**
|
|
46
|
+
* Resize a PTY-backed process terminal
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const response = await client.browsers.process.resize(
|
|
51
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
52
|
+
* {
|
|
53
|
+
* id: 'id',
|
|
54
|
+
* cols: 1,
|
|
55
|
+
* rows: 1,
|
|
56
|
+
* },
|
|
57
|
+
* );
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
resize(
|
|
61
|
+
processID: string,
|
|
62
|
+
params: ProcessResizeParams,
|
|
63
|
+
options?: RequestOptions,
|
|
64
|
+
): APIPromise<ProcessResizeResponse> {
|
|
65
|
+
const { id, ...body } = params;
|
|
66
|
+
return this._client.post(path`/browsers/${id}/process/${processID}/resize`, { body, ...options });
|
|
67
|
+
}
|
|
68
|
+
|
|
45
69
|
/**
|
|
46
70
|
* Execute a command asynchronously
|
|
47
71
|
*
|
|
@@ -156,6 +180,16 @@ export interface ProcessKillResponse {
|
|
|
156
180
|
ok: boolean;
|
|
157
181
|
}
|
|
158
182
|
|
|
183
|
+
/**
|
|
184
|
+
* Generic OK response.
|
|
185
|
+
*/
|
|
186
|
+
export interface ProcessResizeResponse {
|
|
187
|
+
/**
|
|
188
|
+
* Indicates success.
|
|
189
|
+
*/
|
|
190
|
+
ok: boolean;
|
|
191
|
+
}
|
|
192
|
+
|
|
159
193
|
/**
|
|
160
194
|
* Information about a spawned process.
|
|
161
195
|
*/
|
|
@@ -285,12 +319,34 @@ export interface ProcessKillParams {
|
|
|
285
319
|
signal: 'TERM' | 'KILL' | 'INT' | 'HUP';
|
|
286
320
|
}
|
|
287
321
|
|
|
322
|
+
export interface ProcessResizeParams {
|
|
323
|
+
/**
|
|
324
|
+
* Path param: Browser session ID
|
|
325
|
+
*/
|
|
326
|
+
id: string;
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Body param: New terminal columns.
|
|
330
|
+
*/
|
|
331
|
+
cols: number;
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Body param: New terminal rows.
|
|
335
|
+
*/
|
|
336
|
+
rows: number;
|
|
337
|
+
}
|
|
338
|
+
|
|
288
339
|
export interface ProcessSpawnParams {
|
|
289
340
|
/**
|
|
290
341
|
* Executable or shell command to run.
|
|
291
342
|
*/
|
|
292
343
|
command: string;
|
|
293
344
|
|
|
345
|
+
/**
|
|
346
|
+
* Allocate a pseudo-terminal (PTY) for interactive shells.
|
|
347
|
+
*/
|
|
348
|
+
allocate_tty?: boolean;
|
|
349
|
+
|
|
294
350
|
/**
|
|
295
351
|
* Command arguments.
|
|
296
352
|
*/
|
|
@@ -306,6 +362,11 @@ export interface ProcessSpawnParams {
|
|
|
306
362
|
*/
|
|
307
363
|
as_user?: string | null;
|
|
308
364
|
|
|
365
|
+
/**
|
|
366
|
+
* Initial terminal columns. Only used when allocate_tty is true.
|
|
367
|
+
*/
|
|
368
|
+
cols?: number;
|
|
369
|
+
|
|
309
370
|
/**
|
|
310
371
|
* Working directory (absolute path) to run the command in.
|
|
311
372
|
*/
|
|
@@ -316,6 +377,11 @@ export interface ProcessSpawnParams {
|
|
|
316
377
|
*/
|
|
317
378
|
env?: { [key: string]: string };
|
|
318
379
|
|
|
380
|
+
/**
|
|
381
|
+
* Initial terminal rows. Only used when allocate_tty is true.
|
|
382
|
+
*/
|
|
383
|
+
rows?: number;
|
|
384
|
+
|
|
319
385
|
/**
|
|
320
386
|
* Maximum execution time in seconds.
|
|
321
387
|
*/
|
|
@@ -352,12 +418,14 @@ export declare namespace Process {
|
|
|
352
418
|
export {
|
|
353
419
|
type ProcessExecResponse as ProcessExecResponse,
|
|
354
420
|
type ProcessKillResponse as ProcessKillResponse,
|
|
421
|
+
type ProcessResizeResponse as ProcessResizeResponse,
|
|
355
422
|
type ProcessSpawnResponse as ProcessSpawnResponse,
|
|
356
423
|
type ProcessStatusResponse as ProcessStatusResponse,
|
|
357
424
|
type ProcessStdinResponse as ProcessStdinResponse,
|
|
358
425
|
type ProcessStdoutStreamResponse as ProcessStdoutStreamResponse,
|
|
359
426
|
type ProcessExecParams as ProcessExecParams,
|
|
360
427
|
type ProcessKillParams as ProcessKillParams,
|
|
428
|
+
type ProcessResizeParams as ProcessResizeParams,
|
|
361
429
|
type ProcessSpawnParams as ProcessSpawnParams,
|
|
362
430
|
type ProcessStatusParams as ProcessStatusParams,
|
|
363
431
|
type ProcessStdinParams as ProcessStdinParams,
|
|
@@ -9,8 +9,7 @@ import { path } from '../internal/utils/path';
|
|
|
9
9
|
|
|
10
10
|
export class Credentials extends APIResource {
|
|
11
11
|
/**
|
|
12
|
-
* Create a new credential for storing login information.
|
|
13
|
-
* rest.
|
|
12
|
+
* Create a new credential for storing login information.
|
|
14
13
|
*
|
|
15
14
|
* @example
|
|
16
15
|
* ```ts
|
|
@@ -29,27 +28,32 @@ export class Credentials extends APIResource {
|
|
|
29
28
|
}
|
|
30
29
|
|
|
31
30
|
/**
|
|
32
|
-
* Retrieve a credential by its ID. Credential values are not returned.
|
|
31
|
+
* Retrieve a credential by its ID or name. Credential values are not returned.
|
|
33
32
|
*
|
|
34
33
|
* @example
|
|
35
34
|
* ```ts
|
|
36
|
-
* const credential = await client.credentials.retrieve(
|
|
35
|
+
* const credential = await client.credentials.retrieve(
|
|
36
|
+
* 'id_or_name',
|
|
37
|
+
* );
|
|
37
38
|
* ```
|
|
38
39
|
*/
|
|
39
|
-
retrieve(
|
|
40
|
-
return this._client.get(path`/credentials/${
|
|
40
|
+
retrieve(idOrName: string, options?: RequestOptions): APIPromise<Credential> {
|
|
41
|
+
return this._client.get(path`/credentials/${idOrName}`, options);
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
/**
|
|
44
|
-
* Update a credential's name or values.
|
|
45
|
+
* Update a credential's name or values. When values are provided, they are merged
|
|
46
|
+
* with existing values (new keys are added, existing keys are overwritten).
|
|
45
47
|
*
|
|
46
48
|
* @example
|
|
47
49
|
* ```ts
|
|
48
|
-
* const credential = await client.credentials.update(
|
|
50
|
+
* const credential = await client.credentials.update(
|
|
51
|
+
* 'id_or_name',
|
|
52
|
+
* );
|
|
49
53
|
* ```
|
|
50
54
|
*/
|
|
51
|
-
update(
|
|
52
|
-
return this._client.patch(path`/credentials/${
|
|
55
|
+
update(idOrName: string, body: CredentialUpdateParams, options?: RequestOptions): APIPromise<Credential> {
|
|
56
|
+
return this._client.patch(path`/credentials/${idOrName}`, { body, ...options });
|
|
53
57
|
}
|
|
54
58
|
|
|
55
59
|
/**
|
|
@@ -72,19 +76,35 @@ export class Credentials extends APIResource {
|
|
|
72
76
|
}
|
|
73
77
|
|
|
74
78
|
/**
|
|
75
|
-
* Delete a credential by its ID.
|
|
79
|
+
* Delete a credential by its ID or name.
|
|
76
80
|
*
|
|
77
81
|
* @example
|
|
78
82
|
* ```ts
|
|
79
|
-
* await client.credentials.delete('
|
|
83
|
+
* await client.credentials.delete('id_or_name');
|
|
80
84
|
* ```
|
|
81
85
|
*/
|
|
82
|
-
delete(
|
|
83
|
-
return this._client.delete(path`/credentials/${
|
|
86
|
+
delete(idOrName: string, options?: RequestOptions): APIPromise<void> {
|
|
87
|
+
return this._client.delete(path`/credentials/${idOrName}`, {
|
|
84
88
|
...options,
|
|
85
89
|
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
86
90
|
});
|
|
87
91
|
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Returns the current 6-digit TOTP code for a credential with a configured
|
|
95
|
+
* totp_secret. Use this to complete 2FA setup on sites or when you need a fresh
|
|
96
|
+
* code.
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```ts
|
|
100
|
+
* const response = await client.credentials.totpCode(
|
|
101
|
+
* 'id_or_name',
|
|
102
|
+
* );
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
totpCode(idOrName: string, options?: RequestOptions): APIPromise<CredentialTotpCodeResponse> {
|
|
106
|
+
return this._client.get(path`/credentials/${idOrName}/totp-code`, options);
|
|
107
|
+
}
|
|
88
108
|
}
|
|
89
109
|
|
|
90
110
|
export type CredentialsOffsetPagination = OffsetPagination<Credential>;
|
|
@@ -107,6 +127,20 @@ export interface CreateCredentialRequest {
|
|
|
107
127
|
* Field name to value mapping (e.g., username, password)
|
|
108
128
|
*/
|
|
109
129
|
values: { [key: string]: string };
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* If set, indicates this credential should be used with the specified SSO provider
|
|
133
|
+
* (e.g., google, github, microsoft). When the target site has a matching SSO
|
|
134
|
+
* button, it will be clicked first before filling credential values on the
|
|
135
|
+
* identity provider's login page.
|
|
136
|
+
*/
|
|
137
|
+
sso_provider?: string;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Base32-encoded TOTP secret for generating one-time passwords. Used for automatic
|
|
141
|
+
* 2FA during login.
|
|
142
|
+
*/
|
|
143
|
+
totp_secret?: string;
|
|
110
144
|
}
|
|
111
145
|
|
|
112
146
|
/**
|
|
@@ -137,6 +171,30 @@ export interface Credential {
|
|
|
137
171
|
* When the credential was last updated
|
|
138
172
|
*/
|
|
139
173
|
updated_at: string;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Whether this credential has a TOTP secret configured for automatic 2FA
|
|
177
|
+
*/
|
|
178
|
+
has_totp_secret?: boolean;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* If set, indicates this credential should be used with the specified SSO provider
|
|
182
|
+
* (e.g., google, github, microsoft). When the target site has a matching SSO
|
|
183
|
+
* button, it will be clicked first before filling credential values on the
|
|
184
|
+
* identity provider's login page.
|
|
185
|
+
*/
|
|
186
|
+
sso_provider?: string | null;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Current 6-digit TOTP code. Only included in create/update responses when
|
|
190
|
+
* totp_secret was just set.
|
|
191
|
+
*/
|
|
192
|
+
totp_code?: string;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* When the totp_code expires. Only included when totp_code is present.
|
|
196
|
+
*/
|
|
197
|
+
totp_code_expires_at?: string;
|
|
140
198
|
}
|
|
141
199
|
|
|
142
200
|
/**
|
|
@@ -149,12 +207,36 @@ export interface UpdateCredentialRequest {
|
|
|
149
207
|
name?: string;
|
|
150
208
|
|
|
151
209
|
/**
|
|
152
|
-
*
|
|
153
|
-
*
|
|
210
|
+
* If set, indicates this credential should be used with the specified SSO
|
|
211
|
+
* provider. Set to empty string or null to remove.
|
|
212
|
+
*/
|
|
213
|
+
sso_provider?: string | null;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Base32-encoded TOTP secret for generating one-time passwords. Spaces and
|
|
217
|
+
* formatting are automatically normalized. Set to empty string to remove.
|
|
218
|
+
*/
|
|
219
|
+
totp_secret?: string;
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Field name to value mapping. Values are merged with existing values (new keys
|
|
223
|
+
* added, existing keys overwritten).
|
|
154
224
|
*/
|
|
155
225
|
values?: { [key: string]: string };
|
|
156
226
|
}
|
|
157
227
|
|
|
228
|
+
export interface CredentialTotpCodeResponse {
|
|
229
|
+
/**
|
|
230
|
+
* Current 6-digit TOTP code
|
|
231
|
+
*/
|
|
232
|
+
code: string;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* When this code expires (ISO 8601 timestamp)
|
|
236
|
+
*/
|
|
237
|
+
expires_at: string;
|
|
238
|
+
}
|
|
239
|
+
|
|
158
240
|
export interface CredentialCreateParams {
|
|
159
241
|
/**
|
|
160
242
|
* Target domain this credential is for
|
|
@@ -170,6 +252,20 @@ export interface CredentialCreateParams {
|
|
|
170
252
|
* Field name to value mapping (e.g., username, password)
|
|
171
253
|
*/
|
|
172
254
|
values: { [key: string]: string };
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* If set, indicates this credential should be used with the specified SSO provider
|
|
258
|
+
* (e.g., google, github, microsoft). When the target site has a matching SSO
|
|
259
|
+
* button, it will be clicked first before filling credential values on the
|
|
260
|
+
* identity provider's login page.
|
|
261
|
+
*/
|
|
262
|
+
sso_provider?: string;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Base32-encoded TOTP secret for generating one-time passwords. Used for automatic
|
|
266
|
+
* 2FA during login.
|
|
267
|
+
*/
|
|
268
|
+
totp_secret?: string;
|
|
173
269
|
}
|
|
174
270
|
|
|
175
271
|
export interface CredentialUpdateParams {
|
|
@@ -179,8 +275,20 @@ export interface CredentialUpdateParams {
|
|
|
179
275
|
name?: string;
|
|
180
276
|
|
|
181
277
|
/**
|
|
182
|
-
*
|
|
183
|
-
*
|
|
278
|
+
* If set, indicates this credential should be used with the specified SSO
|
|
279
|
+
* provider. Set to empty string or null to remove.
|
|
280
|
+
*/
|
|
281
|
+
sso_provider?: string | null;
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Base32-encoded TOTP secret for generating one-time passwords. Spaces and
|
|
285
|
+
* formatting are automatically normalized. Set to empty string to remove.
|
|
286
|
+
*/
|
|
287
|
+
totp_secret?: string;
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Field name to value mapping. Values are merged with existing values (new keys
|
|
291
|
+
* added, existing keys overwritten).
|
|
184
292
|
*/
|
|
185
293
|
values?: { [key: string]: string };
|
|
186
294
|
}
|
|
@@ -197,6 +305,7 @@ export declare namespace Credentials {
|
|
|
197
305
|
type CreateCredentialRequest as CreateCredentialRequest,
|
|
198
306
|
type Credential as Credential,
|
|
199
307
|
type UpdateCredentialRequest as UpdateCredentialRequest,
|
|
308
|
+
type CredentialTotpCodeResponse as CredentialTotpCodeResponse,
|
|
200
309
|
type CredentialsOffsetPagination as CredentialsOffsetPagination,
|
|
201
310
|
type CredentialCreateParams as CredentialCreateParams,
|
|
202
311
|
type CredentialUpdateParams as CredentialUpdateParams,
|
package/src/resources/index.ts
CHANGED
|
@@ -25,8 +25,10 @@ export {
|
|
|
25
25
|
type Profile,
|
|
26
26
|
type BrowserCreateResponse,
|
|
27
27
|
type BrowserRetrieveResponse,
|
|
28
|
+
type BrowserUpdateResponse,
|
|
28
29
|
type BrowserListResponse,
|
|
29
30
|
type BrowserCreateParams,
|
|
31
|
+
type BrowserUpdateParams,
|
|
30
32
|
type BrowserListParams,
|
|
31
33
|
type BrowserDeleteParams,
|
|
32
34
|
type BrowserLoadExtensionsParams,
|
|
@@ -37,6 +39,7 @@ export {
|
|
|
37
39
|
type CreateCredentialRequest,
|
|
38
40
|
type Credential,
|
|
39
41
|
type UpdateCredentialRequest,
|
|
42
|
+
type CredentialTotpCodeResponse,
|
|
40
43
|
type CredentialCreateParams,
|
|
41
44
|
type CredentialUpdateParams,
|
|
42
45
|
type CredentialListParams,
|
|
@@ -81,5 +84,6 @@ export {
|
|
|
81
84
|
type ProxyCreateResponse,
|
|
82
85
|
type ProxyRetrieveResponse,
|
|
83
86
|
type ProxyListResponse,
|
|
87
|
+
type ProxyCheckResponse,
|
|
84
88
|
type ProxyCreateParams,
|
|
85
89
|
} from './proxies';
|