@onkernel/sdk 0.7.0 → 0.8.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 +31 -0
- package/client.d.mts +6 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +6 -4
- package/client.d.ts.map +1 -1
- package/client.js +13 -10
- package/client.js.map +1 -1
- package/client.mjs +13 -10
- package/client.mjs.map +1 -1
- package/core/streaming.d.mts +5 -3
- package/core/streaming.d.mts.map +1 -1
- package/core/streaming.d.ts +5 -3
- package/core/streaming.d.ts.map +1 -1
- package/core/streaming.js +16 -10
- package/core/streaming.js.map +1 -1
- package/core/streaming.mjs +16 -10
- package/core/streaming.mjs.map +1 -1
- package/internal/parse.js +2 -2
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +2 -2
- package/internal/parse.mjs.map +1 -1
- package/internal/request-options.d.mts +42 -0
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts +42 -0
- package/internal/request-options.d.ts.map +1 -1
- package/internal/request-options.js.map +1 -1
- package/internal/request-options.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/browsers/browsers.d.mts +160 -0
- package/resources/browsers/browsers.d.mts.map +1 -0
- package/resources/browsers/browsers.d.ts +160 -0
- package/resources/browsers/browsers.d.ts.map +1 -0
- package/resources/browsers/browsers.js +88 -0
- package/resources/browsers/browsers.js.map +1 -0
- package/resources/browsers/browsers.mjs +83 -0
- package/resources/browsers/browsers.mjs.map +1 -0
- package/resources/browsers/index.d.mts +3 -0
- package/resources/browsers/index.d.mts.map +1 -0
- package/resources/browsers/index.d.ts +3 -0
- package/resources/browsers/index.d.ts.map +1 -0
- package/resources/browsers/index.js +9 -0
- package/resources/browsers/index.js.map +1 -0
- package/resources/browsers/index.mjs +4 -0
- package/resources/browsers/index.mjs.map +1 -0
- package/resources/browsers/replays.d.mts +120 -0
- package/resources/browsers/replays.d.mts.map +1 -0
- package/resources/browsers/replays.d.ts +120 -0
- package/resources/browsers/replays.d.ts.map +1 -0
- package/resources/browsers/replays.js +72 -0
- package/resources/browsers/replays.js.map +1 -0
- package/resources/browsers/replays.mjs +68 -0
- package/resources/browsers/replays.mjs.map +1 -0
- package/resources/browsers.d.mts +1 -155
- package/resources/browsers.d.mts.map +1 -1
- package/resources/browsers.d.ts +1 -155
- package/resources/browsers.d.ts.map +1 -1
- package/resources/browsers.js +2 -76
- package/resources/browsers.js.map +1 -1
- package/resources/browsers.mjs +1 -74
- package/resources/browsers.mjs.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.js +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/src/client.ts +25 -20
- package/src/core/streaming.ts +22 -8
- package/src/internal/parse.ts +2 -2
- package/src/internal/request-options.ts +53 -0
- package/src/resources/browsers/browsers.ts +234 -0
- package/src/resources/browsers/index.ts +19 -0
- package/src/resources/browsers/replays.ts +168 -0
- package/src/resources/browsers.ts +1 -210
- package/src/resources/index.ts +1 -1
- 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,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Replays = void 0;
|
|
5
|
+
const resource_1 = require("../../core/resource.js");
|
|
6
|
+
const headers_1 = require("../../internal/headers.js");
|
|
7
|
+
const path_1 = require("../../internal/utils/path.js");
|
|
8
|
+
class Replays extends resource_1.APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* List all replays for the specified browser session.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const replays = await client.browsers.replays.list('id');
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
list(id, options) {
|
|
18
|
+
return this._client.get((0, path_1.path) `/browsers/${id}/replays`, options);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Download or stream the specified replay recording.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const response = await client.browsers.replays.download(
|
|
26
|
+
* 'replay_id',
|
|
27
|
+
* { id: 'id' },
|
|
28
|
+
* );
|
|
29
|
+
*
|
|
30
|
+
* const content = await response.blob();
|
|
31
|
+
* console.log(content);
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
download(replayID, params, options) {
|
|
35
|
+
const { id } = params;
|
|
36
|
+
return this._client.get((0, path_1.path) `/browsers/${id}/replays/${replayID}`, {
|
|
37
|
+
...options,
|
|
38
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: 'video/mp4' }, options?.headers]),
|
|
39
|
+
__binaryResponse: true,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Start recording the browser session and return a replay ID.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const response = await client.browsers.replays.start('id');
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
start(id, body = {}, options) {
|
|
51
|
+
return this._client.post((0, path_1.path) `/browsers/${id}/replays`, { body, ...options });
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Stop the specified replay recording and persist the video.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* await client.browsers.replays.stop('replay_id', {
|
|
59
|
+
* id: 'id',
|
|
60
|
+
* });
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
stop(replayID, params, options) {
|
|
64
|
+
const { id } = params;
|
|
65
|
+
return this._client.post((0, path_1.path) `/browsers/${id}/replays/${replayID}/stop`, {
|
|
66
|
+
...options,
|
|
67
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.Replays = Replays;
|
|
72
|
+
//# sourceMappingURL=replays.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replays.js","sourceRoot":"","sources":["../../src/resources/browsers/replays.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAElD,uDAAsD;AAEtD,uDAAiD;AAEjD,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;;;OAOG;IACH,IAAI,CAAC,EAAU,EAAE,OAAwB;QACvC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,aAAa,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,QAAgB,EAAE,MAA4B,EAAE,OAAwB;QAC/E,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,CAAC;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,aAAa,EAAE,YAAY,QAAQ,EAAE,EAAE;YACjE,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAClE,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CACH,EAAU,EACV,OAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,aAAa,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;IAED;;;;;;;;;OASG;IACH,IAAI,CAAC,QAAgB,EAAE,MAAwB,EAAE,OAAwB;QACvE,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,CAAC;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,aAAa,EAAE,YAAY,QAAQ,OAAO,EAAE;YACvE,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF;AArED,0BAqEC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import { buildHeaders } from "../../internal/headers.mjs";
|
|
4
|
+
import { path } from "../../internal/utils/path.mjs";
|
|
5
|
+
export class Replays extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* List all replays for the specified browser session.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const replays = await client.browsers.replays.list('id');
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
list(id, options) {
|
|
15
|
+
return this._client.get(path `/browsers/${id}/replays`, options);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Download or stream the specified replay recording.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* const response = await client.browsers.replays.download(
|
|
23
|
+
* 'replay_id',
|
|
24
|
+
* { id: 'id' },
|
|
25
|
+
* );
|
|
26
|
+
*
|
|
27
|
+
* const content = await response.blob();
|
|
28
|
+
* console.log(content);
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
download(replayID, params, options) {
|
|
32
|
+
const { id } = params;
|
|
33
|
+
return this._client.get(path `/browsers/${id}/replays/${replayID}`, {
|
|
34
|
+
...options,
|
|
35
|
+
headers: buildHeaders([{ Accept: 'video/mp4' }, options?.headers]),
|
|
36
|
+
__binaryResponse: true,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Start recording the browser session and return a replay ID.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const response = await client.browsers.replays.start('id');
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
start(id, body = {}, options) {
|
|
48
|
+
return this._client.post(path `/browsers/${id}/replays`, { body, ...options });
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Stop the specified replay recording and persist the video.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* await client.browsers.replays.stop('replay_id', {
|
|
56
|
+
* id: 'id',
|
|
57
|
+
* });
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
stop(replayID, params, options) {
|
|
61
|
+
const { id } = params;
|
|
62
|
+
return this._client.post(path `/browsers/${id}/replays/${replayID}/stop`, {
|
|
63
|
+
...options,
|
|
64
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=replays.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replays.mjs","sourceRoot":"","sources":["../../src/resources/browsers/replays.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH,IAAI,CAAC,EAAU,EAAE,OAAwB;QACvC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,QAAgB,EAAE,MAA4B,EAAE,OAAwB;QAC/E,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,CAAC;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,EAAE,YAAY,QAAQ,EAAE,EAAE;YACjE,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAClE,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CACH,EAAU,EACV,OAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,aAAa,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;IAED;;;;;;;;;OASG;IACH,IAAI,CAAC,QAAgB,EAAE,MAAwB,EAAE,OAAwB;QACvE,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,CAAC;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,aAAa,EAAE,YAAY,QAAQ,OAAO,EAAE;YACvE,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/resources/browsers.d.mts
CHANGED
|
@@ -1,156 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import * as BrowsersAPI from "./browsers.mjs";
|
|
3
|
-
import { APIPromise } from "../core/api-promise.mjs";
|
|
4
|
-
import { RequestOptions } from "../internal/request-options.mjs";
|
|
5
|
-
export declare class Browsers extends APIResource {
|
|
6
|
-
/**
|
|
7
|
-
* Create a new browser session from within an action.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```ts
|
|
11
|
-
* const browser = await client.browsers.create();
|
|
12
|
-
* ```
|
|
13
|
-
*/
|
|
14
|
-
create(body?: BrowserCreateParams | null | undefined, options?: RequestOptions): APIPromise<BrowserCreateResponse>;
|
|
15
|
-
/**
|
|
16
|
-
* Get information about a browser session.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```ts
|
|
20
|
-
* const browser = await client.browsers.retrieve(
|
|
21
|
-
* 'htzv5orfit78e1m2biiifpbv',
|
|
22
|
-
* );
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
retrieve(id: string, options?: RequestOptions): APIPromise<BrowserRetrieveResponse>;
|
|
26
|
-
/**
|
|
27
|
-
* List active browser sessions
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```ts
|
|
31
|
-
* const browsers = await client.browsers.list();
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
list(options?: RequestOptions): APIPromise<BrowserListResponse>;
|
|
35
|
-
/**
|
|
36
|
-
* Delete a persistent browser session by its persistent_id.
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* ```ts
|
|
40
|
-
* await client.browsers.delete({
|
|
41
|
-
* persistent_id: 'persistent_id',
|
|
42
|
-
* });
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
|
-
delete(params: BrowserDeleteParams, options?: RequestOptions): APIPromise<void>;
|
|
46
|
-
/**
|
|
47
|
-
* Delete a browser session by ID
|
|
48
|
-
*
|
|
49
|
-
* @example
|
|
50
|
-
* ```ts
|
|
51
|
-
* await client.browsers.deleteByID(
|
|
52
|
-
* 'htzv5orfit78e1m2biiifpbv',
|
|
53
|
-
* );
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
deleteByID(id: string, options?: RequestOptions): APIPromise<void>;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Optional persistence configuration for the browser session.
|
|
60
|
-
*/
|
|
61
|
-
export interface BrowserPersistence {
|
|
62
|
-
/**
|
|
63
|
-
* Unique identifier for the persistent browser session.
|
|
64
|
-
*/
|
|
65
|
-
id: string;
|
|
66
|
-
}
|
|
67
|
-
export interface BrowserCreateResponse {
|
|
68
|
-
/**
|
|
69
|
-
* Websocket URL for Chrome DevTools Protocol connections to the browser session
|
|
70
|
-
*/
|
|
71
|
-
cdp_ws_url: string;
|
|
72
|
-
/**
|
|
73
|
-
* Unique identifier for the browser session
|
|
74
|
-
*/
|
|
75
|
-
session_id: string;
|
|
76
|
-
/**
|
|
77
|
-
* Remote URL for live viewing the browser session. Only available for non-headless
|
|
78
|
-
* browsers.
|
|
79
|
-
*/
|
|
80
|
-
browser_live_view_url?: string;
|
|
81
|
-
/**
|
|
82
|
-
* Optional persistence configuration for the browser session.
|
|
83
|
-
*/
|
|
84
|
-
persistence?: BrowserPersistence;
|
|
85
|
-
}
|
|
86
|
-
export interface BrowserRetrieveResponse {
|
|
87
|
-
/**
|
|
88
|
-
* Websocket URL for Chrome DevTools Protocol connections to the browser session
|
|
89
|
-
*/
|
|
90
|
-
cdp_ws_url: string;
|
|
91
|
-
/**
|
|
92
|
-
* Unique identifier for the browser session
|
|
93
|
-
*/
|
|
94
|
-
session_id: string;
|
|
95
|
-
/**
|
|
96
|
-
* Remote URL for live viewing the browser session. Only available for non-headless
|
|
97
|
-
* browsers.
|
|
98
|
-
*/
|
|
99
|
-
browser_live_view_url?: string;
|
|
100
|
-
/**
|
|
101
|
-
* Optional persistence configuration for the browser session.
|
|
102
|
-
*/
|
|
103
|
-
persistence?: BrowserPersistence;
|
|
104
|
-
}
|
|
105
|
-
export type BrowserListResponse = Array<BrowserListResponse.BrowserListResponseItem>;
|
|
106
|
-
export declare namespace BrowserListResponse {
|
|
107
|
-
interface BrowserListResponseItem {
|
|
108
|
-
/**
|
|
109
|
-
* Websocket URL for Chrome DevTools Protocol connections to the browser session
|
|
110
|
-
*/
|
|
111
|
-
cdp_ws_url: string;
|
|
112
|
-
/**
|
|
113
|
-
* Unique identifier for the browser session
|
|
114
|
-
*/
|
|
115
|
-
session_id: string;
|
|
116
|
-
/**
|
|
117
|
-
* Remote URL for live viewing the browser session. Only available for non-headless
|
|
118
|
-
* browsers.
|
|
119
|
-
*/
|
|
120
|
-
browser_live_view_url?: string;
|
|
121
|
-
/**
|
|
122
|
-
* Optional persistence configuration for the browser session.
|
|
123
|
-
*/
|
|
124
|
-
persistence?: BrowsersAPI.BrowserPersistence;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
export interface BrowserCreateParams {
|
|
128
|
-
/**
|
|
129
|
-
* If true, launches the browser using a headless image (no VNC/GUI). Defaults to
|
|
130
|
-
* false.
|
|
131
|
-
*/
|
|
132
|
-
headless?: boolean;
|
|
133
|
-
/**
|
|
134
|
-
* action invocation ID
|
|
135
|
-
*/
|
|
136
|
-
invocation_id?: string;
|
|
137
|
-
/**
|
|
138
|
-
* Optional persistence configuration for the browser session.
|
|
139
|
-
*/
|
|
140
|
-
persistence?: BrowserPersistence;
|
|
141
|
-
/**
|
|
142
|
-
* If true, launches the browser in stealth mode to reduce detection by anti-bot
|
|
143
|
-
* mechanisms.
|
|
144
|
-
*/
|
|
145
|
-
stealth?: boolean;
|
|
146
|
-
}
|
|
147
|
-
export interface BrowserDeleteParams {
|
|
148
|
-
/**
|
|
149
|
-
* Persistent browser identifier
|
|
150
|
-
*/
|
|
151
|
-
persistent_id: string;
|
|
152
|
-
}
|
|
153
|
-
export declare namespace Browsers {
|
|
154
|
-
export { type BrowserPersistence as BrowserPersistence, type BrowserCreateResponse as BrowserCreateResponse, type BrowserRetrieveResponse as BrowserRetrieveResponse, type BrowserListResponse as BrowserListResponse, type BrowserCreateParams as BrowserCreateParams, type BrowserDeleteParams as BrowserDeleteParams, };
|
|
155
|
-
}
|
|
1
|
+
export * from "./browsers/index.mjs";
|
|
156
2
|
//# sourceMappingURL=browsers.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browsers.d.mts","sourceRoot":"","sources":["../src/resources/browsers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"browsers.d.mts","sourceRoot":"","sources":["../src/resources/browsers.ts"],"names":[],"mappings":""}
|
package/resources/browsers.d.ts
CHANGED
|
@@ -1,156 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import * as BrowsersAPI from "./browsers.js";
|
|
3
|
-
import { APIPromise } from "../core/api-promise.js";
|
|
4
|
-
import { RequestOptions } from "../internal/request-options.js";
|
|
5
|
-
export declare class Browsers extends APIResource {
|
|
6
|
-
/**
|
|
7
|
-
* Create a new browser session from within an action.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```ts
|
|
11
|
-
* const browser = await client.browsers.create();
|
|
12
|
-
* ```
|
|
13
|
-
*/
|
|
14
|
-
create(body?: BrowserCreateParams | null | undefined, options?: RequestOptions): APIPromise<BrowserCreateResponse>;
|
|
15
|
-
/**
|
|
16
|
-
* Get information about a browser session.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```ts
|
|
20
|
-
* const browser = await client.browsers.retrieve(
|
|
21
|
-
* 'htzv5orfit78e1m2biiifpbv',
|
|
22
|
-
* );
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
retrieve(id: string, options?: RequestOptions): APIPromise<BrowserRetrieveResponse>;
|
|
26
|
-
/**
|
|
27
|
-
* List active browser sessions
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```ts
|
|
31
|
-
* const browsers = await client.browsers.list();
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
list(options?: RequestOptions): APIPromise<BrowserListResponse>;
|
|
35
|
-
/**
|
|
36
|
-
* Delete a persistent browser session by its persistent_id.
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* ```ts
|
|
40
|
-
* await client.browsers.delete({
|
|
41
|
-
* persistent_id: 'persistent_id',
|
|
42
|
-
* });
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
|
-
delete(params: BrowserDeleteParams, options?: RequestOptions): APIPromise<void>;
|
|
46
|
-
/**
|
|
47
|
-
* Delete a browser session by ID
|
|
48
|
-
*
|
|
49
|
-
* @example
|
|
50
|
-
* ```ts
|
|
51
|
-
* await client.browsers.deleteByID(
|
|
52
|
-
* 'htzv5orfit78e1m2biiifpbv',
|
|
53
|
-
* );
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
deleteByID(id: string, options?: RequestOptions): APIPromise<void>;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Optional persistence configuration for the browser session.
|
|
60
|
-
*/
|
|
61
|
-
export interface BrowserPersistence {
|
|
62
|
-
/**
|
|
63
|
-
* Unique identifier for the persistent browser session.
|
|
64
|
-
*/
|
|
65
|
-
id: string;
|
|
66
|
-
}
|
|
67
|
-
export interface BrowserCreateResponse {
|
|
68
|
-
/**
|
|
69
|
-
* Websocket URL for Chrome DevTools Protocol connections to the browser session
|
|
70
|
-
*/
|
|
71
|
-
cdp_ws_url: string;
|
|
72
|
-
/**
|
|
73
|
-
* Unique identifier for the browser session
|
|
74
|
-
*/
|
|
75
|
-
session_id: string;
|
|
76
|
-
/**
|
|
77
|
-
* Remote URL for live viewing the browser session. Only available for non-headless
|
|
78
|
-
* browsers.
|
|
79
|
-
*/
|
|
80
|
-
browser_live_view_url?: string;
|
|
81
|
-
/**
|
|
82
|
-
* Optional persistence configuration for the browser session.
|
|
83
|
-
*/
|
|
84
|
-
persistence?: BrowserPersistence;
|
|
85
|
-
}
|
|
86
|
-
export interface BrowserRetrieveResponse {
|
|
87
|
-
/**
|
|
88
|
-
* Websocket URL for Chrome DevTools Protocol connections to the browser session
|
|
89
|
-
*/
|
|
90
|
-
cdp_ws_url: string;
|
|
91
|
-
/**
|
|
92
|
-
* Unique identifier for the browser session
|
|
93
|
-
*/
|
|
94
|
-
session_id: string;
|
|
95
|
-
/**
|
|
96
|
-
* Remote URL for live viewing the browser session. Only available for non-headless
|
|
97
|
-
* browsers.
|
|
98
|
-
*/
|
|
99
|
-
browser_live_view_url?: string;
|
|
100
|
-
/**
|
|
101
|
-
* Optional persistence configuration for the browser session.
|
|
102
|
-
*/
|
|
103
|
-
persistence?: BrowserPersistence;
|
|
104
|
-
}
|
|
105
|
-
export type BrowserListResponse = Array<BrowserListResponse.BrowserListResponseItem>;
|
|
106
|
-
export declare namespace BrowserListResponse {
|
|
107
|
-
interface BrowserListResponseItem {
|
|
108
|
-
/**
|
|
109
|
-
* Websocket URL for Chrome DevTools Protocol connections to the browser session
|
|
110
|
-
*/
|
|
111
|
-
cdp_ws_url: string;
|
|
112
|
-
/**
|
|
113
|
-
* Unique identifier for the browser session
|
|
114
|
-
*/
|
|
115
|
-
session_id: string;
|
|
116
|
-
/**
|
|
117
|
-
* Remote URL for live viewing the browser session. Only available for non-headless
|
|
118
|
-
* browsers.
|
|
119
|
-
*/
|
|
120
|
-
browser_live_view_url?: string;
|
|
121
|
-
/**
|
|
122
|
-
* Optional persistence configuration for the browser session.
|
|
123
|
-
*/
|
|
124
|
-
persistence?: BrowsersAPI.BrowserPersistence;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
export interface BrowserCreateParams {
|
|
128
|
-
/**
|
|
129
|
-
* If true, launches the browser using a headless image (no VNC/GUI). Defaults to
|
|
130
|
-
* false.
|
|
131
|
-
*/
|
|
132
|
-
headless?: boolean;
|
|
133
|
-
/**
|
|
134
|
-
* action invocation ID
|
|
135
|
-
*/
|
|
136
|
-
invocation_id?: string;
|
|
137
|
-
/**
|
|
138
|
-
* Optional persistence configuration for the browser session.
|
|
139
|
-
*/
|
|
140
|
-
persistence?: BrowserPersistence;
|
|
141
|
-
/**
|
|
142
|
-
* If true, launches the browser in stealth mode to reduce detection by anti-bot
|
|
143
|
-
* mechanisms.
|
|
144
|
-
*/
|
|
145
|
-
stealth?: boolean;
|
|
146
|
-
}
|
|
147
|
-
export interface BrowserDeleteParams {
|
|
148
|
-
/**
|
|
149
|
-
* Persistent browser identifier
|
|
150
|
-
*/
|
|
151
|
-
persistent_id: string;
|
|
152
|
-
}
|
|
153
|
-
export declare namespace Browsers {
|
|
154
|
-
export { type BrowserPersistence as BrowserPersistence, type BrowserCreateResponse as BrowserCreateResponse, type BrowserRetrieveResponse as BrowserRetrieveResponse, type BrowserListResponse as BrowserListResponse, type BrowserCreateParams as BrowserCreateParams, type BrowserDeleteParams as BrowserDeleteParams, };
|
|
155
|
-
}
|
|
1
|
+
export * from "./browsers/index.js";
|
|
156
2
|
//# sourceMappingURL=browsers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browsers.d.ts","sourceRoot":"","sources":["../src/resources/browsers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"browsers.d.ts","sourceRoot":"","sources":["../src/resources/browsers.ts"],"names":[],"mappings":""}
|
package/resources/browsers.js
CHANGED
|
@@ -1,80 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const headers_1 = require("../internal/headers.js");
|
|
7
|
-
const path_1 = require("../internal/utils/path.js");
|
|
8
|
-
class Browsers extends resource_1.APIResource {
|
|
9
|
-
/**
|
|
10
|
-
* Create a new browser session from within an action.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```ts
|
|
14
|
-
* const browser = await client.browsers.create();
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
create(body = {}, options) {
|
|
18
|
-
return this._client.post('/browsers', { body, ...options });
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Get information about a browser session.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```ts
|
|
25
|
-
* const browser = await client.browsers.retrieve(
|
|
26
|
-
* 'htzv5orfit78e1m2biiifpbv',
|
|
27
|
-
* );
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
retrieve(id, options) {
|
|
31
|
-
return this._client.get((0, path_1.path) `/browsers/${id}`, options);
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* List active browser sessions
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```ts
|
|
38
|
-
* const browsers = await client.browsers.list();
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
list(options) {
|
|
42
|
-
return this._client.get('/browsers', options);
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Delete a persistent browser session by its persistent_id.
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* ```ts
|
|
49
|
-
* await client.browsers.delete({
|
|
50
|
-
* persistent_id: 'persistent_id',
|
|
51
|
-
* });
|
|
52
|
-
* ```
|
|
53
|
-
*/
|
|
54
|
-
delete(params, options) {
|
|
55
|
-
const { persistent_id } = params;
|
|
56
|
-
return this._client.delete('/browsers', {
|
|
57
|
-
query: { persistent_id },
|
|
58
|
-
...options,
|
|
59
|
-
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Delete a browser session by ID
|
|
64
|
-
*
|
|
65
|
-
* @example
|
|
66
|
-
* ```ts
|
|
67
|
-
* await client.browsers.deleteByID(
|
|
68
|
-
* 'htzv5orfit78e1m2biiifpbv',
|
|
69
|
-
* );
|
|
70
|
-
* ```
|
|
71
|
-
*/
|
|
72
|
-
deleteByID(id, options) {
|
|
73
|
-
return this._client.delete((0, path_1.path) `/browsers/${id}`, {
|
|
74
|
-
...options,
|
|
75
|
-
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
exports.Browsers = Browsers;
|
|
4
|
+
const tslib_1 = require("../internal/tslib.js");
|
|
5
|
+
tslib_1.__exportStar(require("./browsers/index.js"), exports);
|
|
80
6
|
//# sourceMappingURL=browsers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browsers.js","sourceRoot":"","sources":["../src/resources/browsers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"browsers.js","sourceRoot":"","sources":["../src/resources/browsers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,8DAAiC"}
|
package/resources/browsers.mjs
CHANGED
|
@@ -1,76 +1,3 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { buildHeaders } from "../internal/headers.mjs";
|
|
4
|
-
import { path } from "../internal/utils/path.mjs";
|
|
5
|
-
export class Browsers extends APIResource {
|
|
6
|
-
/**
|
|
7
|
-
* Create a new browser session from within an action.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```ts
|
|
11
|
-
* const browser = await client.browsers.create();
|
|
12
|
-
* ```
|
|
13
|
-
*/
|
|
14
|
-
create(body = {}, options) {
|
|
15
|
-
return this._client.post('/browsers', { body, ...options });
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Get information about a browser session.
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```ts
|
|
22
|
-
* const browser = await client.browsers.retrieve(
|
|
23
|
-
* 'htzv5orfit78e1m2biiifpbv',
|
|
24
|
-
* );
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
retrieve(id, options) {
|
|
28
|
-
return this._client.get(path `/browsers/${id}`, options);
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* List active browser sessions
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* ```ts
|
|
35
|
-
* const browsers = await client.browsers.list();
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
list(options) {
|
|
39
|
-
return this._client.get('/browsers', options);
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Delete a persistent browser session by its persistent_id.
|
|
43
|
-
*
|
|
44
|
-
* @example
|
|
45
|
-
* ```ts
|
|
46
|
-
* await client.browsers.delete({
|
|
47
|
-
* persistent_id: 'persistent_id',
|
|
48
|
-
* });
|
|
49
|
-
* ```
|
|
50
|
-
*/
|
|
51
|
-
delete(params, options) {
|
|
52
|
-
const { persistent_id } = params;
|
|
53
|
-
return this._client.delete('/browsers', {
|
|
54
|
-
query: { persistent_id },
|
|
55
|
-
...options,
|
|
56
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Delete a browser session by ID
|
|
61
|
-
*
|
|
62
|
-
* @example
|
|
63
|
-
* ```ts
|
|
64
|
-
* await client.browsers.deleteByID(
|
|
65
|
-
* 'htzv5orfit78e1m2biiifpbv',
|
|
66
|
-
* );
|
|
67
|
-
* ```
|
|
68
|
-
*/
|
|
69
|
-
deleteByID(id, options) {
|
|
70
|
-
return this._client.delete(path `/browsers/${id}`, {
|
|
71
|
-
...options,
|
|
72
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
}
|
|
2
|
+
export * from "./browsers/index.mjs";
|
|
76
3
|
//# sourceMappingURL=browsers.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browsers.mjs","sourceRoot":"","sources":["../src/resources/browsers.ts"],"names":[],"mappings":"AAAA,sFAAsF
|
|
1
|
+
{"version":3,"file":"browsers.mjs","sourceRoot":"","sources":["../src/resources/browsers.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
|
package/resources/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from "./shared.mjs";
|
|
2
2
|
export { Apps, type AppListResponse, type AppListParams } from "./apps/apps.mjs";
|
|
3
|
-
export { Browsers, type BrowserPersistence, type BrowserCreateResponse, type BrowserRetrieveResponse, type BrowserListResponse, type BrowserCreateParams, type BrowserDeleteParams, } from "./browsers.mjs";
|
|
3
|
+
export { Browsers, type BrowserPersistence, type BrowserCreateResponse, type BrowserRetrieveResponse, type BrowserListResponse, type BrowserCreateParams, type BrowserDeleteParams, } from "./browsers/browsers.mjs";
|
|
4
4
|
export { Deployments, type DeploymentStateEvent, type DeploymentCreateResponse, type DeploymentRetrieveResponse, type DeploymentListResponse, type DeploymentFollowResponse, type DeploymentCreateParams, type DeploymentListParams, type DeploymentFollowParams, } from "./deployments.mjs";
|
|
5
5
|
export { Invocations, type InvocationStateEvent, type InvocationCreateResponse, type InvocationRetrieveResponse, type InvocationUpdateResponse, type InvocationFollowResponse, type InvocationCreateParams, type InvocationUpdateParams, } from "./invocations.mjs";
|
|
6
6
|
//# sourceMappingURL=index.d.mts.map
|
package/resources/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from "./shared.js";
|
|
2
2
|
export { Apps, type AppListResponse, type AppListParams } from "./apps/apps.js";
|
|
3
|
-
export { Browsers, type BrowserPersistence, type BrowserCreateResponse, type BrowserRetrieveResponse, type BrowserListResponse, type BrowserCreateParams, type BrowserDeleteParams, } from "./browsers.js";
|
|
3
|
+
export { Browsers, type BrowserPersistence, type BrowserCreateResponse, type BrowserRetrieveResponse, type BrowserListResponse, type BrowserCreateParams, type BrowserDeleteParams, } from "./browsers/browsers.js";
|
|
4
4
|
export { Deployments, type DeploymentStateEvent, type DeploymentCreateResponse, type DeploymentRetrieveResponse, type DeploymentListResponse, type DeploymentFollowResponse, type DeploymentCreateParams, type DeploymentListParams, type DeploymentFollowParams, } from "./deployments.js";
|
|
5
5
|
export { Invocations, type InvocationStateEvent, type InvocationCreateResponse, type InvocationRetrieveResponse, type InvocationUpdateResponse, type InvocationFollowResponse, type InvocationCreateParams, type InvocationUpdateParams, } from "./invocations.js";
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|