@onkernel/sdk 0.150.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.
Files changed (85) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/client.d.mts +14 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +14 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js +12 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +12 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/api-keys.d.mts +28 -10
  12. package/resources/api-keys.d.mts.map +1 -1
  13. package/resources/api-keys.d.ts +28 -10
  14. package/resources/api-keys.d.ts.map +1 -1
  15. package/resources/auth/auth.d.mts +2 -2
  16. package/resources/auth/auth.d.mts.map +1 -1
  17. package/resources/auth/auth.d.ts +2 -2
  18. package/resources/auth/auth.d.ts.map +1 -1
  19. package/resources/auth/auth.js.map +1 -1
  20. package/resources/auth/auth.mjs.map +1 -1
  21. package/resources/auth/context.d.mts +11 -11
  22. package/resources/auth/context.d.mts.map +1 -1
  23. package/resources/auth/context.d.ts +11 -11
  24. package/resources/auth/context.d.ts.map +1 -1
  25. package/resources/auth/index.d.mts +1 -1
  26. package/resources/auth/index.d.mts.map +1 -1
  27. package/resources/auth/index.d.ts +1 -1
  28. package/resources/auth/index.d.ts.map +1 -1
  29. package/resources/auth/index.js.map +1 -1
  30. package/resources/auth/index.mjs.map +1 -1
  31. package/resources/index.d.mts +5 -1
  32. package/resources/index.d.mts.map +1 -1
  33. package/resources/index.d.ts +5 -1
  34. package/resources/index.d.ts.map +1 -1
  35. package/resources/index.js +9 -1
  36. package/resources/index.js.map +1 -1
  37. package/resources/index.mjs +4 -0
  38. package/resources/index.mjs.map +1 -1
  39. package/resources/service-accounts.d.mts +73 -0
  40. package/resources/service-accounts.d.mts.map +1 -0
  41. package/resources/service-accounts.d.ts +73 -0
  42. package/resources/service-accounts.d.ts.map +1 -0
  43. package/resources/service-accounts.js +50 -0
  44. package/resources/service-accounts.js.map +1 -0
  45. package/resources/service-accounts.mjs +46 -0
  46. package/resources/service-accounts.mjs.map +1 -0
  47. package/resources/workload-identity-authentication-events.d.mts +36 -0
  48. package/resources/workload-identity-authentication-events.d.mts.map +1 -0
  49. package/resources/workload-identity-authentication-events.d.ts +36 -0
  50. package/resources/workload-identity-authentication-events.d.ts.map +1 -0
  51. package/resources/workload-identity-authentication-events.js +16 -0
  52. package/resources/workload-identity-authentication-events.js.map +1 -0
  53. package/resources/workload-identity-authentication-events.mjs +12 -0
  54. package/resources/workload-identity-authentication-events.mjs.map +1 -0
  55. package/resources/workload-identity-federation-rules.d.mts +194 -0
  56. package/resources/workload-identity-federation-rules.d.mts.map +1 -0
  57. package/resources/workload-identity-federation-rules.d.ts +194 -0
  58. package/resources/workload-identity-federation-rules.d.ts.map +1 -0
  59. package/resources/workload-identity-federation-rules.js +47 -0
  60. package/resources/workload-identity-federation-rules.js.map +1 -0
  61. package/resources/workload-identity-federation-rules.mjs +43 -0
  62. package/resources/workload-identity-federation-rules.mjs.map +1 -0
  63. package/resources/workload-identity-issuers.d.mts +169 -0
  64. package/resources/workload-identity-issuers.d.mts.map +1 -0
  65. package/resources/workload-identity-issuers.d.ts +169 -0
  66. package/resources/workload-identity-issuers.d.ts.map +1 -0
  67. package/resources/workload-identity-issuers.js +54 -0
  68. package/resources/workload-identity-issuers.js.map +1 -0
  69. package/resources/workload-identity-issuers.mjs +50 -0
  70. package/resources/workload-identity-issuers.mjs.map +1 -0
  71. package/src/client.ts +96 -0
  72. package/src/resources/api-keys.ts +32 -9
  73. package/src/resources/auth/auth.ts +6 -2
  74. package/src/resources/auth/context.ts +11 -11
  75. package/src/resources/auth/index.ts +1 -1
  76. package/src/resources/index.ts +41 -0
  77. package/src/resources/service-accounts.ts +128 -0
  78. package/src/resources/workload-identity-authentication-events.ts +72 -0
  79. package/src/resources/workload-identity-federation-rules.ts +314 -0
  80. package/src/resources/workload-identity-issuers.ts +273 -0
  81. package/src/version.ts +1 -1
  82. package/version.d.mts +1 -1
  83. package/version.d.ts +1 -1
  84. package/version.js +1 -1
  85. package/version.mjs +1 -1
@@ -191,7 +191,7 @@ export interface APIKey {
191
191
  */
192
192
  policy?: APIKey.Policy | null;
193
193
 
194
- principal?: APIKey.Principal;
194
+ principal?: APIKeyPrincipal;
195
195
 
196
196
  /**
197
197
  * Organization-owned service principal, when linked.
@@ -278,12 +278,12 @@ export namespace APIKey {
278
278
  }
279
279
  }
280
280
  }
281
+ }
281
282
 
282
- export interface Principal {
283
- id: string;
283
+ export interface APIKeyPrincipal {
284
+ id: string;
284
285
 
285
- type: 'user' | 'service_account';
286
- }
286
+ type: 'user' | 'service_account';
287
287
  }
288
288
 
289
289
  /**
@@ -484,6 +484,12 @@ export namespace APIKeyUpdateParams {
484
484
  }
485
485
 
486
486
  export interface APIKeyListParams extends OffsetPaginationParams {
487
+ /**
488
+ * Return only keys created by this user ID. This is the same person the key's
489
+ * created_by field describes.
490
+ */
491
+ created_by?: string;
492
+
487
493
  /**
488
494
  * Deprecated: use status=all instead. When true, include deleted (soft-deleted)
489
495
  * API keys in the results for audit purposes.
@@ -498,12 +504,28 @@ export interface APIKeyListParams extends OffsetPaginationParams {
498
504
  */
499
505
  name?: string;
500
506
 
507
+ /**
508
+ * Return only keys that act as a user, or only keys that act as a service account.
509
+ */
510
+ principal_type?: 'user' | 'service_account';
511
+
512
+ /**
513
+ * Return only keys scoped to this project ID. The value "org" returns keys that
514
+ * are not scoped to a project.
515
+ */
516
+ project_id?: string;
517
+
501
518
  /**
502
519
  * Case-insensitive substring match against API key name, creator, and project. API
503
520
  * key identifiers and masked keys match by exact value or prefix.
504
521
  */
505
522
  query?: string;
506
523
 
524
+ /**
525
+ * Return only keys that belong to this service account.
526
+ */
527
+ service_account_id?: string;
528
+
507
529
  /**
508
530
  * Field to sort API keys by. Keys with no expiry or no recorded use sort last for
509
531
  * expires_at and last_used_at in either direction.
@@ -516,11 +538,11 @@ export interface APIKeyListParams extends OffsetPaginationParams {
516
538
  sort_direction?: 'asc' | 'desc';
517
539
 
518
540
  /**
519
- * Filter API keys by status. "active" returns keys that are not deleted (default;
520
- * expired-but-not-deleted keys are still included), "deleted" returns only
521
- * soft-deleted keys, "all" returns both.
541
+ * Filter API keys by status. "active" returns keys that are neither deleted nor
542
+ * expired (default), "expired" returns keys that are not deleted and whose expiry
543
+ * has passed, "deleted" returns only soft-deleted keys, "all" returns every key.
522
544
  */
523
- status?: 'active' | 'deleted' | 'all';
545
+ status?: 'active' | 'expired' | 'deleted' | 'all';
524
546
  }
525
547
 
526
548
  export interface APIKeyRotateParams {
@@ -540,6 +562,7 @@ export interface APIKeyRotateParams {
540
562
  export declare namespace APIKeys {
541
563
  export {
542
564
  type APIKey as APIKey,
565
+ type APIKeyPrincipal as APIKeyPrincipal,
543
566
  type CreatedAPIKey as CreatedAPIKey,
544
567
  type APIKeysOffsetPagination as APIKeysOffsetPagination,
545
568
  type APIKeyCreateParams as APIKeyCreateParams,
@@ -24,7 +24,7 @@ import {
24
24
  SubmitFieldsResponse,
25
25
  } from './connections';
26
26
  import * as ContextAPI from './context';
27
- import { AuthContext, Context } from './context';
27
+ import { AuthContext, AuthContextWorkloadIdentity, Context } from './context';
28
28
 
29
29
  export class Auth extends APIResource {
30
30
  context: ContextAPI.Context = new ContextAPI.Context(this._client);
@@ -35,7 +35,11 @@ Auth.Context = Context;
35
35
  Auth.Connections = Connections;
36
36
 
37
37
  export declare namespace Auth {
38
- export { Context as Context, type AuthContext as AuthContext };
38
+ export {
39
+ Context as Context,
40
+ type AuthContext as AuthContext,
41
+ type AuthContextWorkloadIdentity as AuthContextWorkloadIdentity,
42
+ };
39
43
 
40
44
  export {
41
45
  Connections as Connections,
@@ -39,7 +39,7 @@ export interface AuthContext {
39
39
 
40
40
  principal: AuthContext.Principal;
41
41
 
42
- workload_identity?: AuthContext.WorkloadIdentity;
42
+ workload_identity?: AuthContextWorkloadIdentity;
43
43
  }
44
44
 
45
45
  export namespace AuthContext {
@@ -184,20 +184,20 @@ export namespace AuthContext {
184
184
  */
185
185
  type: 'api_key' | 'user' | 'service_account';
186
186
  }
187
+ }
187
188
 
188
- export interface WorkloadIdentity {
189
- /**
190
- * Digest of the verified external subject. Never the original assertion or
191
- * arbitrary claims.
192
- */
193
- external_subject_digest: string;
189
+ export interface AuthContextWorkloadIdentity {
190
+ /**
191
+ * Digest of the verified external subject. Never the original assertion or
192
+ * arbitrary claims.
193
+ */
194
+ external_subject_digest: string;
194
195
 
195
- federation_rule_id: string;
196
+ federation_rule_id: string;
196
197
 
197
- issuer_id: string;
198
- }
198
+ issuer_id: string;
199
199
  }
200
200
 
201
201
  export declare namespace Context {
202
- export { type AuthContext as AuthContext };
202
+ export { type AuthContext as AuthContext, type AuthContextWorkloadIdentity as AuthContextWorkloadIdentity };
203
203
  }
@@ -22,4 +22,4 @@ export {
22
22
  type ManagedAuthsOffsetPagination,
23
23
  type ManagedAuthTimelineEventsOffsetPagination,
24
24
  } from './connections';
25
- export { Context, type AuthContext } from './context';
25
+ export { Context, type AuthContext, type AuthContextWorkloadIdentity } from './context';
@@ -4,6 +4,7 @@ export * from './shared';
4
4
  export {
5
5
  APIKeys,
6
6
  type APIKey,
7
+ type APIKeyPrincipal,
7
8
  type CreatedAPIKey,
8
9
  type APIKeyCreateParams,
9
10
  type APIKeyRetrieveParams,
@@ -230,6 +231,15 @@ export {
230
231
  type Warning,
231
232
  type SearchCreateParams,
232
233
  } from './search/search';
234
+ export {
235
+ ServiceAccounts,
236
+ type ServiceAccount,
237
+ type ServiceAccountConfig,
238
+ type ServiceAccountCreateParams,
239
+ type ServiceAccountUpdateParams,
240
+ type ServiceAccountListParams,
241
+ type ServiceAccountsOffsetPagination,
242
+ } from './service-accounts';
233
243
  export {
234
244
  Tasks,
235
245
  type Task,
@@ -256,3 +266,34 @@ export {
256
266
  type VaultUpsertParams,
257
267
  type VaultsOffsetPagination,
258
268
  } from './vaults/vaults';
269
+ export {
270
+ WorkloadIdentityAuthenticationEvents,
271
+ type WorkloadIdentityAuthenticationEvent,
272
+ type WorkloadIdentityAuthenticationEventListParams,
273
+ type WorkloadIdentityAuthenticationEventsOffsetPagination,
274
+ } from './workload-identity-authentication-events';
275
+ export {
276
+ WorkloadIdentityFederationRules,
277
+ type WorkloadIdentityAuthorization,
278
+ type WorkloadIdentityFederationRule,
279
+ type WorkloadIdentityFederationRuleConfig,
280
+ type WorkloadIdentityMatch,
281
+ type WorkloadIdentityTarget,
282
+ type WorkloadIdentityFederationRuleCreateParams,
283
+ type WorkloadIdentityFederationRuleUpdateParams,
284
+ type WorkloadIdentityFederationRuleListParams,
285
+ type WorkloadIdentityFederationRulesOffsetPagination,
286
+ } from './workload-identity-federation-rules';
287
+ export {
288
+ WorkloadIdentityIssuers,
289
+ type WorkloadIdentityIssuer,
290
+ type WorkloadIdentityIssuerConfig,
291
+ type WorkloadIdentityIssuerKeyCheck,
292
+ type WorkloadIdentityKeySource,
293
+ type WorkloadIdentityPresetType,
294
+ type WorkloadIdentityTokenValidation,
295
+ type WorkloadIdentityIssuerCreateParams,
296
+ type WorkloadIdentityIssuerUpdateParams,
297
+ type WorkloadIdentityIssuerListParams,
298
+ type WorkloadIdentityIssuersOffsetPagination,
299
+ } from './workload-identity-issuers';
@@ -0,0 +1,128 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { 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
+ export class ServiceAccounts extends APIResource {
11
+ /**
12
+ * Organization credential administrators only. No external namespace-ownership or
13
+ * staff approval is required. New trust resources default disabled.
14
+ */
15
+ create(body: ServiceAccountCreateParams, options?: RequestOptions): APIPromise<ServiceAccount> {
16
+ return this._client.post('/org/service_accounts', { body, ...options });
17
+ }
18
+
19
+ /**
20
+ * Any signed-in member of the organization can read this. API keys cannot.
21
+ */
22
+ retrieve(id: string, options?: RequestOptions): APIPromise<ServiceAccount> {
23
+ return this._client.get(path`/org/service_accounts/${id}`, options);
24
+ }
25
+
26
+ /**
27
+ * Update a service account
28
+ */
29
+ update(id: string, body: ServiceAccountUpdateParams, options?: RequestOptions): APIPromise<ServiceAccount> {
30
+ return this._client.patch(path`/org/service_accounts/${id}`, { body, ...options });
31
+ }
32
+
33
+ /**
34
+ * Any signed-in member of the organization can read this. API keys cannot.
35
+ */
36
+ list(
37
+ query: ServiceAccountListParams | null | undefined = {},
38
+ options?: RequestOptions,
39
+ ): PagePromise<ServiceAccountsOffsetPagination, ServiceAccount> {
40
+ return this._client.getAPIList('/org/service_accounts', OffsetPagination<ServiceAccount>, {
41
+ query,
42
+ ...options,
43
+ });
44
+ }
45
+
46
+ /**
47
+ * Retains history and invalidates associated authority within the documented
48
+ * status bound. Does not delete created browser resources.
49
+ */
50
+ delete(id: string, options?: RequestOptions): APIPromise<void> {
51
+ return this._client.delete(path`/org/service_accounts/${id}`, {
52
+ ...options,
53
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
54
+ });
55
+ }
56
+ }
57
+
58
+ export type ServiceAccountsOffsetPagination = OffsetPagination<ServiceAccount>;
59
+
60
+ export interface ServiceAccount {
61
+ id: string;
62
+
63
+ archived_at: string | null;
64
+
65
+ created_at: string;
66
+
67
+ created_by_user_id: string | null;
68
+
69
+ description: string;
70
+
71
+ /**
72
+ * When one of the account's API keys last authenticated or one of its rules last
73
+ * issued a token. Recorded at most once every 15 minutes, so it can lag. Null if
74
+ * the account has never been used.
75
+ */
76
+ last_used_at: string | null;
77
+
78
+ name: string;
79
+
80
+ org_id: string;
81
+
82
+ /**
83
+ * Authority revision. Cosmetic updates do not widen permissions.
84
+ */
85
+ security_version: number;
86
+
87
+ updated_at: string;
88
+ }
89
+
90
+ export interface ServiceAccountConfig {
91
+ name: string;
92
+
93
+ description?: string;
94
+ }
95
+
96
+ export interface ServiceAccountCreateParams {
97
+ name: string;
98
+
99
+ description?: string;
100
+ }
101
+
102
+ export interface ServiceAccountUpdateParams {
103
+ expected_version: number;
104
+
105
+ description?: string;
106
+
107
+ name?: string;
108
+ }
109
+
110
+ export interface ServiceAccountListParams extends OffsetPaginationParams {
111
+ /**
112
+ * Case-insensitive substring match against name or description; exact ID match.
113
+ */
114
+ query?: string;
115
+
116
+ status?: 'active' | 'archived' | 'all';
117
+ }
118
+
119
+ export declare namespace ServiceAccounts {
120
+ export {
121
+ type ServiceAccount as ServiceAccount,
122
+ type ServiceAccountConfig as ServiceAccountConfig,
123
+ type ServiceAccountsOffsetPagination as ServiceAccountsOffsetPagination,
124
+ type ServiceAccountCreateParams as ServiceAccountCreateParams,
125
+ type ServiceAccountUpdateParams as ServiceAccountUpdateParams,
126
+ type ServiceAccountListParams as ServiceAccountListParams,
127
+ };
128
+ }
@@ -0,0 +1,72 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { OffsetPagination, type OffsetPaginationParams, PagePromise } from '../core/pagination';
5
+ import { RequestOptions } from '../internal/request-options';
6
+
7
+ export class WorkloadIdentityAuthenticationEvents extends APIResource {
8
+ /**
9
+ * Any signed-in member of the organization can read this. API keys cannot.
10
+ */
11
+ list(
12
+ query: WorkloadIdentityAuthenticationEventListParams | null | undefined = {},
13
+ options?: RequestOptions,
14
+ ): PagePromise<WorkloadIdentityAuthenticationEventsOffsetPagination, WorkloadIdentityAuthenticationEvent> {
15
+ return this._client.getAPIList(
16
+ '/org/workload_identity_authentication_events',
17
+ OffsetPagination<WorkloadIdentityAuthenticationEvent>,
18
+ { query, ...options },
19
+ );
20
+ }
21
+ }
22
+
23
+ export type WorkloadIdentityAuthenticationEventsOffsetPagination =
24
+ OffsetPagination<WorkloadIdentityAuthenticationEvent>;
25
+
26
+ export interface WorkloadIdentityAuthenticationEvent {
27
+ id: string;
28
+
29
+ correlation_id: string;
30
+
31
+ created_at: string;
32
+
33
+ credential_id: string | null;
34
+
35
+ federation_rule_id: string | null;
36
+
37
+ issuer_id: string | null;
38
+
39
+ org_id: string;
40
+
41
+ outcome: 'success' | 'failure';
42
+
43
+ project_id: string | null;
44
+
45
+ reason: string;
46
+
47
+ service_account_id: string | null;
48
+ }
49
+
50
+ export interface WorkloadIdentityAuthenticationEventListParams extends OffsetPaginationParams {
51
+ end_time?: string;
52
+
53
+ federation_rule_id?: string;
54
+
55
+ issuer_id?: string;
56
+
57
+ outcome?: 'success' | 'failure';
58
+
59
+ project_id?: string;
60
+
61
+ service_account_id?: string;
62
+
63
+ start_time?: string;
64
+ }
65
+
66
+ export declare namespace WorkloadIdentityAuthenticationEvents {
67
+ export {
68
+ type WorkloadIdentityAuthenticationEvent as WorkloadIdentityAuthenticationEvent,
69
+ type WorkloadIdentityAuthenticationEventsOffsetPagination as WorkloadIdentityAuthenticationEventsOffsetPagination,
70
+ type WorkloadIdentityAuthenticationEventListParams as WorkloadIdentityAuthenticationEventListParams,
71
+ };
72
+ }