@onkernel/sdk 0.47.0 → 0.48.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 (83) hide show
  1. package/CHANGELOG.md +14 -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/internal/utils/env.js +2 -2
  11. package/internal/utils/env.js.map +1 -1
  12. package/internal/utils/env.mjs +2 -2
  13. package/internal/utils/env.mjs.map +1 -1
  14. package/package.json +1 -1
  15. package/resources/browser-pools.d.mts +4 -0
  16. package/resources/browser-pools.d.mts.map +1 -1
  17. package/resources/browser-pools.d.ts +4 -0
  18. package/resources/browser-pools.d.ts.map +1 -1
  19. package/resources/browsers/browsers.d.mts +16 -0
  20. package/resources/browsers/browsers.d.mts.map +1 -1
  21. package/resources/browsers/browsers.d.ts +16 -0
  22. package/resources/browsers/browsers.d.ts.map +1 -1
  23. package/resources/browsers/browsers.js.map +1 -1
  24. package/resources/browsers/browsers.mjs.map +1 -1
  25. package/resources/index.d.mts +1 -0
  26. package/resources/index.d.mts.map +1 -1
  27. package/resources/index.d.ts +1 -0
  28. package/resources/index.d.ts.map +1 -1
  29. package/resources/index.js +3 -1
  30. package/resources/index.js.map +1 -1
  31. package/resources/index.mjs +1 -0
  32. package/resources/index.mjs.map +1 -1
  33. package/resources/invocations.d.mts +4 -0
  34. package/resources/invocations.d.mts.map +1 -1
  35. package/resources/invocations.d.ts +4 -0
  36. package/resources/invocations.d.ts.map +1 -1
  37. package/resources/projects/index.d.mts +3 -0
  38. package/resources/projects/index.d.mts.map +1 -0
  39. package/resources/projects/index.d.ts +3 -0
  40. package/resources/projects/index.d.ts.map +1 -0
  41. package/resources/projects/index.js +9 -0
  42. package/resources/projects/index.js.map +1 -0
  43. package/resources/projects/index.mjs +4 -0
  44. package/resources/projects/index.mjs.map +1 -0
  45. package/resources/projects/limits.d.mts +103 -0
  46. package/resources/projects/limits.d.mts.map +1 -0
  47. package/resources/projects/limits.d.ts +103 -0
  48. package/resources/projects/limits.d.ts.map +1 -0
  49. package/resources/projects/limits.js +42 -0
  50. package/resources/projects/limits.js.map +1 -0
  51. package/resources/projects/limits.mjs +38 -0
  52. package/resources/projects/limits.mjs.map +1 -0
  53. package/resources/projects/projects.d.mts +125 -0
  54. package/resources/projects/projects.d.mts.map +1 -0
  55. package/resources/projects/projects.d.ts +125 -0
  56. package/resources/projects/projects.d.ts.map +1 -0
  57. package/resources/projects/projects.js +87 -0
  58. package/resources/projects/projects.js.map +1 -0
  59. package/resources/projects/projects.mjs +82 -0
  60. package/resources/projects/projects.mjs.map +1 -0
  61. package/resources/projects.d.mts +2 -0
  62. package/resources/projects.d.mts.map +1 -0
  63. package/resources/projects.d.ts +2 -0
  64. package/resources/projects.d.ts.map +1 -0
  65. package/resources/projects.js +6 -0
  66. package/resources/projects.js.map +1 -0
  67. package/resources/projects.mjs +3 -0
  68. package/resources/projects.mjs.map +1 -0
  69. package/src/client.ts +26 -0
  70. package/src/internal/utils/env.ts +2 -2
  71. package/src/resources/browser-pools.ts +5 -0
  72. package/src/resources/browsers/browsers.ts +20 -0
  73. package/src/resources/index.ts +10 -0
  74. package/src/resources/invocations.ts +5 -0
  75. package/src/resources/projects/index.ts +18 -0
  76. package/src/resources/projects/limits.ts +128 -0
  77. package/src/resources/projects/projects.ts +179 -0
  78. package/src/resources/projects.ts +3 -0
  79. package/src/version.ts +1 -1
  80. package/version.d.mts +1 -1
  81. package/version.d.ts +1 -1
  82. package/version.js +1 -1
  83. package/version.mjs +1 -1
@@ -318,6 +318,11 @@ export interface BrowserCreateResponse {
318
318
  */
319
319
  webdriver_ws_url: string;
320
320
 
321
+ /**
322
+ * Metro-API HTTP base URL for this browser session.
323
+ */
324
+ base_url?: string;
325
+
321
326
  /**
322
327
  * Remote URL for live viewing the browser session. Only available for non-headless
323
328
  * browsers.
@@ -419,6 +424,11 @@ export interface BrowserRetrieveResponse {
419
424
  */
420
425
  webdriver_ws_url: string;
421
426
 
427
+ /**
428
+ * Metro-API HTTP base URL for this browser session.
429
+ */
430
+ base_url?: string;
431
+
422
432
  /**
423
433
  * Remote URL for live viewing the browser session. Only available for non-headless
424
434
  * browsers.
@@ -520,6 +530,11 @@ export interface BrowserUpdateResponse {
520
530
  */
521
531
  webdriver_ws_url: string;
522
532
 
533
+ /**
534
+ * Metro-API HTTP base URL for this browser session.
535
+ */
536
+ base_url?: string;
537
+
523
538
  /**
524
539
  * Remote URL for live viewing the browser session. Only available for non-headless
525
540
  * browsers.
@@ -621,6 +636,11 @@ export interface BrowserListResponse {
621
636
  */
622
637
  webdriver_ws_url: string;
623
638
 
639
+ /**
640
+ * Metro-API HTTP base URL for this browser session.
641
+ */
642
+ base_url?: string;
643
+
624
644
  /**
625
645
  * Remote URL for live viewing the browser session. Only available for non-headless
626
646
  * browsers.
@@ -96,6 +96,16 @@ export {
96
96
  type InvocationListResponsesOffsetPagination,
97
97
  } from './invocations';
98
98
  export { Profiles, type ProfileCreateParams, type ProfileListParams } from './profiles';
99
+ export {
100
+ Projects,
101
+ type CreateProjectRequest,
102
+ type Project,
103
+ type UpdateProjectRequest,
104
+ type ProjectCreateParams,
105
+ type ProjectUpdateParams,
106
+ type ProjectListParams,
107
+ type ProjectsOffsetPagination,
108
+ } from './projects/projects';
99
109
  export {
100
110
  Proxies,
101
111
  type ProxyCreateResponse,
@@ -453,6 +453,11 @@ export namespace InvocationListBrowsersResponse {
453
453
  */
454
454
  webdriver_ws_url: string;
455
455
 
456
+ /**
457
+ * Metro-API HTTP base URL for this browser session.
458
+ */
459
+ base_url?: string;
460
+
456
461
  /**
457
462
  * Remote URL for live viewing the browser session. Only available for non-headless
458
463
  * browsers.
@@ -0,0 +1,18 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export {
4
+ Limits,
5
+ type ProjectLimits,
6
+ type UpdateProjectLimitsRequest,
7
+ type LimitUpdateParams,
8
+ } from './limits';
9
+ export {
10
+ Projects,
11
+ type CreateProjectRequest,
12
+ type Project,
13
+ type UpdateProjectRequest,
14
+ type ProjectCreateParams,
15
+ type ProjectUpdateParams,
16
+ type ProjectListParams,
17
+ type ProjectsOffsetPagination,
18
+ } from './projects';
@@ -0,0 +1,128 @@
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 { RequestOptions } from '../../internal/request-options';
6
+ import { path } from '../../internal/utils/path';
7
+
8
+ /**
9
+ * Create and manage projects for resource isolation within an organization.
10
+ */
11
+ export class Limits extends APIResource {
12
+ /**
13
+ * Get the resource limit overrides for a project. Null values mean no
14
+ * project-level cap (org limit applies).
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const projectLimits = await client.projects.limits.retrieve(
19
+ * 'id',
20
+ * );
21
+ * ```
22
+ */
23
+ retrieve(id: string, options?: RequestOptions): APIPromise<ProjectLimits> {
24
+ return this._client.get(path`/projects/${id}/limits`, options);
25
+ }
26
+
27
+ /**
28
+ * Update resource limit overrides for a project. Only fields present in the
29
+ * request are modified. Set a field to 0 to remove that limit cap; omit a field to
30
+ * leave it unchanged.
31
+ *
32
+ * @example
33
+ * ```ts
34
+ * const projectLimits = await client.projects.limits.update(
35
+ * 'id',
36
+ * );
37
+ * ```
38
+ */
39
+ update(id: string, body: LimitUpdateParams, options?: RequestOptions): APIPromise<ProjectLimits> {
40
+ return this._client.patch(path`/projects/${id}/limits`, { body, ...options });
41
+ }
42
+ }
43
+
44
+ export interface ProjectLimits {
45
+ /**
46
+ * Maximum concurrent app invocations for this project. Null means no project-level
47
+ * cap.
48
+ */
49
+ max_concurrent_invocations?: number | null;
50
+
51
+ /**
52
+ * Maximum concurrent browser sessions for this project. Null means no
53
+ * project-level cap.
54
+ */
55
+ max_concurrent_sessions?: number | null;
56
+
57
+ /**
58
+ * Maximum persistent browser sessions for this project. Null means no
59
+ * project-level cap.
60
+ */
61
+ max_persistent_sessions?: number | null;
62
+
63
+ /**
64
+ * Maximum pooled sessions capacity for this project. Null means no project-level
65
+ * cap.
66
+ */
67
+ max_pooled_sessions?: number | null;
68
+ }
69
+
70
+ export interface UpdateProjectLimitsRequest {
71
+ /**
72
+ * Maximum concurrent app invocations for this project. Set to 0 to remove the cap;
73
+ * omit to leave unchanged.
74
+ */
75
+ max_concurrent_invocations?: number | null;
76
+
77
+ /**
78
+ * Maximum concurrent browser sessions for this project. Set to 0 to remove the
79
+ * cap; omit to leave unchanged.
80
+ */
81
+ max_concurrent_sessions?: number | null;
82
+
83
+ /**
84
+ * Maximum persistent browser sessions for this project. Set to 0 to remove the
85
+ * cap; omit to leave unchanged.
86
+ */
87
+ max_persistent_sessions?: number | null;
88
+
89
+ /**
90
+ * Maximum pooled sessions capacity for this project. Set to 0 to remove the cap;
91
+ * omit to leave unchanged.
92
+ */
93
+ max_pooled_sessions?: number | null;
94
+ }
95
+
96
+ export interface LimitUpdateParams {
97
+ /**
98
+ * Maximum concurrent app invocations for this project. Set to 0 to remove the cap;
99
+ * omit to leave unchanged.
100
+ */
101
+ max_concurrent_invocations?: number | null;
102
+
103
+ /**
104
+ * Maximum concurrent browser sessions for this project. Set to 0 to remove the
105
+ * cap; omit to leave unchanged.
106
+ */
107
+ max_concurrent_sessions?: number | null;
108
+
109
+ /**
110
+ * Maximum persistent browser sessions for this project. Set to 0 to remove the
111
+ * cap; omit to leave unchanged.
112
+ */
113
+ max_persistent_sessions?: number | null;
114
+
115
+ /**
116
+ * Maximum pooled sessions capacity for this project. Set to 0 to remove the cap;
117
+ * omit to leave unchanged.
118
+ */
119
+ max_pooled_sessions?: number | null;
120
+ }
121
+
122
+ export declare namespace Limits {
123
+ export {
124
+ type ProjectLimits as ProjectLimits,
125
+ type UpdateProjectLimitsRequest as UpdateProjectLimitsRequest,
126
+ type LimitUpdateParams as LimitUpdateParams,
127
+ };
128
+ }
@@ -0,0 +1,179 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as LimitsAPI from './limits';
5
+ import { LimitUpdateParams, Limits, ProjectLimits, UpdateProjectLimitsRequest } from './limits';
6
+ import { APIPromise } from '../../core/api-promise';
7
+ import { OffsetPagination, type OffsetPaginationParams, PagePromise } from '../../core/pagination';
8
+ import { buildHeaders } from '../../internal/headers';
9
+ import { RequestOptions } from '../../internal/request-options';
10
+ import { path } from '../../internal/utils/path';
11
+
12
+ /**
13
+ * Create and manage projects for resource isolation within an organization.
14
+ */
15
+ export class Projects extends APIResource {
16
+ limits: LimitsAPI.Limits = new LimitsAPI.Limits(this._client);
17
+
18
+ /**
19
+ * Create a new project within the authenticated organization. Requires a paid plan
20
+ * and the projects feature flag.
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * const project = await client.projects.create({
25
+ * name: 'staging',
26
+ * });
27
+ * ```
28
+ */
29
+ create(body: ProjectCreateParams, options?: RequestOptions): APIPromise<Project> {
30
+ return this._client.post('/projects', { body, ...options });
31
+ }
32
+
33
+ /**
34
+ * Get a project by ID.
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * const project = await client.projects.retrieve('id');
39
+ * ```
40
+ */
41
+ retrieve(id: string, options?: RequestOptions): APIPromise<Project> {
42
+ return this._client.get(path`/projects/${id}`, options);
43
+ }
44
+
45
+ /**
46
+ * Update a project's name or status.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const project = await client.projects.update('id');
51
+ * ```
52
+ */
53
+ update(id: string, body: ProjectUpdateParams, options?: RequestOptions): APIPromise<Project> {
54
+ return this._client.patch(path`/projects/${id}`, { body, ...options });
55
+ }
56
+
57
+ /**
58
+ * List projects for the authenticated organization.
59
+ *
60
+ * @example
61
+ * ```ts
62
+ * // Automatically fetches more pages as needed.
63
+ * for await (const project of client.projects.list()) {
64
+ * // ...
65
+ * }
66
+ * ```
67
+ */
68
+ list(
69
+ query: ProjectListParams | null | undefined = {},
70
+ options?: RequestOptions,
71
+ ): PagePromise<ProjectsOffsetPagination, Project> {
72
+ return this._client.getAPIList('/projects', OffsetPagination<Project>, { query, ...options });
73
+ }
74
+
75
+ /**
76
+ * Soft-delete a project. The project must be empty (no active resources).
77
+ *
78
+ * @example
79
+ * ```ts
80
+ * await client.projects.delete('id');
81
+ * ```
82
+ */
83
+ delete(id: string, options?: RequestOptions): APIPromise<void> {
84
+ return this._client.delete(path`/projects/${id}`, {
85
+ ...options,
86
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
87
+ });
88
+ }
89
+ }
90
+
91
+ export type ProjectsOffsetPagination = OffsetPagination<Project>;
92
+
93
+ export interface CreateProjectRequest {
94
+ /**
95
+ * Project name (1-255 characters)
96
+ */
97
+ name: string;
98
+ }
99
+
100
+ export interface Project {
101
+ /**
102
+ * Unique project identifier
103
+ */
104
+ id: string;
105
+
106
+ /**
107
+ * When the project was created
108
+ */
109
+ created_at: string;
110
+
111
+ /**
112
+ * Project name
113
+ */
114
+ name: string;
115
+
116
+ /**
117
+ * Project status
118
+ */
119
+ status: 'active' | 'archived';
120
+
121
+ /**
122
+ * When the project was last updated
123
+ */
124
+ updated_at: string;
125
+ }
126
+
127
+ export interface UpdateProjectRequest {
128
+ /**
129
+ * New project name
130
+ */
131
+ name?: string;
132
+
133
+ /**
134
+ * New project status
135
+ */
136
+ status?: 'active' | 'archived';
137
+ }
138
+
139
+ export interface ProjectCreateParams {
140
+ /**
141
+ * Project name (1-255 characters)
142
+ */
143
+ name: string;
144
+ }
145
+
146
+ export interface ProjectUpdateParams {
147
+ /**
148
+ * New project name
149
+ */
150
+ name?: string;
151
+
152
+ /**
153
+ * New project status
154
+ */
155
+ status?: 'active' | 'archived';
156
+ }
157
+
158
+ export interface ProjectListParams extends OffsetPaginationParams {}
159
+
160
+ Projects.Limits = Limits;
161
+
162
+ export declare namespace Projects {
163
+ export {
164
+ type CreateProjectRequest as CreateProjectRequest,
165
+ type Project as Project,
166
+ type UpdateProjectRequest as UpdateProjectRequest,
167
+ type ProjectsOffsetPagination as ProjectsOffsetPagination,
168
+ type ProjectCreateParams as ProjectCreateParams,
169
+ type ProjectUpdateParams as ProjectUpdateParams,
170
+ type ProjectListParams as ProjectListParams,
171
+ };
172
+
173
+ export {
174
+ Limits as Limits,
175
+ type ProjectLimits as ProjectLimits,
176
+ type UpdateProjectLimitsRequest as UpdateProjectLimitsRequest,
177
+ type LimitUpdateParams as LimitUpdateParams,
178
+ };
179
+ }
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './projects/index';
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.47.0'; // x-release-please-version
1
+ export const VERSION = '0.48.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.47.0";
1
+ export declare const VERSION = "0.48.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.47.0";
1
+ export declare const VERSION = "0.48.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.47.0'; // x-release-please-version
4
+ exports.VERSION = '0.48.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.47.0'; // x-release-please-version
1
+ export const VERSION = '0.48.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map