@cadenya/cadenya 0.120.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.
Files changed (75) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/client.d.mts +14 -4
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +14 -4
  5. package/client.d.ts.map +1 -1
  6. package/client.js +13 -3
  7. package/client.js.map +1 -1
  8. package/client.mjs +13 -3
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/account.d.mts +5 -4
  12. package/resources/account.d.mts.map +1 -1
  13. package/resources/account.d.ts +5 -4
  14. package/resources/account.d.ts.map +1 -1
  15. package/resources/api-keys.d.mts +258 -1
  16. package/resources/api-keys.d.mts.map +1 -1
  17. package/resources/api-keys.d.ts +258 -1
  18. package/resources/api-keys.d.ts.map +1 -1
  19. package/resources/api-keys.js +78 -2
  20. package/resources/api-keys.js.map +1 -1
  21. package/resources/api-keys.mjs +76 -1
  22. package/resources/api-keys.mjs.map +1 -1
  23. package/resources/global-api-key.d.mts +33 -0
  24. package/resources/global-api-key.d.mts.map +1 -0
  25. package/resources/global-api-key.d.ts +33 -0
  26. package/resources/global-api-key.d.ts.map +1 -0
  27. package/resources/global-api-key.js +43 -0
  28. package/resources/global-api-key.js.map +1 -0
  29. package/resources/global-api-key.mjs +39 -0
  30. package/resources/global-api-key.mjs.map +1 -0
  31. package/resources/index.d.mts +2 -1
  32. package/resources/index.d.mts.map +1 -1
  33. package/resources/index.d.ts +2 -1
  34. package/resources/index.d.ts.map +1 -1
  35. package/resources/index.js +4 -2
  36. package/resources/index.js.map +1 -1
  37. package/resources/index.mjs +2 -1
  38. package/resources/index.mjs.map +1 -1
  39. package/src/client.ts +33 -13
  40. package/src/resources/account.ts +5 -4
  41. package/src/resources/api-keys.ts +345 -1
  42. package/src/resources/global-api-key.ts +46 -0
  43. package/src/resources/index.ts +6 -1
  44. package/src/version.ts +1 -1
  45. package/version.d.mts +1 -1
  46. package/version.d.ts +1 -1
  47. package/version.js +1 -1
  48. package/version.mjs +1 -1
  49. package/resources/api-keys/access.d.mts +0 -53
  50. package/resources/api-keys/access.d.mts.map +0 -1
  51. package/resources/api-keys/access.d.ts +0 -53
  52. package/resources/api-keys/access.d.ts.map +0 -1
  53. package/resources/api-keys/access.js +0 -41
  54. package/resources/api-keys/access.js.map +0 -1
  55. package/resources/api-keys/access.mjs +0 -37
  56. package/resources/api-keys/access.mjs.map +0 -1
  57. package/resources/api-keys/api-keys.d.mts +0 -230
  58. package/resources/api-keys/api-keys.d.mts.map +0 -1
  59. package/resources/api-keys/api-keys.d.ts +0 -230
  60. package/resources/api-keys/api-keys.d.ts.map +0 -1
  61. package/resources/api-keys/api-keys.js +0 -65
  62. package/resources/api-keys/api-keys.js.map +0 -1
  63. package/resources/api-keys/api-keys.mjs +0 -60
  64. package/resources/api-keys/api-keys.mjs.map +0 -1
  65. package/resources/api-keys/index.d.mts +0 -3
  66. package/resources/api-keys/index.d.mts.map +0 -1
  67. package/resources/api-keys/index.d.ts +0 -3
  68. package/resources/api-keys/index.d.ts.map +0 -1
  69. package/resources/api-keys/index.js +0 -9
  70. package/resources/api-keys/index.js.map +0 -1
  71. package/resources/api-keys/index.mjs +0 -4
  72. package/resources/api-keys/index.mjs.map +0 -1
  73. package/src/resources/api-keys/access.ts +0 -86
  74. package/src/resources/api-keys/api-keys.ts +0 -300
  75. package/src/resources/api-keys/index.ts +0 -14
@@ -1 +1 @@
1
- {"version":3,"file":"account.d.mts","sourceRoot":"","sources":["../src/resources/account.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,KAAK,MAAM,qBAAiB;AACnC,OAAO,KAAK,aAAa,yBAAqB;AAC9C,OAAO,KAAK,UAAU,gCAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACjD,OAAO,EAAE,gBAAgB,EAAE,+BAA2B;AACtD,OAAO,EAAE,cA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B,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,CAAC,OAAO,WAAW,eAAe,CAAC;IACvC,OAAO,EACL,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,+BAA+B,IAAI,+BAA+B,GACxE,CAAC;CACH"}
@@ -1,7 +1,7 @@
1
1
  import { APIResource } from "../core/resource.js";
2
+ import * as APIKeysAPI from "./api-keys.js";
2
3
  import * as Shared from "./shared.js";
3
4
  import * as WorkspacesAPI from "./workspaces.js";
4
- import * as APIKeysAPI from "./api-keys/api-keys.js";
5
5
  import { APIPromise } from "../core/api-promise.js";
6
6
  import { CursorPagination } from "../core/pagination.js";
7
7
  import { RequestOptions } from "../internal/request-options.js";
@@ -58,9 +58,10 @@ export interface AccountInfo {
58
58
  */
59
59
  challengeToken?: string;
60
60
  /**
61
- * An API key for the account. Use workspace-association RPCs to grant the key
62
- * access to specific workspaces; a key with zero workspaces is valid but cannot
63
- * access workspace-scoped resources.
61
+ * An API key. Every key belongs to exactly one workspace and is managed via the
62
+ * workspace-scoped API key routes. The only exception is the system-managed global
63
+ * account key, which spans all workspaces and is managed via the account
64
+ * global_api_key routes.
64
65
  */
65
66
  globalApiKey?: APIKeysAPI.APIKey;
66
67
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../src/resources/account.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,KAAK,MAAM,oBAAiB;AACnC,OAAO,KAAK,aAAa,wBAAqB;AAC9C,OAAO,KAAK,UAAU,+BAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,gBAAgB,EAAE,8BAA2B;AACtD,OAAO,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C,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,CAAC,OAAO,WAAW,eAAe,CAAC;IACvC,OAAO,EACL,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,+BAA+B,IAAI,+BAA+B,GACxE,CAAC;CACH"}
@@ -1,2 +1,259 @@
1
- export * from "./api-keys/index.mjs";
1
+ import { APIResource } from "../core/resource.mjs";
2
+ import * as AccountAPI from "./account.mjs";
3
+ import * as Shared from "./shared.mjs";
4
+ import { APIPromise } from "../core/api-promise.mjs";
5
+ import { CursorPagination, type CursorPaginationParams, PagePromise } from "../core/pagination.mjs";
6
+ import { RequestOptions } from "../internal/request-options.mjs";
7
+ /**
8
+ * Issue, rotate, disable, and revoke a workspace's API keys. Every key
9
+ * belongs to exactly one workspace; the system-managed global account key is
10
+ * managed via GlobalAPIKeyService instead.
11
+ */
12
+ export declare class APIKeys extends APIResource {
13
+ /**
14
+ * Creates a new API key in the workspace.
15
+ */
16
+ create(workspaceID: string, body: APIKeyCreateParams, options?: RequestOptions): APIPromise<APIKey>;
17
+ /**
18
+ * Retrieves an API key by ID.
19
+ */
20
+ retrieve(id: string, params: APIKeyRetrieveParams, options?: RequestOptions): APIPromise<APIKey>;
21
+ /**
22
+ * Updates an API key.
23
+ */
24
+ update(id: string, params: APIKeyUpdateParams, options?: RequestOptions): APIPromise<APIKey>;
25
+ /**
26
+ * Lists the workspace's API keys.
27
+ */
28
+ list(workspaceID: string, query?: APIKeyListParams | null | undefined, options?: RequestOptions): PagePromise<APIKeysCursorPagination, APIKey>;
29
+ /**
30
+ * Deletes an API key.
31
+ */
32
+ delete(id: string, params: APIKeyDeleteParams, options?: RequestOptions): APIPromise<void>;
33
+ /**
34
+ * Disables an API key. While disabled, presenting the key's token fails
35
+ * authentication on every endpoint; the key is retained. Idempotent.
36
+ */
37
+ disable(id: string, params: APIKeyDisableParams, options?: RequestOptions): APIPromise<APIKey>;
38
+ /**
39
+ * Re-enables a disabled API key so its token authenticates again. Idempotent.
40
+ */
41
+ enable(id: string, params: APIKeyEnableParams, options?: RequestOptions): APIPromise<APIKey>;
42
+ /**
43
+ * Rotates an API key and returns a new token. All previous tokens for this key are
44
+ * invalidated.
45
+ */
46
+ rotate(id: string, params: APIKeyRotateParams, options?: RequestOptions): APIPromise<APIKey>;
47
+ }
48
+ export type APIKeysCursorPagination = CursorPagination<APIKey>;
49
+ /**
50
+ * An API key. Every key belongs to exactly one workspace and is managed via the
51
+ * workspace-scoped API key routes. The only exception is the system-managed global
52
+ * account key, which spans all workspaces and is managed via the account
53
+ * global_api_key routes.
54
+ */
55
+ export interface APIKey {
56
+ /**
57
+ * AccountResourceMetadata is used to represent a resource that is associated to an
58
+ * account but not to a workspace.
59
+ */
60
+ metadata: Shared.AccountResourceMetadata;
61
+ /**
62
+ * Configuration for an API key.
63
+ */
64
+ spec: APIKeySpec;
65
+ /**
66
+ * The current lifecycle state of the API key. Output only. Keys are created
67
+ * STATE_ENABLED; use the :disable and :enable actions to transition between
68
+ * states.
69
+ */
70
+ state: 'STATE_UNSPECIFIED' | 'STATE_ENABLED' | 'STATE_DISABLED';
71
+ info?: APIKeyInfo;
72
+ }
73
+ export interface APIKeyInfo {
74
+ /**
75
+ * A profile identifies a user or non-human principal (such as an API key) at the
76
+ * account level. Profiles are account-scoped and can be granted access to multiple
77
+ * workspaces.
78
+ */
79
+ createdBy?: AccountAPI.Profile;
80
+ }
81
+ /**
82
+ * Configuration for an API key.
83
+ */
84
+ export interface APIKeySpec {
85
+ /**
86
+ * The bearer token used to authenticate as this API key. Returned only on creation
87
+ * and rotation; subsequent reads omit this field.
88
+ */
89
+ token?: string;
90
+ /**
91
+ * Free-form description of what this API key is used for.
92
+ */
93
+ description?: string;
94
+ /**
95
+ * Scopes granted to this key. Each entry is a colon-separated resource:verb string
96
+ * (e.g. "objectives:manage").
97
+ *
98
+ * Resources: agents, objectives, tools, memory, api_keys, workspaces, secrets,
99
+ * account. Verbs: read and manage, where manage implies read — a stored scope set
100
+ * is normalized to drop "x:read" when "x:manage" is present. The secrets and
101
+ * account resources support only manage. "\*" is an explicit full-access grant.
102
+ *
103
+ * Scopes are deny-by-default: a key with an empty list can call only scope-free
104
+ * endpoints. Full access is always an explicit "\*" grant.
105
+ */
106
+ permissions?: Array<string>;
107
+ /**
108
+ * True when this key is managed by the system (i.e. the auto-provisioned global
109
+ * account key). System keys cannot be deleted but can be rotated.
110
+ */
111
+ system?: boolean;
112
+ }
113
+ export interface APIKeyCreateParams {
114
+ /**
115
+ * CreateAccountResourceMetadata contains the user-provided fields for creating an
116
+ * account-scoped resource. Read-only fields (id, account_id, profile_id) are
117
+ * excluded since they are set by the server.
118
+ */
119
+ metadata: APIKeyCreateParams.Metadata;
120
+ /**
121
+ * Configuration for an API key.
122
+ */
123
+ spec: APIKeySpec;
124
+ }
125
+ export declare namespace APIKeyCreateParams {
126
+ /**
127
+ * CreateAccountResourceMetadata contains the user-provided fields for creating an
128
+ * account-scoped resource. Read-only fields (id, account_id, profile_id) are
129
+ * excluded since they are set by the server.
130
+ */
131
+ interface Metadata {
132
+ /**
133
+ * Human-readable name for the resource (e.g., "Production API Key", "Staging
134
+ * Workspace")
135
+ */
136
+ name: string;
137
+ /**
138
+ * External ID for the resource (e.g., a workflow ID from an external system)
139
+ */
140
+ externalId?: string;
141
+ /**
142
+ * Key-value pairs for categorization and filtering. Values are 0-63 alphanumeric
143
+ * characters with "-", "\_", or "." allowed between; keys follow the same shape
144
+ * and additionally accept an optional DNS-subdomain prefix (e.g. "cadenya.com/")
145
+ * of at most 253 characters. Examples: {"environment": "production", "team":
146
+ * "platform", "version": "v2"}
147
+ */
148
+ labels?: {
149
+ [key: string]: string;
150
+ };
151
+ }
152
+ }
153
+ export interface APIKeyRetrieveParams {
154
+ /**
155
+ * The workspace the API key belongs to (path).
156
+ */
157
+ workspaceId: string;
158
+ }
159
+ export interface APIKeyUpdateParams {
160
+ /**
161
+ * Path param: The workspace the API key belongs to (path).
162
+ */
163
+ workspaceId: string;
164
+ /**
165
+ * Body param: UpdateAccountResourceMetadata contains the user-provided fields for
166
+ * updating an account-scoped resource. Read-only fields (id, account_id,
167
+ * profile_id) are excluded since they are set by the server.
168
+ */
169
+ metadata?: APIKeyUpdateParams.Metadata;
170
+ /**
171
+ * Body param: Configuration for an API key.
172
+ */
173
+ spec?: APIKeySpec;
174
+ /**
175
+ * Body param: Fields to update.
176
+ */
177
+ updateMask?: string;
178
+ }
179
+ export declare namespace APIKeyUpdateParams {
180
+ /**
181
+ * UpdateAccountResourceMetadata contains the user-provided fields for updating an
182
+ * account-scoped resource. Read-only fields (id, account_id, profile_id) are
183
+ * excluded since they are set by the server.
184
+ */
185
+ interface Metadata {
186
+ /**
187
+ * Human-readable name for the resource (e.g., "Production API Key", "Staging
188
+ * Workspace")
189
+ */
190
+ name: string;
191
+ /**
192
+ * External ID for the resource (e.g., a workflow ID from an external system)
193
+ */
194
+ externalId?: string;
195
+ /**
196
+ * Key-value pairs for categorization and filtering. Values are 0-63 alphanumeric
197
+ * characters with "-", "\_", or "." allowed between; keys follow the same shape
198
+ * and additionally accept an optional DNS-subdomain prefix (e.g. "cadenya.com/")
199
+ * of at most 253 characters. Examples: {"environment": "production", "team":
200
+ * "platform", "version": "v2"}
201
+ */
202
+ labels?: {
203
+ [key: string]: string;
204
+ };
205
+ }
206
+ }
207
+ export interface APIKeyListParams extends CursorPaginationParams {
208
+ /**
209
+ * When true, included info fields are populated. Requests with this flag count
210
+ * more against your rate limit.
211
+ */
212
+ includeInfo?: boolean;
213
+ /**
214
+ * Filters by metadata labels. Comma-separated key=value pairs, e.g.
215
+ * "env=prod,team=ai". A resource matches only if every pair matches exactly (AND
216
+ * semantics).
217
+ */
218
+ labels?: string;
219
+ /**
220
+ * Filter by ID prefix.
221
+ */
222
+ prefix?: string;
223
+ /**
224
+ * Free-form search query.
225
+ */
226
+ query?: string;
227
+ /**
228
+ * Sort order for results (asc or desc by creation time).
229
+ */
230
+ sortOrder?: string;
231
+ }
232
+ export interface APIKeyDeleteParams {
233
+ /**
234
+ * The workspace the API key belongs to (path).
235
+ */
236
+ workspaceId: string;
237
+ }
238
+ export interface APIKeyDisableParams {
239
+ /**
240
+ * The workspace the API key belongs to (path).
241
+ */
242
+ workspaceId: string;
243
+ }
244
+ export interface APIKeyEnableParams {
245
+ /**
246
+ * The workspace the API key belongs to (path).
247
+ */
248
+ workspaceId: string;
249
+ }
250
+ export interface APIKeyRotateParams {
251
+ /**
252
+ * The workspace the API key belongs to (path).
253
+ */
254
+ workspaceId: string;
255
+ }
256
+ export declare namespace APIKeys {
257
+ export { type APIKey as APIKey, type APIKeyInfo as APIKeyInfo, type APIKeySpec as APIKeySpec, type APIKeysCursorPagination as APIKeysCursorPagination, type APIKeyCreateParams as APIKeyCreateParams, type APIKeyRetrieveParams as APIKeyRetrieveParams, type APIKeyUpdateParams as APIKeyUpdateParams, type APIKeyListParams as APIKeyListParams, type APIKeyDeleteParams as APIKeyDeleteParams, type APIKeyDisableParams as APIKeyDisableParams, type APIKeyEnableParams as APIKeyEnableParams, type APIKeyRotateParams as APIKeyRotateParams, };
258
+ }
2
259
  //# 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,qCAAiC"}
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,KAAK,UAAU,sBAAkB;AACxC,OAAO,KAAK,MAAM,qBAAiB;AACnC,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACjD,OAAO,EAAE,gBAAgB,EAAE,KAA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B,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,EAC7C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
@@ -1,2 +1,259 @@
1
- export * from "./api-keys/index.js";
1
+ import { APIResource } from "../core/resource.js";
2
+ import * as AccountAPI from "./account.js";
3
+ import * as Shared from "./shared.js";
4
+ import { APIPromise } from "../core/api-promise.js";
5
+ import { CursorPagination, type CursorPaginationParams, PagePromise } from "../core/pagination.js";
6
+ import { RequestOptions } from "../internal/request-options.js";
7
+ /**
8
+ * Issue, rotate, disable, and revoke a workspace's API keys. Every key
9
+ * belongs to exactly one workspace; the system-managed global account key is
10
+ * managed via GlobalAPIKeyService instead.
11
+ */
12
+ export declare class APIKeys extends APIResource {
13
+ /**
14
+ * Creates a new API key in the workspace.
15
+ */
16
+ create(workspaceID: string, body: APIKeyCreateParams, options?: RequestOptions): APIPromise<APIKey>;
17
+ /**
18
+ * Retrieves an API key by ID.
19
+ */
20
+ retrieve(id: string, params: APIKeyRetrieveParams, options?: RequestOptions): APIPromise<APIKey>;
21
+ /**
22
+ * Updates an API key.
23
+ */
24
+ update(id: string, params: APIKeyUpdateParams, options?: RequestOptions): APIPromise<APIKey>;
25
+ /**
26
+ * Lists the workspace's API keys.
27
+ */
28
+ list(workspaceID: string, query?: APIKeyListParams | null | undefined, options?: RequestOptions): PagePromise<APIKeysCursorPagination, APIKey>;
29
+ /**
30
+ * Deletes an API key.
31
+ */
32
+ delete(id: string, params: APIKeyDeleteParams, options?: RequestOptions): APIPromise<void>;
33
+ /**
34
+ * Disables an API key. While disabled, presenting the key's token fails
35
+ * authentication on every endpoint; the key is retained. Idempotent.
36
+ */
37
+ disable(id: string, params: APIKeyDisableParams, options?: RequestOptions): APIPromise<APIKey>;
38
+ /**
39
+ * Re-enables a disabled API key so its token authenticates again. Idempotent.
40
+ */
41
+ enable(id: string, params: APIKeyEnableParams, options?: RequestOptions): APIPromise<APIKey>;
42
+ /**
43
+ * Rotates an API key and returns a new token. All previous tokens for this key are
44
+ * invalidated.
45
+ */
46
+ rotate(id: string, params: APIKeyRotateParams, options?: RequestOptions): APIPromise<APIKey>;
47
+ }
48
+ export type APIKeysCursorPagination = CursorPagination<APIKey>;
49
+ /**
50
+ * An API key. Every key belongs to exactly one workspace and is managed via the
51
+ * workspace-scoped API key routes. The only exception is the system-managed global
52
+ * account key, which spans all workspaces and is managed via the account
53
+ * global_api_key routes.
54
+ */
55
+ export interface APIKey {
56
+ /**
57
+ * AccountResourceMetadata is used to represent a resource that is associated to an
58
+ * account but not to a workspace.
59
+ */
60
+ metadata: Shared.AccountResourceMetadata;
61
+ /**
62
+ * Configuration for an API key.
63
+ */
64
+ spec: APIKeySpec;
65
+ /**
66
+ * The current lifecycle state of the API key. Output only. Keys are created
67
+ * STATE_ENABLED; use the :disable and :enable actions to transition between
68
+ * states.
69
+ */
70
+ state: 'STATE_UNSPECIFIED' | 'STATE_ENABLED' | 'STATE_DISABLED';
71
+ info?: APIKeyInfo;
72
+ }
73
+ export interface APIKeyInfo {
74
+ /**
75
+ * A profile identifies a user or non-human principal (such as an API key) at the
76
+ * account level. Profiles are account-scoped and can be granted access to multiple
77
+ * workspaces.
78
+ */
79
+ createdBy?: AccountAPI.Profile;
80
+ }
81
+ /**
82
+ * Configuration for an API key.
83
+ */
84
+ export interface APIKeySpec {
85
+ /**
86
+ * The bearer token used to authenticate as this API key. Returned only on creation
87
+ * and rotation; subsequent reads omit this field.
88
+ */
89
+ token?: string;
90
+ /**
91
+ * Free-form description of what this API key is used for.
92
+ */
93
+ description?: string;
94
+ /**
95
+ * Scopes granted to this key. Each entry is a colon-separated resource:verb string
96
+ * (e.g. "objectives:manage").
97
+ *
98
+ * Resources: agents, objectives, tools, memory, api_keys, workspaces, secrets,
99
+ * account. Verbs: read and manage, where manage implies read — a stored scope set
100
+ * is normalized to drop "x:read" when "x:manage" is present. The secrets and
101
+ * account resources support only manage. "\*" is an explicit full-access grant.
102
+ *
103
+ * Scopes are deny-by-default: a key with an empty list can call only scope-free
104
+ * endpoints. Full access is always an explicit "\*" grant.
105
+ */
106
+ permissions?: Array<string>;
107
+ /**
108
+ * True when this key is managed by the system (i.e. the auto-provisioned global
109
+ * account key). System keys cannot be deleted but can be rotated.
110
+ */
111
+ system?: boolean;
112
+ }
113
+ export interface APIKeyCreateParams {
114
+ /**
115
+ * CreateAccountResourceMetadata contains the user-provided fields for creating an
116
+ * account-scoped resource. Read-only fields (id, account_id, profile_id) are
117
+ * excluded since they are set by the server.
118
+ */
119
+ metadata: APIKeyCreateParams.Metadata;
120
+ /**
121
+ * Configuration for an API key.
122
+ */
123
+ spec: APIKeySpec;
124
+ }
125
+ export declare namespace APIKeyCreateParams {
126
+ /**
127
+ * CreateAccountResourceMetadata contains the user-provided fields for creating an
128
+ * account-scoped resource. Read-only fields (id, account_id, profile_id) are
129
+ * excluded since they are set by the server.
130
+ */
131
+ interface Metadata {
132
+ /**
133
+ * Human-readable name for the resource (e.g., "Production API Key", "Staging
134
+ * Workspace")
135
+ */
136
+ name: string;
137
+ /**
138
+ * External ID for the resource (e.g., a workflow ID from an external system)
139
+ */
140
+ externalId?: string;
141
+ /**
142
+ * Key-value pairs for categorization and filtering. Values are 0-63 alphanumeric
143
+ * characters with "-", "\_", or "." allowed between; keys follow the same shape
144
+ * and additionally accept an optional DNS-subdomain prefix (e.g. "cadenya.com/")
145
+ * of at most 253 characters. Examples: {"environment": "production", "team":
146
+ * "platform", "version": "v2"}
147
+ */
148
+ labels?: {
149
+ [key: string]: string;
150
+ };
151
+ }
152
+ }
153
+ export interface APIKeyRetrieveParams {
154
+ /**
155
+ * The workspace the API key belongs to (path).
156
+ */
157
+ workspaceId: string;
158
+ }
159
+ export interface APIKeyUpdateParams {
160
+ /**
161
+ * Path param: The workspace the API key belongs to (path).
162
+ */
163
+ workspaceId: string;
164
+ /**
165
+ * Body param: UpdateAccountResourceMetadata contains the user-provided fields for
166
+ * updating an account-scoped resource. Read-only fields (id, account_id,
167
+ * profile_id) are excluded since they are set by the server.
168
+ */
169
+ metadata?: APIKeyUpdateParams.Metadata;
170
+ /**
171
+ * Body param: Configuration for an API key.
172
+ */
173
+ spec?: APIKeySpec;
174
+ /**
175
+ * Body param: Fields to update.
176
+ */
177
+ updateMask?: string;
178
+ }
179
+ export declare namespace APIKeyUpdateParams {
180
+ /**
181
+ * UpdateAccountResourceMetadata contains the user-provided fields for updating an
182
+ * account-scoped resource. Read-only fields (id, account_id, profile_id) are
183
+ * excluded since they are set by the server.
184
+ */
185
+ interface Metadata {
186
+ /**
187
+ * Human-readable name for the resource (e.g., "Production API Key", "Staging
188
+ * Workspace")
189
+ */
190
+ name: string;
191
+ /**
192
+ * External ID for the resource (e.g., a workflow ID from an external system)
193
+ */
194
+ externalId?: string;
195
+ /**
196
+ * Key-value pairs for categorization and filtering. Values are 0-63 alphanumeric
197
+ * characters with "-", "\_", or "." allowed between; keys follow the same shape
198
+ * and additionally accept an optional DNS-subdomain prefix (e.g. "cadenya.com/")
199
+ * of at most 253 characters. Examples: {"environment": "production", "team":
200
+ * "platform", "version": "v2"}
201
+ */
202
+ labels?: {
203
+ [key: string]: string;
204
+ };
205
+ }
206
+ }
207
+ export interface APIKeyListParams extends CursorPaginationParams {
208
+ /**
209
+ * When true, included info fields are populated. Requests with this flag count
210
+ * more against your rate limit.
211
+ */
212
+ includeInfo?: boolean;
213
+ /**
214
+ * Filters by metadata labels. Comma-separated key=value pairs, e.g.
215
+ * "env=prod,team=ai". A resource matches only if every pair matches exactly (AND
216
+ * semantics).
217
+ */
218
+ labels?: string;
219
+ /**
220
+ * Filter by ID prefix.
221
+ */
222
+ prefix?: string;
223
+ /**
224
+ * Free-form search query.
225
+ */
226
+ query?: string;
227
+ /**
228
+ * Sort order for results (asc or desc by creation time).
229
+ */
230
+ sortOrder?: string;
231
+ }
232
+ export interface APIKeyDeleteParams {
233
+ /**
234
+ * The workspace the API key belongs to (path).
235
+ */
236
+ workspaceId: string;
237
+ }
238
+ export interface APIKeyDisableParams {
239
+ /**
240
+ * The workspace the API key belongs to (path).
241
+ */
242
+ workspaceId: string;
243
+ }
244
+ export interface APIKeyEnableParams {
245
+ /**
246
+ * The workspace the API key belongs to (path).
247
+ */
248
+ workspaceId: string;
249
+ }
250
+ export interface APIKeyRotateParams {
251
+ /**
252
+ * The workspace the API key belongs to (path).
253
+ */
254
+ workspaceId: string;
255
+ }
256
+ export declare namespace APIKeys {
257
+ export { type APIKey as APIKey, type APIKeyInfo as APIKeyInfo, type APIKeySpec as APIKeySpec, type APIKeysCursorPagination as APIKeysCursorPagination, type APIKeyCreateParams as APIKeyCreateParams, type APIKeyRetrieveParams as APIKeyRetrieveParams, type APIKeyUpdateParams as APIKeyUpdateParams, type APIKeyListParams as APIKeyListParams, type APIKeyDeleteParams as APIKeyDeleteParams, type APIKeyDisableParams as APIKeyDisableParams, type APIKeyEnableParams as APIKeyEnableParams, type APIKeyRotateParams as APIKeyRotateParams, };
258
+ }
2
259
  //# 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,oCAAiC"}
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,KAAK,UAAU,qBAAkB;AACxC,OAAO,KAAK,MAAM,oBAAiB;AACnC,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,WAAW,EAAE,8BAA2B;AAEhG,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KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
@@ -1,6 +1,82 @@
1
1
  "use strict";
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- const tslib_1 = require("../internal/tslib.js");
5
- tslib_1.__exportStar(require("./api-keys/index.js"), exports);
4
+ exports.APIKeys = 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, disable, and revoke a workspace's API keys. Every key
11
+ * belongs to exactly one workspace; the system-managed global account key is
12
+ * managed via GlobalAPIKeyService instead.
13
+ */
14
+ class APIKeys extends resource_1.APIResource {
15
+ /**
16
+ * Creates a new API key in the workspace.
17
+ */
18
+ create(workspaceID, body, options) {
19
+ return this._client.post((0, path_1.path) `/v1/workspaces/${workspaceID}/api_keys`, { body, ...options });
20
+ }
21
+ /**
22
+ * Retrieves an API key by ID.
23
+ */
24
+ retrieve(id, params, options) {
25
+ const { workspaceId } = params;
26
+ return this._client.get((0, path_1.path) `/v1/workspaces/${workspaceId}/api_keys/${id}`, options);
27
+ }
28
+ /**
29
+ * Updates an API key.
30
+ */
31
+ update(id, params, options) {
32
+ const { workspaceId, ...body } = params;
33
+ return this._client.patch((0, path_1.path) `/v1/workspaces/${workspaceId}/api_keys/${id}`, { body, ...options });
34
+ }
35
+ /**
36
+ * Lists the workspace's API keys.
37
+ */
38
+ list(workspaceID, query = {}, options) {
39
+ return this._client.getAPIList((0, path_1.path) `/v1/workspaces/${workspaceID}/api_keys`, (pagination_1.CursorPagination), {
40
+ query,
41
+ ...options,
42
+ });
43
+ }
44
+ /**
45
+ * Deletes an API key.
46
+ */
47
+ delete(id, params, options) {
48
+ const { workspaceId } = params;
49
+ return this._client.delete((0, path_1.path) `/v1/workspaces/${workspaceId}/api_keys/${id}`, {
50
+ ...options,
51
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
52
+ });
53
+ }
54
+ /**
55
+ * Disables an API key. While disabled, presenting the key's token fails
56
+ * authentication on every endpoint; the key is retained. Idempotent.
57
+ */
58
+ disable(id, params, options) {
59
+ const { workspaceId, ...body } = params;
60
+ return this._client.post((0, path_1.path) `/v1/workspaces/${workspaceId}/api_keys/${id}:disable`, {
61
+ body,
62
+ ...options,
63
+ });
64
+ }
65
+ /**
66
+ * Re-enables a disabled API key so its token authenticates again. Idempotent.
67
+ */
68
+ enable(id, params, options) {
69
+ const { workspaceId, ...body } = params;
70
+ return this._client.post((0, path_1.path) `/v1/workspaces/${workspaceId}/api_keys/${id}:enable`, { body, ...options });
71
+ }
72
+ /**
73
+ * Rotates an API key and returns a new token. All previous tokens for this key are
74
+ * invalidated.
75
+ */
76
+ rotate(id, params, options) {
77
+ const { workspaceId, ...body } = params;
78
+ return this._client.post((0, path_1.path) `/v1/workspaces/${workspaceId}/api_keys/${id}:rotate`, { body, ...options });
79
+ }
80
+ }
81
+ exports.APIKeys = APIKeys;
6
82
  //# sourceMappingURL=api-keys.js.map