@cadenya/cadenya 0.79.0 → 0.80.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 (116) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +8 -8
  3. package/client.d.mts +17 -11
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +17 -11
  6. package/client.d.ts.map +1 -1
  7. package/client.js +16 -10
  8. package/client.js.map +1 -1
  9. package/client.mjs +16 -10
  10. package/client.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/resources/account.d.mts +1 -3
  13. package/resources/account.d.mts.map +1 -1
  14. package/resources/account.d.ts +1 -3
  15. package/resources/account.d.ts.map +1 -1
  16. package/resources/account.js.map +1 -1
  17. package/resources/account.mjs.map +1 -1
  18. package/resources/api-keys/access.d.mts +2 -2
  19. package/resources/api-keys/access.d.mts.map +1 -1
  20. package/resources/api-keys/access.d.ts +2 -2
  21. package/resources/api-keys/access.d.ts.map +1 -1
  22. package/resources/index.d.mts +3 -3
  23. package/resources/index.d.mts.map +1 -1
  24. package/resources/index.d.ts +3 -3
  25. package/resources/index.d.ts.map +1 -1
  26. package/resources/index.js +4 -4
  27. package/resources/index.js.map +1 -1
  28. package/resources/index.mjs +2 -2
  29. package/resources/index.mjs.map +1 -1
  30. package/resources/workspace-admin/index.d.mts +3 -0
  31. package/resources/workspace-admin/index.d.mts.map +1 -0
  32. package/resources/workspace-admin/index.d.ts +3 -0
  33. package/resources/workspace-admin/index.d.ts.map +1 -0
  34. package/resources/{workspaces → workspace-admin}/index.js +3 -3
  35. package/resources/workspace-admin/index.js.map +1 -0
  36. package/resources/{workspaces → workspace-admin}/index.mjs +1 -1
  37. package/resources/workspace-admin/index.mjs.map +1 -0
  38. package/resources/workspace-admin/members.d.mts +55 -0
  39. package/resources/workspace-admin/members.d.mts.map +1 -0
  40. package/resources/workspace-admin/members.d.ts +55 -0
  41. package/resources/workspace-admin/members.d.ts.map +1 -0
  42. package/resources/workspace-admin/members.js +46 -0
  43. package/resources/workspace-admin/members.js.map +1 -0
  44. package/resources/workspace-admin/members.mjs +42 -0
  45. package/resources/workspace-admin/members.mjs.map +1 -0
  46. package/resources/workspace-admin/workspace-admin.d.mts +111 -0
  47. package/resources/workspace-admin/workspace-admin.d.mts.map +1 -0
  48. package/resources/workspace-admin/workspace-admin.d.ts +111 -0
  49. package/resources/workspace-admin/workspace-admin.d.ts.map +1 -0
  50. package/resources/workspace-admin/workspace-admin.js +60 -0
  51. package/resources/workspace-admin/workspace-admin.js.map +1 -0
  52. package/resources/workspace-admin/workspace-admin.mjs +55 -0
  53. package/resources/workspace-admin/workspace-admin.mjs.map +1 -0
  54. package/resources/workspace-admin.d.mts +2 -0
  55. package/resources/workspace-admin.d.mts.map +1 -0
  56. package/resources/workspace-admin.d.ts +2 -0
  57. package/resources/workspace-admin.d.ts.map +1 -0
  58. package/resources/workspace-admin.js +6 -0
  59. package/resources/workspace-admin.js.map +1 -0
  60. package/resources/workspace-admin.mjs +3 -0
  61. package/resources/workspace-admin.mjs.map +1 -0
  62. package/resources/workspaces.d.mts +54 -1
  63. package/resources/workspaces.d.mts.map +1 -1
  64. package/resources/workspaces.d.ts +54 -1
  65. package/resources/workspaces.d.ts.map +1 -1
  66. package/resources/workspaces.js +27 -2
  67. package/resources/workspaces.js.map +1 -1
  68. package/resources/workspaces.mjs +25 -1
  69. package/resources/workspaces.mjs.map +1 -1
  70. package/src/client.ts +32 -20
  71. package/src/resources/account.ts +1 -4
  72. package/src/resources/api-keys/access.ts +2 -2
  73. package/src/resources/index.ts +8 -6
  74. package/src/resources/{workspaces → workspace-admin}/index.ts +4 -7
  75. package/src/resources/workspace-admin/members.ts +92 -0
  76. package/src/resources/workspace-admin/workspace-admin.ts +160 -0
  77. package/src/resources/workspace-admin.ts +3 -0
  78. package/src/resources/workspaces.ts +76 -1
  79. package/src/version.ts +1 -1
  80. package/version.d.mts +1 -1
  81. package/version.d.ts +1 -1
  82. package/version.js +1 -1
  83. package/version.mjs +1 -1
  84. package/resources/profiles.d.mts +0 -33
  85. package/resources/profiles.d.mts.map +0 -1
  86. package/resources/profiles.d.ts +0 -33
  87. package/resources/profiles.d.ts.map +0 -1
  88. package/resources/profiles.js +0 -25
  89. package/resources/profiles.js.map +0 -1
  90. package/resources/profiles.mjs +0 -21
  91. package/resources/profiles.mjs.map +0 -1
  92. package/resources/workspaces/index.d.mts +0 -3
  93. package/resources/workspaces/index.d.mts.map +0 -1
  94. package/resources/workspaces/index.d.ts +0 -3
  95. package/resources/workspaces/index.d.ts.map +0 -1
  96. package/resources/workspaces/index.js.map +0 -1
  97. package/resources/workspaces/index.mjs.map +0 -1
  98. package/resources/workspaces/members.d.mts +0 -49
  99. package/resources/workspaces/members.d.mts.map +0 -1
  100. package/resources/workspaces/members.d.ts +0 -49
  101. package/resources/workspaces/members.d.ts.map +0 -1
  102. package/resources/workspaces/members.js +0 -44
  103. package/resources/workspaces/members.js.map +0 -1
  104. package/resources/workspaces/members.mjs +0 -40
  105. package/resources/workspaces/members.mjs.map +0 -1
  106. package/resources/workspaces/workspaces.d.mts +0 -133
  107. package/resources/workspaces/workspaces.d.mts.map +0 -1
  108. package/resources/workspaces/workspaces.d.ts +0 -133
  109. package/resources/workspaces/workspaces.d.ts.map +0 -1
  110. package/resources/workspaces/workspaces.js +0 -62
  111. package/resources/workspaces/workspaces.js.map +0 -1
  112. package/resources/workspaces/workspaces.mjs +0 -57
  113. package/resources/workspaces/workspaces.mjs.map +0 -1
  114. package/src/resources/profiles.ts +0 -47
  115. package/src/resources/workspaces/members.ts +0 -85
  116. package/src/resources/workspaces/workspaces.ts +0 -190
package/src/client.ts CHANGED
@@ -37,7 +37,6 @@ import {
37
37
  Models,
38
38
  ModelsCursorPagination,
39
39
  } from './resources/models';
40
- import { ProfileListParams, Profiles } from './resources/profiles';
41
40
  import {
42
41
  Search,
43
42
  SearchSearchToolsOrToolSetsParams,
@@ -64,6 +63,13 @@ import {
64
63
  WorkspaceSecrets,
65
64
  WorkspaceSecretsCursorPagination,
66
65
  } from './resources/workspace-secrets';
66
+ import {
67
+ Workspace,
68
+ WorkspaceListParams,
69
+ WorkspaceSpec,
70
+ Workspaces,
71
+ WorkspacesCursorPagination,
72
+ } from './resources/workspaces';
67
73
  import {
68
74
  Agent,
69
75
  AgentCreateParams,
@@ -192,14 +198,11 @@ import {
192
198
  ToolSetsCursorPagination,
193
199
  } from './resources/tool-sets/tool-sets';
194
200
  import {
195
- Workspace,
196
- WorkspaceCreateParams,
197
- WorkspaceListParams,
201
+ WorkspaceAdmin,
202
+ WorkspaceAdminCreateParams,
203
+ WorkspaceAdminListParams,
198
204
  WorkspaceMember,
199
- WorkspaceSpec,
200
- Workspaces,
201
- WorkspacesCursorPagination,
202
- } from './resources/workspaces/workspaces';
205
+ } from './resources/workspace-admin/workspace-admin';
203
206
  import { type Fetch } from './internal/builtin-types';
204
207
  import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
205
208
  import { FinalRequestOptions, RequestOptions } from './internal/request-options';
@@ -949,11 +952,6 @@ export class Cadenya {
949
952
  * unit and contain one or more workspaces.
950
953
  */
951
954
  account: API.AccountResource = new API.AccountResource(this);
952
- /**
953
- * Read account profiles. Profiles are the account-level principals (users and
954
- * API keys) that can be granted access to workspaces.
955
- */
956
- profiles: API.Profiles = new API.Profiles(this);
957
955
  /**
958
956
  * Manage AI agents within a workspace. Agents define AI behavior and tool access.
959
957
  */
@@ -996,10 +994,21 @@ export class Cadenya {
996
994
  /**
997
995
  * Manage workspaces within an account. Workspaces provide organizational
998
996
  * grouping and isolation for resources such as agents, tools, and API keys.
999
- * Workspace creation, archival, and membership management require an account
1000
- * administrator (a token whose profile holds the admin role).
997
+ *
998
+ * This is the workspace-scoped, end-user surface. Administrative operations
999
+ * (create / archive workspaces, manage members) live in WorkspaceAdminService
1000
+ * under /v1/account/workspaces and require the admin role.
1001
1001
  */
1002
1002
  workspaces: API.Workspaces = new API.Workspaces(this);
1003
+ /**
1004
+ * Administer workspaces across the account: create and archive workspaces and
1005
+ * manage their membership. These operations are account-scoped and require the
1006
+ * admin role (a token whose profile holds the WorkOS admin role); they live
1007
+ * under /v1/account/workspaces rather than the workspace-scoped /v1/workspaces
1008
+ * tree so an admin can manage any workspace in the account, including ones they
1009
+ * are not themselves a member of.
1010
+ */
1011
+ workspaceAdmin: API.WorkspaceAdmin = new API.WorkspaceAdmin(this);
1003
1012
  webhooks: API.Webhooks = new API.Webhooks(this);
1004
1013
  /**
1005
1014
  * Apply a declarative bundle of workspace resources — tool sets, memory
@@ -1010,7 +1019,6 @@ export class Cadenya {
1010
1019
  }
1011
1020
 
1012
1021
  Cadenya.AccountResource = AccountResource;
1013
- Cadenya.Profiles = Profiles;
1014
1022
  Cadenya.Agents = Agents;
1015
1023
  Cadenya.Objectives = Objectives;
1016
1024
  Cadenya.MemoryLayers = MemoryLayers;
@@ -1021,6 +1029,7 @@ Cadenya.ToolSets = ToolSets;
1021
1029
  Cadenya.APIKeys = APIKeys;
1022
1030
  Cadenya.WorkspaceSecrets = WorkspaceSecrets;
1023
1031
  Cadenya.Workspaces = Workspaces;
1032
+ Cadenya.WorkspaceAdmin = WorkspaceAdmin;
1024
1033
  Cadenya.Webhooks = Webhooks;
1025
1034
  Cadenya.BulkWorkspaceResources = BulkWorkspaceResources;
1026
1035
 
@@ -1043,8 +1052,6 @@ export declare namespace Cadenya {
1043
1052
  type RotateWebhookSigningKeyResponse as RotateWebhookSigningKeyResponse,
1044
1053
  };
1045
1054
 
1046
- export { Profiles as Profiles, type ProfileListParams as ProfileListParams };
1047
-
1048
1055
  export {
1049
1056
  Agents as Agents,
1050
1057
  type Agent as Agent,
@@ -1198,13 +1205,18 @@ export declare namespace Cadenya {
1198
1205
  export {
1199
1206
  Workspaces as Workspaces,
1200
1207
  type Workspace as Workspace,
1201
- type WorkspaceMember as WorkspaceMember,
1202
1208
  type WorkspaceSpec as WorkspaceSpec,
1203
1209
  type WorkspacesCursorPagination as WorkspacesCursorPagination,
1204
- type WorkspaceCreateParams as WorkspaceCreateParams,
1205
1210
  type WorkspaceListParams as WorkspaceListParams,
1206
1211
  };
1207
1212
 
1213
+ export {
1214
+ WorkspaceAdmin as WorkspaceAdmin,
1215
+ type WorkspaceMember as WorkspaceMember,
1216
+ type WorkspaceAdminCreateParams as WorkspaceAdminCreateParams,
1217
+ type WorkspaceAdminListParams as WorkspaceAdminListParams,
1218
+ };
1219
+
1208
1220
  export {
1209
1221
  Webhooks as Webhooks,
1210
1222
  type UnsafeUnwrapWebhookEvent as UnsafeUnwrapWebhookEvent,
@@ -2,10 +2,9 @@
2
2
 
3
3
  import { APIResource } from '../core/resource';
4
4
  import * as Shared from './shared';
5
+ import * as WorkspacesAPI from './workspaces';
5
6
  import * as APIKeysAPI from './api-keys/api-keys';
6
- import * as WorkspacesAPI from './workspaces/workspaces';
7
7
  import { APIPromise } from '../core/api-promise';
8
- import { CursorPagination } from '../core/pagination';
9
8
  import { RequestOptions } from '../internal/request-options';
10
9
 
11
10
  /**
@@ -29,8 +28,6 @@ export class AccountResource extends APIResource {
29
28
  }
30
29
  }
31
30
 
32
- export type ProfilesCursorPagination = CursorPagination<Profile>;
33
-
34
31
  /**
35
32
  * An account, the top-level organizational unit. Contains workspaces and
36
33
  * account-wide settings such as the webhook signing secret.
@@ -1,9 +1,9 @@
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 WorkspacesAPI from '../workspaces';
5
+ import { WorkspacesCursorPagination } from '../workspaces';
4
6
  import * as APIKeysAPI from './api-keys';
5
- import * as WorkspacesAPI from '../workspaces/workspaces';
6
- import { WorkspacesCursorPagination } from '../workspaces/workspaces';
7
7
  import { APIPromise } from '../../core/api-promise';
8
8
  import { CursorPagination, type CursorPaginationParams, PagePromise } from '../../core/pagination';
9
9
  import { buildHeaders } from '../../internal/headers';
@@ -19,7 +19,6 @@ export {
19
19
  type Profile,
20
20
  type ProfileSpec,
21
21
  type RotateWebhookSigningKeyResponse,
22
- type ProfilesCursorPagination,
23
22
  } from './account';
24
23
  export {
25
24
  Agents,
@@ -118,7 +117,6 @@ export {
118
117
  type ObjectiveContextWindowsCursorPagination,
119
118
  type ObjectiveListEventsResponsesCursorPagination,
120
119
  } from './objectives/objectives';
121
- export { Profiles, type ProfileListParams } from './profiles';
122
120
  export {
123
121
  Search,
124
122
  type SearchSearchToolsOrToolSetsResponse,
@@ -162,6 +160,13 @@ export {
162
160
  type UploadRetrieveParams,
163
161
  } from './uploads';
164
162
  export { Webhooks, type UnsafeUnwrapWebhookEvent, type UnwrapWebhookEvent } from './webhooks';
163
+ export {
164
+ WorkspaceAdmin,
165
+ type WorkspaceMember,
166
+ type WorkspaceAdminCreateParams,
167
+ type WorkspaceAdminListParams,
168
+ type WorkspaceMembersCursorPagination,
169
+ } from './workspace-admin/workspace-admin';
165
170
  export {
166
171
  WorkspaceSecrets,
167
172
  type WorkspaceSecret,
@@ -177,10 +182,7 @@ export {
177
182
  export {
178
183
  Workspaces,
179
184
  type Workspace,
180
- type WorkspaceMember,
181
185
  type WorkspaceSpec,
182
- type WorkspaceCreateParams,
183
186
  type WorkspaceListParams,
184
187
  type WorkspacesCursorPagination,
185
- type WorkspaceMembersCursorPagination,
186
- } from './workspaces/workspaces';
188
+ } from './workspaces';
@@ -2,12 +2,9 @@
2
2
 
3
3
  export { Members, type MemberListParams, type MemberAddParams, type MemberRemoveParams } from './members';
4
4
  export {
5
- Workspaces,
6
- type Workspace,
5
+ WorkspaceAdmin,
7
6
  type WorkspaceMember,
8
- type WorkspaceSpec,
9
- type WorkspaceCreateParams,
10
- type WorkspaceListParams,
11
- type WorkspacesCursorPagination,
7
+ type WorkspaceAdminCreateParams,
8
+ type WorkspaceAdminListParams,
12
9
  type WorkspaceMembersCursorPagination,
13
- } from './workspaces';
10
+ } from './workspace-admin';
@@ -0,0 +1,92 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as WorkspaceAdminAPI from './workspace-admin';
5
+ import { WorkspaceMembersCursorPagination } from './workspace-admin';
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
+ * Administer workspaces across the account: create and archive workspaces and
14
+ * manage their membership. These operations are account-scoped and require the
15
+ * admin role (a token whose profile holds the WorkOS admin role); they live
16
+ * under /v1/account/workspaces rather than the workspace-scoped /v1/workspaces
17
+ * tree so an admin can manage any workspace in the account, including ones they
18
+ * are not themselves a member of.
19
+ */
20
+ export class Members extends APIResource {
21
+ /**
22
+ * Lists the members of a workspace. Admin only.
23
+ */
24
+ list(
25
+ workspaceID: string,
26
+ query: MemberListParams | null | undefined = {},
27
+ options?: RequestOptions,
28
+ ): PagePromise<WorkspaceMembersCursorPagination, WorkspaceAdminAPI.WorkspaceMember> {
29
+ return this._client.getAPIList(
30
+ path`/v1/account/workspaces/${workspaceID}/members`,
31
+ CursorPagination<WorkspaceAdminAPI.WorkspaceMember>,
32
+ { query, ...options },
33
+ );
34
+ }
35
+
36
+ /**
37
+ * Grants a profile access to the workspace by creating (or reactivating) the actor
38
+ * that links the profile to the workspace. Accepts either an existing profile_id
39
+ * or an email to resolve-or-invite. Idempotent for an already-active member. Admin
40
+ * only.
41
+ */
42
+ add(
43
+ workspaceID: string,
44
+ body: MemberAddParams,
45
+ options?: RequestOptions,
46
+ ): APIPromise<WorkspaceAdminAPI.WorkspaceMember> {
47
+ return this._client.post(path`/v1/account/workspaces/${workspaceID}/members`, { body, ...options });
48
+ }
49
+
50
+ /**
51
+ * Revokes a member's access by deactivating their actor; the member is immediately
52
+ * cut off. The underlying profile is not deleted. Admin only.
53
+ */
54
+ remove(profileID: string, params: MemberRemoveParams, options?: RequestOptions): APIPromise<void> {
55
+ const { workspaceId } = params;
56
+ return this._client.delete(path`/v1/account/workspaces/${workspaceId}/members/${profileID}`, {
57
+ ...options,
58
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
59
+ });
60
+ }
61
+ }
62
+
63
+ export interface MemberListParams extends CursorPaginationParams {}
64
+
65
+ export interface MemberAddParams {
66
+ /**
67
+ * Email address to add (resolve-or-invite). Mutually exclusive with profile_id.
68
+ */
69
+ email?: string;
70
+
71
+ /**
72
+ * An existing account profile to add. Mutually exclusive with email.
73
+ */
74
+ profileId?: string;
75
+ }
76
+
77
+ export interface MemberRemoveParams {
78
+ /**
79
+ * The workspace to remove the member from (path).
80
+ */
81
+ workspaceId: string;
82
+ }
83
+
84
+ export declare namespace Members {
85
+ export {
86
+ type MemberListParams as MemberListParams,
87
+ type MemberAddParams as MemberAddParams,
88
+ type MemberRemoveParams as MemberRemoveParams,
89
+ };
90
+ }
91
+
92
+ export { type WorkspaceMembersCursorPagination };
@@ -0,0 +1,160 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as WorkspacesAPI from '../workspaces';
5
+ import { WorkspacesCursorPagination } from '../workspaces';
6
+ import * as MembersAPI from './members';
7
+ import { MemberAddParams, MemberListParams, MemberRemoveParams, Members } from './members';
8
+ import { APIPromise } from '../../core/api-promise';
9
+ import { CursorPagination, type CursorPaginationParams, PagePromise } from '../../core/pagination';
10
+ import { buildHeaders } from '../../internal/headers';
11
+ import { RequestOptions } from '../../internal/request-options';
12
+ import { path } from '../../internal/utils/path';
13
+
14
+ /**
15
+ * Administer workspaces across the account: create and archive workspaces and
16
+ * manage their membership. These operations are account-scoped and require the
17
+ * admin role (a token whose profile holds the WorkOS admin role); they live
18
+ * under /v1/account/workspaces rather than the workspace-scoped /v1/workspaces
19
+ * tree so an admin can manage any workspace in the account, including ones they
20
+ * are not themselves a member of.
21
+ */
22
+ export class WorkspaceAdmin extends APIResource {
23
+ members: MembersAPI.Members = new MembersAPI.Members(this._client);
24
+
25
+ /**
26
+ * Creates a new workspace in the account. Admin only.
27
+ */
28
+ create(body: WorkspaceAdminCreateParams, options?: RequestOptions): APIPromise<WorkspacesAPI.Workspace> {
29
+ return this._client.post('/v1/account/workspaces', { body, ...options });
30
+ }
31
+
32
+ /**
33
+ * Retrieves a workspace in the account by ID. Admin only.
34
+ */
35
+ retrieve(workspaceID: string, options?: RequestOptions): APIPromise<WorkspacesAPI.Workspace> {
36
+ return this._client.get(path`/v1/account/workspaces/${workspaceID}`, options);
37
+ }
38
+
39
+ /**
40
+ * Lists every workspace in the account, optionally including archived ones. Admin
41
+ * only.
42
+ */
43
+ list(
44
+ query: WorkspaceAdminListParams | null | undefined = {},
45
+ options?: RequestOptions,
46
+ ): PagePromise<WorkspacesCursorPagination, WorkspacesAPI.Workspace> {
47
+ return this._client.getAPIList('/v1/account/workspaces', CursorPagination<WorkspacesAPI.Workspace>, {
48
+ query,
49
+ ...options,
50
+ });
51
+ }
52
+
53
+ /**
54
+ * Archives a workspace (soft delete). The workspace is retained, but any
55
+ * subsequent request scoped to it returns a permission error. Admin only.
56
+ */
57
+ archive(workspaceID: string, options?: RequestOptions): APIPromise<void> {
58
+ return this._client.delete(path`/v1/account/workspaces/${workspaceID}`, {
59
+ ...options,
60
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
61
+ });
62
+ }
63
+ }
64
+
65
+ export type WorkspaceMembersCursorPagination = CursorPagination<WorkspaceMember>;
66
+
67
+ /**
68
+ * A member of a workspace: the profile granted access plus the actor row that
69
+ * links it to the workspace. Returned by member list/add operations.
70
+ */
71
+ export interface WorkspaceMember {
72
+ /**
73
+ * The actor row linking the profile to the workspace (the junction record).
74
+ */
75
+ actorId: string;
76
+
77
+ /**
78
+ * The account profile that has access to the workspace.
79
+ */
80
+ profileId: string;
81
+
82
+ /**
83
+ * When the member was added to the workspace.
84
+ */
85
+ addedAt?: string;
86
+
87
+ /**
88
+ * Email address of the member's profile.
89
+ */
90
+ email?: string;
91
+
92
+ /**
93
+ * Display name of the member's profile.
94
+ */
95
+ name?: string;
96
+ }
97
+
98
+ export interface WorkspaceAdminCreateParams {
99
+ /**
100
+ * CreateAccountResourceMetadata contains the user-provided fields for creating an
101
+ * account-scoped resource. Read-only fields (id, account_id, profile_id) are
102
+ * excluded since they are set by the server.
103
+ */
104
+ metadata: WorkspaceAdminCreateParams.Metadata;
105
+
106
+ spec: WorkspacesAPI.WorkspaceSpec;
107
+ }
108
+
109
+ export namespace WorkspaceAdminCreateParams {
110
+ /**
111
+ * CreateAccountResourceMetadata contains the user-provided fields for creating an
112
+ * account-scoped resource. Read-only fields (id, account_id, profile_id) are
113
+ * excluded since they are set by the server.
114
+ */
115
+ export interface Metadata {
116
+ /**
117
+ * Human-readable name for the resource (e.g., "Production API Key", "Staging
118
+ * Workspace")
119
+ */
120
+ name: string;
121
+
122
+ /**
123
+ * External ID for the resource (e.g., a workflow ID from an external system)
124
+ */
125
+ externalId?: string;
126
+
127
+ /**
128
+ * Arbitrary key-value pairs for categorization and filtering Examples:
129
+ * {"environment": "production", "team": "platform", "version": "v2"}
130
+ */
131
+ labels?: { [key: string]: string };
132
+ }
133
+ }
134
+
135
+ export interface WorkspaceAdminListParams extends CursorPaginationParams {
136
+ /**
137
+ * When true, archived workspaces are included in the results. Defaults to false
138
+ * (active workspaces only).
139
+ */
140
+ includeArchived?: boolean;
141
+ }
142
+
143
+ WorkspaceAdmin.Members = Members;
144
+
145
+ export declare namespace WorkspaceAdmin {
146
+ export {
147
+ type WorkspaceMember as WorkspaceMember,
148
+ type WorkspaceAdminCreateParams as WorkspaceAdminCreateParams,
149
+ type WorkspaceAdminListParams as WorkspaceAdminListParams,
150
+ };
151
+
152
+ export {
153
+ Members as Members,
154
+ type MemberListParams as MemberListParams,
155
+ type MemberAddParams as MemberAddParams,
156
+ type MemberRemoveParams as MemberRemoveParams,
157
+ };
158
+ }
159
+
160
+ export { type WorkspacesCursorPagination };
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './workspace-admin/index';
@@ -1,3 +1,78 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- export * from './workspaces/index';
3
+ import { APIResource } from '../core/resource';
4
+ import * as Shared from './shared';
5
+ import { APIPromise } from '../core/api-promise';
6
+ import { CursorPagination, type CursorPaginationParams, PagePromise } from '../core/pagination';
7
+ import { RequestOptions } from '../internal/request-options';
8
+
9
+ /**
10
+ * Manage workspaces within an account. Workspaces provide organizational
11
+ * grouping and isolation for resources such as agents, tools, and API keys.
12
+ *
13
+ * This is the workspace-scoped, end-user surface. Administrative operations
14
+ * (create / archive workspaces, manage members) live in WorkspaceAdminService
15
+ * under /v1/account/workspaces and require the admin role.
16
+ */
17
+ export class Workspaces extends APIResource {
18
+ /**
19
+ * Lists all workspaces for the current account
20
+ */
21
+ list(
22
+ query: WorkspaceListParams | null | undefined = {},
23
+ options?: RequestOptions,
24
+ ): PagePromise<WorkspacesCursorPagination, Workspace> {
25
+ return this._client.getAPIList('/v1/workspaces', CursorPagination<Workspace>, { query, ...options });
26
+ }
27
+
28
+ /**
29
+ * Retrieves the workspace associated with the current API token. Useful for
30
+ * workspace-scoped tokens to identify which workspace they belong to.
31
+ */
32
+ get(options?: RequestOptions): APIPromise<Workspace> {
33
+ return this._client.get('/v1/workspaces/current', options);
34
+ }
35
+ }
36
+
37
+ export type WorkspacesCursorPagination = CursorPagination<Workspace>;
38
+
39
+ export interface Workspace {
40
+ /**
41
+ * AccountResourceMetadata is used to represent a resource that is associated to an
42
+ * account but not to a workspace.
43
+ */
44
+ metadata: Shared.AccountResourceMetadata;
45
+
46
+ spec: WorkspaceSpec;
47
+
48
+ /**
49
+ * Lifecycle status of the workspace. Archived workspaces reject all requests
50
+ * scoped to them. Server-populated.
51
+ */
52
+ status?: 'STATUS_ENABLED' | 'STATUS_DISABLED' | 'STATUS_ARCHIVED';
53
+ }
54
+
55
+ export interface WorkspaceSpec {
56
+ description?: string;
57
+ }
58
+
59
+ export interface WorkspaceListParams extends CursorPaginationParams {
60
+ /**
61
+ * When set to true you may use more of your alloted API rate-limit
62
+ */
63
+ includeInfo?: boolean;
64
+
65
+ /**
66
+ * Sort order for results (asc or desc by creation time)
67
+ */
68
+ sortOrder?: string;
69
+ }
70
+
71
+ export declare namespace Workspaces {
72
+ export {
73
+ type Workspace as Workspace,
74
+ type WorkspaceSpec as WorkspaceSpec,
75
+ type WorkspacesCursorPagination as WorkspacesCursorPagination,
76
+ type WorkspaceListParams as WorkspaceListParams,
77
+ };
78
+ }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.79.0'; // x-release-please-version
1
+ export const VERSION = '0.80.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.79.0";
1
+ export declare const VERSION = "0.80.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.79.0";
1
+ export declare const VERSION = "0.80.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.79.0'; // x-release-please-version
4
+ exports.VERSION = '0.80.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.79.0'; // x-release-please-version
1
+ export const VERSION = '0.80.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map
@@ -1,33 +0,0 @@
1
- import { APIResource } from "../core/resource.mjs";
2
- import * as AccountAPI from "./account.mjs";
3
- import { ProfilesCursorPagination } from "./account.mjs";
4
- import { type CursorPaginationParams, PagePromise } from "../core/pagination.mjs";
5
- import { RequestOptions } from "../internal/request-options.mjs";
6
- /**
7
- * Read account profiles. Profiles are the account-level principals (users and
8
- * API keys) that can be granted access to workspaces.
9
- */
10
- export declare class Profiles extends APIResource {
11
- /**
12
- * Lists the profiles in the current account. Supports free-form search and a type
13
- * filter, intended for member-picker UIs (e.g. choosing a profile to add to a
14
- * workspace).
15
- */
16
- list(query?: ProfileListParams | null | undefined, options?: RequestOptions): PagePromise<ProfilesCursorPagination, AccountAPI.Profile>;
17
- }
18
- export interface ProfileListParams extends CursorPaginationParams {
19
- /**
20
- * Free-form search over profile name and email, for member-picker UIs.
21
- */
22
- query?: string;
23
- /**
24
- * Filter by profile type. Defaults to all types when unset; pass PROFILE_TYPE_USER
25
- * to list only human users (e.g. for a member picker).
26
- */
27
- type?: 'PROFILE_TYPE_USER' | 'PROFILE_TYPE_API_KEY' | 'PROFILE_TYPE_SYSTEM';
28
- }
29
- export declare namespace Profiles {
30
- export { type ProfileListParams as ProfileListParams };
31
- }
32
- export { type ProfilesCursorPagination };
33
- //# sourceMappingURL=profiles.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"profiles.d.mts","sourceRoot":"","sources":["../src/resources/profiles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,KAAK,UAAU,sBAAkB;AACxC,OAAO,EAAE,wBAAwB,EAAE,sBAAkB;AACrD,OAAO,EAAoB,KAAK,sBAAsB,EAAE,WAAW,EAAE,+BAA2B;AAChG,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAE7D;;;GAGG;AACH,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;OAIG;IACH,IAAI,CACF,KAAK,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,wBAAwB,EAAE,UAAU,CAAC,OAAO,CAAC;CAM7D;AAED,MAAM,WAAW,iBAAkB,SAAQ,sBAAsB;IAC/D;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,IAAI,CAAC,EAAE,mBAAmB,GAAG,sBAAsB,GAAG,qBAAqB,CAAC;CAC7E;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EAAE,KAAK,iBAAiB,IAAI,iBAAiB,EAAE,CAAC;CACxD;AAED,OAAO,EAAE,KAAK,wBAAwB,EAAE,CAAC"}
@@ -1,33 +0,0 @@
1
- import { APIResource } from "../core/resource.js";
2
- import * as AccountAPI from "./account.js";
3
- import { ProfilesCursorPagination } from "./account.js";
4
- import { type CursorPaginationParams, PagePromise } from "../core/pagination.js";
5
- import { RequestOptions } from "../internal/request-options.js";
6
- /**
7
- * Read account profiles. Profiles are the account-level principals (users and
8
- * API keys) that can be granted access to workspaces.
9
- */
10
- export declare class Profiles extends APIResource {
11
- /**
12
- * Lists the profiles in the current account. Supports free-form search and a type
13
- * filter, intended for member-picker UIs (e.g. choosing a profile to add to a
14
- * workspace).
15
- */
16
- list(query?: ProfileListParams | null | undefined, options?: RequestOptions): PagePromise<ProfilesCursorPagination, AccountAPI.Profile>;
17
- }
18
- export interface ProfileListParams extends CursorPaginationParams {
19
- /**
20
- * Free-form search over profile name and email, for member-picker UIs.
21
- */
22
- query?: string;
23
- /**
24
- * Filter by profile type. Defaults to all types when unset; pass PROFILE_TYPE_USER
25
- * to list only human users (e.g. for a member picker).
26
- */
27
- type?: 'PROFILE_TYPE_USER' | 'PROFILE_TYPE_API_KEY' | 'PROFILE_TYPE_SYSTEM';
28
- }
29
- export declare namespace Profiles {
30
- export { type ProfileListParams as ProfileListParams };
31
- }
32
- export { type ProfilesCursorPagination };
33
- //# sourceMappingURL=profiles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../src/resources/profiles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,KAAK,UAAU,qBAAkB;AACxC,OAAO,EAAE,wBAAwB,EAAE,qBAAkB;AACrD,OAAO,EAAoB,KAAK,sBAAsB,EAAE,WAAW,EAAE,8BAA2B;AAChG,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAE7D;;;GAGG;AACH,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;OAIG;IACH,IAAI,CACF,KAAK,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,wBAAwB,EAAE,UAAU,CAAC,OAAO,CAAC;CAM7D;AAED,MAAM,WAAW,iBAAkB,SAAQ,sBAAsB;IAC/D;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,IAAI,CAAC,EAAE,mBAAmB,GAAG,sBAAsB,GAAG,qBAAqB,CAAC;CAC7E;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EAAE,KAAK,iBAAiB,IAAI,iBAAiB,EAAE,CAAC;CACxD;AAED,OAAO,EAAE,KAAK,wBAAwB,EAAE,CAAC"}