@onkernel/sdk 0.57.0 → 0.58.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.
- package/CHANGELOG.md +10 -0
- package/client.d.mts +6 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +6 -0
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +6 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/api-keys.d.mts +146 -0
- package/resources/api-keys.d.mts.map +1 -0
- package/resources/api-keys.d.ts +146 -0
- package/resources/api-keys.d.ts.map +1 -0
- package/resources/api-keys.js +81 -0
- package/resources/api-keys.js.map +1 -0
- package/resources/api-keys.mjs +77 -0
- package/resources/api-keys.mjs.map +1 -0
- package/resources/browsers/browsers.d.mts +50 -4
- package/resources/browsers/browsers.d.mts.map +1 -1
- package/resources/browsers/browsers.d.ts +50 -4
- package/resources/browsers/browsers.d.ts.map +1 -1
- package/resources/browsers/browsers.js.map +1 -1
- package/resources/browsers/browsers.mjs +2 -2
- package/resources/browsers/browsers.mjs.map +1 -1
- package/resources/browsers/index.d.mts +1 -1
- package/resources/browsers/index.d.mts.map +1 -1
- package/resources/browsers/index.d.ts +1 -1
- package/resources/browsers/index.d.ts.map +1 -1
- package/resources/browsers/index.js.map +1 -1
- package/resources/browsers/index.mjs.map +1 -1
- package/resources/browsers/telemetry.d.mts +1 -18
- package/resources/browsers/telemetry.d.mts.map +1 -1
- package/resources/browsers/telemetry.d.ts +1 -18
- package/resources/browsers/telemetry.d.ts.map +1 -1
- package/resources/index.d.mts +1 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/src/client.ts +24 -0
- package/src/resources/api-keys.ts +195 -0
- package/src/resources/browsers/browsers.ts +55 -7
- package/src/resources/browsers/index.ts +0 -1
- package/src/resources/browsers/telemetry.ts +0 -20
- package/src/resources/index.ts +9 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,195 @@
|
|
|
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 { buildHeaders } from '../internal/headers';
|
|
7
|
+
import { RequestOptions } from '../internal/request-options';
|
|
8
|
+
import { path } from '../internal/utils/path';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Create and manage API keys for organization and project-scoped access.
|
|
12
|
+
*/
|
|
13
|
+
export class APIKeys extends APIResource {
|
|
14
|
+
/**
|
|
15
|
+
* Create a new API key within the authenticated organization.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const createdAPIKey = await client.apiKeys.create({
|
|
20
|
+
* name: 'staging',
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
create(body: APIKeyCreateParams, options?: RequestOptions): APIPromise<CreatedAPIKey> {
|
|
25
|
+
return this._client.post('/org/api_keys', { body, ...options });
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Retrieve an API key by ID for the authenticated organization. API keys are
|
|
30
|
+
* masked.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* const apiKey = await client.apiKeys.retrieve('id');
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<APIKey> {
|
|
38
|
+
return this._client.get(path`/org/api_keys/${id}`, options);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Update an API key's name.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* const apiKey = await client.apiKeys.update('id', {
|
|
47
|
+
* name: 'new-api-name',
|
|
48
|
+
* });
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
update(id: string, body: APIKeyUpdateParams, options?: RequestOptions): APIPromise<APIKey> {
|
|
52
|
+
return this._client.patch(path`/org/api_keys/${id}`, { body, ...options });
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* List API keys for the authenticated organization. API keys are masked.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* // Automatically fetches more pages as needed.
|
|
61
|
+
* for await (const apiKey of client.apiKeys.list()) {
|
|
62
|
+
* // ...
|
|
63
|
+
* }
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
list(
|
|
67
|
+
query: APIKeyListParams | null | undefined = {},
|
|
68
|
+
options?: RequestOptions,
|
|
69
|
+
): PagePromise<APIKeysOffsetPagination, APIKey> {
|
|
70
|
+
return this._client.getAPIList('/org/api_keys', OffsetPagination<APIKey>, { query, ...options });
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Delete an API key.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* await client.apiKeys.delete('id');
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
delete(id: string, options?: RequestOptions): APIPromise<void> {
|
|
82
|
+
return this._client.delete(path`/org/api_keys/${id}`, {
|
|
83
|
+
...options,
|
|
84
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export type APIKeysOffsetPagination = OffsetPagination<APIKey>;
|
|
90
|
+
|
|
91
|
+
export interface APIKey {
|
|
92
|
+
/**
|
|
93
|
+
* Unique API key identifier
|
|
94
|
+
*/
|
|
95
|
+
id: string;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* When the API key was created
|
|
99
|
+
*/
|
|
100
|
+
created_at: string;
|
|
101
|
+
|
|
102
|
+
created_by: APIKey.CreatedBy;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* When the API key expires
|
|
106
|
+
*/
|
|
107
|
+
expires_at: string | null;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Masked version of the API key
|
|
111
|
+
*/
|
|
112
|
+
masked_key: string;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* API key name
|
|
116
|
+
*/
|
|
117
|
+
name: string;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Project identifier for project-scoped API keys. Null means org-wide.
|
|
121
|
+
*/
|
|
122
|
+
project_id: string | null;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Project name for project-scoped API keys. Null means the key is org-wide or the
|
|
126
|
+
* project name is unavailable.
|
|
127
|
+
*/
|
|
128
|
+
project_name: string | null;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export namespace APIKey {
|
|
132
|
+
export interface CreatedBy {
|
|
133
|
+
/**
|
|
134
|
+
* Kernel user ID of the creator.
|
|
135
|
+
*/
|
|
136
|
+
id: string;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Email address of the creator.
|
|
140
|
+
*/
|
|
141
|
+
email: string;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Display name of the creator, if available.
|
|
145
|
+
*/
|
|
146
|
+
name: string | null;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* API key returned immediately after creation. Includes the plaintext key once.
|
|
152
|
+
*/
|
|
153
|
+
export interface CreatedAPIKey extends APIKey {
|
|
154
|
+
/**
|
|
155
|
+
* Plaintext API key. Only returned once when the key is created.
|
|
156
|
+
*/
|
|
157
|
+
key: string;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export interface APIKeyCreateParams {
|
|
161
|
+
/**
|
|
162
|
+
* API key name (1-255 characters)
|
|
163
|
+
*/
|
|
164
|
+
name: string;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Number of days until expiry, up to 3650. Use null for never.
|
|
168
|
+
*/
|
|
169
|
+
days_to_expire?: number | null;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Unique project identifier
|
|
173
|
+
*/
|
|
174
|
+
project_id?: string | null;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export interface APIKeyUpdateParams {
|
|
178
|
+
/**
|
|
179
|
+
* New API key name
|
|
180
|
+
*/
|
|
181
|
+
name: string;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export interface APIKeyListParams extends OffsetPaginationParams {}
|
|
185
|
+
|
|
186
|
+
export declare namespace APIKeys {
|
|
187
|
+
export {
|
|
188
|
+
type APIKey as APIKey,
|
|
189
|
+
type CreatedAPIKey as CreatedAPIKey,
|
|
190
|
+
type APIKeysOffsetPagination as APIKeysOffsetPagination,
|
|
191
|
+
type APIKeyCreateParams as APIKeyCreateParams,
|
|
192
|
+
type APIKeyUpdateParams as APIKeyUpdateParams,
|
|
193
|
+
type APIKeyListParams as APIKeyListParams,
|
|
194
|
+
};
|
|
195
|
+
}
|
|
@@ -83,8 +83,7 @@ import {
|
|
|
83
83
|
BrowserTelemetryCategoryConfig,
|
|
84
84
|
BrowserTelemetryConfig,
|
|
85
85
|
BrowserTelemetryEvent,
|
|
86
|
-
|
|
87
|
-
Telemetry,
|
|
86
|
+
Telemetry as TelemetryAPITelemetry,
|
|
88
87
|
TelemetryStreamParams,
|
|
89
88
|
TelemetryStreamResponse,
|
|
90
89
|
} from './telemetry';
|
|
@@ -899,7 +898,7 @@ export interface BrowserCreateParams {
|
|
|
899
898
|
* category settings, or all four categories are explicitly disabled, capture is
|
|
900
899
|
* not started.
|
|
901
900
|
*/
|
|
902
|
-
telemetry?:
|
|
901
|
+
telemetry?: BrowserCreateParams.Telemetry | null;
|
|
903
902
|
|
|
904
903
|
/**
|
|
905
904
|
* The number of seconds of inactivity before the browser session is terminated.
|
|
@@ -927,6 +926,32 @@ export interface BrowserCreateParams {
|
|
|
927
926
|
viewport?: Shared.BrowserViewport;
|
|
928
927
|
}
|
|
929
928
|
|
|
929
|
+
export namespace BrowserCreateParams {
|
|
930
|
+
/**
|
|
931
|
+
* Telemetry configuration for the browser session. Set enabled to true to start
|
|
932
|
+
* capture using VM defaults, or provide browser category settings. If omitted,
|
|
933
|
+
* null, set to an empty object ({}), set to enabled: false without browser
|
|
934
|
+
* category settings, or all four categories are explicitly disabled, capture is
|
|
935
|
+
* not started.
|
|
936
|
+
*/
|
|
937
|
+
export interface Telemetry {
|
|
938
|
+
/**
|
|
939
|
+
* Per-category enable/disable flags. If enabled is true and browser is omitted or
|
|
940
|
+
* empty, the VM default category set is used. Explicitly disabling all four
|
|
941
|
+
* categories stops capture on update and starts no capture on create.
|
|
942
|
+
*/
|
|
943
|
+
browser?: TelemetryAPI.BrowserTelemetryCategoriesConfig;
|
|
944
|
+
|
|
945
|
+
/**
|
|
946
|
+
* Request shortcut for browser telemetry capture. True enables capture using VM
|
|
947
|
+
* defaults unless browser category settings are provided. False stops capture on
|
|
948
|
+
* update and starts no capture on create. enabled=false cannot be combined with
|
|
949
|
+
* browser category settings.
|
|
950
|
+
*/
|
|
951
|
+
enabled?: boolean;
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
|
|
930
955
|
export interface BrowserRetrieveParams {
|
|
931
956
|
/**
|
|
932
957
|
* When true, includes soft-deleted browser sessions in the lookup.
|
|
@@ -960,7 +985,7 @@ export interface BrowserUpdateParams {
|
|
|
960
985
|
* category settings for per-category updates. Explicitly disabling all four
|
|
961
986
|
* categories also stops capture.
|
|
962
987
|
*/
|
|
963
|
-
telemetry?:
|
|
988
|
+
telemetry?: BrowserUpdateParams.Telemetry | null;
|
|
964
989
|
|
|
965
990
|
/**
|
|
966
991
|
* Viewport configuration to apply to the browser session.
|
|
@@ -969,6 +994,30 @@ export interface BrowserUpdateParams {
|
|
|
969
994
|
}
|
|
970
995
|
|
|
971
996
|
export namespace BrowserUpdateParams {
|
|
997
|
+
/**
|
|
998
|
+
* Telemetry configuration. Omit, set to null, or set to an empty object ({}) to
|
|
999
|
+
* leave the existing configuration unchanged. Set enabled to true to enable
|
|
1000
|
+
* capture using VM defaults. Set enabled to false to stop capture. Provide browser
|
|
1001
|
+
* category settings for per-category updates. Explicitly disabling all four
|
|
1002
|
+
* categories also stops capture.
|
|
1003
|
+
*/
|
|
1004
|
+
export interface Telemetry {
|
|
1005
|
+
/**
|
|
1006
|
+
* Per-category enable/disable flags. If enabled is true and browser is omitted or
|
|
1007
|
+
* empty, the VM default category set is used. Explicitly disabling all four
|
|
1008
|
+
* categories stops capture on update and starts no capture on create.
|
|
1009
|
+
*/
|
|
1010
|
+
browser?: TelemetryAPI.BrowserTelemetryCategoriesConfig;
|
|
1011
|
+
|
|
1012
|
+
/**
|
|
1013
|
+
* Request shortcut for browser telemetry capture. True enables capture using VM
|
|
1014
|
+
* defaults unless browser category settings are provided. False stops capture on
|
|
1015
|
+
* update and starts no capture on create. enabled=false cannot be combined with
|
|
1016
|
+
* browser category settings.
|
|
1017
|
+
*/
|
|
1018
|
+
enabled?: boolean;
|
|
1019
|
+
}
|
|
1020
|
+
|
|
972
1021
|
/**
|
|
973
1022
|
* Viewport configuration to apply to the browser session.
|
|
974
1023
|
*/
|
|
@@ -1056,7 +1105,7 @@ export namespace BrowserLoadExtensionsParams {
|
|
|
1056
1105
|
}
|
|
1057
1106
|
}
|
|
1058
1107
|
|
|
1059
|
-
Browsers.Telemetry =
|
|
1108
|
+
Browsers.Telemetry = TelemetryAPITelemetry;
|
|
1060
1109
|
Browsers.Replays = Replays;
|
|
1061
1110
|
Browsers.Fs = Fs;
|
|
1062
1111
|
Browsers.Process = Process;
|
|
@@ -1084,7 +1133,7 @@ export declare namespace Browsers {
|
|
|
1084
1133
|
};
|
|
1085
1134
|
|
|
1086
1135
|
export {
|
|
1087
|
-
|
|
1136
|
+
TelemetryAPITelemetry as Telemetry,
|
|
1088
1137
|
type BrowserCallStack as BrowserCallStack,
|
|
1089
1138
|
type BrowserConsoleErrorEvent as BrowserConsoleErrorEvent,
|
|
1090
1139
|
type BrowserConsoleLogEvent as BrowserConsoleLogEvent,
|
|
@@ -1115,7 +1164,6 @@ export declare namespace Browsers {
|
|
|
1115
1164
|
type BrowserTelemetryCategoryConfig as BrowserTelemetryCategoryConfig,
|
|
1116
1165
|
type BrowserTelemetryConfig as BrowserTelemetryConfig,
|
|
1117
1166
|
type BrowserTelemetryEvent as BrowserTelemetryEvent,
|
|
1118
|
-
type BrowserTelemetryRequestConfig as BrowserTelemetryRequestConfig,
|
|
1119
1167
|
type TelemetryStreamResponse as TelemetryStreamResponse,
|
|
1120
1168
|
type TelemetryStreamParams as TelemetryStreamParams,
|
|
1121
1169
|
};
|
|
@@ -1452,25 +1452,6 @@ export type BrowserTelemetryEvent =
|
|
|
1452
1452
|
| BrowserMonitorReconnectFailedEvent
|
|
1453
1453
|
| BrowserMonitorInitFailedEvent;
|
|
1454
1454
|
|
|
1455
|
-
/**
|
|
1456
|
-
* Telemetry request configuration for a browser session.
|
|
1457
|
-
*/
|
|
1458
|
-
export interface BrowserTelemetryRequestConfig {
|
|
1459
|
-
/**
|
|
1460
|
-
* Per-category enable/disable flags. If enabled is true and browser is omitted or
|
|
1461
|
-
* empty, the VM default category set is used. Explicitly disabling all four
|
|
1462
|
-
* categories stops capture on update and starts no capture on create.
|
|
1463
|
-
*/
|
|
1464
|
-
browser?: BrowserTelemetryCategoriesConfig;
|
|
1465
|
-
|
|
1466
|
-
/**
|
|
1467
|
-
* Request shortcut for browser telemetry capture. True enables capture using VM
|
|
1468
|
-
* defaults. False stops capture on update and starts no capture on create. Cannot
|
|
1469
|
-
* be combined with browser category settings.
|
|
1470
|
-
*/
|
|
1471
|
-
enabled?: boolean;
|
|
1472
|
-
}
|
|
1473
|
-
|
|
1474
1455
|
/**
|
|
1475
1456
|
* Envelope wrapping a browser telemetry event with its monotonic sequence number.
|
|
1476
1457
|
* Each SSE data: frame carries one envelope as JSON. The seq value is also emitted
|
|
@@ -1534,7 +1515,6 @@ export declare namespace Telemetry {
|
|
|
1534
1515
|
type BrowserTelemetryCategoryConfig as BrowserTelemetryCategoryConfig,
|
|
1535
1516
|
type BrowserTelemetryConfig as BrowserTelemetryConfig,
|
|
1536
1517
|
type BrowserTelemetryEvent as BrowserTelemetryEvent,
|
|
1537
|
-
type BrowserTelemetryRequestConfig as BrowserTelemetryRequestConfig,
|
|
1538
1518
|
type TelemetryStreamResponse as TelemetryStreamResponse,
|
|
1539
1519
|
type TelemetryStreamParams as TelemetryStreamParams,
|
|
1540
1520
|
};
|
package/src/resources/index.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
export * from './shared';
|
|
4
|
+
export {
|
|
5
|
+
APIKeys,
|
|
6
|
+
type APIKey,
|
|
7
|
+
type CreatedAPIKey,
|
|
8
|
+
type APIKeyCreateParams,
|
|
9
|
+
type APIKeyUpdateParams,
|
|
10
|
+
type APIKeyListParams,
|
|
11
|
+
type APIKeysOffsetPagination,
|
|
12
|
+
} from './api-keys';
|
|
4
13
|
export {
|
|
5
14
|
Apps,
|
|
6
15
|
type AppListResponse,
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.58.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.58.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.58.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.58.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|