@onkernel/sdk 0.49.0 → 0.51.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 +64 -0
- package/client.d.mts +5 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +5 -2
- package/client.d.ts.map +1 -1
- package/client.js +15 -2
- package/client.js.map +1 -1
- package/client.mjs +15 -2
- package/client.mjs.map +1 -1
- package/index.d.mts +2 -0
- package/index.d.mts.map +1 -1
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/index.mjs +1 -0
- package/index.mjs.map +1 -1
- package/lib/browser-fetch.d.mts +7 -0
- package/lib/browser-fetch.d.mts.map +1 -0
- package/lib/browser-fetch.d.ts +7 -0
- package/lib/browser-fetch.d.ts.map +1 -0
- package/lib/browser-fetch.js +128 -0
- package/lib/browser-fetch.js.map +1 -0
- package/lib/browser-fetch.mjs +125 -0
- package/lib/browser-fetch.mjs.map +1 -0
- package/lib/browser-routing.d.mts +20 -0
- package/lib/browser-routing.d.mts.map +1 -0
- package/lib/browser-routing.d.ts +20 -0
- package/lib/browser-routing.d.ts.map +1 -0
- package/lib/browser-routing.js +246 -0
- package/lib/browser-routing.js.map +1 -0
- package/lib/browser-routing.mjs +240 -0
- package/lib/browser-routing.mjs.map +1 -0
- package/lib/join-url.d.mts +2 -0
- package/lib/join-url.d.mts.map +1 -0
- package/lib/join-url.d.ts +2 -0
- package/lib/join-url.d.ts.map +1 -0
- package/lib/join-url.js +7 -0
- package/lib/join-url.js.map +1 -0
- package/lib/join-url.mjs +4 -0
- package/lib/join-url.mjs.map +1 -0
- package/package.json +11 -1
- package/resources/auth/connections.d.mts +31 -2
- package/resources/auth/connections.d.mts.map +1 -1
- package/resources/auth/connections.d.ts +31 -2
- package/resources/auth/connections.d.ts.map +1 -1
- package/resources/browsers/browsers.d.mts +72 -1
- package/resources/browsers/browsers.d.mts.map +1 -1
- package/resources/browsers/browsers.d.ts +72 -1
- package/resources/browsers/browsers.d.ts.map +1 -1
- package/resources/browsers/browsers.js +23 -0
- package/resources/browsers/browsers.js.map +1 -1
- package/resources/browsers/browsers.mjs +23 -0
- package/resources/browsers/browsers.mjs.map +1 -1
- package/resources/browsers/index.d.mts +1 -1
- package/resources/browsers/index.d.mts.map +1 -1
- package/resources/browsers/index.d.ts +1 -1
- package/resources/browsers/index.d.ts.map +1 -1
- package/resources/browsers/index.js.map +1 -1
- package/resources/browsers/index.mjs.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/projects/projects.d.mts +2 -2
- package/resources/projects/projects.d.ts +2 -2
- package/resources/projects/projects.js +2 -2
- package/resources/projects/projects.mjs +2 -2
- package/src/client.ts +25 -2
- package/src/index.ts +2 -0
- package/src/lib/browser-fetch.ts +180 -0
- package/src/lib/browser-routing.ts +329 -0
- package/src/lib/join-url.ts +3 -0
- package/src/resources/auth/connections.ts +35 -2
- package/src/resources/browsers/browsers.ts +85 -0
- package/src/resources/browsers/index.ts +2 -0
- package/src/resources/index.ts +2 -0
- package/src/resources/projects/projects.ts +2 -2
- 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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
import type { RequestInfo } from '../../internal/builtin-types';
|
|
3
4
|
import { APIResource } from '../../core/resource';
|
|
4
5
|
import * as Shared from '../shared';
|
|
5
6
|
import * as ComputerAPI from './computer';
|
|
@@ -75,6 +76,7 @@ import { buildHeaders } from '../../internal/headers';
|
|
|
75
76
|
import { RequestOptions } from '../../internal/request-options';
|
|
76
77
|
import { multipartFormRequestOptions } from '../../internal/uploads';
|
|
77
78
|
import { path } from '../../internal/utils/path';
|
|
79
|
+
import { browserFetch, type BrowserFetchInit } from '../../lib/browser-fetch';
|
|
78
80
|
|
|
79
81
|
/**
|
|
80
82
|
* Create and manage browser sessions.
|
|
@@ -168,6 +170,30 @@ export class Browsers extends APIResource {
|
|
|
168
170
|
});
|
|
169
171
|
}
|
|
170
172
|
|
|
173
|
+
/**
|
|
174
|
+
* Sends an HTTP request through Chrome's HTTP request stack, inheriting the
|
|
175
|
+
* browser's TLS fingerprint, cookies, proxy configuration, and headers. Returns a
|
|
176
|
+
* structured JSON response with status, headers, body, and timing.
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```ts
|
|
180
|
+
* const response = await client.browsers.curl('id', {
|
|
181
|
+
* url: 'url',
|
|
182
|
+
* });
|
|
183
|
+
* ```
|
|
184
|
+
*/
|
|
185
|
+
curl(id: string, body: BrowserCurlParams, options?: RequestOptions): APIPromise<BrowserCurlResponse> {
|
|
186
|
+
return this._client.post(path`/browsers/${id}/curl`, { body, ...options });
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Issues an HTTP request through the browser VM network stack, routing directly
|
|
191
|
+
* to the browser's `base_url` using the shared browser route cache.
|
|
192
|
+
*/
|
|
193
|
+
fetch(id: string, input: RequestInfo | URL, init?: BrowserFetchInit): Promise<Response> {
|
|
194
|
+
return browserFetch(this._client, id, input, init);
|
|
195
|
+
}
|
|
196
|
+
|
|
171
197
|
/**
|
|
172
198
|
* Delete a browser session by ID
|
|
173
199
|
*
|
|
@@ -706,6 +732,31 @@ export interface BrowserListResponse {
|
|
|
706
732
|
viewport?: Shared.BrowserViewport;
|
|
707
733
|
}
|
|
708
734
|
|
|
735
|
+
/**
|
|
736
|
+
* Structured response from the browser curl request.
|
|
737
|
+
*/
|
|
738
|
+
export interface BrowserCurlResponse {
|
|
739
|
+
/**
|
|
740
|
+
* Response body (UTF-8 string or base64 depending on request).
|
|
741
|
+
*/
|
|
742
|
+
body: string;
|
|
743
|
+
|
|
744
|
+
/**
|
|
745
|
+
* Total request duration in milliseconds.
|
|
746
|
+
*/
|
|
747
|
+
duration_ms: number;
|
|
748
|
+
|
|
749
|
+
/**
|
|
750
|
+
* Response headers (multi-value).
|
|
751
|
+
*/
|
|
752
|
+
headers: { [key: string]: Array<string> };
|
|
753
|
+
|
|
754
|
+
/**
|
|
755
|
+
* HTTP status code from target.
|
|
756
|
+
*/
|
|
757
|
+
status: number;
|
|
758
|
+
}
|
|
759
|
+
|
|
709
760
|
export interface BrowserCreateParams {
|
|
710
761
|
/**
|
|
711
762
|
* List of browser extensions to load into the session. Provide each by id or name.
|
|
@@ -859,6 +910,38 @@ export interface BrowserDeleteParams {
|
|
|
859
910
|
persistent_id: string;
|
|
860
911
|
}
|
|
861
912
|
|
|
913
|
+
export interface BrowserCurlParams {
|
|
914
|
+
/**
|
|
915
|
+
* Target URL (must be http or https).
|
|
916
|
+
*/
|
|
917
|
+
url: string;
|
|
918
|
+
|
|
919
|
+
/**
|
|
920
|
+
* Request body (for POST/PUT/PATCH).
|
|
921
|
+
*/
|
|
922
|
+
body?: string;
|
|
923
|
+
|
|
924
|
+
/**
|
|
925
|
+
* Custom headers merged with browser defaults.
|
|
926
|
+
*/
|
|
927
|
+
headers?: { [key: string]: string };
|
|
928
|
+
|
|
929
|
+
/**
|
|
930
|
+
* HTTP method.
|
|
931
|
+
*/
|
|
932
|
+
method?: 'GET' | 'HEAD' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS';
|
|
933
|
+
|
|
934
|
+
/**
|
|
935
|
+
* Encoding for the response body. Use base64 for binary content.
|
|
936
|
+
*/
|
|
937
|
+
response_encoding?: 'utf8' | 'base64';
|
|
938
|
+
|
|
939
|
+
/**
|
|
940
|
+
* Request timeout in milliseconds.
|
|
941
|
+
*/
|
|
942
|
+
timeout_ms?: number;
|
|
943
|
+
}
|
|
944
|
+
|
|
862
945
|
export interface BrowserLoadExtensionsParams {
|
|
863
946
|
/**
|
|
864
947
|
* List of extensions to upload and activate
|
|
@@ -898,12 +981,14 @@ export declare namespace Browsers {
|
|
|
898
981
|
type BrowserRetrieveResponse as BrowserRetrieveResponse,
|
|
899
982
|
type BrowserUpdateResponse as BrowserUpdateResponse,
|
|
900
983
|
type BrowserListResponse as BrowserListResponse,
|
|
984
|
+
type BrowserCurlResponse as BrowserCurlResponse,
|
|
901
985
|
type BrowserListResponsesOffsetPagination as BrowserListResponsesOffsetPagination,
|
|
902
986
|
type BrowserCreateParams as BrowserCreateParams,
|
|
903
987
|
type BrowserRetrieveParams as BrowserRetrieveParams,
|
|
904
988
|
type BrowserUpdateParams as BrowserUpdateParams,
|
|
905
989
|
type BrowserListParams as BrowserListParams,
|
|
906
990
|
type BrowserDeleteParams as BrowserDeleteParams,
|
|
991
|
+
type BrowserCurlParams as BrowserCurlParams,
|
|
907
992
|
type BrowserLoadExtensionsParams as BrowserLoadExtensionsParams,
|
|
908
993
|
};
|
|
909
994
|
|
|
@@ -10,11 +10,13 @@ export {
|
|
|
10
10
|
type BrowserRetrieveResponse,
|
|
11
11
|
type BrowserUpdateResponse,
|
|
12
12
|
type BrowserListResponse,
|
|
13
|
+
type BrowserCurlResponse,
|
|
13
14
|
type BrowserCreateParams,
|
|
14
15
|
type BrowserRetrieveParams,
|
|
15
16
|
type BrowserUpdateParams,
|
|
16
17
|
type BrowserListParams,
|
|
17
18
|
type BrowserDeleteParams,
|
|
19
|
+
type BrowserCurlParams,
|
|
18
20
|
type BrowserLoadExtensionsParams,
|
|
19
21
|
type ProfilesOffsetPagination,
|
|
20
22
|
type BrowserListResponsesOffsetPagination,
|
package/src/resources/index.ts
CHANGED
|
@@ -29,11 +29,13 @@ export {
|
|
|
29
29
|
type BrowserRetrieveResponse,
|
|
30
30
|
type BrowserUpdateResponse,
|
|
31
31
|
type BrowserListResponse,
|
|
32
|
+
type BrowserCurlResponse,
|
|
32
33
|
type BrowserCreateParams,
|
|
33
34
|
type BrowserRetrieveParams,
|
|
34
35
|
type BrowserUpdateParams,
|
|
35
36
|
type BrowserListParams,
|
|
36
37
|
type BrowserDeleteParams,
|
|
38
|
+
type BrowserCurlParams,
|
|
37
39
|
type BrowserLoadExtensionsParams,
|
|
38
40
|
type ProfilesOffsetPagination,
|
|
39
41
|
type BrowserListResponsesOffsetPagination,
|
|
@@ -16,8 +16,8 @@ export class Projects extends APIResource {
|
|
|
16
16
|
limits: LimitsAPI.Limits = new LimitsAPI.Limits(this._client);
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* Create a new project within the authenticated organization. Requires
|
|
20
|
-
*
|
|
19
|
+
* Create a new project within the authenticated organization. Requires the
|
|
20
|
+
* projects feature flag.
|
|
21
21
|
*
|
|
22
22
|
* @example
|
|
23
23
|
* ```ts
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.51.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.51.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.51.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.51.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|