@cadenya/cadenya 0.68.0 → 0.70.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 (68) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/client.d.mts +6 -6
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +6 -6
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -3
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -3
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/account.d.mts +17 -12
  12. package/resources/account.d.mts.map +1 -1
  13. package/resources/account.d.ts +17 -12
  14. package/resources/account.d.ts.map +1 -1
  15. package/resources/account.js.map +1 -1
  16. package/resources/account.mjs.map +1 -1
  17. package/resources/api-keys/access.d.mts +47 -0
  18. package/resources/api-keys/access.d.mts.map +1 -0
  19. package/resources/api-keys/access.d.ts +47 -0
  20. package/resources/api-keys/access.d.ts.map +1 -0
  21. package/resources/api-keys/access.js +41 -0
  22. package/resources/api-keys/access.js.map +1 -0
  23. package/resources/api-keys/access.mjs +37 -0
  24. package/resources/api-keys/access.mjs.map +1 -0
  25. package/resources/api-keys/api-keys.d.mts +213 -0
  26. package/resources/api-keys/api-keys.d.mts.map +1 -0
  27. package/resources/api-keys/api-keys.d.ts +213 -0
  28. package/resources/api-keys/api-keys.d.ts.map +1 -0
  29. package/resources/api-keys/api-keys.js +65 -0
  30. package/resources/api-keys/api-keys.js.map +1 -0
  31. package/resources/api-keys/api-keys.mjs +60 -0
  32. package/resources/api-keys/api-keys.mjs.map +1 -0
  33. package/resources/api-keys/index.d.mts +3 -0
  34. package/resources/api-keys/index.d.mts.map +1 -0
  35. package/resources/api-keys/index.d.ts +3 -0
  36. package/resources/api-keys/index.d.ts.map +1 -0
  37. package/resources/api-keys/index.js +9 -0
  38. package/resources/api-keys/index.js.map +1 -0
  39. package/resources/api-keys/index.mjs +4 -0
  40. package/resources/api-keys/index.mjs.map +1 -0
  41. package/resources/api-keys.d.mts +1 -151
  42. package/resources/api-keys.d.mts.map +1 -1
  43. package/resources/api-keys.d.ts +1 -151
  44. package/resources/api-keys.d.ts.map +1 -1
  45. package/resources/api-keys.js +2 -59
  46. package/resources/api-keys.js.map +1 -1
  47. package/resources/api-keys.mjs +1 -57
  48. package/resources/api-keys.mjs.map +1 -1
  49. package/resources/index.d.mts +2 -2
  50. package/resources/index.d.mts.map +1 -1
  51. package/resources/index.d.ts +2 -2
  52. package/resources/index.d.ts.map +1 -1
  53. package/resources/index.js +1 -1
  54. package/resources/index.js.map +1 -1
  55. package/resources/index.mjs +1 -1
  56. package/resources/index.mjs.map +1 -1
  57. package/src/client.ts +14 -18
  58. package/src/resources/account.ts +18 -11
  59. package/src/resources/api-keys/access.ts +79 -0
  60. package/src/resources/api-keys/api-keys.ts +282 -0
  61. package/src/resources/api-keys/index.ts +13 -0
  62. package/src/resources/api-keys.ts +1 -218
  63. package/src/resources/index.ts +2 -4
  64. package/src/version.ts +1 -1
  65. package/version.d.mts +1 -1
  66. package/version.d.ts +1 -1
  67. package/version.js +1 -1
  68. package/version.mjs +1 -1
@@ -0,0 +1,213 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import * as AccountAPI from "../account.js";
3
+ import * as Shared from "../shared.js";
4
+ import * as AccessAPI from "./access.js";
5
+ import { Access, AccessAddParams, AccessListParams, AccessRemoveParams } from "./access.js";
6
+ import { APIPromise } from "../../core/api-promise.js";
7
+ import { CursorPagination, type CursorPaginationParams, PagePromise } from "../../core/pagination.js";
8
+ import { RequestOptions } from "../../internal/request-options.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
+ export declare class APIKeys extends APIResource {
14
+ access: AccessAPI.Access;
15
+ /**
16
+ * Creates a new API key on the account. Optionally grants the key access to one or
17
+ * more workspaces via initial_workspace_ids.
18
+ */
19
+ create(body: APIKeyCreateParams, options?: RequestOptions): APIPromise<APIKey>;
20
+ /**
21
+ * Retrieves an API key by ID.
22
+ */
23
+ retrieve(id: string, options?: RequestOptions): APIPromise<APIKey>;
24
+ /**
25
+ * Updates an API key.
26
+ */
27
+ update(id: string, body: APIKeyUpdateParams, options?: RequestOptions): APIPromise<APIKey>;
28
+ /**
29
+ * Lists all API keys on the account.
30
+ */
31
+ list(query?: APIKeyListParams | null | undefined, options?: RequestOptions): PagePromise<APIKeysCursorPagination, APIKey>;
32
+ /**
33
+ * Deletes an API key.
34
+ */
35
+ delete(id: string, options?: RequestOptions): APIPromise<void>;
36
+ /**
37
+ * Rotates an API key and returns a new token. All previous tokens for this key are
38
+ * invalidated.
39
+ */
40
+ rotate(id: string, options?: RequestOptions): APIPromise<APIKey>;
41
+ }
42
+ export type APIKeysCursorPagination = CursorPagination<APIKey>;
43
+ /**
44
+ * An API key for the account. Use workspace-association RPCs to grant the key
45
+ * access to specific workspaces; a key with zero workspaces is valid but cannot
46
+ * access workspace-scoped resources.
47
+ */
48
+ export interface APIKey {
49
+ /**
50
+ * AccountResourceMetadata is used to represent a resource that is associated to an
51
+ * account but not to a workspace.
52
+ */
53
+ metadata: Shared.AccountResourceMetadata;
54
+ /**
55
+ * Configuration for an API key.
56
+ */
57
+ spec: APIKeySpec;
58
+ info?: APIKeyInfo;
59
+ }
60
+ export interface APIKeyInfo {
61
+ /**
62
+ * A profile identifies a user or non-human principal (such as an API key) at the
63
+ * account level. Profiles are account-scoped and can be granted access to multiple
64
+ * workspaces.
65
+ */
66
+ createdBy?: AccountAPI.Profile;
67
+ /**
68
+ * Up to a small number of workspaces this key has access to, intended for display
69
+ * ("Workspace 1, Workspace 2, and 4 more"). Use ListAPIKeyWorkspaces for the full
70
+ * paginated list.
71
+ */
72
+ workspacesPreview?: Array<Shared.BareMetadata>;
73
+ /**
74
+ * Total number of workspaces this key has access to.
75
+ */
76
+ workspacesTotal?: number;
77
+ }
78
+ /**
79
+ * Configuration for an API key.
80
+ */
81
+ export interface APIKeySpec {
82
+ /**
83
+ * The bearer token used to authenticate as this API key. Returned only on creation
84
+ * and rotation; subsequent reads omit this field.
85
+ */
86
+ token?: string;
87
+ /**
88
+ * Free-form description of what this API key is used for.
89
+ */
90
+ description?: string;
91
+ /**
92
+ * Permissions granted to this key. Each entry is a colon-separated verb:resource
93
+ * string (e.g. "manage:agents"). Currently has no enforced effect; reserved for
94
+ * future fine-grained authorization.
95
+ */
96
+ permissions?: Array<string>;
97
+ /**
98
+ * True when this key is managed by the system (e.g. the auto-provisioned global
99
+ * account key). System keys cannot be deleted but can be rotated.
100
+ */
101
+ system?: boolean;
102
+ }
103
+ export interface APIKeyCreateParams {
104
+ /**
105
+ * CreateAccountResourceMetadata contains the user-provided fields for creating an
106
+ * account-scoped resource. Read-only fields (id, account_id, profile_id) are
107
+ * excluded since they are set by the server.
108
+ */
109
+ metadata: APIKeyCreateParams.Metadata;
110
+ /**
111
+ * Configuration for an API key.
112
+ */
113
+ spec: APIKeySpec;
114
+ /**
115
+ * Workspaces this API key will have access to on creation. Optional — a key can be
116
+ * created with no workspace access and granted later via AddAPIKeyWorkspace.
117
+ */
118
+ initialWorkspaceIds?: Array<string>;
119
+ }
120
+ export declare namespace APIKeyCreateParams {
121
+ /**
122
+ * CreateAccountResourceMetadata contains the user-provided fields for creating an
123
+ * account-scoped resource. Read-only fields (id, account_id, profile_id) are
124
+ * excluded since they are set by the server.
125
+ */
126
+ interface Metadata {
127
+ /**
128
+ * Human-readable name for the resource (e.g., "Production API Key", "Staging
129
+ * Workspace")
130
+ */
131
+ name: string;
132
+ /**
133
+ * External ID for the resource (e.g., a workflow ID from an external system)
134
+ */
135
+ externalId?: string;
136
+ /**
137
+ * Arbitrary key-value pairs for categorization and filtering Examples:
138
+ * {"environment": "production", "team": "platform", "version": "v2"}
139
+ */
140
+ labels?: {
141
+ [key: string]: string;
142
+ };
143
+ }
144
+ }
145
+ export interface APIKeyUpdateParams {
146
+ /**
147
+ * UpdateAccountResourceMetadata contains the user-provided fields for updating an
148
+ * account-scoped resource. Read-only fields (id, account_id, profile_id) are
149
+ * excluded since they are set by the server.
150
+ */
151
+ metadata?: APIKeyUpdateParams.Metadata;
152
+ /**
153
+ * Configuration for an API key.
154
+ */
155
+ spec?: APIKeySpec;
156
+ /**
157
+ * Fields to update.
158
+ */
159
+ updateMask?: string;
160
+ }
161
+ export declare namespace APIKeyUpdateParams {
162
+ /**
163
+ * UpdateAccountResourceMetadata contains the user-provided fields for updating an
164
+ * account-scoped resource. Read-only fields (id, account_id, profile_id) are
165
+ * excluded since they are set by the server.
166
+ */
167
+ interface Metadata {
168
+ /**
169
+ * Human-readable name for the resource (e.g., "Production API Key", "Staging
170
+ * Workspace")
171
+ */
172
+ name: string;
173
+ /**
174
+ * External ID for the resource (e.g., a workflow ID from an external system)
175
+ */
176
+ externalId?: string;
177
+ /**
178
+ * Arbitrary key-value pairs for categorization and filtering Examples:
179
+ * {"environment": "production", "team": "platform", "version": "v2"}
180
+ */
181
+ labels?: {
182
+ [key: string]: string;
183
+ };
184
+ }
185
+ }
186
+ export interface APIKeyListParams extends CursorPaginationParams {
187
+ /**
188
+ * Filter by bundle_key — return only resources owned by this bundle.
189
+ */
190
+ bundleKey?: string;
191
+ /**
192
+ * When true, included info fields are populated. Requests with this flag count
193
+ * more against your rate limit.
194
+ */
195
+ includeInfo?: boolean;
196
+ /**
197
+ * Filter by ID prefix.
198
+ */
199
+ prefix?: string;
200
+ /**
201
+ * Free-form search query.
202
+ */
203
+ query?: string;
204
+ /**
205
+ * Sort order for results (asc or desc by creation time).
206
+ */
207
+ sortOrder?: string;
208
+ }
209
+ export declare namespace APIKeys {
210
+ export { type APIKey as APIKey, type APIKeyInfo as APIKeyInfo, type APIKeySpec as APIKeySpec, type APIKeysCursorPagination as APIKeysCursorPagination, type APIKeyCreateParams as APIKeyCreateParams, type APIKeyUpdateParams as APIKeyUpdateParams, type APIKeyListParams as APIKeyListParams, };
211
+ export { Access as Access, type AccessListParams as AccessListParams, type AccessAddParams as AccessAddParams, type AccessRemoveParams as AccessRemoveParams, };
212
+ }
213
+ //# sourceMappingURL=api-keys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-keys.d.ts","sourceRoot":"","sources":["../../src/resources/api-keys/api-keys.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,KAAK,MAAM;OACX,KAAK,SAAS;OACd,EAAE,MAAM,EAAE,eAAe,EAAE,gBAAgB,EAAE,kBAAkB,EAAE;OACjE,EAAE,UAAU,EAAE;OACd,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,WAAW,EAAE;OAE9D,EAAE,cAAc,EAAE;AAGzB;;;GAGG;AACH,qBAAa,OAAQ,SAAQ,WAAW;IACtC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAsC;IAE9D;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAI9E;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAIlE;;OAEG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAI1F;;OAEG;IACH,IAAI,CACF,KAAK,GAAE,gBAAgB,GAAG,IAAI,GAAG,SAAc,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,uBAAuB,EAAE,MAAM,CAAC;IAI/C;;OAEG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAO9D;;;OAGG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;CA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API spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.APIKeys = void 0;
5
+ const tslib_1 = require("../../internal/tslib.js");
6
+ const resource_1 = require("../../core/resource.js");
7
+ const AccessAPI = tslib_1.__importStar(require("./access.js"));
8
+ const access_1 = require("./access.js");
9
+ const pagination_1 = require("../../core/pagination.js");
10
+ const headers_1 = require("../../internal/headers.js");
11
+ const path_1 = require("../../internal/utils/path.js");
12
+ /**
13
+ * Issue, rotate, and revoke API keys for the account, and grant or revoke
14
+ * each key's access to individual workspaces.
15
+ */
16
+ class APIKeys extends resource_1.APIResource {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.access = new AccessAPI.Access(this._client);
20
+ }
21
+ /**
22
+ * Creates a new API key on the account. Optionally grants the key access to one or
23
+ * more workspaces via initial_workspace_ids.
24
+ */
25
+ create(body, options) {
26
+ return this._client.post('/v1/account/api_keys', { body, ...options });
27
+ }
28
+ /**
29
+ * Retrieves an API key by ID.
30
+ */
31
+ retrieve(id, options) {
32
+ return this._client.get((0, path_1.path) `/v1/account/api_keys/${id}`, options);
33
+ }
34
+ /**
35
+ * Updates an API key.
36
+ */
37
+ update(id, body, options) {
38
+ return this._client.patch((0, path_1.path) `/v1/account/api_keys/${id}`, { body, ...options });
39
+ }
40
+ /**
41
+ * Lists all API keys on the account.
42
+ */
43
+ list(query = {}, options) {
44
+ return this._client.getAPIList('/v1/account/api_keys', (pagination_1.CursorPagination), { query, ...options });
45
+ }
46
+ /**
47
+ * Deletes an API key.
48
+ */
49
+ delete(id, options) {
50
+ return this._client.delete((0, path_1.path) `/v1/account/api_keys/${id}`, {
51
+ ...options,
52
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
53
+ });
54
+ }
55
+ /**
56
+ * Rotates an API key and returns a new token. All previous tokens for this key are
57
+ * invalidated.
58
+ */
59
+ rotate(id, options) {
60
+ return this._client.put((0, path_1.path) `/v1/account/api_keys/${id}/rotate`, options);
61
+ }
62
+ }
63
+ exports.APIKeys = APIKeys;
64
+ APIKeys.Access = access_1.Access;
65
+ //# sourceMappingURL=api-keys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-keys.js","sourceRoot":"","sources":["../../src/resources/api-keys/api-keys.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAGlD,+DAAsC;AACtC,wCAAyF;AAEzF,yDAAmG;AACnG,uDAAsD;AAEtD,uDAAiD;AAEjD;;;GAGG;AACH,MAAa,OAAQ,SAAQ,sBAAW;IAAxC;;QACE,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAmDhE,CAAC;IAjDC;;;OAGG;IACH,MAAM,CAAC,IAAwB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,wBAAwB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACrE,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,EAAU,EAAE,IAAwB,EAAE,OAAwB;QACnE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,wBAAwB,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpF,CAAC;IAED;;OAEG;IACH,IAAI,CACF,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,sBAAsB,EAAE,CAAA,6BAAwB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1G,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,EAAU,EAAE,OAAwB;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,wBAAwB,EAAE,EAAE,EAAE;YAC3D,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;IAED;;;OAGG;IACH,MAAM,CAAC,EAAU,EAAE,OAAwB;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,wBAAwB,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC;CACF;AApDD,0BAoDC;AAiMD,OAAO,CAAC,MAAM,GAAG,eAAM,CAAC"}
@@ -0,0 +1,60 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ import * as AccessAPI from "./access.mjs";
4
+ import { Access } from "./access.mjs";
5
+ import { CursorPagination } from "../../core/pagination.mjs";
6
+ import { buildHeaders } from "../../internal/headers.mjs";
7
+ import { path } from "../../internal/utils/path.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 class APIKeys extends APIResource {
13
+ constructor() {
14
+ super(...arguments);
15
+ this.access = new AccessAPI.Access(this._client);
16
+ }
17
+ /**
18
+ * Creates a new API key on the account. Optionally grants the key access to one or
19
+ * more workspaces via initial_workspace_ids.
20
+ */
21
+ create(body, options) {
22
+ return this._client.post('/v1/account/api_keys', { body, ...options });
23
+ }
24
+ /**
25
+ * Retrieves an API key by ID.
26
+ */
27
+ retrieve(id, options) {
28
+ return this._client.get(path `/v1/account/api_keys/${id}`, options);
29
+ }
30
+ /**
31
+ * Updates an API key.
32
+ */
33
+ update(id, body, options) {
34
+ return this._client.patch(path `/v1/account/api_keys/${id}`, { body, ...options });
35
+ }
36
+ /**
37
+ * Lists all API keys on the account.
38
+ */
39
+ list(query = {}, options) {
40
+ return this._client.getAPIList('/v1/account/api_keys', (CursorPagination), { query, ...options });
41
+ }
42
+ /**
43
+ * Deletes an API key.
44
+ */
45
+ delete(id, options) {
46
+ return this._client.delete(path `/v1/account/api_keys/${id}`, {
47
+ ...options,
48
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
49
+ });
50
+ }
51
+ /**
52
+ * Rotates an API key and returns a new token. All previous tokens for this key are
53
+ * invalidated.
54
+ */
55
+ rotate(id, options) {
56
+ return this._client.put(path `/v1/account/api_keys/${id}/rotate`, options);
57
+ }
58
+ }
59
+ APIKeys.Access = Access;
60
+ //# sourceMappingURL=api-keys.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-keys.mjs","sourceRoot":"","sources":["../../src/resources/api-keys/api-keys.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,KAAK,SAAS;OACd,EAAE,MAAM,EAAyD;OAEjE,EAAE,gBAAgB,EAA4C;OAC9D,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf;;;GAGG;AACH,MAAM,OAAO,OAAQ,SAAQ,WAAW;IAAxC;;QACE,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAmDhE,CAAC;IAjDC;;;OAGG;IACH,MAAM,CAAC,IAAwB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,wBAAwB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACrE,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,EAAU,EAAE,IAAwB,EAAE,OAAwB;QACnE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,wBAAwB,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpF,CAAC;IAED;;OAEG;IACH,IAAI,CACF,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,sBAAsB,EAAE,CAAA,gBAAwB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1G,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,EAAU,EAAE,OAAwB;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,wBAAwB,EAAE,EAAE,EAAE;YAC3D,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,EAAU,EAAE,OAAwB;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,wBAAwB,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC;CACF;AAiMD,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { APIKeys, type APIKey, type APIKeyInfo, type APIKeySpec, type APIKeyCreateParams, type APIKeyUpdateParams, type APIKeyListParams, type APIKeysCursorPagination, } from "./api-keys.mjs";
2
+ export { Access, type AccessListParams, type AccessAddParams, type AccessRemoveParams } from "./access.mjs";
3
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/api-keys/index.ts"],"names":[],"mappings":"OAEO,EACL,OAAO,EACP,KAAK,MAAM,EACX,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,GAC7B;OACM,EAAE,MAAM,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,KAAK,kBAAkB,EAAE"}
@@ -0,0 +1,3 @@
1
+ export { APIKeys, type APIKey, type APIKeyInfo, type APIKeySpec, type APIKeyCreateParams, type APIKeyUpdateParams, type APIKeyListParams, type APIKeysCursorPagination, } from "./api-keys.js";
2
+ export { Access, type AccessListParams, type AccessAddParams, type AccessRemoveParams } from "./access.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/api-keys/index.ts"],"names":[],"mappings":"OAEO,EACL,OAAO,EACP,KAAK,MAAM,EACX,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,GAC7B;OACM,EAAE,MAAM,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,KAAK,kBAAkB,EAAE"}
@@ -0,0 +1,9 @@
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 = exports.APIKeys = void 0;
5
+ var api_keys_1 = require("./api-keys.js");
6
+ Object.defineProperty(exports, "APIKeys", { enumerable: true, get: function () { return api_keys_1.APIKeys; } });
7
+ var access_1 = require("./access.js");
8
+ Object.defineProperty(exports, "Access", { enumerable: true, get: function () { return access_1.Access; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/api-keys/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,0CASoB;AARlB,mGAAA,OAAO,OAAA;AAST,sCAAwG;AAA/F,gGAAA,MAAM,OAAA"}
@@ -0,0 +1,4 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export { APIKeys, } from "./api-keys.mjs";
3
+ export { Access } from "./access.mjs";
4
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/api-keys/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,OAAO,GAQR;OACM,EAAE,MAAM,EAAwE"}
@@ -1,152 +1,2 @@
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, and revoke API keys for a workspace. Each API key belongs to
9
- * exactly one workspace, ensuring isolation between environments.
10
- */
11
- export declare class APIKeys extends APIResource {
12
- /**
13
- * Creates a new API key in the workspace.
14
- */
15
- create(workspaceID: string, body: APIKeyCreateParams, options?: RequestOptions): APIPromise<APIKey>;
16
- /**
17
- * Retrieves an API key by ID from the workspace
18
- */
19
- retrieve(id: string, params: APIKeyRetrieveParams, options?: RequestOptions): APIPromise<APIKey>;
20
- /**
21
- * Updates an API key in the workspace
22
- */
23
- update(id: string, params: APIKeyUpdateParams, options?: RequestOptions): APIPromise<APIKey>;
24
- /**
25
- * Lists all API keys in the workspace
26
- */
27
- list(workspaceID: string, query?: APIKeyListParams | null | undefined, options?: RequestOptions): PagePromise<APIKeysCursorPagination, APIKey>;
28
- /**
29
- * Deletes an API key from the workspace
30
- */
31
- delete(id: string, params: APIKeyDeleteParams, options?: RequestOptions): APIPromise<void>;
32
- /**
33
- * Rotates an API Key and returns a new token. All previous API Key tokens in use
34
- * will be invalidated.
35
- */
36
- rotate(id: string, params: APIKeyRotateParams, options?: RequestOptions): APIPromise<APIKey>;
37
- }
38
- export type APIKeysCursorPagination = CursorPagination<APIKey>;
39
- /**
40
- * An API key scoped to a single workspace. The key's token is used to authenticate
41
- * requests against that workspace's resources.
42
- */
43
- export interface APIKey {
44
- /**
45
- * Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
46
- */
47
- metadata: Shared.ResourceMetadata;
48
- /**
49
- * Configuration for an API key.
50
- */
51
- spec: APIKeySpec;
52
- info?: APIKeyInfo;
53
- }
54
- export interface APIKeyInfo {
55
- /**
56
- * A profile identifies a user or non-human principal (such as an API key) at the
57
- * account level. Profiles are account-scoped and can be granted access to multiple
58
- * workspaces.
59
- */
60
- createdBy?: AccountAPI.Profile;
61
- }
62
- /**
63
- * Configuration for an API key.
64
- */
65
- export interface APIKeySpec {
66
- /**
67
- * The bearer token used to authenticate as this API key. Returned only on creation
68
- * and rotation; subsequent reads omit this field.
69
- */
70
- token?: string;
71
- /**
72
- * Free-form description of what this API key is used for.
73
- */
74
- description?: string;
75
- }
76
- export interface APIKeyCreateParams {
77
- /**
78
- * CreateResourceMetadata contains the user-provided fields for creating a
79
- * workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
80
- * profile_id, created_at) are excluded since they are set by the server.
81
- */
82
- metadata: Shared.CreateResourceMetadata;
83
- /**
84
- * Configuration for an API key.
85
- */
86
- spec: APIKeySpec;
87
- }
88
- export interface APIKeyRetrieveParams {
89
- /**
90
- * The workspace the API key belongs to.
91
- */
92
- workspaceId: string;
93
- }
94
- export interface APIKeyUpdateParams {
95
- /**
96
- * Path param: The workspace the API key belongs to.
97
- */
98
- workspaceId: string;
99
- /**
100
- * Body param: UpdateResourceMetadata contains the user-provided fields for
101
- * updating a workspace-scoped resource. Read-only fields (id, account_id,
102
- * workspace_id, profile_id, created_at) are excluded since they are set by the
103
- * server.
104
- */
105
- metadata?: Shared.UpdateResourceMetadata;
106
- /**
107
- * Body param: Configuration for an API key.
108
- */
109
- spec?: APIKeySpec;
110
- /**
111
- * Body param: Fields to update.
112
- */
113
- updateMask?: string;
114
- }
115
- export interface APIKeyListParams extends CursorPaginationParams {
116
- /**
117
- * Filter by bundle_key — return only resources owned by this bundle.
118
- */
119
- bundleKey?: string;
120
- /**
121
- * When set to true you may use more of your alloted API rate-limit
122
- */
123
- includeInfo?: boolean;
124
- /**
125
- * Filter expression (query param: prefix)
126
- */
127
- prefix?: string;
128
- /**
129
- * Free-form search query
130
- */
131
- query?: string;
132
- /**
133
- * Sort order for results (asc or desc by creation time)
134
- */
135
- sortOrder?: string;
136
- }
137
- export interface APIKeyDeleteParams {
138
- /**
139
- * The workspace the API key belongs to.
140
- */
141
- workspaceId: string;
142
- }
143
- export interface APIKeyRotateParams {
144
- /**
145
- * The workspace the API key belongs to.
146
- */
147
- workspaceId: string;
148
- }
149
- export declare namespace APIKeys {
150
- 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 APIKeyRotateParams as APIKeyRotateParams, };
151
- }
1
+ export * from "./api-keys/index.mjs";
152
2
  //# 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":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,WAAW,EAAE;OAE9D,EAAE,cAAc,EAAE;AAGzB;;;GAGG;AACH,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;OAE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