@onkernel/sdk 0.141.0 → 0.142.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 (55) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/client.d.mts +6 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +6 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +6 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +6 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/config-registry/config-registry.d.mts +12 -1
  12. package/resources/config-registry/config-registry.d.mts.map +1 -1
  13. package/resources/config-registry/config-registry.d.ts +12 -1
  14. package/resources/config-registry/config-registry.d.ts.map +1 -1
  15. package/resources/config-registry/config-registry.js.map +1 -1
  16. package/resources/config-registry/config-registry.mjs.map +1 -1
  17. package/resources/index.d.mts +1 -0
  18. package/resources/index.d.mts.map +1 -1
  19. package/resources/index.d.ts +1 -0
  20. package/resources/index.d.ts.map +1 -1
  21. package/resources/index.js +3 -1
  22. package/resources/index.js.map +1 -1
  23. package/resources/index.mjs +1 -0
  24. package/resources/index.mjs.map +1 -1
  25. package/resources/proxies.d.mts +106 -12
  26. package/resources/proxies.d.mts.map +1 -1
  27. package/resources/proxies.d.ts +106 -12
  28. package/resources/proxies.d.ts.map +1 -1
  29. package/resources/proxies.js +8 -5
  30. package/resources/proxies.js.map +1 -1
  31. package/resources/proxies.mjs +8 -5
  32. package/resources/proxies.mjs.map +1 -1
  33. package/resources/proxy-ips.d.mts +100 -0
  34. package/resources/proxy-ips.d.mts.map +1 -0
  35. package/resources/proxy-ips.d.ts +100 -0
  36. package/resources/proxy-ips.d.ts.map +1 -0
  37. package/resources/proxy-ips.js +38 -0
  38. package/resources/proxy-ips.js.map +1 -0
  39. package/resources/proxy-ips.mjs +34 -0
  40. package/resources/proxy-ips.mjs.map +1 -0
  41. package/resources/shared.d.mts +4 -2
  42. package/resources/shared.d.mts.map +1 -1
  43. package/resources/shared.d.ts +4 -2
  44. package/resources/shared.d.ts.map +1 -1
  45. package/src/client.ts +20 -0
  46. package/src/resources/config-registry/config-registry.ts +13 -1
  47. package/src/resources/index.ts +7 -0
  48. package/src/resources/proxies.ts +115 -12
  49. package/src/resources/proxy-ips.ts +130 -0
  50. package/src/resources/shared.ts +4 -2
  51. package/src/version.ts +1 -1
  52. package/version.d.mts +1 -1
  53. package/version.d.ts +1 -1
  54. package/version.js +1 -1
  55. package/version.mjs +1 -1
@@ -39,14 +39,17 @@ export class Proxies extends APIResource {
39
39
  }
40
40
 
41
41
  /**
42
- * Update a proxy's name. Proxy names are not unique and duplicate names are
43
- * allowed.
42
+ * Update a proxy's name, or move an ISP proxy to another reserved exit IP. Proxy
43
+ * names are not unique and duplicate names are allowed. Moving requires a reserved
44
+ * ISP allocation and is accepted only for proxies of type isp: the new endpoint is
45
+ * probed first and nothing changes if the probe fails. An IP outside the
46
+ * allocation is a 400 with code ip_not_reserved. A 409 means the IP cannot
47
+ * currently be assigned or the proxy was changed concurrently; read it back and
48
+ * retry.
44
49
  *
45
50
  * @example
46
51
  * ```ts
47
- * const proxy = await client.proxies.update('id_or_name', {
48
- * name: 'my-renamed-proxy',
49
- * });
52
+ * const proxy = await client.proxies.update('id_or_name');
50
53
  * ```
51
54
  */
52
55
  update(
@@ -172,9 +175,21 @@ export namespace ProxyCreateResponse {
172
175
  export interface IspProxyConfig {
173
176
  /**
174
177
  * ISO 3166 country code. Supported countries are US, GB, FR, DE, SG, and KR.
175
- * Defaults to US if not provided.
178
+ * Defaults to US if not provided, or to the country of ip_address when that is
179
+ * set.
176
180
  */
177
181
  country?: string;
182
+
183
+ /**
184
+ * Reserved exit IP to pin the proxy to. Available only to organizations with a
185
+ * reserved ISP allocation; the IP must be active in it (see GET /proxy_ips) and,
186
+ * when country is also set, in that country. Omit to let Kernel choose an IP. A
187
+ * proxy read includes it only when the proxy's primary exit IP is one of the
188
+ * organization's reserved IPs; every ISP proxy's exit IP is on the top-level
189
+ * ip_address. An IP outside the allocation is rejected with code ip_not_reserved;
190
+ * one that cannot currently be assigned, with 409 ip_unavailable.
191
+ */
192
+ ip_address?: string;
178
193
  }
179
194
 
180
195
  /**
@@ -321,9 +336,21 @@ export namespace ProxyRetrieveResponse {
321
336
  export interface IspProxyConfig {
322
337
  /**
323
338
  * ISO 3166 country code. Supported countries are US, GB, FR, DE, SG, and KR.
324
- * Defaults to US if not provided.
339
+ * Defaults to US if not provided, or to the country of ip_address when that is
340
+ * set.
325
341
  */
326
342
  country?: string;
343
+
344
+ /**
345
+ * Reserved exit IP to pin the proxy to. Available only to organizations with a
346
+ * reserved ISP allocation; the IP must be active in it (see GET /proxy_ips) and,
347
+ * when country is also set, in that country. Omit to let Kernel choose an IP. A
348
+ * proxy read includes it only when the proxy's primary exit IP is one of the
349
+ * organization's reserved IPs; every ISP proxy's exit IP is on the top-level
350
+ * ip_address. An IP outside the allocation is rejected with code ip_not_reserved;
351
+ * one that cannot currently be assigned, with 409 ip_unavailable.
352
+ */
353
+ ip_address?: string;
327
354
  }
328
355
 
329
356
  /**
@@ -470,9 +497,21 @@ export namespace ProxyUpdateResponse {
470
497
  export interface IspProxyConfig {
471
498
  /**
472
499
  * ISO 3166 country code. Supported countries are US, GB, FR, DE, SG, and KR.
473
- * Defaults to US if not provided.
500
+ * Defaults to US if not provided, or to the country of ip_address when that is
501
+ * set.
474
502
  */
475
503
  country?: string;
504
+
505
+ /**
506
+ * Reserved exit IP to pin the proxy to. Available only to organizations with a
507
+ * reserved ISP allocation; the IP must be active in it (see GET /proxy_ips) and,
508
+ * when country is also set, in that country. Omit to let Kernel choose an IP. A
509
+ * proxy read includes it only when the proxy's primary exit IP is one of the
510
+ * organization's reserved IPs; every ISP proxy's exit IP is on the top-level
511
+ * ip_address. An IP outside the allocation is rejected with code ip_not_reserved;
512
+ * one that cannot currently be assigned, with 409 ip_unavailable.
513
+ */
514
+ ip_address?: string;
476
515
  }
477
516
 
478
517
  /**
@@ -619,9 +658,21 @@ export namespace ProxyListResponse {
619
658
  export interface IspProxyConfig {
620
659
  /**
621
660
  * ISO 3166 country code. Supported countries are US, GB, FR, DE, SG, and KR.
622
- * Defaults to US if not provided.
661
+ * Defaults to US if not provided, or to the country of ip_address when that is
662
+ * set.
623
663
  */
624
664
  country?: string;
665
+
666
+ /**
667
+ * Reserved exit IP to pin the proxy to. Available only to organizations with a
668
+ * reserved ISP allocation; the IP must be active in it (see GET /proxy_ips) and,
669
+ * when country is also set, in that country. Omit to let Kernel choose an IP. A
670
+ * proxy read includes it only when the proxy's primary exit IP is one of the
671
+ * organization's reserved IPs; every ISP proxy's exit IP is on the top-level
672
+ * ip_address. An IP outside the allocation is rejected with code ip_not_reserved;
673
+ * one that cannot currently be assigned, with 409 ip_unavailable.
674
+ */
675
+ ip_address?: string;
625
676
  }
626
677
 
627
678
  /**
@@ -768,9 +819,21 @@ export namespace ProxyCheckResponse {
768
819
  export interface IspProxyConfig {
769
820
  /**
770
821
  * ISO 3166 country code. Supported countries are US, GB, FR, DE, SG, and KR.
771
- * Defaults to US if not provided.
822
+ * Defaults to US if not provided, or to the country of ip_address when that is
823
+ * set.
772
824
  */
773
825
  country?: string;
826
+
827
+ /**
828
+ * Reserved exit IP to pin the proxy to. Available only to organizations with a
829
+ * reserved ISP allocation; the IP must be active in it (see GET /proxy_ips) and,
830
+ * when country is also set, in that country. Omit to let Kernel choose an IP. A
831
+ * proxy read includes it only when the proxy's primary exit IP is one of the
832
+ * organization's reserved IPs; every ISP proxy's exit IP is on the top-level
833
+ * ip_address. An IP outside the allocation is rejected with code ip_not_reserved;
834
+ * one that cannot currently be assigned, with 409 ip_unavailable.
835
+ */
836
+ ip_address?: string;
774
837
  }
775
838
 
776
839
  /**
@@ -897,9 +960,21 @@ export namespace ProxyCreateParams {
897
960
  export interface IspProxyConfig {
898
961
  /**
899
962
  * ISO 3166 country code. Supported countries are US, GB, FR, DE, SG, and KR.
900
- * Defaults to US if not provided.
963
+ * Defaults to US if not provided, or to the country of ip_address when that is
964
+ * set.
901
965
  */
902
966
  country?: string;
967
+
968
+ /**
969
+ * Reserved exit IP to pin the proxy to. Available only to organizations with a
970
+ * reserved ISP allocation; the IP must be active in it (see GET /proxy_ips) and,
971
+ * when country is also set, in that country. Omit to let Kernel choose an IP. A
972
+ * proxy read includes it only when the proxy's primary exit IP is one of the
973
+ * organization's reserved IPs; every ISP proxy's exit IP is on the top-level
974
+ * ip_address. An IP outside the allocation is rejected with code ip_not_reserved;
975
+ * one that cannot currently be assigned, with 409 ip_unavailable.
976
+ */
977
+ ip_address?: string;
903
978
  }
904
979
 
905
980
  /**
@@ -994,14 +1069,42 @@ export namespace ProxyCreateParams {
994
1069
  }
995
1070
 
996
1071
  export interface ProxyUpdateParams {
1072
+ /**
1073
+ * Changes to an ISP proxy's exit IP. Accepted only for proxies of type `isp`.
1074
+ */
1075
+ config?: ProxyUpdateParams.Config;
1076
+
997
1077
  /**
998
1078
  * New proxy name. Proxy names are trimmed and length-checked only; duplicates are
999
1079
  * allowed because proxies are updated by ID, not by name.
1000
1080
  */
1001
- name: string;
1081
+ name?: string;
1082
+ }
1083
+
1084
+ export namespace ProxyUpdateParams {
1085
+ /**
1086
+ * Changes to an ISP proxy's exit IP. Accepted only for proxies of type `isp`.
1087
+ */
1088
+ export interface Config {
1089
+ /**
1090
+ * Reserved exit IP to move the proxy to. The IP must be active in the
1091
+ * organization's allocation and in the proxy's country. The proxy keeps its ID.
1092
+ * The new endpoint is probed before anything changes; a failed probe leaves the
1093
+ * proxy as it was. Live browsers open new connections on the new IP within a few
1094
+ * seconds; established connections drain on the old one.
1095
+ */
1096
+ ip_address: string;
1097
+ }
1002
1098
  }
1003
1099
 
1004
1100
  export interface ProxyListParams extends OffsetPaginationParams {
1101
+ /**
1102
+ * Exact match on the primary exit IP of ISP proxies. Must be an IPv4 address. Only
1103
+ * ISP proxies are matched: the ip_address shown on other proxy types is a one-time
1104
+ * observation, not a stable identity.
1105
+ */
1106
+ ip_address?: string;
1107
+
1005
1108
  /**
1006
1109
  * Exact-match filter on proxy name using the database collation. In production,
1007
1110
  * matching is case- and accent-insensitive. Names are not required to be unique,
@@ -0,0 +1,130 @@
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 { OffsetPagination, type OffsetPaginationParams, PagePromise } from '../core/pagination';
6
+ import { RequestOptions } from '../internal/request-options';
7
+ import { path } from '../internal/utils/path';
8
+
9
+ /**
10
+ * Create and manage proxy configurations for routing browser traffic.
11
+ */
12
+ export class ProxyIPs extends APIResource {
13
+ /**
14
+ * Retrieve one reserved IP with the ISP proxies using it as their primary exit.
15
+ * proxy_count spans the organization; proxies lists only those in the current
16
+ * project. Returns 404 when the IP is not in the organization's allocation and 403
17
+ * with code reserved_isp_not_enabled when the organization has none. Scoped API
18
+ * keys require proxies:read on the whole project or organization, not on
19
+ * individual proxies; otherwise the operation returns 403 with code
20
+ * insufficient_scope.
21
+ */
22
+ retrieve(ipAddress: string, options?: RequestOptions): APIPromise<ProxyIPDetail> {
23
+ return this._client.get(path`/proxy_ips/${ipAddress}`, options);
24
+ }
25
+
26
+ /**
27
+ * List the IP addresses reserved for the organization's ISP proxies, with each
28
+ * IP's country and whether it can currently be assigned. Available only to
29
+ * organizations with a reserved ISP allocation; others receive a 403 with code
30
+ * reserved_isp_not_enabled. Served from the allocation itself, so IPs appear
31
+ * whether or not a proxy uses them. Scoped API keys require proxies:read on the
32
+ * whole project or organization, not on individual proxies; otherwise the
33
+ * operation returns 403 with code insufficient_scope.
34
+ */
35
+ list(
36
+ query: ProxyIPListParams | null | undefined = {},
37
+ options?: RequestOptions,
38
+ ): PagePromise<ProxyIPsOffsetPagination, ProxyIP> {
39
+ return this._client.getAPIList('/proxy_ips', OffsetPagination<ProxyIP>, { query, ...options });
40
+ }
41
+ }
42
+
43
+ export type ProxyIPsOffsetPagination = OffsetPagination<ProxyIP>;
44
+
45
+ /**
46
+ * One IP address reserved for the organization's ISP proxies.
47
+ */
48
+ export interface ProxyIP {
49
+ /**
50
+ * ISO 3166 country code of the IP.
51
+ */
52
+ country: string;
53
+
54
+ /**
55
+ * Reserved exit IP address.
56
+ */
57
+ ip_address: string;
58
+
59
+ /**
60
+ * Whether the IP can currently be assigned. An excluded IP is listed but cannot be
61
+ * pinned or moved to; proxies already on it keep working.
62
+ */
63
+ status: 'active' | 'excluded';
64
+ }
65
+
66
+ /**
67
+ * A reserved IP with the ISP proxies using it as their primary exit. Reservations
68
+ * are organization-wide, so proxy_count covers every project while proxies lists
69
+ * only those in the current project.
70
+ */
71
+ export interface ProxyIPDetail {
72
+ /**
73
+ * ISO 3166 country code of the IP.
74
+ */
75
+ country: string;
76
+
77
+ /**
78
+ * Reserved exit IP address.
79
+ */
80
+ ip_address: string;
81
+
82
+ /**
83
+ * ISP proxies in the current project whose primary exit IP is this address.
84
+ */
85
+ proxies: Array<ProxyIPDetail.Proxy>;
86
+
87
+ /**
88
+ * Number of ISP proxies across the organization whose primary exit IP is this
89
+ * address.
90
+ */
91
+ proxy_count: number;
92
+
93
+ /**
94
+ * Whether the IP can currently be assigned. An excluded IP is listed but cannot be
95
+ * pinned or moved to; proxies already on it keep working.
96
+ */
97
+ status: 'active' | 'excluded';
98
+ }
99
+
100
+ export namespace ProxyIPDetail {
101
+ /**
102
+ * An ISP proxy whose primary exit is the reserved IP.
103
+ */
104
+ export interface Proxy {
105
+ id: string;
106
+
107
+ name?: string;
108
+ }
109
+ }
110
+
111
+ export interface ProxyIPListParams extends OffsetPaginationParams {
112
+ /**
113
+ * ISO 3166 country code to filter by. Must be a country ISP proxies support.
114
+ */
115
+ country?: string;
116
+
117
+ /**
118
+ * Filter by whether the IP can currently be assigned.
119
+ */
120
+ status?: 'active' | 'excluded';
121
+ }
122
+
123
+ export declare namespace ProxyIPs {
124
+ export {
125
+ type ProxyIP as ProxyIP,
126
+ type ProxyIPDetail as ProxyIPDetail,
127
+ type ProxyIPsOffsetPagination as ProxyIPsOffsetPagination,
128
+ type ProxyIPListParams as ProxyIPListParams,
129
+ };
130
+ }
@@ -79,12 +79,14 @@ export interface BrowserProfile {
79
79
  */
80
80
  export interface BrowserViewport {
81
81
  /**
82
- * Browser window height in pixels. Any positive integer is accepted.
82
+ * Browser window height in pixels. Any positive integer is accepted; headful
83
+ * browsers require at least 64.
83
84
  */
84
85
  height: number;
85
86
 
86
87
  /**
87
- * Browser window width in pixels. Any positive integer is accepted.
88
+ * Browser window width in pixels. Any positive integer is accepted; headful
89
+ * browsers require at least 64.
88
90
  */
89
91
  width: number;
90
92
 
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.141.0'; // x-release-please-version
1
+ export const VERSION = '0.142.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.141.0";
1
+ export declare const VERSION = "0.142.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.141.0";
1
+ export declare const VERSION = "0.142.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.141.0'; // x-release-please-version
4
+ exports.VERSION = '0.142.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.141.0'; // x-release-please-version
1
+ export const VERSION = '0.142.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map