@onkernel/sdk 0.149.0 → 0.151.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 +25 -0
- package/client.d.mts +29 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +29 -4
- package/client.d.ts.map +1 -1
- package/client.js +32 -3
- package/client.js.map +1 -1
- package/client.mjs +32 -3
- package/client.mjs.map +1 -1
- package/lib/credentials/client-auth.d.mts +88 -0
- package/lib/credentials/client-auth.d.mts.map +1 -0
- package/lib/credentials/client-auth.d.ts +88 -0
- package/lib/credentials/client-auth.d.ts.map +1 -0
- package/lib/credentials/client-auth.js +166 -0
- package/lib/credentials/client-auth.js.map +1 -0
- package/lib/credentials/client-auth.mjs +162 -0
- package/lib/credentials/client-auth.mjs.map +1 -0
- package/lib/credentials/credential-chain.d.mts +20 -0
- package/lib/credentials/credential-chain.d.mts.map +1 -0
- package/lib/credentials/credential-chain.d.ts +20 -0
- package/lib/credentials/credential-chain.d.ts.map +1 -0
- package/lib/credentials/credential-chain.js +81 -0
- package/lib/credentials/credential-chain.js.map +1 -0
- package/lib/credentials/credential-chain.mjs +77 -0
- package/lib/credentials/credential-chain.mjs.map +1 -0
- package/lib/credentials/identity-token.d.mts +59 -0
- package/lib/credentials/identity-token.d.mts.map +1 -0
- package/lib/credentials/identity-token.d.ts +59 -0
- package/lib/credentials/identity-token.d.ts.map +1 -0
- package/lib/credentials/identity-token.js +243 -0
- package/lib/credentials/identity-token.js.map +1 -0
- package/lib/credentials/identity-token.mjs +202 -0
- package/lib/credentials/identity-token.mjs.map +1 -0
- package/lib/credentials/oidc-federation.d.mts +65 -0
- package/lib/credentials/oidc-federation.d.mts.map +1 -0
- package/lib/credentials/oidc-federation.d.ts +65 -0
- package/lib/credentials/oidc-federation.d.ts.map +1 -0
- package/lib/credentials/oidc-federation.js +200 -0
- package/lib/credentials/oidc-federation.js.map +1 -0
- package/lib/credentials/oidc-federation.mjs +196 -0
- package/lib/credentials/oidc-federation.mjs.map +1 -0
- package/lib/credentials/token-cache.d.mts +64 -0
- package/lib/credentials/token-cache.d.mts.map +1 -0
- package/lib/credentials/token-cache.d.ts +64 -0
- package/lib/credentials/token-cache.d.ts.map +1 -0
- package/lib/credentials/token-cache.js +147 -0
- package/lib/credentials/token-cache.js.map +1 -0
- package/lib/credentials/token-cache.mjs +143 -0
- package/lib/credentials/token-cache.mjs.map +1 -0
- package/lib/credentials/types.d.mts +126 -0
- package/lib/credentials/types.d.mts.map +1 -0
- package/lib/credentials/types.d.ts +126 -0
- package/lib/credentials/types.d.ts.map +1 -0
- package/lib/credentials/types.js +182 -0
- package/lib/credentials/types.js.map +1 -0
- package/lib/credentials/types.mjs +169 -0
- package/lib/credentials/types.mjs.map +1 -0
- package/lib/credentials.d.mts +6 -0
- package/lib/credentials.d.mts.map +1 -0
- package/lib/credentials.d.ts +6 -0
- package/lib/credentials.d.ts.map +1 -0
- package/lib/credentials.js +19 -0
- package/lib/credentials.js.map +1 -0
- package/lib/credentials.mjs +6 -0
- package/lib/credentials.mjs.map +1 -0
- package/package.json +9 -1
- package/resources/api-keys.d.mts +192 -16
- package/resources/api-keys.d.mts.map +1 -1
- package/resources/api-keys.d.ts +192 -16
- package/resources/api-keys.d.ts.map +1 -1
- package/resources/api-keys.js +19 -7
- package/resources/api-keys.js.map +1 -1
- package/resources/api-keys.mjs +19 -7
- package/resources/api-keys.mjs.map +1 -1
- package/resources/auth/auth.d.mts +2 -2
- package/resources/auth/auth.d.mts.map +1 -1
- package/resources/auth/auth.d.ts +2 -2
- package/resources/auth/auth.d.ts.map +1 -1
- package/resources/auth/auth.js.map +1 -1
- package/resources/auth/auth.mjs.map +1 -1
- package/resources/auth/connections.d.mts +16 -2
- package/resources/auth/connections.d.mts.map +1 -1
- package/resources/auth/connections.d.ts +16 -2
- package/resources/auth/connections.d.ts.map +1 -1
- package/resources/auth/context.d.mts +69 -3
- package/resources/auth/context.d.mts.map +1 -1
- package/resources/auth/context.d.ts +69 -3
- package/resources/auth/context.d.ts.map +1 -1
- package/resources/auth/index.d.mts +1 -1
- package/resources/auth/index.d.mts.map +1 -1
- package/resources/auth/index.d.ts +1 -1
- package/resources/auth/index.d.ts.map +1 -1
- package/resources/auth/index.js.map +1 -1
- package/resources/auth/index.mjs.map +1 -1
- package/resources/browser-pools.d.mts +41 -6
- package/resources/browser-pools.d.mts.map +1 -1
- package/resources/browser-pools.d.ts +41 -6
- package/resources/browser-pools.d.ts.map +1 -1
- package/resources/browsers/browsers.d.mts +105 -45
- package/resources/browsers/browsers.d.mts.map +1 -1
- package/resources/browsers/browsers.d.ts +105 -45
- package/resources/browsers/browsers.d.ts.map +1 -1
- package/resources/browsers/browsers.js.map +1 -1
- 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 +4 -4
- package/resources/browsers/telemetry.d.mts.map +1 -1
- package/resources/browsers/telemetry.d.ts +4 -4
- package/resources/browsers/telemetry.d.ts.map +1 -1
- package/resources/index.d.mts +6 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +6 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +9 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +4 -0
- package/resources/index.mjs.map +1 -1
- package/resources/invocations.d.mts +13 -1
- package/resources/invocations.d.mts.map +1 -1
- package/resources/invocations.d.ts +13 -1
- package/resources/invocations.d.ts.map +1 -1
- package/resources/service-accounts.d.mts +73 -0
- package/resources/service-accounts.d.mts.map +1 -0
- package/resources/service-accounts.d.ts +73 -0
- package/resources/service-accounts.d.ts.map +1 -0
- package/resources/service-accounts.js +50 -0
- package/resources/service-accounts.js.map +1 -0
- package/resources/service-accounts.mjs +46 -0
- package/resources/service-accounts.mjs.map +1 -0
- package/resources/vaults/items.d.mts +68 -2
- package/resources/vaults/items.d.mts.map +1 -1
- package/resources/vaults/items.d.ts +68 -2
- package/resources/vaults/items.d.ts.map +1 -1
- package/resources/workload-identity-authentication-events.d.mts +36 -0
- package/resources/workload-identity-authentication-events.d.mts.map +1 -0
- package/resources/workload-identity-authentication-events.d.ts +36 -0
- package/resources/workload-identity-authentication-events.d.ts.map +1 -0
- package/resources/workload-identity-authentication-events.js +16 -0
- package/resources/workload-identity-authentication-events.js.map +1 -0
- package/resources/workload-identity-authentication-events.mjs +12 -0
- package/resources/workload-identity-authentication-events.mjs.map +1 -0
- package/resources/workload-identity-federation-rules.d.mts +194 -0
- package/resources/workload-identity-federation-rules.d.mts.map +1 -0
- package/resources/workload-identity-federation-rules.d.ts +194 -0
- package/resources/workload-identity-federation-rules.d.ts.map +1 -0
- package/resources/workload-identity-federation-rules.js +47 -0
- package/resources/workload-identity-federation-rules.js.map +1 -0
- package/resources/workload-identity-federation-rules.mjs +43 -0
- package/resources/workload-identity-federation-rules.mjs.map +1 -0
- package/resources/workload-identity-issuers.d.mts +169 -0
- package/resources/workload-identity-issuers.d.mts.map +1 -0
- package/resources/workload-identity-issuers.d.ts +169 -0
- package/resources/workload-identity-issuers.d.ts.map +1 -0
- package/resources/workload-identity-issuers.js +54 -0
- package/resources/workload-identity-issuers.js.map +1 -0
- package/resources/workload-identity-issuers.mjs +50 -0
- package/resources/workload-identity-issuers.mjs.map +1 -0
- package/src/client.ts +134 -1
- package/src/lib/credentials/client-auth.ts +194 -0
- package/src/lib/credentials/credential-chain.ts +95 -0
- package/src/lib/credentials/identity-token.ts +284 -0
- package/src/lib/credentials/oidc-federation.ts +304 -0
- package/src/lib/credentials/token-cache.ts +172 -0
- package/src/lib/credentials/types.ts +267 -0
- package/src/lib/credentials.ts +30 -0
- package/src/resources/api-keys.ts +217 -15
- package/src/resources/auth/auth.ts +6 -2
- package/src/resources/auth/connections.ts +17 -2
- package/src/resources/auth/context.ts +81 -3
- package/src/resources/auth/index.ts +1 -1
- package/src/resources/browser-pools.ts +46 -6
- package/src/resources/browsers/browsers.ts +115 -44
- package/src/resources/browsers/index.ts +1 -0
- package/src/resources/browsers/telemetry.ts +4 -3
- package/src/resources/index.ts +42 -0
- package/src/resources/invocations.ts +15 -1
- package/src/resources/service-accounts.ts +128 -0
- package/src/resources/vaults/items.ts +80 -2
- package/src/resources/workload-identity-authentication-events.ts +72 -0
- package/src/resources/workload-identity-federation-rules.ts +314 -0
- package/src/resources/workload-identity-issuers.ts +273 -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
package/resources/api-keys.d.mts
CHANGED
|
@@ -7,8 +7,13 @@ import { RequestOptions } from "../internal/request-options.mjs";
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class APIKeys extends APIResource {
|
|
9
9
|
/**
|
|
10
|
-
* Create a
|
|
11
|
-
*
|
|
10
|
+
* Create a personal API key, or link a key to an organization-owned service
|
|
11
|
+
* account. Service-account keys require an organization administrator, explicit
|
|
12
|
+
* project and nonempty policy. An optional `policy` scopes the key to its listed
|
|
13
|
+
* actions and resources, and each statement may carry a `condition`. A `source_ip`
|
|
14
|
+
* condition restricts the statement to requests whose client address falls inside
|
|
15
|
+
* its CIDR networks, so a key limited to your egress IP ranges only works from
|
|
16
|
+
* your network, even if its secret leaks.
|
|
12
17
|
*
|
|
13
18
|
* @example
|
|
14
19
|
* ```ts
|
|
@@ -29,13 +34,18 @@ export declare class APIKeys extends APIResource {
|
|
|
29
34
|
*/
|
|
30
35
|
retrieve(id: string, query?: APIKeyRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<APIKey>;
|
|
31
36
|
/**
|
|
32
|
-
* Update an API key's name
|
|
37
|
+
* Update an API key's name, or replace its permissions by attaching a new policy
|
|
38
|
+
* in place: the key's credential never changes, so consumers keep the same secret.
|
|
39
|
+
* The replacement policy may carry `source_ip` conditions, so you can add, change,
|
|
40
|
+
* or remove IP allowlisting on an existing key without rotating its credential. A
|
|
41
|
+
* present `policy` fully replaces the key's policy and takes effect for new
|
|
42
|
+
* requests within the authorization cache; requests from outside a condition's
|
|
43
|
+
* networks get `403` and are recorded in the audit log with the client address.
|
|
44
|
+
* Requires api_keys:write to rename; api_keys:set_policy to replace permissions.
|
|
33
45
|
*
|
|
34
46
|
* @example
|
|
35
47
|
* ```ts
|
|
36
|
-
* const apiKey = await client.apiKeys.update('id'
|
|
37
|
-
* name: 'new-api-name',
|
|
38
|
-
* });
|
|
48
|
+
* const apiKey = await client.apiKeys.update('id');
|
|
39
49
|
* ```
|
|
40
50
|
*/
|
|
41
51
|
update(id: string, body: APIKeyUpdateParams, options?: RequestOptions): APIPromise<APIKey>;
|
|
@@ -69,7 +79,9 @@ export declare class APIKeys extends APIResource {
|
|
|
69
79
|
* expire_in_days set to 0, browser sessions attributed to the old key are ended
|
|
70
80
|
* asynchronously and unsaved profile changes are discarded. Grace-period and
|
|
71
81
|
* natural expiry do not end existing browsers. If cleanup cannot be registered, an
|
|
72
|
-
* immediate rotation is not committed.
|
|
82
|
+
* immediate rotation is not committed. Service-account keys retain their service
|
|
83
|
+
* principal and policy; the rotating administrator is recorded separately for
|
|
84
|
+
* audit.
|
|
73
85
|
*
|
|
74
86
|
* @example
|
|
75
87
|
* ```ts
|
|
@@ -88,7 +100,11 @@ export interface APIKey {
|
|
|
88
100
|
* When the API key was created
|
|
89
101
|
*/
|
|
90
102
|
created_at: string;
|
|
91
|
-
|
|
103
|
+
/**
|
|
104
|
+
* Human audit creator, or null after creator deletion. Not the service
|
|
105
|
+
* credential's principal.
|
|
106
|
+
*/
|
|
107
|
+
created_by: APIKey.CreatedBy | null;
|
|
92
108
|
/**
|
|
93
109
|
* When the API key was deleted (soft-deleted). Null for keys that have not been
|
|
94
110
|
* deleted.
|
|
@@ -126,8 +142,17 @@ export interface APIKey {
|
|
|
126
142
|
* unrestricted access within its organization or project.
|
|
127
143
|
*/
|
|
128
144
|
policy?: APIKey.Policy | null;
|
|
145
|
+
principal?: APIKeyPrincipal;
|
|
146
|
+
/**
|
|
147
|
+
* Organization-owned service principal, when linked.
|
|
148
|
+
*/
|
|
149
|
+
service_account_id?: string;
|
|
129
150
|
}
|
|
130
151
|
export declare namespace APIKey {
|
|
152
|
+
/**
|
|
153
|
+
* Human audit creator, or null after creator deletion. Not the service
|
|
154
|
+
* credential's principal.
|
|
155
|
+
*/
|
|
131
156
|
interface CreatedBy {
|
|
132
157
|
/**
|
|
133
158
|
* Kernel user ID of the creator.
|
|
@@ -163,9 +188,41 @@ export declare namespace APIKey {
|
|
|
163
188
|
* Wildcards are supported.
|
|
164
189
|
*/
|
|
165
190
|
resource: string;
|
|
191
|
+
/**
|
|
192
|
+
* A condition narrows a policy statement to requests matching its constraint: the
|
|
193
|
+
* request attribute, a comparison operator, and that operator's values.
|
|
194
|
+
*/
|
|
195
|
+
condition?: Statement.Condition;
|
|
196
|
+
}
|
|
197
|
+
namespace Statement {
|
|
198
|
+
/**
|
|
199
|
+
* A condition narrows a policy statement to requests matching its constraint: the
|
|
200
|
+
* request attribute, a comparison operator, and that operator's values.
|
|
201
|
+
*/
|
|
202
|
+
interface Condition {
|
|
203
|
+
/**
|
|
204
|
+
* Request attribute the condition constrains. `source_ip` restricts the statement
|
|
205
|
+
* to requests whose client address falls inside one of `values`.
|
|
206
|
+
*/
|
|
207
|
+
key: 'source_ip';
|
|
208
|
+
/**
|
|
209
|
+
* Comparison the condition applies between the request attribute and values.
|
|
210
|
+
*/
|
|
211
|
+
operator: 'in';
|
|
212
|
+
/**
|
|
213
|
+
* Values the request attribute must match. For `source_ip`, CIDR networks: a bare
|
|
214
|
+
* address without a mask is rejected, and so are an entry with host bits set and
|
|
215
|
+
* an IPv4 network written in IPv6 notation.
|
|
216
|
+
*/
|
|
217
|
+
values: Array<string>;
|
|
218
|
+
}
|
|
166
219
|
}
|
|
167
220
|
}
|
|
168
221
|
}
|
|
222
|
+
export interface APIKeyPrincipal {
|
|
223
|
+
id: string;
|
|
224
|
+
type: 'user' | 'service_account';
|
|
225
|
+
}
|
|
169
226
|
/**
|
|
170
227
|
* API key returned immediately after creation. Includes the plaintext key once.
|
|
171
228
|
*/
|
|
@@ -192,18 +249,25 @@ export interface APIKeyCreateParams {
|
|
|
192
249
|
expires_at?: string | null;
|
|
193
250
|
/**
|
|
194
251
|
* Issue a scoped key that may only perform the listed actions on the listed
|
|
195
|
-
* resources.
|
|
252
|
+
* resources. A statement may carry a condition; a `source_ip` condition restricts
|
|
253
|
+
* the statement to requests from inside its CIDR networks.
|
|
196
254
|
*/
|
|
197
255
|
policy?: APIKeyCreateParams.Policy;
|
|
198
256
|
/**
|
|
199
257
|
* Unique project identifier
|
|
200
258
|
*/
|
|
201
259
|
project_id?: string | null;
|
|
260
|
+
/**
|
|
261
|
+
* Link to an active same-organization service account. Requires an organization
|
|
262
|
+
* administrator, explicit project and nonempty policy. Omit for a personal key.
|
|
263
|
+
*/
|
|
264
|
+
service_account_id?: string;
|
|
202
265
|
}
|
|
203
266
|
export declare namespace APIKeyCreateParams {
|
|
204
267
|
/**
|
|
205
268
|
* Issue a scoped key that may only perform the listed actions on the listed
|
|
206
|
-
* resources.
|
|
269
|
+
* resources. A statement may carry a condition; a `source_ip` condition restricts
|
|
270
|
+
* the statement to requests from inside its CIDR networks.
|
|
207
271
|
*/
|
|
208
272
|
interface Policy {
|
|
209
273
|
/**
|
|
@@ -222,6 +286,34 @@ export declare namespace APIKeyCreateParams {
|
|
|
222
286
|
* Wildcards are supported.
|
|
223
287
|
*/
|
|
224
288
|
resource: string;
|
|
289
|
+
/**
|
|
290
|
+
* A condition narrows a policy statement to requests matching its constraint: the
|
|
291
|
+
* request attribute, a comparison operator, and that operator's values.
|
|
292
|
+
*/
|
|
293
|
+
condition?: Statement.Condition;
|
|
294
|
+
}
|
|
295
|
+
namespace Statement {
|
|
296
|
+
/**
|
|
297
|
+
* A condition narrows a policy statement to requests matching its constraint: the
|
|
298
|
+
* request attribute, a comparison operator, and that operator's values.
|
|
299
|
+
*/
|
|
300
|
+
interface Condition {
|
|
301
|
+
/**
|
|
302
|
+
* Request attribute the condition constrains. `source_ip` restricts the statement
|
|
303
|
+
* to requests whose client address falls inside one of `values`.
|
|
304
|
+
*/
|
|
305
|
+
key: 'source_ip';
|
|
306
|
+
/**
|
|
307
|
+
* Comparison the condition applies between the request attribute and values.
|
|
308
|
+
*/
|
|
309
|
+
operator: 'in';
|
|
310
|
+
/**
|
|
311
|
+
* Values the request attribute must match. For `source_ip`, CIDR networks: a bare
|
|
312
|
+
* address without a mask is rejected, and so are an entry with host bits set and
|
|
313
|
+
* an IPv4 network written in IPv6 notation.
|
|
314
|
+
*/
|
|
315
|
+
values: Array<string>;
|
|
316
|
+
}
|
|
225
317
|
}
|
|
226
318
|
}
|
|
227
319
|
}
|
|
@@ -236,9 +328,80 @@ export interface APIKeyUpdateParams {
|
|
|
236
328
|
/**
|
|
237
329
|
* New API key name
|
|
238
330
|
*/
|
|
239
|
-
name
|
|
331
|
+
name?: string;
|
|
332
|
+
/**
|
|
333
|
+
* Permissions that fully replace the key's policy. Attaching a policy to a key
|
|
334
|
+
* without one makes the key scoped: every action and resource the policy does not
|
|
335
|
+
* list is denied. The key's credential, name, project, and expiry are unchanged,
|
|
336
|
+
* so consumers never need the key redistributed. A `source_ip` condition adds or
|
|
337
|
+
* changes IP allowlisting without rotating the credential. Requires
|
|
338
|
+
* api_keys:set_policy on the key.
|
|
339
|
+
*/
|
|
340
|
+
policy?: APIKeyUpdateParams.Policy;
|
|
341
|
+
}
|
|
342
|
+
export declare namespace APIKeyUpdateParams {
|
|
343
|
+
/**
|
|
344
|
+
* Permissions that fully replace the key's policy. Attaching a policy to a key
|
|
345
|
+
* without one makes the key scoped: every action and resource the policy does not
|
|
346
|
+
* list is denied. The key's credential, name, project, and expiry are unchanged,
|
|
347
|
+
* so consumers never need the key redistributed. A `source_ip` condition adds or
|
|
348
|
+
* changes IP allowlisting without rotating the credential. Requires
|
|
349
|
+
* api_keys:set_policy on the key.
|
|
350
|
+
*/
|
|
351
|
+
interface Policy {
|
|
352
|
+
/**
|
|
353
|
+
* Allow statements. Every action and resource not listed is denied.
|
|
354
|
+
*/
|
|
355
|
+
statements: Array<Policy.Statement>;
|
|
356
|
+
}
|
|
357
|
+
namespace Policy {
|
|
358
|
+
interface Statement {
|
|
359
|
+
/**
|
|
360
|
+
* Permitted action, such as browsers:use or vaults:read.
|
|
361
|
+
*/
|
|
362
|
+
action: string;
|
|
363
|
+
/**
|
|
364
|
+
* Resource the action applies to, in the format projects/{project_id}/{kind}/{id}.
|
|
365
|
+
* Wildcards are supported.
|
|
366
|
+
*/
|
|
367
|
+
resource: string;
|
|
368
|
+
/**
|
|
369
|
+
* A condition narrows a policy statement to requests matching its constraint: the
|
|
370
|
+
* request attribute, a comparison operator, and that operator's values.
|
|
371
|
+
*/
|
|
372
|
+
condition?: Statement.Condition;
|
|
373
|
+
}
|
|
374
|
+
namespace Statement {
|
|
375
|
+
/**
|
|
376
|
+
* A condition narrows a policy statement to requests matching its constraint: the
|
|
377
|
+
* request attribute, a comparison operator, and that operator's values.
|
|
378
|
+
*/
|
|
379
|
+
interface Condition {
|
|
380
|
+
/**
|
|
381
|
+
* Request attribute the condition constrains. `source_ip` restricts the statement
|
|
382
|
+
* to requests whose client address falls inside one of `values`.
|
|
383
|
+
*/
|
|
384
|
+
key: 'source_ip';
|
|
385
|
+
/**
|
|
386
|
+
* Comparison the condition applies between the request attribute and values.
|
|
387
|
+
*/
|
|
388
|
+
operator: 'in';
|
|
389
|
+
/**
|
|
390
|
+
* Values the request attribute must match. For `source_ip`, CIDR networks: a bare
|
|
391
|
+
* address without a mask is rejected, and so are an entry with host bits set and
|
|
392
|
+
* an IPv4 network written in IPv6 notation.
|
|
393
|
+
*/
|
|
394
|
+
values: Array<string>;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
240
398
|
}
|
|
241
399
|
export interface APIKeyListParams extends OffsetPaginationParams {
|
|
400
|
+
/**
|
|
401
|
+
* Return only keys created by this user ID. This is the same person the key's
|
|
402
|
+
* created_by field describes.
|
|
403
|
+
*/
|
|
404
|
+
created_by?: string;
|
|
242
405
|
/**
|
|
243
406
|
* Deprecated: use status=all instead. When true, include deleted (soft-deleted)
|
|
244
407
|
* API keys in the results for audit purposes.
|
|
@@ -251,11 +414,24 @@ export interface APIKeyListParams extends OffsetPaginationParams {
|
|
|
251
414
|
* soft-deleted keys with the same name may also match.
|
|
252
415
|
*/
|
|
253
416
|
name?: string;
|
|
417
|
+
/**
|
|
418
|
+
* Return only keys that act as a user, or only keys that act as a service account.
|
|
419
|
+
*/
|
|
420
|
+
principal_type?: 'user' | 'service_account';
|
|
421
|
+
/**
|
|
422
|
+
* Return only keys scoped to this project ID. The value "org" returns keys that
|
|
423
|
+
* are not scoped to a project.
|
|
424
|
+
*/
|
|
425
|
+
project_id?: string;
|
|
254
426
|
/**
|
|
255
427
|
* Case-insensitive substring match against API key name, creator, and project. API
|
|
256
428
|
* key identifiers and masked keys match by exact value or prefix.
|
|
257
429
|
*/
|
|
258
430
|
query?: string;
|
|
431
|
+
/**
|
|
432
|
+
* Return only keys that belong to this service account.
|
|
433
|
+
*/
|
|
434
|
+
service_account_id?: string;
|
|
259
435
|
/**
|
|
260
436
|
* Field to sort API keys by. Keys with no expiry or no recorded use sort last for
|
|
261
437
|
* expires_at and last_used_at in either direction.
|
|
@@ -266,11 +442,11 @@ export interface APIKeyListParams extends OffsetPaginationParams {
|
|
|
266
442
|
*/
|
|
267
443
|
sort_direction?: 'asc' | 'desc';
|
|
268
444
|
/**
|
|
269
|
-
* Filter API keys by status. "active" returns keys that are
|
|
270
|
-
* expired
|
|
271
|
-
* soft-deleted keys, "all" returns
|
|
445
|
+
* Filter API keys by status. "active" returns keys that are neither deleted nor
|
|
446
|
+
* expired (default), "expired" returns keys that are not deleted and whose expiry
|
|
447
|
+
* has passed, "deleted" returns only soft-deleted keys, "all" returns every key.
|
|
272
448
|
*/
|
|
273
|
-
status?: 'active' | 'deleted' | 'all';
|
|
449
|
+
status?: 'active' | 'expired' | 'deleted' | 'all';
|
|
274
450
|
}
|
|
275
451
|
export interface APIKeyRotateParams {
|
|
276
452
|
/**
|
|
@@ -285,6 +461,6 @@ export interface APIKeyRotateParams {
|
|
|
285
461
|
expire_in_days?: number | null;
|
|
286
462
|
}
|
|
287
463
|
export declare namespace APIKeys {
|
|
288
|
-
export { type APIKey as APIKey, type CreatedAPIKey as CreatedAPIKey, type APIKeysOffsetPagination as APIKeysOffsetPagination, type APIKeyCreateParams as APIKeyCreateParams, type APIKeyRetrieveParams as APIKeyRetrieveParams, type APIKeyUpdateParams as APIKeyUpdateParams, type APIKeyListParams as APIKeyListParams, type APIKeyRotateParams as APIKeyRotateParams, };
|
|
464
|
+
export { type APIKey as APIKey, type APIKeyPrincipal as APIKeyPrincipal, type CreatedAPIKey as CreatedAPIKey, type APIKeysOffsetPagination as APIKeysOffsetPagination, type APIKeyCreateParams as APIKeyCreateParams, type APIKeyRetrieveParams as APIKeyRetrieveParams, type APIKeyUpdateParams as APIKeyUpdateParams, type APIKeyListParams as APIKeyListParams, type APIKeyRotateParams as APIKeyRotateParams, };
|
|
289
465
|
}
|
|
290
466
|
//# sourceMappingURL=api-keys.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-keys.d.mts","sourceRoot":"","sources":["../src/resources/api-keys.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACjD,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,WAAW,EAAE,+BAA2B;AAEhG,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAG7D;;GAEG;AACH,qBAAa,OAAQ,SAAQ,WAAW;IACtC
|
|
1
|
+
{"version":3,"file":"api-keys.d.mts","sourceRoot":"","sources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5C;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;;OAGG;IACH,OAAO,CAAC,EAAE,YAAY,GAAG,MAAM,GAAG,YAAY,GAAG,cAAc,CAAC;IAEhE;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAEhC;;;;OAIG;IACH,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,KAAK,CAAC;CACnD;AAED,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
|
package/resources/api-keys.d.ts
CHANGED
|
@@ -7,8 +7,13 @@ import { RequestOptions } from "../internal/request-options.js";
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class APIKeys extends APIResource {
|
|
9
9
|
/**
|
|
10
|
-
* Create a
|
|
11
|
-
*
|
|
10
|
+
* Create a personal API key, or link a key to an organization-owned service
|
|
11
|
+
* account. Service-account keys require an organization administrator, explicit
|
|
12
|
+
* project and nonempty policy. An optional `policy` scopes the key to its listed
|
|
13
|
+
* actions and resources, and each statement may carry a `condition`. A `source_ip`
|
|
14
|
+
* condition restricts the statement to requests whose client address falls inside
|
|
15
|
+
* its CIDR networks, so a key limited to your egress IP ranges only works from
|
|
16
|
+
* your network, even if its secret leaks.
|
|
12
17
|
*
|
|
13
18
|
* @example
|
|
14
19
|
* ```ts
|
|
@@ -29,13 +34,18 @@ export declare class APIKeys extends APIResource {
|
|
|
29
34
|
*/
|
|
30
35
|
retrieve(id: string, query?: APIKeyRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<APIKey>;
|
|
31
36
|
/**
|
|
32
|
-
* Update an API key's name
|
|
37
|
+
* Update an API key's name, or replace its permissions by attaching a new policy
|
|
38
|
+
* in place: the key's credential never changes, so consumers keep the same secret.
|
|
39
|
+
* The replacement policy may carry `source_ip` conditions, so you can add, change,
|
|
40
|
+
* or remove IP allowlisting on an existing key without rotating its credential. A
|
|
41
|
+
* present `policy` fully replaces the key's policy and takes effect for new
|
|
42
|
+
* requests within the authorization cache; requests from outside a condition's
|
|
43
|
+
* networks get `403` and are recorded in the audit log with the client address.
|
|
44
|
+
* Requires api_keys:write to rename; api_keys:set_policy to replace permissions.
|
|
33
45
|
*
|
|
34
46
|
* @example
|
|
35
47
|
* ```ts
|
|
36
|
-
* const apiKey = await client.apiKeys.update('id'
|
|
37
|
-
* name: 'new-api-name',
|
|
38
|
-
* });
|
|
48
|
+
* const apiKey = await client.apiKeys.update('id');
|
|
39
49
|
* ```
|
|
40
50
|
*/
|
|
41
51
|
update(id: string, body: APIKeyUpdateParams, options?: RequestOptions): APIPromise<APIKey>;
|
|
@@ -69,7 +79,9 @@ export declare class APIKeys extends APIResource {
|
|
|
69
79
|
* expire_in_days set to 0, browser sessions attributed to the old key are ended
|
|
70
80
|
* asynchronously and unsaved profile changes are discarded. Grace-period and
|
|
71
81
|
* natural expiry do not end existing browsers. If cleanup cannot be registered, an
|
|
72
|
-
* immediate rotation is not committed.
|
|
82
|
+
* immediate rotation is not committed. Service-account keys retain their service
|
|
83
|
+
* principal and policy; the rotating administrator is recorded separately for
|
|
84
|
+
* audit.
|
|
73
85
|
*
|
|
74
86
|
* @example
|
|
75
87
|
* ```ts
|
|
@@ -88,7 +100,11 @@ export interface APIKey {
|
|
|
88
100
|
* When the API key was created
|
|
89
101
|
*/
|
|
90
102
|
created_at: string;
|
|
91
|
-
|
|
103
|
+
/**
|
|
104
|
+
* Human audit creator, or null after creator deletion. Not the service
|
|
105
|
+
* credential's principal.
|
|
106
|
+
*/
|
|
107
|
+
created_by: APIKey.CreatedBy | null;
|
|
92
108
|
/**
|
|
93
109
|
* When the API key was deleted (soft-deleted). Null for keys that have not been
|
|
94
110
|
* deleted.
|
|
@@ -126,8 +142,17 @@ export interface APIKey {
|
|
|
126
142
|
* unrestricted access within its organization or project.
|
|
127
143
|
*/
|
|
128
144
|
policy?: APIKey.Policy | null;
|
|
145
|
+
principal?: APIKeyPrincipal;
|
|
146
|
+
/**
|
|
147
|
+
* Organization-owned service principal, when linked.
|
|
148
|
+
*/
|
|
149
|
+
service_account_id?: string;
|
|
129
150
|
}
|
|
130
151
|
export declare namespace APIKey {
|
|
152
|
+
/**
|
|
153
|
+
* Human audit creator, or null after creator deletion. Not the service
|
|
154
|
+
* credential's principal.
|
|
155
|
+
*/
|
|
131
156
|
interface CreatedBy {
|
|
132
157
|
/**
|
|
133
158
|
* Kernel user ID of the creator.
|
|
@@ -163,9 +188,41 @@ export declare namespace APIKey {
|
|
|
163
188
|
* Wildcards are supported.
|
|
164
189
|
*/
|
|
165
190
|
resource: string;
|
|
191
|
+
/**
|
|
192
|
+
* A condition narrows a policy statement to requests matching its constraint: the
|
|
193
|
+
* request attribute, a comparison operator, and that operator's values.
|
|
194
|
+
*/
|
|
195
|
+
condition?: Statement.Condition;
|
|
196
|
+
}
|
|
197
|
+
namespace Statement {
|
|
198
|
+
/**
|
|
199
|
+
* A condition narrows a policy statement to requests matching its constraint: the
|
|
200
|
+
* request attribute, a comparison operator, and that operator's values.
|
|
201
|
+
*/
|
|
202
|
+
interface Condition {
|
|
203
|
+
/**
|
|
204
|
+
* Request attribute the condition constrains. `source_ip` restricts the statement
|
|
205
|
+
* to requests whose client address falls inside one of `values`.
|
|
206
|
+
*/
|
|
207
|
+
key: 'source_ip';
|
|
208
|
+
/**
|
|
209
|
+
* Comparison the condition applies between the request attribute and values.
|
|
210
|
+
*/
|
|
211
|
+
operator: 'in';
|
|
212
|
+
/**
|
|
213
|
+
* Values the request attribute must match. For `source_ip`, CIDR networks: a bare
|
|
214
|
+
* address without a mask is rejected, and so are an entry with host bits set and
|
|
215
|
+
* an IPv4 network written in IPv6 notation.
|
|
216
|
+
*/
|
|
217
|
+
values: Array<string>;
|
|
218
|
+
}
|
|
166
219
|
}
|
|
167
220
|
}
|
|
168
221
|
}
|
|
222
|
+
export interface APIKeyPrincipal {
|
|
223
|
+
id: string;
|
|
224
|
+
type: 'user' | 'service_account';
|
|
225
|
+
}
|
|
169
226
|
/**
|
|
170
227
|
* API key returned immediately after creation. Includes the plaintext key once.
|
|
171
228
|
*/
|
|
@@ -192,18 +249,25 @@ export interface APIKeyCreateParams {
|
|
|
192
249
|
expires_at?: string | null;
|
|
193
250
|
/**
|
|
194
251
|
* Issue a scoped key that may only perform the listed actions on the listed
|
|
195
|
-
* resources.
|
|
252
|
+
* resources. A statement may carry a condition; a `source_ip` condition restricts
|
|
253
|
+
* the statement to requests from inside its CIDR networks.
|
|
196
254
|
*/
|
|
197
255
|
policy?: APIKeyCreateParams.Policy;
|
|
198
256
|
/**
|
|
199
257
|
* Unique project identifier
|
|
200
258
|
*/
|
|
201
259
|
project_id?: string | null;
|
|
260
|
+
/**
|
|
261
|
+
* Link to an active same-organization service account. Requires an organization
|
|
262
|
+
* administrator, explicit project and nonempty policy. Omit for a personal key.
|
|
263
|
+
*/
|
|
264
|
+
service_account_id?: string;
|
|
202
265
|
}
|
|
203
266
|
export declare namespace APIKeyCreateParams {
|
|
204
267
|
/**
|
|
205
268
|
* Issue a scoped key that may only perform the listed actions on the listed
|
|
206
|
-
* resources.
|
|
269
|
+
* resources. A statement may carry a condition; a `source_ip` condition restricts
|
|
270
|
+
* the statement to requests from inside its CIDR networks.
|
|
207
271
|
*/
|
|
208
272
|
interface Policy {
|
|
209
273
|
/**
|
|
@@ -222,6 +286,34 @@ export declare namespace APIKeyCreateParams {
|
|
|
222
286
|
* Wildcards are supported.
|
|
223
287
|
*/
|
|
224
288
|
resource: string;
|
|
289
|
+
/**
|
|
290
|
+
* A condition narrows a policy statement to requests matching its constraint: the
|
|
291
|
+
* request attribute, a comparison operator, and that operator's values.
|
|
292
|
+
*/
|
|
293
|
+
condition?: Statement.Condition;
|
|
294
|
+
}
|
|
295
|
+
namespace Statement {
|
|
296
|
+
/**
|
|
297
|
+
* A condition narrows a policy statement to requests matching its constraint: the
|
|
298
|
+
* request attribute, a comparison operator, and that operator's values.
|
|
299
|
+
*/
|
|
300
|
+
interface Condition {
|
|
301
|
+
/**
|
|
302
|
+
* Request attribute the condition constrains. `source_ip` restricts the statement
|
|
303
|
+
* to requests whose client address falls inside one of `values`.
|
|
304
|
+
*/
|
|
305
|
+
key: 'source_ip';
|
|
306
|
+
/**
|
|
307
|
+
* Comparison the condition applies between the request attribute and values.
|
|
308
|
+
*/
|
|
309
|
+
operator: 'in';
|
|
310
|
+
/**
|
|
311
|
+
* Values the request attribute must match. For `source_ip`, CIDR networks: a bare
|
|
312
|
+
* address without a mask is rejected, and so are an entry with host bits set and
|
|
313
|
+
* an IPv4 network written in IPv6 notation.
|
|
314
|
+
*/
|
|
315
|
+
values: Array<string>;
|
|
316
|
+
}
|
|
225
317
|
}
|
|
226
318
|
}
|
|
227
319
|
}
|
|
@@ -236,9 +328,80 @@ export interface APIKeyUpdateParams {
|
|
|
236
328
|
/**
|
|
237
329
|
* New API key name
|
|
238
330
|
*/
|
|
239
|
-
name
|
|
331
|
+
name?: string;
|
|
332
|
+
/**
|
|
333
|
+
* Permissions that fully replace the key's policy. Attaching a policy to a key
|
|
334
|
+
* without one makes the key scoped: every action and resource the policy does not
|
|
335
|
+
* list is denied. The key's credential, name, project, and expiry are unchanged,
|
|
336
|
+
* so consumers never need the key redistributed. A `source_ip` condition adds or
|
|
337
|
+
* changes IP allowlisting without rotating the credential. Requires
|
|
338
|
+
* api_keys:set_policy on the key.
|
|
339
|
+
*/
|
|
340
|
+
policy?: APIKeyUpdateParams.Policy;
|
|
341
|
+
}
|
|
342
|
+
export declare namespace APIKeyUpdateParams {
|
|
343
|
+
/**
|
|
344
|
+
* Permissions that fully replace the key's policy. Attaching a policy to a key
|
|
345
|
+
* without one makes the key scoped: every action and resource the policy does not
|
|
346
|
+
* list is denied. The key's credential, name, project, and expiry are unchanged,
|
|
347
|
+
* so consumers never need the key redistributed. A `source_ip` condition adds or
|
|
348
|
+
* changes IP allowlisting without rotating the credential. Requires
|
|
349
|
+
* api_keys:set_policy on the key.
|
|
350
|
+
*/
|
|
351
|
+
interface Policy {
|
|
352
|
+
/**
|
|
353
|
+
* Allow statements. Every action and resource not listed is denied.
|
|
354
|
+
*/
|
|
355
|
+
statements: Array<Policy.Statement>;
|
|
356
|
+
}
|
|
357
|
+
namespace Policy {
|
|
358
|
+
interface Statement {
|
|
359
|
+
/**
|
|
360
|
+
* Permitted action, such as browsers:use or vaults:read.
|
|
361
|
+
*/
|
|
362
|
+
action: string;
|
|
363
|
+
/**
|
|
364
|
+
* Resource the action applies to, in the format projects/{project_id}/{kind}/{id}.
|
|
365
|
+
* Wildcards are supported.
|
|
366
|
+
*/
|
|
367
|
+
resource: string;
|
|
368
|
+
/**
|
|
369
|
+
* A condition narrows a policy statement to requests matching its constraint: the
|
|
370
|
+
* request attribute, a comparison operator, and that operator's values.
|
|
371
|
+
*/
|
|
372
|
+
condition?: Statement.Condition;
|
|
373
|
+
}
|
|
374
|
+
namespace Statement {
|
|
375
|
+
/**
|
|
376
|
+
* A condition narrows a policy statement to requests matching its constraint: the
|
|
377
|
+
* request attribute, a comparison operator, and that operator's values.
|
|
378
|
+
*/
|
|
379
|
+
interface Condition {
|
|
380
|
+
/**
|
|
381
|
+
* Request attribute the condition constrains. `source_ip` restricts the statement
|
|
382
|
+
* to requests whose client address falls inside one of `values`.
|
|
383
|
+
*/
|
|
384
|
+
key: 'source_ip';
|
|
385
|
+
/**
|
|
386
|
+
* Comparison the condition applies between the request attribute and values.
|
|
387
|
+
*/
|
|
388
|
+
operator: 'in';
|
|
389
|
+
/**
|
|
390
|
+
* Values the request attribute must match. For `source_ip`, CIDR networks: a bare
|
|
391
|
+
* address without a mask is rejected, and so are an entry with host bits set and
|
|
392
|
+
* an IPv4 network written in IPv6 notation.
|
|
393
|
+
*/
|
|
394
|
+
values: Array<string>;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
240
398
|
}
|
|
241
399
|
export interface APIKeyListParams extends OffsetPaginationParams {
|
|
400
|
+
/**
|
|
401
|
+
* Return only keys created by this user ID. This is the same person the key's
|
|
402
|
+
* created_by field describes.
|
|
403
|
+
*/
|
|
404
|
+
created_by?: string;
|
|
242
405
|
/**
|
|
243
406
|
* Deprecated: use status=all instead. When true, include deleted (soft-deleted)
|
|
244
407
|
* API keys in the results for audit purposes.
|
|
@@ -251,11 +414,24 @@ export interface APIKeyListParams extends OffsetPaginationParams {
|
|
|
251
414
|
* soft-deleted keys with the same name may also match.
|
|
252
415
|
*/
|
|
253
416
|
name?: string;
|
|
417
|
+
/**
|
|
418
|
+
* Return only keys that act as a user, or only keys that act as a service account.
|
|
419
|
+
*/
|
|
420
|
+
principal_type?: 'user' | 'service_account';
|
|
421
|
+
/**
|
|
422
|
+
* Return only keys scoped to this project ID. The value "org" returns keys that
|
|
423
|
+
* are not scoped to a project.
|
|
424
|
+
*/
|
|
425
|
+
project_id?: string;
|
|
254
426
|
/**
|
|
255
427
|
* Case-insensitive substring match against API key name, creator, and project. API
|
|
256
428
|
* key identifiers and masked keys match by exact value or prefix.
|
|
257
429
|
*/
|
|
258
430
|
query?: string;
|
|
431
|
+
/**
|
|
432
|
+
* Return only keys that belong to this service account.
|
|
433
|
+
*/
|
|
434
|
+
service_account_id?: string;
|
|
259
435
|
/**
|
|
260
436
|
* Field to sort API keys by. Keys with no expiry or no recorded use sort last for
|
|
261
437
|
* expires_at and last_used_at in either direction.
|
|
@@ -266,11 +442,11 @@ export interface APIKeyListParams extends OffsetPaginationParams {
|
|
|
266
442
|
*/
|
|
267
443
|
sort_direction?: 'asc' | 'desc';
|
|
268
444
|
/**
|
|
269
|
-
* Filter API keys by status. "active" returns keys that are
|
|
270
|
-
* expired
|
|
271
|
-
* soft-deleted keys, "all" returns
|
|
445
|
+
* Filter API keys by status. "active" returns keys that are neither deleted nor
|
|
446
|
+
* expired (default), "expired" returns keys that are not deleted and whose expiry
|
|
447
|
+
* has passed, "deleted" returns only soft-deleted keys, "all" returns every key.
|
|
272
448
|
*/
|
|
273
|
-
status?: 'active' | 'deleted' | 'all';
|
|
449
|
+
status?: 'active' | 'expired' | 'deleted' | 'all';
|
|
274
450
|
}
|
|
275
451
|
export interface APIKeyRotateParams {
|
|
276
452
|
/**
|
|
@@ -285,6 +461,6 @@ export interface APIKeyRotateParams {
|
|
|
285
461
|
expire_in_days?: number | null;
|
|
286
462
|
}
|
|
287
463
|
export declare namespace APIKeys {
|
|
288
|
-
export { type APIKey as APIKey, type CreatedAPIKey as CreatedAPIKey, type APIKeysOffsetPagination as APIKeysOffsetPagination, type APIKeyCreateParams as APIKeyCreateParams, type APIKeyRetrieveParams as APIKeyRetrieveParams, type APIKeyUpdateParams as APIKeyUpdateParams, type APIKeyListParams as APIKeyListParams, type APIKeyRotateParams as APIKeyRotateParams, };
|
|
464
|
+
export { type APIKey as APIKey, type APIKeyPrincipal as APIKeyPrincipal, type CreatedAPIKey as CreatedAPIKey, type APIKeysOffsetPagination as APIKeysOffsetPagination, type APIKeyCreateParams as APIKeyCreateParams, type APIKeyRetrieveParams as APIKeyRetrieveParams, type APIKeyUpdateParams as APIKeyUpdateParams, type APIKeyListParams as APIKeyListParams, type APIKeyRotateParams as APIKeyRotateParams, };
|
|
289
465
|
}
|
|
290
466
|
//# sourceMappingURL=api-keys.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-keys.d.ts","sourceRoot":"","sources":["../src/resources/api-keys.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,WAAW,EAAE,8BAA2B;AAEhG,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D;;GAEG;AACH,qBAAa,OAAQ,SAAQ,WAAW;IACtC
|
|
1
|
+
{"version":3,"file":"api-keys.d.ts","sourceRoot":"","sources":["../src/resources/api-keys.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,WAAW,EAAE,8BAA2B;AAEhG,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D;;GAEG;AACH,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;IAIrF;;;;;;;;OAQG;IACH,QAAQ,CACN,EAAE,EAAE,MAAM,EACV,KAAK,GAAE,oBAAoB,GAAG,IAAI,GAAG,SAAc,EACnD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,MAAM,CAAC;IAIrB;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAI1F;;;;;;;;;;OAUG;IACH,IAAI,CACF,KAAK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