@anthropic-ai/sdk 0.125.0 → 0.127.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 +88 -0
- package/client.d.mts +12 -11
- package/client.d.mts.map +1 -1
- package/client.d.ts +12 -11
- package/client.d.ts.map +1 -1
- package/client.js +865 -845
- package/client.js.map +1 -1
- package/client.mjs +866 -840
- package/client.mjs.map +1 -1
- package/core/api-promise.js +71 -68
- package/core/api-promise.js.map +1 -1
- package/core/api-promise.mjs +71 -64
- package/core/api-promise.mjs.map +1 -1
- package/core/error.js +5 -2
- package/core/error.js.map +1 -1
- package/core/error.mjs +5 -2
- package/core/error.mjs.map +1 -1
- package/core/pagination.js +56 -50
- package/core/pagination.js.map +1 -1
- package/core/pagination.mjs +56 -41
- package/core/pagination.mjs.map +1 -1
- package/core/streaming.js +212 -209
- package/core/streaming.js.map +1 -1
- package/core/streaming.mjs +212 -209
- package/core/streaming.mjs.map +1 -1
- package/helpers/beta/mcp.js +14 -19
- package/helpers/beta/mcp.js.map +1 -1
- package/helpers/beta/mcp.mjs +14 -13
- package/helpers/beta/mcp.mjs.map +1 -1
- package/internal/constants.js +1 -1
- package/internal/constants.js.map +1 -1
- package/internal/decoders/jsonl.js +27 -24
- package/internal/decoders/jsonl.js.map +1 -1
- package/internal/decoders/jsonl.mjs +27 -24
- package/internal/decoders/jsonl.mjs.map +1 -1
- package/internal/decoders/line.js +52 -49
- package/internal/decoders/line.js.map +1 -1
- package/internal/decoders/line.mjs +52 -43
- package/internal/decoders/line.mjs.map +1 -1
- package/internal/file-store.js +256 -258
- package/internal/file-store.js.map +1 -1
- package/internal/file-store.mjs +256 -243
- package/internal/file-store.mjs.map +1 -1
- package/internal/node.browser.d.mts.map +1 -1
- package/internal/node.browser.d.ts.map +1 -1
- package/internal/node.browser.js.map +1 -1
- package/internal/node.browser.mjs +7 -7
- package/internal/node.browser.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +2 -2
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +3 -3
- package/internal/parse.mjs.map +1 -1
- package/internal/shim-types.js +0 -6
- package/internal/shim-types.js.map +1 -1
- package/internal/shim-types.mjs +0 -6
- package/internal/shim-types.mjs.map +1 -1
- package/internal/shims.d.mts +3 -3
- package/internal/shims.d.mts.map +1 -1
- package/internal/shims.d.ts +3 -3
- package/internal/shims.d.ts.map +1 -1
- package/internal/shims.js +0 -6
- package/internal/shims.js.map +1 -1
- package/internal/shims.mjs +0 -6
- package/internal/shims.mjs.map +1 -1
- package/internal/stainless-helper-header.js +6 -6
- package/internal/stainless-helper-header.js.map +1 -1
- package/internal/utils/async-queue.js +66 -63
- package/internal/utils/async-queue.js.map +1 -1
- package/internal/utils/async-queue.mjs +66 -56
- package/internal/utils/async-queue.mjs.map +1 -1
- package/internal/utils/bytes.d.mts +1 -1
- package/internal/utils/bytes.d.mts.map +1 -1
- package/internal/utils/bytes.d.ts +1 -1
- package/internal/utils/bytes.d.ts.map +1 -1
- package/internal/utils/log.d.mts +7 -12
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts +7 -12
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js +12 -0
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +11 -0
- package/internal/utils/log.mjs.map +1 -1
- package/lib/BetaMessageStream.d.mts.map +1 -1
- package/lib/BetaMessageStream.d.ts.map +1 -1
- package/lib/BetaMessageStream.js +595 -590
- package/lib/BetaMessageStream.js.map +1 -1
- package/lib/BetaMessageStream.mjs +595 -590
- package/lib/BetaMessageStream.mjs.map +1 -1
- package/lib/MessageStream.js +544 -541
- package/lib/MessageStream.js.map +1 -1
- package/lib/MessageStream.mjs +544 -541
- package/lib/MessageStream.mjs.map +1 -1
- package/lib/beta-parser.d.mts +1 -3
- package/lib/beta-parser.d.mts.map +1 -1
- package/lib/beta-parser.d.ts +1 -3
- package/lib/beta-parser.d.ts.map +1 -1
- package/lib/beta-parser.js.map +1 -1
- package/lib/beta-parser.mjs.map +1 -1
- package/lib/environments/poller.js +180 -174
- package/lib/environments/poller.js.map +1 -1
- package/lib/environments/poller.mjs +180 -153
- package/lib/environments/poller.mjs.map +1 -1
- package/lib/environments/worker.js +375 -369
- package/lib/environments/worker.js.map +1 -1
- package/lib/environments/worker.mjs +374 -329
- package/lib/environments/worker.mjs.map +1 -1
- package/lib/internal/stub.d.mts +2 -0
- package/lib/internal/stub.d.mts.map +1 -0
- package/lib/internal/stub.d.ts +2 -0
- package/lib/internal/stub.d.ts.map +1 -0
- package/lib/internal/stub.js +6 -0
- package/lib/internal/stub.js.map +1 -0
- package/lib/internal/stub.mjs +3 -0
- package/lib/internal/stub.mjs.map +1 -0
- package/lib/internal/types.d.mts +5 -0
- package/lib/internal/types.d.mts.map +1 -0
- package/lib/internal/types.d.ts +5 -0
- package/lib/internal/types.d.ts.map +1 -0
- package/lib/internal/types.js +3 -0
- package/lib/internal/types.js.map +1 -0
- package/lib/internal/types.mjs +2 -0
- package/lib/internal/types.mjs.map +1 -0
- package/lib/middleware.js +6 -1
- package/lib/middleware.js.map +1 -1
- package/lib/middleware.mjs +6 -1
- package/lib/middleware.mjs.map +1 -1
- package/lib/parser.d.mts +1 -3
- package/lib/parser.d.mts.map +1 -1
- package/lib/parser.d.ts +1 -3
- package/lib/parser.d.ts.map +1 -1
- package/lib/parser.js.map +1 -1
- package/lib/parser.mjs.map +1 -1
- package/lib/tools/BetaToolRunner.d.mts +21 -6
- package/lib/tools/BetaToolRunner.d.mts.map +1 -1
- package/lib/tools/BetaToolRunner.d.ts +21 -6
- package/lib/tools/BetaToolRunner.d.ts.map +1 -1
- package/lib/tools/BetaToolRunner.js +415 -310
- package/lib/tools/BetaToolRunner.js.map +1 -1
- package/lib/tools/BetaToolRunner.mjs +414 -303
- package/lib/tools/BetaToolRunner.mjs.map +1 -1
- package/lib/tools/SessionToolRunner.js +241 -235
- package/lib/tools/SessionToolRunner.js.map +1 -1
- package/lib/tools/SessionToolRunner.mjs +241 -192
- package/lib/tools/SessionToolRunner.mjs.map +1 -1
- package/lib/tools/ToolError.js +39 -36
- package/lib/tools/ToolError.js.map +1 -1
- package/lib/tools/ToolError.mjs +39 -13
- package/lib/tools/ToolError.mjs.map +1 -1
- package/lib/transform-json-schema.js +7 -5
- package/lib/transform-json-schema.js.map +1 -1
- package/lib/transform-json-schema.mjs +7 -5
- package/lib/transform-json-schema.mjs.map +1 -1
- package/package.json +4 -3
- package/resources/beta/agents/agents.js +135 -132
- package/resources/beta/agents/agents.js.map +1 -1
- package/resources/beta/agents/agents.mjs +135 -132
- package/resources/beta/agents/agents.mjs.map +1 -1
- package/resources/beta/beta.d.mts +5 -5
- package/resources/beta/beta.d.mts.map +1 -1
- package/resources/beta/beta.d.ts +5 -5
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js +39 -36
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs +39 -36
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/deployment-runs.d.mts +4 -0
- package/resources/beta/deployment-runs.d.mts.map +1 -1
- package/resources/beta/deployment-runs.d.ts +4 -0
- package/resources/beta/deployment-runs.d.ts.map +1 -1
- package/resources/beta/deployments.d.mts +5 -0
- package/resources/beta/deployments.d.mts.map +1 -1
- package/resources/beta/deployments.d.ts +5 -0
- package/resources/beta/deployments.d.ts.map +1 -1
- package/resources/beta/dreams.d.mts +19 -28
- package/resources/beta/dreams.d.mts.map +1 -1
- package/resources/beta/dreams.d.ts +19 -28
- package/resources/beta/dreams.d.ts.map +1 -1
- package/resources/beta/environments/environments.js +157 -154
- package/resources/beta/environments/environments.js.map +1 -1
- package/resources/beta/environments/environments.mjs +157 -154
- package/resources/beta/environments/environments.mjs.map +1 -1
- package/resources/beta/environments/work.js +255 -252
- package/resources/beta/environments/work.js.map +1 -1
- package/resources/beta/environments/work.mjs +255 -252
- package/resources/beta/environments/work.mjs.map +1 -1
- package/resources/beta/index.d.mts +2 -2
- package/resources/beta/index.d.mts.map +1 -1
- package/resources/beta/index.d.ts +2 -2
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta/memory-stores/memories.d.mts +6 -0
- package/resources/beta/memory-stores/memories.d.mts.map +1 -1
- package/resources/beta/memory-stores/memories.d.ts +6 -0
- package/resources/beta/memory-stores/memories.d.ts.map +1 -1
- package/resources/beta/memory-stores/memory-stores.js +150 -147
- package/resources/beta/memory-stores/memory-stores.js.map +1 -1
- package/resources/beta/memory-stores/memory-stores.mjs +150 -147
- package/resources/beta/memory-stores/memory-stores.mjs.map +1 -1
- package/resources/beta/memory-stores/memory-versions.d.mts +7 -0
- package/resources/beta/memory-stores/memory-versions.d.mts.map +1 -1
- package/resources/beta/memory-stores/memory-versions.d.ts +7 -0
- package/resources/beta/memory-stores/memory-versions.d.ts.map +1 -1
- package/resources/beta/messages/batches.d.mts +12 -1
- package/resources/beta/messages/batches.d.mts.map +1 -1
- package/resources/beta/messages/batches.d.ts +12 -1
- package/resources/beta/messages/batches.d.ts.map +1 -1
- package/resources/beta/messages/index.d.mts +1 -1
- package/resources/beta/messages/index.d.mts.map +1 -1
- package/resources/beta/messages/index.d.ts +1 -1
- package/resources/beta/messages/index.d.ts.map +1 -1
- package/resources/beta/messages/index.js.map +1 -1
- package/resources/beta/messages/index.mjs.map +1 -1
- package/resources/beta/messages/messages.d.mts +239 -101
- package/resources/beta/messages/messages.d.mts.map +1 -1
- package/resources/beta/messages/messages.d.ts +239 -101
- package/resources/beta/messages/messages.d.ts.map +1 -1
- package/resources/beta/messages/messages.js +113 -110
- package/resources/beta/messages/messages.js.map +1 -1
- package/resources/beta/messages/messages.mjs +113 -110
- package/resources/beta/messages/messages.mjs.map +1 -1
- package/resources/beta/models.d.mts +22 -1
- package/resources/beta/models.d.mts.map +1 -1
- package/resources/beta/models.d.ts +22 -1
- package/resources/beta/models.d.ts.map +1 -1
- package/resources/beta/organization/federation/federation.js +11 -8
- package/resources/beta/organization/federation/federation.js.map +1 -1
- package/resources/beta/organization/federation/federation.mjs +11 -8
- package/resources/beta/organization/federation/federation.mjs.map +1 -1
- package/resources/beta/organization/federation/rules/rules.js +187 -184
- package/resources/beta/organization/federation/rules/rules.js.map +1 -1
- package/resources/beta/organization/federation/rules/rules.mjs +187 -184
- package/resources/beta/organization/federation/rules/rules.mjs.map +1 -1
- package/resources/beta/organization/index.d.mts +1 -1
- package/resources/beta/organization/index.d.mts.map +1 -1
- package/resources/beta/organization/index.d.ts +1 -1
- package/resources/beta/organization/index.d.ts.map +1 -1
- package/resources/beta/organization/index.js.map +1 -1
- package/resources/beta/organization/index.mjs.map +1 -1
- package/resources/beta/organization/organization.d.mts +2 -2
- package/resources/beta/organization/organization.d.mts.map +1 -1
- package/resources/beta/organization/organization.d.ts +2 -2
- package/resources/beta/organization/organization.d.ts.map +1 -1
- package/resources/beta/organization/organization.js +38 -35
- package/resources/beta/organization/organization.js.map +1 -1
- package/resources/beta/organization/organization.mjs +38 -35
- package/resources/beta/organization/organization.mjs.map +1 -1
- package/resources/beta/organization/rate-limits.d.mts +87 -5
- package/resources/beta/organization/rate-limits.d.mts.map +1 -1
- package/resources/beta/organization/rate-limits.d.ts +87 -5
- package/resources/beta/organization/rate-limits.d.ts.map +1 -1
- package/resources/beta/organization/service-accounts/service-accounts.js +163 -160
- package/resources/beta/organization/service-accounts/service-accounts.js.map +1 -1
- package/resources/beta/organization/service-accounts/service-accounts.mjs +163 -160
- package/resources/beta/organization/service-accounts/service-accounts.mjs.map +1 -1
- package/resources/beta/organization/workspaces/rate-limits.d.mts +9 -4
- package/resources/beta/organization/workspaces/rate-limits.d.mts.map +1 -1
- package/resources/beta/organization/workspaces/rate-limits.d.ts +9 -4
- package/resources/beta/organization/workspaces/rate-limits.d.ts.map +1 -1
- package/resources/beta/organization/workspaces/rate-limits.js.map +1 -1
- package/resources/beta/organization/workspaces/rate-limits.mjs.map +1 -1
- package/resources/beta/organization/workspaces/workspaces.d.mts +3 -3
- package/resources/beta/organization/workspaces/workspaces.d.mts.map +1 -1
- package/resources/beta/organization/workspaces/workspaces.d.ts +3 -3
- package/resources/beta/organization/workspaces/workspaces.d.ts.map +1 -1
- package/resources/beta/organization/workspaces/workspaces.js +97 -94
- package/resources/beta/organization/workspaces/workspaces.js.map +1 -1
- package/resources/beta/organization/workspaces/workspaces.mjs +97 -94
- package/resources/beta/organization/workspaces/workspaces.mjs.map +1 -1
- package/resources/beta/sessions/events.d.mts +12 -21
- package/resources/beta/sessions/events.d.mts.map +1 -1
- package/resources/beta/sessions/events.d.ts +12 -21
- package/resources/beta/sessions/events.d.ts.map +1 -1
- package/resources/beta/sessions/events.js +118 -115
- package/resources/beta/sessions/events.js.map +1 -1
- package/resources/beta/sessions/events.mjs +118 -115
- package/resources/beta/sessions/events.mjs.map +1 -1
- package/resources/beta/sessions/resources.d.mts +0 -3
- package/resources/beta/sessions/resources.d.mts.map +1 -1
- package/resources/beta/sessions/resources.d.ts +0 -3
- package/resources/beta/sessions/resources.d.ts.map +1 -1
- package/resources/beta/sessions/sessions.d.mts +8 -2
- package/resources/beta/sessions/sessions.d.mts.map +1 -1
- package/resources/beta/sessions/sessions.d.ts +8 -2
- package/resources/beta/sessions/sessions.d.ts.map +1 -1
- package/resources/beta/sessions/sessions.js +161 -158
- package/resources/beta/sessions/sessions.js.map +1 -1
- package/resources/beta/sessions/sessions.mjs +161 -158
- package/resources/beta/sessions/sessions.mjs.map +1 -1
- package/resources/beta/sessions/threads/threads.js +86 -83
- package/resources/beta/sessions/threads/threads.js.map +1 -1
- package/resources/beta/sessions/threads/threads.mjs +86 -83
- package/resources/beta/sessions/threads/threads.mjs.map +1 -1
- package/resources/beta/skills/skills.js +104 -101
- package/resources/beta/skills/skills.js.map +1 -1
- package/resources/beta/skills/skills.mjs +104 -101
- package/resources/beta/skills/skills.mjs.map +1 -1
- package/resources/beta/tunnels/certificates.d.mts +2 -2
- package/resources/beta/tunnels/certificates.d.ts +2 -2
- package/resources/beta/tunnels/tunnels.js +188 -185
- package/resources/beta/tunnels/tunnels.js.map +1 -1
- package/resources/beta/tunnels/tunnels.mjs +188 -185
- package/resources/beta/tunnels/tunnels.mjs.map +1 -1
- package/resources/beta/user-profiles.d.mts +45 -0
- package/resources/beta/user-profiles.d.mts.map +1 -1
- package/resources/beta/user-profiles.d.ts +45 -0
- package/resources/beta/user-profiles.d.ts.map +1 -1
- package/resources/beta/user-profiles.js +25 -10
- package/resources/beta/user-profiles.js.map +1 -1
- package/resources/beta/user-profiles.mjs +25 -10
- package/resources/beta/user-profiles.mjs.map +1 -1
- package/resources/beta/vaults/credentials.d.mts +19 -19
- package/resources/beta/vaults/credentials.d.mts.map +1 -1
- package/resources/beta/vaults/credentials.d.ts +19 -19
- package/resources/beta/vaults/credentials.d.ts.map +1 -1
- package/resources/beta/vaults/vaults.js +156 -153
- package/resources/beta/vaults/vaults.js.map +1 -1
- package/resources/beta/vaults/vaults.mjs +156 -153
- package/resources/beta/vaults/vaults.mjs.map +1 -1
- package/resources/completions.d.mts +1 -1
- package/resources/completions.d.ts +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/messages/index.d.mts +1 -1
- package/resources/messages/index.d.mts.map +1 -1
- package/resources/messages/index.d.ts +1 -1
- package/resources/messages/index.d.ts.map +1 -1
- package/resources/messages/index.js.map +1 -1
- package/resources/messages/index.mjs.map +1 -1
- package/resources/messages/messages.d.mts +100 -63
- package/resources/messages/messages.d.mts.map +1 -1
- package/resources/messages/messages.d.ts +100 -63
- package/resources/messages/messages.d.ts.map +1 -1
- package/resources/messages/messages.js +115 -112
- package/resources/messages/messages.js.map +1 -1
- package/resources/messages/messages.mjs +115 -112
- package/resources/messages/messages.mjs.map +1 -1
- package/resources/skills/skills.js +88 -85
- package/resources/skills/skills.js.map +1 -1
- package/resources/skills/skills.mjs +88 -85
- package/resources/skills/skills.mjs.map +1 -1
- package/resources/top-level.js +0 -1
- package/resources/top-level.js.map +1 -1
- package/resources/top-level.mjs +0 -1
- package/resources/top-level.mjs.map +1 -1
- package/src/client.ts +95 -72
- package/src/internal/node.browser.ts +7 -7
- package/src/internal/parse.ts +8 -11
- package/src/internal/shims.ts +4 -3
- package/src/internal/utils/bytes.ts +1 -1
- package/src/internal/utils/log.ts +16 -2
- package/src/lib/BetaMessageStream.ts +7 -5
- package/src/lib/beta-parser.ts +1 -3
- package/src/lib/internal/stub.ts +2 -0
- package/src/lib/internal/types.ts +2 -0
- package/src/lib/middleware.ts +6 -1
- package/src/lib/parser.ts +1 -3
- package/src/lib/tools/BetaToolRunner.ts +157 -24
- package/src/lib/transform-json-schema.ts +8 -6
- package/src/resources/beta/beta.ts +24 -1
- package/src/resources/beta/deployment-runs.ts +4 -0
- package/src/resources/beta/deployments.ts +5 -0
- package/src/resources/beta/dreams.ts +19 -28
- package/src/resources/beta/index.ts +11 -0
- package/src/resources/beta/memory-stores/memories.ts +6 -0
- package/src/resources/beta/memory-stores/memory-versions.ts +7 -0
- package/src/resources/beta/messages/batches.ts +13 -1
- package/src/resources/beta/messages/index.ts +10 -0
- package/src/resources/beta/messages/messages.ts +289 -100
- package/src/resources/beta/models.ts +25 -0
- package/src/resources/beta/organization/index.ts +6 -0
- package/src/resources/beta/organization/organization.ts +12 -0
- package/src/resources/beta/organization/rate-limits.ts +112 -4
- package/src/resources/beta/organization/workspaces/rate-limits.ts +16 -4
- package/src/resources/beta/organization/workspaces/workspaces.ts +3 -3
- package/src/resources/beta/sessions/events.ts +12 -21
- package/src/resources/beta/sessions/resources.ts +0 -3
- package/src/resources/beta/sessions/sessions.ts +8 -2
- package/src/resources/beta/tunnels/certificates.ts +2 -2
- package/src/resources/beta/user-profiles.ts +75 -10
- package/src/resources/beta/vaults/credentials.ts +19 -19
- package/src/resources/completions.ts +1 -1
- package/src/resources/index.ts +6 -0
- package/src/resources/messages/index.ts +6 -0
- package/src/resources/messages/messages.ts +128 -62
- package/src/tsconfig.json +13 -3
- package/src/version.ts +1 -1
- package/tools/agent-toolset/fs-util.js +0 -6
- package/tools/agent-toolset/fs-util.js.map +1 -1
- package/tools/agent-toolset/fs-util.mjs +0 -6
- package/tools/agent-toolset/fs-util.mjs.map +1 -1
- package/tools/agent-toolset/memories.js +4 -4
- package/tools/agent-toolset/memories.js.map +1 -1
- package/tools/agent-toolset/memories.mjs +2 -2
- package/tools/agent-toolset/memories.mjs.map +1 -1
- package/tools/agent-toolset/node.browser.js +12 -12
- package/tools/agent-toolset/node.browser.js.map +1 -1
- package/tools/agent-toolset/node.js +142 -139
- package/tools/agent-toolset/node.js.map +1 -1
- package/tools/agent-toolset/node.mjs +132 -125
- package/tools/agent-toolset/node.mjs.map +1 -1
- package/tools/agent-toolset/skills.js +5 -5
- package/tools/agent-toolset/skills.js.map +1 -1
- package/tools/agent-toolset/sync-interval.js +3 -3
- package/tools/agent-toolset/sync-interval.js.map +1 -1
- package/tools/memory/node.browser.js +2 -2
- package/tools/memory/node.browser.js.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
|
@@ -8,166 +8,169 @@ const workspaces_1 = require("./workspaces.js");
|
|
|
8
8
|
const pagination_1 = require("../../../../core/pagination.js");
|
|
9
9
|
const headers_1 = require("../../../../internal/headers.js");
|
|
10
10
|
const path_1 = require("../../../../internal/utils/path.js");
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
var ServiceAccounts = /* @__PURE__ */ (() => {
|
|
12
|
+
class ServiceAccounts extends resource_1.APIResource {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.workspaces = new WorkspacesAPI.Workspaces(this._client);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* **Requires an OAuth access token with the `org:admin` scope**, from
|
|
19
|
+
* `ant auth login --scope org:admin` or a workload identity federation rule; Admin
|
|
20
|
+
* API keys are not accepted. See
|
|
21
|
+
* [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).
|
|
22
|
+
*
|
|
23
|
+
* Create a service account.
|
|
24
|
+
*
|
|
25
|
+
* A service account is a named workload identity that federation rules target.
|
|
26
|
+
* `organization_role` is `developer` (default) or `admin`; a rule may only be
|
|
27
|
+
* created or retargeted to grant `org:admin` scope when the target's
|
|
28
|
+
* `organization_role` is `admin`. Creating an `admin`-role service account
|
|
29
|
+
* requires an interactive credential (a user OAuth token or a Console session) — a
|
|
30
|
+
* workload may only create `developer`-role service accounts.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* const betaServiceAccount =
|
|
35
|
+
* await client.beta.organization.serviceAccounts.create({
|
|
36
|
+
* name: 'ci-deploy-bot',
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
create(params, options) {
|
|
41
|
+
const { betas, ...body } = params;
|
|
42
|
+
return this._client.post('/v1/organizations/service_accounts?beta=true', {
|
|
43
|
+
body,
|
|
44
|
+
...options,
|
|
45
|
+
headers: (0, headers_1.buildHeaders)([
|
|
46
|
+
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
47
|
+
options?.headers,
|
|
48
|
+
]),
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* **Requires an OAuth access token with the `org:admin` scope**, from
|
|
53
|
+
* `ant auth login --scope org:admin` or a workload identity federation rule; Admin
|
|
54
|
+
* API keys are not accepted. See
|
|
55
|
+
* [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).
|
|
56
|
+
*
|
|
57
|
+
* Retrieve a service account by its ID (`svac_...`).
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* const betaServiceAccount =
|
|
62
|
+
* await client.beta.organization.serviceAccounts.retrieve(
|
|
63
|
+
* 'service_account_id',
|
|
64
|
+
* );
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
retrieve(serviceAccountID, params = {}, options) {
|
|
68
|
+
const { betas } = params ?? {};
|
|
69
|
+
return this._client.get((0, path_1.path) `/v1/organizations/service_accounts/${serviceAccountID}?beta=true`, {
|
|
70
|
+
...options,
|
|
71
|
+
headers: (0, headers_1.buildHeaders)([
|
|
72
|
+
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
73
|
+
options?.headers,
|
|
74
|
+
]),
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* **Requires an OAuth access token with the `org:admin` scope**, from
|
|
79
|
+
* `ant auth login --scope org:admin` or a workload identity federation rule; Admin
|
|
80
|
+
* API keys are not accepted. See
|
|
81
|
+
* [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).
|
|
82
|
+
*
|
|
83
|
+
* Update a service account.
|
|
84
|
+
*
|
|
85
|
+
* Only `description` and `organization_role` are mutable; `name` cannot be
|
|
86
|
+
* changed. Archived service accounts cannot be updated; this returns 400. Setting
|
|
87
|
+
* `organization_role` to `admin` (even when unchanged) requires an interactive
|
|
88
|
+
* credential (a user OAuth token or a Console session).
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```ts
|
|
92
|
+
* const betaServiceAccount =
|
|
93
|
+
* await client.beta.organization.serviceAccounts.update(
|
|
94
|
+
* 'service_account_id',
|
|
95
|
+
* );
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
update(serviceAccountID, params, options) {
|
|
99
|
+
const { betas, ...body } = params;
|
|
100
|
+
return this._client.post((0, path_1.path) `/v1/organizations/service_accounts/${serviceAccountID}?beta=true`, {
|
|
101
|
+
body,
|
|
102
|
+
...options,
|
|
103
|
+
headers: (0, headers_1.buildHeaders)([
|
|
104
|
+
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
105
|
+
options?.headers,
|
|
106
|
+
]),
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* **Requires an OAuth access token with the `org:admin` scope**, from
|
|
111
|
+
* `ant auth login --scope org:admin` or a workload identity federation rule; Admin
|
|
112
|
+
* API keys are not accepted. See
|
|
113
|
+
* [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).
|
|
114
|
+
*
|
|
115
|
+
* List service accounts in the caller's organization.
|
|
116
|
+
*
|
|
117
|
+
* Results are ordered by creation time, newest first. Use `limit` and the
|
|
118
|
+
* `next_page` cursor to paginate; set `include_archived=true` to include archived
|
|
119
|
+
* service accounts.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```ts
|
|
123
|
+
* // Automatically fetches more pages as needed.
|
|
124
|
+
* for await (const betaServiceAccount of client.beta.organization.serviceAccounts.list()) {
|
|
125
|
+
* // ...
|
|
126
|
+
* }
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
list(params = {}, options) {
|
|
130
|
+
const { betas, ...query } = params ?? {};
|
|
131
|
+
return this._client.getAPIList('/v1/organizations/service_accounts?beta=true', (pagination_1.PageCursor), {
|
|
132
|
+
query,
|
|
133
|
+
...options,
|
|
134
|
+
headers: (0, headers_1.buildHeaders)([
|
|
135
|
+
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
136
|
+
options?.headers,
|
|
137
|
+
]),
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* **Requires an OAuth access token with the `org:admin` scope**, from
|
|
142
|
+
* `ant auth login --scope org:admin` or a workload identity federation rule; Admin
|
|
143
|
+
* API keys are not accepted. See
|
|
144
|
+
* [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).
|
|
145
|
+
*
|
|
146
|
+
* Archive a service account.
|
|
147
|
+
*
|
|
148
|
+
* Idempotent; re-archiving returns the service account with its original
|
|
149
|
+
* `archived_at`. Rejected with 400 if any live (non-archived) federation rule
|
|
150
|
+
* still targets this service account, same as issuer archival; archive those rules
|
|
151
|
+
* first or change their target to another service account.
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* ```ts
|
|
155
|
+
* const betaServiceAccount =
|
|
156
|
+
* await client.beta.organization.serviceAccounts.archive(
|
|
157
|
+
* 'service_account_id',
|
|
158
|
+
* );
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
161
|
+
archive(serviceAccountID, params = {}, options) {
|
|
162
|
+
const { betas } = params ?? {};
|
|
163
|
+
return this._client.post((0, path_1.path) `/v1/organizations/service_accounts/${serviceAccountID}/archive?beta=true`, {
|
|
164
|
+
...options,
|
|
165
|
+
headers: (0, headers_1.buildHeaders)([
|
|
166
|
+
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
167
|
+
options?.headers,
|
|
168
|
+
]),
|
|
169
|
+
});
|
|
170
|
+
}
|
|
15
171
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
* API keys are not accepted. See
|
|
20
|
-
* [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).
|
|
21
|
-
*
|
|
22
|
-
* Create a service account.
|
|
23
|
-
*
|
|
24
|
-
* A service account is a named workload identity that federation rules target.
|
|
25
|
-
* `organization_role` is `developer` (default) or `admin`; a rule may only be
|
|
26
|
-
* created or retargeted to grant `org:admin` scope when the target's
|
|
27
|
-
* `organization_role` is `admin`. Creating an `admin`-role service account
|
|
28
|
-
* requires an interactive credential (a user OAuth token or a Console session) — a
|
|
29
|
-
* workload may only create `developer`-role service accounts.
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* ```ts
|
|
33
|
-
* const betaServiceAccount =
|
|
34
|
-
* await client.beta.organization.serviceAccounts.create({
|
|
35
|
-
* name: 'ci-deploy-bot',
|
|
36
|
-
* });
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
create(params, options) {
|
|
40
|
-
const { betas, ...body } = params;
|
|
41
|
-
return this._client.post('/v1/organizations/service_accounts?beta=true', {
|
|
42
|
-
body,
|
|
43
|
-
...options,
|
|
44
|
-
headers: (0, headers_1.buildHeaders)([
|
|
45
|
-
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
46
|
-
options?.headers,
|
|
47
|
-
]),
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* **Requires an OAuth access token with the `org:admin` scope**, from
|
|
52
|
-
* `ant auth login --scope org:admin` or a workload identity federation rule; Admin
|
|
53
|
-
* API keys are not accepted. See
|
|
54
|
-
* [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).
|
|
55
|
-
*
|
|
56
|
-
* Retrieve a service account by its ID (`svac_...`).
|
|
57
|
-
*
|
|
58
|
-
* @example
|
|
59
|
-
* ```ts
|
|
60
|
-
* const betaServiceAccount =
|
|
61
|
-
* await client.beta.organization.serviceAccounts.retrieve(
|
|
62
|
-
* 'service_account_id',
|
|
63
|
-
* );
|
|
64
|
-
* ```
|
|
65
|
-
*/
|
|
66
|
-
retrieve(serviceAccountID, params = {}, options) {
|
|
67
|
-
const { betas } = params ?? {};
|
|
68
|
-
return this._client.get((0, path_1.path) `/v1/organizations/service_accounts/${serviceAccountID}?beta=true`, {
|
|
69
|
-
...options,
|
|
70
|
-
headers: (0, headers_1.buildHeaders)([
|
|
71
|
-
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
72
|
-
options?.headers,
|
|
73
|
-
]),
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* **Requires an OAuth access token with the `org:admin` scope**, from
|
|
78
|
-
* `ant auth login --scope org:admin` or a workload identity federation rule; Admin
|
|
79
|
-
* API keys are not accepted. See
|
|
80
|
-
* [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).
|
|
81
|
-
*
|
|
82
|
-
* Update a service account.
|
|
83
|
-
*
|
|
84
|
-
* Only `description` and `organization_role` are mutable; `name` cannot be
|
|
85
|
-
* changed. Archived service accounts cannot be updated; this returns 400. Setting
|
|
86
|
-
* `organization_role` to `admin` (even when unchanged) requires an interactive
|
|
87
|
-
* credential (a user OAuth token or a Console session).
|
|
88
|
-
*
|
|
89
|
-
* @example
|
|
90
|
-
* ```ts
|
|
91
|
-
* const betaServiceAccount =
|
|
92
|
-
* await client.beta.organization.serviceAccounts.update(
|
|
93
|
-
* 'service_account_id',
|
|
94
|
-
* );
|
|
95
|
-
* ```
|
|
96
|
-
*/
|
|
97
|
-
update(serviceAccountID, params, options) {
|
|
98
|
-
const { betas, ...body } = params;
|
|
99
|
-
return this._client.post((0, path_1.path) `/v1/organizations/service_accounts/${serviceAccountID}?beta=true`, {
|
|
100
|
-
body,
|
|
101
|
-
...options,
|
|
102
|
-
headers: (0, headers_1.buildHeaders)([
|
|
103
|
-
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
104
|
-
options?.headers,
|
|
105
|
-
]),
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* **Requires an OAuth access token with the `org:admin` scope**, from
|
|
110
|
-
* `ant auth login --scope org:admin` or a workload identity federation rule; Admin
|
|
111
|
-
* API keys are not accepted. See
|
|
112
|
-
* [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).
|
|
113
|
-
*
|
|
114
|
-
* List service accounts in the caller's organization.
|
|
115
|
-
*
|
|
116
|
-
* Results are ordered by creation time, newest first. Use `limit` and the
|
|
117
|
-
* `next_page` cursor to paginate; set `include_archived=true` to include archived
|
|
118
|
-
* service accounts.
|
|
119
|
-
*
|
|
120
|
-
* @example
|
|
121
|
-
* ```ts
|
|
122
|
-
* // Automatically fetches more pages as needed.
|
|
123
|
-
* for await (const betaServiceAccount of client.beta.organization.serviceAccounts.list()) {
|
|
124
|
-
* // ...
|
|
125
|
-
* }
|
|
126
|
-
* ```
|
|
127
|
-
*/
|
|
128
|
-
list(params = {}, options) {
|
|
129
|
-
const { betas, ...query } = params ?? {};
|
|
130
|
-
return this._client.getAPIList('/v1/organizations/service_accounts?beta=true', (pagination_1.PageCursor), {
|
|
131
|
-
query,
|
|
132
|
-
...options,
|
|
133
|
-
headers: (0, headers_1.buildHeaders)([
|
|
134
|
-
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
135
|
-
options?.headers,
|
|
136
|
-
]),
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* **Requires an OAuth access token with the `org:admin` scope**, from
|
|
141
|
-
* `ant auth login --scope org:admin` or a workload identity federation rule; Admin
|
|
142
|
-
* API keys are not accepted. See
|
|
143
|
-
* [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).
|
|
144
|
-
*
|
|
145
|
-
* Archive a service account.
|
|
146
|
-
*
|
|
147
|
-
* Idempotent; re-archiving returns the service account with its original
|
|
148
|
-
* `archived_at`. Rejected with 400 if any live (non-archived) federation rule
|
|
149
|
-
* still targets this service account, same as issuer archival; archive those rules
|
|
150
|
-
* first or change their target to another service account.
|
|
151
|
-
*
|
|
152
|
-
* @example
|
|
153
|
-
* ```ts
|
|
154
|
-
* const betaServiceAccount =
|
|
155
|
-
* await client.beta.organization.serviceAccounts.archive(
|
|
156
|
-
* 'service_account_id',
|
|
157
|
-
* );
|
|
158
|
-
* ```
|
|
159
|
-
*/
|
|
160
|
-
archive(serviceAccountID, params = {}, options) {
|
|
161
|
-
const { betas } = params ?? {};
|
|
162
|
-
return this._client.post((0, path_1.path) `/v1/organizations/service_accounts/${serviceAccountID}/archive?beta=true`, {
|
|
163
|
-
...options,
|
|
164
|
-
headers: (0, headers_1.buildHeaders)([
|
|
165
|
-
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
166
|
-
options?.headers,
|
|
167
|
-
]),
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
}
|
|
172
|
+
ServiceAccounts.Workspaces = workspaces_1.Workspaces;
|
|
173
|
+
return ServiceAccounts;
|
|
174
|
+
})();
|
|
171
175
|
exports.ServiceAccounts = ServiceAccounts;
|
|
172
|
-
ServiceAccounts.Workspaces = workspaces_1.Workspaces;
|
|
173
176
|
//# sourceMappingURL=service-accounts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-accounts.js","sourceRoot":"","sources":["../../../../src/resources/beta/organization/service-accounts/service-accounts.ts"],"names":[],"mappings":";;;;AAAA,2DAAwD;AAExD,uEAA8C;AAC9C,gDAMsB;AAGtB,+DAA6F;AAC7F,6DAA4D;AAE5D,6DAAuD
|
|
1
|
+
{"version":3,"file":"service-accounts.js","sourceRoot":"","sources":["../../../../src/resources/beta/organization/service-accounts/service-accounts.ts"],"names":[],"mappings":"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"}
|
|
@@ -4,165 +4,168 @@ import { Workspaces, } from "./workspaces.mjs";
|
|
|
4
4
|
import { PageCursor } from "../../../../core/pagination.mjs";
|
|
5
5
|
import { buildHeaders } from "../../../../internal/headers.mjs";
|
|
6
6
|
import { path } from "../../../../internal/utils/path.mjs";
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
export var ServiceAccounts = /* @__PURE__ */ (() => {
|
|
8
|
+
class ServiceAccounts extends APIResource {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.workspaces = new WorkspacesAPI.Workspaces(this._client);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* **Requires an OAuth access token with the `org:admin` scope**, from
|
|
15
|
+
* `ant auth login --scope org:admin` or a workload identity federation rule; Admin
|
|
16
|
+
* API keys are not accepted. See
|
|
17
|
+
* [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).
|
|
18
|
+
*
|
|
19
|
+
* Create a service account.
|
|
20
|
+
*
|
|
21
|
+
* A service account is a named workload identity that federation rules target.
|
|
22
|
+
* `organization_role` is `developer` (default) or `admin`; a rule may only be
|
|
23
|
+
* created or retargeted to grant `org:admin` scope when the target's
|
|
24
|
+
* `organization_role` is `admin`. Creating an `admin`-role service account
|
|
25
|
+
* requires an interactive credential (a user OAuth token or a Console session) — a
|
|
26
|
+
* workload may only create `developer`-role service accounts.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* const betaServiceAccount =
|
|
31
|
+
* await client.beta.organization.serviceAccounts.create({
|
|
32
|
+
* name: 'ci-deploy-bot',
|
|
33
|
+
* });
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
create(params, options) {
|
|
37
|
+
const { betas, ...body } = params;
|
|
38
|
+
return this._client.post('/v1/organizations/service_accounts?beta=true', {
|
|
39
|
+
body,
|
|
40
|
+
...options,
|
|
41
|
+
headers: buildHeaders([
|
|
42
|
+
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
43
|
+
options?.headers,
|
|
44
|
+
]),
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* **Requires an OAuth access token with the `org:admin` scope**, from
|
|
49
|
+
* `ant auth login --scope org:admin` or a workload identity federation rule; Admin
|
|
50
|
+
* API keys are not accepted. See
|
|
51
|
+
* [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).
|
|
52
|
+
*
|
|
53
|
+
* Retrieve a service account by its ID (`svac_...`).
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* const betaServiceAccount =
|
|
58
|
+
* await client.beta.organization.serviceAccounts.retrieve(
|
|
59
|
+
* 'service_account_id',
|
|
60
|
+
* );
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
retrieve(serviceAccountID, params = {}, options) {
|
|
64
|
+
const { betas } = params ?? {};
|
|
65
|
+
return this._client.get(path `/v1/organizations/service_accounts/${serviceAccountID}?beta=true`, {
|
|
66
|
+
...options,
|
|
67
|
+
headers: buildHeaders([
|
|
68
|
+
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
69
|
+
options?.headers,
|
|
70
|
+
]),
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* **Requires an OAuth access token with the `org:admin` scope**, from
|
|
75
|
+
* `ant auth login --scope org:admin` or a workload identity federation rule; Admin
|
|
76
|
+
* API keys are not accepted. See
|
|
77
|
+
* [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).
|
|
78
|
+
*
|
|
79
|
+
* Update a service account.
|
|
80
|
+
*
|
|
81
|
+
* Only `description` and `organization_role` are mutable; `name` cannot be
|
|
82
|
+
* changed. Archived service accounts cannot be updated; this returns 400. Setting
|
|
83
|
+
* `organization_role` to `admin` (even when unchanged) requires an interactive
|
|
84
|
+
* credential (a user OAuth token or a Console session).
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* const betaServiceAccount =
|
|
89
|
+
* await client.beta.organization.serviceAccounts.update(
|
|
90
|
+
* 'service_account_id',
|
|
91
|
+
* );
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
update(serviceAccountID, params, options) {
|
|
95
|
+
const { betas, ...body } = params;
|
|
96
|
+
return this._client.post(path `/v1/organizations/service_accounts/${serviceAccountID}?beta=true`, {
|
|
97
|
+
body,
|
|
98
|
+
...options,
|
|
99
|
+
headers: buildHeaders([
|
|
100
|
+
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
101
|
+
options?.headers,
|
|
102
|
+
]),
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* **Requires an OAuth access token with the `org:admin` scope**, from
|
|
107
|
+
* `ant auth login --scope org:admin` or a workload identity federation rule; Admin
|
|
108
|
+
* API keys are not accepted. See
|
|
109
|
+
* [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).
|
|
110
|
+
*
|
|
111
|
+
* List service accounts in the caller's organization.
|
|
112
|
+
*
|
|
113
|
+
* Results are ordered by creation time, newest first. Use `limit` and the
|
|
114
|
+
* `next_page` cursor to paginate; set `include_archived=true` to include archived
|
|
115
|
+
* service accounts.
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```ts
|
|
119
|
+
* // Automatically fetches more pages as needed.
|
|
120
|
+
* for await (const betaServiceAccount of client.beta.organization.serviceAccounts.list()) {
|
|
121
|
+
* // ...
|
|
122
|
+
* }
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
list(params = {}, options) {
|
|
126
|
+
const { betas, ...query } = params ?? {};
|
|
127
|
+
return this._client.getAPIList('/v1/organizations/service_accounts?beta=true', (PageCursor), {
|
|
128
|
+
query,
|
|
129
|
+
...options,
|
|
130
|
+
headers: buildHeaders([
|
|
131
|
+
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
132
|
+
options?.headers,
|
|
133
|
+
]),
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* **Requires an OAuth access token with the `org:admin` scope**, from
|
|
138
|
+
* `ant auth login --scope org:admin` or a workload identity federation rule; Admin
|
|
139
|
+
* API keys are not accepted. See
|
|
140
|
+
* [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).
|
|
141
|
+
*
|
|
142
|
+
* Archive a service account.
|
|
143
|
+
*
|
|
144
|
+
* Idempotent; re-archiving returns the service account with its original
|
|
145
|
+
* `archived_at`. Rejected with 400 if any live (non-archived) federation rule
|
|
146
|
+
* still targets this service account, same as issuer archival; archive those rules
|
|
147
|
+
* first or change their target to another service account.
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* ```ts
|
|
151
|
+
* const betaServiceAccount =
|
|
152
|
+
* await client.beta.organization.serviceAccounts.archive(
|
|
153
|
+
* 'service_account_id',
|
|
154
|
+
* );
|
|
155
|
+
* ```
|
|
156
|
+
*/
|
|
157
|
+
archive(serviceAccountID, params = {}, options) {
|
|
158
|
+
const { betas } = params ?? {};
|
|
159
|
+
return this._client.post(path `/v1/organizations/service_accounts/${serviceAccountID}/archive?beta=true`, {
|
|
160
|
+
...options,
|
|
161
|
+
headers: buildHeaders([
|
|
162
|
+
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
163
|
+
options?.headers,
|
|
164
|
+
]),
|
|
165
|
+
});
|
|
166
|
+
}
|
|
11
167
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* API keys are not accepted. See
|
|
16
|
-
* [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).
|
|
17
|
-
*
|
|
18
|
-
* Create a service account.
|
|
19
|
-
*
|
|
20
|
-
* A service account is a named workload identity that federation rules target.
|
|
21
|
-
* `organization_role` is `developer` (default) or `admin`; a rule may only be
|
|
22
|
-
* created or retargeted to grant `org:admin` scope when the target's
|
|
23
|
-
* `organization_role` is `admin`. Creating an `admin`-role service account
|
|
24
|
-
* requires an interactive credential (a user OAuth token or a Console session) — a
|
|
25
|
-
* workload may only create `developer`-role service accounts.
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* ```ts
|
|
29
|
-
* const betaServiceAccount =
|
|
30
|
-
* await client.beta.organization.serviceAccounts.create({
|
|
31
|
-
* name: 'ci-deploy-bot',
|
|
32
|
-
* });
|
|
33
|
-
* ```
|
|
34
|
-
*/
|
|
35
|
-
create(params, options) {
|
|
36
|
-
const { betas, ...body } = params;
|
|
37
|
-
return this._client.post('/v1/organizations/service_accounts?beta=true', {
|
|
38
|
-
body,
|
|
39
|
-
...options,
|
|
40
|
-
headers: buildHeaders([
|
|
41
|
-
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
42
|
-
options?.headers,
|
|
43
|
-
]),
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* **Requires an OAuth access token with the `org:admin` scope**, from
|
|
48
|
-
* `ant auth login --scope org:admin` or a workload identity federation rule; Admin
|
|
49
|
-
* API keys are not accepted. See
|
|
50
|
-
* [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).
|
|
51
|
-
*
|
|
52
|
-
* Retrieve a service account by its ID (`svac_...`).
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
* ```ts
|
|
56
|
-
* const betaServiceAccount =
|
|
57
|
-
* await client.beta.organization.serviceAccounts.retrieve(
|
|
58
|
-
* 'service_account_id',
|
|
59
|
-
* );
|
|
60
|
-
* ```
|
|
61
|
-
*/
|
|
62
|
-
retrieve(serviceAccountID, params = {}, options) {
|
|
63
|
-
const { betas } = params ?? {};
|
|
64
|
-
return this._client.get(path `/v1/organizations/service_accounts/${serviceAccountID}?beta=true`, {
|
|
65
|
-
...options,
|
|
66
|
-
headers: buildHeaders([
|
|
67
|
-
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
68
|
-
options?.headers,
|
|
69
|
-
]),
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* **Requires an OAuth access token with the `org:admin` scope**, from
|
|
74
|
-
* `ant auth login --scope org:admin` or a workload identity federation rule; Admin
|
|
75
|
-
* API keys are not accepted. See
|
|
76
|
-
* [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).
|
|
77
|
-
*
|
|
78
|
-
* Update a service account.
|
|
79
|
-
*
|
|
80
|
-
* Only `description` and `organization_role` are mutable; `name` cannot be
|
|
81
|
-
* changed. Archived service accounts cannot be updated; this returns 400. Setting
|
|
82
|
-
* `organization_role` to `admin` (even when unchanged) requires an interactive
|
|
83
|
-
* credential (a user OAuth token or a Console session).
|
|
84
|
-
*
|
|
85
|
-
* @example
|
|
86
|
-
* ```ts
|
|
87
|
-
* const betaServiceAccount =
|
|
88
|
-
* await client.beta.organization.serviceAccounts.update(
|
|
89
|
-
* 'service_account_id',
|
|
90
|
-
* );
|
|
91
|
-
* ```
|
|
92
|
-
*/
|
|
93
|
-
update(serviceAccountID, params, options) {
|
|
94
|
-
const { betas, ...body } = params;
|
|
95
|
-
return this._client.post(path `/v1/organizations/service_accounts/${serviceAccountID}?beta=true`, {
|
|
96
|
-
body,
|
|
97
|
-
...options,
|
|
98
|
-
headers: buildHeaders([
|
|
99
|
-
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
100
|
-
options?.headers,
|
|
101
|
-
]),
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* **Requires an OAuth access token with the `org:admin` scope**, from
|
|
106
|
-
* `ant auth login --scope org:admin` or a workload identity federation rule; Admin
|
|
107
|
-
* API keys are not accepted. See
|
|
108
|
-
* [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).
|
|
109
|
-
*
|
|
110
|
-
* List service accounts in the caller's organization.
|
|
111
|
-
*
|
|
112
|
-
* Results are ordered by creation time, newest first. Use `limit` and the
|
|
113
|
-
* `next_page` cursor to paginate; set `include_archived=true` to include archived
|
|
114
|
-
* service accounts.
|
|
115
|
-
*
|
|
116
|
-
* @example
|
|
117
|
-
* ```ts
|
|
118
|
-
* // Automatically fetches more pages as needed.
|
|
119
|
-
* for await (const betaServiceAccount of client.beta.organization.serviceAccounts.list()) {
|
|
120
|
-
* // ...
|
|
121
|
-
* }
|
|
122
|
-
* ```
|
|
123
|
-
*/
|
|
124
|
-
list(params = {}, options) {
|
|
125
|
-
const { betas, ...query } = params ?? {};
|
|
126
|
-
return this._client.getAPIList('/v1/organizations/service_accounts?beta=true', (PageCursor), {
|
|
127
|
-
query,
|
|
128
|
-
...options,
|
|
129
|
-
headers: buildHeaders([
|
|
130
|
-
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
131
|
-
options?.headers,
|
|
132
|
-
]),
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* **Requires an OAuth access token with the `org:admin` scope**, from
|
|
137
|
-
* `ant auth login --scope org:admin` or a workload identity federation rule; Admin
|
|
138
|
-
* API keys are not accepted. See
|
|
139
|
-
* [Manage WIF with the Admin API](/docs/en/manage-claude/wif-admin-api).
|
|
140
|
-
*
|
|
141
|
-
* Archive a service account.
|
|
142
|
-
*
|
|
143
|
-
* Idempotent; re-archiving returns the service account with its original
|
|
144
|
-
* `archived_at`. Rejected with 400 if any live (non-archived) federation rule
|
|
145
|
-
* still targets this service account, same as issuer archival; archive those rules
|
|
146
|
-
* first or change their target to another service account.
|
|
147
|
-
*
|
|
148
|
-
* @example
|
|
149
|
-
* ```ts
|
|
150
|
-
* const betaServiceAccount =
|
|
151
|
-
* await client.beta.organization.serviceAccounts.archive(
|
|
152
|
-
* 'service_account_id',
|
|
153
|
-
* );
|
|
154
|
-
* ```
|
|
155
|
-
*/
|
|
156
|
-
archive(serviceAccountID, params = {}, options) {
|
|
157
|
-
const { betas } = params ?? {};
|
|
158
|
-
return this._client.post(path `/v1/organizations/service_accounts/${serviceAccountID}/archive?beta=true`, {
|
|
159
|
-
...options,
|
|
160
|
-
headers: buildHeaders([
|
|
161
|
-
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
162
|
-
options?.headers,
|
|
163
|
-
]),
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
ServiceAccounts.Workspaces = Workspaces;
|
|
168
|
+
ServiceAccounts.Workspaces = Workspaces;
|
|
169
|
+
return ServiceAccounts;
|
|
170
|
+
})();
|
|
168
171
|
//# sourceMappingURL=service-accounts.mjs.map
|