@onkernel/sdk 0.7.0 → 0.7.1
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 +18 -0
- package/client.d.mts +2 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -0
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- 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.d.mts +30 -0
- package/resources/browsers.d.mts.map +1 -1
- package/resources/browsers.d.ts +30 -0
- package/resources/browsers.d.ts.map +1 -1
- package/resources/browsers.js +20 -0
- package/resources/browsers.js.map +1 -1
- package/resources/browsers.mjs +20 -0
- package/resources/browsers.mjs.map +1 -1
- package/src/client.ts +2 -0
- 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.ts +41 -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
package/internal/parse.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.mjs","sourceRoot":"","sources":["../src/internal/parse.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAG/E,EAAE,MAAM,EAAE;OA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,CAAC,MAAM;QACvB,IAAI;QACJ,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS;KACnC,CAAC,CACH,CAAC;IACF,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -8,17 +8,59 @@ export type FinalRequestOptions = RequestOptions & {
|
|
|
8
8
|
path: string;
|
|
9
9
|
};
|
|
10
10
|
export type RequestOptions = {
|
|
11
|
+
/**
|
|
12
|
+
* The HTTP method for the request (e.g., 'get', 'post', 'put', 'delete').
|
|
13
|
+
*/
|
|
11
14
|
method?: HTTPMethod;
|
|
15
|
+
/**
|
|
16
|
+
* The URL path for the request.
|
|
17
|
+
*
|
|
18
|
+
* @example "/v1/foo"
|
|
19
|
+
*/
|
|
12
20
|
path?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Query parameters to include in the request URL.
|
|
23
|
+
*/
|
|
13
24
|
query?: object | undefined | null;
|
|
25
|
+
/**
|
|
26
|
+
* The request body. Can be a string, JSON object, FormData, or other supported types.
|
|
27
|
+
*/
|
|
14
28
|
body?: unknown;
|
|
29
|
+
/**
|
|
30
|
+
* HTTP headers to include with the request. Can be a Headers object, plain object, or array of tuples.
|
|
31
|
+
*/
|
|
15
32
|
headers?: HeadersLike;
|
|
33
|
+
/**
|
|
34
|
+
* The maximum number of times that the client will retry a request in case of a
|
|
35
|
+
* temporary failure, like a network error or a 5XX error from the server.
|
|
36
|
+
*
|
|
37
|
+
* @default 2
|
|
38
|
+
*/
|
|
16
39
|
maxRetries?: number;
|
|
17
40
|
stream?: boolean | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* The maximum amount of time (in milliseconds) that the client should wait for a response
|
|
43
|
+
* from the server before timing out a single request.
|
|
44
|
+
*
|
|
45
|
+
* @unit milliseconds
|
|
46
|
+
*/
|
|
18
47
|
timeout?: number;
|
|
48
|
+
/**
|
|
49
|
+
* Additional `RequestInit` options to be passed to the underlying `fetch` call.
|
|
50
|
+
* These options will be merged with the client's default fetch options.
|
|
51
|
+
*/
|
|
19
52
|
fetchOptions?: MergedRequestInit;
|
|
53
|
+
/**
|
|
54
|
+
* An AbortSignal that can be used to cancel the request.
|
|
55
|
+
*/
|
|
20
56
|
signal?: AbortSignal | undefined | null;
|
|
57
|
+
/**
|
|
58
|
+
* A unique key for this request to enable idempotency.
|
|
59
|
+
*/
|
|
21
60
|
idempotencyKey?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Override the default base URL for this specific request.
|
|
63
|
+
*/
|
|
22
64
|
defaultBaseURL?: string | undefined;
|
|
23
65
|
__binaryResponse?: boolean | undefined;
|
|
24
66
|
__streamClass?: typeof Stream;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-options.d.mts","sourceRoot":"","sources":["../src/internal/request-options.ts"],"names":[],"mappings":"OAEO,EAAE,eAAe,EAAE;OAEnB,KAAK,EAAE,QAAQ,EAAE;OACjB,EAAE,MAAM,EAAE;OACV,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE;OACtC,EAAE,KAAK,WAAW,EAAE;AAE3B,MAAM,MAAM,mBAAmB,GAAG,cAAc,GAAG;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAExF,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,CAAC,EAAE,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"request-options.d.mts","sourceRoot":"","sources":["../src/internal/request-options.ts"],"names":[],"mappings":"OAEO,EAAE,eAAe,EAAE;OAEnB,KAAK,EAAE,QAAQ,EAAE;OACjB,EAAE,MAAM,EAAE;OACV,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE;OACtC,EAAE,KAAK,WAAW,EAAE;AAE3B,MAAM,MAAM,mBAAmB,GAAG,cAAc,GAAG;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAExF,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IAEpB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IAElC;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;OAEG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAE7B;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,YAAY,CAAC,EAAE,iBAAiB,CAAC;IAEjC;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,GAAG,IAAI,CAAC;IAExC;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEpC,gBAAgB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACvC,aAAa,CAAC,EAAE,OAAO,MAAM,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAAE,WAAW,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AAC1E,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE;IAAE,OAAO,EAAE,eAAe,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,KAAK,cAAc,CAAC;AAEtG,eAAO,MAAM,eAAe,EAAE,cAO7B,CAAC"}
|
|
@@ -8,17 +8,59 @@ export type FinalRequestOptions = RequestOptions & {
|
|
|
8
8
|
path: string;
|
|
9
9
|
};
|
|
10
10
|
export type RequestOptions = {
|
|
11
|
+
/**
|
|
12
|
+
* The HTTP method for the request (e.g., 'get', 'post', 'put', 'delete').
|
|
13
|
+
*/
|
|
11
14
|
method?: HTTPMethod;
|
|
15
|
+
/**
|
|
16
|
+
* The URL path for the request.
|
|
17
|
+
*
|
|
18
|
+
* @example "/v1/foo"
|
|
19
|
+
*/
|
|
12
20
|
path?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Query parameters to include in the request URL.
|
|
23
|
+
*/
|
|
13
24
|
query?: object | undefined | null;
|
|
25
|
+
/**
|
|
26
|
+
* The request body. Can be a string, JSON object, FormData, or other supported types.
|
|
27
|
+
*/
|
|
14
28
|
body?: unknown;
|
|
29
|
+
/**
|
|
30
|
+
* HTTP headers to include with the request. Can be a Headers object, plain object, or array of tuples.
|
|
31
|
+
*/
|
|
15
32
|
headers?: HeadersLike;
|
|
33
|
+
/**
|
|
34
|
+
* The maximum number of times that the client will retry a request in case of a
|
|
35
|
+
* temporary failure, like a network error or a 5XX error from the server.
|
|
36
|
+
*
|
|
37
|
+
* @default 2
|
|
38
|
+
*/
|
|
16
39
|
maxRetries?: number;
|
|
17
40
|
stream?: boolean | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* The maximum amount of time (in milliseconds) that the client should wait for a response
|
|
43
|
+
* from the server before timing out a single request.
|
|
44
|
+
*
|
|
45
|
+
* @unit milliseconds
|
|
46
|
+
*/
|
|
18
47
|
timeout?: number;
|
|
48
|
+
/**
|
|
49
|
+
* Additional `RequestInit` options to be passed to the underlying `fetch` call.
|
|
50
|
+
* These options will be merged with the client's default fetch options.
|
|
51
|
+
*/
|
|
19
52
|
fetchOptions?: MergedRequestInit;
|
|
53
|
+
/**
|
|
54
|
+
* An AbortSignal that can be used to cancel the request.
|
|
55
|
+
*/
|
|
20
56
|
signal?: AbortSignal | undefined | null;
|
|
57
|
+
/**
|
|
58
|
+
* A unique key for this request to enable idempotency.
|
|
59
|
+
*/
|
|
21
60
|
idempotencyKey?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Override the default base URL for this specific request.
|
|
63
|
+
*/
|
|
22
64
|
defaultBaseURL?: string | undefined;
|
|
23
65
|
__binaryResponse?: boolean | undefined;
|
|
24
66
|
__streamClass?: typeof Stream;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-options.d.ts","sourceRoot":"","sources":["../src/internal/request-options.ts"],"names":[],"mappings":"OAEO,EAAE,eAAe,EAAE;OAEnB,KAAK,EAAE,QAAQ,EAAE;OACjB,EAAE,MAAM,EAAE;OACV,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE;OACtC,EAAE,KAAK,WAAW,EAAE;AAE3B,MAAM,MAAM,mBAAmB,GAAG,cAAc,GAAG;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAExF,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,CAAC,EAAE,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"request-options.d.ts","sourceRoot":"","sources":["../src/internal/request-options.ts"],"names":[],"mappings":"OAEO,EAAE,eAAe,EAAE;OAEnB,KAAK,EAAE,QAAQ,EAAE;OACjB,EAAE,MAAM,EAAE;OACV,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE;OACtC,EAAE,KAAK,WAAW,EAAE;AAE3B,MAAM,MAAM,mBAAmB,GAAG,cAAc,GAAG;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAExF,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IAEpB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IAElC;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;OAEG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAE7B;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,YAAY,CAAC,EAAE,iBAAiB,CAAC;IAEjC;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,GAAG,IAAI,CAAC;IAExC;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEpC,gBAAgB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACvC,aAAa,CAAC,EAAE,OAAO,MAAM,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAAE,WAAW,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AAC1E,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE;IAAE,OAAO,EAAE,eAAe,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,KAAK,cAAc,CAAC;AAEtG,eAAO,MAAM,eAAe,EAAE,cAO7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-options.js","sourceRoot":"","sources":["../src/internal/request-options.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;
|
|
1
|
+
{"version":3,"file":"request-options.js","sourceRoot":"","sources":["../src/internal/request-options.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAqF/E,MAAM,eAAe,GAAmB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE;IACnE,OAAO;QACL,WAAW,EAAE;YACX,cAAc,EAAE,kBAAkB;SACnC;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;KAC3B,CAAC;AACJ,CAAC,CAAC;AAPW,QAAA,eAAe,mBAO1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-options.mjs","sourceRoot":"","sources":["../src/internal/request-options.ts"],"names":[],"mappings":"AAAA,sFAAsF;
|
|
1
|
+
{"version":3,"file":"request-options.mjs","sourceRoot":"","sources":["../src/internal/request-options.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAqFtF,MAAM,CAAC,MAAM,eAAe,GAAmB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE;IACnE,OAAO;QACL,WAAW,EAAE;YACX,cAAc,EAAE,kBAAkB;SACnC;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;KAC3B,CAAC;AACJ,CAAC,CAAC"}
|
package/package.json
CHANGED
package/resources/browsers.d.mts
CHANGED
|
@@ -54,6 +54,20 @@ export declare class Browsers extends APIResource {
|
|
|
54
54
|
* ```
|
|
55
55
|
*/
|
|
56
56
|
deleteByID(id: string, options?: RequestOptions): APIPromise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Get browser session replay.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* const response = await client.browsers.retrieveReplay(
|
|
63
|
+
* 'htzv5orfit78e1m2biiifpbv',
|
|
64
|
+
* );
|
|
65
|
+
*
|
|
66
|
+
* const content = await response.blob();
|
|
67
|
+
* console.log(content);
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
retrieveReplay(id: string, options?: RequestOptions): APIPromise<Response>;
|
|
57
71
|
}
|
|
58
72
|
/**
|
|
59
73
|
* Optional persistence configuration for the browser session.
|
|
@@ -82,6 +96,10 @@ export interface BrowserCreateResponse {
|
|
|
82
96
|
* Optional persistence configuration for the browser session.
|
|
83
97
|
*/
|
|
84
98
|
persistence?: BrowserPersistence;
|
|
99
|
+
/**
|
|
100
|
+
* Remote URL for viewing the browser session replay if enabled
|
|
101
|
+
*/
|
|
102
|
+
replay_view_url?: string;
|
|
85
103
|
}
|
|
86
104
|
export interface BrowserRetrieveResponse {
|
|
87
105
|
/**
|
|
@@ -101,6 +119,10 @@ export interface BrowserRetrieveResponse {
|
|
|
101
119
|
* Optional persistence configuration for the browser session.
|
|
102
120
|
*/
|
|
103
121
|
persistence?: BrowserPersistence;
|
|
122
|
+
/**
|
|
123
|
+
* Remote URL for viewing the browser session replay if enabled
|
|
124
|
+
*/
|
|
125
|
+
replay_view_url?: string;
|
|
104
126
|
}
|
|
105
127
|
export type BrowserListResponse = Array<BrowserListResponse.BrowserListResponseItem>;
|
|
106
128
|
export declare namespace BrowserListResponse {
|
|
@@ -122,6 +144,10 @@ export declare namespace BrowserListResponse {
|
|
|
122
144
|
* Optional persistence configuration for the browser session.
|
|
123
145
|
*/
|
|
124
146
|
persistence?: BrowsersAPI.BrowserPersistence;
|
|
147
|
+
/**
|
|
148
|
+
* Remote URL for viewing the browser session replay if enabled
|
|
149
|
+
*/
|
|
150
|
+
replay_view_url?: string;
|
|
125
151
|
}
|
|
126
152
|
}
|
|
127
153
|
export interface BrowserCreateParams {
|
|
@@ -138,6 +164,10 @@ export interface BrowserCreateParams {
|
|
|
138
164
|
* Optional persistence configuration for the browser session.
|
|
139
165
|
*/
|
|
140
166
|
persistence?: BrowserPersistence;
|
|
167
|
+
/**
|
|
168
|
+
* If true, enables replay recording of the browser session. Defaults to false.
|
|
169
|
+
*/
|
|
170
|
+
replay?: boolean;
|
|
141
171
|
/**
|
|
142
172
|
* If true, launches the browser in stealth mode to reduce detection by anti-bot
|
|
143
173
|
* mechanisms.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browsers.d.mts","sourceRoot":"","sources":["../src/resources/browsers.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;OAOG;IACH,MAAM,CACJ,IAAI,GAAE,mBAAmB,GAAG,IAAI,GAAG,SAAc,EACjD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,qB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C,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,WAAW,CAAC,EAAE,kBAAkB,CAAC;IAEjC;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
|
package/resources/browsers.d.ts
CHANGED
|
@@ -54,6 +54,20 @@ export declare class Browsers extends APIResource {
|
|
|
54
54
|
* ```
|
|
55
55
|
*/
|
|
56
56
|
deleteByID(id: string, options?: RequestOptions): APIPromise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Get browser session replay.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* const response = await client.browsers.retrieveReplay(
|
|
63
|
+
* 'htzv5orfit78e1m2biiifpbv',
|
|
64
|
+
* );
|
|
65
|
+
*
|
|
66
|
+
* const content = await response.blob();
|
|
67
|
+
* console.log(content);
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
retrieveReplay(id: string, options?: RequestOptions): APIPromise<Response>;
|
|
57
71
|
}
|
|
58
72
|
/**
|
|
59
73
|
* Optional persistence configuration for the browser session.
|
|
@@ -82,6 +96,10 @@ export interface BrowserCreateResponse {
|
|
|
82
96
|
* Optional persistence configuration for the browser session.
|
|
83
97
|
*/
|
|
84
98
|
persistence?: BrowserPersistence;
|
|
99
|
+
/**
|
|
100
|
+
* Remote URL for viewing the browser session replay if enabled
|
|
101
|
+
*/
|
|
102
|
+
replay_view_url?: string;
|
|
85
103
|
}
|
|
86
104
|
export interface BrowserRetrieveResponse {
|
|
87
105
|
/**
|
|
@@ -101,6 +119,10 @@ export interface BrowserRetrieveResponse {
|
|
|
101
119
|
* Optional persistence configuration for the browser session.
|
|
102
120
|
*/
|
|
103
121
|
persistence?: BrowserPersistence;
|
|
122
|
+
/**
|
|
123
|
+
* Remote URL for viewing the browser session replay if enabled
|
|
124
|
+
*/
|
|
125
|
+
replay_view_url?: string;
|
|
104
126
|
}
|
|
105
127
|
export type BrowserListResponse = Array<BrowserListResponse.BrowserListResponseItem>;
|
|
106
128
|
export declare namespace BrowserListResponse {
|
|
@@ -122,6 +144,10 @@ export declare namespace BrowserListResponse {
|
|
|
122
144
|
* Optional persistence configuration for the browser session.
|
|
123
145
|
*/
|
|
124
146
|
persistence?: BrowsersAPI.BrowserPersistence;
|
|
147
|
+
/**
|
|
148
|
+
* Remote URL for viewing the browser session replay if enabled
|
|
149
|
+
*/
|
|
150
|
+
replay_view_url?: string;
|
|
125
151
|
}
|
|
126
152
|
}
|
|
127
153
|
export interface BrowserCreateParams {
|
|
@@ -138,6 +164,10 @@ export interface BrowserCreateParams {
|
|
|
138
164
|
* Optional persistence configuration for the browser session.
|
|
139
165
|
*/
|
|
140
166
|
persistence?: BrowserPersistence;
|
|
167
|
+
/**
|
|
168
|
+
* If true, enables replay recording of the browser session. Defaults to false.
|
|
169
|
+
*/
|
|
170
|
+
replay?: boolean;
|
|
141
171
|
/**
|
|
142
172
|
* If true, launches the browser in stealth mode to reduce detection by anti-bot
|
|
143
173
|
* mechanisms.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browsers.d.ts","sourceRoot":"","sources":["../src/resources/browsers.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,EAA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AAC,EAAE,MAAM,CAAC;QAE/B;;WAEG;QACH,WAAW,CAAC,EAAE,WAAW,CAAC,kBAAkB,CAAC;QAE7C;;WAEG;QACH,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B;CACF;AAED,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,WAAW,CAAC,EAAE,kBAAkB,CAAC;IAEjC;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
|
package/resources/browsers.js
CHANGED
|
@@ -75,6 +75,26 @@ class Browsers extends resource_1.APIResource {
|
|
|
75
75
|
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Get browser session replay.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```ts
|
|
83
|
+
* const response = await client.browsers.retrieveReplay(
|
|
84
|
+
* 'htzv5orfit78e1m2biiifpbv',
|
|
85
|
+
* );
|
|
86
|
+
*
|
|
87
|
+
* const content = await response.blob();
|
|
88
|
+
* console.log(content);
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
retrieveReplay(id, options) {
|
|
92
|
+
return this._client.get((0, path_1.path) `/browsers/${id}/replay`, {
|
|
93
|
+
...options,
|
|
94
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: 'video/mp4' }, options?.headers]),
|
|
95
|
+
__binaryResponse: true,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
78
98
|
}
|
|
79
99
|
exports.Browsers = Browsers;
|
|
80
100
|
//# sourceMappingURL=browsers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browsers.js","sourceRoot":"","sources":["../src/resources/browsers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAAmD;AAEnD,oDAA8C;AAE9C,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;;;OAOG;IACH,MAAM,CACJ,OAA+C,EAAE,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,aAAa,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;;OAOG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAChD,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,MAA2B,EAAE,OAAwB;QAC1D,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC;QACjC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE;YACtC,KAAK,EAAE,EAAE,aAAa,EAAE;YACxB,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,C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AC,WAAW,EAAE;YACtC,KAAK,EAAE,EAAE,aAAa,EAAE;YACxB,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;IAED;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAU,EAAE,OAAwB;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,aAAa,EAAE,EAAE,EAAE;YAChD,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;IAED;;;;;;;;;;;;OAYG;IACH,cAAc,CAAC,EAAU,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,aAAa,EAAE,SAAS,EAAE;YACpD,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;CACF;AAlGD,4BAkGC"}
|
package/resources/browsers.mjs
CHANGED
|
@@ -72,5 +72,25 @@ export class Browsers extends APIResource {
|
|
|
72
72
|
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* Get browser session replay.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
80
|
+
* const response = await client.browsers.retrieveReplay(
|
|
81
|
+
* 'htzv5orfit78e1m2biiifpbv',
|
|
82
|
+
* );
|
|
83
|
+
*
|
|
84
|
+
* const content = await response.blob();
|
|
85
|
+
* console.log(content);
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
retrieveReplay(id, options) {
|
|
89
|
+
return this._client.get(path `/browsers/${id}/replay`, {
|
|
90
|
+
...options,
|
|
91
|
+
headers: buildHeaders([{ Accept: 'video/mp4' }, options?.headers]),
|
|
92
|
+
__binaryResponse: true,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
75
95
|
}
|
|
76
96
|
//# sourceMappingURL=browsers.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browsers.mjs","sourceRoot":"","sources":["../src/resources/browsers.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;;;OAOG;IACH,MAAM,CACJ,OAA+C,EAAE,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;;OAOG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAChD,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,MAA2B,EAAE,OAAwB;QAC1D,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC;QACjC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE;YACtC,KAAK,EAAE,EAAE,aAAa,EAAE;YACxB,GAAG,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AAC;QACjC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE;YACtC,KAAK,EAAE,EAAE,aAAa,EAAE;YACxB,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAU,EAAE,OAAwB;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,aAAa,EAAE,EAAE,EAAE;YAChD,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,cAAc,CAAC,EAAU,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,EAAE,SAAS,EAAE;YACpD,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;CACF"}
|
package/src/client.ts
CHANGED
|
@@ -95,6 +95,8 @@ export interface ClientOptions {
|
|
|
95
95
|
*
|
|
96
96
|
* Note that request timeouts are retried by default, so in a worst-case scenario you may wait
|
|
97
97
|
* much longer than this timeout before the promise succeeds or fails.
|
|
98
|
+
*
|
|
99
|
+
* @unit milliseconds
|
|
98
100
|
*/
|
|
99
101
|
timeout?: number | undefined;
|
|
100
102
|
/**
|
package/src/core/streaming.ts
CHANGED
|
@@ -5,6 +5,8 @@ import { findDoubleNewlineIndex, LineDecoder } from '../internal/decoders/line';
|
|
|
5
5
|
import { ReadableStreamToAsyncIterable } from '../internal/shims';
|
|
6
6
|
import { isAbortError } from '../internal/errors';
|
|
7
7
|
import { encodeUTF8 } from '../internal/utils/bytes';
|
|
8
|
+
import { loggerFor } from '../internal/utils/log';
|
|
9
|
+
import type { Kernel } from '../client';
|
|
8
10
|
|
|
9
11
|
type Bytes = string | ArrayBuffer | Uint8Array | null | undefined;
|
|
10
12
|
|
|
@@ -16,16 +18,24 @@ export type ServerSentEvent = {
|
|
|
16
18
|
|
|
17
19
|
export class Stream<Item> implements AsyncIterable<Item> {
|
|
18
20
|
controller: AbortController;
|
|
21
|
+
#client: Kernel | undefined;
|
|
19
22
|
|
|
20
23
|
constructor(
|
|
21
24
|
private iterator: () => AsyncIterator<Item>,
|
|
22
25
|
controller: AbortController,
|
|
26
|
+
client?: Kernel,
|
|
23
27
|
) {
|
|
24
28
|
this.controller = controller;
|
|
29
|
+
this.#client = client;
|
|
25
30
|
}
|
|
26
31
|
|
|
27
|
-
static fromSSEResponse<Item>(
|
|
32
|
+
static fromSSEResponse<Item>(
|
|
33
|
+
response: Response,
|
|
34
|
+
controller: AbortController,
|
|
35
|
+
client?: Kernel,
|
|
36
|
+
): Stream<Item> {
|
|
28
37
|
let consumed = false;
|
|
38
|
+
const logger = client ? loggerFor(client) : console;
|
|
29
39
|
|
|
30
40
|
async function* iterator(): AsyncIterator<Item, any, undefined> {
|
|
31
41
|
if (consumed) {
|
|
@@ -38,8 +48,8 @@ export class Stream<Item> implements AsyncIterable<Item> {
|
|
|
38
48
|
try {
|
|
39
49
|
yield JSON.parse(sse.data);
|
|
40
50
|
} catch (e) {
|
|
41
|
-
|
|
42
|
-
|
|
51
|
+
logger.error(`Could not parse message into JSON:`, sse.data);
|
|
52
|
+
logger.error(`From chunk:`, sse.raw);
|
|
43
53
|
throw e;
|
|
44
54
|
}
|
|
45
55
|
}
|
|
@@ -54,14 +64,18 @@ export class Stream<Item> implements AsyncIterable<Item> {
|
|
|
54
64
|
}
|
|
55
65
|
}
|
|
56
66
|
|
|
57
|
-
return new Stream(iterator, controller);
|
|
67
|
+
return new Stream(iterator, controller, client);
|
|
58
68
|
}
|
|
59
69
|
|
|
60
70
|
/**
|
|
61
71
|
* Generates a Stream from a newline-separated ReadableStream
|
|
62
72
|
* where each item is a JSON value.
|
|
63
73
|
*/
|
|
64
|
-
static fromReadableStream<Item>(
|
|
74
|
+
static fromReadableStream<Item>(
|
|
75
|
+
readableStream: ReadableStream,
|
|
76
|
+
controller: AbortController,
|
|
77
|
+
client?: Kernel,
|
|
78
|
+
): Stream<Item> {
|
|
65
79
|
let consumed = false;
|
|
66
80
|
|
|
67
81
|
async function* iterLines(): AsyncGenerator<string, void, unknown> {
|
|
@@ -101,7 +115,7 @@ export class Stream<Item> implements AsyncIterable<Item> {
|
|
|
101
115
|
}
|
|
102
116
|
}
|
|
103
117
|
|
|
104
|
-
return new Stream(iterator, controller);
|
|
118
|
+
return new Stream(iterator, controller, client);
|
|
105
119
|
}
|
|
106
120
|
|
|
107
121
|
[Symbol.asyncIterator](): AsyncIterator<Item> {
|
|
@@ -131,8 +145,8 @@ export class Stream<Item> implements AsyncIterable<Item> {
|
|
|
131
145
|
};
|
|
132
146
|
|
|
133
147
|
return [
|
|
134
|
-
new Stream(() => teeIterator(left), this.controller),
|
|
135
|
-
new Stream(() => teeIterator(right), this.controller),
|
|
148
|
+
new Stream(() => teeIterator(left), this.controller, this.#client),
|
|
149
|
+
new Stream(() => teeIterator(right), this.controller, this.#client),
|
|
136
150
|
];
|
|
137
151
|
}
|
|
138
152
|
|
package/src/internal/parse.ts
CHANGED
|
@@ -24,10 +24,10 @@ export async function defaultParseResponse<T>(client: Kernel, props: APIResponse
|
|
|
24
24
|
// that if you set `stream: true` the response type must also be `Stream<T>`
|
|
25
25
|
|
|
26
26
|
if (props.options.__streamClass) {
|
|
27
|
-
return props.options.__streamClass.fromSSEResponse(response, props.controller) as any;
|
|
27
|
+
return props.options.__streamClass.fromSSEResponse(response, props.controller, client) as any;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
return Stream.fromSSEResponse(response, props.controller) as any;
|
|
30
|
+
return Stream.fromSSEResponse(response, props.controller, client) as any;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
// fetch refuses to read the body when the status code is 204.
|
|
@@ -10,17 +10,70 @@ import { type HeadersLike } from './headers';
|
|
|
10
10
|
export type FinalRequestOptions = RequestOptions & { method: HTTPMethod; path: string };
|
|
11
11
|
|
|
12
12
|
export type RequestOptions = {
|
|
13
|
+
/**
|
|
14
|
+
* The HTTP method for the request (e.g., 'get', 'post', 'put', 'delete').
|
|
15
|
+
*/
|
|
13
16
|
method?: HTTPMethod;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The URL path for the request.
|
|
20
|
+
*
|
|
21
|
+
* @example "/v1/foo"
|
|
22
|
+
*/
|
|
14
23
|
path?: string;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Query parameters to include in the request URL.
|
|
27
|
+
*/
|
|
15
28
|
query?: object | undefined | null;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The request body. Can be a string, JSON object, FormData, or other supported types.
|
|
32
|
+
*/
|
|
16
33
|
body?: unknown;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* HTTP headers to include with the request. Can be a Headers object, plain object, or array of tuples.
|
|
37
|
+
*/
|
|
17
38
|
headers?: HeadersLike;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The maximum number of times that the client will retry a request in case of a
|
|
42
|
+
* temporary failure, like a network error or a 5XX error from the server.
|
|
43
|
+
*
|
|
44
|
+
* @default 2
|
|
45
|
+
*/
|
|
18
46
|
maxRetries?: number;
|
|
47
|
+
|
|
19
48
|
stream?: boolean | undefined;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The maximum amount of time (in milliseconds) that the client should wait for a response
|
|
52
|
+
* from the server before timing out a single request.
|
|
53
|
+
*
|
|
54
|
+
* @unit milliseconds
|
|
55
|
+
*/
|
|
20
56
|
timeout?: number;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Additional `RequestInit` options to be passed to the underlying `fetch` call.
|
|
60
|
+
* These options will be merged with the client's default fetch options.
|
|
61
|
+
*/
|
|
21
62
|
fetchOptions?: MergedRequestInit;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* An AbortSignal that can be used to cancel the request.
|
|
66
|
+
*/
|
|
22
67
|
signal?: AbortSignal | undefined | null;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* A unique key for this request to enable idempotency.
|
|
71
|
+
*/
|
|
23
72
|
idempotencyKey?: string;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Override the default base URL for this specific request.
|
|
76
|
+
*/
|
|
24
77
|
defaultBaseURL?: string | undefined;
|
|
25
78
|
|
|
26
79
|
__binaryResponse?: boolean | undefined;
|
|
@@ -84,6 +84,27 @@ export class Browsers extends APIResource {
|
|
|
84
84
|
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Get browser session replay.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```ts
|
|
93
|
+
* const response = await client.browsers.retrieveReplay(
|
|
94
|
+
* 'htzv5orfit78e1m2biiifpbv',
|
|
95
|
+
* );
|
|
96
|
+
*
|
|
97
|
+
* const content = await response.blob();
|
|
98
|
+
* console.log(content);
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
retrieveReplay(id: string, options?: RequestOptions): APIPromise<Response> {
|
|
102
|
+
return this._client.get(path`/browsers/${id}/replay`, {
|
|
103
|
+
...options,
|
|
104
|
+
headers: buildHeaders([{ Accept: 'video/mp4' }, options?.headers]),
|
|
105
|
+
__binaryResponse: true,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
87
108
|
}
|
|
88
109
|
|
|
89
110
|
/**
|
|
@@ -117,6 +138,11 @@ export interface BrowserCreateResponse {
|
|
|
117
138
|
* Optional persistence configuration for the browser session.
|
|
118
139
|
*/
|
|
119
140
|
persistence?: BrowserPersistence;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Remote URL for viewing the browser session replay if enabled
|
|
144
|
+
*/
|
|
145
|
+
replay_view_url?: string;
|
|
120
146
|
}
|
|
121
147
|
|
|
122
148
|
export interface BrowserRetrieveResponse {
|
|
@@ -140,6 +166,11 @@ export interface BrowserRetrieveResponse {
|
|
|
140
166
|
* Optional persistence configuration for the browser session.
|
|
141
167
|
*/
|
|
142
168
|
persistence?: BrowserPersistence;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Remote URL for viewing the browser session replay if enabled
|
|
172
|
+
*/
|
|
173
|
+
replay_view_url?: string;
|
|
143
174
|
}
|
|
144
175
|
|
|
145
176
|
export type BrowserListResponse = Array<BrowserListResponse.BrowserListResponseItem>;
|
|
@@ -166,6 +197,11 @@ export namespace BrowserListResponse {
|
|
|
166
197
|
* Optional persistence configuration for the browser session.
|
|
167
198
|
*/
|
|
168
199
|
persistence?: BrowsersAPI.BrowserPersistence;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Remote URL for viewing the browser session replay if enabled
|
|
203
|
+
*/
|
|
204
|
+
replay_view_url?: string;
|
|
169
205
|
}
|
|
170
206
|
}
|
|
171
207
|
|
|
@@ -186,6 +222,11 @@ export interface BrowserCreateParams {
|
|
|
186
222
|
*/
|
|
187
223
|
persistence?: BrowserPersistence;
|
|
188
224
|
|
|
225
|
+
/**
|
|
226
|
+
* If true, enables replay recording of the browser session. Defaults to false.
|
|
227
|
+
*/
|
|
228
|
+
replay?: boolean;
|
|
229
|
+
|
|
189
230
|
/**
|
|
190
231
|
* If true, launches the browser in stealth mode to reduce detection by anti-bot
|
|
191
232
|
* mechanisms.
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.7.
|
|
1
|
+
export const VERSION = '0.7.1'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.7.
|
|
1
|
+
export declare const VERSION = "0.7.1";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|