@onkernel/sdk 0.10.0 → 0.11.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.
Files changed (48) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/client.d.mts +5 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +5 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js +4 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs +4 -1
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/browsers/browsers.d.mts +67 -1
  12. package/resources/browsers/browsers.d.mts.map +1 -1
  13. package/resources/browsers/browsers.d.ts +67 -1
  14. package/resources/browsers/browsers.d.ts.map +1 -1
  15. package/resources/browsers/browsers.js.map +1 -1
  16. package/resources/browsers/browsers.mjs.map +1 -1
  17. package/resources/browsers/index.d.mts +1 -1
  18. package/resources/browsers/index.d.mts.map +1 -1
  19. package/resources/browsers/index.d.ts +1 -1
  20. package/resources/browsers/index.d.ts.map +1 -1
  21. package/resources/browsers/index.js.map +1 -1
  22. package/resources/browsers/index.mjs.map +1 -1
  23. package/resources/index.d.mts +2 -1
  24. package/resources/index.d.mts.map +1 -1
  25. package/resources/index.d.ts +2 -1
  26. package/resources/index.d.ts.map +1 -1
  27. package/resources/index.js +3 -1
  28. package/resources/index.js.map +1 -1
  29. package/resources/index.mjs +1 -0
  30. package/resources/index.mjs.map +1 -1
  31. package/resources/profiles.d.mts +39 -0
  32. package/resources/profiles.d.mts.map +1 -0
  33. package/resources/profiles.d.ts +39 -0
  34. package/resources/profiles.d.ts.map +1 -0
  35. package/resources/profiles.js +50 -0
  36. package/resources/profiles.js.map +1 -0
  37. package/resources/profiles.mjs +46 -0
  38. package/resources/profiles.mjs.map +1 -0
  39. package/src/client.ts +12 -1
  40. package/src/resources/browsers/browsers.ts +79 -0
  41. package/src/resources/browsers/index.ts +1 -0
  42. package/src/resources/index.ts +2 -0
  43. package/src/resources/profiles.ts +67 -0
  44. package/src/version.ts +1 -1
  45. package/version.d.mts +1 -1
  46. package/version.d.ts +1 -1
  47. package/version.js +1 -1
  48. package/version.mjs +1 -1
@@ -146,6 +146,36 @@ export interface BrowserPersistence {
146
146
  id: string;
147
147
  }
148
148
 
149
+ /**
150
+ * Browser profile metadata.
151
+ */
152
+ export interface Profile {
153
+ /**
154
+ * Unique identifier for the profile
155
+ */
156
+ id: string;
157
+
158
+ /**
159
+ * Timestamp when the profile was created
160
+ */
161
+ created_at: string;
162
+
163
+ /**
164
+ * Timestamp when the profile was last used
165
+ */
166
+ last_used_at?: string;
167
+
168
+ /**
169
+ * Optional, easier-to-reference name for the profile
170
+ */
171
+ name?: string | null;
172
+
173
+ /**
174
+ * Timestamp when the profile was last updated
175
+ */
176
+ updated_at?: string;
177
+ }
178
+
149
179
  export interface BrowserCreateResponse {
150
180
  /**
151
181
  * Websocket URL for Chrome DevTools Protocol connections to the browser session
@@ -187,6 +217,11 @@ export interface BrowserCreateResponse {
187
217
  * Optional persistence configuration for the browser session.
188
218
  */
189
219
  persistence?: BrowserPersistence;
220
+
221
+ /**
222
+ * Browser profile metadata.
223
+ */
224
+ profile?: Profile;
190
225
  }
191
226
 
192
227
  export interface BrowserRetrieveResponse {
@@ -230,6 +265,11 @@ export interface BrowserRetrieveResponse {
230
265
  * Optional persistence configuration for the browser session.
231
266
  */
232
267
  persistence?: BrowserPersistence;
268
+
269
+ /**
270
+ * Browser profile metadata.
271
+ */
272
+ profile?: Profile;
233
273
  }
234
274
 
235
275
  export type BrowserListResponse = Array<BrowserListResponse.BrowserListResponseItem>;
@@ -276,6 +316,11 @@ export namespace BrowserListResponse {
276
316
  * Optional persistence configuration for the browser session.
277
317
  */
278
318
  persistence?: BrowsersAPI.BrowserPersistence;
319
+
320
+ /**
321
+ * Browser profile metadata.
322
+ */
323
+ profile?: BrowsersAPI.Profile;
279
324
  }
280
325
  }
281
326
 
@@ -296,6 +341,13 @@ export interface BrowserCreateParams {
296
341
  */
297
342
  persistence?: BrowserPersistence;
298
343
 
344
+ /**
345
+ * Profile selection for the browser session. Provide either id or name. If
346
+ * specified, the matching profile will be loaded into the browser session.
347
+ * Profiles must be created beforehand.
348
+ */
349
+ profile?: BrowserCreateParams.Profile;
350
+
299
351
  /**
300
352
  * If true, launches the browser in stealth mode to reduce detection by anti-bot
301
353
  * mechanisms.
@@ -310,6 +362,32 @@ export interface BrowserCreateParams {
310
362
  timeout_seconds?: number;
311
363
  }
312
364
 
365
+ export namespace BrowserCreateParams {
366
+ /**
367
+ * Profile selection for the browser session. Provide either id or name. If
368
+ * specified, the matching profile will be loaded into the browser session.
369
+ * Profiles must be created beforehand.
370
+ */
371
+ export interface Profile {
372
+ /**
373
+ * Profile ID to load for this browser session
374
+ */
375
+ id?: string;
376
+
377
+ /**
378
+ * Profile name to load for this browser session (instead of id). Must be 1-255
379
+ * characters, using letters, numbers, dots, underscores, or hyphens.
380
+ */
381
+ name?: string;
382
+
383
+ /**
384
+ * If true, save changes made during the session back to the profile when the
385
+ * session ends.
386
+ */
387
+ save_changes?: boolean;
388
+ }
389
+ }
390
+
313
391
  export interface BrowserDeleteParams {
314
392
  /**
315
393
  * Persistent browser identifier
@@ -325,6 +403,7 @@ Browsers.Logs = Logs;
325
403
  export declare namespace Browsers {
326
404
  export {
327
405
  type BrowserPersistence as BrowserPersistence,
406
+ type Profile as Profile,
328
407
  type BrowserCreateResponse as BrowserCreateResponse,
329
408
  type BrowserRetrieveResponse as BrowserRetrieveResponse,
330
409
  type BrowserListResponse as BrowserListResponse,
@@ -3,6 +3,7 @@
3
3
  export {
4
4
  Browsers,
5
5
  type BrowserPersistence,
6
+ type Profile,
6
7
  type BrowserCreateResponse,
7
8
  type BrowserRetrieveResponse,
8
9
  type BrowserListResponse,
@@ -5,6 +5,7 @@ export { Apps, type AppListResponse, type AppListParams } from './apps';
5
5
  export {
6
6
  Browsers,
7
7
  type BrowserPersistence,
8
+ type Profile,
8
9
  type BrowserCreateResponse,
9
10
  type BrowserRetrieveResponse,
10
11
  type BrowserListResponse,
@@ -32,3 +33,4 @@ export {
32
33
  type InvocationCreateParams,
33
34
  type InvocationUpdateParams,
34
35
  } from './invocations';
36
+ export { Profiles, type ProfileListResponse, type ProfileCreateParams } from './profiles';
@@ -0,0 +1,67 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import * as BrowsersAPI from './browsers/browsers';
5
+ import { APIPromise } from '../core/api-promise';
6
+ import { buildHeaders } from '../internal/headers';
7
+ import { RequestOptions } from '../internal/request-options';
8
+ import { path } from '../internal/utils/path';
9
+
10
+ export class Profiles extends APIResource {
11
+ /**
12
+ * Create a browser profile that can be used to load state into future browser
13
+ * sessions.
14
+ */
15
+ create(body: ProfileCreateParams, options?: RequestOptions): APIPromise<BrowsersAPI.Profile> {
16
+ return this._client.post('/profiles', { body, ...options });
17
+ }
18
+
19
+ /**
20
+ * Retrieve details for a single profile by its ID or name.
21
+ */
22
+ retrieve(idOrName: string, options?: RequestOptions): APIPromise<BrowsersAPI.Profile> {
23
+ return this._client.get(path`/profiles/${idOrName}`, options);
24
+ }
25
+
26
+ /**
27
+ * List profiles with optional filtering and pagination.
28
+ */
29
+ list(options?: RequestOptions): APIPromise<ProfileListResponse> {
30
+ return this._client.get('/profiles', options);
31
+ }
32
+
33
+ /**
34
+ * Delete a profile by its ID or by its name.
35
+ */
36
+ delete(idOrName: string, options?: RequestOptions): APIPromise<void> {
37
+ return this._client.delete(path`/profiles/${idOrName}`, {
38
+ ...options,
39
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
40
+ });
41
+ }
42
+
43
+ /**
44
+ * Download the profile. Profiles are JSON files containing the pieces of state
45
+ * that we save.
46
+ */
47
+ download(idOrName: string, options?: RequestOptions): APIPromise<Response> {
48
+ return this._client.get(path`/profiles/${idOrName}/download`, {
49
+ ...options,
50
+ headers: buildHeaders([{ Accept: 'application/octet-stream' }, options?.headers]),
51
+ __binaryResponse: true,
52
+ });
53
+ }
54
+ }
55
+
56
+ export type ProfileListResponse = Array<BrowsersAPI.Profile>;
57
+
58
+ export interface ProfileCreateParams {
59
+ /**
60
+ * Optional name of the profile. Must be unique within the organization.
61
+ */
62
+ name?: string;
63
+ }
64
+
65
+ export declare namespace Profiles {
66
+ export { type ProfileListResponse as ProfileListResponse, type ProfileCreateParams as ProfileCreateParams };
67
+ }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.10.0'; // x-release-please-version
1
+ export const VERSION = '0.11.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.10.0";
1
+ export declare const VERSION = "0.11.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.10.0";
1
+ export declare const VERSION = "0.11.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.10.0'; // x-release-please-version
4
+ exports.VERSION = '0.11.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.10.0'; // x-release-please-version
1
+ export const VERSION = '0.11.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map