@onkernel/sdk 0.86.1 → 0.87.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 (105) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/client.d.mts +1 -1
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +1 -1
  5. package/client.d.ts.map +1 -1
  6. package/client.js +1 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs +1 -1
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/audit-logs/audit-logs.d.mts +169 -0
  12. package/resources/audit-logs/audit-logs.d.mts.map +1 -0
  13. package/resources/audit-logs/audit-logs.d.ts +169 -0
  14. package/resources/audit-logs/audit-logs.d.ts.map +1 -0
  15. package/resources/audit-logs/audit-logs.js +53 -0
  16. package/resources/audit-logs/audit-logs.js.map +1 -0
  17. package/resources/audit-logs/audit-logs.mjs +48 -0
  18. package/resources/audit-logs/audit-logs.mjs.map +1 -0
  19. package/resources/audit-logs/export-destinations.d.mts +163 -0
  20. package/resources/audit-logs/export-destinations.d.mts.map +1 -0
  21. package/resources/audit-logs/export-destinations.d.ts +163 -0
  22. package/resources/audit-logs/export-destinations.d.ts.map +1 -0
  23. package/resources/audit-logs/export-destinations.js +62 -0
  24. package/resources/audit-logs/export-destinations.js.map +1 -0
  25. package/resources/audit-logs/export-destinations.mjs +58 -0
  26. package/resources/audit-logs/export-destinations.mjs.map +1 -0
  27. package/resources/audit-logs/index.d.mts +3 -0
  28. package/resources/audit-logs/index.d.mts.map +1 -0
  29. package/resources/audit-logs/index.d.ts +3 -0
  30. package/resources/audit-logs/index.d.ts.map +1 -0
  31. package/resources/audit-logs/index.js +9 -0
  32. package/resources/audit-logs/index.js.map +1 -0
  33. package/resources/audit-logs/index.mjs +4 -0
  34. package/resources/audit-logs/index.mjs.map +1 -0
  35. package/resources/audit-logs.d.mts +1 -164
  36. package/resources/audit-logs.d.mts.map +1 -1
  37. package/resources/audit-logs.d.ts +1 -164
  38. package/resources/audit-logs.d.ts.map +1 -1
  39. package/resources/audit-logs.js +2 -41
  40. package/resources/audit-logs.js.map +1 -1
  41. package/resources/audit-logs.mjs +1 -39
  42. package/resources/audit-logs.mjs.map +1 -1
  43. package/resources/auth/auth.d.mts +4 -0
  44. package/resources/auth/auth.d.mts.map +1 -1
  45. package/resources/auth/auth.d.ts +4 -0
  46. package/resources/auth/auth.d.ts.map +1 -1
  47. package/resources/auth/auth.js +4 -0
  48. package/resources/auth/auth.js.map +1 -1
  49. package/resources/auth/auth.mjs +4 -0
  50. package/resources/auth/auth.mjs.map +1 -1
  51. package/resources/auth/context.d.mts +106 -0
  52. package/resources/auth/context.d.mts.map +1 -0
  53. package/resources/auth/context.d.ts +106 -0
  54. package/resources/auth/context.d.ts.map +1 -0
  55. package/resources/auth/context.js +25 -0
  56. package/resources/auth/context.js.map +1 -0
  57. package/resources/auth/context.mjs +21 -0
  58. package/resources/auth/context.mjs.map +1 -0
  59. package/resources/auth/index.d.mts +1 -0
  60. package/resources/auth/index.d.mts.map +1 -1
  61. package/resources/auth/index.d.ts +1 -0
  62. package/resources/auth/index.d.ts.map +1 -1
  63. package/resources/auth/index.js +3 -1
  64. package/resources/auth/index.js.map +1 -1
  65. package/resources/auth/index.mjs +1 -0
  66. package/resources/auth/index.mjs.map +1 -1
  67. package/resources/browser-pools.d.mts +5 -0
  68. package/resources/browser-pools.d.mts.map +1 -1
  69. package/resources/browser-pools.d.ts +5 -0
  70. package/resources/browser-pools.d.ts.map +1 -1
  71. package/resources/browsers/browsers.d.mts +20 -0
  72. package/resources/browsers/browsers.d.mts.map +1 -1
  73. package/resources/browsers/browsers.d.ts +20 -0
  74. package/resources/browsers/browsers.d.ts.map +1 -1
  75. package/resources/browsers/browsers.js.map +1 -1
  76. package/resources/browsers/browsers.mjs.map +1 -1
  77. package/resources/index.d.mts +1 -1
  78. package/resources/index.d.mts.map +1 -1
  79. package/resources/index.d.ts +1 -1
  80. package/resources/index.d.ts.map +1 -1
  81. package/resources/index.js +1 -1
  82. package/resources/index.js.map +1 -1
  83. package/resources/index.mjs +1 -1
  84. package/resources/index.mjs.map +1 -1
  85. package/resources/invocations.d.mts +5 -0
  86. package/resources/invocations.d.mts.map +1 -1
  87. package/resources/invocations.d.ts +5 -0
  88. package/resources/invocations.d.ts.map +1 -1
  89. package/src/client.ts +7 -7
  90. package/src/resources/audit-logs/audit-logs.ts +281 -0
  91. package/src/resources/audit-logs/export-destinations.ts +262 -0
  92. package/src/resources/audit-logs/index.ts +25 -0
  93. package/src/resources/audit-logs.ts +1 -249
  94. package/src/resources/auth/auth.ts +6 -0
  95. package/src/resources/auth/context.ts +125 -0
  96. package/src/resources/auth/index.ts +1 -0
  97. package/src/resources/browser-pools.ts +6 -0
  98. package/src/resources/browsers/browsers.ts +24 -0
  99. package/src/resources/index.ts +1 -1
  100. package/src/resources/invocations.ts +6 -0
  101. package/src/version.ts +1 -1
  102. package/version.d.mts +1 -1
  103. package/version.d.ts +1 -1
  104. package/version.js +1 -1
  105. package/version.mjs +1 -1
@@ -1,251 +1,3 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../core/resource';
4
- import { APIPromise } from '../core/api-promise';
5
- import { PagePromise, PageTokenPagination, type PageTokenPaginationParams } from '../core/pagination';
6
- import { buildHeaders } from '../internal/headers';
7
- import { RequestOptions } from '../internal/request-options';
8
- import {
9
- downloadAuditLogs,
10
- type AuditLogDownloadDestination,
11
- type AuditLogDownloadOptions,
12
- type AuditLogDownloadParams,
13
- type AuditLogDownloadProgress,
14
- type AuditLogDownloadResult,
15
- } from '../lib/audit-log-download';
16
-
17
- export type {
18
- AuditLogDownloadDestination,
19
- AuditLogDownloadOptions,
20
- AuditLogDownloadParams,
21
- AuditLogDownloadProgress,
22
- AuditLogDownloadResult,
23
- } from '../lib/audit-log-download';
24
-
25
- /**
26
- * Read audit log records for the authenticated organization.
27
- */
28
- export class AuditLogs extends APIResource {
29
- /**
30
- * API for searching audit logs. Limited to at most 30 day search, returns up to
31
- * 100 records per page. Not recommended for bulk export.
32
- */
33
- list(
34
- query: AuditLogListParams,
35
- options?: RequestOptions,
36
- ): PagePromise<AuditLogEntriesPageTokenPagination, AuditLogEntry> {
37
- return this._client.getAPIList('/audit-logs', PageTokenPagination<AuditLogEntry>, { query, ...options });
38
- }
39
-
40
- /**
41
- * Download an organization's audit log records for a time range as a file, for
42
- * archival, compliance, or offline analysis. For interactive browsing, use GET
43
- * /audit-logs.
44
- */
45
- exportChunk(query: AuditLogExportChunkParams, options?: RequestOptions): APIPromise<Response> {
46
- return this._client.get('/audit-logs/export/chunk', {
47
- query,
48
- ...options,
49
- headers: buildHeaders([{ Accept: 'application/octet-stream' }, options?.headers]),
50
- __binaryResponse: true,
51
- });
52
- }
53
-
54
- /**
55
- * Download a complete gzip-compressed JSON Lines audit log export to a writable
56
- * destination. The SDK verifies every chunk and retries transient transfer
57
- * failures. It does not close the destination. If the download fails, the
58
- * destination may contain a partial export; use a temporary file and atomic
59
- * rename when the completed export must be published atomically.
60
- */
61
- download(
62
- query: AuditLogDownloadParams,
63
- destination: AuditLogDownloadDestination,
64
- options?: AuditLogDownloadOptions,
65
- ): Promise<AuditLogDownloadResult> {
66
- return downloadAuditLogs(
67
- (chunkQuery, chunkOptions) => this.exportChunk(chunkQuery, chunkOptions),
68
- query,
69
- destination,
70
- this._client.timeout,
71
- options,
72
- );
73
- }
74
- }
75
-
76
- export type AuditLogEntriesPageTokenPagination = PageTokenPagination<AuditLogEntry>;
77
-
78
- export interface AuditLogEntry {
79
- /**
80
- * Authentication strategy used for the request.
81
- */
82
- auth_strategy: string;
83
-
84
- /**
85
- * Client IP address.
86
- */
87
- client_ip: string;
88
-
89
- /**
90
- * Request host.
91
- */
92
- domain: string;
93
-
94
- /**
95
- * Request duration in milliseconds.
96
- */
97
- duration_ms: number;
98
-
99
- /**
100
- * Email of the authenticated user at request time, if any.
101
- */
102
- email: string;
103
-
104
- /**
105
- * HTTP method.
106
- */
107
- method: string;
108
-
109
- /**
110
- * Request path.
111
- */
112
- path: string;
113
-
114
- /**
115
- * Matched API route pattern, if available.
116
- */
117
- route: string;
118
-
119
- /**
120
- * HTTP response status code.
121
- */
122
- status: number;
123
-
124
- /**
125
- * UTC time when the request was received.
126
- */
127
- timestamp: string;
128
-
129
- /**
130
- * User agent header.
131
- */
132
- user_agent: string;
133
-
134
- /**
135
- * ID of the authenticated user, if any.
136
- */
137
- user_id: string;
138
- }
139
-
140
- export interface AuditLogListParams extends PageTokenPaginationParams {
141
- /**
142
- * Upper bound (exclusive) for the audit record timestamp.
143
- */
144
- end: string;
145
-
146
- /**
147
- * Lower bound (inclusive) for the audit record timestamp.
148
- */
149
- start: string;
150
-
151
- /**
152
- * Filter by authentication strategy.
153
- */
154
- auth_strategy?: string;
155
-
156
- /**
157
- * Filter out results by HTTP method.
158
- */
159
- exclude_method?: Array<string>;
160
-
161
- /**
162
- * Filter by HTTP method.
163
- */
164
- method?: string;
165
-
166
- /**
167
- * Free-text search over path, user ID, email, client IP, and status.
168
- */
169
- search?: string;
170
-
171
- /**
172
- * Additional user IDs to OR into free-text search.
173
- */
174
- search_user_id?: Array<string>;
175
-
176
- /**
177
- * Filter by service name.
178
- */
179
- service?: string;
180
- }
181
-
182
- export interface AuditLogExportChunkParams {
183
- /**
184
- * Upper bound (exclusive) for the audit record timestamp.
185
- */
186
- end: string;
187
-
188
- /**
189
- * Lower bound (inclusive) for the audit record timestamp.
190
- */
191
- start: string;
192
-
193
- /**
194
- * Filter by authentication strategy.
195
- */
196
- auth_strategy?: string;
197
-
198
- /**
199
- * Opaque cursor from X-Next-Cursor for the next chunk of older records.
200
- */
201
- cursor?: string;
202
-
203
- /**
204
- * Filter out results by HTTP method.
205
- */
206
- exclude_method?: Array<string>;
207
-
208
- /**
209
- * Encoding for the returned chunk.
210
- */
211
- format?: 'jsonl' | 'jsonl.gz';
212
-
213
- /**
214
- * Maximum number of records to return in this chunk.
215
- */
216
- limit?: number;
217
-
218
- /**
219
- * Filter by HTTP method.
220
- */
221
- method?: string;
222
-
223
- /**
224
- * Free-text search over path, user ID, email, client IP, and status.
225
- */
226
- search?: string;
227
-
228
- /**
229
- * Additional user IDs to OR into free-text search.
230
- */
231
- search_user_id?: Array<string>;
232
-
233
- /**
234
- * Filter by service name.
235
- */
236
- service?: string;
237
- }
238
-
239
- export declare namespace AuditLogs {
240
- export {
241
- type AuditLogEntry as AuditLogEntry,
242
- type AuditLogEntriesPageTokenPagination as AuditLogEntriesPageTokenPagination,
243
- type AuditLogListParams as AuditLogListParams,
244
- type AuditLogExportChunkParams as AuditLogExportChunkParams,
245
- type AuditLogDownloadDestination as AuditLogDownloadDestination,
246
- type AuditLogDownloadOptions as AuditLogDownloadOptions,
247
- type AuditLogDownloadParams as AuditLogDownloadParams,
248
- type AuditLogDownloadProgress as AuditLogDownloadProgress,
249
- type AuditLogDownloadResult as AuditLogDownloadResult,
250
- };
251
- }
3
+ export * from './audit-logs/index';
@@ -21,14 +21,20 @@ import {
21
21
  SubmitFieldsRequest,
22
22
  SubmitFieldsResponse,
23
23
  } from './connections';
24
+ import * as ContextAPI from './context';
25
+ import { AuthContext, Context } from './context';
24
26
 
25
27
  export class Auth extends APIResource {
28
+ context: ContextAPI.Context = new ContextAPI.Context(this._client);
26
29
  connections: ConnectionsAPI.Connections = new ConnectionsAPI.Connections(this._client);
27
30
  }
28
31
 
32
+ Auth.Context = Context;
29
33
  Auth.Connections = Connections;
30
34
 
31
35
  export declare namespace Auth {
36
+ export { Context as Context, type AuthContext as AuthContext };
37
+
32
38
  export {
33
39
  Connections as Connections,
34
40
  type LoginResponse as LoginResponse,
@@ -0,0 +1,125 @@
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
+
7
+ /**
8
+ * Inspect the identity and authorization context for the current request.
9
+ */
10
+ export class Context extends APIResource {
11
+ /**
12
+ * Returns the authenticated principal, organization, credential scope, and
13
+ * effective request scope. The response is derived from the verified request
14
+ * context and does not expose credential secrets.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const authContext = await client.auth.context.retrieve();
19
+ * ```
20
+ */
21
+ retrieve(options?: RequestOptions): APIPromise<AuthContext> {
22
+ return this._client.get('/auth/context', options);
23
+ }
24
+ }
25
+
26
+ /**
27
+ * The identity and authorization context resolved for the current request.
28
+ */
29
+ export interface AuthContext {
30
+ authentication: AuthContext.Authentication;
31
+
32
+ /**
33
+ * The credential's maximum scope and the effective scope selected for this
34
+ * request. Future permission data can be added without changing scope semantics.
35
+ */
36
+ authorization: AuthContext.Authorization;
37
+
38
+ organization: AuthContext.Organization;
39
+
40
+ principal: AuthContext.Principal;
41
+ }
42
+
43
+ export namespace AuthContext {
44
+ export interface Authentication {
45
+ /**
46
+ * The API key ID when authenticated with an API key; null for session credentials.
47
+ */
48
+ credential_id: string | null;
49
+
50
+ /**
51
+ * The credential format used to authenticate the request.
52
+ */
53
+ method: 'api_key' | 'jwt';
54
+
55
+ /**
56
+ * The source classification resolved by authentication middleware.
57
+ */
58
+ source: 'api_key' | 'oauth' | 'dashboard';
59
+ }
60
+
61
+ /**
62
+ * The credential's maximum scope and the effective scope selected for this
63
+ * request. Future permission data can be added without changing scope semantics.
64
+ */
65
+ export interface Authorization {
66
+ /**
67
+ * A scope within the authenticated organization. A null project_id represents
68
+ * organization-wide scope.
69
+ */
70
+ credential_scope: Authorization.CredentialScope;
71
+
72
+ /**
73
+ * A scope within the authenticated organization. A null project_id represents
74
+ * organization-wide scope.
75
+ */
76
+ effective_scope: Authorization.EffectiveScope;
77
+ }
78
+
79
+ export namespace Authorization {
80
+ /**
81
+ * A scope within the authenticated organization. A null project_id represents
82
+ * organization-wide scope.
83
+ */
84
+ export interface CredentialScope {
85
+ /**
86
+ * The Kernel project ID, or null when the scope is organization-wide.
87
+ */
88
+ project_id: string | null;
89
+ }
90
+
91
+ /**
92
+ * A scope within the authenticated organization. A null project_id represents
93
+ * organization-wide scope.
94
+ */
95
+ export interface EffectiveScope {
96
+ /**
97
+ * The Kernel project ID, or null when the scope is organization-wide.
98
+ */
99
+ project_id: string | null;
100
+ }
101
+ }
102
+
103
+ export interface Organization {
104
+ /**
105
+ * The authenticated Kernel organization ID.
106
+ */
107
+ id: string;
108
+ }
109
+
110
+ export interface Principal {
111
+ /**
112
+ * The API key ID for API-key principals or user ID for user principals.
113
+ */
114
+ id: string;
115
+
116
+ /**
117
+ * The kind of principal authenticated for the request.
118
+ */
119
+ type: 'api_key' | 'user';
120
+ }
121
+ }
122
+
123
+ export declare namespace Context {
124
+ export { type AuthContext as AuthContext };
125
+ }
@@ -20,3 +20,4 @@ export {
20
20
  type ManagedAuthsOffsetPagination,
21
21
  type ManagedAuthTimelineEventsOffsetPagination,
22
22
  } from './connections';
23
+ export { Context, type AuthContext } from './context';
@@ -432,6 +432,12 @@ export interface BrowserPoolAcquireResponse {
432
432
  */
433
433
  profile?: BrowsersAPI.Profile;
434
434
 
435
+ /**
436
+ * Whether changes made during this browser session are saved back to its profile
437
+ * when the session ends. Omitted when no profile is attached.
438
+ */
439
+ profile_save_changes?: boolean;
440
+
435
441
  /**
436
442
  * ID of the proxy associated with this browser session, if any.
437
443
  */
@@ -426,6 +426,12 @@ export interface BrowserCreateResponse {
426
426
  */
427
427
  profile?: Profile;
428
428
 
429
+ /**
430
+ * Whether changes made during this browser session are saved back to its profile
431
+ * when the session ends. Omitted when no profile is attached.
432
+ */
433
+ profile_save_changes?: boolean;
434
+
429
435
  /**
430
436
  * ID of the proxy associated with this browser session, if any.
431
437
  */
@@ -558,6 +564,12 @@ export interface BrowserRetrieveResponse {
558
564
  */
559
565
  profile?: Profile;
560
566
 
567
+ /**
568
+ * Whether changes made during this browser session are saved back to its profile
569
+ * when the session ends. Omitted when no profile is attached.
570
+ */
571
+ profile_save_changes?: boolean;
572
+
561
573
  /**
562
574
  * ID of the proxy associated with this browser session, if any.
563
575
  */
@@ -690,6 +702,12 @@ export interface BrowserUpdateResponse {
690
702
  */
691
703
  profile?: Profile;
692
704
 
705
+ /**
706
+ * Whether changes made during this browser session are saved back to its profile
707
+ * when the session ends. Omitted when no profile is attached.
708
+ */
709
+ profile_save_changes?: boolean;
710
+
693
711
  /**
694
712
  * ID of the proxy associated with this browser session, if any.
695
713
  */
@@ -822,6 +840,12 @@ export interface BrowserListResponse {
822
840
  */
823
841
  profile?: Profile;
824
842
 
843
+ /**
844
+ * Whether changes made during this browser session are saved back to its profile
845
+ * when the session ends. Omitted when no profile is attached.
846
+ */
847
+ profile_save_changes?: boolean;
848
+
825
849
  /**
826
850
  * ID of the proxy associated with this browser session, if any.
827
851
  */
@@ -24,7 +24,7 @@ export {
24
24
  type AuditLogListParams,
25
25
  type AuditLogExportChunkParams,
26
26
  type AuditLogEntriesPageTokenPagination,
27
- } from './audit-logs';
27
+ } from './audit-logs/audit-logs';
28
28
  export { Auth } from './auth/auth';
29
29
  export {
30
30
  BrowserPools,
@@ -503,6 +503,12 @@ export namespace InvocationListBrowsersResponse {
503
503
  */
504
504
  profile?: BrowsersAPI.Profile;
505
505
 
506
+ /**
507
+ * Whether changes made during this browser session are saved back to its profile
508
+ * when the session ends. Omitted when no profile is attached.
509
+ */
510
+ profile_save_changes?: boolean;
511
+
506
512
  /**
507
513
  * ID of the proxy associated with this browser session, if any.
508
514
  */
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.86.1'; // x-release-please-version
1
+ export const VERSION = '0.87.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.86.1";
1
+ export declare const VERSION = "0.87.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.86.1";
1
+ export declare const VERSION = "0.87.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.86.1'; // x-release-please-version
4
+ exports.VERSION = '0.87.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.86.1'; // x-release-please-version
1
+ export const VERSION = '0.87.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map