@cadenya/cadenya 0.121.0 → 0.122.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 +8 -0
- package/client.d.mts +14 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +14 -4
- package/client.d.ts.map +1 -1
- package/client.js +13 -3
- package/client.js.map +1 -1
- package/client.mjs +13 -3
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/account.d.mts +5 -4
- package/resources/account.d.mts.map +1 -1
- package/resources/account.d.ts +5 -4
- package/resources/account.d.ts.map +1 -1
- package/resources/api-keys.d.mts +258 -1
- package/resources/api-keys.d.mts.map +1 -1
- package/resources/api-keys.d.ts +258 -1
- package/resources/api-keys.d.ts.map +1 -1
- package/resources/api-keys.js +78 -2
- package/resources/api-keys.js.map +1 -1
- package/resources/api-keys.mjs +76 -1
- package/resources/api-keys.mjs.map +1 -1
- package/resources/global-api-key.d.mts +33 -0
- package/resources/global-api-key.d.mts.map +1 -0
- package/resources/global-api-key.d.ts +33 -0
- package/resources/global-api-key.d.ts.map +1 -0
- package/resources/global-api-key.js +43 -0
- package/resources/global-api-key.js.map +1 -0
- package/resources/global-api-key.mjs +39 -0
- package/resources/global-api-key.mjs.map +1 -0
- package/resources/index.d.mts +2 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +4 -2
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -1
- package/resources/index.mjs.map +1 -1
- package/src/client.ts +33 -13
- package/src/resources/account.ts +5 -4
- package/src/resources/api-keys.ts +345 -1
- package/src/resources/global-api-key.ts +46 -0
- package/src/resources/index.ts +6 -1
- 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/access.d.mts +0 -53
- package/resources/api-keys/access.d.mts.map +0 -1
- package/resources/api-keys/access.d.ts +0 -53
- package/resources/api-keys/access.d.ts.map +0 -1
- package/resources/api-keys/access.js +0 -41
- package/resources/api-keys/access.js.map +0 -1
- package/resources/api-keys/access.mjs +0 -37
- package/resources/api-keys/access.mjs.map +0 -1
- package/resources/api-keys/api-keys.d.mts +0 -230
- package/resources/api-keys/api-keys.d.mts.map +0 -1
- package/resources/api-keys/api-keys.d.ts +0 -230
- package/resources/api-keys/api-keys.d.ts.map +0 -1
- package/resources/api-keys/api-keys.js +0 -65
- package/resources/api-keys/api-keys.js.map +0 -1
- package/resources/api-keys/api-keys.mjs +0 -60
- package/resources/api-keys/api-keys.mjs.map +0 -1
- package/resources/api-keys/index.d.mts +0 -3
- package/resources/api-keys/index.d.mts.map +0 -1
- package/resources/api-keys/index.d.ts +0 -3
- package/resources/api-keys/index.d.ts.map +0 -1
- package/resources/api-keys/index.js +0 -9
- package/resources/api-keys/index.js.map +0 -1
- package/resources/api-keys/index.mjs +0 -4
- package/resources/api-keys/index.mjs.map +0 -1
- package/src/resources/api-keys/access.ts +0 -86
- package/src/resources/api-keys/api-keys.ts +0 -300
- package/src/resources/api-keys/index.ts +0 -14
|
@@ -1,3 +1,347 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import * as AccountAPI from './account';
|
|
5
|
+
import * as Shared from './shared';
|
|
6
|
+
import { APIPromise } from '../core/api-promise';
|
|
7
|
+
import { CursorPagination, type CursorPaginationParams, PagePromise } from '../core/pagination';
|
|
8
|
+
import { buildHeaders } from '../internal/headers';
|
|
9
|
+
import { RequestOptions } from '../internal/request-options';
|
|
10
|
+
import { path } from '../internal/utils/path';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Issue, rotate, disable, and revoke a workspace's API keys. Every key
|
|
14
|
+
* belongs to exactly one workspace; the system-managed global account key is
|
|
15
|
+
* managed via GlobalAPIKeyService instead.
|
|
16
|
+
*/
|
|
17
|
+
export class APIKeys extends APIResource {
|
|
18
|
+
/**
|
|
19
|
+
* Creates a new API key in the workspace.
|
|
20
|
+
*/
|
|
21
|
+
create(workspaceID: string, body: APIKeyCreateParams, options?: RequestOptions): APIPromise<APIKey> {
|
|
22
|
+
return this._client.post(path`/v1/workspaces/${workspaceID}/api_keys`, { body, ...options });
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Retrieves an API key by ID.
|
|
27
|
+
*/
|
|
28
|
+
retrieve(id: string, params: APIKeyRetrieveParams, options?: RequestOptions): APIPromise<APIKey> {
|
|
29
|
+
const { workspaceId } = params;
|
|
30
|
+
return this._client.get(path`/v1/workspaces/${workspaceId}/api_keys/${id}`, options);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Updates an API key.
|
|
35
|
+
*/
|
|
36
|
+
update(id: string, params: APIKeyUpdateParams, options?: RequestOptions): APIPromise<APIKey> {
|
|
37
|
+
const { workspaceId, ...body } = params;
|
|
38
|
+
return this._client.patch(path`/v1/workspaces/${workspaceId}/api_keys/${id}`, { body, ...options });
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Lists the workspace's API keys.
|
|
43
|
+
*/
|
|
44
|
+
list(
|
|
45
|
+
workspaceID: string,
|
|
46
|
+
query: APIKeyListParams | null | undefined = {},
|
|
47
|
+
options?: RequestOptions,
|
|
48
|
+
): PagePromise<APIKeysCursorPagination, APIKey> {
|
|
49
|
+
return this._client.getAPIList(path`/v1/workspaces/${workspaceID}/api_keys`, CursorPagination<APIKey>, {
|
|
50
|
+
query,
|
|
51
|
+
...options,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Deletes an API key.
|
|
57
|
+
*/
|
|
58
|
+
delete(id: string, params: APIKeyDeleteParams, options?: RequestOptions): APIPromise<void> {
|
|
59
|
+
const { workspaceId } = params;
|
|
60
|
+
return this._client.delete(path`/v1/workspaces/${workspaceId}/api_keys/${id}`, {
|
|
61
|
+
...options,
|
|
62
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Disables an API key. While disabled, presenting the key's token fails
|
|
68
|
+
* authentication on every endpoint; the key is retained. Idempotent.
|
|
69
|
+
*/
|
|
70
|
+
disable(id: string, params: APIKeyDisableParams, options?: RequestOptions): APIPromise<APIKey> {
|
|
71
|
+
const { workspaceId, ...body } = params;
|
|
72
|
+
return this._client.post(path`/v1/workspaces/${workspaceId}/api_keys/${id}:disable`, {
|
|
73
|
+
body,
|
|
74
|
+
...options,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Re-enables a disabled API key so its token authenticates again. Idempotent.
|
|
80
|
+
*/
|
|
81
|
+
enable(id: string, params: APIKeyEnableParams, options?: RequestOptions): APIPromise<APIKey> {
|
|
82
|
+
const { workspaceId, ...body } = params;
|
|
83
|
+
return this._client.post(path`/v1/workspaces/${workspaceId}/api_keys/${id}:enable`, { body, ...options });
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Rotates an API key and returns a new token. All previous tokens for this key are
|
|
88
|
+
* invalidated.
|
|
89
|
+
*/
|
|
90
|
+
rotate(id: string, params: APIKeyRotateParams, options?: RequestOptions): APIPromise<APIKey> {
|
|
91
|
+
const { workspaceId, ...body } = params;
|
|
92
|
+
return this._client.post(path`/v1/workspaces/${workspaceId}/api_keys/${id}:rotate`, { body, ...options });
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export type APIKeysCursorPagination = CursorPagination<APIKey>;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* An API key. Every key belongs to exactly one workspace and is managed via the
|
|
100
|
+
* workspace-scoped API key routes. The only exception is the system-managed global
|
|
101
|
+
* account key, which spans all workspaces and is managed via the account
|
|
102
|
+
* global_api_key routes.
|
|
103
|
+
*/
|
|
104
|
+
export interface APIKey {
|
|
105
|
+
/**
|
|
106
|
+
* AccountResourceMetadata is used to represent a resource that is associated to an
|
|
107
|
+
* account but not to a workspace.
|
|
108
|
+
*/
|
|
109
|
+
metadata: Shared.AccountResourceMetadata;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Configuration for an API key.
|
|
113
|
+
*/
|
|
114
|
+
spec: APIKeySpec;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* The current lifecycle state of the API key. Output only. Keys are created
|
|
118
|
+
* STATE_ENABLED; use the :disable and :enable actions to transition between
|
|
119
|
+
* states.
|
|
120
|
+
*/
|
|
121
|
+
state: 'STATE_UNSPECIFIED' | 'STATE_ENABLED' | 'STATE_DISABLED';
|
|
122
|
+
|
|
123
|
+
info?: APIKeyInfo;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface APIKeyInfo {
|
|
127
|
+
/**
|
|
128
|
+
* A profile identifies a user or non-human principal (such as an API key) at the
|
|
129
|
+
* account level. Profiles are account-scoped and can be granted access to multiple
|
|
130
|
+
* workspaces.
|
|
131
|
+
*/
|
|
132
|
+
createdBy?: AccountAPI.Profile;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Configuration for an API key.
|
|
137
|
+
*/
|
|
138
|
+
export interface APIKeySpec {
|
|
139
|
+
/**
|
|
140
|
+
* The bearer token used to authenticate as this API key. Returned only on creation
|
|
141
|
+
* and rotation; subsequent reads omit this field.
|
|
142
|
+
*/
|
|
143
|
+
token?: string;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Free-form description of what this API key is used for.
|
|
147
|
+
*/
|
|
148
|
+
description?: string;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Scopes granted to this key. Each entry is a colon-separated resource:verb string
|
|
152
|
+
* (e.g. "objectives:manage").
|
|
153
|
+
*
|
|
154
|
+
* Resources: agents, objectives, tools, memory, api_keys, workspaces, secrets,
|
|
155
|
+
* account. Verbs: read and manage, where manage implies read — a stored scope set
|
|
156
|
+
* is normalized to drop "x:read" when "x:manage" is present. The secrets and
|
|
157
|
+
* account resources support only manage. "\*" is an explicit full-access grant.
|
|
158
|
+
*
|
|
159
|
+
* Scopes are deny-by-default: a key with an empty list can call only scope-free
|
|
160
|
+
* endpoints. Full access is always an explicit "\*" grant.
|
|
161
|
+
*/
|
|
162
|
+
permissions?: Array<string>;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* True when this key is managed by the system (i.e. the auto-provisioned global
|
|
166
|
+
* account key). System keys cannot be deleted but can be rotated.
|
|
167
|
+
*/
|
|
168
|
+
system?: boolean;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export interface APIKeyCreateParams {
|
|
172
|
+
/**
|
|
173
|
+
* CreateAccountResourceMetadata contains the user-provided fields for creating an
|
|
174
|
+
* account-scoped resource. Read-only fields (id, account_id, profile_id) are
|
|
175
|
+
* excluded since they are set by the server.
|
|
176
|
+
*/
|
|
177
|
+
metadata: APIKeyCreateParams.Metadata;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Configuration for an API key.
|
|
181
|
+
*/
|
|
182
|
+
spec: APIKeySpec;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export namespace APIKeyCreateParams {
|
|
186
|
+
/**
|
|
187
|
+
* CreateAccountResourceMetadata contains the user-provided fields for creating an
|
|
188
|
+
* account-scoped resource. Read-only fields (id, account_id, profile_id) are
|
|
189
|
+
* excluded since they are set by the server.
|
|
190
|
+
*/
|
|
191
|
+
export interface Metadata {
|
|
192
|
+
/**
|
|
193
|
+
* Human-readable name for the resource (e.g., "Production API Key", "Staging
|
|
194
|
+
* Workspace")
|
|
195
|
+
*/
|
|
196
|
+
name: string;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* External ID for the resource (e.g., a workflow ID from an external system)
|
|
200
|
+
*/
|
|
201
|
+
externalId?: string;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Key-value pairs for categorization and filtering. Values are 0-63 alphanumeric
|
|
205
|
+
* characters with "-", "\_", or "." allowed between; keys follow the same shape
|
|
206
|
+
* and additionally accept an optional DNS-subdomain prefix (e.g. "cadenya.com/")
|
|
207
|
+
* of at most 253 characters. Examples: {"environment": "production", "team":
|
|
208
|
+
* "platform", "version": "v2"}
|
|
209
|
+
*/
|
|
210
|
+
labels?: { [key: string]: string };
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export interface APIKeyRetrieveParams {
|
|
215
|
+
/**
|
|
216
|
+
* The workspace the API key belongs to (path).
|
|
217
|
+
*/
|
|
218
|
+
workspaceId: string;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export interface APIKeyUpdateParams {
|
|
222
|
+
/**
|
|
223
|
+
* Path param: The workspace the API key belongs to (path).
|
|
224
|
+
*/
|
|
225
|
+
workspaceId: string;
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Body param: UpdateAccountResourceMetadata contains the user-provided fields for
|
|
229
|
+
* updating an account-scoped resource. Read-only fields (id, account_id,
|
|
230
|
+
* profile_id) are excluded since they are set by the server.
|
|
231
|
+
*/
|
|
232
|
+
metadata?: APIKeyUpdateParams.Metadata;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Body param: Configuration for an API key.
|
|
236
|
+
*/
|
|
237
|
+
spec?: APIKeySpec;
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Body param: Fields to update.
|
|
241
|
+
*/
|
|
242
|
+
updateMask?: string;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export namespace APIKeyUpdateParams {
|
|
246
|
+
/**
|
|
247
|
+
* UpdateAccountResourceMetadata contains the user-provided fields for updating an
|
|
248
|
+
* account-scoped resource. Read-only fields (id, account_id, profile_id) are
|
|
249
|
+
* excluded since they are set by the server.
|
|
250
|
+
*/
|
|
251
|
+
export interface Metadata {
|
|
252
|
+
/**
|
|
253
|
+
* Human-readable name for the resource (e.g., "Production API Key", "Staging
|
|
254
|
+
* Workspace")
|
|
255
|
+
*/
|
|
256
|
+
name: string;
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* External ID for the resource (e.g., a workflow ID from an external system)
|
|
260
|
+
*/
|
|
261
|
+
externalId?: string;
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Key-value pairs for categorization and filtering. Values are 0-63 alphanumeric
|
|
265
|
+
* characters with "-", "\_", or "." allowed between; keys follow the same shape
|
|
266
|
+
* and additionally accept an optional DNS-subdomain prefix (e.g. "cadenya.com/")
|
|
267
|
+
* of at most 253 characters. Examples: {"environment": "production", "team":
|
|
268
|
+
* "platform", "version": "v2"}
|
|
269
|
+
*/
|
|
270
|
+
labels?: { [key: string]: string };
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export interface APIKeyListParams extends CursorPaginationParams {
|
|
275
|
+
/**
|
|
276
|
+
* When true, included info fields are populated. Requests with this flag count
|
|
277
|
+
* more against your rate limit.
|
|
278
|
+
*/
|
|
279
|
+
includeInfo?: boolean;
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Filters by metadata labels. Comma-separated key=value pairs, e.g.
|
|
283
|
+
* "env=prod,team=ai". A resource matches only if every pair matches exactly (AND
|
|
284
|
+
* semantics).
|
|
285
|
+
*/
|
|
286
|
+
labels?: string;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Filter by ID prefix.
|
|
290
|
+
*/
|
|
291
|
+
prefix?: string;
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Free-form search query.
|
|
295
|
+
*/
|
|
296
|
+
query?: string;
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Sort order for results (asc or desc by creation time).
|
|
300
|
+
*/
|
|
301
|
+
sortOrder?: string;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export interface APIKeyDeleteParams {
|
|
305
|
+
/**
|
|
306
|
+
* The workspace the API key belongs to (path).
|
|
307
|
+
*/
|
|
308
|
+
workspaceId: string;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
export interface APIKeyDisableParams {
|
|
312
|
+
/**
|
|
313
|
+
* The workspace the API key belongs to (path).
|
|
314
|
+
*/
|
|
315
|
+
workspaceId: string;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export interface APIKeyEnableParams {
|
|
319
|
+
/**
|
|
320
|
+
* The workspace the API key belongs to (path).
|
|
321
|
+
*/
|
|
322
|
+
workspaceId: string;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
export interface APIKeyRotateParams {
|
|
326
|
+
/**
|
|
327
|
+
* The workspace the API key belongs to (path).
|
|
328
|
+
*/
|
|
329
|
+
workspaceId: string;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export declare namespace APIKeys {
|
|
333
|
+
export {
|
|
334
|
+
type APIKey as APIKey,
|
|
335
|
+
type APIKeyInfo as APIKeyInfo,
|
|
336
|
+
type APIKeySpec as APIKeySpec,
|
|
337
|
+
type APIKeysCursorPagination as APIKeysCursorPagination,
|
|
338
|
+
type APIKeyCreateParams as APIKeyCreateParams,
|
|
339
|
+
type APIKeyRetrieveParams as APIKeyRetrieveParams,
|
|
340
|
+
type APIKeyUpdateParams as APIKeyUpdateParams,
|
|
341
|
+
type APIKeyListParams as APIKeyListParams,
|
|
342
|
+
type APIKeyDeleteParams as APIKeyDeleteParams,
|
|
343
|
+
type APIKeyDisableParams as APIKeyDisableParams,
|
|
344
|
+
type APIKeyEnableParams as APIKeyEnableParams,
|
|
345
|
+
type APIKeyRotateParams as APIKeyRotateParams,
|
|
346
|
+
};
|
|
347
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import * as APIKeysAPI from './api-keys';
|
|
5
|
+
import { APIPromise } from '../core/api-promise';
|
|
6
|
+
import { RequestOptions } from '../internal/request-options';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Manage the account's system-provisioned global API key. The global key is
|
|
10
|
+
* the only key that spans every workspace; it is created by the system and
|
|
11
|
+
* cannot be deleted, so the surface is retrieve, rotate, and the
|
|
12
|
+
* disable/enable kill switch.
|
|
13
|
+
*/
|
|
14
|
+
export class GlobalAPIKey extends APIResource {
|
|
15
|
+
/**
|
|
16
|
+
* Retrieves the account's global API key. The token is included only when the
|
|
17
|
+
* caller's scopes dominate the key's.
|
|
18
|
+
*/
|
|
19
|
+
retrieve(options?: RequestOptions): APIPromise<APIKeysAPI.APIKey> {
|
|
20
|
+
return this._client.get('/v1/account/global_api_key', options);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Disables the global API key. While disabled, presenting its token fails
|
|
25
|
+
* authentication on every endpoint; the key is retained. Idempotent.
|
|
26
|
+
*/
|
|
27
|
+
disable(options?: RequestOptions): APIPromise<APIKeysAPI.APIKey> {
|
|
28
|
+
return this._client.post('/v1/account/global_api_key:disable', options);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Re-enables the disabled global API key so its token authenticates again.
|
|
33
|
+
* Idempotent.
|
|
34
|
+
*/
|
|
35
|
+
enable(options?: RequestOptions): APIPromise<APIKeysAPI.APIKey> {
|
|
36
|
+
return this._client.post('/v1/account/global_api_key:enable', options);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Rotates the global API key and returns a new token. All previous tokens are
|
|
41
|
+
* invalidated.
|
|
42
|
+
*/
|
|
43
|
+
rotate(options?: RequestOptions): APIPromise<APIKeysAPI.APIKey> {
|
|
44
|
+
return this._client.post('/v1/account/global_api_key:rotate', options);
|
|
45
|
+
}
|
|
46
|
+
}
|
package/src/resources/index.ts
CHANGED
|
@@ -18,11 +18,15 @@ export {
|
|
|
18
18
|
type APIKeyInfo,
|
|
19
19
|
type APIKeySpec,
|
|
20
20
|
type APIKeyCreateParams,
|
|
21
|
+
type APIKeyRetrieveParams,
|
|
21
22
|
type APIKeyUpdateParams,
|
|
22
23
|
type APIKeyListParams,
|
|
24
|
+
type APIKeyDeleteParams,
|
|
25
|
+
type APIKeyDisableParams,
|
|
26
|
+
type APIKeyEnableParams,
|
|
23
27
|
type APIKeyRotateParams,
|
|
24
28
|
type APIKeysCursorPagination,
|
|
25
|
-
} from './api-keys
|
|
29
|
+
} from './api-keys';
|
|
26
30
|
export {
|
|
27
31
|
AccountResource,
|
|
28
32
|
type Account,
|
|
@@ -51,6 +55,7 @@ export {
|
|
|
51
55
|
type AgentUnpublishParams,
|
|
52
56
|
type AgentsCursorPagination,
|
|
53
57
|
} from './agents/agents';
|
|
58
|
+
export { GlobalAPIKey } from './global-api-key';
|
|
54
59
|
export {
|
|
55
60
|
MemoryLayers,
|
|
56
61
|
type MemoryLayer,
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.122.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.122.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.122.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.122.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
-
import * as WorkspacesAPI from "../workspaces.mjs";
|
|
3
|
-
import { WorkspacesCursorPagination } from "../workspaces.mjs";
|
|
4
|
-
import * as APIKeysAPI from "./api-keys.mjs";
|
|
5
|
-
import { APIPromise } from "../../core/api-promise.mjs";
|
|
6
|
-
import { type CursorPaginationParams, PagePromise } from "../../core/pagination.mjs";
|
|
7
|
-
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
8
|
-
/**
|
|
9
|
-
* Issue, rotate, and revoke API keys for the account, and grant or revoke
|
|
10
|
-
* each key's access to individual workspaces.
|
|
11
|
-
*/
|
|
12
|
-
export declare class Access extends APIResource {
|
|
13
|
-
/**
|
|
14
|
-
* Lists the workspaces this API key has access to. Cursor-paginated.
|
|
15
|
-
*/
|
|
16
|
-
list(id: string, query?: AccessListParams | null | undefined, options?: RequestOptions): PagePromise<WorkspacesCursorPagination, WorkspacesAPI.Workspace>;
|
|
17
|
-
/**
|
|
18
|
-
* Grants this API key access to the specified workspace. Idempotent — adding an
|
|
19
|
-
* already-associated workspace is a no-op. Returns the updated API key with
|
|
20
|
-
* refreshed workspace preview and total.
|
|
21
|
-
*/
|
|
22
|
-
add(id: string, body: AccessAddParams, options?: RequestOptions): APIPromise<APIKeysAPI.APIKey>;
|
|
23
|
-
/**
|
|
24
|
-
* Revokes this API key's access to the specified workspace. Idempotent. A key may
|
|
25
|
-
* have zero workspaces and remains valid.
|
|
26
|
-
*/
|
|
27
|
-
remove(workspaceID: string, params: AccessRemoveParams, options?: RequestOptions): APIPromise<void>;
|
|
28
|
-
}
|
|
29
|
-
export interface AccessListParams extends CursorPaginationParams {
|
|
30
|
-
/**
|
|
31
|
-
* Filters by metadata labels. Comma-separated key=value pairs, e.g.
|
|
32
|
-
* "env=prod,team=ai". A resource matches only if every pair matches exactly (AND
|
|
33
|
-
* semantics).
|
|
34
|
-
*/
|
|
35
|
-
labels?: string;
|
|
36
|
-
}
|
|
37
|
-
export interface AccessAddParams {
|
|
38
|
-
/**
|
|
39
|
-
* The workspace to grant access to.
|
|
40
|
-
*/
|
|
41
|
-
workspaceId?: string;
|
|
42
|
-
}
|
|
43
|
-
export interface AccessRemoveParams {
|
|
44
|
-
/**
|
|
45
|
-
* The API key losing workspace access (path).
|
|
46
|
-
*/
|
|
47
|
-
id: string;
|
|
48
|
-
}
|
|
49
|
-
export declare namespace Access {
|
|
50
|
-
export { type AccessListParams as AccessListParams, type AccessAddParams as AccessAddParams, type AccessRemoveParams as AccessRemoveParams, };
|
|
51
|
-
}
|
|
52
|
-
export { type WorkspacesCursorPagination };
|
|
53
|
-
//# sourceMappingURL=access.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"access.d.mts","sourceRoot":"","sources":["../../src/resources/api-keys/access.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,aAAa,0BAAsB;AAC/C,OAAO,EAAE,0BAA0B,EAAE,0BAAsB;AAC3D,OAAO,KAAK,UAAU,uBAAmB;AACzC,OAAO,EAAE,UAAU,EAAE,mCAA+B;AACpD,OAAO,EAAoB,KAAK,sBAAsB,EAAE,WAAW,EAAE,kCAA8B;AAEnG,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAGhE;;;GAGG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACrC;;OAEG;IACH,IAAI,CACF,EAAE,EAAE,MAAM,EACV,KAAK,GAAE,gBAAgB,GAAG,IAAI,GAAG,SAAc,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,0BAA0B,EAAE,aAAa,CAAC,SAAS,CAAC;IAQnE;;;;OAIG;IACH,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC;IAI/F;;;OAGG;IACH,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAOpG;AAED,MAAM,WAAW,gBAAiB,SAAQ,sBAAsB;IAC9D;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH;AAED,OAAO,EAAE,KAAK,0BAA0B,EAAE,CAAC"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { APIResource } from "../../core/resource.js";
|
|
2
|
-
import * as WorkspacesAPI from "../workspaces.js";
|
|
3
|
-
import { WorkspacesCursorPagination } from "../workspaces.js";
|
|
4
|
-
import * as APIKeysAPI from "./api-keys.js";
|
|
5
|
-
import { APIPromise } from "../../core/api-promise.js";
|
|
6
|
-
import { type CursorPaginationParams, PagePromise } from "../../core/pagination.js";
|
|
7
|
-
import { RequestOptions } from "../../internal/request-options.js";
|
|
8
|
-
/**
|
|
9
|
-
* Issue, rotate, and revoke API keys for the account, and grant or revoke
|
|
10
|
-
* each key's access to individual workspaces.
|
|
11
|
-
*/
|
|
12
|
-
export declare class Access extends APIResource {
|
|
13
|
-
/**
|
|
14
|
-
* Lists the workspaces this API key has access to. Cursor-paginated.
|
|
15
|
-
*/
|
|
16
|
-
list(id: string, query?: AccessListParams | null | undefined, options?: RequestOptions): PagePromise<WorkspacesCursorPagination, WorkspacesAPI.Workspace>;
|
|
17
|
-
/**
|
|
18
|
-
* Grants this API key access to the specified workspace. Idempotent — adding an
|
|
19
|
-
* already-associated workspace is a no-op. Returns the updated API key with
|
|
20
|
-
* refreshed workspace preview and total.
|
|
21
|
-
*/
|
|
22
|
-
add(id: string, body: AccessAddParams, options?: RequestOptions): APIPromise<APIKeysAPI.APIKey>;
|
|
23
|
-
/**
|
|
24
|
-
* Revokes this API key's access to the specified workspace. Idempotent. A key may
|
|
25
|
-
* have zero workspaces and remains valid.
|
|
26
|
-
*/
|
|
27
|
-
remove(workspaceID: string, params: AccessRemoveParams, options?: RequestOptions): APIPromise<void>;
|
|
28
|
-
}
|
|
29
|
-
export interface AccessListParams extends CursorPaginationParams {
|
|
30
|
-
/**
|
|
31
|
-
* Filters by metadata labels. Comma-separated key=value pairs, e.g.
|
|
32
|
-
* "env=prod,team=ai". A resource matches only if every pair matches exactly (AND
|
|
33
|
-
* semantics).
|
|
34
|
-
*/
|
|
35
|
-
labels?: string;
|
|
36
|
-
}
|
|
37
|
-
export interface AccessAddParams {
|
|
38
|
-
/**
|
|
39
|
-
* The workspace to grant access to.
|
|
40
|
-
*/
|
|
41
|
-
workspaceId?: string;
|
|
42
|
-
}
|
|
43
|
-
export interface AccessRemoveParams {
|
|
44
|
-
/**
|
|
45
|
-
* The API key losing workspace access (path).
|
|
46
|
-
*/
|
|
47
|
-
id: string;
|
|
48
|
-
}
|
|
49
|
-
export declare namespace Access {
|
|
50
|
-
export { type AccessListParams as AccessListParams, type AccessAddParams as AccessAddParams, type AccessRemoveParams as AccessRemoveParams, };
|
|
51
|
-
}
|
|
52
|
-
export { type WorkspacesCursorPagination };
|
|
53
|
-
//# sourceMappingURL=access.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"access.d.ts","sourceRoot":"","sources":["../../src/resources/api-keys/access.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,aAAa,yBAAsB;AAC/C,OAAO,EAAE,0BAA0B,EAAE,yBAAsB;AAC3D,OAAO,KAAK,UAAU,sBAAmB;AACzC,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAAoB,KAAK,sBAAsB,EAAE,WAAW,EAAE,iCAA8B;AAEnG,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAGhE;;;GAGG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACrC;;OAEG;IACH,IAAI,CACF,EAAE,EAAE,MAAM,EACV,KAAK,GAAE,gBAAgB,GAAG,IAAI,GAAG,SAAc,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,0BAA0B,EAAE,aAAa,CAAC,SAAS,CAAC;IAQnE;;;;OAIG;IACH,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC;IAI/F;;;OAGG;IACH,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAOpG;AAED,MAAM,WAAW,gBAAiB,SAAQ,sBAAsB;IAC9D;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH;AAED,OAAO,EAAE,KAAK,0BAA0B,EAAE,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Access = void 0;
|
|
5
|
-
const resource_1 = require("../../core/resource.js");
|
|
6
|
-
const pagination_1 = require("../../core/pagination.js");
|
|
7
|
-
const headers_1 = require("../../internal/headers.js");
|
|
8
|
-
const path_1 = require("../../internal/utils/path.js");
|
|
9
|
-
/**
|
|
10
|
-
* Issue, rotate, and revoke API keys for the account, and grant or revoke
|
|
11
|
-
* each key's access to individual workspaces.
|
|
12
|
-
*/
|
|
13
|
-
class Access extends resource_1.APIResource {
|
|
14
|
-
/**
|
|
15
|
-
* Lists the workspaces this API key has access to. Cursor-paginated.
|
|
16
|
-
*/
|
|
17
|
-
list(id, query = {}, options) {
|
|
18
|
-
return this._client.getAPIList((0, path_1.path) `/v1/account/api_keys/${id}/workspaces`, (pagination_1.CursorPagination), { query, ...options });
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Grants this API key access to the specified workspace. Idempotent — adding an
|
|
22
|
-
* already-associated workspace is a no-op. Returns the updated API key with
|
|
23
|
-
* refreshed workspace preview and total.
|
|
24
|
-
*/
|
|
25
|
-
add(id, body, options) {
|
|
26
|
-
return this._client.post((0, path_1.path) `/v1/account/api_keys/${id}/workspaces`, { body, ...options });
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Revokes this API key's access to the specified workspace. Idempotent. A key may
|
|
30
|
-
* have zero workspaces and remains valid.
|
|
31
|
-
*/
|
|
32
|
-
remove(workspaceID, params, options) {
|
|
33
|
-
const { id } = params;
|
|
34
|
-
return this._client.delete((0, path_1.path) `/v1/account/api_keys/${id}/workspaces/${workspaceID}`, {
|
|
35
|
-
...options,
|
|
36
|
-
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
exports.Access = Access;
|
|
41
|
-
//# sourceMappingURL=access.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"access.js","sourceRoot":"","sources":["../../src/resources/api-keys/access.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAKlD,yDAAmG;AACnG,uDAAsD;AAEtD,uDAAiD;AAEjD;;;GAGG;AACH,MAAa,MAAO,SAAQ,sBAAW;IACrC;;OAEG;IACH,IAAI,CACF,EAAU,EACV,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAA,WAAI,EAAA,wBAAwB,EAAE,aAAa,EAC3C,CAAA,6BAAyC,CAAA,EACzC,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,GAAG,CAAC,EAAU,EAAE,IAAqB,EAAE,OAAwB;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,wBAAwB,EAAE,aAAa,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9F,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,WAAmB,EAAE,MAA0B,EAAE,OAAwB;QAC9E,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,CAAC;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,wBAAwB,EAAE,eAAe,WAAW,EAAE,EAAE;YACrF,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF;AApCD,wBAoCC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
-
import { CursorPagination } from "../../core/pagination.mjs";
|
|
4
|
-
import { buildHeaders } from "../../internal/headers.mjs";
|
|
5
|
-
import { path } from "../../internal/utils/path.mjs";
|
|
6
|
-
/**
|
|
7
|
-
* Issue, rotate, and revoke API keys for the account, and grant or revoke
|
|
8
|
-
* each key's access to individual workspaces.
|
|
9
|
-
*/
|
|
10
|
-
export class Access extends APIResource {
|
|
11
|
-
/**
|
|
12
|
-
* Lists the workspaces this API key has access to. Cursor-paginated.
|
|
13
|
-
*/
|
|
14
|
-
list(id, query = {}, options) {
|
|
15
|
-
return this._client.getAPIList(path `/v1/account/api_keys/${id}/workspaces`, (CursorPagination), { query, ...options });
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Grants this API key access to the specified workspace. Idempotent — adding an
|
|
19
|
-
* already-associated workspace is a no-op. Returns the updated API key with
|
|
20
|
-
* refreshed workspace preview and total.
|
|
21
|
-
*/
|
|
22
|
-
add(id, body, options) {
|
|
23
|
-
return this._client.post(path `/v1/account/api_keys/${id}/workspaces`, { body, ...options });
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Revokes this API key's access to the specified workspace. Idempotent. A key may
|
|
27
|
-
* have zero workspaces and remains valid.
|
|
28
|
-
*/
|
|
29
|
-
remove(workspaceID, params, options) {
|
|
30
|
-
const { id } = params;
|
|
31
|
-
return this._client.delete(path `/v1/account/api_keys/${id}/workspaces/${workspaceID}`, {
|
|
32
|
-
...options,
|
|
33
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=access.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"access.mjs","sourceRoot":"","sources":["../../src/resources/api-keys/access.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAKlD,OAAO,EAAE,gBAAgB,EAA4C,kCAA8B;AACnG,OAAO,EAAE,YAAY,EAAE,mCAA+B;AAEtD,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD;;;GAGG;AACH,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;OAEG;IACH,IAAI,CACF,EAAU,EACV,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAI,CAAA,wBAAwB,EAAE,aAAa,EAC3C,CAAA,gBAAyC,CAAA,EACzC,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,GAAG,CAAC,EAAU,EAAE,IAAqB,EAAE,OAAwB;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,wBAAwB,EAAE,aAAa,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9F,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,WAAmB,EAAE,MAA0B,EAAE,OAAwB;QAC9E,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,CAAC;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,wBAAwB,EAAE,eAAe,WAAW,EAAE,EAAE;YACrF,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF"}
|