botshield-sdk 1.8.3 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/FUNCTIONS.md +87 -0
- package/README.md +485 -295
- package/RUNTIMES.md +48 -0
- package/bin/mcp-server.js +52962 -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 +138 -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 +135 -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 +138 -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 +54 -0
- package/dist/commonjs/lib/encodings.d.ts.map +1 -0
- package/dist/commonjs/lib/encodings.js +406 -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 +167 -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 +149 -0
- package/dist/commonjs/mcp-server/cli/start/command.js.map +1 -0
- package/dist/commonjs/mcp-server/cli/start/impl.d.ts +20 -0
- package/dist/commonjs/mcp-server/cli/start/impl.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/cli/start/impl.js +112 -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 +210 -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 +128 -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 +181 -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 +122 -0
- package/dist/commonjs/models/operations/sdk-verify-token.d.ts.map +1 -0
- package/dist/commonjs/models/operations/sdk-verify-token.js +188 -0
- package/dist/commonjs/models/operations/sdk-verify-token.js.map +1 -0
- package/dist/commonjs/models/operations/verification-get-status.d.ts +153 -0
- package/dist/commonjs/models/operations/verification-get-status.d.ts.map +1 -0
- package/dist/commonjs/models/operations/verification-get-status.js +234 -0
- package/dist/commonjs/models/operations/verification-get-status.js.map +1 -0
- package/dist/commonjs/models/security.d.ts +21 -0
- package/dist/commonjs/models/security.d.ts.map +1 -0
- package/dist/commonjs/models/security.js +63 -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 +102 -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 +99 -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 +102 -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 +54 -0
- package/dist/esm/lib/encodings.d.ts.map +1 -0
- package/dist/esm/lib/encodings.js +391 -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 +160 -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 +113 -0
- package/dist/esm/mcp-server/cli/start/command.js.map +1 -0
- package/dist/esm/mcp-server/cli/start/impl.d.ts +20 -0
- package/dist/esm/mcp-server/cli/start/impl.d.ts.map +1 -0
- package/dist/esm/mcp-server/cli/start/impl.js +106 -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 +210 -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 +128 -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 +133 -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 +122 -0
- package/dist/esm/models/operations/sdk-verify-token.d.ts.map +1 -0
- package/dist/esm/models/operations/sdk-verify-token.js +140 -0
- package/dist/esm/models/operations/sdk-verify-token.js.map +1 -0
- package/dist/esm/models/operations/verification-get-status.d.ts +153 -0
- package/dist/esm/models/operations/verification-get-status.d.ts.map +1 -0
- package/dist/esm/models/operations/verification-get-status.js +188 -0
- package/dist/esm/models/operations/verification-get-status.js.map +1 -0
- package/dist/esm/models/security.d.ts +21 -0
- package/dist/esm/models/security.d.ts.map +1 -0
- package/dist/esm/models/security.js +25 -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 +203 -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 +198 -0
- package/src/funcs/verification-get-status.ts +203 -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 +529 -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 +293 -0
- package/src/lib/url.ts +35 -0
- package/src/mcp-server/cli/start/command.ts +117 -0
- package/src/mcp-server/cli/start/impl.ts +144 -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 +540 -0
- package/src/models/operations/sdk-get-partner-config.ts +349 -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 +347 -0
- package/src/models/operations/verification-get-status.ts +424 -0
- package/src/models/security.ts +56 -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 -262
- 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,600 @@
|
|
|
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
|
+
**Census** — a partner 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.sdk.*`, `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
|
+
"--agent-key-auth2", "..."
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
135
110
|
```
|
|
136
111
|
|
|
137
|
-
|
|
112
|
+
</details>
|
|
113
|
+
|
|
114
|
+
<details>
|
|
115
|
+
<summary>Cursor installation steps</summary>
|
|
116
|
+
|
|
117
|
+
Create a `.cursor/mcp.json` file in your project root with the following content:
|
|
118
|
+
|
|
119
|
+
```json
|
|
120
|
+
{
|
|
121
|
+
"mcpServers": {
|
|
122
|
+
"BotShield": {
|
|
123
|
+
"command": "npx",
|
|
124
|
+
"args": [
|
|
125
|
+
"-y", "--package", "botshield-sdk",
|
|
126
|
+
"--",
|
|
127
|
+
"mcp", "start",
|
|
128
|
+
"--agent-key-auth", "...",
|
|
129
|
+
"--agent-key-auth1", "...",
|
|
130
|
+
"--agent-key-auth2", "..."
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
```
|
|
138
136
|
|
|
139
|
-
|
|
137
|
+
</details>
|
|
140
138
|
|
|
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
|
-
});
|
|
139
|
+
You can also run MCP servers as a standalone binary with no additional dependencies. You must pull these binaries from available Github releases:
|
|
147
140
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
141
|
+
```bash
|
|
142
|
+
curl -L -o mcp-server \
|
|
143
|
+
https://github.com/{org}/{repo}/releases/download/{tag}/mcp-server-bun-darwin-arm64 && \
|
|
144
|
+
chmod +x mcp-server
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
If the repo is a private repo you must add your Github PAT to download a release `-H "Authorization: Bearer {GITHUB_PAT}"`.
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
```json
|
|
151
|
+
{
|
|
152
|
+
"mcpServers": {
|
|
153
|
+
"Todos": {
|
|
154
|
+
"command": "./DOWNLOAD/PATH/mcp-server",
|
|
155
|
+
"args": [
|
|
156
|
+
"start"
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
157
161
|
```
|
|
158
162
|
|
|
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);
|
|
163
|
+
For a full list of server arguments, run:
|
|
164
|
+
|
|
165
|
+
```sh
|
|
166
|
+
npx -y --package botshield-sdk -- mcp start --help
|
|
198
167
|
```
|
|
168
|
+
<!-- End SDK Installation [installation] -->
|
|
199
169
|
|
|
200
|
-
|
|
170
|
+
<!-- Start Requirements [requirements] -->
|
|
171
|
+
## Requirements
|
|
201
172
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
> may change between releases.
|
|
173
|
+
For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
|
|
174
|
+
<!-- End Requirements [requirements] -->
|
|
205
175
|
|
|
206
|
-
|
|
176
|
+
<!-- Start SDK Example Usage [usage] -->
|
|
177
|
+
## SDK Example Usage
|
|
207
178
|
|
|
208
|
-
|
|
179
|
+
### Example
|
|
209
180
|
|
|
210
|
-
|
|
211
|
-
|
|
181
|
+
```typescript
|
|
182
|
+
import { BotShield } from "botshield-sdk";
|
|
212
183
|
|
|
213
|
-
|
|
214
|
-
import BotShield from 'botshield-sdk';
|
|
184
|
+
const botShield = new BotShield();
|
|
215
185
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
186
|
+
async function run() {
|
|
187
|
+
const result = await botShield.census.createSession({
|
|
188
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
189
|
+
}, {});
|
|
220
190
|
|
|
221
|
-
|
|
191
|
+
console.log(result);
|
|
192
|
+
}
|
|
222
193
|
|
|
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
|
|
194
|
+
run();
|
|
228
195
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
may still be visible.
|
|
196
|
+
```
|
|
197
|
+
<!-- End SDK Example Usage [usage] -->
|
|
232
198
|
|
|
233
|
-
|
|
199
|
+
<!-- Start Authentication [security] -->
|
|
200
|
+
## Authentication
|
|
234
201
|
|
|
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.
|
|
202
|
+
### Per-Client Security Schemes
|
|
237
203
|
|
|
238
|
-
|
|
239
|
-
below the configured level will not be sent to your logger.
|
|
204
|
+
This SDK supports the following security schemes globally:
|
|
240
205
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
206
|
+
| Name | Type | Scheme |
|
|
207
|
+
| --------------- | ------ | ------- |
|
|
208
|
+
| `agentKeyAuth` | apiKey | API key |
|
|
209
|
+
| `agentKeyAuth1` | apiKey | API key |
|
|
210
|
+
| `agentKeyAuth2` | apiKey | API key |
|
|
244
211
|
|
|
245
|
-
|
|
212
|
+
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:
|
|
213
|
+
```typescript
|
|
214
|
+
import { BotShield } from "botshield-sdk";
|
|
246
215
|
|
|
247
|
-
const
|
|
248
|
-
|
|
249
|
-
|
|
216
|
+
const botShield = new BotShield({
|
|
217
|
+
security: {
|
|
218
|
+
agentKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
219
|
+
},
|
|
250
220
|
});
|
|
221
|
+
|
|
222
|
+
async function run() {
|
|
223
|
+
const result = await botShield.census.storeSignal({
|
|
224
|
+
siteKey: "<value>",
|
|
225
|
+
score: 229498,
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
console.log(result);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
run();
|
|
232
|
+
|
|
251
233
|
```
|
|
252
234
|
|
|
253
|
-
###
|
|
235
|
+
### Per-Operation Security Schemes
|
|
254
236
|
|
|
255
|
-
|
|
256
|
-
|
|
237
|
+
Some operations in this SDK require the security scheme to be specified at the request level. For example:
|
|
238
|
+
```typescript
|
|
239
|
+
import { BotShield } from "botshield-sdk";
|
|
257
240
|
|
|
258
|
-
|
|
241
|
+
const botShield = new BotShield();
|
|
259
242
|
|
|
260
|
-
|
|
261
|
-
|
|
243
|
+
async function run() {
|
|
244
|
+
const result = await botShield.census.createSession({
|
|
245
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
246
|
+
}, {});
|
|
247
|
+
|
|
248
|
+
console.log(result);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
run();
|
|
262
252
|
|
|
263
|
-
```ts
|
|
264
|
-
await client.post('/some/path', {
|
|
265
|
-
body: { some_prop: 'foo' },
|
|
266
|
-
query: { some_query_arg: 'bar' },
|
|
267
|
-
});
|
|
268
253
|
```
|
|
254
|
+
<!-- End Authentication [security] -->
|
|
269
255
|
|
|
270
|
-
|
|
256
|
+
<!-- Start Available Resources and Operations [operations] -->
|
|
257
|
+
## Available Resources and Operations
|
|
271
258
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
send will be sent as-is.
|
|
259
|
+
<details open>
|
|
260
|
+
<summary>Available methods</summary>
|
|
275
261
|
|
|
276
|
-
|
|
277
|
-
client.sdk.createVerificationLink({
|
|
278
|
-
// ...
|
|
279
|
-
// @ts-expect-error baz is not yet public
|
|
280
|
-
baz: 'undocumented option',
|
|
281
|
-
});
|
|
282
|
-
```
|
|
262
|
+
### [Actions](docs/sdks/actions/README.md)
|
|
283
263
|
|
|
284
|
-
|
|
285
|
-
|
|
264
|
+
* [proposeAction](docs/sdks/actions/README.md#proposeaction) - Propose an action for human confirmation
|
|
265
|
+
* [checkActionStatus](docs/sdks/actions/README.md#checkactionstatus) - Check action proposal status
|
|
266
|
+
* [cancelAction](docs/sdks/actions/README.md#cancelaction) - Cancel a queued action proposal
|
|
286
267
|
|
|
287
|
-
|
|
288
|
-
options.
|
|
268
|
+
### [Census](docs/sdks/census/README.md)
|
|
289
269
|
|
|
290
|
-
|
|
270
|
+
* [createSession](docs/sdks/census/README.md#createsession) - Create an Anchor Grant Window
|
|
271
|
+
* [createVerificationLink](docs/sdks/census/README.md#createverificationlink) - Create a verification request
|
|
272
|
+
* [verifyToken](docs/sdks/census/README.md#verifytoken) - Validate a verification token
|
|
273
|
+
* [storeSignal](docs/sdks/census/README.md#storesignal) - Store a Signal Pixel bot score
|
|
274
|
+
* [validateSignal](docs/sdks/census/README.md#validatesignal) - Validate a signal token
|
|
275
|
+
* [getPartnerConfig](docs/sdks/census/README.md#getpartnerconfig) - Get partner configuration
|
|
276
|
+
* [revokeVerification](docs/sdks/census/README.md#revokeverification) - Revoke a pending verification
|
|
277
|
+
* [logout](docs/sdks/census/README.md#logout) - Revoke an Anchor Grant Window token
|
|
291
278
|
|
|
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.
|
|
279
|
+
### [Verification](docs/sdks/verification/README.md)
|
|
295
280
|
|
|
296
|
-
|
|
281
|
+
* [getStatus](docs/sdks/verification/README.md#getstatus) - Check verification status
|
|
297
282
|
|
|
298
|
-
|
|
283
|
+
</details>
|
|
284
|
+
<!-- End Available Resources and Operations [operations] -->
|
|
299
285
|
|
|
300
|
-
|
|
286
|
+
<!-- Start Standalone functions [standalone-funcs] -->
|
|
287
|
+
## Standalone functions
|
|
301
288
|
|
|
302
|
-
|
|
303
|
-
|
|
289
|
+
All the methods listed above are available as standalone functions. These
|
|
290
|
+
functions are ideal for use in applications running in the browser, serverless
|
|
291
|
+
runtimes or other environments where application bundle size is a primary
|
|
292
|
+
concern. When using a bundler to build your application, all unused
|
|
293
|
+
functionality will be either excluded from the final bundle or tree-shaken away.
|
|
304
294
|
|
|
305
|
-
|
|
306
|
-
```
|
|
295
|
+
To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
|
|
307
296
|
|
|
308
|
-
|
|
297
|
+
<details>
|
|
309
298
|
|
|
310
|
-
|
|
311
|
-
import BotShield from 'botshield-sdk';
|
|
312
|
-
import fetch from 'my-fetch';
|
|
299
|
+
<summary>Available standalone functions</summary>
|
|
313
300
|
|
|
314
|
-
|
|
315
|
-
|
|
301
|
+
- [`actionsCancelAction`](docs/sdks/actions/README.md#cancelaction) - Cancel a queued action proposal
|
|
302
|
+
- [`actionsCheckActionStatus`](docs/sdks/actions/README.md#checkactionstatus) - Check action proposal status
|
|
303
|
+
- [`actionsProposeAction`](docs/sdks/actions/README.md#proposeaction) - Propose an action for human confirmation
|
|
304
|
+
- [`censusCreateSession`](docs/sdks/census/README.md#createsession) - Create an Anchor Grant Window
|
|
305
|
+
- [`censusCreateVerificationLink`](docs/sdks/census/README.md#createverificationlink) - Create a verification request
|
|
306
|
+
- [`censusGetPartnerConfig`](docs/sdks/census/README.md#getpartnerconfig) - Get partner configuration
|
|
307
|
+
- [`censusLogout`](docs/sdks/census/README.md#logout) - Revoke an Anchor Grant Window token
|
|
308
|
+
- [`censusRevokeVerification`](docs/sdks/census/README.md#revokeverification) - Revoke a pending verification
|
|
309
|
+
- [`censusStoreSignal`](docs/sdks/census/README.md#storesignal) - Store a Signal Pixel bot score
|
|
310
|
+
- [`censusValidateSignal`](docs/sdks/census/README.md#validatesignal) - Validate a signal token
|
|
311
|
+
- [`censusVerifyToken`](docs/sdks/census/README.md#verifytoken) - Validate a verification token
|
|
312
|
+
- [`verificationGetStatus`](docs/sdks/verification/README.md#getstatus) - Check verification status
|
|
313
|
+
|
|
314
|
+
</details>
|
|
315
|
+
<!-- End Standalone functions [standalone-funcs] -->
|
|
316
|
+
|
|
317
|
+
<!-- Start Retries [retries] -->
|
|
318
|
+
## Retries
|
|
319
|
+
|
|
320
|
+
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.
|
|
321
|
+
|
|
322
|
+
To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
|
|
323
|
+
```typescript
|
|
324
|
+
import { BotShield } from "botshield-sdk";
|
|
325
|
+
|
|
326
|
+
const botShield = new BotShield();
|
|
316
327
|
|
|
317
|
-
|
|
328
|
+
async function run() {
|
|
329
|
+
const result = await botShield.census.createSession(
|
|
330
|
+
{
|
|
331
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
332
|
+
},
|
|
333
|
+
{},
|
|
334
|
+
{
|
|
335
|
+
retries: {
|
|
336
|
+
strategy: "backoff",
|
|
337
|
+
backoff: {
|
|
338
|
+
initialInterval: 1,
|
|
339
|
+
maxInterval: 50,
|
|
340
|
+
exponent: 1.1,
|
|
341
|
+
maxElapsedTime: 100,
|
|
342
|
+
},
|
|
343
|
+
retryConnectionErrors: false,
|
|
344
|
+
},
|
|
345
|
+
},
|
|
346
|
+
);
|
|
318
347
|
|
|
319
|
-
|
|
348
|
+
console.log(result);
|
|
349
|
+
}
|
|
320
350
|
|
|
321
|
-
|
|
322
|
-
import BotShield from 'botshield-sdk';
|
|
351
|
+
run();
|
|
323
352
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
|
|
356
|
+
```typescript
|
|
357
|
+
import { BotShield } from "botshield-sdk";
|
|
358
|
+
|
|
359
|
+
const botShield = new BotShield({
|
|
360
|
+
retryConfig: {
|
|
361
|
+
strategy: "backoff",
|
|
362
|
+
backoff: {
|
|
363
|
+
initialInterval: 1,
|
|
364
|
+
maxInterval: 50,
|
|
365
|
+
exponent: 1.1,
|
|
366
|
+
maxElapsedTime: 100,
|
|
367
|
+
},
|
|
368
|
+
retryConnectionErrors: false,
|
|
327
369
|
},
|
|
328
370
|
});
|
|
371
|
+
|
|
372
|
+
async function run() {
|
|
373
|
+
const result = await botShield.census.createSession({
|
|
374
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
375
|
+
}, {});
|
|
376
|
+
|
|
377
|
+
console.log(result);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
run();
|
|
381
|
+
|
|
382
|
+
```
|
|
383
|
+
<!-- End Retries [retries] -->
|
|
384
|
+
|
|
385
|
+
<!-- Start Error Handling [errors] -->
|
|
386
|
+
## Error Handling
|
|
387
|
+
|
|
388
|
+
[`BotShieldError`](./src/models/errors/bot-shield-error.ts) is the base class for all HTTP error responses. It has the following properties:
|
|
389
|
+
|
|
390
|
+
| Property | Type | Description |
|
|
391
|
+
| ------------------- | ---------- | --------------------------------------------------------------------------------------- |
|
|
392
|
+
| `error.message` | `string` | Error message |
|
|
393
|
+
| `error.statusCode` | `number` | HTTP response status code eg `404` |
|
|
394
|
+
| `error.headers` | `Headers` | HTTP response headers |
|
|
395
|
+
| `error.body` | `string` | HTTP body. Can be empty string if no body is returned. |
|
|
396
|
+
| `error.rawResponse` | `Response` | Raw HTTP response |
|
|
397
|
+
| `error.data$` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). |
|
|
398
|
+
|
|
399
|
+
### Example
|
|
400
|
+
```typescript
|
|
401
|
+
import { BotShield } from "botshield-sdk";
|
|
402
|
+
import * as errors from "botshield-sdk/models/errors";
|
|
403
|
+
|
|
404
|
+
const botShield = new BotShield();
|
|
405
|
+
|
|
406
|
+
async function run() {
|
|
407
|
+
try {
|
|
408
|
+
const result = await botShield.census.createSession({
|
|
409
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
410
|
+
}, {});
|
|
411
|
+
|
|
412
|
+
console.log(result);
|
|
413
|
+
} catch (error) {
|
|
414
|
+
// The base class for HTTP error responses
|
|
415
|
+
if (error instanceof errors.BotShieldError) {
|
|
416
|
+
console.log(error.message);
|
|
417
|
+
console.log(error.statusCode);
|
|
418
|
+
console.log(error.body);
|
|
419
|
+
console.log(error.headers);
|
|
420
|
+
|
|
421
|
+
// Depending on the method different errors may be thrown
|
|
422
|
+
if (error instanceof errors.InvalidInputError) {
|
|
423
|
+
console.log(error.data$.message); // string
|
|
424
|
+
console.log(error.data$.input); // { [k: string]: any }
|
|
425
|
+
console.log(error.data$.errors); // InvalidInputErrorError[]
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
run();
|
|
432
|
+
|
|
329
433
|
```
|
|
330
434
|
|
|
331
|
-
|
|
435
|
+
### Error Classes
|
|
436
|
+
**Primary errors:**
|
|
437
|
+
* [`BotShieldError`](./src/models/errors/bot-shield-error.ts): The base class for HTTP error responses.
|
|
438
|
+
* [`InvalidInputError`](./src/models/errors/invalid-input-error.ts): Invalid input. Status code `400`.
|
|
439
|
+
* [`ErrorResponse`](./src/models/errors/error-response.ts): Internal server error. Status code `500`.
|
|
332
440
|
|
|
333
|
-
|
|
334
|
-
options to requests:
|
|
441
|
+
<details><summary>Less common errors (6)</summary>
|
|
335
442
|
|
|
336
|
-
<
|
|
443
|
+
<br />
|
|
337
444
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
445
|
+
**Network errors:**
|
|
446
|
+
* [`ConnectionError`](./src/models/errors/http-client-errors.ts): HTTP client was unable to make a request to a server.
|
|
447
|
+
* [`RequestTimeoutError`](./src/models/errors/http-client-errors.ts): HTTP request timed out due to an AbortSignal signal.
|
|
448
|
+
* [`RequestAbortedError`](./src/models/errors/http-client-errors.ts): HTTP request was aborted by the client.
|
|
449
|
+
* [`InvalidRequestError`](./src/models/errors/http-client-errors.ts): Any input used to create a request is invalid.
|
|
450
|
+
* [`UnexpectedClientError`](./src/models/errors/http-client-errors.ts): Unrecognised or unexpected error.
|
|
341
451
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
452
|
+
|
|
453
|
+
**Inherit from [`BotShieldError`](./src/models/errors/bot-shield-error.ts)**:
|
|
454
|
+
* [`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.
|
|
455
|
+
|
|
456
|
+
</details>
|
|
457
|
+
<!-- End Error Handling [errors] -->
|
|
458
|
+
|
|
459
|
+
<!-- Start Server Selection [server] -->
|
|
460
|
+
## Server Selection
|
|
461
|
+
|
|
462
|
+
### Select Server by Index
|
|
463
|
+
|
|
464
|
+
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:
|
|
465
|
+
|
|
466
|
+
| # | Server | Description |
|
|
467
|
+
| --- | ------------------------------------- | ----------------- |
|
|
468
|
+
| 0 | `http://localhost:9991/operations` | Local development |
|
|
469
|
+
| 1 | `https://api.botshield.ai/operations` | Production |
|
|
470
|
+
|
|
471
|
+
#### Example
|
|
472
|
+
|
|
473
|
+
```typescript
|
|
474
|
+
import { BotShield } from "botshield-sdk";
|
|
475
|
+
|
|
476
|
+
const botShield = new BotShield({
|
|
477
|
+
serverIdx: 0,
|
|
347
478
|
});
|
|
479
|
+
|
|
480
|
+
async function run() {
|
|
481
|
+
const result = await botShield.census.createSession({
|
|
482
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
483
|
+
}, {});
|
|
484
|
+
|
|
485
|
+
console.log(result);
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
run();
|
|
489
|
+
|
|
348
490
|
```
|
|
349
491
|
|
|
350
|
-
|
|
492
|
+
### Override Server URL Per-Client
|
|
351
493
|
|
|
352
|
-
|
|
353
|
-
|
|
494
|
+
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:
|
|
495
|
+
```typescript
|
|
496
|
+
import { BotShield } from "botshield-sdk";
|
|
354
497
|
|
|
355
|
-
const
|
|
356
|
-
|
|
357
|
-
proxy: 'http://localhost:8888',
|
|
358
|
-
},
|
|
498
|
+
const botShield = new BotShield({
|
|
499
|
+
serverURL: "https://api.botshield.ai/operations",
|
|
359
500
|
});
|
|
501
|
+
|
|
502
|
+
async function run() {
|
|
503
|
+
const result = await botShield.census.createSession({
|
|
504
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
505
|
+
}, {});
|
|
506
|
+
|
|
507
|
+
console.log(result);
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
run();
|
|
511
|
+
|
|
360
512
|
```
|
|
513
|
+
<!-- End Server Selection [server] -->
|
|
514
|
+
|
|
515
|
+
<!-- Start Custom HTTP Client [http-client] -->
|
|
516
|
+
## Custom HTTP Client
|
|
517
|
+
|
|
518
|
+
The TypeScript SDK makes API calls using an `HTTPClient` that wraps the native
|
|
519
|
+
[Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). This
|
|
520
|
+
client is a thin wrapper around `fetch` and provides the ability to attach hooks
|
|
521
|
+
around the request lifecycle that can be used to modify the request or handle
|
|
522
|
+
errors and response.
|
|
523
|
+
|
|
524
|
+
The `HTTPClient` constructor takes an optional `fetcher` argument that can be
|
|
525
|
+
used to integrate a third-party HTTP client or when writing tests to mock out
|
|
526
|
+
the HTTP client and feed in fixtures.
|
|
527
|
+
|
|
528
|
+
The following example shows how to:
|
|
529
|
+
- route requests through a proxy server using [undici](https://www.npmjs.com/package/undici)'s ProxyAgent
|
|
530
|
+
- use the `"beforeRequest"` hook to add a custom header and a timeout to requests
|
|
531
|
+
- use the `"requestError"` hook to log errors
|
|
532
|
+
|
|
533
|
+
```typescript
|
|
534
|
+
import { BotShield } from "botshield-sdk";
|
|
535
|
+
import { ProxyAgent } from "undici";
|
|
536
|
+
import { HTTPClient } from "botshield-sdk/lib/http";
|
|
537
|
+
|
|
538
|
+
const dispatcher = new ProxyAgent("http://proxy.example.com:8080");
|
|
539
|
+
|
|
540
|
+
const httpClient = new HTTPClient({
|
|
541
|
+
// 'fetcher' takes a function that has the same signature as native 'fetch'.
|
|
542
|
+
fetcher: (input, init) =>
|
|
543
|
+
// 'dispatcher' is specific to undici and not part of the standard Fetch API.
|
|
544
|
+
fetch(input, { ...init, dispatcher } as RequestInit),
|
|
545
|
+
});
|
|
361
546
|
|
|
362
|
-
|
|
547
|
+
httpClient.addHook("beforeRequest", (request) => {
|
|
548
|
+
const nextRequest = new Request(request, {
|
|
549
|
+
signal: request.signal || AbortSignal.timeout(5000)
|
|
550
|
+
});
|
|
363
551
|
|
|
364
|
-
|
|
365
|
-
import BotShield from 'npm:botshield-sdk';
|
|
552
|
+
nextRequest.headers.set("x-custom-header", "custom value");
|
|
366
553
|
|
|
367
|
-
|
|
368
|
-
const client = new BotShield({
|
|
369
|
-
fetchOptions: {
|
|
370
|
-
client: httpClient,
|
|
371
|
-
},
|
|
554
|
+
return nextRequest;
|
|
372
555
|
});
|
|
373
|
-
```
|
|
374
556
|
|
|
375
|
-
|
|
557
|
+
httpClient.addHook("requestError", (error, request) => {
|
|
558
|
+
console.group("Request Error");
|
|
559
|
+
console.log("Reason:", `${error}`);
|
|
560
|
+
console.log("Endpoint:", `${request.method} ${request.url}`);
|
|
561
|
+
console.groupEnd();
|
|
562
|
+
});
|
|
376
563
|
|
|
377
|
-
|
|
564
|
+
const sdk = new BotShield({ httpClient: httpClient });
|
|
565
|
+
```
|
|
566
|
+
<!-- End Custom HTTP Client [http-client] -->
|
|
378
567
|
|
|
379
|
-
|
|
568
|
+
<!-- Start Debugging [debug] -->
|
|
569
|
+
## Debugging
|
|
380
570
|
|
|
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.
|
|
571
|
+
You can setup your SDK to emit debug logs for SDK requests and responses.
|
|
384
572
|
|
|
385
|
-
|
|
573
|
+
You can pass a logger that matches `console`'s interface as an SDK option.
|
|
386
574
|
|
|
387
|
-
|
|
575
|
+
> [!WARNING]
|
|
576
|
+
> 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
577
|
|
|
389
|
-
|
|
578
|
+
```typescript
|
|
579
|
+
import { BotShield } from "botshield-sdk";
|
|
580
|
+
|
|
581
|
+
const sdk = new BotShield({ debugLogger: console });
|
|
582
|
+
```
|
|
583
|
+
<!-- End Debugging [debug] -->
|
|
390
584
|
|
|
391
|
-
|
|
585
|
+
<!-- Placeholder for Future Speakeasy SDK Sections -->
|
|
392
586
|
|
|
393
|
-
|
|
587
|
+
# Development
|
|
394
588
|
|
|
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.
|
|
589
|
+
## Maturity
|
|
403
590
|
|
|
404
|
-
|
|
591
|
+
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
|
|
592
|
+
to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
|
|
593
|
+
looking for the latest version.
|
|
405
594
|
|
|
406
|
-
|
|
595
|
+
## Contributions
|
|
407
596
|
|
|
408
|
-
|
|
597
|
+
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.
|
|
598
|
+
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
599
|
|
|
410
|
-
|
|
600
|
+
### SDK Created by [Speakeasy](https://www.speakeasy.com/?utm_source=botshield-sdk&utm_campaign=typescript)
|