@anthropic-ai/sdk 0.120.0 → 0.121.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 +33 -0
- package/helpers/beta/standard-schema.d.mts +45 -0
- package/helpers/beta/standard-schema.d.mts.map +1 -0
- package/helpers/beta/standard-schema.d.ts +45 -0
- package/helpers/beta/standard-schema.d.ts.map +1 -0
- package/helpers/beta/standard-schema.js +58 -0
- package/helpers/beta/standard-schema.js.map +1 -0
- package/helpers/beta/standard-schema.mjs +54 -0
- package/helpers/beta/standard-schema.mjs.map +1 -0
- package/internal/detect-platform.js +1 -1
- package/internal/detect-platform.js.map +1 -1
- package/internal/detect-platform.mjs +1 -1
- package/internal/detect-platform.mjs.map +1 -1
- package/internal/utils/values.d.mts +6 -0
- package/internal/utils/values.d.mts.map +1 -1
- package/internal/utils/values.d.ts +6 -0
- package/internal/utils/values.d.ts.map +1 -1
- package/internal/utils/values.js +7 -0
- package/internal/utils/values.js.map +1 -1
- package/internal/utils/values.mjs +6 -0
- package/internal/utils/values.mjs.map +1 -1
- package/lib/BetaMessageStream.d.mts.map +1 -1
- package/lib/BetaMessageStream.d.ts.map +1 -1
- package/lib/BetaMessageStream.js +3 -4
- package/lib/BetaMessageStream.js.map +1 -1
- package/lib/BetaMessageStream.mjs +1 -2
- package/lib/BetaMessageStream.mjs.map +1 -1
- package/lib/MessageStream.d.mts.map +1 -1
- package/lib/MessageStream.d.ts.map +1 -1
- package/lib/MessageStream.js +3 -4
- package/lib/MessageStream.js.map +1 -1
- package/lib/MessageStream.mjs +1 -2
- package/lib/MessageStream.mjs.map +1 -1
- package/lib/sessions/accumulate.d.mts.map +1 -1
- package/lib/sessions/accumulate.d.ts.map +1 -1
- package/lib/sessions/accumulate.js +3 -4
- package/lib/sessions/accumulate.js.map +1 -1
- package/lib/sessions/accumulate.mjs +1 -2
- package/lib/sessions/accumulate.mjs.map +1 -1
- package/lib/standard-schema.d.mts +131 -0
- package/lib/standard-schema.d.mts.map +1 -0
- package/lib/standard-schema.d.ts +131 -0
- package/lib/standard-schema.d.ts.map +1 -0
- package/lib/standard-schema.js +45 -0
- package/lib/standard-schema.js.map +1 -0
- package/lib/standard-schema.mjs +41 -0
- package/lib/standard-schema.mjs.map +1 -0
- package/lib/tools/BetaToolRunner.d.mts.map +1 -1
- package/lib/tools/BetaToolRunner.d.ts.map +1 -1
- package/lib/tools/BetaToolRunner.js +35 -6
- package/lib/tools/BetaToolRunner.js.map +1 -1
- package/lib/tools/BetaToolRunner.mjs +35 -6
- package/lib/tools/BetaToolRunner.mjs.map +1 -1
- package/package.json +2 -11
- package/resources/beta/beta.d.mts +5 -1
- package/resources/beta/beta.d.mts.map +1 -1
- package/resources/beta/beta.d.ts +5 -1
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js +4 -0
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs +4 -0
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/environments/environments.d.mts +8 -1
- package/resources/beta/environments/environments.d.mts.map +1 -1
- package/resources/beta/environments/environments.d.ts +8 -1
- package/resources/beta/environments/environments.d.ts.map +1 -1
- package/resources/beta/environments/environments.js.map +1 -1
- package/resources/beta/environments/environments.mjs.map +1 -1
- package/resources/beta/index.d.mts +1 -0
- package/resources/beta/index.d.mts.map +1 -1
- package/resources/beta/index.d.ts +1 -0
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/index.js +11 -9
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs +1 -0
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta/memory-stores/memories.d.mts +6 -5
- package/resources/beta/memory-stores/memories.d.mts.map +1 -1
- package/resources/beta/memory-stores/memories.d.ts +6 -5
- package/resources/beta/memory-stores/memories.d.ts.map +1 -1
- package/resources/beta/memory-stores/memory-versions.d.mts +8 -5
- package/resources/beta/memory-stores/memory-versions.d.mts.map +1 -1
- package/resources/beta/memory-stores/memory-versions.d.ts +8 -5
- package/resources/beta/memory-stores/memory-versions.d.ts.map +1 -1
- package/resources/beta/messages/messages.d.mts +50 -8
- package/resources/beta/messages/messages.d.mts.map +1 -1
- package/resources/beta/messages/messages.d.ts +50 -8
- package/resources/beta/messages/messages.d.ts.map +1 -1
- package/resources/beta/messages/messages.js.map +1 -1
- package/resources/beta/messages/messages.mjs.map +1 -1
- package/resources/beta/organization/api-keys.d.mts +177 -0
- package/resources/beta/organization/api-keys.d.mts.map +1 -0
- package/resources/beta/organization/api-keys.d.ts +177 -0
- package/resources/beta/organization/api-keys.d.ts.map +1 -0
- package/resources/beta/organization/api-keys.js +56 -0
- package/resources/beta/organization/api-keys.js.map +1 -0
- package/resources/beta/organization/api-keys.mjs +52 -0
- package/resources/beta/organization/api-keys.mjs.map +1 -0
- package/resources/beta/organization/external-keys.d.mts +269 -0
- package/resources/beta/organization/external-keys.d.mts.map +1 -0
- package/resources/beta/organization/external-keys.d.ts +269 -0
- package/resources/beta/organization/external-keys.d.ts.map +1 -0
- package/resources/beta/organization/external-keys.js +119 -0
- package/resources/beta/organization/external-keys.js.map +1 -0
- package/resources/beta/organization/external-keys.mjs +115 -0
- package/resources/beta/organization/external-keys.mjs.map +1 -0
- package/resources/beta/organization/federation/federation.d.mts +14 -0
- package/resources/beta/organization/federation/federation.d.mts.map +1 -0
- package/resources/beta/organization/federation/federation.d.ts +14 -0
- package/resources/beta/organization/federation/federation.d.ts.map +1 -0
- package/resources/beta/organization/federation/federation.js +21 -0
- package/resources/beta/organization/federation/federation.js.map +1 -0
- package/resources/beta/organization/federation/federation.mjs +16 -0
- package/resources/beta/organization/federation/federation.mjs.map +1 -0
- package/resources/beta/organization/federation/index.d.mts +4 -0
- package/resources/beta/organization/federation/index.d.mts.map +1 -0
- package/resources/beta/organization/federation/index.d.ts +4 -0
- package/resources/beta/organization/federation/index.d.ts.map +1 -0
- package/resources/beta/organization/federation/index.js +11 -0
- package/resources/beta/organization/federation/index.js.map +1 -0
- package/resources/beta/organization/federation/index.mjs +5 -0
- package/resources/beta/organization/federation/index.mjs.map +1 -0
- package/resources/beta/organization/federation/issuers.d.mts +353 -0
- package/resources/beta/organization/federation/issuers.d.mts.map +1 -0
- package/resources/beta/organization/federation/issuers.d.ts +353 -0
- package/resources/beta/organization/federation/issuers.d.ts.map +1 -0
- package/resources/beta/organization/federation/issuers.js +169 -0
- package/resources/beta/organization/federation/issuers.js.map +1 -0
- package/resources/beta/organization/federation/issuers.mjs +165 -0
- package/resources/beta/organization/federation/issuers.mjs.map +1 -0
- package/resources/beta/organization/federation/rules/index.d.mts +3 -0
- package/resources/beta/organization/federation/rules/index.d.mts.map +1 -0
- package/resources/beta/organization/federation/rules/index.d.ts +3 -0
- package/resources/beta/organization/federation/rules/index.d.ts.map +1 -0
- package/resources/beta/organization/federation/rules/index.js +9 -0
- package/resources/beta/organization/federation/rules/index.js.map +1 -0
- package/resources/beta/organization/federation/rules/index.mjs +4 -0
- package/resources/beta/organization/federation/rules/index.mjs.map +1 -0
- package/resources/beta/organization/federation/rules/rules.d.mts +468 -0
- package/resources/beta/organization/federation/rules/rules.d.mts.map +1 -0
- package/resources/beta/organization/federation/rules/rules.d.ts +468 -0
- package/resources/beta/organization/federation/rules/rules.d.ts.map +1 -0
- package/resources/beta/organization/federation/rules/rules.js +198 -0
- package/resources/beta/organization/federation/rules/rules.js.map +1 -0
- package/resources/beta/organization/federation/rules/rules.mjs +193 -0
- package/resources/beta/organization/federation/rules/rules.mjs.map +1 -0
- package/resources/beta/organization/federation/rules/workspaces.d.mts +124 -0
- package/resources/beta/organization/federation/rules/workspaces.d.mts.map +1 -0
- package/resources/beta/organization/federation/rules/workspaces.d.ts +124 -0
- package/resources/beta/organization/federation/rules/workspaces.d.ts.map +1 -0
- package/resources/beta/organization/federation/rules/workspaces.js +114 -0
- package/resources/beta/organization/federation/rules/workspaces.js.map +1 -0
- package/resources/beta/organization/federation/rules/workspaces.mjs +110 -0
- package/resources/beta/organization/federation/rules/workspaces.mjs.map +1 -0
- package/resources/beta/organization/federation/rules.d.mts +2 -0
- package/resources/beta/organization/federation/rules.d.mts.map +1 -0
- package/resources/beta/organization/federation/rules.d.ts +2 -0
- package/resources/beta/organization/federation/rules.d.ts.map +1 -0
- package/resources/beta/organization/federation/rules.js +6 -0
- package/resources/beta/organization/federation/rules.js.map +1 -0
- package/resources/beta/organization/federation/rules.mjs +3 -0
- package/resources/beta/organization/federation/rules.mjs.map +1 -0
- package/resources/beta/organization/federation.d.mts +2 -0
- package/resources/beta/organization/federation.d.mts.map +1 -0
- package/resources/beta/organization/federation.d.ts +2 -0
- package/resources/beta/organization/federation.d.ts.map +1 -0
- package/resources/beta/organization/federation.js +6 -0
- package/resources/beta/organization/federation.js.map +1 -0
- package/resources/beta/organization/federation.mjs +3 -0
- package/resources/beta/organization/federation.mjs.map +1 -0
- package/resources/beta/organization/index.d.mts +10 -0
- package/resources/beta/organization/index.d.mts.map +1 -0
- package/resources/beta/organization/index.d.ts +10 -0
- package/resources/beta/organization/index.d.ts.map +1 -0
- package/resources/beta/organization/index.js +23 -0
- package/resources/beta/organization/index.js.map +1 -0
- package/resources/beta/organization/index.mjs +11 -0
- package/resources/beta/organization/index.mjs.map +1 -0
- package/resources/beta/organization/invites.d.mts +162 -0
- package/resources/beta/organization/invites.d.mts.map +1 -0
- package/resources/beta/organization/invites.d.ts +162 -0
- package/resources/beta/organization/invites.d.ts.map +1 -0
- package/resources/beta/organization/invites.js +76 -0
- package/resources/beta/organization/invites.js.map +1 -0
- package/resources/beta/organization/invites.mjs +72 -0
- package/resources/beta/organization/invites.mjs.map +1 -0
- package/resources/beta/organization/organization.d.mts +69 -0
- package/resources/beta/organization/organization.d.mts.map +1 -0
- package/resources/beta/organization/organization.d.ts +69 -0
- package/resources/beta/organization/organization.d.ts.map +1 -0
- package/resources/beta/organization/organization.js +58 -0
- package/resources/beta/organization/organization.js.map +1 -0
- package/resources/beta/organization/organization.mjs +53 -0
- package/resources/beta/organization/organization.mjs.map +1 -0
- package/resources/beta/organization/rate-limits.d.mts +78 -0
- package/resources/beta/organization/rate-limits.d.mts.map +1 -0
- package/resources/beta/organization/rate-limits.d.ts +78 -0
- package/resources/beta/organization/rate-limits.d.ts.map +1 -0
- package/resources/beta/organization/rate-limits.js +32 -0
- package/resources/beta/organization/rate-limits.js.map +1 -0
- package/resources/beta/organization/rate-limits.mjs +28 -0
- package/resources/beta/organization/rate-limits.mjs.map +1 -0
- package/resources/beta/organization/service-accounts/index.d.mts +3 -0
- package/resources/beta/organization/service-accounts/index.d.mts.map +1 -0
- package/resources/beta/organization/service-accounts/index.d.ts +3 -0
- package/resources/beta/organization/service-accounts/index.d.ts.map +1 -0
- package/resources/beta/organization/service-accounts/index.js +9 -0
- package/resources/beta/organization/service-accounts/index.js.map +1 -0
- package/resources/beta/organization/service-accounts/index.mjs +4 -0
- package/resources/beta/organization/service-accounts/index.mjs.map +1 -0
- package/resources/beta/organization/service-accounts/service-accounts.d.mts +258 -0
- package/resources/beta/organization/service-accounts/service-accounts.d.mts.map +1 -0
- package/resources/beta/organization/service-accounts/service-accounts.d.ts +258 -0
- package/resources/beta/organization/service-accounts/service-accounts.d.ts.map +1 -0
- package/resources/beta/organization/service-accounts/service-accounts.js +174 -0
- package/resources/beta/organization/service-accounts/service-accounts.js.map +1 -0
- package/resources/beta/organization/service-accounts/service-accounts.mjs +169 -0
- package/resources/beta/organization/service-accounts/service-accounts.mjs.map +1 -0
- package/resources/beta/organization/service-accounts/workspaces.d.mts +141 -0
- package/resources/beta/organization/service-accounts/workspaces.d.mts.map +1 -0
- package/resources/beta/organization/service-accounts/workspaces.d.ts +141 -0
- package/resources/beta/organization/service-accounts/workspaces.d.ts.map +1 -0
- package/resources/beta/organization/service-accounts/workspaces.js +125 -0
- package/resources/beta/organization/service-accounts/workspaces.js.map +1 -0
- package/resources/beta/organization/service-accounts/workspaces.mjs +121 -0
- package/resources/beta/organization/service-accounts/workspaces.mjs.map +1 -0
- package/resources/beta/organization/service-accounts.d.mts +2 -0
- package/resources/beta/organization/service-accounts.d.mts.map +1 -0
- package/resources/beta/organization/service-accounts.d.ts +2 -0
- package/resources/beta/organization/service-accounts.d.ts.map +1 -0
- package/resources/beta/organization/service-accounts.js +6 -0
- package/resources/beta/organization/service-accounts.js.map +1 -0
- package/resources/beta/organization/service-accounts.mjs +3 -0
- package/resources/beta/organization/service-accounts.mjs.map +1 -0
- package/resources/beta/organization/users.d.mts +124 -0
- package/resources/beta/organization/users.d.mts.map +1 -0
- package/resources/beta/organization/users.d.ts +124 -0
- package/resources/beta/organization/users.d.ts.map +1 -0
- package/resources/beta/organization/users.js +67 -0
- package/resources/beta/organization/users.js.map +1 -0
- package/resources/beta/organization/users.mjs +63 -0
- package/resources/beta/organization/users.mjs.map +1 -0
- package/resources/beta/organization/workspaces/index.d.mts +5 -0
- package/resources/beta/organization/workspaces/index.d.mts.map +1 -0
- package/resources/beta/organization/workspaces/index.d.ts +5 -0
- package/resources/beta/organization/workspaces/index.d.ts.map +1 -0
- package/resources/beta/organization/workspaces/index.js +13 -0
- package/resources/beta/organization/workspaces/index.js.map +1 -0
- package/resources/beta/organization/workspaces/index.mjs +6 -0
- package/resources/beta/organization/workspaces/index.mjs.map +1 -0
- package/resources/beta/organization/workspaces/members.d.mts +135 -0
- package/resources/beta/organization/workspaces/members.d.mts.map +1 -0
- package/resources/beta/organization/workspaces/members.d.ts +135 -0
- package/resources/beta/organization/workspaces/members.d.ts.map +1 -0
- package/resources/beta/organization/workspaces/members.js +102 -0
- package/resources/beta/organization/workspaces/members.js.map +1 -0
- package/resources/beta/organization/workspaces/members.mjs +98 -0
- package/resources/beta/organization/workspaces/members.mjs.map +1 -0
- package/resources/beta/organization/workspaces/rate-limits.d.mts +84 -0
- package/resources/beta/organization/workspaces/rate-limits.d.mts.map +1 -0
- package/resources/beta/organization/workspaces/rate-limits.d.ts +84 -0
- package/resources/beta/organization/workspaces/rate-limits.d.ts.map +1 -0
- package/resources/beta/organization/workspaces/rate-limits.js +35 -0
- package/resources/beta/organization/workspaces/rate-limits.js.map +1 -0
- package/resources/beta/organization/workspaces/rate-limits.mjs +31 -0
- package/resources/beta/organization/workspaces/rate-limits.mjs.map +1 -0
- package/resources/beta/organization/workspaces/service-accounts.d.mts +210 -0
- package/resources/beta/organization/workspaces/service-accounts.d.mts.map +1 -0
- package/resources/beta/organization/workspaces/service-accounts.d.ts +210 -0
- package/resources/beta/organization/workspaces/service-accounts.d.ts.map +1 -0
- package/resources/beta/organization/workspaces/service-accounts.js +189 -0
- package/resources/beta/organization/workspaces/service-accounts.js.map +1 -0
- package/resources/beta/organization/workspaces/service-accounts.mjs +185 -0
- package/resources/beta/organization/workspaces/service-accounts.mjs.map +1 -0
- package/resources/beta/organization/workspaces/workspaces.d.mts +287 -0
- package/resources/beta/organization/workspaces/workspaces.d.mts.map +1 -0
- package/resources/beta/organization/workspaces/workspaces.d.ts +287 -0
- package/resources/beta/organization/workspaces/workspaces.d.ts.map +1 -0
- package/resources/beta/organization/workspaces/workspaces.js +112 -0
- package/resources/beta/organization/workspaces/workspaces.js.map +1 -0
- package/resources/beta/organization/workspaces/workspaces.mjs +107 -0
- package/resources/beta/organization/workspaces/workspaces.mjs.map +1 -0
- package/resources/beta/organization/workspaces.d.mts +2 -0
- package/resources/beta/organization/workspaces.d.mts.map +1 -0
- package/resources/beta/organization/workspaces.d.ts +2 -0
- package/resources/beta/organization/workspaces.d.ts.map +1 -0
- package/resources/beta/organization/workspaces.js +6 -0
- package/resources/beta/organization/workspaces.js.map +1 -0
- package/resources/beta/organization/workspaces.mjs +3 -0
- package/resources/beta/organization/workspaces.mjs.map +1 -0
- package/resources/beta/organization.d.mts +2 -0
- package/resources/beta/organization.d.mts.map +1 -0
- package/resources/beta/organization.d.ts +2 -0
- package/resources/beta/organization.d.ts.map +1 -0
- package/resources/beta/organization.js +6 -0
- package/resources/beta/organization.js.map +1 -0
- package/resources/beta/organization.mjs +3 -0
- package/resources/beta/organization.mjs.map +1 -0
- package/resources/beta/sessions/threads/threads.d.mts +2 -1
- package/resources/beta/sessions/threads/threads.d.mts.map +1 -1
- package/resources/beta/sessions/threads/threads.d.ts +2 -1
- package/resources/beta/sessions/threads/threads.d.ts.map +1 -1
- package/resources/beta/sessions/threads/threads.js.map +1 -1
- package/resources/beta/sessions/threads/threads.mjs.map +1 -1
- package/src/helpers/beta/standard-schema.ts +99 -0
- package/src/internal/detect-platform.ts +1 -1
- package/src/internal/utils/values.ts +7 -0
- package/src/lib/BetaMessageStream.ts +1 -3
- package/src/lib/MessageStream.ts +1 -3
- package/src/lib/sessions/accumulate.ts +1 -3
- package/src/lib/standard-schema.ts +209 -0
- package/src/lib/tools/BetaToolRunner.ts +38 -6
- package/src/resources/beta/beta.ts +18 -1
- package/src/resources/beta/environments/environments.ts +8 -1
- package/src/resources/beta/index.ts +1 -0
- package/src/resources/beta/memory-stores/memories.ts +6 -5
- package/src/resources/beta/memory-stores/memory-versions.ts +8 -5
- package/src/resources/beta/messages/messages.ts +50 -8
- package/src/resources/beta/organization/api-keys.ts +231 -0
- package/src/resources/beta/organization/external-keys.ts +362 -0
- package/src/resources/beta/organization/federation/federation.ts +71 -0
- package/src/resources/beta/organization/federation/index.ts +31 -0
- package/src/resources/beta/organization/federation/issuers.ts +486 -0
- package/src/resources/beta/organization/federation/rules/index.ts +23 -0
- package/src/resources/beta/organization/federation/rules/rules.ts +624 -0
- package/src/resources/beta/organization/federation/rules/workspaces.ts +196 -0
- package/src/resources/beta/organization/federation/rules.ts +3 -0
- package/src/resources/beta/organization/federation.ts +3 -0
- package/src/resources/beta/organization/index.ts +83 -0
- package/src/resources/beta/organization/invites.ts +207 -0
- package/src/resources/beta/organization/organization.ts +245 -0
- package/src/resources/beta/organization/rate-limits.ts +105 -0
- package/src/resources/beta/organization/service-accounts/index.ts +21 -0
- package/src/resources/beta/organization/service-accounts/service-accounts.ts +389 -0
- package/src/resources/beta/organization/service-accounts/workspaces.ts +217 -0
- package/src/resources/beta/organization/service-accounts.ts +3 -0
- package/src/resources/beta/organization/users.ts +163 -0
- package/src/resources/beta/organization/workspaces/index.ts +43 -0
- package/src/resources/beta/organization/workspaces/members.ts +209 -0
- package/src/resources/beta/organization/workspaces/rate-limits.ts +114 -0
- package/src/resources/beta/organization/workspaces/service-accounts.ts +325 -0
- package/src/resources/beta/organization/workspaces/workspaces.ts +434 -0
- package/src/resources/beta/organization/workspaces.ts +3 -0
- package/src/resources/beta/organization.ts +3 -0
- package/src/resources/beta/sessions/threads/threads.ts +2 -1
- package/src/tools/agent-toolset/node.browser.ts +1 -1
- package/src/tools/agent-toolset/node.ts +4 -4
- package/src/version.ts +1 -1
- package/tools/agent-toolset/node.browser.d.mts +1 -1
- package/tools/agent-toolset/node.browser.d.mts.map +1 -1
- package/tools/agent-toolset/node.browser.d.ts +1 -1
- package/tools/agent-toolset/node.browser.d.ts.map +1 -1
- package/tools/agent-toolset/node.browser.js.map +1 -1
- package/tools/agent-toolset/node.browser.mjs.map +1 -1
- package/tools/agent-toolset/node.d.mts +2 -2
- package/tools/agent-toolset/node.d.mts.map +1 -1
- package/tools/agent-toolset/node.d.ts +2 -2
- package/tools/agent-toolset/node.d.ts.map +1 -1
- package/tools/agent-toolset/node.js.map +1 -1
- package/tools/agent-toolset/node.mjs.map +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../../core/resource';
|
|
4
|
+
import * as BetaAPI from '../../beta';
|
|
5
|
+
import * as WorkspacesAPI from './workspaces';
|
|
6
|
+
import {
|
|
7
|
+
WorkspaceAddParams,
|
|
8
|
+
WorkspaceListParams,
|
|
9
|
+
WorkspaceRemoveParams,
|
|
10
|
+
WorkspaceRemoveResponse,
|
|
11
|
+
Workspaces,
|
|
12
|
+
} from './workspaces';
|
|
13
|
+
import * as OrganizationWorkspacesAPI from '../workspaces/workspaces';
|
|
14
|
+
import { APIPromise } from '../../../../core/api-promise';
|
|
15
|
+
import { PageCursor, type PageCursorParams, PagePromise } from '../../../../core/pagination';
|
|
16
|
+
import { buildHeaders } from '../../../../internal/headers';
|
|
17
|
+
import { RequestOptions } from '../../../../internal/request-options';
|
|
18
|
+
import { path } from '../../../../internal/utils/path';
|
|
19
|
+
|
|
20
|
+
export class ServiceAccounts extends APIResource {
|
|
21
|
+
workspaces: WorkspacesAPI.Workspaces = new WorkspacesAPI.Workspaces(this._client);
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* **Requires an OAuth access token with the `org:admin` scope**, from
|
|
25
|
+
* `ant auth login --scope org:admin` or a workload identity federation rule; Admin
|
|
26
|
+
* API keys are not accepted. See
|
|
27
|
+
* [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).
|
|
28
|
+
*
|
|
29
|
+
* Create a service account.
|
|
30
|
+
*
|
|
31
|
+
* A service account is a named workload identity that federation rules target.
|
|
32
|
+
* `organization_role` is `developer` (default) or `admin`; a rule may only be
|
|
33
|
+
* created or retargeted to grant `org:admin` scope when the target's
|
|
34
|
+
* `organization_role` is `admin`. Creating an `admin`-role service account
|
|
35
|
+
* requires an interactive credential (a user OAuth token or a Console session) — a
|
|
36
|
+
* workload may only create `developer`-role service accounts.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const betaServiceAccount =
|
|
41
|
+
* await client.beta.organization.serviceAccounts.create({
|
|
42
|
+
* name: 'ci-deploy-bot',
|
|
43
|
+
* });
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
create(params: ServiceAccountCreateParams, options?: RequestOptions): APIPromise<BetaServiceAccount> {
|
|
47
|
+
const { betas, ...body } = params;
|
|
48
|
+
return this._client.post('/v1/organizations/service_accounts?beta=true', {
|
|
49
|
+
body,
|
|
50
|
+
...options,
|
|
51
|
+
headers: buildHeaders([
|
|
52
|
+
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
53
|
+
options?.headers,
|
|
54
|
+
]),
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* **Requires an OAuth access token with the `org:admin` scope**, from
|
|
60
|
+
* `ant auth login --scope org:admin` or a workload identity federation rule; Admin
|
|
61
|
+
* API keys are not accepted. See
|
|
62
|
+
* [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).
|
|
63
|
+
*
|
|
64
|
+
* Retrieve a service account by its ID (`svac_...`).
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* const betaServiceAccount =
|
|
69
|
+
* await client.beta.organization.serviceAccounts.retrieve(
|
|
70
|
+
* 'service_account_id',
|
|
71
|
+
* );
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
retrieve(
|
|
75
|
+
serviceAccountID: string,
|
|
76
|
+
params: ServiceAccountRetrieveParams | null | undefined = {},
|
|
77
|
+
options?: RequestOptions,
|
|
78
|
+
): APIPromise<BetaServiceAccount> {
|
|
79
|
+
const { betas } = params ?? {};
|
|
80
|
+
return this._client.get(path`/v1/organizations/service_accounts/${serviceAccountID}?beta=true`, {
|
|
81
|
+
...options,
|
|
82
|
+
headers: buildHeaders([
|
|
83
|
+
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
84
|
+
options?.headers,
|
|
85
|
+
]),
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* **Requires an OAuth access token with the `org:admin` scope**, from
|
|
91
|
+
* `ant auth login --scope org:admin` or a workload identity federation rule; Admin
|
|
92
|
+
* API keys are not accepted. See
|
|
93
|
+
* [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).
|
|
94
|
+
*
|
|
95
|
+
* Update a service account.
|
|
96
|
+
*
|
|
97
|
+
* Only `description` and `organization_role` are mutable; `name` cannot be
|
|
98
|
+
* changed. Archived service accounts cannot be updated; this returns 400. Setting
|
|
99
|
+
* `organization_role` to `admin` (even when unchanged) requires an interactive
|
|
100
|
+
* credential (a user OAuth token or a Console session).
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* const betaServiceAccount =
|
|
105
|
+
* await client.beta.organization.serviceAccounts.update(
|
|
106
|
+
* 'service_account_id',
|
|
107
|
+
* );
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
update(
|
|
111
|
+
serviceAccountID: string,
|
|
112
|
+
params: ServiceAccountUpdateParams,
|
|
113
|
+
options?: RequestOptions,
|
|
114
|
+
): APIPromise<BetaServiceAccount> {
|
|
115
|
+
const { betas, ...body } = params;
|
|
116
|
+
return this._client.post(path`/v1/organizations/service_accounts/${serviceAccountID}?beta=true`, {
|
|
117
|
+
body,
|
|
118
|
+
...options,
|
|
119
|
+
headers: buildHeaders([
|
|
120
|
+
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
121
|
+
options?.headers,
|
|
122
|
+
]),
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* **Requires an OAuth access token with the `org:admin` scope**, from
|
|
128
|
+
* `ant auth login --scope org:admin` or a workload identity federation rule; Admin
|
|
129
|
+
* API keys are not accepted. See
|
|
130
|
+
* [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).
|
|
131
|
+
*
|
|
132
|
+
* List service accounts in the caller's organization.
|
|
133
|
+
*
|
|
134
|
+
* Results are ordered by creation time, newest first. Use `limit` and the
|
|
135
|
+
* `next_page` cursor to paginate; set `include_archived=true` to include archived
|
|
136
|
+
* service accounts.
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* ```ts
|
|
140
|
+
* // Automatically fetches more pages as needed.
|
|
141
|
+
* for await (const betaServiceAccount of client.beta.organization.serviceAccounts.list()) {
|
|
142
|
+
* // ...
|
|
143
|
+
* }
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
146
|
+
list(
|
|
147
|
+
params: ServiceAccountListParams | null | undefined = {},
|
|
148
|
+
options?: RequestOptions,
|
|
149
|
+
): PagePromise<BetaServiceAccountsPageCursor, BetaServiceAccount> {
|
|
150
|
+
const { betas, ...query } = params ?? {};
|
|
151
|
+
return this._client.getAPIList(
|
|
152
|
+
'/v1/organizations/service_accounts?beta=true',
|
|
153
|
+
PageCursor<BetaServiceAccount>,
|
|
154
|
+
{
|
|
155
|
+
query,
|
|
156
|
+
...options,
|
|
157
|
+
headers: buildHeaders([
|
|
158
|
+
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
159
|
+
options?.headers,
|
|
160
|
+
]),
|
|
161
|
+
},
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* **Requires an OAuth access token with the `org:admin` scope**, from
|
|
167
|
+
* `ant auth login --scope org:admin` or a workload identity federation rule; Admin
|
|
168
|
+
* API keys are not accepted. See
|
|
169
|
+
* [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).
|
|
170
|
+
*
|
|
171
|
+
* Archive a service account.
|
|
172
|
+
*
|
|
173
|
+
* Idempotent; re-archiving returns the service account with its original
|
|
174
|
+
* `archived_at`. Rejected with 400 if any live (non-archived) federation rule
|
|
175
|
+
* still targets this service account, same as issuer archival; archive those rules
|
|
176
|
+
* first or change their target to another service account.
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```ts
|
|
180
|
+
* const betaServiceAccount =
|
|
181
|
+
* await client.beta.organization.serviceAccounts.archive(
|
|
182
|
+
* 'service_account_id',
|
|
183
|
+
* );
|
|
184
|
+
* ```
|
|
185
|
+
*/
|
|
186
|
+
archive(
|
|
187
|
+
serviceAccountID: string,
|
|
188
|
+
params: ServiceAccountArchiveParams | null | undefined = {},
|
|
189
|
+
options?: RequestOptions,
|
|
190
|
+
): APIPromise<BetaServiceAccount> {
|
|
191
|
+
const { betas } = params ?? {};
|
|
192
|
+
return this._client.post(path`/v1/organizations/service_accounts/${serviceAccountID}/archive?beta=true`, {
|
|
193
|
+
...options,
|
|
194
|
+
headers: buildHeaders([
|
|
195
|
+
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
196
|
+
options?.headers,
|
|
197
|
+
]),
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export type BetaServiceAccountsPageCursor = PageCursor<BetaServiceAccount>;
|
|
203
|
+
|
|
204
|
+
export type BetaServiceAccountWorkspaceMembersPageCursor = PageCursor<BetaServiceAccountWorkspaceMember>;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Named non-human identity within the caller's organization.
|
|
208
|
+
*
|
|
209
|
+
* A service account is a pure identity: name + org. Authorization lives on
|
|
210
|
+
* whatever references it (federation rules).
|
|
211
|
+
*/
|
|
212
|
+
export interface BetaServiceAccount {
|
|
213
|
+
/**
|
|
214
|
+
* Tagged ID of the service account.
|
|
215
|
+
*/
|
|
216
|
+
id: string;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* If set, this service account is archived.
|
|
220
|
+
*/
|
|
221
|
+
archived_at: string | null;
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Tagged ID (`user_`/`svac_`) of the actor that archived this service account.
|
|
225
|
+
*/
|
|
226
|
+
archived_by_actor_id: string | null;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* When this service account was created.
|
|
230
|
+
*/
|
|
231
|
+
created_at: string;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Tagged ID (`user_`/`svac_`) of the actor that created this service account.
|
|
235
|
+
*/
|
|
236
|
+
created_by_actor_id: string | null;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Optional free-text description.
|
|
240
|
+
*/
|
|
241
|
+
description: string | null;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Admin-chosen slug identifier.
|
|
245
|
+
*/
|
|
246
|
+
name: string;
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Org-level role. A federation rule may only be created or retargeted to grant
|
|
250
|
+
* `org:admin` scope when this is `admin`. A rule granting `org:admin` whose target
|
|
251
|
+
* is later demoted to `developer` is rejected at token exchange. Rules granting
|
|
252
|
+
* `org:admin` are managed in the Console.
|
|
253
|
+
*/
|
|
254
|
+
organization_role: 'admin' | 'developer';
|
|
255
|
+
|
|
256
|
+
type: 'service_account';
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* When this service account was last updated.
|
|
260
|
+
*/
|
|
261
|
+
updated_at: string;
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Tagged ID (`user_`/`svac_`) of the actor that last updated this service account.
|
|
265
|
+
*/
|
|
266
|
+
updated_by_actor_id: string | null;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export interface BetaServiceAccountWorkspaceMember {
|
|
270
|
+
/**
|
|
271
|
+
* Tagged ID (`user_...`/`svac_...`) of the actor who created this membership.
|
|
272
|
+
*/
|
|
273
|
+
created_by_actor_id: string | null;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* True when this is the implicit default-workspace membership every service
|
|
277
|
+
* account has when no explicit membership exists. Implicit memberships have role
|
|
278
|
+
* `workspace_user` and cannot be removed.
|
|
279
|
+
*/
|
|
280
|
+
implicit: boolean | null;
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Tagged service account ID (`svac_...`).
|
|
284
|
+
*/
|
|
285
|
+
service_account_id: string;
|
|
286
|
+
|
|
287
|
+
type: 'service_account_workspace_member';
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Tagged workspace ID (`wrkspc_...`).
|
|
291
|
+
*/
|
|
292
|
+
workspace_id: string;
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Role of the service account in this workspace. Service accounts cannot hold the
|
|
296
|
+
* `workspace_billing` role.
|
|
297
|
+
*/
|
|
298
|
+
workspace_role: OrganizationWorkspacesAPI.BetaWorkspaceRole;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
export interface ServiceAccountCreateParams {
|
|
302
|
+
/**
|
|
303
|
+
* Body param: Slug identifier (lowercase, digits, hyphens). Unique within the
|
|
304
|
+
* organization; a duplicate name returns 409.
|
|
305
|
+
*/
|
|
306
|
+
name: string;
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Body param: Optional free-text description.
|
|
310
|
+
*/
|
|
311
|
+
description?: string | null;
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Body param: Org-level role. Defaults to `developer`.
|
|
315
|
+
*/
|
|
316
|
+
organization_role?: 'admin' | 'developer';
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
320
|
+
*/
|
|
321
|
+
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
export interface ServiceAccountRetrieveParams {
|
|
325
|
+
/**
|
|
326
|
+
* Optional header to specify the beta version(s) you want to use.
|
|
327
|
+
*/
|
|
328
|
+
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
export interface ServiceAccountUpdateParams {
|
|
332
|
+
/**
|
|
333
|
+
* Body param: Replaces the description. Omit to leave unchanged; send `null` to
|
|
334
|
+
* clear (the field is stored as an empty string).
|
|
335
|
+
*/
|
|
336
|
+
description?: string | null;
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Body param: Replaces the org-level role. Omit or send `null` to leave unchanged.
|
|
340
|
+
*/
|
|
341
|
+
organization_role?: 'admin' | 'developer' | null;
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
345
|
+
*/
|
|
346
|
+
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
export interface ServiceAccountListParams extends PageCursorParams {
|
|
350
|
+
/**
|
|
351
|
+
* Query param: Include archived resources. Defaults to false.
|
|
352
|
+
*/
|
|
353
|
+
include_archived?: boolean;
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
357
|
+
*/
|
|
358
|
+
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
export interface ServiceAccountArchiveParams {
|
|
362
|
+
/**
|
|
363
|
+
* Optional header to specify the beta version(s) you want to use.
|
|
364
|
+
*/
|
|
365
|
+
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
ServiceAccounts.Workspaces = Workspaces;
|
|
369
|
+
|
|
370
|
+
export declare namespace ServiceAccounts {
|
|
371
|
+
export {
|
|
372
|
+
type BetaServiceAccount as BetaServiceAccount,
|
|
373
|
+
type BetaServiceAccountWorkspaceMember as BetaServiceAccountWorkspaceMember,
|
|
374
|
+
type BetaServiceAccountsPageCursor as BetaServiceAccountsPageCursor,
|
|
375
|
+
type ServiceAccountCreateParams as ServiceAccountCreateParams,
|
|
376
|
+
type ServiceAccountRetrieveParams as ServiceAccountRetrieveParams,
|
|
377
|
+
type ServiceAccountUpdateParams as ServiceAccountUpdateParams,
|
|
378
|
+
type ServiceAccountListParams as ServiceAccountListParams,
|
|
379
|
+
type ServiceAccountArchiveParams as ServiceAccountArchiveParams,
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
export {
|
|
383
|
+
Workspaces as Workspaces,
|
|
384
|
+
type WorkspaceRemoveResponse as WorkspaceRemoveResponse,
|
|
385
|
+
type WorkspaceListParams as WorkspaceListParams,
|
|
386
|
+
type WorkspaceAddParams as WorkspaceAddParams,
|
|
387
|
+
type WorkspaceRemoveParams as WorkspaceRemoveParams,
|
|
388
|
+
};
|
|
389
|
+
}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../../core/resource';
|
|
4
|
+
import * as BetaAPI from '../../beta';
|
|
5
|
+
import * as ServiceAccountsAPI from './service-accounts';
|
|
6
|
+
import { BetaServiceAccountWorkspaceMembersPageCursor } from './service-accounts';
|
|
7
|
+
import * as OrganizationWorkspacesAPI from '../workspaces/workspaces';
|
|
8
|
+
import { APIPromise } from '../../../../core/api-promise';
|
|
9
|
+
import { PageCursor, type PageCursorParams, PagePromise } from '../../../../core/pagination';
|
|
10
|
+
import { buildHeaders } from '../../../../internal/headers';
|
|
11
|
+
import { RequestOptions } from '../../../../internal/request-options';
|
|
12
|
+
import { path } from '../../../../internal/utils/path';
|
|
13
|
+
|
|
14
|
+
export class Workspaces extends APIResource {
|
|
15
|
+
/**
|
|
16
|
+
* **Requires an OAuth access token with the `org:admin` scope**, from
|
|
17
|
+
* `ant auth login --scope org:admin` or a workload identity federation rule; Admin
|
|
18
|
+
* API keys are not accepted. See
|
|
19
|
+
* [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).
|
|
20
|
+
*
|
|
21
|
+
* List the workspaces a service account is a member of.
|
|
22
|
+
*
|
|
23
|
+
* Each entry includes the service account's `workspace_role` in that workspace.
|
|
24
|
+
* Use `limit` and the `next_page` cursor to paginate. When the service account has
|
|
25
|
+
* no explicit default-workspace membership, the implicit (`implicit: true`)
|
|
26
|
+
* membership is returned as the first entry on the first page; with `limit=1` the
|
|
27
|
+
* first page may return up to 2 entries (the implicit entry plus one explicit
|
|
28
|
+
* membership) so a pagination cursor can be derived. Memberships are returned only
|
|
29
|
+
* while the service account is active. Without a `page` cursor, an archived
|
|
30
|
+
* service account returns an empty list. A `page` cursor that does not match an
|
|
31
|
+
* active membership returns a 400 invalid-request error. A cursor stops matching
|
|
32
|
+
* when the membership is removed, the workspace is deleted, or the service account
|
|
33
|
+
* is archived. Restart pagination from the first page to recover.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* // Automatically fetches more pages as needed.
|
|
38
|
+
* for await (const betaServiceAccountWorkspaceMember of client.beta.organization.serviceAccounts.workspaces.list(
|
|
39
|
+
* 'service_account_id',
|
|
40
|
+
* )) {
|
|
41
|
+
* // ...
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
list(
|
|
46
|
+
serviceAccountID: string,
|
|
47
|
+
params: WorkspaceListParams | null | undefined = {},
|
|
48
|
+
options?: RequestOptions,
|
|
49
|
+
): PagePromise<
|
|
50
|
+
BetaServiceAccountWorkspaceMembersPageCursor,
|
|
51
|
+
ServiceAccountsAPI.BetaServiceAccountWorkspaceMember
|
|
52
|
+
> {
|
|
53
|
+
const { betas, ...query } = params ?? {};
|
|
54
|
+
return this._client.getAPIList(
|
|
55
|
+
path`/v1/organizations/service_accounts/${serviceAccountID}/workspaces?beta=true`,
|
|
56
|
+
PageCursor<ServiceAccountsAPI.BetaServiceAccountWorkspaceMember>,
|
|
57
|
+
{
|
|
58
|
+
query,
|
|
59
|
+
...options,
|
|
60
|
+
headers: buildHeaders([
|
|
61
|
+
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
62
|
+
options?.headers,
|
|
63
|
+
]),
|
|
64
|
+
},
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* **Requires an OAuth access token with the `org:admin` scope**, from
|
|
70
|
+
* `ant auth login --scope org:admin` or a workload identity federation rule; Admin
|
|
71
|
+
* API keys are not accepted. See
|
|
72
|
+
* [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).
|
|
73
|
+
*
|
|
74
|
+
* Add a service account to a workspace with the given `workspace_role`.
|
|
75
|
+
*
|
|
76
|
+
* Mirror of `POST /workspaces/{workspace_id}/service_accounts`, addressed from the
|
|
77
|
+
* service-account side; both create the same membership. If the service account is
|
|
78
|
+
* already an explicit member of the workspace, its `workspace_role` is replaced
|
|
79
|
+
* with the value supplied here. Archived workspaces return 400. Archived service
|
|
80
|
+
* accounts cannot be added and are rejected.
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* const betaServiceAccountWorkspaceMember =
|
|
85
|
+
* await client.beta.organization.serviceAccounts.workspaces.add(
|
|
86
|
+
* 'service_account_id',
|
|
87
|
+
* {
|
|
88
|
+
* workspace_id: 'workspace_id',
|
|
89
|
+
* workspace_role: 'workspace_admin',
|
|
90
|
+
* },
|
|
91
|
+
* );
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
add(
|
|
95
|
+
serviceAccountID: string,
|
|
96
|
+
params: WorkspaceAddParams,
|
|
97
|
+
options?: RequestOptions,
|
|
98
|
+
): APIPromise<ServiceAccountsAPI.BetaServiceAccountWorkspaceMember> {
|
|
99
|
+
const { betas, ...body } = params;
|
|
100
|
+
return this._client.post(
|
|
101
|
+
path`/v1/organizations/service_accounts/${serviceAccountID}/workspaces?beta=true`,
|
|
102
|
+
{
|
|
103
|
+
body,
|
|
104
|
+
...options,
|
|
105
|
+
headers: buildHeaders([
|
|
106
|
+
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
107
|
+
options?.headers,
|
|
108
|
+
]),
|
|
109
|
+
},
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* **Requires an OAuth access token with the `org:admin` scope**, from
|
|
115
|
+
* `ant auth login --scope org:admin` or a workload identity federation rule; Admin
|
|
116
|
+
* API keys are not accepted. See
|
|
117
|
+
* [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).
|
|
118
|
+
*
|
|
119
|
+
* Remove a service account from a workspace.
|
|
120
|
+
*
|
|
121
|
+
* Mirror of
|
|
122
|
+
* `DELETE /workspaces/{workspace_id}/service_accounts/{service_account_id}`,
|
|
123
|
+
* addressed from the service-account side. Removal is idempotent (returns 200 even
|
|
124
|
+
* if the membership was already removed). A DELETE against the implicit
|
|
125
|
+
* default-workspace membership returns 200 but is a no-op and the membership
|
|
126
|
+
* persists; deleting an explicit default-workspace row reverts to the implicit
|
|
127
|
+
* `workspace_user` membership. Archived workspaces return 400.
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```ts
|
|
131
|
+
* const workspace =
|
|
132
|
+
* await client.beta.organization.serviceAccounts.workspaces.remove(
|
|
133
|
+
* 'workspace_id',
|
|
134
|
+
* { service_account_id: 'service_account_id' },
|
|
135
|
+
* );
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
remove(
|
|
139
|
+
workspaceID: string,
|
|
140
|
+
params: WorkspaceRemoveParams,
|
|
141
|
+
options?: RequestOptions,
|
|
142
|
+
): APIPromise<WorkspaceRemoveResponse> {
|
|
143
|
+
const { service_account_id, betas } = params;
|
|
144
|
+
return this._client.delete(
|
|
145
|
+
path`/v1/organizations/service_accounts/${service_account_id}/workspaces/${workspaceID}?beta=true`,
|
|
146
|
+
{
|
|
147
|
+
...options,
|
|
148
|
+
headers: buildHeaders([
|
|
149
|
+
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
150
|
+
options?.headers,
|
|
151
|
+
]),
|
|
152
|
+
},
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export interface WorkspaceRemoveResponse {
|
|
158
|
+
/**
|
|
159
|
+
* Tagged service account ID (`svac_...`) named in the delete request. Removal is
|
|
160
|
+
* idempotent; see the endpoint description for the implicit-membership no-op.
|
|
161
|
+
*/
|
|
162
|
+
service_account_id: string;
|
|
163
|
+
|
|
164
|
+
type: 'service_account_workspace_member_deleted';
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Tagged workspace ID (`wrkspc_...`) named in the delete request.
|
|
168
|
+
*/
|
|
169
|
+
workspace_id: string;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export interface WorkspaceListParams extends PageCursorParams {
|
|
173
|
+
/**
|
|
174
|
+
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
175
|
+
*/
|
|
176
|
+
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export interface WorkspaceAddParams {
|
|
180
|
+
/**
|
|
181
|
+
* Body param: Tagged workspace ID to add the service account to.
|
|
182
|
+
*/
|
|
183
|
+
workspace_id: string;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Body param: Role to assign to the service account in this workspace.
|
|
187
|
+
*/
|
|
188
|
+
workspace_role: OrganizationWorkspacesAPI.BetaNoBillingWorkspaceRole;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
192
|
+
*/
|
|
193
|
+
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export interface WorkspaceRemoveParams {
|
|
197
|
+
/**
|
|
198
|
+
* Path param: ID of the service account.
|
|
199
|
+
*/
|
|
200
|
+
service_account_id: string;
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
204
|
+
*/
|
|
205
|
+
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export declare namespace Workspaces {
|
|
209
|
+
export {
|
|
210
|
+
type WorkspaceRemoveResponse as WorkspaceRemoveResponse,
|
|
211
|
+
type WorkspaceListParams as WorkspaceListParams,
|
|
212
|
+
type WorkspaceAddParams as WorkspaceAddParams,
|
|
213
|
+
type WorkspaceRemoveParams as WorkspaceRemoveParams,
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export { type BetaServiceAccountWorkspaceMembersPageCursor };
|