@cadenya/cadenya 0.79.0 → 0.81.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +8 -8
- package/client.d.mts +17 -11
- package/client.d.mts.map +1 -1
- package/client.d.ts +17 -11
- package/client.d.ts.map +1 -1
- package/client.js +16 -10
- package/client.js.map +1 -1
- package/client.mjs +16 -10
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/account.d.mts +1 -3
- package/resources/account.d.mts.map +1 -1
- package/resources/account.d.ts +1 -3
- package/resources/account.d.ts.map +1 -1
- package/resources/account.js.map +1 -1
- package/resources/account.mjs.map +1 -1
- package/resources/api-keys/access.d.mts +2 -2
- package/resources/api-keys/access.d.mts.map +1 -1
- package/resources/api-keys/access.d.ts +2 -2
- package/resources/api-keys/access.d.ts.map +1 -1
- package/resources/index.d.mts +3 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +4 -4
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -2
- package/resources/index.mjs.map +1 -1
- package/resources/workspace-admin/index.d.mts +3 -0
- package/resources/workspace-admin/index.d.mts.map +1 -0
- package/resources/workspace-admin/index.d.ts +3 -0
- package/resources/workspace-admin/index.d.ts.map +1 -0
- package/resources/{workspaces → workspace-admin}/index.js +3 -3
- package/resources/workspace-admin/index.js.map +1 -0
- package/resources/{workspaces → workspace-admin}/index.mjs +1 -1
- package/resources/workspace-admin/index.mjs.map +1 -0
- package/resources/workspace-admin/members.d.mts +55 -0
- package/resources/workspace-admin/members.d.mts.map +1 -0
- package/resources/workspace-admin/members.d.ts +55 -0
- package/resources/workspace-admin/members.d.ts.map +1 -0
- package/resources/workspace-admin/members.js +46 -0
- package/resources/workspace-admin/members.js.map +1 -0
- package/resources/workspace-admin/members.mjs +42 -0
- package/resources/workspace-admin/members.mjs.map +1 -0
- package/resources/workspace-admin/workspace-admin.d.mts +113 -0
- package/resources/workspace-admin/workspace-admin.d.mts.map +1 -0
- package/resources/workspace-admin/workspace-admin.d.ts +113 -0
- package/resources/workspace-admin/workspace-admin.d.ts.map +1 -0
- package/resources/workspace-admin/workspace-admin.js +62 -0
- package/resources/workspace-admin/workspace-admin.js.map +1 -0
- package/resources/workspace-admin/workspace-admin.mjs +57 -0
- package/resources/workspace-admin/workspace-admin.mjs.map +1 -0
- package/resources/workspace-admin.d.mts +2 -0
- package/resources/workspace-admin.d.mts.map +1 -0
- package/resources/workspace-admin.d.ts +2 -0
- package/resources/workspace-admin.d.ts.map +1 -0
- package/resources/workspace-admin.js +6 -0
- package/resources/workspace-admin.js.map +1 -0
- package/resources/workspace-admin.mjs +3 -0
- package/resources/workspace-admin.mjs.map +1 -0
- package/resources/workspaces.d.mts +54 -1
- package/resources/workspaces.d.mts.map +1 -1
- package/resources/workspaces.d.ts +54 -1
- package/resources/workspaces.d.ts.map +1 -1
- package/resources/workspaces.js +27 -2
- package/resources/workspaces.js.map +1 -1
- package/resources/workspaces.mjs +25 -1
- package/resources/workspaces.mjs.map +1 -1
- package/src/client.ts +32 -20
- package/src/resources/account.ts +1 -4
- package/src/resources/api-keys/access.ts +2 -2
- package/src/resources/index.ts +8 -6
- package/src/resources/{workspaces → workspace-admin}/index.ts +4 -7
- package/src/resources/workspace-admin/members.ts +92 -0
- package/src/resources/workspace-admin/workspace-admin.ts +162 -0
- package/src/resources/workspace-admin.ts +3 -0
- package/src/resources/workspaces.ts +76 -1
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/profiles.d.mts +0 -33
- package/resources/profiles.d.mts.map +0 -1
- package/resources/profiles.d.ts +0 -33
- package/resources/profiles.d.ts.map +0 -1
- package/resources/profiles.js +0 -25
- package/resources/profiles.js.map +0 -1
- package/resources/profiles.mjs +0 -21
- package/resources/profiles.mjs.map +0 -1
- package/resources/workspaces/index.d.mts +0 -3
- package/resources/workspaces/index.d.mts.map +0 -1
- package/resources/workspaces/index.d.ts +0 -3
- package/resources/workspaces/index.d.ts.map +0 -1
- package/resources/workspaces/index.js.map +0 -1
- package/resources/workspaces/index.mjs.map +0 -1
- package/resources/workspaces/members.d.mts +0 -49
- package/resources/workspaces/members.d.mts.map +0 -1
- package/resources/workspaces/members.d.ts +0 -49
- package/resources/workspaces/members.d.ts.map +0 -1
- package/resources/workspaces/members.js +0 -44
- package/resources/workspaces/members.js.map +0 -1
- package/resources/workspaces/members.mjs +0 -40
- package/resources/workspaces/members.mjs.map +0 -1
- package/resources/workspaces/workspaces.d.mts +0 -133
- package/resources/workspaces/workspaces.d.mts.map +0 -1
- package/resources/workspaces/workspaces.d.ts +0 -133
- package/resources/workspaces/workspaces.d.ts.map +0 -1
- package/resources/workspaces/workspaces.js +0 -62
- package/resources/workspaces/workspaces.js.map +0 -1
- package/resources/workspaces/workspaces.mjs +0 -57
- package/resources/workspaces/workspaces.mjs.map +0 -1
- package/src/resources/profiles.ts +0 -47
- package/src/resources/workspaces/members.ts +0 -85
- package/src/resources/workspaces/workspaces.ts +0 -190
package/resources/workspaces.mjs
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
2
|
+
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
import { CursorPagination } from "../core/pagination.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* Manage workspaces within an account. Workspaces provide organizational
|
|
6
|
+
* grouping and isolation for resources such as agents, tools, and API keys.
|
|
7
|
+
*
|
|
8
|
+
* This is the workspace-scoped, end-user surface. Administrative operations
|
|
9
|
+
* (create / archive workspaces, manage members) live in WorkspaceAdminService
|
|
10
|
+
* under /v1/account/workspaces and require the admin role.
|
|
11
|
+
*/
|
|
12
|
+
export class Workspaces extends APIResource {
|
|
13
|
+
/**
|
|
14
|
+
* Lists all workspaces for the current account
|
|
15
|
+
*/
|
|
16
|
+
list(query = {}, options) {
|
|
17
|
+
return this._client.getAPIList('/v1/workspaces', (CursorPagination), { query, ...options });
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Retrieves the workspace associated with the current API token. Useful for
|
|
21
|
+
* workspace-scoped tokens to identify which workspace they belong to.
|
|
22
|
+
*/
|
|
23
|
+
get(options) {
|
|
24
|
+
return this._client.get('/v1/workspaces/current', options);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
3
27
|
//# sourceMappingURL=workspaces.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspaces.mjs","sourceRoot":"","sources":["../src/resources/workspaces.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,
|
|
1
|
+
{"version":3,"file":"workspaces.mjs","sourceRoot":"","sources":["../src/resources/workspaces.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAG/C,OAAO,EAAE,gBAAgB,EAA4C,+BAA2B;AAGhG;;;;;;;GAOG;AACH,MAAM,OAAO,UAAW,SAAQ,WAAW;IACzC;;OAEG;IACH,IAAI,CACF,QAAgD,EAAE,EAClD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAA,gBAA2B,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvG,CAAC;IAED;;;OAGG;IACH,GAAG,CAAC,OAAwB;QAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;CACF"}
|
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
|
-
|
|
196
|
-
|
|
197
|
-
|
|
201
|
+
WorkspaceAdmin,
|
|
202
|
+
WorkspaceAdminCreateParams,
|
|
203
|
+
WorkspaceAdminListParams,
|
|
198
204
|
WorkspaceMember,
|
|
199
|
-
|
|
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
|
-
*
|
|
1000
|
-
*
|
|
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,
|
package/src/resources/account.ts
CHANGED
|
@@ -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';
|
package/src/resources/index.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
6
|
-
type Workspace,
|
|
5
|
+
WorkspaceAdmin,
|
|
7
6
|
type WorkspaceMember,
|
|
8
|
-
type
|
|
9
|
-
type
|
|
10
|
-
type WorkspaceListParams,
|
|
11
|
-
type WorkspacesCursorPagination,
|
|
7
|
+
type WorkspaceAdminCreateParams,
|
|
8
|
+
type WorkspaceAdminListParams,
|
|
12
9
|
type WorkspaceMembersCursorPagination,
|
|
13
|
-
} from './
|
|
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,162 @@
|
|
|
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. Archiving the
|
|
56
|
+
* account's last active (non-archived) workspace is not allowed and returns
|
|
57
|
+
* FailedPrecondition. Admin only.
|
|
58
|
+
*/
|
|
59
|
+
archive(workspaceID: string, options?: RequestOptions): APIPromise<void> {
|
|
60
|
+
return this._client.delete(path`/v1/account/workspaces/${workspaceID}`, {
|
|
61
|
+
...options,
|
|
62
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export type WorkspaceMembersCursorPagination = CursorPagination<WorkspaceMember>;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* A member of a workspace: the profile granted access plus the actor row that
|
|
71
|
+
* links it to the workspace. Returned by member list/add operations.
|
|
72
|
+
*/
|
|
73
|
+
export interface WorkspaceMember {
|
|
74
|
+
/**
|
|
75
|
+
* The actor row linking the profile to the workspace (the junction record).
|
|
76
|
+
*/
|
|
77
|
+
actorId: string;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* The account profile that has access to the workspace.
|
|
81
|
+
*/
|
|
82
|
+
profileId: string;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* When the member was added to the workspace.
|
|
86
|
+
*/
|
|
87
|
+
addedAt?: string;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Email address of the member's profile.
|
|
91
|
+
*/
|
|
92
|
+
email?: string;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Display name of the member's profile.
|
|
96
|
+
*/
|
|
97
|
+
name?: string;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface WorkspaceAdminCreateParams {
|
|
101
|
+
/**
|
|
102
|
+
* CreateAccountResourceMetadata contains the user-provided fields for creating an
|
|
103
|
+
* account-scoped resource. Read-only fields (id, account_id, profile_id) are
|
|
104
|
+
* excluded since they are set by the server.
|
|
105
|
+
*/
|
|
106
|
+
metadata: WorkspaceAdminCreateParams.Metadata;
|
|
107
|
+
|
|
108
|
+
spec: WorkspacesAPI.WorkspaceSpec;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export namespace WorkspaceAdminCreateParams {
|
|
112
|
+
/**
|
|
113
|
+
* CreateAccountResourceMetadata contains the user-provided fields for creating an
|
|
114
|
+
* account-scoped resource. Read-only fields (id, account_id, profile_id) are
|
|
115
|
+
* excluded since they are set by the server.
|
|
116
|
+
*/
|
|
117
|
+
export interface Metadata {
|
|
118
|
+
/**
|
|
119
|
+
* Human-readable name for the resource (e.g., "Production API Key", "Staging
|
|
120
|
+
* Workspace")
|
|
121
|
+
*/
|
|
122
|
+
name: string;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* External ID for the resource (e.g., a workflow ID from an external system)
|
|
126
|
+
*/
|
|
127
|
+
externalId?: string;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Arbitrary key-value pairs for categorization and filtering Examples:
|
|
131
|
+
* {"environment": "production", "team": "platform", "version": "v2"}
|
|
132
|
+
*/
|
|
133
|
+
labels?: { [key: string]: string };
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export interface WorkspaceAdminListParams extends CursorPaginationParams {
|
|
138
|
+
/**
|
|
139
|
+
* When true, archived workspaces are included in the results. Defaults to false
|
|
140
|
+
* (active workspaces only).
|
|
141
|
+
*/
|
|
142
|
+
includeArchived?: boolean;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
WorkspaceAdmin.Members = Members;
|
|
146
|
+
|
|
147
|
+
export declare namespace WorkspaceAdmin {
|
|
148
|
+
export {
|
|
149
|
+
type WorkspaceMember as WorkspaceMember,
|
|
150
|
+
type WorkspaceAdminCreateParams as WorkspaceAdminCreateParams,
|
|
151
|
+
type WorkspaceAdminListParams as WorkspaceAdminListParams,
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
export {
|
|
155
|
+
Members as Members,
|
|
156
|
+
type MemberListParams as MemberListParams,
|
|
157
|
+
type MemberAddParams as MemberAddParams,
|
|
158
|
+
type MemberRemoveParams as MemberRemoveParams,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export { type WorkspacesCursorPagination };
|
|
@@ -1,3 +1,78 @@
|
|
|
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 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.
|
|
1
|
+
export const VERSION = '0.81.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.81.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.81.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.81.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|
package/resources/profiles.d.mts
DELETED
|
@@ -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"}
|