@onkernel/sdk 0.12.0 → 0.14.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 (60) hide show
  1. package/CHANGELOG.md +28 -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 +3 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -0
  9. package/client.mjs.map +1 -1
  10. package/internal/to-file.d.mts +1 -1
  11. package/internal/to-file.d.ts +1 -1
  12. package/internal/to-file.js +1 -1
  13. package/internal/to-file.mjs +1 -1
  14. package/package.json +1 -1
  15. package/resources/browsers/browsers.d.mts +57 -1
  16. package/resources/browsers/browsers.d.mts.map +1 -1
  17. package/resources/browsers/browsers.d.ts +57 -1
  18. package/resources/browsers/browsers.d.ts.map +1 -1
  19. package/resources/browsers/browsers.js +20 -0
  20. package/resources/browsers/browsers.js.map +1 -1
  21. package/resources/browsers/browsers.mjs +20 -0
  22. package/resources/browsers/browsers.mjs.map +1 -1
  23. package/resources/browsers/index.d.mts +1 -1
  24. package/resources/browsers/index.d.mts.map +1 -1
  25. package/resources/browsers/index.d.ts +1 -1
  26. package/resources/browsers/index.d.ts.map +1 -1
  27. package/resources/browsers/index.js.map +1 -1
  28. package/resources/browsers/index.mjs.map +1 -1
  29. package/resources/extensions.d.mts +145 -0
  30. package/resources/extensions.d.mts.map +1 -0
  31. package/resources/extensions.d.ts +145 -0
  32. package/resources/extensions.d.ts.map +1 -0
  33. package/resources/extensions.js +94 -0
  34. package/resources/extensions.js.map +1 -0
  35. package/resources/extensions.mjs +90 -0
  36. package/resources/extensions.mjs.map +1 -0
  37. package/resources/index.d.mts +2 -1
  38. package/resources/index.d.mts.map +1 -1
  39. package/resources/index.d.ts +2 -1
  40. package/resources/index.d.ts.map +1 -1
  41. package/resources/index.js +3 -1
  42. package/resources/index.js.map +1 -1
  43. package/resources/index.mjs +1 -0
  44. package/resources/index.mjs.map +1 -1
  45. package/resources/proxies.d.mts +40 -0
  46. package/resources/proxies.d.mts.map +1 -1
  47. package/resources/proxies.d.ts +40 -0
  48. package/resources/proxies.d.ts.map +1 -1
  49. package/src/client.ts +19 -0
  50. package/src/internal/to-file.ts +1 -1
  51. package/src/resources/browsers/browsers.ts +77 -0
  52. package/src/resources/browsers/index.ts +1 -0
  53. package/src/resources/extensions.ts +200 -0
  54. package/src/resources/index.ts +8 -0
  55. package/src/resources/proxies.ts +50 -0
  56. package/src/version.ts +1 -1
  57. package/version.d.mts +1 -1
  58. package/version.d.ts +1 -1
  59. package/version.js +1 -1
  60. package/version.mjs +1 -1
@@ -0,0 +1,200 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { type Uploadable } from '../core/uploads';
6
+ import { buildHeaders } from '../internal/headers';
7
+ import { RequestOptions } from '../internal/request-options';
8
+ import { multipartFormRequestOptions } from '../internal/uploads';
9
+ import { path } from '../internal/utils/path';
10
+
11
+ export class Extensions extends APIResource {
12
+ /**
13
+ * List extensions owned by the caller's organization.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * const extensions = await client.extensions.list();
18
+ * ```
19
+ */
20
+ list(options?: RequestOptions): APIPromise<ExtensionListResponse> {
21
+ return this._client.get('/extensions', options);
22
+ }
23
+
24
+ /**
25
+ * Delete an extension by its ID or by its name.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * await client.extensions.delete('id_or_name');
30
+ * ```
31
+ */
32
+ delete(idOrName: string, options?: RequestOptions): APIPromise<void> {
33
+ return this._client.delete(path`/extensions/${idOrName}`, {
34
+ ...options,
35
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
36
+ });
37
+ }
38
+
39
+ /**
40
+ * Download the extension as a ZIP archive by ID or name.
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * const response = await client.extensions.download(
45
+ * 'id_or_name',
46
+ * );
47
+ *
48
+ * const content = await response.blob();
49
+ * console.log(content);
50
+ * ```
51
+ */
52
+ download(idOrName: string, options?: RequestOptions): APIPromise<Response> {
53
+ return this._client.get(path`/extensions/${idOrName}`, {
54
+ ...options,
55
+ headers: buildHeaders([{ Accept: 'application/octet-stream' }, options?.headers]),
56
+ __binaryResponse: true,
57
+ });
58
+ }
59
+
60
+ /**
61
+ * Returns a ZIP archive containing the unpacked extension fetched from the Chrome
62
+ * Web Store.
63
+ *
64
+ * @example
65
+ * ```ts
66
+ * const response =
67
+ * await client.extensions.downloadFromChromeStore({
68
+ * url: 'url',
69
+ * });
70
+ *
71
+ * const content = await response.blob();
72
+ * console.log(content);
73
+ * ```
74
+ */
75
+ downloadFromChromeStore(
76
+ query: ExtensionDownloadFromChromeStoreParams,
77
+ options?: RequestOptions,
78
+ ): APIPromise<Response> {
79
+ return this._client.get('/extensions/from_chrome_store', {
80
+ query,
81
+ ...options,
82
+ headers: buildHeaders([{ Accept: 'application/octet-stream' }, options?.headers]),
83
+ __binaryResponse: true,
84
+ });
85
+ }
86
+
87
+ /**
88
+ * Upload a zip file containing an unpacked browser extension. Optionally provide a
89
+ * unique name for later reference.
90
+ *
91
+ * @example
92
+ * ```ts
93
+ * const response = await client.extensions.upload({
94
+ * file: fs.createReadStream('path/to/file'),
95
+ * });
96
+ * ```
97
+ */
98
+ upload(body: ExtensionUploadParams, options?: RequestOptions): APIPromise<ExtensionUploadResponse> {
99
+ return this._client.post('/extensions', multipartFormRequestOptions({ body, ...options }, this._client));
100
+ }
101
+ }
102
+
103
+ export type ExtensionListResponse = Array<ExtensionListResponse.ExtensionListResponseItem>;
104
+
105
+ export namespace ExtensionListResponse {
106
+ /**
107
+ * A browser extension uploaded to Kernel.
108
+ */
109
+ export interface ExtensionListResponseItem {
110
+ /**
111
+ * Unique identifier for the extension
112
+ */
113
+ id: string;
114
+
115
+ /**
116
+ * Timestamp when the extension was created
117
+ */
118
+ created_at: string;
119
+
120
+ /**
121
+ * Size of the extension archive in bytes
122
+ */
123
+ size_bytes: number;
124
+
125
+ /**
126
+ * Timestamp when the extension was last used
127
+ */
128
+ last_used_at?: string | null;
129
+
130
+ /**
131
+ * Optional, easier-to-reference name for the extension. Must be unique within the
132
+ * organization.
133
+ */
134
+ name?: string | null;
135
+ }
136
+ }
137
+
138
+ /**
139
+ * A browser extension uploaded to Kernel.
140
+ */
141
+ export interface ExtensionUploadResponse {
142
+ /**
143
+ * Unique identifier for the extension
144
+ */
145
+ id: string;
146
+
147
+ /**
148
+ * Timestamp when the extension was created
149
+ */
150
+ created_at: string;
151
+
152
+ /**
153
+ * Size of the extension archive in bytes
154
+ */
155
+ size_bytes: number;
156
+
157
+ /**
158
+ * Timestamp when the extension was last used
159
+ */
160
+ last_used_at?: string | null;
161
+
162
+ /**
163
+ * Optional, easier-to-reference name for the extension. Must be unique within the
164
+ * organization.
165
+ */
166
+ name?: string | null;
167
+ }
168
+
169
+ export interface ExtensionDownloadFromChromeStoreParams {
170
+ /**
171
+ * Chrome Web Store URL for the extension.
172
+ */
173
+ url: string;
174
+
175
+ /**
176
+ * Target operating system for the extension package. Defaults to linux.
177
+ */
178
+ os?: 'win' | 'mac' | 'linux';
179
+ }
180
+
181
+ export interface ExtensionUploadParams {
182
+ /**
183
+ * ZIP file containing the browser extension.
184
+ */
185
+ file: Uploadable;
186
+
187
+ /**
188
+ * Optional unique name within the organization to reference this extension.
189
+ */
190
+ name?: string;
191
+ }
192
+
193
+ export declare namespace Extensions {
194
+ export {
195
+ type ExtensionListResponse as ExtensionListResponse,
196
+ type ExtensionUploadResponse as ExtensionUploadResponse,
197
+ type ExtensionDownloadFromChromeStoreParams as ExtensionDownloadFromChromeStoreParams,
198
+ type ExtensionUploadParams as ExtensionUploadParams,
199
+ };
200
+ }
@@ -11,6 +11,7 @@ export {
11
11
  type BrowserListResponse,
12
12
  type BrowserCreateParams,
13
13
  type BrowserDeleteParams,
14
+ type BrowserUploadExtensionsParams,
14
15
  } from './browsers/browsers';
15
16
  export {
16
17
  Deployments,
@@ -24,6 +25,13 @@ export {
24
25
  type DeploymentFollowParams,
25
26
  type DeploymentListResponsesOffsetPagination,
26
27
  } from './deployments';
28
+ export {
29
+ Extensions,
30
+ type ExtensionListResponse,
31
+ type ExtensionUploadResponse,
32
+ type ExtensionDownloadFromChromeStoreParams,
33
+ type ExtensionUploadParams,
34
+ } from './extensions';
27
35
  export {
28
36
  Invocations,
29
37
  type InvocationStateEvent,
@@ -61,10 +61,25 @@ export interface ProxyCreateResponse {
61
61
  | ProxyCreateResponse.MobileProxyConfig
62
62
  | ProxyCreateResponse.CustomProxyConfig;
63
63
 
64
+ /**
65
+ * Timestamp of the last health check performed on this proxy.
66
+ */
67
+ last_checked?: string;
68
+
64
69
  /**
65
70
  * Readable name of the proxy.
66
71
  */
67
72
  name?: string;
73
+
74
+ /**
75
+ * Protocol to use for the proxy connection.
76
+ */
77
+ protocol?: 'http' | 'https';
78
+
79
+ /**
80
+ * Current health status of the proxy.
81
+ */
82
+ status?: 'available' | 'unavailable';
68
83
  }
69
84
 
70
85
  export namespace ProxyCreateResponse {
@@ -268,10 +283,25 @@ export interface ProxyRetrieveResponse {
268
283
  | ProxyRetrieveResponse.MobileProxyConfig
269
284
  | ProxyRetrieveResponse.CustomProxyConfig;
270
285
 
286
+ /**
287
+ * Timestamp of the last health check performed on this proxy.
288
+ */
289
+ last_checked?: string;
290
+
271
291
  /**
272
292
  * Readable name of the proxy.
273
293
  */
274
294
  name?: string;
295
+
296
+ /**
297
+ * Protocol to use for the proxy connection.
298
+ */
299
+ protocol?: 'http' | 'https';
300
+
301
+ /**
302
+ * Current health status of the proxy.
303
+ */
304
+ status?: 'available' | 'unavailable';
275
305
  }
276
306
 
277
307
  export namespace ProxyRetrieveResponse {
@@ -478,10 +508,25 @@ export namespace ProxyListResponse {
478
508
  | ProxyListResponseItem.MobileProxyConfig
479
509
  | ProxyListResponseItem.CustomProxyConfig;
480
510
 
511
+ /**
512
+ * Timestamp of the last health check performed on this proxy.
513
+ */
514
+ last_checked?: string;
515
+
481
516
  /**
482
517
  * Readable name of the proxy.
483
518
  */
484
519
  name?: string;
520
+
521
+ /**
522
+ * Protocol to use for the proxy connection.
523
+ */
524
+ protocol?: 'http' | 'https';
525
+
526
+ /**
527
+ * Current health status of the proxy.
528
+ */
529
+ status?: 'available' | 'unavailable';
485
530
  }
486
531
 
487
532
  export namespace ProxyListResponseItem {
@@ -685,6 +730,11 @@ export interface ProxyCreateParams {
685
730
  * Readable name of the proxy.
686
731
  */
687
732
  name?: string;
733
+
734
+ /**
735
+ * Protocol to use for the proxy connection.
736
+ */
737
+ protocol?: 'http' | 'https';
688
738
  }
689
739
 
690
740
  export namespace ProxyCreateParams {
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.12.0'; // x-release-please-version
1
+ export const VERSION = '0.14.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.12.0";
1
+ export declare const VERSION = "0.14.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.12.0";
1
+ export declare const VERSION = "0.14.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.12.0'; // x-release-please-version
4
+ exports.VERSION = '0.14.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.12.0'; // x-release-please-version
1
+ export const VERSION = '0.14.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map