@puku-ai/sdk 4.0.1 → 4.0.2
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/dist/index.d.ts +26 -0
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -0
- package/dist/vendor/_vendor/partial-json-parser/parser.d.ts +2 -0
- package/dist/vendor/_vendor/partial-json-parser/parser.js +223 -0
- package/dist/vendor/_vendor/partial-json-parser/parser.js.map +1 -0
- package/dist/vendor/api-promise.d.ts +2 -0
- package/dist/vendor/api-promise.js +3 -0
- package/dist/vendor/api-promise.js.map +1 -0
- package/dist/vendor/client.d.ts +399 -0
- package/dist/vendor/client.js +976 -0
- package/dist/vendor/client.js.map +1 -0
- package/dist/vendor/core/api-promise.d.ts +49 -0
- package/dist/vendor/core/api-promise.js +77 -0
- package/dist/vendor/core/api-promise.js.map +1 -0
- package/dist/vendor/core/api.d.ts +10 -0
- package/dist/vendor/core/api.js +2 -0
- package/dist/vendor/core/api.js.map +1 -0
- package/dist/vendor/core/credentials.d.ts +130 -0
- package/dist/vendor/core/credentials.js +274 -0
- package/dist/vendor/core/credentials.js.map +1 -0
- package/dist/vendor/core/error.d.ts +82 -0
- package/dist/vendor/core/error.js +140 -0
- package/dist/vendor/core/error.js.map +1 -0
- package/dist/vendor/core/middleware.d.ts +153 -0
- package/dist/vendor/core/middleware.js +168 -0
- package/dist/vendor/core/middleware.js.map +1 -0
- package/dist/vendor/core/pagination.d.ts +121 -0
- package/dist/vendor/core/pagination.js +207 -0
- package/dist/vendor/core/pagination.js.map +1 -0
- package/dist/vendor/core/resource.d.ts +5 -0
- package/dist/vendor/core/resource.js +8 -0
- package/dist/vendor/core/resource.js.map +1 -0
- package/dist/vendor/core/streaming.d.ts +41 -0
- package/dist/vendor/core/streaming.js +342 -0
- package/dist/vendor/core/streaming.js.map +1 -0
- package/dist/vendor/core/uploads.d.ts +2 -0
- package/dist/vendor/core/uploads.js +2 -0
- package/dist/vendor/core/uploads.js.map +1 -0
- package/dist/vendor/error.d.ts +2 -0
- package/dist/vendor/error.js +3 -0
- package/dist/vendor/error.js.map +1 -0
- package/dist/vendor/helpers/beta/environments.d.ts +22 -0
- package/dist/vendor/helpers/beta/environments.js +23 -0
- package/dist/vendor/helpers/beta/environments.js.map +1 -0
- package/dist/vendor/helpers/beta/json-schema.d.ts +36 -0
- package/dist/vendor/helpers/beta/json-schema.js +53 -0
- package/dist/vendor/helpers/beta/json-schema.js.map +1 -0
- package/dist/vendor/helpers/beta/mcp.d.ts +302 -0
- package/dist/vendor/helpers/beta/mcp.js +406 -0
- package/dist/vendor/helpers/beta/mcp.js.map +1 -0
- package/dist/vendor/helpers/beta/memory.d.ts +10 -0
- package/dist/vendor/helpers/beta/memory.js +15 -0
- package/dist/vendor/helpers/beta/memory.js.map +1 -0
- package/dist/vendor/helpers/beta/standard-schema.d.ts +44 -0
- package/dist/vendor/helpers/beta/standard-schema.js +54 -0
- package/dist/vendor/helpers/beta/standard-schema.js.map +1 -0
- package/dist/vendor/helpers/beta/zod.d.ts +32 -0
- package/dist/vendor/helpers/beta/zod.js +52 -0
- package/dist/vendor/helpers/beta/zod.js.map +1 -0
- package/dist/vendor/helpers/index.d.ts +2 -0
- package/dist/vendor/helpers/index.js +3 -0
- package/dist/vendor/helpers/index.js.map +1 -0
- package/dist/vendor/helpers/json-schema.d.ts +17 -0
- package/dist/vendor/helpers/json-schema.js +34 -0
- package/dist/vendor/helpers/json-schema.js.map +1 -0
- package/dist/vendor/helpers/zod.d.ts +12 -0
- package/dist/vendor/helpers/zod.js +42 -0
- package/dist/vendor/helpers/zod.js.map +1 -0
- package/dist/vendor/index.d.ts +16 -0
- package/dist/vendor/index.js +23 -0
- package/dist/vendor/index.js.map +1 -0
- package/dist/vendor/internal/builtin-types.d.ts +72 -0
- package/dist/vendor/internal/builtin-types.js +3 -0
- package/dist/vendor/internal/builtin-types.js.map +1 -0
- package/dist/vendor/internal/constants.d.ts +4 -0
- package/dist/vendor/internal/constants.js +10 -0
- package/dist/vendor/internal/constants.js.map +1 -0
- package/dist/vendor/internal/decoders/jsonl.d.ts +9 -0
- package/dist/vendor/internal/decoders/jsonl.js +37 -0
- package/dist/vendor/internal/decoders/jsonl.js.map +1 -0
- package/dist/vendor/internal/decoders/line.d.ts +16 -0
- package/dist/vendor/internal/decoders/line.js +105 -0
- package/dist/vendor/internal/decoders/line.js.map +1 -0
- package/dist/vendor/internal/detect-platform.d.ts +14 -0
- package/dist/vendor/internal/detect-platform.js +155 -0
- package/dist/vendor/internal/detect-platform.js.map +1 -0
- package/dist/vendor/internal/errors.d.ts +2 -0
- package/dist/vendor/internal/errors.js +38 -0
- package/dist/vendor/internal/errors.js.map +1 -0
- package/dist/vendor/internal/file-store.d.ts +135 -0
- package/dist/vendor/internal/file-store.js +529 -0
- package/dist/vendor/internal/file-store.js.map +1 -0
- package/dist/vendor/internal/headers.d.ts +28 -0
- package/dist/vendor/internal/headers.js +114 -0
- package/dist/vendor/internal/headers.js.map +1 -0
- package/dist/vendor/internal/message-stream-utils.d.ts +9 -0
- package/dist/vendor/internal/message-stream-utils.js +30 -0
- package/dist/vendor/internal/message-stream-utils.js.map +1 -0
- package/dist/vendor/internal/node.browser.d.ts +8 -0
- package/dist/vendor/internal/node.browser.js +19 -0
- package/dist/vendor/internal/node.browser.js.map +1 -0
- package/dist/vendor/internal/node.d.ts +13 -0
- package/dist/vendor/internal/node.js +14 -0
- package/dist/vendor/internal/node.js.map +1 -0
- package/dist/vendor/internal/parse.d.ts +17 -0
- package/dist/vendor/internal/parse.js +62 -0
- package/dist/vendor/internal/parse.js.map +1 -0
- package/dist/vendor/internal/qs/formats.d.ts +6 -0
- package/dist/vendor/internal/qs/formats.js +9 -0
- package/dist/vendor/internal/qs/formats.js.map +1 -0
- package/dist/vendor/internal/qs/index.d.ts +9 -0
- package/dist/vendor/internal/qs/index.js +10 -0
- package/dist/vendor/internal/qs/index.js.map +1 -0
- package/dist/vendor/internal/qs/stringify.d.ts +2 -0
- package/dist/vendor/internal/qs/stringify.js +274 -0
- package/dist/vendor/internal/qs/stringify.js.map +1 -0
- package/dist/vendor/internal/qs/types.d.ts +56 -0
- package/dist/vendor/internal/qs/types.js +2 -0
- package/dist/vendor/internal/qs/types.js.map +1 -0
- package/dist/vendor/internal/qs/utils.d.ts +14 -0
- package/dist/vendor/internal/qs/utils.js +217 -0
- package/dist/vendor/internal/qs/utils.js.map +1 -0
- package/dist/vendor/internal/request-options.d.ts +126 -0
- package/dist/vendor/internal/request-options.js +27 -0
- package/dist/vendor/internal/request-options.js.map +1 -0
- package/dist/vendor/internal/request-signal.d.ts +3 -0
- package/dist/vendor/internal/request-signal.js +45 -0
- package/dist/vendor/internal/request-signal.js.map +1 -0
- package/dist/vendor/internal/shim-types.d.ts +16 -0
- package/dist/vendor/internal/shim-types.js +3 -0
- package/dist/vendor/internal/shim-types.js.map +1 -0
- package/dist/vendor/internal/shims.d.ts +25 -0
- package/dist/vendor/internal/shims.js +85 -0
- package/dist/vendor/internal/shims.js.map +1 -0
- package/dist/vendor/internal/stainless-helper-header.d.ts +59 -0
- package/dist/vendor/internal/stainless-helper-header.js +83 -0
- package/dist/vendor/internal/stainless-helper-header.js.map +1 -0
- package/dist/vendor/internal/stream-utils.d.ts +7 -0
- package/dist/vendor/internal/stream-utils.js +35 -0
- package/dist/vendor/internal/stream-utils.js.map +1 -0
- package/dist/vendor/internal/to-file.d.ts +44 -0
- package/dist/vendor/internal/to-file.js +93 -0
- package/dist/vendor/internal/to-file.js.map +1 -0
- package/dist/vendor/internal/types.d.ts +62 -0
- package/dist/vendor/internal/types.js +3 -0
- package/dist/vendor/internal/types.js.map +1 -0
- package/dist/vendor/internal/uploads.d.ts +41 -0
- package/dist/vendor/internal/uploads.js +139 -0
- package/dist/vendor/internal/uploads.js.map +1 -0
- package/dist/vendor/internal/utils/abort.d.ts +11 -0
- package/dist/vendor/internal/utils/abort.js +22 -0
- package/dist/vendor/internal/utils/abort.js.map +1 -0
- package/dist/vendor/internal/utils/async-queue.d.ts +30 -0
- package/dist/vendor/internal/utils/async-queue.js +66 -0
- package/dist/vendor/internal/utils/async-queue.js.map +1 -0
- package/dist/vendor/internal/utils/backoff.d.ts +22 -0
- package/dist/vendor/internal/utils/backoff.js +36 -0
- package/dist/vendor/internal/utils/backoff.js.map +1 -0
- package/dist/vendor/internal/utils/base64.d.ts +2 -0
- package/dist/vendor/internal/utils/base64.js +33 -0
- package/dist/vendor/internal/utils/base64.js.map +1 -0
- package/dist/vendor/internal/utils/bytes.d.ts +3 -0
- package/dist/vendor/internal/utils/bytes.js +26 -0
- package/dist/vendor/internal/utils/bytes.js.map +1 -0
- package/dist/vendor/internal/utils/env.d.ts +8 -0
- package/dist/vendor/internal/utils/env.js +18 -0
- package/dist/vendor/internal/utils/env.js.map +1 -0
- package/dist/vendor/internal/utils/log.d.ts +46 -0
- package/dist/vendor/internal/utils/log.js +105 -0
- package/dist/vendor/internal/utils/log.js.map +1 -0
- package/dist/vendor/internal/utils/path.d.ts +14 -0
- package/dist/vendor/internal/utils/path.js +74 -0
- package/dist/vendor/internal/utils/path.js.map +1 -0
- package/dist/vendor/internal/utils/promise.d.ts +10 -0
- package/dist/vendor/internal/utils/promise.js +15 -0
- package/dist/vendor/internal/utils/promise.js.map +1 -0
- package/dist/vendor/internal/utils/query.d.ts +1 -0
- package/dist/vendor/internal/utils/query.js +6 -0
- package/dist/vendor/internal/utils/query.js.map +1 -0
- package/dist/vendor/internal/utils/sleep.d.ts +9 -0
- package/dist/vendor/internal/utils/sleep.js +24 -0
- package/dist/vendor/internal/utils/sleep.js.map +1 -0
- package/dist/vendor/internal/utils/time.d.ts +2 -0
- package/dist/vendor/internal/utils/time.js +5 -0
- package/dist/vendor/internal/utils/time.js.map +1 -0
- package/dist/vendor/internal/utils/uuid.d.ts +4 -0
- package/dist/vendor/internal/utils/uuid.js +15 -0
- package/dist/vendor/internal/utils/uuid.js.map +1 -0
- package/dist/vendor/internal/utils/values.d.ts +24 -0
- package/dist/vendor/internal/utils/values.js +106 -0
- package/dist/vendor/internal/utils/values.js.map +1 -0
- package/dist/vendor/internal/utils.d.ts +7 -0
- package/dist/vendor/internal/utils.js +9 -0
- package/dist/vendor/internal/utils.js.map +1 -0
- package/dist/vendor/lib/BetaMessageStream.d.ts +123 -0
- package/dist/vendor/lib/BetaMessageStream.js +662 -0
- package/dist/vendor/lib/BetaMessageStream.js.map +1 -0
- package/dist/vendor/lib/MessageStream.d.ts +122 -0
- package/dist/vendor/lib/MessageStream.js +609 -0
- package/dist/vendor/lib/MessageStream.js.map +1 -0
- package/dist/vendor/lib/beta-parser.d.ts +36 -0
- package/dist/vendor/lib/beta-parser.js +75 -0
- package/dist/vendor/lib/beta-parser.js.map +1 -0
- package/dist/vendor/lib/credentials/credential-chain.d.ts +38 -0
- package/dist/vendor/lib/credentials/credential-chain.js +208 -0
- package/dist/vendor/lib/credentials/credential-chain.js.map +1 -0
- package/dist/vendor/lib/credentials/identity-token.d.ts +10 -0
- package/dist/vendor/lib/credentials/identity-token.js +35 -0
- package/dist/vendor/lib/credentials/identity-token.js.map +1 -0
- package/dist/vendor/lib/credentials/oidc-federation.d.ts +39 -0
- package/dist/vendor/lib/credentials/oidc-federation.js +79 -0
- package/dist/vendor/lib/credentials/oidc-federation.js.map +1 -0
- package/dist/vendor/lib/credentials/token-cache.d.ts +53 -0
- package/dist/vendor/lib/credentials/token-cache.js +110 -0
- package/dist/vendor/lib/credentials/token-cache.js.map +1 -0
- package/dist/vendor/lib/credentials/types.d.ts +95 -0
- package/dist/vendor/lib/credentials/types.js +226 -0
- package/dist/vendor/lib/credentials/types.js.map +1 -0
- package/dist/vendor/lib/credentials/user-oauth.d.ts +20 -0
- package/dist/vendor/lib/credentials/user-oauth.js +94 -0
- package/dist/vendor/lib/credentials/user-oauth.js.map +1 -0
- package/dist/vendor/lib/credentials.d.ts +3 -0
- package/dist/vendor/lib/credentials.js +3 -0
- package/dist/vendor/lib/credentials.js.map +1 -0
- package/dist/vendor/lib/environments/index.d.ts +3 -0
- package/dist/vendor/lib/environments/index.js +4 -0
- package/dist/vendor/lib/environments/index.js.map +1 -0
- package/dist/vendor/lib/environments/poller.d.ts +94 -0
- package/dist/vendor/lib/environments/poller.js +218 -0
- package/dist/vendor/lib/environments/poller.js.map +1 -0
- package/dist/vendor/lib/environments/worker.d.ts +226 -0
- package/dist/vendor/lib/environments/worker.js +572 -0
- package/dist/vendor/lib/environments/worker.js.map +1 -0
- package/dist/vendor/lib/helper-client.d.ts +30 -0
- package/dist/vendor/lib/helper-client.js +55 -0
- package/dist/vendor/lib/helper-client.js.map +1 -0
- package/dist/vendor/lib/middleware.d.ts +97 -0
- package/dist/vendor/lib/middleware.js +775 -0
- package/dist/vendor/lib/middleware.js.map +1 -0
- package/dist/vendor/lib/parser.d.ts +31 -0
- package/dist/vendor/lib/parser.js +62 -0
- package/dist/vendor/lib/parser.js.map +1 -0
- package/dist/vendor/lib/sessions/accumulate.d.ts +22 -0
- package/dist/vendor/lib/sessions/accumulate.js +42 -0
- package/dist/vendor/lib/sessions/accumulate.js.map +1 -0
- package/dist/vendor/lib/standard-schema.d.ts +130 -0
- package/dist/vendor/lib/standard-schema.js +41 -0
- package/dist/vendor/lib/standard-schema.js.map +1 -0
- package/dist/vendor/lib/tools/BetaRunnableTool.d.ts +48 -0
- package/dist/vendor/lib/tools/BetaRunnableTool.js +26 -0
- package/dist/vendor/lib/tools/BetaRunnableTool.js.map +1 -0
- package/dist/vendor/lib/tools/BetaToolRunner.d.ts +160 -0
- package/dist/vendor/lib/tools/BetaToolRunner.js +497 -0
- package/dist/vendor/lib/tools/BetaToolRunner.js.map +1 -0
- package/dist/vendor/lib/tools/CompactionControl.d.ts +29 -0
- package/dist/vendor/lib/tools/CompactionControl.js +25 -0
- package/dist/vendor/lib/tools/CompactionControl.js.map +1 -0
- package/dist/vendor/lib/tools/SessionToolRunner.d.ts +178 -0
- package/dist/vendor/lib/tools/SessionToolRunner.js +737 -0
- package/dist/vendor/lib/tools/SessionToolRunner.js.map +1 -0
- package/dist/vendor/lib/tools/ToolError.d.ts +32 -0
- package/dist/vendor/lib/tools/ToolError.js +43 -0
- package/dist/vendor/lib/tools/ToolError.js.map +1 -0
- package/dist/vendor/lib/transform-json-schema.d.ts +2 -0
- package/dist/vendor/lib/transform-json-schema.js +111 -0
- package/dist/vendor/lib/transform-json-schema.js.map +1 -0
- package/dist/vendor/pagination.d.ts +2 -0
- package/dist/vendor/pagination.js +3 -0
- package/dist/vendor/pagination.js.map +1 -0
- package/dist/vendor/resource.d.ts +2 -0
- package/dist/vendor/resource.js +3 -0
- package/dist/vendor/resource.js.map +1 -0
- package/dist/vendor/resources/beta/agents/agents.d.ts +1128 -0
- package/dist/vendor/resources/beta/agents/agents.js +123 -0
- package/dist/vendor/resources/beta/agents/agents.js.map +1 -0
- package/dist/vendor/resources/beta/agents/index.d.ts +2 -0
- package/dist/vendor/resources/beta/agents/index.js +4 -0
- package/dist/vendor/resources/beta/agents/index.js.map +1 -0
- package/dist/vendor/resources/beta/agents/versions.d.ts +32 -0
- package/dist/vendor/resources/beta/agents/versions.js +32 -0
- package/dist/vendor/resources/beta/agents/versions.js.map +1 -0
- package/dist/vendor/resources/beta/agents.d.ts +1 -0
- package/dist/vendor/resources/beta/agents.js +3 -0
- package/dist/vendor/resources/beta/agents.js.map +1 -0
- package/dist/vendor/resources/beta/beta.d.ts +131 -0
- package/dist/vendor/resources/beta/beta.js +69 -0
- package/dist/vendor/resources/beta/beta.js.map +1 -0
- package/dist/vendor/resources/beta/deployment-runs.d.ts +305 -0
- package/dist/vendor/resources/beta/deployment-runs.js +51 -0
- package/dist/vendor/resources/beta/deployment-runs.js.map +1 -0
- package/dist/vendor/resources/beta/deployments.d.ts +698 -0
- package/dist/vendor/resources/beta/deployments.js +192 -0
- package/dist/vendor/resources/beta/deployments.js.map +1 -0
- package/dist/vendor/resources/beta/dreams.d.ts +335 -0
- package/dist/vendor/resources/beta/dreams.js +112 -0
- package/dist/vendor/resources/beta/dreams.js.map +1 -0
- package/dist/vendor/resources/beta/environments/environments.d.ts +432 -0
- package/dist/vendor/resources/beta/environments/environments.js +142 -0
- package/dist/vendor/resources/beta/environments/environments.js.map +1 -0
- package/dist/vendor/resources/beta/environments/index.d.ts +2 -0
- package/dist/vendor/resources/beta/environments/index.js +4 -0
- package/dist/vendor/resources/beta/environments/index.js.map +1 -0
- package/dist/vendor/resources/beta/environments/work.d.ts +500 -0
- package/dist/vendor/resources/beta/environments/work.js +251 -0
- package/dist/vendor/resources/beta/environments/work.js.map +1 -0
- package/dist/vendor/resources/beta/environments.d.ts +1 -0
- package/dist/vendor/resources/beta/environments.js +3 -0
- package/dist/vendor/resources/beta/environments.js.map +1 -0
- package/dist/vendor/resources/beta/files.d.ts +190 -0
- package/dist/vendor/resources/beta/files.js +120 -0
- package/dist/vendor/resources/beta/files.js.map +1 -0
- package/dist/vendor/resources/beta/index.d.ts +17 -0
- package/dist/vendor/resources/beta/index.js +19 -0
- package/dist/vendor/resources/beta/index.js.map +1 -0
- package/dist/vendor/resources/beta/memory-stores/index.d.ts +3 -0
- package/dist/vendor/resources/beta/memory-stores/index.js +5 -0
- package/dist/vendor/resources/beta/memory-stores/index.js.map +1 -0
- package/dist/vendor/resources/beta/memory-stores/memories.d.ts +346 -0
- package/dist/vendor/resources/beta/memory-stores/memories.js +126 -0
- package/dist/vendor/resources/beta/memory-stores/memories.js.map +1 -0
- package/dist/vendor/resources/beta/memory-stores/memory-stores.d.ts +230 -0
- package/dist/vendor/resources/beta/memory-stores/memory-stores.js +137 -0
- package/dist/vendor/resources/beta/memory-stores/memory-stores.js.map +1 -0
- package/dist/vendor/resources/beta/memory-stores/memory-versions.d.ts +252 -0
- package/dist/vendor/resources/beta/memory-stores/memory-versions.js +77 -0
- package/dist/vendor/resources/beta/memory-stores/memory-versions.js.map +1 -0
- package/dist/vendor/resources/beta/memory-stores.d.ts +1 -0
- package/dist/vendor/resources/beta/memory-stores.js +3 -0
- package/dist/vendor/resources/beta/memory-stores.js.map +1 -0
- package/dist/vendor/resources/beta/messages/batches.d.ts +685 -0
- package/dist/vendor/resources/beta/messages/batches.js +203 -0
- package/dist/vendor/resources/beta/messages/batches.js.map +1 -0
- package/dist/vendor/resources/beta/messages/index.d.ts +3 -0
- package/dist/vendor/resources/beta/messages/index.js +5 -0
- package/dist/vendor/resources/beta/messages/index.js.map +1 -0
- package/dist/vendor/resources/beta/messages/messages.d.ts +5376 -0
- package/dist/vendor/resources/beta/messages/messages.js +158 -0
- package/dist/vendor/resources/beta/messages/messages.js.map +1 -0
- package/dist/vendor/resources/beta/messages.d.ts +1 -0
- package/dist/vendor/resources/beta/messages.js +3 -0
- package/dist/vendor/resources/beta/messages.js.map +1 -0
- package/dist/vendor/resources/beta/models.d.ts +217 -0
- package/dist/vendor/resources/beta/models.js +56 -0
- package/dist/vendor/resources/beta/models.js.map +1 -0
- package/dist/vendor/resources/beta/organization/api-keys.d.ts +176 -0
- package/dist/vendor/resources/beta/organization/api-keys.js +52 -0
- package/dist/vendor/resources/beta/organization/api-keys.js.map +1 -0
- package/dist/vendor/resources/beta/organization/compliance-settings.d.ts +73 -0
- package/dist/vendor/resources/beta/organization/compliance-settings.js +48 -0
- package/dist/vendor/resources/beta/organization/compliance-settings.js.map +1 -0
- package/dist/vendor/resources/beta/organization/external-keys.d.ts +271 -0
- package/dist/vendor/resources/beta/organization/external-keys.js +115 -0
- package/dist/vendor/resources/beta/organization/external-keys.js.map +1 -0
- package/dist/vendor/resources/beta/organization/federation/federation.d.ts +13 -0
- package/dist/vendor/resources/beta/organization/federation/federation.js +13 -0
- package/dist/vendor/resources/beta/organization/federation/federation.js.map +1 -0
- package/dist/vendor/resources/beta/organization/federation/index.d.ts +3 -0
- package/dist/vendor/resources/beta/organization/federation/index.js +5 -0
- package/dist/vendor/resources/beta/organization/federation/index.js.map +1 -0
- package/dist/vendor/resources/beta/organization/federation/issuers.d.ts +352 -0
- package/dist/vendor/resources/beta/organization/federation/issuers.js +165 -0
- package/dist/vendor/resources/beta/organization/federation/issuers.js.map +1 -0
- package/dist/vendor/resources/beta/organization/federation/rules/index.d.ts +2 -0
- package/dist/vendor/resources/beta/organization/federation/rules/index.js +4 -0
- package/dist/vendor/resources/beta/organization/federation/rules/index.js.map +1 -0
- package/dist/vendor/resources/beta/organization/federation/rules/rules.d.ts +467 -0
- package/dist/vendor/resources/beta/organization/federation/rules/rules.js +190 -0
- package/dist/vendor/resources/beta/organization/federation/rules/rules.js.map +1 -0
- package/dist/vendor/resources/beta/organization/federation/rules/workspaces.d.ts +123 -0
- package/dist/vendor/resources/beta/organization/federation/rules/workspaces.js +110 -0
- package/dist/vendor/resources/beta/organization/federation/rules/workspaces.js.map +1 -0
- package/dist/vendor/resources/beta/organization/federation/rules.d.ts +1 -0
- package/dist/vendor/resources/beta/organization/federation/rules.js +3 -0
- package/dist/vendor/resources/beta/organization/federation/rules.js.map +1 -0
- package/dist/vendor/resources/beta/organization/federation.d.ts +1 -0
- package/dist/vendor/resources/beta/organization/federation.js +3 -0
- package/dist/vendor/resources/beta/organization/federation.js.map +1 -0
- package/dist/vendor/resources/beta/organization/index.d.ts +10 -0
- package/dist/vendor/resources/beta/organization/index.js +12 -0
- package/dist/vendor/resources/beta/organization/index.js.map +1 -0
- package/dist/vendor/resources/beta/organization/invites.d.ts +161 -0
- package/dist/vendor/resources/beta/organization/invites.js +72 -0
- package/dist/vendor/resources/beta/organization/invites.js.map +1 -0
- package/dist/vendor/resources/beta/organization/organization.d.ts +72 -0
- package/dist/vendor/resources/beta/organization/organization.js +54 -0
- package/dist/vendor/resources/beta/organization/organization.js.map +1 -0
- package/dist/vendor/resources/beta/organization/rate-limits.d.ts +76 -0
- package/dist/vendor/resources/beta/organization/rate-limits.js +27 -0
- package/dist/vendor/resources/beta/organization/rate-limits.js.map +1 -0
- package/dist/vendor/resources/beta/organization/service-accounts/index.d.ts +2 -0
- package/dist/vendor/resources/beta/organization/service-accounts/index.js +4 -0
- package/dist/vendor/resources/beta/organization/service-accounts/index.js.map +1 -0
- package/dist/vendor/resources/beta/organization/service-accounts/service-accounts.d.ts +257 -0
- package/dist/vendor/resources/beta/organization/service-accounts/service-accounts.js +166 -0
- package/dist/vendor/resources/beta/organization/service-accounts/service-accounts.js.map +1 -0
- package/dist/vendor/resources/beta/organization/service-accounts/workspaces.d.ts +140 -0
- package/dist/vendor/resources/beta/organization/service-accounts/workspaces.js +121 -0
- package/dist/vendor/resources/beta/organization/service-accounts/workspaces.js.map +1 -0
- package/dist/vendor/resources/beta/organization/service-accounts.d.ts +1 -0
- package/dist/vendor/resources/beta/organization/service-accounts.js +3 -0
- package/dist/vendor/resources/beta/organization/service-accounts.js.map +1 -0
- package/dist/vendor/resources/beta/organization/users.d.ts +123 -0
- package/dist/vendor/resources/beta/organization/users.js +63 -0
- package/dist/vendor/resources/beta/organization/users.js.map +1 -0
- package/dist/vendor/resources/beta/organization/workspaces/index.d.ts +4 -0
- package/dist/vendor/resources/beta/organization/workspaces/index.js +6 -0
- package/dist/vendor/resources/beta/organization/workspaces/index.js.map +1 -0
- package/dist/vendor/resources/beta/organization/workspaces/members.d.ts +134 -0
- package/dist/vendor/resources/beta/organization/workspaces/members.js +98 -0
- package/dist/vendor/resources/beta/organization/workspaces/members.js.map +1 -0
- package/dist/vendor/resources/beta/organization/workspaces/rate-limits.d.ts +82 -0
- package/dist/vendor/resources/beta/organization/workspaces/rate-limits.js +30 -0
- package/dist/vendor/resources/beta/organization/workspaces/rate-limits.js.map +1 -0
- package/dist/vendor/resources/beta/organization/workspaces/service-accounts.d.ts +209 -0
- package/dist/vendor/resources/beta/organization/workspaces/service-accounts.js +185 -0
- package/dist/vendor/resources/beta/organization/workspaces/service-accounts.js.map +1 -0
- package/dist/vendor/resources/beta/organization/workspaces/workspaces.d.ts +302 -0
- package/dist/vendor/resources/beta/organization/workspaces/workspaces.js +104 -0
- package/dist/vendor/resources/beta/organization/workspaces/workspaces.js.map +1 -0
- package/dist/vendor/resources/beta/organization/workspaces.d.ts +1 -0
- package/dist/vendor/resources/beta/organization/workspaces.js +3 -0
- package/dist/vendor/resources/beta/organization/workspaces.js.map +1 -0
- package/dist/vendor/resources/beta/organization.d.ts +1 -0
- package/dist/vendor/resources/beta/organization.js +3 -0
- package/dist/vendor/resources/beta/organization.js.map +1 -0
- package/dist/vendor/resources/beta/sessions/events.d.ts +1513 -0
- package/dist/vendor/resources/beta/sessions/events.js +115 -0
- package/dist/vendor/resources/beta/sessions/events.js.map +1 -0
- package/dist/vendor/resources/beta/sessions/index.d.ts +4 -0
- package/dist/vendor/resources/beta/sessions/index.js +6 -0
- package/dist/vendor/resources/beta/sessions/index.js.map +1 -0
- package/dist/vendor/resources/beta/sessions/resources.d.ts +227 -0
- package/dist/vendor/resources/beta/sessions/resources.js +128 -0
- package/dist/vendor/resources/beta/sessions/resources.js.map +1 -0
- package/dist/vendor/resources/beta/sessions/sessions.d.ts +866 -0
- package/dist/vendor/resources/beta/sessions/sessions.js +150 -0
- package/dist/vendor/resources/beta/sessions/sessions.js.map +1 -0
- package/dist/vendor/resources/beta/sessions/threads/events.d.ts +77 -0
- package/dist/vendor/resources/beta/sessions/threads/events.js +57 -0
- package/dist/vendor/resources/beta/sessions/threads/events.js.map +1 -0
- package/dist/vendor/resources/beta/sessions/threads/index.d.ts +2 -0
- package/dist/vendor/resources/beta/sessions/threads/index.js +4 -0
- package/dist/vendor/resources/beta/sessions/threads/index.js.map +1 -0
- package/dist/vendor/resources/beta/sessions/threads/threads.d.ts +195 -0
- package/dist/vendor/resources/beta/sessions/threads/threads.js +80 -0
- package/dist/vendor/resources/beta/sessions/threads/threads.js.map +1 -0
- package/dist/vendor/resources/beta/sessions/threads.d.ts +1 -0
- package/dist/vendor/resources/beta/sessions/threads.js +3 -0
- package/dist/vendor/resources/beta/sessions/threads.js.map +1 -0
- package/dist/vendor/resources/beta/sessions.d.ts +1 -0
- package/dist/vendor/resources/beta/sessions.js +3 -0
- package/dist/vendor/resources/beta/sessions.js.map +1 -0
- package/dist/vendor/resources/beta/skills/index.d.ts +2 -0
- package/dist/vendor/resources/beta/skills/index.js +4 -0
- package/dist/vendor/resources/beta/skills/index.js.map +1 -0
- package/dist/vendor/resources/beta/skills/skills.d.ts +178 -0
- package/dist/vendor/resources/beta/skills/skills.js +96 -0
- package/dist/vendor/resources/beta/skills/skills.js.map +1 -0
- package/dist/vendor/resources/beta/skills/versions.d.ts +181 -0
- package/dist/vendor/resources/beta/skills/versions.js +125 -0
- package/dist/vendor/resources/beta/skills/versions.js.map +1 -0
- package/dist/vendor/resources/beta/skills.d.ts +1 -0
- package/dist/vendor/resources/beta/skills.js +3 -0
- package/dist/vendor/resources/beta/skills.js.map +1 -0
- package/dist/vendor/resources/beta/tunnels/certificates.d.ts +162 -0
- package/dist/vendor/resources/beta/tunnels/certificates.js +125 -0
- package/dist/vendor/resources/beta/tunnels/certificates.js.map +1 -0
- package/dist/vendor/resources/beta/tunnels/index.d.ts +2 -0
- package/dist/vendor/resources/beta/tunnels/index.js +4 -0
- package/dist/vendor/resources/beta/tunnels/index.js.map +1 -0
- package/dist/vendor/resources/beta/tunnels/tunnels.d.ts +211 -0
- package/dist/vendor/resources/beta/tunnels/tunnels.js +173 -0
- package/dist/vendor/resources/beta/tunnels/tunnels.js.map +1 -0
- package/dist/vendor/resources/beta/tunnels.d.ts +1 -0
- package/dist/vendor/resources/beta/tunnels.js +3 -0
- package/dist/vendor/resources/beta/tunnels.js.map +1 -0
- package/dist/vendor/resources/beta/user-profiles.d.ts +244 -0
- package/dist/vendor/resources/beta/user-profiles.js +114 -0
- package/dist/vendor/resources/beta/user-profiles.js.map +1 -0
- package/dist/vendor/resources/beta/vaults/credentials.d.ts +715 -0
- package/dist/vendor/resources/beta/vaults/credentials.js +173 -0
- package/dist/vendor/resources/beta/vaults/credentials.js.map +1 -0
- package/dist/vendor/resources/beta/vaults/index.d.ts +2 -0
- package/dist/vendor/resources/beta/vaults/index.js +4 -0
- package/dist/vendor/resources/beta/vaults/index.js.map +1 -0
- package/dist/vendor/resources/beta/vaults/vaults.d.ts +191 -0
- package/dist/vendor/resources/beta/vaults/vaults.js +141 -0
- package/dist/vendor/resources/beta/vaults/vaults.js.map +1 -0
- package/dist/vendor/resources/beta/vaults.d.ts +1 -0
- package/dist/vendor/resources/beta/vaults.js +3 -0
- package/dist/vendor/resources/beta/vaults.js.map +1 -0
- package/dist/vendor/resources/beta/webhooks.d.ts +464 -0
- package/dist/vendor/resources/beta/webhooks.js +29 -0
- package/dist/vendor/resources/beta/webhooks.js.map +1 -0
- package/dist/vendor/resources/beta.d.ts +1 -0
- package/dist/vendor/resources/beta.js +3 -0
- package/dist/vendor/resources/beta.js.map +1 -0
- package/dist/vendor/resources/completions.d.ts +172 -0
- package/dist/vendor/resources/completions.js +19 -0
- package/dist/vendor/resources/completions.js.map +1 -0
- package/dist/vendor/resources/files.d.ts +104 -0
- package/dist/vendor/resources/files.js +48 -0
- package/dist/vendor/resources/files.js.map +1 -0
- package/dist/vendor/resources/index.d.ts +7 -0
- package/dist/vendor/resources/index.js +9 -0
- package/dist/vendor/resources/index.js.map +1 -0
- package/dist/vendor/resources/messages/batches.d.ts +312 -0
- package/dist/vendor/resources/messages/batches.js +157 -0
- package/dist/vendor/resources/messages/batches.js.map +1 -0
- package/dist/vendor/resources/messages/index.d.ts +2 -0
- package/dist/vendor/resources/messages/index.js +4 -0
- package/dist/vendor/resources/messages/index.js.map +1 -0
- package/dist/vendor/resources/messages/messages.d.ts +3886 -0
- package/dist/vendor/resources/messages/messages.js +130 -0
- package/dist/vendor/resources/messages/messages.js.map +1 -0
- package/dist/vendor/resources/messages.d.ts +1 -0
- package/dist/vendor/resources/messages.js +3 -0
- package/dist/vendor/resources/messages.js.map +1 -0
- package/dist/vendor/resources/models.d.ts +196 -0
- package/dist/vendor/resources/models.js +41 -0
- package/dist/vendor/resources/models.js.map +1 -0
- package/dist/vendor/resources/shared.d.ts +43 -0
- package/dist/vendor/resources/shared.js +3 -0
- package/dist/vendor/resources/shared.js.map +1 -0
- package/dist/vendor/resources/skills/index.d.ts +2 -0
- package/dist/vendor/resources/skills/index.js +4 -0
- package/dist/vendor/resources/skills/index.js.map +1 -0
- package/dist/vendor/resources/skills/skills.d.ts +128 -0
- package/dist/vendor/resources/skills/skills.js +36 -0
- package/dist/vendor/resources/skills/skills.js.map +1 -0
- package/dist/vendor/resources/skills/versions.d.ts +103 -0
- package/dist/vendor/resources/skills/versions.js +37 -0
- package/dist/vendor/resources/skills/versions.js.map +1 -0
- package/dist/vendor/resources/skills.d.ts +1 -0
- package/dist/vendor/resources/skills.js +3 -0
- package/dist/vendor/resources/skills.js.map +1 -0
- package/dist/vendor/resources/top-level.d.ts +1 -0
- package/dist/vendor/resources/top-level.js +3 -0
- package/dist/vendor/resources/top-level.js.map +1 -0
- package/dist/vendor/resources.d.ts +1 -0
- package/dist/vendor/resources.js +2 -0
- package/dist/vendor/resources.js.map +1 -0
- package/dist/vendor/streaming.d.ts +2 -0
- package/dist/vendor/streaming.js +3 -0
- package/dist/vendor/streaming.js.map +1 -0
- package/dist/vendor/tools/agent-toolset/fs-util.d.ts +74 -0
- package/dist/vendor/tools/agent-toolset/fs-util.js +184 -0
- package/dist/vendor/tools/agent-toolset/fs-util.js.map +1 -0
- package/dist/vendor/tools/agent-toolset/memories.d.ts +172 -0
- package/dist/vendor/tools/agent-toolset/memories.js +910 -0
- package/dist/vendor/tools/agent-toolset/memories.js.map +1 -0
- package/dist/vendor/tools/agent-toolset/node.browser.d.ts +80 -0
- package/dist/vendor/tools/agent-toolset/node.browser.js +129 -0
- package/dist/vendor/tools/agent-toolset/node.browser.js.map +1 -0
- package/dist/vendor/tools/agent-toolset/node.d.ts +191 -0
- package/dist/vendor/tools/agent-toolset/node.js +886 -0
- package/dist/vendor/tools/agent-toolset/node.js.map +1 -0
- package/dist/vendor/tools/agent-toolset/skills.d.ts +73 -0
- package/dist/vendor/tools/agent-toolset/skills.js +320 -0
- package/dist/vendor/tools/agent-toolset/skills.js.map +1 -0
- package/dist/vendor/tools/agent-toolset/sync-interval.d.ts +18 -0
- package/dist/vendor/tools/agent-toolset/sync-interval.js +25 -0
- package/dist/vendor/tools/agent-toolset/sync-interval.js.map +1 -0
- package/dist/vendor/tools/memory/node.browser.d.ts +26 -0
- package/dist/vendor/tools/memory/node.browser.js +44 -0
- package/dist/vendor/tools/memory/node.browser.js.map +1 -0
- package/dist/vendor/tools/memory/node.d.ts +17 -0
- package/dist/vendor/tools/memory/node.js +327 -0
- package/dist/vendor/tools/memory/node.js.map +1 -0
- package/dist/vendor/uploads.d.ts +2 -0
- package/dist/vendor/uploads.js +3 -0
- package/dist/vendor/uploads.js.map +1 -0
- package/dist/vendor/version.d.ts +1 -0
- package/dist/vendor/version.js +2 -0
- package/dist/vendor/version.js.map +1 -0
- package/package.json +7 -14
- package/sdk.cjs +2 -2
- package/sdk.cjs.map +2 -2
- package/sdk.d.ts +1 -1
- package/sdk.mjs +2 -2
- package/sdk.mjs.map +3 -3
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { PukuError } from '../../../error.js';
|
|
3
|
+
import * as BatchesAPI from './batches.js';
|
|
4
|
+
import { APIResource } from '../../../core/resource.js';
|
|
5
|
+
import { MODEL_NONSTREAMING_TOKENS } from '../../../internal/constants.js';
|
|
6
|
+
import { buildHeaders } from '../../../internal/headers.js';
|
|
7
|
+
import { stainlessHelperHeader } from '../../../internal/stainless-helper-header.js';
|
|
8
|
+
import { parseBetaMessage, } from '../../../lib/beta-parser.js';
|
|
9
|
+
import { BetaMessageStream } from '../../../lib/BetaMessageStream.js';
|
|
10
|
+
import { BetaToolRunner, } from '../../../lib/tools/BetaToolRunner.js';
|
|
11
|
+
import { ToolError } from '../../../lib/tools/ToolError.js';
|
|
12
|
+
import { Batches, } from './batches.js';
|
|
13
|
+
const DEPRECATED_MODELS = {
|
|
14
|
+
'puku-1.3': 'November 6th, 2024',
|
|
15
|
+
'puku-1.3-100k': 'November 6th, 2024',
|
|
16
|
+
'puku-instant-1.1': 'November 6th, 2024',
|
|
17
|
+
'puku-instant-1.1-100k': 'November 6th, 2024',
|
|
18
|
+
'puku-instant-1.2': 'November 6th, 2024',
|
|
19
|
+
'puku-3-sonnet-20240229': 'July 21st, 2025',
|
|
20
|
+
'puku-3-opus-20240229': 'January 5th, 2026',
|
|
21
|
+
'puku-2.1': 'July 21st, 2025',
|
|
22
|
+
'puku-2.0': 'July 21st, 2025',
|
|
23
|
+
'puku-3-7-sonnet-latest': 'February 19th, 2026',
|
|
24
|
+
};
|
|
25
|
+
const MODELS_TO_WARN_WITH_THINKING_ENABLED = [];
|
|
26
|
+
export class Messages extends APIResource {
|
|
27
|
+
batches = new BatchesAPI.Batches(this._client);
|
|
28
|
+
create(params, options) {
|
|
29
|
+
// Transform deprecated output_format to output_config.format
|
|
30
|
+
const modifiedParams = transformOutputFormat(params);
|
|
31
|
+
const { betas, user_profile_id, ...body } = modifiedParams;
|
|
32
|
+
if (body.model in DEPRECATED_MODELS) {
|
|
33
|
+
console.warn(`The Puku SDK model '${body.model}' is deprecated and will reach end-of-life on ${DEPRECATED_MODELS[body.model]}\nPlease migrate to a newer model. Visit https://puku.ai/docs/resources/model-deprecations for more information.`);
|
|
34
|
+
}
|
|
35
|
+
if (MODELS_TO_WARN_WITH_THINKING_ENABLED.includes(body.model) &&
|
|
36
|
+
body.thinking &&
|
|
37
|
+
body.thinking.type === 'enabled') {
|
|
38
|
+
console.warn(`Using Puku with ${body.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://puku.ai/docs/en/build-with-puku/adaptive-thinking`);
|
|
39
|
+
}
|
|
40
|
+
let timeout = options?.timeout ?? this._client._options.timeout;
|
|
41
|
+
if (!body.stream && timeout == null) {
|
|
42
|
+
const maxNonstreamingTokens = MODEL_NONSTREAMING_TOKENS[body.model] ?? undefined;
|
|
43
|
+
timeout = this._client.calculateNonstreamingTimeout(body.max_tokens, maxNonstreamingTokens);
|
|
44
|
+
}
|
|
45
|
+
// Collect helper info from tools and messages
|
|
46
|
+
const helperHeader = stainlessHelperHeader(body.tools, body.messages);
|
|
47
|
+
return this._client.post('/v1/messages?beta=true', {
|
|
48
|
+
body,
|
|
49
|
+
timeout: timeout ?? 600000,
|
|
50
|
+
...options,
|
|
51
|
+
headers: buildHeaders([
|
|
52
|
+
{
|
|
53
|
+
...(betas?.toString() != null ? { 'puku-beta': betas?.toString() } : undefined),
|
|
54
|
+
...(user_profile_id != null ? { 'puku-user-profile-id': user_profile_id } : undefined),
|
|
55
|
+
},
|
|
56
|
+
helperHeader,
|
|
57
|
+
options?.headers,
|
|
58
|
+
]),
|
|
59
|
+
stream: modifiedParams.stream ?? false,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Send a structured list of input messages with text and/or image content, along with an expected `output_format` and
|
|
64
|
+
* the response will be automatically parsed and available in the `parsed_output` property of the message.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* const message = await client.beta.messages.parse({
|
|
69
|
+
* model: 'puku-3-5-sonnet-20241022',
|
|
70
|
+
* max_tokens: 1024,
|
|
71
|
+
* messages: [{ role: 'user', content: 'What is 2+2?' }],
|
|
72
|
+
* output_format: zodOutputFormat(z.object({ answer: z.number() }), 'math'),
|
|
73
|
+
* });
|
|
74
|
+
*
|
|
75
|
+
* console.log(message.parsed_output?.answer); // 4
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
parse(params, options) {
|
|
79
|
+
options = {
|
|
80
|
+
...options,
|
|
81
|
+
headers: buildHeaders([
|
|
82
|
+
{ 'puku-beta': [...(params.betas ?? []), 'structured-outputs-2025-12-15'].toString() },
|
|
83
|
+
options?.headers,
|
|
84
|
+
]),
|
|
85
|
+
};
|
|
86
|
+
return this.create(params, options).then((message) => parseBetaMessage(message, params, { logger: this._client.logger ?? console }));
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Create a Message stream
|
|
90
|
+
*/
|
|
91
|
+
stream(body, options) {
|
|
92
|
+
return BetaMessageStream.createMessage(this, body, options);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Count the number of tokens in a Message.
|
|
96
|
+
*
|
|
97
|
+
* The Token Count API can be used to count the number of tokens in a Message,
|
|
98
|
+
* including tools, images, and documents, without creating it.
|
|
99
|
+
*
|
|
100
|
+
* Learn more about token counting in our
|
|
101
|
+
* [user guide](https://platform.puku.com/docs/en/build-with-puku/token-counting)
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```ts
|
|
105
|
+
* const betaMessageTokensCount =
|
|
106
|
+
* await client.beta.messages.countTokens({
|
|
107
|
+
* messages: [{ content: 'Hello, world', role: 'user' }],
|
|
108
|
+
* model: 'puku-ai-2.8,
|
|
109
|
+
* });
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
countTokens(params, options) {
|
|
113
|
+
// Transform deprecated output_format to output_config.format
|
|
114
|
+
const modifiedParams = transformOutputFormat(params);
|
|
115
|
+
const { betas, user_profile_id, ...body } = modifiedParams;
|
|
116
|
+
return this._client.post('/v1/messages/count_tokens?beta=true', {
|
|
117
|
+
body,
|
|
118
|
+
...options,
|
|
119
|
+
headers: buildHeaders([
|
|
120
|
+
{
|
|
121
|
+
'puku-beta': [...(betas ?? []), 'token-counting-2024-11-01'].toString(),
|
|
122
|
+
...(user_profile_id != null ? { 'puku-user-profile-id': user_profile_id } : undefined),
|
|
123
|
+
},
|
|
124
|
+
options?.headers,
|
|
125
|
+
]),
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
toolRunner(body, options) {
|
|
129
|
+
return new BetaToolRunner(this._client, body, options);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Transform deprecated output_format to output_config.format
|
|
134
|
+
* Returns a modified copy of the params without mutating the original
|
|
135
|
+
*/
|
|
136
|
+
function transformOutputFormat(params) {
|
|
137
|
+
if (!params.output_format) {
|
|
138
|
+
return params;
|
|
139
|
+
}
|
|
140
|
+
if (params.output_config?.format) {
|
|
141
|
+
throw new PukuError('Both output_format and output_config.format were provided. ' +
|
|
142
|
+
'Please use only output_config.format (output_format is deprecated).');
|
|
143
|
+
}
|
|
144
|
+
const { output_format, ...rest } = params;
|
|
145
|
+
return {
|
|
146
|
+
...rest,
|
|
147
|
+
output_config: {
|
|
148
|
+
...params.output_config,
|
|
149
|
+
format: output_format,
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
export { BetaToolRunner } from '../../../lib/tools/BetaToolRunner.js';
|
|
154
|
+
export { ToolError } from '../../../lib/tools/ToolError.js';
|
|
155
|
+
Messages.Batches = Batches;
|
|
156
|
+
Messages.BetaToolRunner = BetaToolRunner;
|
|
157
|
+
Messages.ToolError = ToolError;
|
|
158
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../../src/vendor/resources/beta/messages/messages.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './messages/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../src/vendor/resources/beta/messages.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { APIResource } from '../../core/resource';
|
|
2
|
+
import * as BetaAPI from './beta';
|
|
3
|
+
import { APIPromise } from '../../core/api-promise';
|
|
4
|
+
import { Page, type PageParams, PagePromise } from '../../core/pagination';
|
|
5
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
6
|
+
export declare class Models extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Get a specific model.
|
|
9
|
+
*
|
|
10
|
+
* The Models API response can be used to determine information about a specific
|
|
11
|
+
* model or resolve a model alias to a model ID.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const betaModelInfo = await client.beta.models.retrieve(
|
|
16
|
+
* 'model_id',
|
|
17
|
+
* );
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
retrieve(modelID: string, params?: ModelRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<BetaModelInfo>;
|
|
21
|
+
/**
|
|
22
|
+
* List available models.
|
|
23
|
+
*
|
|
24
|
+
* The Models API response can be used to determine which models are available for
|
|
25
|
+
* use in the API. More recently released models are listed first.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* // Automatically fetches more pages as needed.
|
|
30
|
+
* for await (const betaModelInfo of client.beta.models.list()) {
|
|
31
|
+
* // ...
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
list(params?: ModelListParams | null | undefined, options?: RequestOptions): PagePromise<BetaModelInfosPage, BetaModelInfo>;
|
|
36
|
+
}
|
|
37
|
+
export type BetaModelInfosPage = Page<BetaModelInfo>;
|
|
38
|
+
/**
|
|
39
|
+
* Indicates whether a capability is supported.
|
|
40
|
+
*/
|
|
41
|
+
export interface BetaCapabilitySupport {
|
|
42
|
+
/**
|
|
43
|
+
* Whether this capability is supported by the model.
|
|
44
|
+
*/
|
|
45
|
+
supported: boolean;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Context management capability details.
|
|
49
|
+
*/
|
|
50
|
+
export interface BetaContextManagementCapability {
|
|
51
|
+
/**
|
|
52
|
+
* Indicates whether a capability is supported.
|
|
53
|
+
*/
|
|
54
|
+
clear_thinking_20251015: BetaCapabilitySupport | null;
|
|
55
|
+
/**
|
|
56
|
+
* Indicates whether a capability is supported.
|
|
57
|
+
*/
|
|
58
|
+
clear_tool_uses_20250919: BetaCapabilitySupport | null;
|
|
59
|
+
/**
|
|
60
|
+
* Indicates whether a capability is supported.
|
|
61
|
+
*/
|
|
62
|
+
compact_20260112: BetaCapabilitySupport | null;
|
|
63
|
+
/**
|
|
64
|
+
* Whether this capability is supported by the model.
|
|
65
|
+
*/
|
|
66
|
+
supported: boolean;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Effort (reasoning_effort) capability details.
|
|
70
|
+
*/
|
|
71
|
+
export interface BetaEffortCapability {
|
|
72
|
+
/**
|
|
73
|
+
* Whether the model supports high effort level.
|
|
74
|
+
*/
|
|
75
|
+
high: BetaCapabilitySupport;
|
|
76
|
+
/**
|
|
77
|
+
* Whether the model supports low effort level.
|
|
78
|
+
*/
|
|
79
|
+
low: BetaCapabilitySupport;
|
|
80
|
+
/**
|
|
81
|
+
* Whether the model supports max effort level.
|
|
82
|
+
*/
|
|
83
|
+
max: BetaCapabilitySupport;
|
|
84
|
+
/**
|
|
85
|
+
* Whether the model supports medium effort level.
|
|
86
|
+
*/
|
|
87
|
+
medium: BetaCapabilitySupport;
|
|
88
|
+
/**
|
|
89
|
+
* Whether this capability is supported by the model.
|
|
90
|
+
*/
|
|
91
|
+
supported: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Indicates whether a capability is supported.
|
|
94
|
+
*/
|
|
95
|
+
xhigh: BetaCapabilitySupport | null;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Model capability information.
|
|
99
|
+
*/
|
|
100
|
+
export interface BetaModelCapabilities {
|
|
101
|
+
/**
|
|
102
|
+
* Whether the model supports the Batch API.
|
|
103
|
+
*/
|
|
104
|
+
batch: BetaCapabilitySupport;
|
|
105
|
+
/**
|
|
106
|
+
* Whether the model supports citation generation.
|
|
107
|
+
*/
|
|
108
|
+
citations: BetaCapabilitySupport;
|
|
109
|
+
/**
|
|
110
|
+
* Whether the model supports code execution tools.
|
|
111
|
+
*/
|
|
112
|
+
code_execution: BetaCapabilitySupport;
|
|
113
|
+
/**
|
|
114
|
+
* Context management support and available strategies.
|
|
115
|
+
*/
|
|
116
|
+
context_management: BetaContextManagementCapability;
|
|
117
|
+
/**
|
|
118
|
+
* Effort (reasoning_effort) support and available levels.
|
|
119
|
+
*/
|
|
120
|
+
effort: BetaEffortCapability;
|
|
121
|
+
/**
|
|
122
|
+
* Whether the model accepts image content blocks.
|
|
123
|
+
*/
|
|
124
|
+
image_input: BetaCapabilitySupport;
|
|
125
|
+
/**
|
|
126
|
+
* Whether the model accepts PDF content blocks.
|
|
127
|
+
*/
|
|
128
|
+
pdf_input: BetaCapabilitySupport;
|
|
129
|
+
/**
|
|
130
|
+
* Whether the model supports structured output / JSON mode / strict tool schemas.
|
|
131
|
+
*/
|
|
132
|
+
structured_outputs: BetaCapabilitySupport;
|
|
133
|
+
/**
|
|
134
|
+
* Thinking capability and supported type configurations.
|
|
135
|
+
*/
|
|
136
|
+
thinking: BetaThinkingCapability;
|
|
137
|
+
}
|
|
138
|
+
export interface BetaModelInfo {
|
|
139
|
+
/**
|
|
140
|
+
* Unique model identifier.
|
|
141
|
+
*/
|
|
142
|
+
id: string;
|
|
143
|
+
/**
|
|
144
|
+
* Model IDs this model accepts as `fallbacks[i].model` on the Messages API. An
|
|
145
|
+
* empty list means the `fallbacks` parameter is not supported for this model as
|
|
146
|
+
* primary.
|
|
147
|
+
*/
|
|
148
|
+
allowed_fallback_models: Array<string> | null;
|
|
149
|
+
/**
|
|
150
|
+
* Model capability information.
|
|
151
|
+
*/
|
|
152
|
+
capabilities: BetaModelCapabilities | null;
|
|
153
|
+
/**
|
|
154
|
+
* RFC 3339 datetime string representing the time at which the model was released.
|
|
155
|
+
* May be set to an epoch value if the release date is unknown.
|
|
156
|
+
*/
|
|
157
|
+
created_at: string;
|
|
158
|
+
/**
|
|
159
|
+
* A human-readable name for the model.
|
|
160
|
+
*/
|
|
161
|
+
display_name: string;
|
|
162
|
+
/**
|
|
163
|
+
* Maximum input context window size in tokens for this model.
|
|
164
|
+
*/
|
|
165
|
+
max_input_tokens: number | null;
|
|
166
|
+
/**
|
|
167
|
+
* Maximum value for the `max_tokens` parameter when using this model.
|
|
168
|
+
*/
|
|
169
|
+
max_tokens: number | null;
|
|
170
|
+
/**
|
|
171
|
+
* Object type.
|
|
172
|
+
*
|
|
173
|
+
* For Models, this is always `"model"`.
|
|
174
|
+
*/
|
|
175
|
+
type: 'model';
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Thinking capability details.
|
|
179
|
+
*/
|
|
180
|
+
export interface BetaThinkingCapability {
|
|
181
|
+
/**
|
|
182
|
+
* Whether this capability is supported by the model.
|
|
183
|
+
*/
|
|
184
|
+
supported: boolean;
|
|
185
|
+
/**
|
|
186
|
+
* Supported thinking type configurations.
|
|
187
|
+
*/
|
|
188
|
+
types: BetaThinkingTypes;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Supported thinking type configurations.
|
|
192
|
+
*/
|
|
193
|
+
export interface BetaThinkingTypes {
|
|
194
|
+
/**
|
|
195
|
+
* Whether the model supports thinking with type 'adaptive' (auto).
|
|
196
|
+
*/
|
|
197
|
+
adaptive: BetaCapabilitySupport;
|
|
198
|
+
/**
|
|
199
|
+
* Whether the model supports thinking with type 'enabled'.
|
|
200
|
+
*/
|
|
201
|
+
enabled: BetaCapabilitySupport;
|
|
202
|
+
}
|
|
203
|
+
export interface ModelRetrieveParams {
|
|
204
|
+
/**
|
|
205
|
+
* Optional header to specify the beta version(s) you want to use.
|
|
206
|
+
*/
|
|
207
|
+
betas?: Array<BetaAPI.PukuBeta>;
|
|
208
|
+
}
|
|
209
|
+
export interface ModelListParams extends PageParams {
|
|
210
|
+
/**
|
|
211
|
+
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
212
|
+
*/
|
|
213
|
+
betas?: Array<BetaAPI.PukuBeta>;
|
|
214
|
+
}
|
|
215
|
+
export declare namespace Models {
|
|
216
|
+
export { type BetaCapabilitySupport as BetaCapabilitySupport, type BetaContextManagementCapability as BetaContextManagementCapability, type BetaEffortCapability as BetaEffortCapability, type BetaModelCapabilities as BetaModelCapabilities, type BetaModelInfo as BetaModelInfo, type BetaThinkingCapability as BetaThinkingCapability, type BetaThinkingTypes as BetaThinkingTypes, type BetaModelInfosPage as BetaModelInfosPage, type ModelRetrieveParams as ModelRetrieveParams, type ModelListParams as ModelListParams, };
|
|
217
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from '../../core/resource.js';
|
|
3
|
+
import { Page } from '../../core/pagination.js';
|
|
4
|
+
import { buildHeaders } from '../../internal/headers.js';
|
|
5
|
+
import { path } from '../../internal/utils/path.js';
|
|
6
|
+
export class Models extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Get a specific model.
|
|
9
|
+
*
|
|
10
|
+
* The Models API response can be used to determine information about a specific
|
|
11
|
+
* model or resolve a model alias to a model ID.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const betaModelInfo = await client.beta.models.retrieve(
|
|
16
|
+
* 'model_id',
|
|
17
|
+
* );
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
retrieve(modelID, params = {}, options) {
|
|
21
|
+
const { betas } = params ?? {};
|
|
22
|
+
return this._client.get(path `/v1/models/${modelID}?beta=true`, {
|
|
23
|
+
...options,
|
|
24
|
+
headers: buildHeaders([
|
|
25
|
+
{ ...(betas?.toString() != null ? { 'puku-beta': betas?.toString() } : undefined) },
|
|
26
|
+
options?.headers,
|
|
27
|
+
]),
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* List available models.
|
|
32
|
+
*
|
|
33
|
+
* The Models API response can be used to determine which models are available for
|
|
34
|
+
* use in the API. More recently released models are listed first.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* // Automatically fetches more pages as needed.
|
|
39
|
+
* for await (const betaModelInfo of client.beta.models.list()) {
|
|
40
|
+
* // ...
|
|
41
|
+
* }
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
list(params = {}, options) {
|
|
45
|
+
const { betas, ...query } = params ?? {};
|
|
46
|
+
return this._client.getAPIList('/v1/models?beta=true', (Page), {
|
|
47
|
+
query,
|
|
48
|
+
...options,
|
|
49
|
+
headers: buildHeaders([
|
|
50
|
+
{ ...(betas?.toString() != null ? { 'puku-beta': betas?.toString() } : undefined) },
|
|
51
|
+
options?.headers,
|
|
52
|
+
]),
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=models.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../../../src/vendor/resources/beta/models.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD,OAAO,EAAE,IAAI,EAAgC,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAEjD,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;;;OAYG;IACH,QAAQ,CACN,OAAe,EACf,SAAiD,EAAE,EACnD,OAAwB;QAExB,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,cAAc,OAAO,YAAY,EAAE;YAC7D,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;gBACpB,EAAE,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE;gBACnF,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,IAAI,CACF,SAA6C,EAAE,EAC/C,OAAwB;QAExB,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,sBAAsB,EAAE,CAAA,IAAmB,CAAA,EAAE;YAC1E,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;gBACpB,EAAE,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE;gBACnF,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { APIResource } from '../../../core/resource';
|
|
2
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
3
|
+
import { Page, type PageParams, PagePromise } from '../../../core/pagination';
|
|
4
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
5
|
+
export declare class APIKeys extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Get API Key
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const betaAPIKey =
|
|
12
|
+
* await client.beta.organization.apiKeys.retrieve(
|
|
13
|
+
* 'api_key_id',
|
|
14
|
+
* );
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
retrieve(apiKeyID: string, options?: RequestOptions): APIPromise<BetaAPIKey>;
|
|
18
|
+
/**
|
|
19
|
+
* Update API Key
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* const betaAPIKey =
|
|
24
|
+
* await client.beta.organization.apiKeys.update(
|
|
25
|
+
* 'api_key_id',
|
|
26
|
+
* );
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
update(apiKeyID: string, body: APIKeyUpdateParams, options?: RequestOptions): APIPromise<BetaAPIKey>;
|
|
30
|
+
/**
|
|
31
|
+
* List API Keys
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* // Automatically fetches more pages as needed.
|
|
36
|
+
* for await (const betaAPIKey of client.beta.organization.apiKeys.list()) {
|
|
37
|
+
* // ...
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
list(query?: APIKeyListParams | null | undefined, options?: RequestOptions): PagePromise<BetaAPIKeysPage, BetaAPIKey>;
|
|
42
|
+
}
|
|
43
|
+
export type BetaAPIKeysPage = Page<BetaAPIKey>;
|
|
44
|
+
export interface BetaAPIKey {
|
|
45
|
+
/**
|
|
46
|
+
* ID of the API key.
|
|
47
|
+
*/
|
|
48
|
+
id: string;
|
|
49
|
+
/**
|
|
50
|
+
* RFC 3339 datetime string indicating when the API Key was created.
|
|
51
|
+
*/
|
|
52
|
+
created_at: string;
|
|
53
|
+
/**
|
|
54
|
+
* The ID and type of the actor that created the API key, or `null` when the
|
|
55
|
+
* creator is not recorded (legacy, workload-identity-federated, or system-created
|
|
56
|
+
* keys).
|
|
57
|
+
*/
|
|
58
|
+
created_by: BetaAPIKeyCreatedBy | null;
|
|
59
|
+
/**
|
|
60
|
+
* RFC 3339 datetime string indicating when the API Key expires, or `null` if it
|
|
61
|
+
* never expires.
|
|
62
|
+
*/
|
|
63
|
+
expires_at: string | null;
|
|
64
|
+
/**
|
|
65
|
+
* Name of the API key.
|
|
66
|
+
*/
|
|
67
|
+
name: string;
|
|
68
|
+
/**
|
|
69
|
+
* Partially redacted hint for the API key.
|
|
70
|
+
*/
|
|
71
|
+
partial_key_hint: string | null;
|
|
72
|
+
/**
|
|
73
|
+
* The principal the API key acts as (a User or a Service Account), or `null` if
|
|
74
|
+
* the API key is not bound to a principal.
|
|
75
|
+
*/
|
|
76
|
+
principal: BetaAPIKeyUserActor | BetaAPIKeyServiceAccountActor | null;
|
|
77
|
+
/**
|
|
78
|
+
* Where the API key belongs: its Workspace
|
|
79
|
+
* (`{"type": "workspace", "workspace_id": "wrkspc_..."}`, with the Workspace's
|
|
80
|
+
* real ID even when it is the organization's default Workspace), or the
|
|
81
|
+
* organization (`{"type": "organization"}`) for a principal-bound API key that has
|
|
82
|
+
* no Workspace.
|
|
83
|
+
*/
|
|
84
|
+
scope: BetaAPIKeyOrganizationScope | BetaAPIKeyWorkspaceScope;
|
|
85
|
+
/**
|
|
86
|
+
* Status of the API key.
|
|
87
|
+
*/
|
|
88
|
+
status: 'active' | 'archived' | 'expired' | 'inactive';
|
|
89
|
+
/**
|
|
90
|
+
* Object type.
|
|
91
|
+
*
|
|
92
|
+
* For API Keys, this is always `"api_key"`.
|
|
93
|
+
*/
|
|
94
|
+
type: 'api_key';
|
|
95
|
+
/**
|
|
96
|
+
* @deprecated Use `scope` instead. `workspace_id` is `null` both for an API key in
|
|
97
|
+
* the default Workspace and for a principal-bound API key that has no Workspace.
|
|
98
|
+
*/
|
|
99
|
+
workspace_id: string | null;
|
|
100
|
+
}
|
|
101
|
+
export interface BetaAPIKeyCreatedBy {
|
|
102
|
+
/**
|
|
103
|
+
* ID of the actor that created the object.
|
|
104
|
+
*/
|
|
105
|
+
id: string;
|
|
106
|
+
/**
|
|
107
|
+
* Type of the actor that created the object.
|
|
108
|
+
*/
|
|
109
|
+
type: 'service_account' | 'user';
|
|
110
|
+
}
|
|
111
|
+
export interface BetaAPIKeyOrganizationScope {
|
|
112
|
+
/**
|
|
113
|
+
* Scope type. Always `"organization"`: the API key has no Workspace. Only a
|
|
114
|
+
* principal-bound API key can have this scope.
|
|
115
|
+
*/
|
|
116
|
+
type: 'organization';
|
|
117
|
+
}
|
|
118
|
+
export interface BetaAPIKeyServiceAccountActor {
|
|
119
|
+
/**
|
|
120
|
+
* ID of the Service Account the API key acts as.
|
|
121
|
+
*/
|
|
122
|
+
service_account_id: string;
|
|
123
|
+
/**
|
|
124
|
+
* Principal type. Always `"service_account_actor"` for a Service Account.
|
|
125
|
+
*/
|
|
126
|
+
type: 'service_account_actor';
|
|
127
|
+
}
|
|
128
|
+
export interface BetaAPIKeyUserActor {
|
|
129
|
+
/**
|
|
130
|
+
* Principal type. Always `"user_actor"` for a User.
|
|
131
|
+
*/
|
|
132
|
+
type: 'user_actor';
|
|
133
|
+
/**
|
|
134
|
+
* ID of the User the API key acts as.
|
|
135
|
+
*/
|
|
136
|
+
user_id: string;
|
|
137
|
+
}
|
|
138
|
+
export interface BetaAPIKeyWorkspaceScope {
|
|
139
|
+
/**
|
|
140
|
+
* Scope type. Always `"workspace"`: the API key belongs to one Workspace.
|
|
141
|
+
*/
|
|
142
|
+
type: 'workspace';
|
|
143
|
+
/**
|
|
144
|
+
* ID of the Workspace the API key belongs to. Unlike the deprecated top-level
|
|
145
|
+
* `workspace_id`, this is the Workspace's real ID even for the organization's
|
|
146
|
+
* default Workspace.
|
|
147
|
+
*/
|
|
148
|
+
workspace_id: string;
|
|
149
|
+
}
|
|
150
|
+
export interface APIKeyUpdateParams {
|
|
151
|
+
/**
|
|
152
|
+
* Name of the API key.
|
|
153
|
+
*/
|
|
154
|
+
name?: string | null;
|
|
155
|
+
/**
|
|
156
|
+
* Status of the API key.
|
|
157
|
+
*/
|
|
158
|
+
status?: 'active' | 'archived' | 'inactive' | null;
|
|
159
|
+
}
|
|
160
|
+
export interface APIKeyListParams extends PageParams {
|
|
161
|
+
/**
|
|
162
|
+
* Filter by the ID of the User who created the object.
|
|
163
|
+
*/
|
|
164
|
+
created_by_user_id?: string | null;
|
|
165
|
+
/**
|
|
166
|
+
* Filter by API key status.
|
|
167
|
+
*/
|
|
168
|
+
status?: 'active' | 'archived' | 'expired' | 'inactive' | null;
|
|
169
|
+
/**
|
|
170
|
+
* Filter by Workspace ID.
|
|
171
|
+
*/
|
|
172
|
+
workspace_id?: string | null;
|
|
173
|
+
}
|
|
174
|
+
export declare namespace APIKeys {
|
|
175
|
+
export { type BetaAPIKey as BetaAPIKey, type BetaAPIKeyCreatedBy as BetaAPIKeyCreatedBy, type BetaAPIKeyOrganizationScope as BetaAPIKeyOrganizationScope, type BetaAPIKeyServiceAccountActor as BetaAPIKeyServiceAccountActor, type BetaAPIKeyUserActor as BetaAPIKeyUserActor, type BetaAPIKeyWorkspaceScope as BetaAPIKeyWorkspaceScope, type BetaAPIKeysPage as BetaAPIKeysPage, type APIKeyUpdateParams as APIKeyUpdateParams, type APIKeyListParams as APIKeyListParams, };
|
|
176
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from '../../../core/resource.js';
|
|
3
|
+
import { Page } from '../../../core/pagination.js';
|
|
4
|
+
import { path } from '../../../internal/utils/path.js';
|
|
5
|
+
export class APIKeys extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Get API Key
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const betaAPIKey =
|
|
12
|
+
* await client.beta.organization.apiKeys.retrieve(
|
|
13
|
+
* 'api_key_id',
|
|
14
|
+
* );
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
retrieve(apiKeyID, options) {
|
|
18
|
+
return this._client.get(path `/v1/organizations/api_keys/${apiKeyID}?beta=true`, options);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Update API Key
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const betaAPIKey =
|
|
26
|
+
* await client.beta.organization.apiKeys.update(
|
|
27
|
+
* 'api_key_id',
|
|
28
|
+
* );
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
update(apiKeyID, body, options) {
|
|
32
|
+
return this._client.post(path `/v1/organizations/api_keys/${apiKeyID}?beta=true`, { body, ...options });
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* List API Keys
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* // Automatically fetches more pages as needed.
|
|
40
|
+
* for await (const betaAPIKey of client.beta.organization.apiKeys.list()) {
|
|
41
|
+
* // ...
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
list(query = {}, options) {
|
|
46
|
+
return this._client.getAPIList('/v1/organizations/api_keys?beta=true', (Page), {
|
|
47
|
+
query,
|
|
48
|
+
...options,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=api-keys.js.map
|