botshield-sdk 1.9.0 → 2.0.1
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/FUNCTIONS.md +87 -0
- package/README.md +482 -295
- package/RUNTIMES.md +48 -0
- package/bin/mcp-server.js +52952 -0
- package/bin/mcp-server.js.map +379 -0
- package/dist/commonjs/core.d.ts +10 -0
- package/dist/commonjs/core.d.ts.map +1 -0
- package/dist/commonjs/core.js +17 -0
- package/dist/commonjs/core.js.map +1 -0
- package/dist/commonjs/funcs/actions-cancel-action.d.ts +18 -0
- package/dist/commonjs/funcs/actions-cancel-action.d.ts.map +1 -0
- package/dist/commonjs/funcs/actions-cancel-action.js +118 -0
- package/dist/commonjs/funcs/actions-cancel-action.js.map +1 -0
- package/dist/commonjs/funcs/actions-check-action-status.d.ts +18 -0
- package/dist/commonjs/funcs/actions-check-action-status.d.ts.map +1 -0
- package/dist/commonjs/funcs/actions-check-action-status.js +122 -0
- package/dist/commonjs/funcs/actions-check-action-status.js.map +1 -0
- package/dist/commonjs/funcs/actions-propose-action.d.ts +18 -0
- package/dist/commonjs/funcs/actions-propose-action.d.ts.map +1 -0
- package/dist/commonjs/funcs/actions-propose-action.js +118 -0
- package/dist/commonjs/funcs/actions-propose-action.js.map +1 -0
- package/dist/commonjs/funcs/census-create-session.d.ts +18 -0
- package/dist/commonjs/funcs/census-create-session.d.ts.map +1 -0
- package/dist/commonjs/funcs/census-create-session.js +123 -0
- package/dist/commonjs/funcs/census-create-session.js.map +1 -0
- package/dist/commonjs/funcs/census-create-verification-link.d.ts +18 -0
- package/dist/commonjs/funcs/census-create-verification-link.d.ts.map +1 -0
- package/dist/commonjs/funcs/census-create-verification-link.js +123 -0
- package/dist/commonjs/funcs/census-create-verification-link.js.map +1 -0
- package/dist/commonjs/funcs/census-get-partner-config.d.ts +18 -0
- package/dist/commonjs/funcs/census-get-partner-config.d.ts.map +1 -0
- package/dist/commonjs/funcs/census-get-partner-config.js +132 -0
- package/dist/commonjs/funcs/census-get-partner-config.js.map +1 -0
- package/dist/commonjs/funcs/census-logout.d.ts +15 -0
- package/dist/commonjs/funcs/census-logout.d.ts.map +1 -0
- package/dist/commonjs/funcs/census-logout.js +120 -0
- package/dist/commonjs/funcs/census-logout.js.map +1 -0
- package/dist/commonjs/funcs/census-revoke-verification.d.ts +18 -0
- package/dist/commonjs/funcs/census-revoke-verification.d.ts.map +1 -0
- package/dist/commonjs/funcs/census-revoke-verification.js +123 -0
- package/dist/commonjs/funcs/census-revoke-verification.js.map +1 -0
- package/dist/commonjs/funcs/census-store-signal.d.ts +18 -0
- package/dist/commonjs/funcs/census-store-signal.d.ts.map +1 -0
- package/dist/commonjs/funcs/census-store-signal.js +114 -0
- package/dist/commonjs/funcs/census-store-signal.js.map +1 -0
- package/dist/commonjs/funcs/census-validate-signal.d.ts +18 -0
- package/dist/commonjs/funcs/census-validate-signal.d.ts.map +1 -0
- package/dist/commonjs/funcs/census-validate-signal.js +114 -0
- package/dist/commonjs/funcs/census-validate-signal.js.map +1 -0
- package/dist/commonjs/funcs/census-verify-token.d.ts +18 -0
- package/dist/commonjs/funcs/census-verify-token.d.ts.map +1 -0
- package/dist/commonjs/funcs/census-verify-token.js +129 -0
- package/dist/commonjs/funcs/census-verify-token.js.map +1 -0
- package/dist/commonjs/funcs/verification-get-status.d.ts +18 -0
- package/dist/commonjs/funcs/verification-get-status.d.ts.map +1 -0
- package/dist/commonjs/funcs/verification-get-status.js +132 -0
- package/dist/commonjs/funcs/verification-get-status.js.map +1 -0
- package/dist/commonjs/hooks/hooks.d.ts +25 -0
- package/dist/commonjs/hooks/hooks.d.ts.map +1 -0
- package/dist/commonjs/hooks/hooks.js +84 -0
- package/dist/commonjs/hooks/hooks.js.map +1 -0
- package/dist/commonjs/hooks/index.d.ts +3 -0
- package/dist/commonjs/hooks/index.d.ts.map +1 -0
- package/dist/commonjs/hooks/index.js +22 -0
- package/dist/commonjs/hooks/index.js.map +1 -0
- package/dist/commonjs/hooks/types.d.ts +77 -0
- package/dist/commonjs/hooks/types.d.ts.map +1 -0
- package/dist/commonjs/hooks/types.js +6 -0
- package/dist/commonjs/hooks/types.js.map +1 -0
- package/dist/commonjs/index.d.ts +6 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +48 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/lib/base64.d.ts +10 -0
- package/dist/commonjs/lib/base64.d.ts.map +1 -0
- package/dist/commonjs/lib/base64.js +71 -0
- package/dist/commonjs/lib/base64.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +42 -0
- package/dist/commonjs/lib/config.d.ts.map +1 -0
- package/dist/commonjs/lib/config.js +42 -0
- package/dist/commonjs/lib/config.js.map +1 -0
- package/dist/commonjs/lib/encodings.d.ts +55 -0
- package/dist/commonjs/lib/encodings.d.ts.map +1 -0
- package/dist/commonjs/lib/encodings.js +422 -0
- package/dist/commonjs/lib/encodings.js.map +1 -0
- package/dist/commonjs/lib/files.d.ts +26 -0
- package/dist/commonjs/lib/files.d.ts.map +1 -0
- package/dist/commonjs/lib/files.js +96 -0
- package/dist/commonjs/lib/files.js.map +1 -0
- package/dist/commonjs/lib/http.d.ts +67 -0
- package/dist/commonjs/lib/http.d.ts.map +1 -0
- package/dist/commonjs/lib/http.js +219 -0
- package/dist/commonjs/lib/http.js.map +1 -0
- package/dist/commonjs/lib/logger.d.ts +6 -0
- package/dist/commonjs/lib/logger.d.ts.map +1 -0
- package/dist/commonjs/lib/logger.js +6 -0
- package/dist/commonjs/lib/logger.js.map +1 -0
- package/dist/commonjs/lib/matchers.d.ts +59 -0
- package/dist/commonjs/lib/matchers.d.ts.map +1 -0
- package/dist/commonjs/lib/matchers.js +221 -0
- package/dist/commonjs/lib/matchers.js.map +1 -0
- package/dist/commonjs/lib/primitives.d.ts +27 -0
- package/dist/commonjs/lib/primitives.d.ts.map +1 -0
- package/dist/commonjs/lib/primitives.js +129 -0
- package/dist/commonjs/lib/primitives.js.map +1 -0
- package/dist/commonjs/lib/retries.d.ts +38 -0
- package/dist/commonjs/lib/retries.d.ts.map +1 -0
- package/dist/commonjs/lib/retries.js +163 -0
- package/dist/commonjs/lib/retries.js.map +1 -0
- package/dist/commonjs/lib/schemas.d.ts +19 -0
- package/dist/commonjs/lib/schemas.d.ts.map +1 -0
- package/dist/commonjs/lib/schemas.js +62 -0
- package/dist/commonjs/lib/schemas.js.map +1 -0
- package/dist/commonjs/lib/sdks.d.ts +63 -0
- package/dist/commonjs/lib/sdks.d.ts.map +1 -0
- package/dist/commonjs/lib/sdks.js +294 -0
- package/dist/commonjs/lib/sdks.js.map +1 -0
- package/dist/commonjs/lib/security.d.ts +84 -0
- package/dist/commonjs/lib/security.d.ts.map +1 -0
- package/dist/commonjs/lib/security.js +160 -0
- package/dist/commonjs/lib/security.js.map +1 -0
- package/dist/commonjs/lib/url.d.ts +5 -0
- package/dist/commonjs/lib/url.d.ts.map +1 -0
- package/dist/commonjs/lib/url.js +27 -0
- package/dist/commonjs/lib/url.js.map +1 -0
- package/dist/commonjs/mcp-server/cli/start/command.d.ts +2 -0
- package/dist/commonjs/mcp-server/cli/start/command.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/cli/start/command.js +141 -0
- package/dist/commonjs/mcp-server/cli/start/command.js.map +1 -0
- package/dist/commonjs/mcp-server/cli/start/impl.d.ts +19 -0
- package/dist/commonjs/mcp-server/cli/start/impl.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/cli/start/impl.js +110 -0
- package/dist/commonjs/mcp-server/cli/start/impl.js.map +1 -0
- package/dist/commonjs/mcp-server/cli.d.ts +6 -0
- package/dist/commonjs/mcp-server/cli.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/cli.js +10 -0
- package/dist/commonjs/mcp-server/cli.js.map +1 -0
- package/dist/commonjs/mcp-server/console-logger.d.ts +7 -0
- package/dist/commonjs/mcp-server/console-logger.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/console-logger.js +59 -0
- package/dist/commonjs/mcp-server/console-logger.js.map +1 -0
- package/dist/commonjs/mcp-server/extensions.d.ts +11 -0
- package/dist/commonjs/mcp-server/extensions.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/extensions.js +6 -0
- package/dist/commonjs/mcp-server/extensions.js.map +1 -0
- package/dist/commonjs/mcp-server/mcp-server.d.ts +2 -0
- package/dist/commonjs/mcp-server/mcp-server.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/mcp-server.js +29 -0
- package/dist/commonjs/mcp-server/mcp-server.js.map +1 -0
- package/dist/commonjs/mcp-server/prompts.d.ts +26 -0
- package/dist/commonjs/mcp-server/prompts.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/prompts.js +51 -0
- package/dist/commonjs/mcp-server/prompts.js.map +1 -0
- package/dist/commonjs/mcp-server/resources.d.ts +32 -0
- package/dist/commonjs/mcp-server/resources.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/resources.js +87 -0
- package/dist/commonjs/mcp-server/resources.js.map +1 -0
- package/dist/commonjs/mcp-server/scopes.d.ts +3 -0
- package/dist/commonjs/mcp-server/scopes.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/scopes.js +10 -0
- package/dist/commonjs/mcp-server/scopes.js.map +1 -0
- package/dist/commonjs/mcp-server/server.d.ts +13 -0
- package/dist/commonjs/mcp-server/server.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/server.js +38 -0
- package/dist/commonjs/mcp-server/server.js.map +1 -0
- package/dist/commonjs/mcp-server/shared.d.ts +7 -0
- package/dist/commonjs/mcp-server/shared.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/shared.js +98 -0
- package/dist/commonjs/mcp-server/shared.js.map +1 -0
- package/dist/commonjs/mcp-server/tools/actions-cancel-action.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/actions-cancel-action.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/actions-cancel-action.js +63 -0
- package/dist/commonjs/mcp-server/tools/actions-cancel-action.js.map +1 -0
- package/dist/commonjs/mcp-server/tools/actions-check-action-status.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/actions-check-action-status.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/actions-check-action-status.js +63 -0
- package/dist/commonjs/mcp-server/tools/actions-check-action-status.js.map +1 -0
- package/dist/commonjs/mcp-server/tools/actions-propose-action.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/actions-propose-action.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/actions-propose-action.js +63 -0
- package/dist/commonjs/mcp-server/tools/actions-propose-action.js.map +1 -0
- package/dist/commonjs/mcp-server/tools.d.ts +25 -0
- package/dist/commonjs/mcp-server/tools.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools.js +82 -0
- package/dist/commonjs/mcp-server/tools.js.map +1 -0
- package/dist/commonjs/models/error-body.d.ts +56 -0
- package/dist/commonjs/models/error-body.d.ts.map +1 -0
- package/dist/commonjs/models/error-body.js +100 -0
- package/dist/commonjs/models/error-body.js.map +1 -0
- package/dist/commonjs/models/error-response.d.ts +19 -0
- package/dist/commonjs/models/error-response.d.ts.map +1 -0
- package/dist/commonjs/models/error-response.js +61 -0
- package/dist/commonjs/models/error-response.js.map +1 -0
- package/dist/commonjs/models/errors/bot-shield-default-error.d.ts +10 -0
- package/dist/commonjs/models/errors/bot-shield-default-error.d.ts.map +1 -0
- package/dist/commonjs/models/errors/bot-shield-default-error.js +34 -0
- package/dist/commonjs/models/errors/bot-shield-default-error.js.map +1 -0
- package/dist/commonjs/models/errors/bot-shield-error.d.ts +19 -0
- package/dist/commonjs/models/errors/bot-shield-error.d.ts.map +1 -0
- package/dist/commonjs/models/errors/bot-shield-error.js +30 -0
- package/dist/commonjs/models/errors/bot-shield-error.js.map +1 -0
- package/dist/commonjs/models/errors/error-response.d.ts +31 -0
- package/dist/commonjs/models/errors/error-response.d.ts.map +1 -0
- package/dist/commonjs/models/errors/error-response.js +80 -0
- package/dist/commonjs/models/errors/error-response.js.map +1 -0
- package/dist/commonjs/models/errors/http-client-errors.d.ts +44 -0
- package/dist/commonjs/models/errors/http-client-errors.d.ts.map +1 -0
- package/dist/commonjs/models/errors/http-client-errors.js +65 -0
- package/dist/commonjs/models/errors/http-client-errors.js.map +1 -0
- package/dist/commonjs/models/errors/index.d.ts +8 -0
- package/dist/commonjs/models/errors/index.d.ts.map +1 -0
- package/dist/commonjs/models/errors/index.js +27 -0
- package/dist/commonjs/models/errors/index.js.map +1 -0
- package/dist/commonjs/models/errors/invalid-input-error.d.ts +42 -0
- package/dist/commonjs/models/errors/invalid-input-error.d.ts.map +1 -0
- package/dist/commonjs/models/errors/invalid-input-error.js +86 -0
- package/dist/commonjs/models/errors/invalid-input-error.js.map +1 -0
- package/dist/commonjs/models/errors/response-validation-error.d.ts +26 -0
- package/dist/commonjs/models/errors/response-validation-error.d.ts.map +1 -0
- package/dist/commonjs/models/errors/response-validation-error.js +74 -0
- package/dist/commonjs/models/errors/response-validation-error.js.map +1 -0
- package/dist/commonjs/models/errors/sdk-validation-error.d.ts +21 -0
- package/dist/commonjs/models/errors/sdk-validation-error.d.ts.map +1 -0
- package/dist/commonjs/models/errors/sdk-validation-error.js +137 -0
- package/dist/commonjs/models/errors/sdk-validation-error.js.map +1 -0
- package/dist/commonjs/models/index.d.ts +5 -0
- package/dist/commonjs/models/index.d.ts.map +1 -0
- package/dist/commonjs/models/index.js +24 -0
- package/dist/commonjs/models/index.js.map +1 -0
- package/dist/commonjs/models/invalid-input-error.d.ts +24 -0
- package/dist/commonjs/models/invalid-input-error.d.ts.map +1 -0
- package/dist/commonjs/models/invalid-input-error.js +63 -0
- package/dist/commonjs/models/invalid-input-error.js.map +1 -0
- package/dist/commonjs/models/operations/actions-cancel.d.ts +104 -0
- package/dist/commonjs/models/operations/actions-cancel.d.ts.map +1 -0
- package/dist/commonjs/models/operations/actions-cancel.js +154 -0
- package/dist/commonjs/models/operations/actions-cancel.js.map +1 -0
- package/dist/commonjs/models/operations/actions-check-status.d.ts +121 -0
- package/dist/commonjs/models/operations/actions-check-status.d.ts.map +1 -0
- package/dist/commonjs/models/operations/actions-check-status.js +176 -0
- package/dist/commonjs/models/operations/actions-check-status.js.map +1 -0
- package/dist/commonjs/models/operations/actions-propose.d.ts +187 -0
- package/dist/commonjs/models/operations/actions-propose.d.ts.map +1 -0
- package/dist/commonjs/models/operations/actions-propose.js +227 -0
- package/dist/commonjs/models/operations/actions-propose.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +13 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -0
- package/dist/commonjs/models/operations/index.js +32 -0
- package/dist/commonjs/models/operations/index.js.map +1 -0
- package/dist/commonjs/models/operations/sdk-create-session.d.ts +139 -0
- package/dist/commonjs/models/operations/sdk-create-session.d.ts.map +1 -0
- package/dist/commonjs/models/operations/sdk-create-session.js +205 -0
- package/dist/commonjs/models/operations/sdk-create-session.js.map +1 -0
- package/dist/commonjs/models/operations/sdk-create-verification-link.d.ts +220 -0
- package/dist/commonjs/models/operations/sdk-create-verification-link.d.ts.map +1 -0
- package/dist/commonjs/models/operations/sdk-create-verification-link.js +270 -0
- package/dist/commonjs/models/operations/sdk-create-verification-link.js.map +1 -0
- package/dist/commonjs/models/operations/sdk-get-partner-config.d.ts +126 -0
- package/dist/commonjs/models/operations/sdk-get-partner-config.d.ts.map +1 -0
- package/dist/commonjs/models/operations/sdk-get-partner-config.js +179 -0
- package/dist/commonjs/models/operations/sdk-get-partner-config.js.map +1 -0
- package/dist/commonjs/models/operations/sdk-logout.d.ts +74 -0
- package/dist/commonjs/models/operations/sdk-logout.d.ts.map +1 -0
- package/dist/commonjs/models/operations/sdk-logout.js +143 -0
- package/dist/commonjs/models/operations/sdk-logout.js.map +1 -0
- package/dist/commonjs/models/operations/sdk-revoke-verification.d.ts +97 -0
- package/dist/commonjs/models/operations/sdk-revoke-verification.d.ts.map +1 -0
- package/dist/commonjs/models/operations/sdk-revoke-verification.js +161 -0
- package/dist/commonjs/models/operations/sdk-revoke-verification.js.map +1 -0
- package/dist/commonjs/models/operations/sdk-store-signal.d.ts +93 -0
- package/dist/commonjs/models/operations/sdk-store-signal.d.ts.map +1 -0
- package/dist/commonjs/models/operations/sdk-store-signal.js +155 -0
- package/dist/commonjs/models/operations/sdk-store-signal.js.map +1 -0
- package/dist/commonjs/models/operations/sdk-validate-signal.d.ts +101 -0
- package/dist/commonjs/models/operations/sdk-validate-signal.d.ts.map +1 -0
- package/dist/commonjs/models/operations/sdk-validate-signal.js +164 -0
- package/dist/commonjs/models/operations/sdk-validate-signal.js.map +1 -0
- package/dist/commonjs/models/operations/sdk-verify-token.d.ts +120 -0
- package/dist/commonjs/models/operations/sdk-verify-token.d.ts.map +1 -0
- package/dist/commonjs/models/operations/sdk-verify-token.js +186 -0
- package/dist/commonjs/models/operations/sdk-verify-token.js.map +1 -0
- package/dist/commonjs/models/operations/verification-get-status.d.ts +161 -0
- package/dist/commonjs/models/operations/verification-get-status.d.ts.map +1 -0
- package/dist/commonjs/models/operations/verification-get-status.js +236 -0
- package/dist/commonjs/models/operations/verification-get-status.js.map +1 -0
- package/dist/commonjs/models/security.d.ts +19 -0
- package/dist/commonjs/models/security.d.ts.map +1 -0
- package/dist/commonjs/models/security.js +61 -0
- package/dist/commonjs/models/security.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/sdk/actions.d.ts +26 -0
- package/dist/commonjs/sdk/actions.d.ts.map +1 -0
- package/dist/commonjs/sdk/actions.js +42 -0
- package/dist/commonjs/sdk/actions.js.map +1 -0
- package/dist/commonjs/sdk/census.d.ts +58 -0
- package/dist/commonjs/sdk/census.d.ts.map +1 -0
- package/dist/commonjs/sdk/census.js +89 -0
- package/dist/commonjs/sdk/census.js.map +1 -0
- package/dist/commonjs/sdk/index.d.ts +2 -0
- package/dist/commonjs/sdk/index.d.ts.map +1 -0
- package/dist/commonjs/sdk/index.js +21 -0
- package/dist/commonjs/sdk/index.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +13 -0
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -0
- package/dist/commonjs/sdk/sdk.js +26 -0
- package/dist/commonjs/sdk/sdk.js.map +1 -0
- package/dist/commonjs/sdk/verification.d.ts +12 -0
- package/dist/commonjs/sdk/verification.d.ts.map +1 -0
- package/dist/commonjs/sdk/verification.js +22 -0
- package/dist/commonjs/sdk/verification.js.map +1 -0
- package/dist/commonjs/types/async.d.ts +23 -0
- package/dist/commonjs/types/async.d.ts.map +1 -0
- package/dist/commonjs/types/async.js +32 -0
- package/dist/commonjs/types/async.js.map +1 -0
- package/dist/commonjs/types/blobs.d.ts +4 -0
- package/dist/commonjs/types/blobs.d.ts.map +1 -0
- package/dist/commonjs/types/blobs.js +62 -0
- package/dist/commonjs/types/blobs.js.map +1 -0
- package/dist/commonjs/types/const-date-time.d.ts +3 -0
- package/dist/commonjs/types/const-date-time.d.ts.map +1 -0
- package/dist/commonjs/types/const-date-time.js +46 -0
- package/dist/commonjs/types/const-date-time.js.map +1 -0
- package/dist/commonjs/types/default-to-zero-value.d.ts +12 -0
- package/dist/commonjs/types/default-to-zero-value.d.ts.map +1 -0
- package/dist/commonjs/types/default-to-zero-value.js +35 -0
- package/dist/commonjs/types/default-to-zero-value.js.map +1 -0
- package/dist/commonjs/types/enums.d.ts +9 -0
- package/dist/commonjs/types/enums.d.ts.map +1 -0
- package/dist/commonjs/types/enums.js +66 -0
- package/dist/commonjs/types/enums.js.map +1 -0
- package/dist/commonjs/types/fp.d.ts +31 -0
- package/dist/commonjs/types/fp.d.ts.map +1 -0
- package/dist/commonjs/types/fp.js +37 -0
- package/dist/commonjs/types/fp.js.map +1 -0
- package/dist/commonjs/types/index.d.ts +10 -0
- package/dist/commonjs/types/index.d.ts.map +1 -0
- package/dist/commonjs/types/index.js +31 -0
- package/dist/commonjs/types/index.js.map +1 -0
- package/dist/commonjs/types/operations.d.ts +27 -0
- package/dist/commonjs/types/operations.d.ts.map +1 -0
- package/dist/commonjs/types/operations.js +83 -0
- package/dist/commonjs/types/operations.js.map +1 -0
- package/dist/commonjs/types/primitives.d.ts +9 -0
- package/dist/commonjs/types/primitives.d.ts.map +1 -0
- package/dist/commonjs/types/primitives.js +147 -0
- package/dist/commonjs/types/primitives.js.map +1 -0
- package/dist/commonjs/types/rfcdate.d.ts +21 -0
- package/dist/commonjs/types/rfcdate.d.ts.map +1 -0
- package/dist/commonjs/types/rfcdate.js +47 -0
- package/dist/commonjs/types/rfcdate.js.map +1 -0
- package/dist/commonjs/types/smart-union.d.ts +7 -0
- package/dist/commonjs/types/smart-union.d.ts.map +1 -0
- package/dist/commonjs/types/smart-union.js +152 -0
- package/dist/commonjs/types/smart-union.js.map +1 -0
- package/dist/commonjs/types/streams.d.ts +2 -0
- package/dist/commonjs/types/streams.d.ts.map +1 -0
- package/dist/commonjs/types/streams.js +18 -0
- package/dist/commonjs/types/streams.js.map +1 -0
- package/dist/commonjs/types/unrecognized.d.ts +16 -0
- package/dist/commonjs/types/unrecognized.d.ts.map +1 -0
- package/dist/commonjs/types/unrecognized.js +34 -0
- package/dist/commonjs/types/unrecognized.js.map +1 -0
- package/dist/esm/core.d.ts +10 -0
- package/dist/esm/core.d.ts.map +1 -0
- package/dist/esm/core.js +13 -0
- package/dist/esm/core.js.map +1 -0
- package/dist/esm/funcs/actions-cancel-action.d.ts +18 -0
- package/dist/esm/funcs/actions-cancel-action.d.ts.map +1 -0
- package/dist/esm/funcs/actions-cancel-action.js +82 -0
- package/dist/esm/funcs/actions-cancel-action.js.map +1 -0
- package/dist/esm/funcs/actions-check-action-status.d.ts +18 -0
- package/dist/esm/funcs/actions-check-action-status.d.ts.map +1 -0
- package/dist/esm/funcs/actions-check-action-status.js +86 -0
- package/dist/esm/funcs/actions-check-action-status.js.map +1 -0
- package/dist/esm/funcs/actions-propose-action.d.ts +18 -0
- package/dist/esm/funcs/actions-propose-action.d.ts.map +1 -0
- package/dist/esm/funcs/actions-propose-action.js +82 -0
- package/dist/esm/funcs/actions-propose-action.js.map +1 -0
- package/dist/esm/funcs/census-create-session.d.ts +18 -0
- package/dist/esm/funcs/census-create-session.d.ts.map +1 -0
- package/dist/esm/funcs/census-create-session.js +87 -0
- package/dist/esm/funcs/census-create-session.js.map +1 -0
- package/dist/esm/funcs/census-create-verification-link.d.ts +18 -0
- package/dist/esm/funcs/census-create-verification-link.d.ts.map +1 -0
- package/dist/esm/funcs/census-create-verification-link.js +87 -0
- package/dist/esm/funcs/census-create-verification-link.js.map +1 -0
- package/dist/esm/funcs/census-get-partner-config.d.ts +18 -0
- package/dist/esm/funcs/census-get-partner-config.d.ts.map +1 -0
- package/dist/esm/funcs/census-get-partner-config.js +96 -0
- package/dist/esm/funcs/census-get-partner-config.js.map +1 -0
- package/dist/esm/funcs/census-logout.d.ts +15 -0
- package/dist/esm/funcs/census-logout.d.ts.map +1 -0
- package/dist/esm/funcs/census-logout.js +84 -0
- package/dist/esm/funcs/census-logout.js.map +1 -0
- package/dist/esm/funcs/census-revoke-verification.d.ts +18 -0
- package/dist/esm/funcs/census-revoke-verification.d.ts.map +1 -0
- package/dist/esm/funcs/census-revoke-verification.js +87 -0
- package/dist/esm/funcs/census-revoke-verification.js.map +1 -0
- package/dist/esm/funcs/census-store-signal.d.ts +18 -0
- package/dist/esm/funcs/census-store-signal.d.ts.map +1 -0
- package/dist/esm/funcs/census-store-signal.js +78 -0
- package/dist/esm/funcs/census-store-signal.js.map +1 -0
- package/dist/esm/funcs/census-validate-signal.d.ts +18 -0
- package/dist/esm/funcs/census-validate-signal.d.ts.map +1 -0
- package/dist/esm/funcs/census-validate-signal.js +78 -0
- package/dist/esm/funcs/census-validate-signal.js.map +1 -0
- package/dist/esm/funcs/census-verify-token.d.ts +18 -0
- package/dist/esm/funcs/census-verify-token.d.ts.map +1 -0
- package/dist/esm/funcs/census-verify-token.js +93 -0
- package/dist/esm/funcs/census-verify-token.js.map +1 -0
- package/dist/esm/funcs/verification-get-status.d.ts +18 -0
- package/dist/esm/funcs/verification-get-status.d.ts.map +1 -0
- package/dist/esm/funcs/verification-get-status.js +96 -0
- package/dist/esm/funcs/verification-get-status.js.map +1 -0
- package/dist/esm/hooks/hooks.d.ts +25 -0
- package/dist/esm/hooks/hooks.d.ts.map +1 -0
- package/dist/esm/hooks/hooks.js +80 -0
- package/dist/esm/hooks/hooks.js.map +1 -0
- package/dist/esm/hooks/index.d.ts +3 -0
- package/dist/esm/hooks/index.d.ts.map +1 -0
- package/dist/esm/hooks/index.js +6 -0
- package/dist/esm/hooks/index.js.map +1 -0
- package/dist/esm/hooks/types.d.ts +77 -0
- package/dist/esm/hooks/types.d.ts.map +1 -0
- package/dist/esm/hooks/types.js +5 -0
- package/dist/esm/hooks/types.js.map +1 -0
- package/dist/esm/index.d.ts +6 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/lib/base64.d.ts +10 -0
- package/dist/esm/lib/base64.d.ts.map +1 -0
- package/dist/esm/lib/base64.js +29 -0
- package/dist/esm/lib/base64.js.map +1 -0
- package/dist/esm/lib/config.d.ts +42 -0
- package/dist/esm/lib/config.d.ts.map +1 -0
- package/dist/esm/lib/config.js +38 -0
- package/dist/esm/lib/config.js.map +1 -0
- package/dist/esm/lib/encodings.d.ts +55 -0
- package/dist/esm/lib/encodings.d.ts.map +1 -0
- package/dist/esm/lib/encodings.js +407 -0
- package/dist/esm/lib/encodings.js.map +1 -0
- package/dist/esm/lib/files.d.ts +26 -0
- package/dist/esm/lib/files.d.ts.map +1 -0
- package/dist/esm/lib/files.js +91 -0
- package/dist/esm/lib/files.js.map +1 -0
- package/dist/esm/lib/http.d.ts +67 -0
- package/dist/esm/lib/http.d.ts.map +1 -0
- package/dist/esm/lib/http.js +209 -0
- package/dist/esm/lib/http.js.map +1 -0
- package/dist/esm/lib/logger.d.ts +6 -0
- package/dist/esm/lib/logger.d.ts.map +1 -0
- package/dist/esm/lib/logger.js +5 -0
- package/dist/esm/lib/logger.js.map +1 -0
- package/dist/esm/lib/matchers.d.ts +59 -0
- package/dist/esm/lib/matchers.d.ts.map +1 -0
- package/dist/esm/lib/matchers.js +202 -0
- package/dist/esm/lib/matchers.js.map +1 -0
- package/dist/esm/lib/primitives.d.ts +27 -0
- package/dist/esm/lib/primitives.d.ts.map +1 -0
- package/dist/esm/lib/primitives.js +120 -0
- package/dist/esm/lib/primitives.js.map +1 -0
- package/dist/esm/lib/retries.d.ts +38 -0
- package/dist/esm/lib/retries.d.ts.map +1 -0
- package/dist/esm/lib/retries.js +157 -0
- package/dist/esm/lib/retries.js.map +1 -0
- package/dist/esm/lib/schemas.d.ts +19 -0
- package/dist/esm/lib/schemas.d.ts.map +1 -0
- package/dist/esm/lib/schemas.js +57 -0
- package/dist/esm/lib/schemas.js.map +1 -0
- package/dist/esm/lib/sdks.d.ts +63 -0
- package/dist/esm/lib/sdks.d.ts.map +1 -0
- package/dist/esm/lib/sdks.js +290 -0
- package/dist/esm/lib/sdks.js.map +1 -0
- package/dist/esm/lib/security.d.ts +84 -0
- package/dist/esm/lib/security.d.ts.map +1 -0
- package/dist/esm/lib/security.js +153 -0
- package/dist/esm/lib/security.js.map +1 -0
- package/dist/esm/lib/url.d.ts +5 -0
- package/dist/esm/lib/url.d.ts.map +1 -0
- package/dist/esm/lib/url.js +24 -0
- package/dist/esm/lib/url.js.map +1 -0
- package/dist/esm/mcp-server/build.d.mts.map +1 -0
- package/dist/esm/mcp-server/build.mjs +14 -0
- package/dist/esm/mcp-server/build.mjs.map +1 -0
- package/dist/esm/mcp-server/cli/start/command.d.ts +2 -0
- package/dist/esm/mcp-server/cli/start/command.d.ts.map +1 -0
- package/dist/esm/mcp-server/cli/start/command.js +105 -0
- package/dist/esm/mcp-server/cli/start/command.js.map +1 -0
- package/dist/esm/mcp-server/cli/start/impl.d.ts +19 -0
- package/dist/esm/mcp-server/cli/start/impl.d.ts.map +1 -0
- package/dist/esm/mcp-server/cli/start/impl.js +104 -0
- package/dist/esm/mcp-server/cli/start/impl.js.map +1 -0
- package/dist/esm/mcp-server/cli.d.ts +6 -0
- package/dist/esm/mcp-server/cli.d.ts.map +1 -0
- package/dist/esm/mcp-server/cli.js +7 -0
- package/dist/esm/mcp-server/cli.js.map +1 -0
- package/dist/esm/mcp-server/console-logger.d.ts +7 -0
- package/dist/esm/mcp-server/console-logger.d.ts.map +1 -0
- package/dist/esm/mcp-server/console-logger.js +55 -0
- package/dist/esm/mcp-server/console-logger.js.map +1 -0
- package/dist/esm/mcp-server/extensions.d.ts +11 -0
- package/dist/esm/mcp-server/extensions.d.ts.map +1 -0
- package/dist/esm/mcp-server/extensions.js +5 -0
- package/dist/esm/mcp-server/extensions.js.map +1 -0
- package/dist/esm/mcp-server/mcp-server.d.ts +2 -0
- package/dist/esm/mcp-server/mcp-server.d.ts.map +1 -0
- package/dist/esm/mcp-server/mcp-server.js +23 -0
- package/dist/esm/mcp-server/mcp-server.js.map +1 -0
- package/dist/esm/mcp-server/prompts.d.ts +26 -0
- package/dist/esm/mcp-server/prompts.d.ts.map +1 -0
- package/dist/esm/mcp-server/prompts.js +47 -0
- package/dist/esm/mcp-server/prompts.js.map +1 -0
- package/dist/esm/mcp-server/resources.d.ts +32 -0
- package/dist/esm/mcp-server/resources.d.ts.map +1 -0
- package/dist/esm/mcp-server/resources.js +82 -0
- package/dist/esm/mcp-server/resources.js.map +1 -0
- package/dist/esm/mcp-server/scopes.d.ts +3 -0
- package/dist/esm/mcp-server/scopes.d.ts.map +1 -0
- package/dist/esm/mcp-server/scopes.js +7 -0
- package/dist/esm/mcp-server/scopes.js.map +1 -0
- package/dist/esm/mcp-server/server.d.ts +13 -0
- package/dist/esm/mcp-server/server.d.ts.map +1 -0
- package/dist/esm/mcp-server/server.js +35 -0
- package/dist/esm/mcp-server/server.js.map +1 -0
- package/dist/esm/mcp-server/shared.d.ts +7 -0
- package/dist/esm/mcp-server/shared.d.ts.map +1 -0
- package/dist/esm/mcp-server/shared.js +59 -0
- package/dist/esm/mcp-server/shared.js.map +1 -0
- package/dist/esm/mcp-server/tools/actions-cancel-action.d.ts +8 -0
- package/dist/esm/mcp-server/tools/actions-cancel-action.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/actions-cancel-action.js +27 -0
- package/dist/esm/mcp-server/tools/actions-cancel-action.js.map +1 -0
- package/dist/esm/mcp-server/tools/actions-check-action-status.d.ts +8 -0
- package/dist/esm/mcp-server/tools/actions-check-action-status.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/actions-check-action-status.js +27 -0
- package/dist/esm/mcp-server/tools/actions-check-action-status.js.map +1 -0
- package/dist/esm/mcp-server/tools/actions-propose-action.d.ts +8 -0
- package/dist/esm/mcp-server/tools/actions-propose-action.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/actions-propose-action.js +27 -0
- package/dist/esm/mcp-server/tools/actions-propose-action.js.map +1 -0
- package/dist/esm/mcp-server/tools.d.ts +25 -0
- package/dist/esm/mcp-server/tools.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools.js +78 -0
- package/dist/esm/mcp-server/tools.js.map +1 -0
- package/dist/esm/models/error-body.d.ts +56 -0
- package/dist/esm/models/error-body.d.ts.map +1 -0
- package/dist/esm/models/error-body.js +60 -0
- package/dist/esm/models/error-body.js.map +1 -0
- package/dist/esm/models/error-response.d.ts +19 -0
- package/dist/esm/models/error-response.d.ts.map +1 -0
- package/dist/esm/models/error-response.js +23 -0
- package/dist/esm/models/error-response.js.map +1 -0
- package/dist/esm/models/errors/bot-shield-default-error.d.ts +10 -0
- package/dist/esm/models/errors/bot-shield-default-error.d.ts.map +1 -0
- package/dist/esm/models/errors/bot-shield-default-error.js +30 -0
- package/dist/esm/models/errors/bot-shield-default-error.js.map +1 -0
- package/dist/esm/models/errors/bot-shield-error.d.ts +19 -0
- package/dist/esm/models/errors/bot-shield-error.d.ts.map +1 -0
- package/dist/esm/models/errors/bot-shield-error.js +26 -0
- package/dist/esm/models/errors/bot-shield-error.js.map +1 -0
- package/dist/esm/models/errors/error-response.d.ts +31 -0
- package/dist/esm/models/errors/error-response.d.ts.map +1 -0
- package/dist/esm/models/errors/error-response.js +43 -0
- package/dist/esm/models/errors/error-response.js.map +1 -0
- package/dist/esm/models/errors/http-client-errors.d.ts +44 -0
- package/dist/esm/models/errors/http-client-errors.d.ts.map +1 -0
- package/dist/esm/models/errors/http-client-errors.js +56 -0
- package/dist/esm/models/errors/http-client-errors.js.map +1 -0
- package/dist/esm/models/errors/index.d.ts +8 -0
- package/dist/esm/models/errors/index.d.ts.map +1 -0
- package/dist/esm/models/errors/index.js +11 -0
- package/dist/esm/models/errors/index.js.map +1 -0
- package/dist/esm/models/errors/invalid-input-error.d.ts +42 -0
- package/dist/esm/models/errors/invalid-input-error.d.ts.map +1 -0
- package/dist/esm/models/errors/invalid-input-error.js +49 -0
- package/dist/esm/models/errors/invalid-input-error.js.map +1 -0
- package/dist/esm/models/errors/response-validation-error.d.ts +26 -0
- package/dist/esm/models/errors/response-validation-error.d.ts.map +1 -0
- package/dist/esm/models/errors/response-validation-error.js +37 -0
- package/dist/esm/models/errors/response-validation-error.js.map +1 -0
- package/dist/esm/models/errors/sdk-validation-error.d.ts +21 -0
- package/dist/esm/models/errors/sdk-validation-error.d.ts.map +1 -0
- package/dist/esm/models/errors/sdk-validation-error.js +99 -0
- package/dist/esm/models/errors/sdk-validation-error.js.map +1 -0
- package/dist/esm/models/index.d.ts +5 -0
- package/dist/esm/models/index.d.ts.map +1 -0
- package/dist/esm/models/index.js +8 -0
- package/dist/esm/models/index.js.map +1 -0
- package/dist/esm/models/invalid-input-error.d.ts +24 -0
- package/dist/esm/models/invalid-input-error.d.ts.map +1 -0
- package/dist/esm/models/invalid-input-error.js +25 -0
- package/dist/esm/models/invalid-input-error.js.map +1 -0
- package/dist/esm/models/operations/actions-cancel.d.ts +104 -0
- package/dist/esm/models/operations/actions-cancel.d.ts.map +1 -0
- package/dist/esm/models/operations/actions-cancel.js +110 -0
- package/dist/esm/models/operations/actions-cancel.js.map +1 -0
- package/dist/esm/models/operations/actions-check-status.d.ts +121 -0
- package/dist/esm/models/operations/actions-check-status.d.ts.map +1 -0
- package/dist/esm/models/operations/actions-check-status.js +132 -0
- package/dist/esm/models/operations/actions-check-status.js.map +1 -0
- package/dist/esm/models/operations/actions-propose.d.ts +187 -0
- package/dist/esm/models/operations/actions-propose.d.ts.map +1 -0
- package/dist/esm/models/operations/actions-propose.js +179 -0
- package/dist/esm/models/operations/actions-propose.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +13 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -0
- package/dist/esm/models/operations/index.js +16 -0
- package/dist/esm/models/operations/index.js.map +1 -0
- package/dist/esm/models/operations/sdk-create-session.d.ts +139 -0
- package/dist/esm/models/operations/sdk-create-session.d.ts.map +1 -0
- package/dist/esm/models/operations/sdk-create-session.js +157 -0
- package/dist/esm/models/operations/sdk-create-session.js.map +1 -0
- package/dist/esm/models/operations/sdk-create-verification-link.d.ts +220 -0
- package/dist/esm/models/operations/sdk-create-verification-link.d.ts.map +1 -0
- package/dist/esm/models/operations/sdk-create-verification-link.js +222 -0
- package/dist/esm/models/operations/sdk-create-verification-link.js.map +1 -0
- package/dist/esm/models/operations/sdk-get-partner-config.d.ts +126 -0
- package/dist/esm/models/operations/sdk-get-partner-config.d.ts.map +1 -0
- package/dist/esm/models/operations/sdk-get-partner-config.js +131 -0
- package/dist/esm/models/operations/sdk-get-partner-config.js.map +1 -0
- package/dist/esm/models/operations/sdk-logout.d.ts +74 -0
- package/dist/esm/models/operations/sdk-logout.d.ts.map +1 -0
- package/dist/esm/models/operations/sdk-logout.js +99 -0
- package/dist/esm/models/operations/sdk-logout.js.map +1 -0
- package/dist/esm/models/operations/sdk-revoke-verification.d.ts +97 -0
- package/dist/esm/models/operations/sdk-revoke-verification.d.ts.map +1 -0
- package/dist/esm/models/operations/sdk-revoke-verification.js +115 -0
- package/dist/esm/models/operations/sdk-revoke-verification.js.map +1 -0
- package/dist/esm/models/operations/sdk-store-signal.d.ts +93 -0
- package/dist/esm/models/operations/sdk-store-signal.d.ts.map +1 -0
- package/dist/esm/models/operations/sdk-store-signal.js +111 -0
- package/dist/esm/models/operations/sdk-store-signal.js.map +1 -0
- package/dist/esm/models/operations/sdk-validate-signal.d.ts +101 -0
- package/dist/esm/models/operations/sdk-validate-signal.d.ts.map +1 -0
- package/dist/esm/models/operations/sdk-validate-signal.js +120 -0
- package/dist/esm/models/operations/sdk-validate-signal.js.map +1 -0
- package/dist/esm/models/operations/sdk-verify-token.d.ts +120 -0
- package/dist/esm/models/operations/sdk-verify-token.d.ts.map +1 -0
- package/dist/esm/models/operations/sdk-verify-token.js +138 -0
- package/dist/esm/models/operations/sdk-verify-token.js.map +1 -0
- package/dist/esm/models/operations/verification-get-status.d.ts +161 -0
- package/dist/esm/models/operations/verification-get-status.d.ts.map +1 -0
- package/dist/esm/models/operations/verification-get-status.js +190 -0
- package/dist/esm/models/operations/verification-get-status.js.map +1 -0
- package/dist/esm/models/security.d.ts +19 -0
- package/dist/esm/models/security.d.ts.map +1 -0
- package/dist/esm/models/security.js +23 -0
- package/dist/esm/models/security.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/sdk/actions.d.ts +26 -0
- package/dist/esm/sdk/actions.d.ts.map +1 -0
- package/dist/esm/sdk/actions.js +38 -0
- package/dist/esm/sdk/actions.js.map +1 -0
- package/dist/esm/sdk/census.d.ts +58 -0
- package/dist/esm/sdk/census.d.ts.map +1 -0
- package/dist/esm/sdk/census.js +85 -0
- package/dist/esm/sdk/census.js.map +1 -0
- package/dist/esm/sdk/index.d.ts +2 -0
- package/dist/esm/sdk/index.d.ts.map +1 -0
- package/dist/esm/sdk/index.js +5 -0
- package/dist/esm/sdk/index.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +13 -0
- package/dist/esm/sdk/sdk.d.ts.map +1 -0
- package/dist/esm/sdk/sdk.js +22 -0
- package/dist/esm/sdk/sdk.js.map +1 -0
- package/dist/esm/sdk/verification.d.ts +12 -0
- package/dist/esm/sdk/verification.d.ts.map +1 -0
- package/dist/esm/sdk/verification.js +18 -0
- package/dist/esm/sdk/verification.js.map +1 -0
- package/dist/esm/types/async.d.ts +23 -0
- package/dist/esm/types/async.d.ts.map +1 -0
- package/dist/esm/types/async.js +28 -0
- package/dist/esm/types/async.js.map +1 -0
- package/dist/esm/types/blobs.d.ts +4 -0
- package/dist/esm/types/blobs.d.ts.map +1 -0
- package/dist/esm/types/blobs.js +25 -0
- package/dist/esm/types/blobs.js.map +1 -0
- package/dist/esm/types/const-date-time.d.ts +3 -0
- package/dist/esm/types/const-date-time.d.ts.map +1 -0
- package/dist/esm/types/const-date-time.js +10 -0
- package/dist/esm/types/const-date-time.js.map +1 -0
- package/dist/esm/types/default-to-zero-value.d.ts +12 -0
- package/dist/esm/types/default-to-zero-value.d.ts.map +1 -0
- package/dist/esm/types/default-to-zero-value.js +31 -0
- package/dist/esm/types/default-to-zero-value.js.map +1 -0
- package/dist/esm/types/enums.d.ts +9 -0
- package/dist/esm/types/enums.d.ts.map +1 -0
- package/dist/esm/types/enums.js +27 -0
- package/dist/esm/types/enums.js.map +1 -0
- package/dist/esm/types/fp.d.ts +31 -0
- package/dist/esm/types/fp.d.ts.map +1 -0
- package/dist/esm/types/fp.js +31 -0
- package/dist/esm/types/fp.js.map +1 -0
- package/dist/esm/types/index.d.ts +10 -0
- package/dist/esm/types/index.d.ts.map +1 -0
- package/dist/esm/types/index.js +10 -0
- package/dist/esm/types/index.js.map +1 -0
- package/dist/esm/types/operations.d.ts +27 -0
- package/dist/esm/types/operations.d.ts.map +1 -0
- package/dist/esm/types/operations.js +77 -0
- package/dist/esm/types/operations.js.map +1 -0
- package/dist/esm/types/primitives.d.ts +9 -0
- package/dist/esm/types/primitives.d.ts.map +1 -0
- package/dist/esm/types/primitives.js +105 -0
- package/dist/esm/types/primitives.js.map +1 -0
- package/dist/esm/types/rfcdate.d.ts +21 -0
- package/dist/esm/types/rfcdate.d.ts.map +1 -0
- package/dist/esm/types/rfcdate.js +43 -0
- package/dist/esm/types/rfcdate.js.map +1 -0
- package/dist/esm/types/smart-union.d.ts +7 -0
- package/dist/esm/types/smart-union.d.ts.map +1 -0
- package/dist/esm/types/smart-union.js +116 -0
- package/dist/esm/types/smart-union.js.map +1 -0
- package/dist/esm/types/streams.d.ts +2 -0
- package/dist/esm/types/streams.d.ts.map +1 -0
- package/dist/esm/types/streams.js +15 -0
- package/dist/esm/types/streams.js.map +1 -0
- package/dist/esm/types/unrecognized.d.ts +16 -0
- package/dist/esm/types/unrecognized.d.ts.map +1 -0
- package/dist/esm/types/unrecognized.js +31 -0
- package/dist/esm/types/unrecognized.js.map +1 -0
- package/examples/censusCreateSession.example.ts +26 -0
- package/jsr.json +27 -0
- package/package.json +124 -132
- package/src/core.ts +13 -0
- package/src/funcs/actions-cancel-action.ts +174 -0
- package/src/funcs/actions-check-action-status.ts +179 -0
- package/src/funcs/actions-propose-action.ts +174 -0
- package/src/funcs/census-create-session.ts +184 -0
- package/src/funcs/census-create-verification-link.ts +185 -0
- package/src/funcs/census-get-partner-config.ts +196 -0
- package/src/funcs/census-logout.ts +181 -0
- package/src/funcs/census-revoke-verification.ts +185 -0
- package/src/funcs/census-store-signal.ts +169 -0
- package/src/funcs/census-validate-signal.ts +169 -0
- package/src/funcs/census-verify-token.ts +191 -0
- package/src/funcs/verification-get-status.ts +196 -0
- package/src/hooks/hooks.ts +129 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/types.ts +108 -0
- package/src/index.ts +8 -21
- package/src/lib/base64.ts +37 -0
- package/src/lib/config.ts +75 -0
- package/src/lib/encodings.ts +564 -0
- package/src/lib/files.ts +104 -0
- package/src/lib/http.ts +325 -0
- package/src/lib/logger.ts +9 -0
- package/src/lib/matchers.ts +353 -0
- package/src/lib/primitives.ts +166 -0
- package/src/lib/retries.ts +226 -0
- package/src/lib/schemas.ts +91 -0
- package/src/lib/sdks.ts +438 -0
- package/src/lib/security.ts +286 -0
- package/src/lib/url.ts +35 -0
- package/src/mcp-server/cli/start/command.ts +109 -0
- package/src/mcp-server/cli/start/impl.ts +141 -0
- package/src/mcp-server/cli.ts +13 -0
- package/src/mcp-server/console-logger.ts +71 -0
- package/src/mcp-server/extensions.ts +17 -0
- package/src/mcp-server/mcp-server.ts +26 -0
- package/src/mcp-server/prompts.ts +121 -0
- package/src/mcp-server/resources.ts +176 -0
- package/src/mcp-server/scopes.ts +9 -0
- package/src/mcp-server/server.ts +65 -0
- package/src/mcp-server/shared.ts +74 -0
- package/src/mcp-server/tools/actions-cancel-action.ts +37 -0
- package/src/mcp-server/tools/actions-check-action-status.ts +37 -0
- package/src/mcp-server/tools/actions-propose-action.ts +37 -0
- package/src/mcp-server/tools.ts +133 -0
- package/src/models/error-body.ts +138 -0
- package/src/models/error-response.ts +56 -0
- package/src/models/errors/bot-shield-default-error.ts +40 -0
- package/src/models/errors/bot-shield-error.ts +35 -0
- package/src/models/errors/error-response.ts +72 -0
- package/src/models/errors/http-client-errors.ts +62 -0
- package/src/models/errors/index.ts +11 -0
- package/src/models/errors/invalid-input-error.ts +82 -0
- package/src/models/errors/response-validation-error.ts +50 -0
- package/src/models/errors/sdk-validation-error.ts +109 -0
- package/src/models/index.ts +8 -0
- package/src/models/invalid-input-error.ts +63 -0
- package/src/models/operations/actions-cancel.ts +271 -0
- package/src/models/operations/actions-check-status.ts +308 -0
- package/src/models/operations/actions-propose.ts +439 -0
- package/src/models/operations/index.ts +16 -0
- package/src/models/operations/sdk-create-session.ts +388 -0
- package/src/models/operations/sdk-create-verification-link.ts +550 -0
- package/src/models/operations/sdk-get-partner-config.ts +345 -0
- package/src/models/operations/sdk-logout.ts +230 -0
- package/src/models/operations/sdk-revoke-verification.ts +299 -0
- package/src/models/operations/sdk-store-signal.ts +261 -0
- package/src/models/operations/sdk-validate-signal.ts +274 -0
- package/src/models/operations/sdk-verify-token.ts +343 -0
- package/src/models/operations/verification-get-status.ts +430 -0
- package/src/models/security.ts +52 -0
- package/src/sdk/actions.ts +63 -0
- package/src/sdk/census.ts +162 -0
- package/src/sdk/index.ts +5 -0
- package/src/sdk/sdk.ts +25 -0
- package/src/sdk/verification.ts +29 -0
- package/src/types/async.ts +69 -0
- package/src/types/blobs.ts +32 -0
- package/src/types/const-date-time.ts +15 -0
- package/src/types/default-to-zero-value.ts +33 -0
- package/src/types/enums.ts +45 -0
- package/src/types/fp.ts +50 -0
- package/src/types/index.ts +13 -0
- package/src/types/operations.ts +105 -0
- package/src/types/primitives.ts +122 -0
- package/src/types/rfcdate.ts +54 -0
- package/src/types/smart-union.ts +153 -0
- package/src/types/streams.ts +21 -0
- package/src/types/unrecognized.ts +35 -0
- package/CHANGELOG.md +0 -270
- package/LICENSE +0 -201
- package/api-promise.d.mts +0 -3
- package/api-promise.d.mts.map +0 -1
- package/api-promise.d.ts +0 -3
- package/api-promise.d.ts.map +0 -1
- package/api-promise.js +0 -6
- package/api-promise.js.map +0 -1
- package/api-promise.mjs +0 -3
- package/api-promise.mjs.map +0 -1
- package/client.d.mts +0 -218
- package/client.d.mts.map +0 -1
- package/client.d.ts +0 -218
- package/client.d.ts.map +0 -1
- package/client.js +0 -534
- package/client.js.map +0 -1
- package/client.mjs +0 -530
- package/client.mjs.map +0 -1
- package/core/api-promise.d.mts +0 -46
- package/core/api-promise.d.mts.map +0 -1
- package/core/api-promise.d.ts +0 -46
- package/core/api-promise.d.ts.map +0 -1
- package/core/api-promise.js +0 -74
- package/core/api-promise.js.map +0 -1
- package/core/api-promise.mjs +0 -70
- package/core/api-promise.mjs.map +0 -1
- package/core/error.d.mts +0 -46
- package/core/error.d.mts.map +0 -1
- package/core/error.d.ts +0 -46
- package/core/error.d.ts.map +0 -1
- package/core/error.js +0 -113
- package/core/error.js.map +0 -1
- package/core/error.mjs +0 -97
- package/core/error.mjs.map +0 -1
- package/core/resource.d.mts +0 -6
- package/core/resource.d.mts.map +0 -1
- package/core/resource.d.ts +0 -6
- package/core/resource.d.ts.map +0 -1
- package/core/resource.js +0 -11
- package/core/resource.js.map +0 -1
- package/core/resource.mjs +0 -7
- package/core/resource.mjs.map +0 -1
- package/core/uploads.d.mts +0 -3
- package/core/uploads.d.mts.map +0 -1
- package/core/uploads.d.ts +0 -3
- package/core/uploads.d.ts.map +0 -1
- package/core/uploads.js +0 -6
- package/core/uploads.js.map +0 -1
- package/core/uploads.mjs +0 -2
- package/core/uploads.mjs.map +0 -1
- package/error.d.mts +0 -3
- package/error.d.mts.map +0 -1
- package/error.d.ts +0 -3
- package/error.d.ts.map +0 -1
- package/error.js +0 -6
- package/error.js.map +0 -1
- package/error.mjs +0 -3
- package/error.mjs.map +0 -1
- package/index.d.mts +0 -6
- package/index.d.mts.map +0 -1
- package/index.d.ts +0 -6
- package/index.d.ts.map +0 -1
- package/index.js +0 -30
- package/index.js.map +0 -1
- package/index.mjs +0 -7
- package/index.mjs.map +0 -1
- package/internal/builtin-types.d.mts +0 -73
- package/internal/builtin-types.d.mts.map +0 -1
- package/internal/builtin-types.d.ts +0 -73
- package/internal/builtin-types.d.ts.map +0 -1
- package/internal/builtin-types.js +0 -4
- package/internal/builtin-types.js.map +0 -1
- package/internal/builtin-types.mjs +0 -3
- package/internal/builtin-types.mjs.map +0 -1
- package/internal/detect-platform.d.mts +0 -15
- package/internal/detect-platform.d.mts.map +0 -1
- package/internal/detect-platform.d.ts +0 -15
- package/internal/detect-platform.d.ts.map +0 -1
- package/internal/detect-platform.js +0 -162
- package/internal/detect-platform.js.map +0 -1
- package/internal/detect-platform.mjs +0 -157
- package/internal/detect-platform.mjs.map +0 -1
- package/internal/errors.d.mts +0 -3
- package/internal/errors.d.mts.map +0 -1
- package/internal/errors.d.ts +0 -3
- package/internal/errors.d.ts.map +0 -1
- package/internal/errors.js +0 -41
- package/internal/errors.js.map +0 -1
- package/internal/errors.mjs +0 -36
- package/internal/errors.mjs.map +0 -1
- package/internal/headers.d.mts +0 -20
- package/internal/headers.d.mts.map +0 -1
- package/internal/headers.d.ts +0 -20
- package/internal/headers.d.ts.map +0 -1
- package/internal/headers.js +0 -79
- package/internal/headers.js.map +0 -1
- package/internal/headers.mjs +0 -74
- package/internal/headers.mjs.map +0 -1
- package/internal/parse.d.mts +0 -12
- package/internal/parse.d.mts.map +0 -1
- package/internal/parse.d.ts +0 -12
- package/internal/parse.d.ts.map +0 -1
- package/internal/parse.js +0 -40
- package/internal/parse.js.map +0 -1
- package/internal/parse.mjs +0 -37
- package/internal/parse.mjs.map +0 -1
- package/internal/request-options.d.mts +0 -75
- package/internal/request-options.d.mts.map +0 -1
- package/internal/request-options.d.ts +0 -75
- package/internal/request-options.d.ts.map +0 -1
- package/internal/request-options.js +0 -14
- package/internal/request-options.js.map +0 -1
- package/internal/request-options.mjs +0 -10
- package/internal/request-options.mjs.map +0 -1
- package/internal/shim-types.d.mts +0 -17
- package/internal/shim-types.d.mts.map +0 -1
- package/internal/shim-types.d.ts +0 -17
- package/internal/shim-types.d.ts.map +0 -1
- package/internal/shim-types.js +0 -4
- package/internal/shim-types.js.map +0 -1
- package/internal/shim-types.mjs +0 -3
- package/internal/shim-types.mjs.map +0 -1
- package/internal/shims.d.mts +0 -26
- package/internal/shims.d.mts.map +0 -1
- package/internal/shims.d.ts +0 -26
- package/internal/shims.d.ts.map +0 -1
- package/internal/shims.js +0 -92
- package/internal/shims.js.map +0 -1
- package/internal/shims.mjs +0 -85
- package/internal/shims.mjs.map +0 -1
- package/internal/to-file.d.mts +0 -45
- package/internal/to-file.d.mts.map +0 -1
- package/internal/to-file.d.ts +0 -45
- package/internal/to-file.d.ts.map +0 -1
- package/internal/to-file.js +0 -91
- package/internal/to-file.js.map +0 -1
- package/internal/to-file.mjs +0 -88
- package/internal/to-file.mjs.map +0 -1
- package/internal/tslib.js +0 -81
- package/internal/tslib.mjs +0 -17
- package/internal/types.d.mts +0 -69
- package/internal/types.d.mts.map +0 -1
- package/internal/types.d.ts +0 -69
- package/internal/types.d.ts.map +0 -1
- package/internal/types.js +0 -4
- package/internal/types.js.map +0 -1
- package/internal/types.mjs +0 -3
- package/internal/types.mjs.map +0 -1
- package/internal/uploads.d.mts +0 -42
- package/internal/uploads.d.mts.map +0 -1
- package/internal/uploads.d.ts +0 -42
- package/internal/uploads.d.ts.map +0 -1
- package/internal/uploads.js +0 -141
- package/internal/uploads.js.map +0 -1
- package/internal/uploads.mjs +0 -131
- package/internal/uploads.mjs.map +0 -1
- package/internal/utils/base64.d.mts +0 -3
- package/internal/utils/base64.d.mts.map +0 -1
- package/internal/utils/base64.d.ts +0 -3
- package/internal/utils/base64.d.ts.map +0 -1
- package/internal/utils/base64.js +0 -38
- package/internal/utils/base64.js.map +0 -1
- package/internal/utils/base64.mjs +0 -33
- package/internal/utils/base64.mjs.map +0 -1
- package/internal/utils/bytes.d.mts +0 -4
- package/internal/utils/bytes.d.mts.map +0 -1
- package/internal/utils/bytes.d.ts +0 -4
- package/internal/utils/bytes.d.ts.map +0 -1
- package/internal/utils/bytes.js +0 -31
- package/internal/utils/bytes.js.map +0 -1
- package/internal/utils/bytes.mjs +0 -26
- package/internal/utils/bytes.mjs.map +0 -1
- package/internal/utils/env.d.mts +0 -9
- package/internal/utils/env.d.mts.map +0 -1
- package/internal/utils/env.d.ts +0 -9
- package/internal/utils/env.d.ts.map +0 -1
- package/internal/utils/env.js +0 -22
- package/internal/utils/env.js.map +0 -1
- package/internal/utils/env.mjs +0 -18
- package/internal/utils/env.mjs.map +0 -1
- package/internal/utils/log.d.mts +0 -37
- package/internal/utils/log.d.mts.map +0 -1
- package/internal/utils/log.d.ts +0 -37
- package/internal/utils/log.d.ts.map +0 -1
- package/internal/utils/log.js +0 -87
- package/internal/utils/log.js.map +0 -1
- package/internal/utils/log.mjs +0 -81
- package/internal/utils/log.mjs.map +0 -1
- package/internal/utils/path.d.mts +0 -15
- package/internal/utils/path.d.mts.map +0 -1
- package/internal/utils/path.d.ts +0 -15
- package/internal/utils/path.d.ts.map +0 -1
- package/internal/utils/path.js +0 -79
- package/internal/utils/path.js.map +0 -1
- package/internal/utils/path.mjs +0 -74
- package/internal/utils/path.mjs.map +0 -1
- package/internal/utils/query.d.mts +0 -5
- package/internal/utils/query.d.mts.map +0 -1
- package/internal/utils/query.d.ts +0 -5
- package/internal/utils/query.d.ts.map +0 -1
- package/internal/utils/query.js +0 -23
- package/internal/utils/query.js.map +0 -1
- package/internal/utils/query.mjs +0 -20
- package/internal/utils/query.mjs.map +0 -1
- package/internal/utils/sleep.d.mts +0 -2
- package/internal/utils/sleep.d.mts.map +0 -1
- package/internal/utils/sleep.d.ts +0 -2
- package/internal/utils/sleep.d.ts.map +0 -1
- package/internal/utils/sleep.js +0 -7
- package/internal/utils/sleep.js.map +0 -1
- package/internal/utils/sleep.mjs +0 -3
- package/internal/utils/sleep.mjs.map +0 -1
- package/internal/utils/uuid.d.mts +0 -5
- package/internal/utils/uuid.d.mts.map +0 -1
- package/internal/utils/uuid.d.ts +0 -5
- package/internal/utils/uuid.d.ts.map +0 -1
- package/internal/utils/uuid.js +0 -19
- package/internal/utils/uuid.js.map +0 -1
- package/internal/utils/uuid.mjs +0 -15
- package/internal/utils/uuid.mjs.map +0 -1
- package/internal/utils/values.d.mts +0 -18
- package/internal/utils/values.d.mts.map +0 -1
- package/internal/utils/values.d.ts +0 -18
- package/internal/utils/values.d.ts.map +0 -1
- package/internal/utils/values.js +0 -112
- package/internal/utils/values.js.map +0 -1
- package/internal/utils/values.mjs +0 -94
- package/internal/utils/values.mjs.map +0 -1
- package/internal/utils.d.mts +0 -8
- package/internal/utils.d.mts.map +0 -1
- package/internal/utils.d.ts +0 -8
- package/internal/utils.d.ts.map +0 -1
- package/internal/utils.js +0 -12
- package/internal/utils.js.map +0 -1
- package/internal/utils.mjs +0 -9
- package/internal/utils.mjs.map +0 -1
- package/resource.d.mts +0 -3
- package/resource.d.mts.map +0 -1
- package/resource.d.ts +0 -3
- package/resource.d.ts.map +0 -1
- package/resource.js +0 -6
- package/resource.js.map +0 -1
- package/resource.mjs +0 -3
- package/resource.mjs.map +0 -1
- package/resources/actions.d.mts +0 -133
- package/resources/actions.d.mts.map +0 -1
- package/resources/actions.d.ts +0 -133
- package/resources/actions.d.ts.map +0 -1
- package/resources/actions.js +0 -36
- package/resources/actions.js.map +0 -1
- package/resources/actions.mjs +0 -32
- package/resources/actions.mjs.map +0 -1
- package/resources/index.d.mts +0 -4
- package/resources/index.d.mts.map +0 -1
- package/resources/index.d.ts +0 -4
- package/resources/index.d.ts.map +0 -1
- package/resources/index.js +0 -11
- package/resources/index.js.map +0 -1
- package/resources/index.mjs +0 -5
- package/resources/index.mjs.map +0 -1
- package/resources/sdk.d.mts +0 -261
- package/resources/sdk.d.mts.map +0 -1
- package/resources/sdk.d.ts +0 -261
- package/resources/sdk.d.ts.map +0 -1
- package/resources/sdk.js +0 -69
- package/resources/sdk.js.map +0 -1
- package/resources/sdk.mjs +0 -65
- package/resources/sdk.mjs.map +0 -1
- package/resources/verification.d.mts +0 -64
- package/resources/verification.d.mts.map +0 -1
- package/resources/verification.d.ts +0 -64
- package/resources/verification.d.ts.map +0 -1
- package/resources/verification.js +0 -25
- package/resources/verification.js.map +0 -1
- package/resources/verification.mjs +0 -21
- package/resources/verification.mjs.map +0 -1
- package/resources.d.mts +0 -2
- package/resources.d.mts.map +0 -1
- package/resources.d.ts +0 -2
- package/resources.d.ts.map +0 -1
- package/resources.js +0 -5
- package/resources.js.map +0 -1
- package/resources.mjs +0 -2
- package/resources.mjs.map +0 -1
- package/src/api-promise.ts +0 -2
- package/src/client.ts +0 -892
- package/src/core/README.md +0 -3
- package/src/core/api-promise.ts +0 -92
- package/src/core/error.ts +0 -130
- package/src/core/resource.ts +0 -11
- package/src/core/uploads.ts +0 -2
- package/src/error.ts +0 -2
- package/src/internal/README.md +0 -3
- package/src/internal/builtin-types.ts +0 -93
- package/src/internal/detect-platform.ts +0 -196
- package/src/internal/errors.ts +0 -33
- package/src/internal/headers.ts +0 -97
- package/src/internal/parse.ts +0 -56
- package/src/internal/request-options.ts +0 -91
- package/src/internal/shim-types.ts +0 -26
- package/src/internal/shims.ts +0 -107
- package/src/internal/to-file.ts +0 -154
- package/src/internal/types.ts +0 -93
- package/src/internal/uploads.ts +0 -187
- package/src/internal/utils/base64.ts +0 -40
- package/src/internal/utils/bytes.ts +0 -32
- package/src/internal/utils/env.ts +0 -18
- package/src/internal/utils/log.ts +0 -128
- package/src/internal/utils/path.ts +0 -88
- package/src/internal/utils/query.ts +0 -23
- package/src/internal/utils/sleep.ts +0 -3
- package/src/internal/utils/uuid.ts +0 -17
- package/src/internal/utils/values.ts +0 -105
- package/src/internal/utils.ts +0 -9
- package/src/lib/.keep +0 -4
- package/src/resource.ts +0 -2
- package/src/resources/actions.ts +0 -184
- package/src/resources/index.ts +0 -37
- package/src/resources/sdk.ts +0 -403
- package/src/resources/verification.ts +0 -107
- package/src/resources.ts +0 -1
- package/src/tsconfig.json +0 -11
- package/src/uploads.ts +0 -2
- package/src/version.ts +0 -1
- package/uploads.d.mts +0 -3
- package/uploads.d.mts.map +0 -1
- package/uploads.d.ts +0 -3
- package/uploads.d.ts.map +0 -1
- package/uploads.js +0 -6
- package/uploads.js.map +0 -1
- package/uploads.mjs +0 -3
- package/uploads.mjs.map +0 -1
- package/version.d.mts +0 -2
- package/version.d.mts.map +0 -1
- package/version.d.ts +0 -2
- package/version.d.ts.map +0 -1
- package/version.js +0 -5
- package/version.js.map +0 -1
- package/version.mjs +0 -2
- package/version.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -1,410 +1,597 @@
|
|
|
1
|
-
#
|
|
1
|
+
# botshield-sdk
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Developer-friendly & type-safe Typescript SDK specifically catered to leverage *botshield-sdk* API.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://www.speakeasy.com/?utm_source=botshield-sdk&utm_campaign=typescript)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
7
|
|
|
7
|
-
The REST API documentation can be found on [docs.botshield.ai](https://docs.botshield.ai). The full API of this library can be found in [api.md](api.md).
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
<br /><br />
|
|
10
|
+
> [!IMPORTANT]
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
<!-- Start Summary [summary] -->
|
|
13
|
+
## Summary
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
BotShield API: Human presence verification protocol.
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22botshield-sdk-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22botshield-sdk-mcp%22%5D%2C%22env%22%3A%7B%22BOTSHIELD_API_KEY%22%3A%22My%20API%20Key%22%2C%22BOTSHIELD_AGENT_KEY%22%3A%22My%20Agent%20Key%22%7D%7D)
|
|
17
|
+
**BotShield Human Verification** — a BotShield Gate (checkout, sign-up, any action moment) asks whether a live human is present. The client pre-check returns the two-result-state contract `result_state: human_verified | unavailable`; when presence is required the person confirms with a device biometric in the BotShield app and the gate receives an ES256 attestation JWT, verifiable against the public JWKS at /.well-known/jwks.json. No identity crosses the boundary.
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
**Agents Ask** — an agent proposes an action; the human confirms in the BotShield app and BotShield signs a Proof of Resolution JWT.
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
**Frontend:** load the BotShield client script from https://cdn.botshield.ai/sdk.js and place the botshield-verify element.
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
npm install botshield-sdk
|
|
24
|
-
```
|
|
23
|
+
**Backend SDK:** install `botshield-sdk` from npm and use `client.census.*`, `client.verification.*`, `client.actions.*`.
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
**Response envelope:** every operation answers HTTP 200 with `{ data: ... }`. Most carry the result one level deeper (`data.data`); `logout` and `verification/status` carry it directly. Handler errors are also HTTP 200 — `data.error = { message, statusCode }` — so check `data.error` before reading a result. HTTP 400 is reserved for input validation (`InvalidInputError`), 500 for unhandled failures.
|
|
26
|
+
<!-- End Summary [summary] -->
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
<!-- Start Table of Contents [toc] -->
|
|
29
|
+
## Table of Contents
|
|
30
|
+
<!-- $toc-max-depth=2 -->
|
|
31
|
+
* [botshield-sdk](#botshield-sdk)
|
|
32
|
+
* [SDK Installation](#sdk-installation)
|
|
33
|
+
* [Requirements](#requirements)
|
|
34
|
+
* [SDK Example Usage](#sdk-example-usage)
|
|
35
|
+
* [Authentication](#authentication)
|
|
36
|
+
* [Available Resources and Operations](#available-resources-and-operations)
|
|
37
|
+
* [Standalone functions](#standalone-functions)
|
|
38
|
+
* [Retries](#retries)
|
|
39
|
+
* [Error Handling](#error-handling)
|
|
40
|
+
* [Server Selection](#server-selection)
|
|
41
|
+
* [Custom HTTP Client](#custom-http-client)
|
|
42
|
+
* [Debugging](#debugging)
|
|
43
|
+
* [Development](#development)
|
|
44
|
+
* [Maturity](#maturity)
|
|
45
|
+
* [Contributions](#contributions)
|
|
29
46
|
|
|
30
|
-
<!--
|
|
31
|
-
```js
|
|
32
|
-
import BotShield from 'botshield-sdk';
|
|
47
|
+
<!-- End Table of Contents [toc] -->
|
|
33
48
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
environment: 'development', // defaults to 'production'
|
|
37
|
-
});
|
|
49
|
+
<!-- Start SDK Installation [installation] -->
|
|
50
|
+
## SDK Installation
|
|
38
51
|
|
|
39
|
-
|
|
40
|
-
return_url: 'https://yourapp.com/verified',
|
|
41
|
-
user_email: 'user@example.com',
|
|
42
|
-
});
|
|
52
|
+
The SDK can be installed with either [npm](https://www.npmjs.com/), [pnpm](https://pnpm.io/), [bun](https://bun.sh/) or [yarn](https://classic.yarnpkg.com/en/) package managers.
|
|
43
53
|
|
|
44
|
-
|
|
45
|
-
```
|
|
54
|
+
### NPM
|
|
46
55
|
|
|
47
|
-
|
|
56
|
+
```bash
|
|
57
|
+
npm add botshield-sdk
|
|
58
|
+
```
|
|
48
59
|
|
|
49
|
-
|
|
60
|
+
### PNPM
|
|
50
61
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
62
|
+
```bash
|
|
63
|
+
pnpm add botshield-sdk
|
|
64
|
+
```
|
|
54
65
|
|
|
55
|
-
|
|
56
|
-
apiKey: process.env['BOTSHIELD_API_KEY'], // This is the default and can be omitted
|
|
57
|
-
environment: 'development', // defaults to 'production'
|
|
58
|
-
});
|
|
66
|
+
### Bun
|
|
59
67
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
mode: 'linked-account',
|
|
63
|
-
return_url: 'https://yourapp.com/verified',
|
|
64
|
-
user_email: 'user@example.com',
|
|
65
|
-
};
|
|
66
|
-
const response: BotShield.SDKCreateVerificationLinkResponse =
|
|
67
|
-
await client.sdk.createVerificationLink(params);
|
|
68
|
+
```bash
|
|
69
|
+
bun add botshield-sdk
|
|
68
70
|
```
|
|
69
71
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
When the library is unable to connect to the API,
|
|
75
|
-
or if the API returns a non-success status code (i.e., 4xx or 5xx response),
|
|
76
|
-
a subclass of `APIError` will be thrown:
|
|
77
|
-
|
|
78
|
-
<!-- prettier-ignore -->
|
|
79
|
-
```ts
|
|
80
|
-
const response = await client.sdk
|
|
81
|
-
.createVerificationLink({
|
|
82
|
-
metadata: { cart_id: 'cart_123', action: 'checkout' },
|
|
83
|
-
mode: 'linked-account',
|
|
84
|
-
return_url: 'https://yourapp.com/verified',
|
|
85
|
-
user_email: 'user@example.com',
|
|
86
|
-
})
|
|
87
|
-
.catch(async (err) => {
|
|
88
|
-
if (err instanceof BotShield.APIError) {
|
|
89
|
-
console.log(err.status); // 400
|
|
90
|
-
console.log(err.name); // BadRequestError
|
|
91
|
-
console.log(err.headers); // {server: 'nginx', ...}
|
|
92
|
-
} else {
|
|
93
|
-
throw err;
|
|
94
|
-
}
|
|
95
|
-
});
|
|
72
|
+
### Yarn
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
yarn add botshield-sdk
|
|
96
76
|
```
|
|
97
77
|
|
|
98
|
-
|
|
78
|
+
> [!NOTE]
|
|
79
|
+
> This package is published with CommonJS and ES Modules (ESM) support.
|
|
99
80
|
|
|
100
|
-
| Status Code | Error Type |
|
|
101
|
-
| ----------- | -------------------------- |
|
|
102
|
-
| 400 | `BadRequestError` |
|
|
103
|
-
| 401 | `AuthenticationError` |
|
|
104
|
-
| 403 | `PermissionDeniedError` |
|
|
105
|
-
| 404 | `NotFoundError` |
|
|
106
|
-
| 422 | `UnprocessableEntityError` |
|
|
107
|
-
| 429 | `RateLimitError` |
|
|
108
|
-
| >=500 | `InternalServerError` |
|
|
109
|
-
| N/A | `APIConnectionError` |
|
|
110
81
|
|
|
111
|
-
###
|
|
82
|
+
### Model Context Protocol (MCP) Server
|
|
112
83
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
429 Rate Limit, and >=500 Internal errors will all be retried by default.
|
|
84
|
+
This SDK is also an installable MCP server where the various SDK methods are
|
|
85
|
+
exposed as tools that can be invoked by AI applications.
|
|
116
86
|
|
|
117
|
-
|
|
87
|
+
> Node.js v20 or greater is required to run the MCP server from npm.
|
|
118
88
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
// Configure the default for all requests:
|
|
122
|
-
const client = new BotShield({
|
|
123
|
-
maxRetries: 0, // default is 2
|
|
124
|
-
});
|
|
89
|
+
<details>
|
|
90
|
+
<summary>Claude installation steps</summary>
|
|
125
91
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
92
|
+
Add the following server definition to your `claude_desktop_config.json` file:
|
|
93
|
+
|
|
94
|
+
```json
|
|
95
|
+
{
|
|
96
|
+
"mcpServers": {
|
|
97
|
+
"BotShield": {
|
|
98
|
+
"command": "npx",
|
|
99
|
+
"args": [
|
|
100
|
+
"-y", "--package", "botshield-sdk",
|
|
101
|
+
"--",
|
|
102
|
+
"mcp", "start",
|
|
103
|
+
"--agent-key-auth", "...",
|
|
104
|
+
"--agent-key-auth1", "..."
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
135
109
|
```
|
|
136
110
|
|
|
137
|
-
|
|
111
|
+
</details>
|
|
112
|
+
|
|
113
|
+
<details>
|
|
114
|
+
<summary>Cursor installation steps</summary>
|
|
115
|
+
|
|
116
|
+
Create a `.cursor/mcp.json` file in your project root with the following content:
|
|
117
|
+
|
|
118
|
+
```json
|
|
119
|
+
{
|
|
120
|
+
"mcpServers": {
|
|
121
|
+
"BotShield": {
|
|
122
|
+
"command": "npx",
|
|
123
|
+
"args": [
|
|
124
|
+
"-y", "--package", "botshield-sdk",
|
|
125
|
+
"--",
|
|
126
|
+
"mcp", "start",
|
|
127
|
+
"--agent-key-auth", "...",
|
|
128
|
+
"--agent-key-auth1", "..."
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
```
|
|
138
134
|
|
|
139
|
-
|
|
135
|
+
</details>
|
|
140
136
|
|
|
141
|
-
|
|
142
|
-
```ts
|
|
143
|
-
// Configure the default for all requests:
|
|
144
|
-
const client = new BotShield({
|
|
145
|
-
timeout: 20 * 1000, // 20 seconds (default is 1 minute)
|
|
146
|
-
});
|
|
137
|
+
You can also run MCP servers as a standalone binary with no additional dependencies. You must pull these binaries from available Github releases:
|
|
147
138
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
139
|
+
```bash
|
|
140
|
+
curl -L -o mcp-server \
|
|
141
|
+
https://github.com/{org}/{repo}/releases/download/{tag}/mcp-server-bun-darwin-arm64 && \
|
|
142
|
+
chmod +x mcp-server
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
If the repo is a private repo you must add your Github PAT to download a release `-H "Authorization: Bearer {GITHUB_PAT}"`.
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
```json
|
|
149
|
+
{
|
|
150
|
+
"mcpServers": {
|
|
151
|
+
"Todos": {
|
|
152
|
+
"command": "./DOWNLOAD/PATH/mcp-server",
|
|
153
|
+
"args": [
|
|
154
|
+
"start"
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
157
159
|
```
|
|
158
160
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
## Advanced Usage
|
|
164
|
-
|
|
165
|
-
### Accessing raw Response data (e.g., headers)
|
|
166
|
-
|
|
167
|
-
The "raw" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.
|
|
168
|
-
This method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.
|
|
169
|
-
|
|
170
|
-
You can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.
|
|
171
|
-
Unlike `.asResponse()` this method consumes the body, returning once it is parsed.
|
|
172
|
-
|
|
173
|
-
<!-- prettier-ignore -->
|
|
174
|
-
```ts
|
|
175
|
-
const client = new BotShield();
|
|
176
|
-
|
|
177
|
-
const response = await client.sdk
|
|
178
|
-
.createVerificationLink({
|
|
179
|
-
metadata: { cart_id: 'cart_123', action: 'checkout' },
|
|
180
|
-
mode: 'linked-account',
|
|
181
|
-
return_url: 'https://yourapp.com/verified',
|
|
182
|
-
user_email: 'user@example.com',
|
|
183
|
-
})
|
|
184
|
-
.asResponse();
|
|
185
|
-
console.log(response.headers.get('X-My-Header'));
|
|
186
|
-
console.log(response.statusText); // access the underlying Response object
|
|
187
|
-
|
|
188
|
-
const { data: response, response: raw } = await client.sdk
|
|
189
|
-
.createVerificationLink({
|
|
190
|
-
metadata: { cart_id: 'cart_123', action: 'checkout' },
|
|
191
|
-
mode: 'linked-account',
|
|
192
|
-
return_url: 'https://yourapp.com/verified',
|
|
193
|
-
user_email: 'user@example.com',
|
|
194
|
-
})
|
|
195
|
-
.withResponse();
|
|
196
|
-
console.log(raw.headers.get('X-My-Header'));
|
|
197
|
-
console.log(response.data);
|
|
161
|
+
For a full list of server arguments, run:
|
|
162
|
+
|
|
163
|
+
```sh
|
|
164
|
+
npx -y --package botshield-sdk -- mcp start --help
|
|
198
165
|
```
|
|
166
|
+
<!-- End SDK Installation [installation] -->
|
|
199
167
|
|
|
200
|
-
|
|
168
|
+
<!-- Start Requirements [requirements] -->
|
|
169
|
+
## Requirements
|
|
201
170
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
> may change between releases.
|
|
171
|
+
For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
|
|
172
|
+
<!-- End Requirements [requirements] -->
|
|
205
173
|
|
|
206
|
-
|
|
174
|
+
<!-- Start SDK Example Usage [usage] -->
|
|
175
|
+
## SDK Example Usage
|
|
207
176
|
|
|
208
|
-
|
|
177
|
+
### Example
|
|
209
178
|
|
|
210
|
-
|
|
211
|
-
|
|
179
|
+
```typescript
|
|
180
|
+
import { BotShield } from "botshield-sdk";
|
|
212
181
|
|
|
213
|
-
|
|
214
|
-
import BotShield from 'botshield-sdk';
|
|
182
|
+
const botShield = new BotShield();
|
|
215
183
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
184
|
+
async function run() {
|
|
185
|
+
const result = await botShield.census.createSession({
|
|
186
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
187
|
+
}, {});
|
|
220
188
|
|
|
221
|
-
|
|
189
|
+
console.log(result);
|
|
190
|
+
}
|
|
222
191
|
|
|
223
|
-
|
|
224
|
-
- `'info'` - Show info messages, warnings, and errors
|
|
225
|
-
- `'warn'` - Show warnings and errors (default)
|
|
226
|
-
- `'error'` - Show only errors
|
|
227
|
-
- `'off'` - Disable all logging
|
|
192
|
+
run();
|
|
228
193
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
may still be visible.
|
|
194
|
+
```
|
|
195
|
+
<!-- End SDK Example Usage [usage] -->
|
|
232
196
|
|
|
233
|
-
|
|
197
|
+
<!-- Start Authentication [security] -->
|
|
198
|
+
## Authentication
|
|
234
199
|
|
|
235
|
-
|
|
236
|
-
Most logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.
|
|
200
|
+
### Per-Client Security Schemes
|
|
237
201
|
|
|
238
|
-
|
|
239
|
-
below the configured level will not be sent to your logger.
|
|
202
|
+
This SDK supports the following security schemes globally:
|
|
240
203
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
204
|
+
| Name | Type | Scheme |
|
|
205
|
+
| --------------- | ------ | ------- |
|
|
206
|
+
| `agentKeyAuth` | apiKey | API key |
|
|
207
|
+
| `agentKeyAuth1` | apiKey | API key |
|
|
244
208
|
|
|
245
|
-
|
|
209
|
+
You can set the security parameters through the `security` optional parameter when initializing the SDK client instance. The selected scheme will be used by default to authenticate with the API for all operations that support it. For example:
|
|
210
|
+
```typescript
|
|
211
|
+
import { BotShield } from "botshield-sdk";
|
|
246
212
|
|
|
247
|
-
const
|
|
248
|
-
|
|
249
|
-
|
|
213
|
+
const botShield = new BotShield({
|
|
214
|
+
security: {
|
|
215
|
+
agentKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
216
|
+
},
|
|
250
217
|
});
|
|
218
|
+
|
|
219
|
+
async function run() {
|
|
220
|
+
const result = await botShield.census.storeSignal({
|
|
221
|
+
siteKey: "<value>",
|
|
222
|
+
score: 229498,
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
console.log(result);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
run();
|
|
229
|
+
|
|
251
230
|
```
|
|
252
231
|
|
|
253
|
-
###
|
|
232
|
+
### Per-Operation Security Schemes
|
|
254
233
|
|
|
255
|
-
|
|
256
|
-
|
|
234
|
+
Some operations in this SDK require the security scheme to be specified at the request level. For example:
|
|
235
|
+
```typescript
|
|
236
|
+
import { BotShield } from "botshield-sdk";
|
|
257
237
|
|
|
258
|
-
|
|
238
|
+
const botShield = new BotShield();
|
|
259
239
|
|
|
260
|
-
|
|
261
|
-
|
|
240
|
+
async function run() {
|
|
241
|
+
const result = await botShield.census.createSession({
|
|
242
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
243
|
+
}, {});
|
|
244
|
+
|
|
245
|
+
console.log(result);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
run();
|
|
262
249
|
|
|
263
|
-
```ts
|
|
264
|
-
await client.post('/some/path', {
|
|
265
|
-
body: { some_prop: 'foo' },
|
|
266
|
-
query: { some_query_arg: 'bar' },
|
|
267
|
-
});
|
|
268
250
|
```
|
|
251
|
+
<!-- End Authentication [security] -->
|
|
269
252
|
|
|
270
|
-
|
|
253
|
+
<!-- Start Available Resources and Operations [operations] -->
|
|
254
|
+
## Available Resources and Operations
|
|
271
255
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
send will be sent as-is.
|
|
256
|
+
<details open>
|
|
257
|
+
<summary>Available methods</summary>
|
|
275
258
|
|
|
276
|
-
|
|
277
|
-
client.sdk.createVerificationLink({
|
|
278
|
-
// ...
|
|
279
|
-
// @ts-expect-error baz is not yet public
|
|
280
|
-
baz: 'undocumented option',
|
|
281
|
-
});
|
|
282
|
-
```
|
|
259
|
+
### [Actions](docs/sdks/actions/README.md)
|
|
283
260
|
|
|
284
|
-
|
|
285
|
-
|
|
261
|
+
* [proposeAction](docs/sdks/actions/README.md#proposeaction) - Propose an action for human confirmation
|
|
262
|
+
* [checkActionStatus](docs/sdks/actions/README.md#checkactionstatus) - Check action proposal status
|
|
263
|
+
* [cancelAction](docs/sdks/actions/README.md#cancelaction) - Cancel a queued action proposal
|
|
286
264
|
|
|
287
|
-
|
|
288
|
-
options.
|
|
265
|
+
### [Census](docs/sdks/census/README.md)
|
|
289
266
|
|
|
290
|
-
|
|
267
|
+
* [createSession](docs/sdks/census/README.md#createsession) - Create a grant token
|
|
268
|
+
* [createVerificationLink](docs/sdks/census/README.md#createverificationlink) - Create a verification request
|
|
269
|
+
* [verifyToken](docs/sdks/census/README.md#verifytoken) - Validate a verification token
|
|
270
|
+
* [storeSignal](docs/sdks/census/README.md#storesignal) - Store a Signal Pixel bot score
|
|
271
|
+
* [validateSignal](docs/sdks/census/README.md#validatesignal) - Validate a signal token
|
|
272
|
+
* [getPartnerConfig](docs/sdks/census/README.md#getpartnerconfig) - Get partner configuration
|
|
273
|
+
* [revokeVerification](docs/sdks/census/README.md#revokeverification) - Revoke a pending verification
|
|
274
|
+
* [logout](docs/sdks/census/README.md#logout) - Revoke a grant token
|
|
291
275
|
|
|
292
|
-
|
|
293
|
-
the response object, or cast the response object to the requisite type. Like the request params, we do not
|
|
294
|
-
validate or strip extra properties from the response from the API.
|
|
276
|
+
### [Verification](docs/sdks/verification/README.md)
|
|
295
277
|
|
|
296
|
-
|
|
278
|
+
* [getStatus](docs/sdks/verification/README.md#getstatus) - Check verification status
|
|
297
279
|
|
|
298
|
-
|
|
280
|
+
</details>
|
|
281
|
+
<!-- End Available Resources and Operations [operations] -->
|
|
299
282
|
|
|
300
|
-
|
|
283
|
+
<!-- Start Standalone functions [standalone-funcs] -->
|
|
284
|
+
## Standalone functions
|
|
301
285
|
|
|
302
|
-
|
|
303
|
-
|
|
286
|
+
All the methods listed above are available as standalone functions. These
|
|
287
|
+
functions are ideal for use in applications running in the browser, serverless
|
|
288
|
+
runtimes or other environments where application bundle size is a primary
|
|
289
|
+
concern. When using a bundler to build your application, all unused
|
|
290
|
+
functionality will be either excluded from the final bundle or tree-shaken away.
|
|
304
291
|
|
|
305
|
-
|
|
306
|
-
```
|
|
292
|
+
To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
|
|
307
293
|
|
|
308
|
-
|
|
294
|
+
<details>
|
|
309
295
|
|
|
310
|
-
|
|
311
|
-
import BotShield from 'botshield-sdk';
|
|
312
|
-
import fetch from 'my-fetch';
|
|
296
|
+
<summary>Available standalone functions</summary>
|
|
313
297
|
|
|
314
|
-
|
|
315
|
-
|
|
298
|
+
- [`actionsCancelAction`](docs/sdks/actions/README.md#cancelaction) - Cancel a queued action proposal
|
|
299
|
+
- [`actionsCheckActionStatus`](docs/sdks/actions/README.md#checkactionstatus) - Check action proposal status
|
|
300
|
+
- [`actionsProposeAction`](docs/sdks/actions/README.md#proposeaction) - Propose an action for human confirmation
|
|
301
|
+
- [`censusCreateSession`](docs/sdks/census/README.md#createsession) - Create a grant token
|
|
302
|
+
- [`censusCreateVerificationLink`](docs/sdks/census/README.md#createverificationlink) - Create a verification request
|
|
303
|
+
- [`censusGetPartnerConfig`](docs/sdks/census/README.md#getpartnerconfig) - Get partner configuration
|
|
304
|
+
- [`censusLogout`](docs/sdks/census/README.md#logout) - Revoke a grant token
|
|
305
|
+
- [`censusRevokeVerification`](docs/sdks/census/README.md#revokeverification) - Revoke a pending verification
|
|
306
|
+
- [`censusStoreSignal`](docs/sdks/census/README.md#storesignal) - Store a Signal Pixel bot score
|
|
307
|
+
- [`censusValidateSignal`](docs/sdks/census/README.md#validatesignal) - Validate a signal token
|
|
308
|
+
- [`censusVerifyToken`](docs/sdks/census/README.md#verifytoken) - Validate a verification token
|
|
309
|
+
- [`verificationGetStatus`](docs/sdks/verification/README.md#getstatus) - Check verification status
|
|
310
|
+
|
|
311
|
+
</details>
|
|
312
|
+
<!-- End Standalone functions [standalone-funcs] -->
|
|
313
|
+
|
|
314
|
+
<!-- Start Retries [retries] -->
|
|
315
|
+
## Retries
|
|
316
|
+
|
|
317
|
+
Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
|
|
318
|
+
|
|
319
|
+
To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
|
|
320
|
+
```typescript
|
|
321
|
+
import { BotShield } from "botshield-sdk";
|
|
322
|
+
|
|
323
|
+
const botShield = new BotShield();
|
|
316
324
|
|
|
317
|
-
|
|
325
|
+
async function run() {
|
|
326
|
+
const result = await botShield.census.createSession(
|
|
327
|
+
{
|
|
328
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
329
|
+
},
|
|
330
|
+
{},
|
|
331
|
+
{
|
|
332
|
+
retries: {
|
|
333
|
+
strategy: "backoff",
|
|
334
|
+
backoff: {
|
|
335
|
+
initialInterval: 1,
|
|
336
|
+
maxInterval: 50,
|
|
337
|
+
exponent: 1.1,
|
|
338
|
+
maxElapsedTime: 100,
|
|
339
|
+
},
|
|
340
|
+
retryConnectionErrors: false,
|
|
341
|
+
},
|
|
342
|
+
},
|
|
343
|
+
);
|
|
318
344
|
|
|
319
|
-
|
|
345
|
+
console.log(result);
|
|
346
|
+
}
|
|
320
347
|
|
|
321
|
-
|
|
322
|
-
import BotShield from 'botshield-sdk';
|
|
348
|
+
run();
|
|
323
349
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
|
|
353
|
+
```typescript
|
|
354
|
+
import { BotShield } from "botshield-sdk";
|
|
355
|
+
|
|
356
|
+
const botShield = new BotShield({
|
|
357
|
+
retryConfig: {
|
|
358
|
+
strategy: "backoff",
|
|
359
|
+
backoff: {
|
|
360
|
+
initialInterval: 1,
|
|
361
|
+
maxInterval: 50,
|
|
362
|
+
exponent: 1.1,
|
|
363
|
+
maxElapsedTime: 100,
|
|
364
|
+
},
|
|
365
|
+
retryConnectionErrors: false,
|
|
327
366
|
},
|
|
328
367
|
});
|
|
368
|
+
|
|
369
|
+
async function run() {
|
|
370
|
+
const result = await botShield.census.createSession({
|
|
371
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
372
|
+
}, {});
|
|
373
|
+
|
|
374
|
+
console.log(result);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
run();
|
|
378
|
+
|
|
379
|
+
```
|
|
380
|
+
<!-- End Retries [retries] -->
|
|
381
|
+
|
|
382
|
+
<!-- Start Error Handling [errors] -->
|
|
383
|
+
## Error Handling
|
|
384
|
+
|
|
385
|
+
[`BotShieldError`](./src/models/errors/bot-shield-error.ts) is the base class for all HTTP error responses. It has the following properties:
|
|
386
|
+
|
|
387
|
+
| Property | Type | Description |
|
|
388
|
+
| ------------------- | ---------- | --------------------------------------------------------------------------------------- |
|
|
389
|
+
| `error.message` | `string` | Error message |
|
|
390
|
+
| `error.statusCode` | `number` | HTTP response status code eg `404` |
|
|
391
|
+
| `error.headers` | `Headers` | HTTP response headers |
|
|
392
|
+
| `error.body` | `string` | HTTP body. Can be empty string if no body is returned. |
|
|
393
|
+
| `error.rawResponse` | `Response` | Raw HTTP response |
|
|
394
|
+
| `error.data$` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). |
|
|
395
|
+
|
|
396
|
+
### Example
|
|
397
|
+
```typescript
|
|
398
|
+
import { BotShield } from "botshield-sdk";
|
|
399
|
+
import * as errors from "botshield-sdk/models/errors";
|
|
400
|
+
|
|
401
|
+
const botShield = new BotShield();
|
|
402
|
+
|
|
403
|
+
async function run() {
|
|
404
|
+
try {
|
|
405
|
+
const result = await botShield.census.createSession({
|
|
406
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
407
|
+
}, {});
|
|
408
|
+
|
|
409
|
+
console.log(result);
|
|
410
|
+
} catch (error) {
|
|
411
|
+
// The base class for HTTP error responses
|
|
412
|
+
if (error instanceof errors.BotShieldError) {
|
|
413
|
+
console.log(error.message);
|
|
414
|
+
console.log(error.statusCode);
|
|
415
|
+
console.log(error.body);
|
|
416
|
+
console.log(error.headers);
|
|
417
|
+
|
|
418
|
+
// Depending on the method different errors may be thrown
|
|
419
|
+
if (error instanceof errors.InvalidInputError) {
|
|
420
|
+
console.log(error.data$.message); // string
|
|
421
|
+
console.log(error.data$.input); // { [k: string]: any }
|
|
422
|
+
console.log(error.data$.errors); // InvalidInputErrorError[]
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
run();
|
|
429
|
+
|
|
329
430
|
```
|
|
330
431
|
|
|
331
|
-
|
|
432
|
+
### Error Classes
|
|
433
|
+
**Primary errors:**
|
|
434
|
+
* [`BotShieldError`](./src/models/errors/bot-shield-error.ts): The base class for HTTP error responses.
|
|
435
|
+
* [`InvalidInputError`](./src/models/errors/invalid-input-error.ts): Invalid input. Status code `400`.
|
|
436
|
+
* [`ErrorResponse`](./src/models/errors/error-response.ts): Internal server error. Status code `500`.
|
|
332
437
|
|
|
333
|
-
|
|
334
|
-
options to requests:
|
|
438
|
+
<details><summary>Less common errors (6)</summary>
|
|
335
439
|
|
|
336
|
-
<
|
|
440
|
+
<br />
|
|
337
441
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
442
|
+
**Network errors:**
|
|
443
|
+
* [`ConnectionError`](./src/models/errors/http-client-errors.ts): HTTP client was unable to make a request to a server.
|
|
444
|
+
* [`RequestTimeoutError`](./src/models/errors/http-client-errors.ts): HTTP request timed out due to an AbortSignal signal.
|
|
445
|
+
* [`RequestAbortedError`](./src/models/errors/http-client-errors.ts): HTTP request was aborted by the client.
|
|
446
|
+
* [`InvalidRequestError`](./src/models/errors/http-client-errors.ts): Any input used to create a request is invalid.
|
|
447
|
+
* [`UnexpectedClientError`](./src/models/errors/http-client-errors.ts): Unrecognised or unexpected error.
|
|
341
448
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
449
|
+
|
|
450
|
+
**Inherit from [`BotShieldError`](./src/models/errors/bot-shield-error.ts)**:
|
|
451
|
+
* [`ResponseValidationError`](./src/models/errors/response-validation-error.ts): Type mismatch between the data returned from the server and the structure expected by the SDK. See `error.rawValue` for the raw value and `error.pretty()` for a nicely formatted multi-line string.
|
|
452
|
+
|
|
453
|
+
</details>
|
|
454
|
+
<!-- End Error Handling [errors] -->
|
|
455
|
+
|
|
456
|
+
<!-- Start Server Selection [server] -->
|
|
457
|
+
## Server Selection
|
|
458
|
+
|
|
459
|
+
### Select Server by Index
|
|
460
|
+
|
|
461
|
+
You can override the default server globally by passing a server index to the `serverIdx: number` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:
|
|
462
|
+
|
|
463
|
+
| # | Server | Description |
|
|
464
|
+
| --- | ------------------------------------- | ----------------- |
|
|
465
|
+
| 0 | `http://localhost:9991/operations` | Local development |
|
|
466
|
+
| 1 | `https://api.botshield.ai/operations` | Production |
|
|
467
|
+
|
|
468
|
+
#### Example
|
|
469
|
+
|
|
470
|
+
```typescript
|
|
471
|
+
import { BotShield } from "botshield-sdk";
|
|
472
|
+
|
|
473
|
+
const botShield = new BotShield({
|
|
474
|
+
serverIdx: 0,
|
|
347
475
|
});
|
|
476
|
+
|
|
477
|
+
async function run() {
|
|
478
|
+
const result = await botShield.census.createSession({
|
|
479
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
480
|
+
}, {});
|
|
481
|
+
|
|
482
|
+
console.log(result);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
run();
|
|
486
|
+
|
|
348
487
|
```
|
|
349
488
|
|
|
350
|
-
|
|
489
|
+
### Override Server URL Per-Client
|
|
351
490
|
|
|
352
|
-
|
|
353
|
-
|
|
491
|
+
The default server can also be overridden globally by passing a URL to the `serverURL: string` optional parameter when initializing the SDK client instance. For example:
|
|
492
|
+
```typescript
|
|
493
|
+
import { BotShield } from "botshield-sdk";
|
|
354
494
|
|
|
355
|
-
const
|
|
356
|
-
|
|
357
|
-
proxy: 'http://localhost:8888',
|
|
358
|
-
},
|
|
495
|
+
const botShield = new BotShield({
|
|
496
|
+
serverURL: "https://api.botshield.ai/operations",
|
|
359
497
|
});
|
|
498
|
+
|
|
499
|
+
async function run() {
|
|
500
|
+
const result = await botShield.census.createSession({
|
|
501
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
502
|
+
}, {});
|
|
503
|
+
|
|
504
|
+
console.log(result);
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
run();
|
|
508
|
+
|
|
360
509
|
```
|
|
510
|
+
<!-- End Server Selection [server] -->
|
|
511
|
+
|
|
512
|
+
<!-- Start Custom HTTP Client [http-client] -->
|
|
513
|
+
## Custom HTTP Client
|
|
514
|
+
|
|
515
|
+
The TypeScript SDK makes API calls using an `HTTPClient` that wraps the native
|
|
516
|
+
[Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). This
|
|
517
|
+
client is a thin wrapper around `fetch` and provides the ability to attach hooks
|
|
518
|
+
around the request lifecycle that can be used to modify the request or handle
|
|
519
|
+
errors and response.
|
|
520
|
+
|
|
521
|
+
The `HTTPClient` constructor takes an optional `fetcher` argument that can be
|
|
522
|
+
used to integrate a third-party HTTP client or when writing tests to mock out
|
|
523
|
+
the HTTP client and feed in fixtures.
|
|
524
|
+
|
|
525
|
+
The following example shows how to:
|
|
526
|
+
- route requests through a proxy server using [undici](https://www.npmjs.com/package/undici)'s ProxyAgent
|
|
527
|
+
- use the `"beforeRequest"` hook to add a custom header and a timeout to requests
|
|
528
|
+
- use the `"requestError"` hook to log errors
|
|
529
|
+
|
|
530
|
+
```typescript
|
|
531
|
+
import { BotShield } from "botshield-sdk";
|
|
532
|
+
import { ProxyAgent } from "undici";
|
|
533
|
+
import { HTTPClient } from "botshield-sdk/lib/http";
|
|
534
|
+
|
|
535
|
+
const dispatcher = new ProxyAgent("http://proxy.example.com:8080");
|
|
536
|
+
|
|
537
|
+
const httpClient = new HTTPClient({
|
|
538
|
+
// 'fetcher' takes a function that has the same signature as native 'fetch'.
|
|
539
|
+
fetcher: (input, init) =>
|
|
540
|
+
// 'dispatcher' is specific to undici and not part of the standard Fetch API.
|
|
541
|
+
fetch(input, { ...init, dispatcher } as RequestInit),
|
|
542
|
+
});
|
|
361
543
|
|
|
362
|
-
|
|
544
|
+
httpClient.addHook("beforeRequest", (request) => {
|
|
545
|
+
const nextRequest = new Request(request, {
|
|
546
|
+
signal: request.signal || AbortSignal.timeout(5000)
|
|
547
|
+
});
|
|
363
548
|
|
|
364
|
-
|
|
365
|
-
import BotShield from 'npm:botshield-sdk';
|
|
549
|
+
nextRequest.headers.set("x-custom-header", "custom value");
|
|
366
550
|
|
|
367
|
-
|
|
368
|
-
const client = new BotShield({
|
|
369
|
-
fetchOptions: {
|
|
370
|
-
client: httpClient,
|
|
371
|
-
},
|
|
551
|
+
return nextRequest;
|
|
372
552
|
});
|
|
373
|
-
```
|
|
374
553
|
|
|
375
|
-
|
|
554
|
+
httpClient.addHook("requestError", (error, request) => {
|
|
555
|
+
console.group("Request Error");
|
|
556
|
+
console.log("Reason:", `${error}`);
|
|
557
|
+
console.log("Endpoint:", `${request.method} ${request.url}`);
|
|
558
|
+
console.groupEnd();
|
|
559
|
+
});
|
|
376
560
|
|
|
377
|
-
|
|
561
|
+
const sdk = new BotShield({ httpClient: httpClient });
|
|
562
|
+
```
|
|
563
|
+
<!-- End Custom HTTP Client [http-client] -->
|
|
378
564
|
|
|
379
|
-
|
|
565
|
+
<!-- Start Debugging [debug] -->
|
|
566
|
+
## Debugging
|
|
380
567
|
|
|
381
|
-
|
|
382
|
-
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_
|
|
383
|
-
3. Changes that we do not expect to impact the vast majority of users in practice.
|
|
568
|
+
You can setup your SDK to emit debug logs for SDK requests and responses.
|
|
384
569
|
|
|
385
|
-
|
|
570
|
+
You can pass a logger that matches `console`'s interface as an SDK option.
|
|
386
571
|
|
|
387
|
-
|
|
572
|
+
> [!WARNING]
|
|
573
|
+
> Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production.
|
|
388
574
|
|
|
389
|
-
|
|
575
|
+
```typescript
|
|
576
|
+
import { BotShield } from "botshield-sdk";
|
|
577
|
+
|
|
578
|
+
const sdk = new BotShield({ debugLogger: console });
|
|
579
|
+
```
|
|
580
|
+
<!-- End Debugging [debug] -->
|
|
390
581
|
|
|
391
|
-
|
|
582
|
+
<!-- Placeholder for Future Speakeasy SDK Sections -->
|
|
392
583
|
|
|
393
|
-
|
|
584
|
+
# Development
|
|
394
585
|
|
|
395
|
-
|
|
396
|
-
- Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.
|
|
397
|
-
- Deno v1.28.0 or higher.
|
|
398
|
-
- Bun 1.0 or later.
|
|
399
|
-
- Cloudflare Workers.
|
|
400
|
-
- Vercel Edge Runtime.
|
|
401
|
-
- Jest 28 or greater with the `"node"` environment (`"jsdom"` is not supported at this time).
|
|
402
|
-
- Nitro v2.6 or greater.
|
|
586
|
+
## Maturity
|
|
403
587
|
|
|
404
|
-
|
|
588
|
+
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
|
|
589
|
+
to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
|
|
590
|
+
looking for the latest version.
|
|
405
591
|
|
|
406
|
-
|
|
592
|
+
## Contributions
|
|
407
593
|
|
|
408
|
-
|
|
594
|
+
While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation.
|
|
595
|
+
We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.
|
|
409
596
|
|
|
410
|
-
|
|
597
|
+
### SDK Created by [Speakeasy](https://www.speakeasy.com/?utm_source=botshield-sdk&utm_campaign=typescript)
|