@cadenya/cadenya 0.78.1 → 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 +16 -0
- package/client.d.mts +15 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +15 -0
- package/client.d.ts.map +1 -1
- package/client.js +15 -0
- package/client.js.map +1 -1
- package/client.mjs +15 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/index.d.mts +1 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- 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/workspace-admin/index.js +9 -0
- package/resources/workspace-admin/index.js.map +1 -0
- package/resources/workspace-admin/index.mjs +4 -0
- 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 +9 -0
- package/resources/workspaces.d.mts.map +1 -1
- package/resources/workspaces.d.ts +9 -0
- package/resources/workspaces.d.ts.map +1 -1
- package/resources/workspaces.js +4 -0
- package/resources/workspaces.js.map +1 -1
- package/resources/workspaces.mjs +4 -0
- package/resources/workspaces.mjs.map +1 -1
- package/src/client.ts +27 -0
- package/src/resources/index.ts +7 -0
- package/src/resources/workspace-admin/index.ts +10 -0
- 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 +10 -0
- 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/index.mjs
CHANGED
|
@@ -11,6 +11,7 @@ export { Search, } from "./search.mjs";
|
|
|
11
11
|
export { ToolSets, } from "./tool-sets/tool-sets.mjs";
|
|
12
12
|
export { Uploads, } from "./uploads.mjs";
|
|
13
13
|
export { Webhooks } from "./webhooks.mjs";
|
|
14
|
+
export { WorkspaceAdmin, } from "./workspace-admin/workspace-admin.mjs";
|
|
14
15
|
export { WorkspaceSecrets, } from "./workspace-secrets.mjs";
|
|
15
16
|
export { Workspaces, } from "./workspaces.mjs";
|
|
16
17
|
//# sourceMappingURL=index.mjs.map
|
package/resources/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,6BAAyB;AACzB,OAAO,EACL,OAAO,GAQR,gCAA4B;AAC7B,OAAO,EACL,eAAe,GAOhB,sBAAkB;AACnB,OAAO,EACL,MAAM,GAWP,4BAAwB;AACzB,OAAO,EACL,sBAAsB,GAkBvB,gEAA4D;AAC7D,OAAO,EACL,YAAY,GAUb,0CAAsC;AACvC,OAAO,EACL,MAAM,GAOP,qBAAiB;AAClB,OAAO,EACL,UAAU,GAyCX,oCAAgC;AACjC,OAAO,EACL,MAAM,GAGP,qBAAiB;AAClB,OAAO,EACL,QAAQ,GA2BT,kCAA8B;AAC/B,OAAO,EACL,OAAO,GAMR,sBAAkB;AACnB,OAAO,EAAE,QAAQ,EAA0D,uBAAmB;AAC9F,OAAO,EACL,gBAAgB,GAUjB,gCAA4B;AAC7B,OAAO,EACL,UAAU,GAKX,yBAAqB"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,6BAAyB;AACzB,OAAO,EACL,OAAO,GAQR,gCAA4B;AAC7B,OAAO,EACL,eAAe,GAOhB,sBAAkB;AACnB,OAAO,EACL,MAAM,GAWP,4BAAwB;AACzB,OAAO,EACL,sBAAsB,GAkBvB,gEAA4D;AAC7D,OAAO,EACL,YAAY,GAUb,0CAAsC;AACvC,OAAO,EACL,MAAM,GAOP,qBAAiB;AAClB,OAAO,EACL,UAAU,GAyCX,oCAAgC;AACjC,OAAO,EACL,MAAM,GAGP,qBAAiB;AAClB,OAAO,EACL,QAAQ,GA2BT,kCAA8B;AAC/B,OAAO,EACL,OAAO,GAMR,sBAAkB;AACnB,OAAO,EAAE,QAAQ,EAA0D,uBAAmB;AAC9F,OAAO,EACL,cAAc,GAKf,8CAA0C;AAC3C,OAAO,EACL,gBAAgB,GAUjB,gCAA4B;AAC7B,OAAO,EACL,UAAU,GAKX,yBAAqB"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { Members, type MemberListParams, type MemberAddParams, type MemberRemoveParams } from "./members.mjs";
|
|
2
|
+
export { WorkspaceAdmin, type WorkspaceMember, type WorkspaceAdminCreateParams, type WorkspaceAdminListParams, type WorkspaceMembersCursorPagination, } from "./workspace-admin.mjs";
|
|
3
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/workspace-admin/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,KAAK,kBAAkB,EAAE,sBAAkB;AAC1G,OAAO,EACL,cAAc,EACd,KAAK,eAAe,EACpB,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,gCAAgC,GACtC,8BAA0B"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { Members, type MemberListParams, type MemberAddParams, type MemberRemoveParams } from "./members.js";
|
|
2
|
+
export { WorkspaceAdmin, type WorkspaceMember, type WorkspaceAdminCreateParams, type WorkspaceAdminListParams, type WorkspaceMembersCursorPagination, } from "./workspace-admin.js";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/workspace-admin/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,KAAK,kBAAkB,EAAE,qBAAkB;AAC1G,OAAO,EACL,cAAc,EACd,KAAK,eAAe,EACpB,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,gCAAgC,GACtC,6BAA0B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.WorkspaceAdmin = exports.Members = void 0;
|
|
5
|
+
var members_1 = require("./members.js");
|
|
6
|
+
Object.defineProperty(exports, "Members", { enumerable: true, get: function () { return members_1.Members; } });
|
|
7
|
+
var workspace_admin_1 = require("./workspace-admin.js");
|
|
8
|
+
Object.defineProperty(exports, "WorkspaceAdmin", { enumerable: true, get: function () { return workspace_admin_1.WorkspaceAdmin; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/workspace-admin/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wCAA0G;AAAjG,kGAAA,OAAO,OAAA;AAChB,wDAM2B;AALzB,iHAAA,cAAc,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/workspace-admin/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,OAAO,EAAwE,sBAAkB;AAC1G,OAAO,EACL,cAAc,GAKf,8BAA0B"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
+
import * as WorkspaceAdminAPI from "./workspace-admin.mjs";
|
|
3
|
+
import { WorkspaceMembersCursorPagination } from "./workspace-admin.mjs";
|
|
4
|
+
import { APIPromise } from "../../core/api-promise.mjs";
|
|
5
|
+
import { type CursorPaginationParams, PagePromise } from "../../core/pagination.mjs";
|
|
6
|
+
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
7
|
+
/**
|
|
8
|
+
* Administer workspaces across the account: create and archive workspaces and
|
|
9
|
+
* manage their membership. These operations are account-scoped and require the
|
|
10
|
+
* admin role (a token whose profile holds the WorkOS admin role); they live
|
|
11
|
+
* under /v1/account/workspaces rather than the workspace-scoped /v1/workspaces
|
|
12
|
+
* tree so an admin can manage any workspace in the account, including ones they
|
|
13
|
+
* are not themselves a member of.
|
|
14
|
+
*/
|
|
15
|
+
export declare class Members extends APIResource {
|
|
16
|
+
/**
|
|
17
|
+
* Lists the members of a workspace. Admin only.
|
|
18
|
+
*/
|
|
19
|
+
list(workspaceID: string, query?: MemberListParams | null | undefined, options?: RequestOptions): PagePromise<WorkspaceMembersCursorPagination, WorkspaceAdminAPI.WorkspaceMember>;
|
|
20
|
+
/**
|
|
21
|
+
* Grants a profile access to the workspace by creating (or reactivating) the actor
|
|
22
|
+
* that links the profile to the workspace. Accepts either an existing profile_id
|
|
23
|
+
* or an email to resolve-or-invite. Idempotent for an already-active member. Admin
|
|
24
|
+
* only.
|
|
25
|
+
*/
|
|
26
|
+
add(workspaceID: string, body: MemberAddParams, options?: RequestOptions): APIPromise<WorkspaceAdminAPI.WorkspaceMember>;
|
|
27
|
+
/**
|
|
28
|
+
* Revokes a member's access by deactivating their actor; the member is immediately
|
|
29
|
+
* cut off. The underlying profile is not deleted. Admin only.
|
|
30
|
+
*/
|
|
31
|
+
remove(profileID: string, params: MemberRemoveParams, options?: RequestOptions): APIPromise<void>;
|
|
32
|
+
}
|
|
33
|
+
export interface MemberListParams extends CursorPaginationParams {
|
|
34
|
+
}
|
|
35
|
+
export interface MemberAddParams {
|
|
36
|
+
/**
|
|
37
|
+
* Email address to add (resolve-or-invite). Mutually exclusive with profile_id.
|
|
38
|
+
*/
|
|
39
|
+
email?: string;
|
|
40
|
+
/**
|
|
41
|
+
* An existing account profile to add. Mutually exclusive with email.
|
|
42
|
+
*/
|
|
43
|
+
profileId?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface MemberRemoveParams {
|
|
46
|
+
/**
|
|
47
|
+
* The workspace to remove the member from (path).
|
|
48
|
+
*/
|
|
49
|
+
workspaceId: string;
|
|
50
|
+
}
|
|
51
|
+
export declare namespace Members {
|
|
52
|
+
export { type MemberListParams as MemberListParams, type MemberAddParams as MemberAddParams, type MemberRemoveParams as MemberRemoveParams, };
|
|
53
|
+
}
|
|
54
|
+
export { type WorkspaceMembersCursorPagination };
|
|
55
|
+
//# sourceMappingURL=members.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"members.d.mts","sourceRoot":"","sources":["../../src/resources/workspace-admin/members.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,iBAAiB,8BAA0B;AACvD,OAAO,EAAE,gCAAgC,EAAE,8BAA0B;AACrE,OAAO,EAAE,UAAU,EAAE,mCAA+B;AACpD,OAAO,EAAoB,KAAK,sBAAsB,EAAE,WAAW,EAAE,kCAA8B;AAEnG,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAGhE;;;;;;;GAOG;AACH,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;OAEG;IACH,IAAI,CACF,WAAW,EAAE,MAAM,EACnB,KAAK,GAAE,gBAAgB,GAAG,IAAI,GAAG,SAAc,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,gCAAgC,EAAE,iBAAiB,CAAC,eAAe,CAAC;IAQnF;;;;;OAKG;IACH,GAAG,CACD,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,eAAe,EACrB,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,iBAAiB,CAAC,eAAe,CAAC;IAIhD;;;OAGG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAOlG;AAED,MAAM,WAAW,gBAAiB,SAAQ,sBAAsB;CAAG;AAEnE,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH;AAED,OAAO,EAAE,KAAK,gCAAgC,EAAE,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import * as WorkspaceAdminAPI from "./workspace-admin.js";
|
|
3
|
+
import { WorkspaceMembersCursorPagination } from "./workspace-admin.js";
|
|
4
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
5
|
+
import { type CursorPaginationParams, PagePromise } from "../../core/pagination.js";
|
|
6
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
7
|
+
/**
|
|
8
|
+
* Administer workspaces across the account: create and archive workspaces and
|
|
9
|
+
* manage their membership. These operations are account-scoped and require the
|
|
10
|
+
* admin role (a token whose profile holds the WorkOS admin role); they live
|
|
11
|
+
* under /v1/account/workspaces rather than the workspace-scoped /v1/workspaces
|
|
12
|
+
* tree so an admin can manage any workspace in the account, including ones they
|
|
13
|
+
* are not themselves a member of.
|
|
14
|
+
*/
|
|
15
|
+
export declare class Members extends APIResource {
|
|
16
|
+
/**
|
|
17
|
+
* Lists the members of a workspace. Admin only.
|
|
18
|
+
*/
|
|
19
|
+
list(workspaceID: string, query?: MemberListParams | null | undefined, options?: RequestOptions): PagePromise<WorkspaceMembersCursorPagination, WorkspaceAdminAPI.WorkspaceMember>;
|
|
20
|
+
/**
|
|
21
|
+
* Grants a profile access to the workspace by creating (or reactivating) the actor
|
|
22
|
+
* that links the profile to the workspace. Accepts either an existing profile_id
|
|
23
|
+
* or an email to resolve-or-invite. Idempotent for an already-active member. Admin
|
|
24
|
+
* only.
|
|
25
|
+
*/
|
|
26
|
+
add(workspaceID: string, body: MemberAddParams, options?: RequestOptions): APIPromise<WorkspaceAdminAPI.WorkspaceMember>;
|
|
27
|
+
/**
|
|
28
|
+
* Revokes a member's access by deactivating their actor; the member is immediately
|
|
29
|
+
* cut off. The underlying profile is not deleted. Admin only.
|
|
30
|
+
*/
|
|
31
|
+
remove(profileID: string, params: MemberRemoveParams, options?: RequestOptions): APIPromise<void>;
|
|
32
|
+
}
|
|
33
|
+
export interface MemberListParams extends CursorPaginationParams {
|
|
34
|
+
}
|
|
35
|
+
export interface MemberAddParams {
|
|
36
|
+
/**
|
|
37
|
+
* Email address to add (resolve-or-invite). Mutually exclusive with profile_id.
|
|
38
|
+
*/
|
|
39
|
+
email?: string;
|
|
40
|
+
/**
|
|
41
|
+
* An existing account profile to add. Mutually exclusive with email.
|
|
42
|
+
*/
|
|
43
|
+
profileId?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface MemberRemoveParams {
|
|
46
|
+
/**
|
|
47
|
+
* The workspace to remove the member from (path).
|
|
48
|
+
*/
|
|
49
|
+
workspaceId: string;
|
|
50
|
+
}
|
|
51
|
+
export declare namespace Members {
|
|
52
|
+
export { type MemberListParams as MemberListParams, type MemberAddParams as MemberAddParams, type MemberRemoveParams as MemberRemoveParams, };
|
|
53
|
+
}
|
|
54
|
+
export { type WorkspaceMembersCursorPagination };
|
|
55
|
+
//# sourceMappingURL=members.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"members.d.ts","sourceRoot":"","sources":["../../src/resources/workspace-admin/members.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,iBAAiB,6BAA0B;AACvD,OAAO,EAAE,gCAAgC,EAAE,6BAA0B;AACrE,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAAoB,KAAK,sBAAsB,EAAE,WAAW,EAAE,iCAA8B;AAEnG,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAGhE;;;;;;;GAOG;AACH,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;OAEG;IACH,IAAI,CACF,WAAW,EAAE,MAAM,EACnB,KAAK,GAAE,gBAAgB,GAAG,IAAI,GAAG,SAAc,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,gCAAgC,EAAE,iBAAiB,CAAC,eAAe,CAAC;IAQnF;;;;;OAKG;IACH,GAAG,CACD,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,eAAe,EACrB,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,iBAAiB,CAAC,eAAe,CAAC;IAIhD;;;OAGG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAOlG;AAED,MAAM,WAAW,gBAAiB,SAAQ,sBAAsB;CAAG;AAEnE,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH;AAED,OAAO,EAAE,KAAK,gCAAgC,EAAE,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Members = void 0;
|
|
5
|
+
const resource_1 = require("../../core/resource.js");
|
|
6
|
+
const pagination_1 = require("../../core/pagination.js");
|
|
7
|
+
const headers_1 = require("../../internal/headers.js");
|
|
8
|
+
const path_1 = require("../../internal/utils/path.js");
|
|
9
|
+
/**
|
|
10
|
+
* 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
|
+
class Members extends resource_1.APIResource {
|
|
18
|
+
/**
|
|
19
|
+
* Lists the members of a workspace. Admin only.
|
|
20
|
+
*/
|
|
21
|
+
list(workspaceID, query = {}, options) {
|
|
22
|
+
return this._client.getAPIList((0, path_1.path) `/v1/account/workspaces/${workspaceID}/members`, (pagination_1.CursorPagination), { query, ...options });
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Grants a profile access to the workspace by creating (or reactivating) the actor
|
|
26
|
+
* that links the profile to the workspace. Accepts either an existing profile_id
|
|
27
|
+
* or an email to resolve-or-invite. Idempotent for an already-active member. Admin
|
|
28
|
+
* only.
|
|
29
|
+
*/
|
|
30
|
+
add(workspaceID, body, options) {
|
|
31
|
+
return this._client.post((0, path_1.path) `/v1/account/workspaces/${workspaceID}/members`, { body, ...options });
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Revokes a member's access by deactivating their actor; the member is immediately
|
|
35
|
+
* cut off. The underlying profile is not deleted. Admin only.
|
|
36
|
+
*/
|
|
37
|
+
remove(profileID, params, options) {
|
|
38
|
+
const { workspaceId } = params;
|
|
39
|
+
return this._client.delete((0, path_1.path) `/v1/account/workspaces/${workspaceId}/members/${profileID}`, {
|
|
40
|
+
...options,
|
|
41
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.Members = Members;
|
|
46
|
+
//# sourceMappingURL=members.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"members.js","sourceRoot":"","sources":["../../src/resources/workspace-admin/members.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAIlD,yDAAmG;AACnG,uDAAsD;AAEtD,uDAAiD;AAEjD;;;;;;;GAOG;AACH,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;OAEG;IACH,IAAI,CACF,WAAmB,EACnB,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAA,WAAI,EAAA,0BAA0B,WAAW,UAAU,EACnD,CAAA,6BAAmD,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,IAAA,WAAI,EAAA,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,IAAA,WAAI,EAAA,0BAA0B,WAAW,YAAY,SAAS,EAAE,EAAE;YAC3F,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,0BAyCC"}
|
|
@@ -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,EAA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;WAGG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB;;;WAGG;QACH,MAAM,CAAC,EAAE;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAC;KACpC;CACF;AAED,MAAM,WAAW,wBAAyB,SAAQ,sBAAsB;IACtE;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAID,MAAM,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,I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AAO,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,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.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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