@onkernel/sdk 0.46.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 (92) hide show
  1. package/CHANGELOG.md +22 -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/auth/connections.d.mts +11 -4
  16. package/resources/auth/connections.d.mts.map +1 -1
  17. package/resources/auth/connections.d.ts +11 -4
  18. package/resources/auth/connections.d.ts.map +1 -1
  19. package/resources/auth/connections.js +3 -2
  20. package/resources/auth/connections.js.map +1 -1
  21. package/resources/auth/connections.mjs +3 -2
  22. package/resources/auth/connections.mjs.map +1 -1
  23. package/resources/browser-pools.d.mts +4 -0
  24. package/resources/browser-pools.d.mts.map +1 -1
  25. package/resources/browser-pools.d.ts +4 -0
  26. package/resources/browser-pools.d.ts.map +1 -1
  27. package/resources/browsers/browsers.d.mts +16 -0
  28. package/resources/browsers/browsers.d.mts.map +1 -1
  29. package/resources/browsers/browsers.d.ts +16 -0
  30. package/resources/browsers/browsers.d.ts.map +1 -1
  31. package/resources/browsers/browsers.js.map +1 -1
  32. package/resources/browsers/browsers.mjs.map +1 -1
  33. package/resources/index.d.mts +1 -0
  34. package/resources/index.d.mts.map +1 -1
  35. package/resources/index.d.ts +1 -0
  36. package/resources/index.d.ts.map +1 -1
  37. package/resources/index.js +3 -1
  38. package/resources/index.js.map +1 -1
  39. package/resources/index.mjs +1 -0
  40. package/resources/index.mjs.map +1 -1
  41. package/resources/invocations.d.mts +4 -0
  42. package/resources/invocations.d.mts.map +1 -1
  43. package/resources/invocations.d.ts +4 -0
  44. package/resources/invocations.d.ts.map +1 -1
  45. package/resources/projects/index.d.mts +3 -0
  46. package/resources/projects/index.d.mts.map +1 -0
  47. package/resources/projects/index.d.ts +3 -0
  48. package/resources/projects/index.d.ts.map +1 -0
  49. package/resources/projects/index.js +9 -0
  50. package/resources/projects/index.js.map +1 -0
  51. package/resources/projects/index.mjs +4 -0
  52. package/resources/projects/index.mjs.map +1 -0
  53. package/resources/projects/limits.d.mts +103 -0
  54. package/resources/projects/limits.d.mts.map +1 -0
  55. package/resources/projects/limits.d.ts +103 -0
  56. package/resources/projects/limits.d.ts.map +1 -0
  57. package/resources/projects/limits.js +42 -0
  58. package/resources/projects/limits.js.map +1 -0
  59. package/resources/projects/limits.mjs +38 -0
  60. package/resources/projects/limits.mjs.map +1 -0
  61. package/resources/projects/projects.d.mts +125 -0
  62. package/resources/projects/projects.d.mts.map +1 -0
  63. package/resources/projects/projects.d.ts +125 -0
  64. package/resources/projects/projects.d.ts.map +1 -0
  65. package/resources/projects/projects.js +87 -0
  66. package/resources/projects/projects.js.map +1 -0
  67. package/resources/projects/projects.mjs +82 -0
  68. package/resources/projects/projects.mjs.map +1 -0
  69. package/resources/projects.d.mts +2 -0
  70. package/resources/projects.d.mts.map +1 -0
  71. package/resources/projects.d.ts +2 -0
  72. package/resources/projects.d.ts.map +1 -0
  73. package/resources/projects.js +6 -0
  74. package/resources/projects.js.map +1 -0
  75. package/resources/projects.mjs +3 -0
  76. package/resources/projects.mjs.map +1 -0
  77. package/src/client.ts +26 -0
  78. package/src/internal/utils/env.ts +2 -2
  79. package/src/resources/auth/connections.ts +12 -4
  80. package/src/resources/browser-pools.ts +5 -0
  81. package/src/resources/browsers/browsers.ts +20 -0
  82. package/src/resources/index.ts +10 -0
  83. package/src/resources/invocations.ts +5 -0
  84. package/src/resources/projects/index.ts +18 -0
  85. package/src/resources/projects/limits.ts +128 -0
  86. package/src/resources/projects/projects.ts +179 -0
  87. package/src/resources/projects.ts +3 -0
  88. package/src/version.ts +1 -1
  89. package/version.d.mts +1 -1
  90. package/version.d.ts +1 -1
  91. package/version.js +1 -1
  92. package/version.mjs +1 -1
@@ -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.46.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.46.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.46.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.46.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.46.0'; // x-release-please-version
1
+ export const VERSION = '0.48.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map