@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.
Files changed (116) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +8 -8
  3. package/client.d.mts +17 -11
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +17 -11
  6. package/client.d.ts.map +1 -1
  7. package/client.js +16 -10
  8. package/client.js.map +1 -1
  9. package/client.mjs +16 -10
  10. package/client.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/resources/account.d.mts +1 -3
  13. package/resources/account.d.mts.map +1 -1
  14. package/resources/account.d.ts +1 -3
  15. package/resources/account.d.ts.map +1 -1
  16. package/resources/account.js.map +1 -1
  17. package/resources/account.mjs.map +1 -1
  18. package/resources/api-keys/access.d.mts +2 -2
  19. package/resources/api-keys/access.d.mts.map +1 -1
  20. package/resources/api-keys/access.d.ts +2 -2
  21. package/resources/api-keys/access.d.ts.map +1 -1
  22. package/resources/index.d.mts +3 -3
  23. package/resources/index.d.mts.map +1 -1
  24. package/resources/index.d.ts +3 -3
  25. package/resources/index.d.ts.map +1 -1
  26. package/resources/index.js +4 -4
  27. package/resources/index.js.map +1 -1
  28. package/resources/index.mjs +2 -2
  29. package/resources/index.mjs.map +1 -1
  30. package/resources/workspace-admin/index.d.mts +3 -0
  31. package/resources/workspace-admin/index.d.mts.map +1 -0
  32. package/resources/workspace-admin/index.d.ts +3 -0
  33. package/resources/workspace-admin/index.d.ts.map +1 -0
  34. package/resources/{workspaces → workspace-admin}/index.js +3 -3
  35. package/resources/workspace-admin/index.js.map +1 -0
  36. package/resources/{workspaces → workspace-admin}/index.mjs +1 -1
  37. package/resources/workspace-admin/index.mjs.map +1 -0
  38. package/resources/workspace-admin/members.d.mts +55 -0
  39. package/resources/workspace-admin/members.d.mts.map +1 -0
  40. package/resources/workspace-admin/members.d.ts +55 -0
  41. package/resources/workspace-admin/members.d.ts.map +1 -0
  42. package/resources/workspace-admin/members.js +46 -0
  43. package/resources/workspace-admin/members.js.map +1 -0
  44. package/resources/workspace-admin/members.mjs +42 -0
  45. package/resources/workspace-admin/members.mjs.map +1 -0
  46. package/resources/workspace-admin/workspace-admin.d.mts +113 -0
  47. package/resources/workspace-admin/workspace-admin.d.mts.map +1 -0
  48. package/resources/workspace-admin/workspace-admin.d.ts +113 -0
  49. package/resources/workspace-admin/workspace-admin.d.ts.map +1 -0
  50. package/resources/workspace-admin/workspace-admin.js +62 -0
  51. package/resources/workspace-admin/workspace-admin.js.map +1 -0
  52. package/resources/workspace-admin/workspace-admin.mjs +57 -0
  53. package/resources/workspace-admin/workspace-admin.mjs.map +1 -0
  54. package/resources/workspace-admin.d.mts +2 -0
  55. package/resources/workspace-admin.d.mts.map +1 -0
  56. package/resources/workspace-admin.d.ts +2 -0
  57. package/resources/workspace-admin.d.ts.map +1 -0
  58. package/resources/workspace-admin.js +6 -0
  59. package/resources/workspace-admin.js.map +1 -0
  60. package/resources/workspace-admin.mjs +3 -0
  61. package/resources/workspace-admin.mjs.map +1 -0
  62. package/resources/workspaces.d.mts +54 -1
  63. package/resources/workspaces.d.mts.map +1 -1
  64. package/resources/workspaces.d.ts +54 -1
  65. package/resources/workspaces.d.ts.map +1 -1
  66. package/resources/workspaces.js +27 -2
  67. package/resources/workspaces.js.map +1 -1
  68. package/resources/workspaces.mjs +25 -1
  69. package/resources/workspaces.mjs.map +1 -1
  70. package/src/client.ts +32 -20
  71. package/src/resources/account.ts +1 -4
  72. package/src/resources/api-keys/access.ts +2 -2
  73. package/src/resources/index.ts +8 -6
  74. package/src/resources/{workspaces → workspace-admin}/index.ts +4 -7
  75. package/src/resources/workspace-admin/members.ts +92 -0
  76. package/src/resources/workspace-admin/workspace-admin.ts +162 -0
  77. package/src/resources/workspace-admin.ts +3 -0
  78. package/src/resources/workspaces.ts +76 -1
  79. package/src/version.ts +1 -1
  80. package/version.d.mts +1 -1
  81. package/version.d.ts +1 -1
  82. package/version.js +1 -1
  83. package/version.mjs +1 -1
  84. package/resources/profiles.d.mts +0 -33
  85. package/resources/profiles.d.mts.map +0 -1
  86. package/resources/profiles.d.ts +0 -33
  87. package/resources/profiles.d.ts.map +0 -1
  88. package/resources/profiles.js +0 -25
  89. package/resources/profiles.js.map +0 -1
  90. package/resources/profiles.mjs +0 -21
  91. package/resources/profiles.mjs.map +0 -1
  92. package/resources/workspaces/index.d.mts +0 -3
  93. package/resources/workspaces/index.d.mts.map +0 -1
  94. package/resources/workspaces/index.d.ts +0 -3
  95. package/resources/workspaces/index.d.ts.map +0 -1
  96. package/resources/workspaces/index.js.map +0 -1
  97. package/resources/workspaces/index.mjs.map +0 -1
  98. package/resources/workspaces/members.d.mts +0 -49
  99. package/resources/workspaces/members.d.mts.map +0 -1
  100. package/resources/workspaces/members.d.ts +0 -49
  101. package/resources/workspaces/members.d.ts.map +0 -1
  102. package/resources/workspaces/members.js +0 -44
  103. package/resources/workspaces/members.js.map +0 -1
  104. package/resources/workspaces/members.mjs +0 -40
  105. package/resources/workspaces/members.mjs.map +0 -1
  106. package/resources/workspaces/workspaces.d.mts +0 -133
  107. package/resources/workspaces/workspaces.d.mts.map +0 -1
  108. package/resources/workspaces/workspaces.d.ts +0 -133
  109. package/resources/workspaces/workspaces.d.ts.map +0 -1
  110. package/resources/workspaces/workspaces.js +0 -62
  111. package/resources/workspaces/workspaces.js.map +0 -1
  112. package/resources/workspaces/workspaces.mjs +0 -57
  113. package/resources/workspaces/workspaces.mjs.map +0 -1
  114. package/src/resources/profiles.ts +0 -47
  115. package/src/resources/workspaces/members.ts +0 -85
  116. package/src/resources/workspaces/workspaces.ts +0 -190
@@ -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,113 @@
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. Archiving the
35
+ * account's last active (non-archived) workspace is not allowed and returns
36
+ * FailedPrecondition. Admin only.
37
+ */
38
+ archive(workspaceID: string, options?: RequestOptions): APIPromise<void>;
39
+ }
40
+ export type WorkspaceMembersCursorPagination = CursorPagination<WorkspaceMember>;
41
+ /**
42
+ * A member of a workspace: the profile granted access plus the actor row that
43
+ * links it to the workspace. Returned by member list/add operations.
44
+ */
45
+ export interface WorkspaceMember {
46
+ /**
47
+ * The actor row linking the profile to the workspace (the junction record).
48
+ */
49
+ actorId: string;
50
+ /**
51
+ * The account profile that has access to the workspace.
52
+ */
53
+ profileId: string;
54
+ /**
55
+ * When the member was added to the workspace.
56
+ */
57
+ addedAt?: string;
58
+ /**
59
+ * Email address of the member's profile.
60
+ */
61
+ email?: string;
62
+ /**
63
+ * Display name of the member's profile.
64
+ */
65
+ name?: string;
66
+ }
67
+ export interface WorkspaceAdminCreateParams {
68
+ /**
69
+ * CreateAccountResourceMetadata contains the user-provided fields for creating an
70
+ * account-scoped resource. Read-only fields (id, account_id, profile_id) are
71
+ * excluded since they are set by the server.
72
+ */
73
+ metadata: WorkspaceAdminCreateParams.Metadata;
74
+ spec: WorkspacesAPI.WorkspaceSpec;
75
+ }
76
+ export declare namespace WorkspaceAdminCreateParams {
77
+ /**
78
+ * CreateAccountResourceMetadata contains the user-provided fields for creating an
79
+ * account-scoped resource. Read-only fields (id, account_id, profile_id) are
80
+ * excluded since they are set by the server.
81
+ */
82
+ interface Metadata {
83
+ /**
84
+ * Human-readable name for the resource (e.g., "Production API Key", "Staging
85
+ * Workspace")
86
+ */
87
+ name: string;
88
+ /**
89
+ * External ID for the resource (e.g., a workflow ID from an external system)
90
+ */
91
+ externalId?: string;
92
+ /**
93
+ * Arbitrary key-value pairs for categorization and filtering Examples:
94
+ * {"environment": "production", "team": "platform", "version": "v2"}
95
+ */
96
+ labels?: {
97
+ [key: string]: string;
98
+ };
99
+ }
100
+ }
101
+ export interface WorkspaceAdminListParams extends CursorPaginationParams {
102
+ /**
103
+ * When true, archived workspaces are included in the results. Defaults to false
104
+ * (active workspaces only).
105
+ */
106
+ includeArchived?: boolean;
107
+ }
108
+ export declare namespace WorkspaceAdmin {
109
+ export { type WorkspaceMember as WorkspaceMember, type WorkspaceAdminCreateParams as WorkspaceAdminCreateParams, type WorkspaceAdminListParams as WorkspaceAdminListParams, };
110
+ export { Members as Members, type MemberListParams as MemberListParams, type MemberAddParams as MemberAddParams, type MemberRemoveParams as MemberRemoveParams, };
111
+ }
112
+ export { type WorkspacesCursorPagination };
113
+ //# 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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,IAAI,EAAE,aAAa,CAAC,aAAa,CAAC;CACnC;AAED,yBAAiB,0BAA0B,CAAC;IAC1C;;;;OAIG;IACH,UAAiB,QAAQ;QACvB;;;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,113 @@
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. Archiving the
35
+ * account's last active (non-archived) workspace is not allowed and returns
36
+ * FailedPrecondition. Admin only.
37
+ */
38
+ archive(workspaceID: string, options?: RequestOptions): APIPromise<void>;
39
+ }
40
+ export type WorkspaceMembersCursorPagination = CursorPagination<WorkspaceMember>;
41
+ /**
42
+ * A member of a workspace: the profile granted access plus the actor row that
43
+ * links it to the workspace. Returned by member list/add operations.
44
+ */
45
+ export interface WorkspaceMember {
46
+ /**
47
+ * The actor row linking the profile to the workspace (the junction record).
48
+ */
49
+ actorId: string;
50
+ /**
51
+ * The account profile that has access to the workspace.
52
+ */
53
+ profileId: string;
54
+ /**
55
+ * When the member was added to the workspace.
56
+ */
57
+ addedAt?: string;
58
+ /**
59
+ * Email address of the member's profile.
60
+ */
61
+ email?: string;
62
+ /**
63
+ * Display name of the member's profile.
64
+ */
65
+ name?: string;
66
+ }
67
+ export interface WorkspaceAdminCreateParams {
68
+ /**
69
+ * CreateAccountResourceMetadata contains the user-provided fields for creating an
70
+ * account-scoped resource. Read-only fields (id, account_id, profile_id) are
71
+ * excluded since they are set by the server.
72
+ */
73
+ metadata: WorkspaceAdminCreateParams.Metadata;
74
+ spec: WorkspacesAPI.WorkspaceSpec;
75
+ }
76
+ export declare namespace WorkspaceAdminCreateParams {
77
+ /**
78
+ * CreateAccountResourceMetadata contains the user-provided fields for creating an
79
+ * account-scoped resource. Read-only fields (id, account_id, profile_id) are
80
+ * excluded since they are set by the server.
81
+ */
82
+ interface Metadata {
83
+ /**
84
+ * Human-readable name for the resource (e.g., "Production API Key", "Staging
85
+ * Workspace")
86
+ */
87
+ name: string;
88
+ /**
89
+ * External ID for the resource (e.g., a workflow ID from an external system)
90
+ */
91
+ externalId?: string;
92
+ /**
93
+ * Arbitrary key-value pairs for categorization and filtering Examples:
94
+ * {"environment": "production", "team": "platform", "version": "v2"}
95
+ */
96
+ labels?: {
97
+ [key: string]: string;
98
+ };
99
+ }
100
+ }
101
+ export interface WorkspaceAdminListParams extends CursorPaginationParams {
102
+ /**
103
+ * When true, archived workspaces are included in the results. Defaults to false
104
+ * (active workspaces only).
105
+ */
106
+ includeArchived?: boolean;
107
+ }
108
+ export declare namespace WorkspaceAdmin {
109
+ export { type WorkspaceMember as WorkspaceMember, type WorkspaceAdminCreateParams as WorkspaceAdminCreateParams, type WorkspaceAdminListParams as WorkspaceAdminListParams, };
110
+ export { Members as Members, type MemberListParams as MemberListParams, type MemberAddParams as MemberAddParams, type MemberRemoveParams as MemberRemoveParams, };
111
+ }
112
+ export { type WorkspacesCursorPagination };
113
+ //# 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,qBA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a,CAAC,aAAa,CAAC;CACnC;AAED,yBAAiB,0BAA0B,CAAC;IAC1C;;;;OAIG;IACH,UAAiB,QAAQ;QACvB;;;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,62 @@
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. Archiving the
50
+ * account's last active (non-archived) workspace is not allowed and returns
51
+ * FailedPrecondition. Admin only.
52
+ */
53
+ archive(workspaceID, options) {
54
+ return this._client.delete((0, path_1.path) `/v1/account/workspaces/${workspaceID}`, {
55
+ ...options,
56
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
57
+ });
58
+ }
59
+ }
60
+ exports.WorkspaceAdmin = WorkspaceAdmin;
61
+ WorkspaceAdmin.Members = members_1.Members;
62
+ //# 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;IA0CrE,CAAC;IAxCC;;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;;;;;OAKG;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;AA3CD,wCA2CC;AAgFD,cAAc,CAAC,OAAO,GAAG,iBAAO,CAAC"}
@@ -0,0 +1,57 @@
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. Archiving the
46
+ * account's last active (non-archived) workspace is not allowed and returns
47
+ * FailedPrecondition. Admin only.
48
+ */
49
+ archive(workspaceID, options) {
50
+ return this._client.delete(path `/v1/account/workspaces/${workspaceID}`, {
51
+ ...options,
52
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
53
+ });
54
+ }
55
+ }
56
+ WorkspaceAdmin.Members = Members;
57
+ //# 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,sB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 export * from "./workspace-admin/index.mjs";
2
+ //# sourceMappingURL=workspace-admin.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-admin.d.mts","sourceRoot":"","sources":["../src/resources/workspace-admin.ts"],"names":[],"mappings":"AAEA,4CAAwC"}
@@ -0,0 +1,2 @@
1
+ export * from "./workspace-admin/index.js";
2
+ //# sourceMappingURL=workspace-admin.d.ts.map
@@ -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,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export * from "./workspace-admin/index.mjs";
3
+ //# sourceMappingURL=workspace-admin.mjs.map
@@ -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
- export * from "./workspaces/index.mjs";
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,uCAAmC"}
1
+ {"version":3,"file":"workspaces.d.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,CAAC;CACH"}
@@ -1,2 +1,55 @@
1
- export * from "./workspaces/index.js";
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,sCAAmC"}
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"}
@@ -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
- const tslib_1 = require("../internal/tslib.js");
5
- tslib_1.__exportStar(require("./workspaces/index.js"), exports);
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,gEAAmC"}
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"}