@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.
- package/CHANGELOG.md +8 -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 +111 -0
- package/resources/workspace-admin/workspace-admin.d.mts.map +1 -0
- package/resources/workspace-admin/workspace-admin.d.ts +111 -0
- package/resources/workspace-admin/workspace-admin.d.ts.map +1 -0
- package/resources/workspace-admin/workspace-admin.js +60 -0
- package/resources/workspace-admin/workspace-admin.js.map +1 -0
- package/resources/workspace-admin/workspace-admin.mjs +55 -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 +160 -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
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import { CursorPagination } from "../../core/pagination.mjs";
|
|
4
|
+
import { buildHeaders } from "../../internal/headers.mjs";
|
|
5
|
+
import { path } from "../../internal/utils/path.mjs";
|
|
6
|
+
/**
|
|
7
|
+
* Administer workspaces across the account: create and archive workspaces and
|
|
8
|
+
* manage their membership. These operations are account-scoped and require the
|
|
9
|
+
* admin role (a token whose profile holds the WorkOS admin role); they live
|
|
10
|
+
* under /v1/account/workspaces rather than the workspace-scoped /v1/workspaces
|
|
11
|
+
* tree so an admin can manage any workspace in the account, including ones they
|
|
12
|
+
* are not themselves a member of.
|
|
13
|
+
*/
|
|
14
|
+
export class Members extends APIResource {
|
|
15
|
+
/**
|
|
16
|
+
* Lists the members of a workspace. Admin only.
|
|
17
|
+
*/
|
|
18
|
+
list(workspaceID, query = {}, options) {
|
|
19
|
+
return this._client.getAPIList(path `/v1/account/workspaces/${workspaceID}/members`, (CursorPagination), { query, ...options });
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Grants a profile access to the workspace by creating (or reactivating) the actor
|
|
23
|
+
* that links the profile to the workspace. Accepts either an existing profile_id
|
|
24
|
+
* or an email to resolve-or-invite. Idempotent for an already-active member. Admin
|
|
25
|
+
* only.
|
|
26
|
+
*/
|
|
27
|
+
add(workspaceID, body, options) {
|
|
28
|
+
return this._client.post(path `/v1/account/workspaces/${workspaceID}/members`, { body, ...options });
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Revokes a member's access by deactivating their actor; the member is immediately
|
|
32
|
+
* cut off. The underlying profile is not deleted. Admin only.
|
|
33
|
+
*/
|
|
34
|
+
remove(profileID, params, options) {
|
|
35
|
+
const { workspaceId } = params;
|
|
36
|
+
return this._client.delete(path `/v1/account/workspaces/${workspaceId}/members/${profileID}`, {
|
|
37
|
+
...options,
|
|
38
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=members.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"members.mjs","sourceRoot":"","sources":["../../src/resources/workspace-admin/members.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAIlD,OAAO,EAAE,gBAAgB,EAA4C,kCAA8B;AACnG,OAAO,EAAE,YAAY,EAAE,mCAA+B;AAEtD,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD;;;;;;;GAOG;AACH,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;OAEG;IACH,IAAI,CACF,WAAmB,EACnB,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAI,CAAA,0BAA0B,WAAW,UAAU,EACnD,CAAA,gBAAmD,CAAA,EACnD,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,GAAG,CACD,WAAmB,EACnB,IAAqB,EACrB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,0BAA0B,WAAW,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtG,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,SAAiB,EAAE,MAA0B,EAAE,OAAwB;QAC5E,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,0BAA0B,WAAW,YAAY,SAAS,EAAE,EAAE;YAC3F,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
+
import * as WorkspacesAPI from "../workspaces.mjs";
|
|
3
|
+
import { WorkspacesCursorPagination } from "../workspaces.mjs";
|
|
4
|
+
import * as MembersAPI from "./members.mjs";
|
|
5
|
+
import { MemberAddParams, MemberListParams, MemberRemoveParams, Members } from "./members.mjs";
|
|
6
|
+
import { APIPromise } from "../../core/api-promise.mjs";
|
|
7
|
+
import { CursorPagination, type CursorPaginationParams, PagePromise } from "../../core/pagination.mjs";
|
|
8
|
+
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
9
|
+
/**
|
|
10
|
+
* Administer workspaces across the account: create and archive workspaces and
|
|
11
|
+
* manage their membership. These operations are account-scoped and require the
|
|
12
|
+
* admin role (a token whose profile holds the WorkOS admin role); they live
|
|
13
|
+
* under /v1/account/workspaces rather than the workspace-scoped /v1/workspaces
|
|
14
|
+
* tree so an admin can manage any workspace in the account, including ones they
|
|
15
|
+
* are not themselves a member of.
|
|
16
|
+
*/
|
|
17
|
+
export declare class WorkspaceAdmin extends APIResource {
|
|
18
|
+
members: MembersAPI.Members;
|
|
19
|
+
/**
|
|
20
|
+
* Creates a new workspace in the account. Admin only.
|
|
21
|
+
*/
|
|
22
|
+
create(body: WorkspaceAdminCreateParams, options?: RequestOptions): APIPromise<WorkspacesAPI.Workspace>;
|
|
23
|
+
/**
|
|
24
|
+
* Retrieves a workspace in the account by ID. Admin only.
|
|
25
|
+
*/
|
|
26
|
+
retrieve(workspaceID: string, options?: RequestOptions): APIPromise<WorkspacesAPI.Workspace>;
|
|
27
|
+
/**
|
|
28
|
+
* Lists every workspace in the account, optionally including archived ones. Admin
|
|
29
|
+
* only.
|
|
30
|
+
*/
|
|
31
|
+
list(query?: WorkspaceAdminListParams | null | undefined, options?: RequestOptions): PagePromise<WorkspacesCursorPagination, WorkspacesAPI.Workspace>;
|
|
32
|
+
/**
|
|
33
|
+
* Archives a workspace (soft delete). The workspace is retained, but any
|
|
34
|
+
* subsequent request scoped to it returns a permission error. Admin only.
|
|
35
|
+
*/
|
|
36
|
+
archive(workspaceID: string, options?: RequestOptions): APIPromise<void>;
|
|
37
|
+
}
|
|
38
|
+
export type WorkspaceMembersCursorPagination = CursorPagination<WorkspaceMember>;
|
|
39
|
+
/**
|
|
40
|
+
* A member of a workspace: the profile granted access plus the actor row that
|
|
41
|
+
* links it to the workspace. Returned by member list/add operations.
|
|
42
|
+
*/
|
|
43
|
+
export interface WorkspaceMember {
|
|
44
|
+
/**
|
|
45
|
+
* The actor row linking the profile to the workspace (the junction record).
|
|
46
|
+
*/
|
|
47
|
+
actorId: string;
|
|
48
|
+
/**
|
|
49
|
+
* The account profile that has access to the workspace.
|
|
50
|
+
*/
|
|
51
|
+
profileId: string;
|
|
52
|
+
/**
|
|
53
|
+
* When the member was added to the workspace.
|
|
54
|
+
*/
|
|
55
|
+
addedAt?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Email address of the member's profile.
|
|
58
|
+
*/
|
|
59
|
+
email?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Display name of the member's profile.
|
|
62
|
+
*/
|
|
63
|
+
name?: string;
|
|
64
|
+
}
|
|
65
|
+
export interface WorkspaceAdminCreateParams {
|
|
66
|
+
/**
|
|
67
|
+
* CreateAccountResourceMetadata contains the user-provided fields for creating an
|
|
68
|
+
* account-scoped resource. Read-only fields (id, account_id, profile_id) are
|
|
69
|
+
* excluded since they are set by the server.
|
|
70
|
+
*/
|
|
71
|
+
metadata: WorkspaceAdminCreateParams.Metadata;
|
|
72
|
+
spec: WorkspacesAPI.WorkspaceSpec;
|
|
73
|
+
}
|
|
74
|
+
export declare namespace WorkspaceAdminCreateParams {
|
|
75
|
+
/**
|
|
76
|
+
* CreateAccountResourceMetadata contains the user-provided fields for creating an
|
|
77
|
+
* account-scoped resource. Read-only fields (id, account_id, profile_id) are
|
|
78
|
+
* excluded since they are set by the server.
|
|
79
|
+
*/
|
|
80
|
+
interface Metadata {
|
|
81
|
+
/**
|
|
82
|
+
* Human-readable name for the resource (e.g., "Production API Key", "Staging
|
|
83
|
+
* Workspace")
|
|
84
|
+
*/
|
|
85
|
+
name: string;
|
|
86
|
+
/**
|
|
87
|
+
* External ID for the resource (e.g., a workflow ID from an external system)
|
|
88
|
+
*/
|
|
89
|
+
externalId?: string;
|
|
90
|
+
/**
|
|
91
|
+
* Arbitrary key-value pairs for categorization and filtering Examples:
|
|
92
|
+
* {"environment": "production", "team": "platform", "version": "v2"}
|
|
93
|
+
*/
|
|
94
|
+
labels?: {
|
|
95
|
+
[key: string]: string;
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
export interface WorkspaceAdminListParams extends CursorPaginationParams {
|
|
100
|
+
/**
|
|
101
|
+
* When true, archived workspaces are included in the results. Defaults to false
|
|
102
|
+
* (active workspaces only).
|
|
103
|
+
*/
|
|
104
|
+
includeArchived?: boolean;
|
|
105
|
+
}
|
|
106
|
+
export declare namespace WorkspaceAdmin {
|
|
107
|
+
export { type WorkspaceMember as WorkspaceMember, type WorkspaceAdminCreateParams as WorkspaceAdminCreateParams, type WorkspaceAdminListParams as WorkspaceAdminListParams, };
|
|
108
|
+
export { Members as Members, type MemberListParams as MemberListParams, type MemberAddParams as MemberAddParams, type MemberRemoveParams as MemberRemoveParams, };
|
|
109
|
+
}
|
|
110
|
+
export { type WorkspacesCursorPagination };
|
|
111
|
+
//# sourceMappingURL=workspace-admin.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-admin.d.mts","sourceRoot":"","sources":["../../src/resources/workspace-admin/workspace-admin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,aAAa,0BAAsB;AAC/C,OAAO,EAAE,0BAA0B,EAAE,0BAAsB;AAC3D,OAAO,KAAK,UAAU,sBAAkB;AACxC,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,OAAO,EAAE,sBAAkB;AAC3F,OAAO,EAAE,UAAU,EAAE,mCAA+B;AACpD,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,WAAW,EAAE,kCAA8B;AAEnG,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAGhE;;;;;;;GAOG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,OAAO,EAAE,UAAU,CAAC,OAAO,CAAwC;IAEnE;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,0BAA0B,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC,SAAS,CAAC;IAIvG;;OAEG;IAC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M,CAAC,OAAO,WAAW,cAAc,CAAC;IACtC,OAAO,EACL,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;IAEF,OAAO,EACL,OAAO,IAAI,OAAO,EAClB,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH;AAED,OAAO,EAAE,KAAK,0BAA0B,EAAE,CAAC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import * as WorkspacesAPI from "../workspaces.js";
|
|
3
|
+
import { WorkspacesCursorPagination } from "../workspaces.js";
|
|
4
|
+
import * as MembersAPI from "./members.js";
|
|
5
|
+
import { MemberAddParams, MemberListParams, MemberRemoveParams, Members } from "./members.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
|
+
* Administer workspaces across the account: create and archive workspaces and
|
|
11
|
+
* manage their membership. These operations are account-scoped and require the
|
|
12
|
+
* admin role (a token whose profile holds the WorkOS admin role); they live
|
|
13
|
+
* under /v1/account/workspaces rather than the workspace-scoped /v1/workspaces
|
|
14
|
+
* tree so an admin can manage any workspace in the account, including ones they
|
|
15
|
+
* are not themselves a member of.
|
|
16
|
+
*/
|
|
17
|
+
export declare class WorkspaceAdmin extends APIResource {
|
|
18
|
+
members: MembersAPI.Members;
|
|
19
|
+
/**
|
|
20
|
+
* Creates a new workspace in the account. Admin only.
|
|
21
|
+
*/
|
|
22
|
+
create(body: WorkspaceAdminCreateParams, options?: RequestOptions): APIPromise<WorkspacesAPI.Workspace>;
|
|
23
|
+
/**
|
|
24
|
+
* Retrieves a workspace in the account by ID. Admin only.
|
|
25
|
+
*/
|
|
26
|
+
retrieve(workspaceID: string, options?: RequestOptions): APIPromise<WorkspacesAPI.Workspace>;
|
|
27
|
+
/**
|
|
28
|
+
* Lists every workspace in the account, optionally including archived ones. Admin
|
|
29
|
+
* only.
|
|
30
|
+
*/
|
|
31
|
+
list(query?: WorkspaceAdminListParams | null | undefined, options?: RequestOptions): PagePromise<WorkspacesCursorPagination, WorkspacesAPI.Workspace>;
|
|
32
|
+
/**
|
|
33
|
+
* Archives a workspace (soft delete). The workspace is retained, but any
|
|
34
|
+
* subsequent request scoped to it returns a permission error. Admin only.
|
|
35
|
+
*/
|
|
36
|
+
archive(workspaceID: string, options?: RequestOptions): APIPromise<void>;
|
|
37
|
+
}
|
|
38
|
+
export type WorkspaceMembersCursorPagination = CursorPagination<WorkspaceMember>;
|
|
39
|
+
/**
|
|
40
|
+
* A member of a workspace: the profile granted access plus the actor row that
|
|
41
|
+
* links it to the workspace. Returned by member list/add operations.
|
|
42
|
+
*/
|
|
43
|
+
export interface WorkspaceMember {
|
|
44
|
+
/**
|
|
45
|
+
* The actor row linking the profile to the workspace (the junction record).
|
|
46
|
+
*/
|
|
47
|
+
actorId: string;
|
|
48
|
+
/**
|
|
49
|
+
* The account profile that has access to the workspace.
|
|
50
|
+
*/
|
|
51
|
+
profileId: string;
|
|
52
|
+
/**
|
|
53
|
+
* When the member was added to the workspace.
|
|
54
|
+
*/
|
|
55
|
+
addedAt?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Email address of the member's profile.
|
|
58
|
+
*/
|
|
59
|
+
email?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Display name of the member's profile.
|
|
62
|
+
*/
|
|
63
|
+
name?: string;
|
|
64
|
+
}
|
|
65
|
+
export interface WorkspaceAdminCreateParams {
|
|
66
|
+
/**
|
|
67
|
+
* CreateAccountResourceMetadata contains the user-provided fields for creating an
|
|
68
|
+
* account-scoped resource. Read-only fields (id, account_id, profile_id) are
|
|
69
|
+
* excluded since they are set by the server.
|
|
70
|
+
*/
|
|
71
|
+
metadata: WorkspaceAdminCreateParams.Metadata;
|
|
72
|
+
spec: WorkspacesAPI.WorkspaceSpec;
|
|
73
|
+
}
|
|
74
|
+
export declare namespace WorkspaceAdminCreateParams {
|
|
75
|
+
/**
|
|
76
|
+
* CreateAccountResourceMetadata contains the user-provided fields for creating an
|
|
77
|
+
* account-scoped resource. Read-only fields (id, account_id, profile_id) are
|
|
78
|
+
* excluded since they are set by the server.
|
|
79
|
+
*/
|
|
80
|
+
interface Metadata {
|
|
81
|
+
/**
|
|
82
|
+
* Human-readable name for the resource (e.g., "Production API Key", "Staging
|
|
83
|
+
* Workspace")
|
|
84
|
+
*/
|
|
85
|
+
name: string;
|
|
86
|
+
/**
|
|
87
|
+
* External ID for the resource (e.g., a workflow ID from an external system)
|
|
88
|
+
*/
|
|
89
|
+
externalId?: string;
|
|
90
|
+
/**
|
|
91
|
+
* Arbitrary key-value pairs for categorization and filtering Examples:
|
|
92
|
+
* {"environment": "production", "team": "platform", "version": "v2"}
|
|
93
|
+
*/
|
|
94
|
+
labels?: {
|
|
95
|
+
[key: string]: string;
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
export interface WorkspaceAdminListParams extends CursorPaginationParams {
|
|
100
|
+
/**
|
|
101
|
+
* When true, archived workspaces are included in the results. Defaults to false
|
|
102
|
+
* (active workspaces only).
|
|
103
|
+
*/
|
|
104
|
+
includeArchived?: boolean;
|
|
105
|
+
}
|
|
106
|
+
export declare namespace WorkspaceAdmin {
|
|
107
|
+
export { type WorkspaceMember as WorkspaceMember, type WorkspaceAdminCreateParams as WorkspaceAdminCreateParams, type WorkspaceAdminListParams as WorkspaceAdminListParams, };
|
|
108
|
+
export { Members as Members, type MemberListParams as MemberListParams, type MemberAddParams as MemberAddParams, type MemberRemoveParams as MemberRemoveParams, };
|
|
109
|
+
}
|
|
110
|
+
export { type WorkspacesCursorPagination };
|
|
111
|
+
//# sourceMappingURL=workspace-admin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-admin.d.ts","sourceRoot":"","sources":["../../src/resources/workspace-admin/workspace-admin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,aAAa,yBAAsB;AAC/C,OAAO,EAAE,0BAA0B,EAAE,yBAAsB;AAC3D,OAAO,KAAK,UAAU,qBAAkB;AACxC,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,OAAO,EAAE,qBAAkB;AAC3F,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,WAAW,EAAE,iCAA8B;AAEnG,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAGhE;;;;;;;GAOG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,OAAO,EAAE,UAAU,CAAC,OAAO,CAAwC;IAEnE;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,0BAA0B,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC,SAAS,CAAC;IAIvG;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC,SAAS,CAAC;IAI5F;;;OAGG;IACH,IAAI,CACF,KAAK,GAAE,wBAAwB,GAAG,IAAI,GAAG,SAAc,EACvD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,0BAA0B,EAAE,aAAa,CAAC,SAAS,CAAC;IAOnE;;;OAGG;IACH,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAMzE;AAED,MAAM,MAAM,gCAAgC,GAAG,gBAAgB,CAAC,eAAe,CAAC,CAAC;AAEjF;;;GAGG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|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.WorkspaceAdmin = void 0;
|
|
5
|
+
const tslib_1 = require("../../internal/tslib.js");
|
|
6
|
+
const resource_1 = require("../../core/resource.js");
|
|
7
|
+
const MembersAPI = tslib_1.__importStar(require("./members.js"));
|
|
8
|
+
const members_1 = require("./members.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
|
+
* 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
|
+
class WorkspaceAdmin extends resource_1.APIResource {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
this.members = new MembersAPI.Members(this._client);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Creates a new workspace in the account. Admin only.
|
|
27
|
+
*/
|
|
28
|
+
create(body, options) {
|
|
29
|
+
return this._client.post('/v1/account/workspaces', { body, ...options });
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Retrieves a workspace in the account by ID. Admin only.
|
|
33
|
+
*/
|
|
34
|
+
retrieve(workspaceID, options) {
|
|
35
|
+
return this._client.get((0, path_1.path) `/v1/account/workspaces/${workspaceID}`, options);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Lists every workspace in the account, optionally including archived ones. Admin
|
|
39
|
+
* only.
|
|
40
|
+
*/
|
|
41
|
+
list(query = {}, options) {
|
|
42
|
+
return this._client.getAPIList('/v1/account/workspaces', (pagination_1.CursorPagination), {
|
|
43
|
+
query,
|
|
44
|
+
...options,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Archives a workspace (soft delete). The workspace is retained, but any
|
|
49
|
+
* subsequent request scoped to it returns a permission error. Admin only.
|
|
50
|
+
*/
|
|
51
|
+
archive(workspaceID, options) {
|
|
52
|
+
return this._client.delete((0, path_1.path) `/v1/account/workspaces/${workspaceID}`, {
|
|
53
|
+
...options,
|
|
54
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.WorkspaceAdmin = WorkspaceAdmin;
|
|
59
|
+
WorkspaceAdmin.Members = members_1.Members;
|
|
60
|
+
//# sourceMappingURL=workspace-admin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-admin.js","sourceRoot":"","sources":["../../src/resources/workspace-admin/workspace-admin.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAGlD,iEAAwC;AACxC,0CAA2F;AAE3F,yDAAmG;AACnG,uDAAsD;AAEtD,uDAAiD;AAEjD;;;;;;;GAOG;AACH,MAAa,cAAe,SAAQ,sBAAW;IAA/C;;QACE,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAwCrE,CAAC;IAtCC;;OAEG;IACH,MAAM,CAAC,IAAgC,EAAE,OAAwB;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,WAAmB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,0BAA0B,WAAW,EAAE,EAAE,OAAO,CAAC,CAAC;IAChF,CAAC;IAED;;;OAGG;IACH,IAAI,CACF,QAAqD,EAAE,EACvD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,wBAAwB,EAAE,CAAA,6BAAyC,CAAA,EAAE;YAClG,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,OAAO,CAAC,WAAmB,EAAE,OAAwB;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,0BAA0B,WAAW,EAAE,EAAE;YACtE,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF;AAzCD,wCAyCC;AAgFD,cAAc,CAAC,OAAO,GAAG,iBAAO,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import * as MembersAPI from "./members.mjs";
|
|
4
|
+
import { Members } from "./members.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
|
+
* Administer workspaces across the account: create and archive workspaces and
|
|
10
|
+
* manage their membership. These operations are account-scoped and require the
|
|
11
|
+
* admin role (a token whose profile holds the WorkOS admin role); they live
|
|
12
|
+
* under /v1/account/workspaces rather than the workspace-scoped /v1/workspaces
|
|
13
|
+
* tree so an admin can manage any workspace in the account, including ones they
|
|
14
|
+
* are not themselves a member of.
|
|
15
|
+
*/
|
|
16
|
+
export class WorkspaceAdmin extends APIResource {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this.members = new MembersAPI.Members(this._client);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Creates a new workspace in the account. Admin only.
|
|
23
|
+
*/
|
|
24
|
+
create(body, options) {
|
|
25
|
+
return this._client.post('/v1/account/workspaces', { body, ...options });
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Retrieves a workspace in the account by ID. Admin only.
|
|
29
|
+
*/
|
|
30
|
+
retrieve(workspaceID, options) {
|
|
31
|
+
return this._client.get(path `/v1/account/workspaces/${workspaceID}`, options);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Lists every workspace in the account, optionally including archived ones. Admin
|
|
35
|
+
* only.
|
|
36
|
+
*/
|
|
37
|
+
list(query = {}, options) {
|
|
38
|
+
return this._client.getAPIList('/v1/account/workspaces', (CursorPagination), {
|
|
39
|
+
query,
|
|
40
|
+
...options,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Archives a workspace (soft delete). The workspace is retained, but any
|
|
45
|
+
* subsequent request scoped to it returns a permission error. Admin only.
|
|
46
|
+
*/
|
|
47
|
+
archive(workspaceID, options) {
|
|
48
|
+
return this._client.delete(path `/v1/account/workspaces/${workspaceID}`, {
|
|
49
|
+
...options,
|
|
50
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
WorkspaceAdmin.Members = Members;
|
|
55
|
+
//# sourceMappingURL=workspace-admin.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-admin.mjs","sourceRoot":"","sources":["../../src/resources/workspace-admin/workspace-admin.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAGlD,OAAO,KAAK,UAAU,sBAAkB;AACxC,OAAO,EAAyD,OAAO,EAAE,sBAAkB;AAE3F,OAAO,EAAE,gBAAgB,EAA4C,kCAA8B;AACnG,O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AwC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-admin.d.ts","sourceRoot":"","sources":["../src/resources/workspace-admin.ts"],"names":[],"mappings":"AAEA,2CAAwC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
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
|
+
const tslib_1 = require("../internal/tslib.js");
|
|
5
|
+
tslib_1.__exportStar(require("./workspace-admin/index.js"), exports);
|
|
6
|
+
//# sourceMappingURL=workspace-admin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-admin.js","sourceRoot":"","sources":["../src/resources/workspace-admin.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qEAAwC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-admin.mjs","sourceRoot":"","sources":["../src/resources/workspace-admin.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,4CAAwC"}
|
|
@@ -1,2 +1,55 @@
|
|
|
1
|
-
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import * as Shared from "./shared.mjs";
|
|
3
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
|
4
|
+
import { CursorPagination, type CursorPaginationParams, PagePromise } from "../core/pagination.mjs";
|
|
5
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
6
|
+
/**
|
|
7
|
+
* Manage workspaces within an account. Workspaces provide organizational
|
|
8
|
+
* grouping and isolation for resources such as agents, tools, and API keys.
|
|
9
|
+
*
|
|
10
|
+
* This is the workspace-scoped, end-user surface. Administrative operations
|
|
11
|
+
* (create / archive workspaces, manage members) live in WorkspaceAdminService
|
|
12
|
+
* under /v1/account/workspaces and require the admin role.
|
|
13
|
+
*/
|
|
14
|
+
export declare class Workspaces extends APIResource {
|
|
15
|
+
/**
|
|
16
|
+
* Lists all workspaces for the current account
|
|
17
|
+
*/
|
|
18
|
+
list(query?: WorkspaceListParams | null | undefined, options?: RequestOptions): PagePromise<WorkspacesCursorPagination, Workspace>;
|
|
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?: RequestOptions): APIPromise<Workspace>;
|
|
24
|
+
}
|
|
25
|
+
export type WorkspacesCursorPagination = CursorPagination<Workspace>;
|
|
26
|
+
export interface Workspace {
|
|
27
|
+
/**
|
|
28
|
+
* AccountResourceMetadata is used to represent a resource that is associated to an
|
|
29
|
+
* account but not to a workspace.
|
|
30
|
+
*/
|
|
31
|
+
metadata: Shared.AccountResourceMetadata;
|
|
32
|
+
spec: WorkspaceSpec;
|
|
33
|
+
/**
|
|
34
|
+
* Lifecycle status of the workspace. Archived workspaces reject all requests
|
|
35
|
+
* scoped to them. Server-populated.
|
|
36
|
+
*/
|
|
37
|
+
status?: 'STATUS_ENABLED' | 'STATUS_DISABLED' | 'STATUS_ARCHIVED';
|
|
38
|
+
}
|
|
39
|
+
export interface WorkspaceSpec {
|
|
40
|
+
description?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface WorkspaceListParams extends CursorPaginationParams {
|
|
43
|
+
/**
|
|
44
|
+
* When set to true you may use more of your alloted API rate-limit
|
|
45
|
+
*/
|
|
46
|
+
includeInfo?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Sort order for results (asc or desc by creation time)
|
|
49
|
+
*/
|
|
50
|
+
sortOrder?: string;
|
|
51
|
+
}
|
|
52
|
+
export declare namespace Workspaces {
|
|
53
|
+
export { type Workspace as Workspace, type WorkspaceSpec as WorkspaceSpec, type WorkspacesCursorPagination as WorkspacesCursorPagination, type WorkspaceListParams as WorkspaceListParams, };
|
|
54
|
+
}
|
|
2
55
|
//# sourceMappingURL=workspaces.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspaces.d.mts","sourceRoot":"","sources":["../src/resources/workspaces.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"workspaces.d.mts","sourceRoot":"","sources":["../src/resources/workspaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,KAAK,MAAM,qBAAiB;AACnC,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACjD,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,WAAW,EAAE,+BAA2B;AAChG,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAE7D;;;;;;;GAOG;AACH,qBAAa,UAAW,SAAQ,WAAW;IACzC;;OAEG;IACH,IAAI,CACF,KAAK,GAAE,mBAAmB,GAAG,IAAI,GAAG,SAAc,EAClD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,0BAA0B,EAAE,SAAS,CAAC;IAIrD;;;OAGG;IACH,GAAG,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC;CAGrD;AAED,MAAM,MAAM,0BAA0B,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;AAErE,MAAM,WAAW,SAAS;IACxB;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC,uBAAuB,CAAC;IAEzC,IAAI,EAAE,aAAa,CAAC;IAEpB;;;OAGG;IACH,MAAM,CAAC,EAAE,gBAAgB,GAAG,iBAAiB,GAAG,iBAAiB,CAAC;CACnE;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,mBAAoB,SAAQ,sBAAsB;IACjE;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,WAAW,UAAU,CAAC;IAClC,OAAO,EACL,KAAK,SAAS,IAAI,SAAS,EAC3B,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
|
|
@@ -1,2 +1,55 @@
|
|
|
1
|
-
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import * as Shared from "./shared.js";
|
|
3
|
+
import { APIPromise } from "../core/api-promise.js";
|
|
4
|
+
import { CursorPagination, type CursorPaginationParams, PagePromise } from "../core/pagination.js";
|
|
5
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
6
|
+
/**
|
|
7
|
+
* Manage workspaces within an account. Workspaces provide organizational
|
|
8
|
+
* grouping and isolation for resources such as agents, tools, and API keys.
|
|
9
|
+
*
|
|
10
|
+
* This is the workspace-scoped, end-user surface. Administrative operations
|
|
11
|
+
* (create / archive workspaces, manage members) live in WorkspaceAdminService
|
|
12
|
+
* under /v1/account/workspaces and require the admin role.
|
|
13
|
+
*/
|
|
14
|
+
export declare class Workspaces extends APIResource {
|
|
15
|
+
/**
|
|
16
|
+
* Lists all workspaces for the current account
|
|
17
|
+
*/
|
|
18
|
+
list(query?: WorkspaceListParams | null | undefined, options?: RequestOptions): PagePromise<WorkspacesCursorPagination, Workspace>;
|
|
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?: RequestOptions): APIPromise<Workspace>;
|
|
24
|
+
}
|
|
25
|
+
export type WorkspacesCursorPagination = CursorPagination<Workspace>;
|
|
26
|
+
export interface Workspace {
|
|
27
|
+
/**
|
|
28
|
+
* AccountResourceMetadata is used to represent a resource that is associated to an
|
|
29
|
+
* account but not to a workspace.
|
|
30
|
+
*/
|
|
31
|
+
metadata: Shared.AccountResourceMetadata;
|
|
32
|
+
spec: WorkspaceSpec;
|
|
33
|
+
/**
|
|
34
|
+
* Lifecycle status of the workspace. Archived workspaces reject all requests
|
|
35
|
+
* scoped to them. Server-populated.
|
|
36
|
+
*/
|
|
37
|
+
status?: 'STATUS_ENABLED' | 'STATUS_DISABLED' | 'STATUS_ARCHIVED';
|
|
38
|
+
}
|
|
39
|
+
export interface WorkspaceSpec {
|
|
40
|
+
description?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface WorkspaceListParams extends CursorPaginationParams {
|
|
43
|
+
/**
|
|
44
|
+
* When set to true you may use more of your alloted API rate-limit
|
|
45
|
+
*/
|
|
46
|
+
includeInfo?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Sort order for results (asc or desc by creation time)
|
|
49
|
+
*/
|
|
50
|
+
sortOrder?: string;
|
|
51
|
+
}
|
|
52
|
+
export declare namespace Workspaces {
|
|
53
|
+
export { type Workspace as Workspace, type WorkspaceSpec as WorkspaceSpec, type WorkspacesCursorPagination as WorkspacesCursorPagination, type WorkspaceListParams as WorkspaceListParams, };
|
|
54
|
+
}
|
|
2
55
|
//# sourceMappingURL=workspaces.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspaces.d.ts","sourceRoot":"","sources":["../src/resources/workspaces.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"workspaces.d.ts","sourceRoot":"","sources":["../src/resources/workspaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,KAAK,MAAM,oBAAiB;AACnC,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,WAAW,EAAE,8BAA2B;AAChG,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAE7D;;;;;;;GAOG;AACH,qBAAa,UAAW,SAAQ,WAAW;IACzC;;OAEG;IACH,IAAI,CACF,KAAK,GAAE,mBAAmB,GAAG,IAAI,GAAG,SAAc,EAClD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,0BAA0B,EAAE,SAAS,CAAC;IAIrD;;;OAGG;IACH,GAAG,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC;CAGrD;AAED,MAAM,MAAM,0BAA0B,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;AAErE,MAAM,WAAW,SAAS;IACxB;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC,uBAAuB,CAAC;IAEzC,IAAI,EAAE,aAAa,CAAC;IAEpB;;;OAGG;IACH,MAAM,CAAC,EAAE,gBAAgB,GAAG,iBAAiB,GAAG,iBAAiB,CAAC;CACnE;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,mBAAoB,SAAQ,sBAAsB;IACjE;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,WAAW,UAAU,CAAC;IAClC,OAAO,EACL,KAAK,SAAS,IAAI,SAAS,EAC3B,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
|
package/resources/workspaces.js
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
exports.Workspaces = void 0;
|
|
5
|
+
const resource_1 = require("../core/resource.js");
|
|
6
|
+
const pagination_1 = require("../core/pagination.js");
|
|
7
|
+
/**
|
|
8
|
+
* Manage workspaces within an account. Workspaces provide organizational
|
|
9
|
+
* grouping and isolation for resources such as agents, tools, and API keys.
|
|
10
|
+
*
|
|
11
|
+
* This is the workspace-scoped, end-user surface. Administrative operations
|
|
12
|
+
* (create / archive workspaces, manage members) live in WorkspaceAdminService
|
|
13
|
+
* under /v1/account/workspaces and require the admin role.
|
|
14
|
+
*/
|
|
15
|
+
class Workspaces extends resource_1.APIResource {
|
|
16
|
+
/**
|
|
17
|
+
* Lists all workspaces for the current account
|
|
18
|
+
*/
|
|
19
|
+
list(query = {}, options) {
|
|
20
|
+
return this._client.getAPIList('/v1/workspaces', (pagination_1.CursorPagination), { query, ...options });
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Retrieves the workspace associated with the current API token. Useful for
|
|
24
|
+
* workspace-scoped tokens to identify which workspace they belong to.
|
|
25
|
+
*/
|
|
26
|
+
get(options) {
|
|
27
|
+
return this._client.get('/v1/workspaces/current', options);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.Workspaces = Workspaces;
|
|
6
31
|
//# sourceMappingURL=workspaces.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspaces.js","sourceRoot":"","sources":["../src/resources/workspaces.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"workspaces.js","sourceRoot":"","sources":["../src/resources/workspaces.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,sDAAgG;AAGhG;;;;;;;GAOG;AACH,MAAa,UAAW,SAAQ,sBAAW;IACzC;;OAEG;IACH,IAAI,CACF,QAAgD,EAAE,EAClD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAA,6BAA2B,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;AAlBD,gCAkBC"}
|
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"}
|