botshield-sdk 2.3.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -2
- package/bin/mcp-server.js +1129 -52
- package/bin/mcp-server.js.map +34 -24
- package/dist/commonjs/funcs/actions-propose-action.d.ts +1 -1
- package/dist/commonjs/funcs/actions-propose-action.js +1 -1
- package/dist/commonjs/funcs/actions-verify-resolution.d.ts +18 -0
- package/dist/commonjs/funcs/actions-verify-resolution.d.ts.map +1 -0
- package/dist/commonjs/funcs/actions-verify-resolution.js +129 -0
- package/dist/commonjs/funcs/actions-verify-resolution.js.map +1 -0
- package/dist/commonjs/funcs/census-confirm-link.d.ts +17 -0
- package/dist/commonjs/funcs/census-confirm-link.d.ts.map +1 -0
- package/dist/commonjs/funcs/census-confirm-link.js +119 -0
- package/dist/commonjs/funcs/census-confirm-link.js.map +1 -0
- package/dist/commonjs/funcs/census-create-verification-link.d.ts +2 -0
- package/dist/commonjs/funcs/census-create-verification-link.d.ts.map +1 -1
- package/dist/commonjs/funcs/census-create-verification-link.js +2 -0
- package/dist/commonjs/funcs/census-create-verification-link.js.map +1 -1
- package/dist/commonjs/funcs/census-send-by-number.d.ts +18 -0
- package/dist/commonjs/funcs/census-send-by-number.d.ts.map +1 -0
- package/dist/commonjs/funcs/census-send-by-number.js +123 -0
- package/dist/commonjs/funcs/census-send-by-number.js.map +1 -0
- package/dist/commonjs/funcs/census-verify-token.d.ts +1 -1
- package/dist/commonjs/funcs/census-verify-token.js +1 -1
- package/dist/commonjs/funcs/gates-actions-request-cancel.d.ts +18 -0
- package/dist/commonjs/funcs/gates-actions-request-cancel.d.ts.map +1 -0
- package/dist/commonjs/funcs/gates-actions-request-cancel.js +123 -0
- package/dist/commonjs/funcs/gates-actions-request-cancel.js.map +1 -0
- package/dist/commonjs/funcs/gates-actions-request-status.js +1 -0
- package/dist/commonjs/funcs/gates-actions-request-status.js.map +1 -1
- package/dist/commonjs/funcs/gates-actions-request.d.ts +1 -1
- package/dist/commonjs/funcs/gates-actions-request.js +1 -1
- package/dist/commonjs/funcs/gates-actions-update.d.ts +18 -0
- package/dist/commonjs/funcs/gates-actions-update.d.ts.map +1 -0
- package/dist/commonjs/funcs/gates-actions-update.js +123 -0
- package/dist/commonjs/funcs/gates-actions-update.js.map +1 -0
- package/dist/commonjs/funcs/recovery-exchange.d.ts +18 -0
- package/dist/commonjs/funcs/recovery-exchange.d.ts.map +1 -0
- package/dist/commonjs/funcs/recovery-exchange.js +123 -0
- package/dist/commonjs/funcs/recovery-exchange.js.map +1 -0
- package/dist/commonjs/funcs/recovery-other-route.d.ts +18 -0
- package/dist/commonjs/funcs/recovery-other-route.d.ts.map +1 -0
- package/dist/commonjs/funcs/recovery-other-route.js +123 -0
- package/dist/commonjs/funcs/recovery-other-route.js.map +1 -0
- package/dist/commonjs/funcs/sign-in-confirm.d.ts +18 -0
- package/dist/commonjs/funcs/sign-in-confirm.d.ts.map +1 -0
- package/dist/commonjs/funcs/sign-in-confirm.js +123 -0
- package/dist/commonjs/funcs/sign-in-confirm.js.map +1 -0
- package/dist/commonjs/funcs/sign-in-request.d.ts +18 -0
- package/dist/commonjs/funcs/sign-in-request.d.ts.map +1 -0
- package/dist/commonjs/funcs/sign-in-request.js +123 -0
- package/dist/commonjs/funcs/sign-in-request.js.map +1 -0
- package/dist/commonjs/funcs/verification-get-status.d.ts +1 -1
- package/dist/commonjs/funcs/verification-get-status.js +2 -1
- package/dist/commonjs/funcs/verification-get-status.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.js +1 -1
- package/dist/commonjs/models/bot-shield-action.d.ts +46 -0
- package/dist/commonjs/models/bot-shield-action.d.ts.map +1 -1
- package/dist/commonjs/models/bot-shield-action.js +36 -1
- package/dist/commonjs/models/bot-shield-action.js.map +1 -1
- package/dist/commonjs/models/error-body.d.ts +6 -1
- package/dist/commonjs/models/error-body.d.ts.map +1 -1
- package/dist/commonjs/models/error-body.js +4 -0
- package/dist/commonjs/models/error-body.js.map +1 -1
- package/dist/commonjs/models/gate-unavailable-event.d.ts +112 -0
- package/dist/commonjs/models/gate-unavailable-event.d.ts.map +1 -0
- package/dist/commonjs/models/gate-unavailable-event.js +137 -0
- package/dist/commonjs/models/gate-unavailable-event.js.map +1 -0
- package/dist/commonjs/models/gates-api-error.d.ts +5 -0
- package/dist/commonjs/models/gates-api-error.d.ts.map +1 -1
- package/dist/commonjs/models/gates-api-error.js +11 -0
- package/dist/commonjs/models/gates-api-error.js.map +1 -1
- package/dist/commonjs/models/index.d.ts +1 -0
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +1 -0
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/operations/actions-propose.d.ts +21 -1
- package/dist/commonjs/models/operations/actions-propose.d.ts.map +1 -1
- package/dist/commonjs/models/operations/actions-propose.js +16 -0
- package/dist/commonjs/models/operations/actions-propose.js.map +1 -1
- package/dist/commonjs/models/operations/gates-api-actions-create.d.ts +11 -1
- package/dist/commonjs/models/operations/gates-api-actions-create.d.ts.map +1 -1
- package/dist/commonjs/models/operations/gates-api-actions-create.js +4 -0
- package/dist/commonjs/models/operations/gates-api-actions-create.js.map +1 -1
- package/dist/commonjs/models/operations/gates-api-actions-list.d.ts +1 -1
- package/dist/commonjs/models/operations/gates-api-actions-request-cancel.d.ts +113 -0
- package/dist/commonjs/models/operations/gates-api-actions-request-cancel.d.ts.map +1 -0
- package/dist/commonjs/models/operations/gates-api-actions-request-cancel.js +178 -0
- package/dist/commonjs/models/operations/gates-api-actions-request-cancel.js.map +1 -0
- package/dist/commonjs/models/operations/gates-api-actions-request-status.d.ts +5 -0
- package/dist/commonjs/models/operations/gates-api-actions-request-status.d.ts.map +1 -1
- package/dist/commonjs/models/operations/gates-api-actions-request-status.js +2 -0
- package/dist/commonjs/models/operations/gates-api-actions-request-status.js.map +1 -1
- package/dist/commonjs/models/operations/gates-api-actions-request.d.ts +34 -4
- package/dist/commonjs/models/operations/gates-api-actions-request.d.ts.map +1 -1
- package/dist/commonjs/models/operations/gates-api-actions-request.js +32 -3
- package/dist/commonjs/models/operations/gates-api-actions-request.js.map +1 -1
- package/dist/commonjs/models/operations/gates-api-actions-set-state.d.ts +1 -1
- package/dist/commonjs/models/operations/gates-api-actions-update.d.ts +99 -0
- package/dist/commonjs/models/operations/gates-api-actions-update.d.ts.map +1 -0
- package/dist/commonjs/models/operations/gates-api-actions-update.js +141 -0
- package/dist/commonjs/models/operations/gates-api-actions-update.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +9 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +9 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/recovery-exchange.d.ts +114 -0
- package/dist/commonjs/models/operations/recovery-exchange.d.ts.map +1 -0
- package/dist/commonjs/models/operations/recovery-exchange.js +164 -0
- package/dist/commonjs/models/operations/recovery-exchange.js.map +1 -0
- package/dist/commonjs/models/operations/recovery-other-route.d.ts +86 -0
- package/dist/commonjs/models/operations/recovery-other-route.d.ts.map +1 -0
- package/dist/commonjs/models/operations/recovery-other-route.js +145 -0
- package/dist/commonjs/models/operations/recovery-other-route.js.map +1 -0
- package/dist/commonjs/models/operations/request-passkey-complete.d.ts +1 -1
- package/dist/commonjs/models/operations/sdk-confirm-link.d.ts +130 -0
- package/dist/commonjs/models/operations/sdk-confirm-link.d.ts.map +1 -0
- package/dist/commonjs/models/operations/sdk-confirm-link.js +205 -0
- package/dist/commonjs/models/operations/sdk-confirm-link.js.map +1 -0
- package/dist/commonjs/models/operations/sdk-create-session.d.ts +1 -1
- package/dist/commonjs/models/operations/sdk-create-verification-link.d.ts +48 -2
- package/dist/commonjs/models/operations/sdk-create-verification-link.d.ts.map +1 -1
- package/dist/commonjs/models/operations/sdk-create-verification-link.js +34 -1
- package/dist/commonjs/models/operations/sdk-create-verification-link.js.map +1 -1
- package/dist/commonjs/models/operations/sdk-send-by-number.d.ts +124 -0
- package/dist/commonjs/models/operations/sdk-send-by-number.d.ts.map +1 -0
- package/dist/commonjs/models/operations/sdk-send-by-number.js +203 -0
- package/dist/commonjs/models/operations/sdk-send-by-number.js.map +1 -0
- package/dist/commonjs/models/operations/sdk-verify-resolution.d.ts +125 -0
- package/dist/commonjs/models/operations/sdk-verify-resolution.d.ts.map +1 -0
- package/dist/commonjs/models/operations/sdk-verify-resolution.js +182 -0
- package/dist/commonjs/models/operations/sdk-verify-resolution.js.map +1 -0
- package/dist/commonjs/models/operations/sdk-verify-token.d.ts +110 -1
- package/dist/commonjs/models/operations/sdk-verify-token.d.ts.map +1 -1
- package/dist/commonjs/models/operations/sdk-verify-token.js +96 -1
- package/dist/commonjs/models/operations/sdk-verify-token.js.map +1 -1
- package/dist/commonjs/models/operations/signin-confirm.d.ts +148 -0
- package/dist/commonjs/models/operations/signin-confirm.d.ts.map +1 -0
- package/dist/commonjs/models/operations/signin-confirm.js +202 -0
- package/dist/commonjs/models/operations/signin-confirm.js.map +1 -0
- package/dist/commonjs/models/operations/signin-request.d.ts +115 -0
- package/dist/commonjs/models/operations/signin-request.d.ts.map +1 -0
- package/dist/commonjs/models/operations/signin-request.js +174 -0
- package/dist/commonjs/models/operations/signin-request.js.map +1 -0
- package/dist/commonjs/models/operations/verification-get-status.d.ts +45 -5
- package/dist/commonjs/models/operations/verification-get-status.d.ts.map +1 -1
- package/dist/commonjs/models/operations/verification-get-status.js +37 -2
- package/dist/commonjs/models/operations/verification-get-status.js.map +1 -1
- package/dist/commonjs/models/passes-per-person.d.ts +1 -1
- package/dist/commonjs/sdk/actions.d.ts +8 -1
- package/dist/commonjs/sdk/actions.d.ts.map +1 -1
- package/dist/commonjs/sdk/actions.js +11 -1
- package/dist/commonjs/sdk/actions.js.map +1 -1
- package/dist/commonjs/sdk/census.d.ts +17 -1
- package/dist/commonjs/sdk/census.d.ts.map +1 -1
- package/dist/commonjs/sdk/census.js +23 -1
- package/dist/commonjs/sdk/census.js.map +1 -1
- package/dist/commonjs/sdk/gates-actions.d.ts +15 -1
- package/dist/commonjs/sdk/gates-actions.d.ts.map +1 -1
- package/dist/commonjs/sdk/gates-actions.js +21 -1
- package/dist/commonjs/sdk/gates-actions.js.map +1 -1
- package/dist/commonjs/sdk/recovery.d.ts +19 -0
- package/dist/commonjs/sdk/recovery.d.ts.map +1 -0
- package/dist/commonjs/sdk/recovery.js +32 -0
- package/dist/commonjs/sdk/recovery.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +8 -2
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +14 -4
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/commonjs/sdk/sign-in.d.ts +19 -0
- package/dist/commonjs/sdk/sign-in.d.ts.map +1 -0
- package/dist/commonjs/sdk/sign-in.js +32 -0
- package/dist/commonjs/sdk/sign-in.js.map +1 -0
- package/dist/commonjs/sdk/verification.d.ts +1 -1
- package/dist/commonjs/sdk/verification.js +1 -1
- package/dist/esm/funcs/actions-propose-action.d.ts +1 -1
- package/dist/esm/funcs/actions-propose-action.js +1 -1
- package/dist/esm/funcs/actions-verify-resolution.d.ts +18 -0
- package/dist/esm/funcs/actions-verify-resolution.d.ts.map +1 -0
- package/dist/esm/funcs/actions-verify-resolution.js +93 -0
- package/dist/esm/funcs/actions-verify-resolution.js.map +1 -0
- package/dist/esm/funcs/census-confirm-link.d.ts +17 -0
- package/dist/esm/funcs/census-confirm-link.d.ts.map +1 -0
- package/dist/esm/funcs/census-confirm-link.js +83 -0
- package/dist/esm/funcs/census-confirm-link.js.map +1 -0
- package/dist/esm/funcs/census-create-verification-link.d.ts +2 -0
- package/dist/esm/funcs/census-create-verification-link.d.ts.map +1 -1
- package/dist/esm/funcs/census-create-verification-link.js +2 -0
- package/dist/esm/funcs/census-create-verification-link.js.map +1 -1
- package/dist/esm/funcs/census-send-by-number.d.ts +18 -0
- package/dist/esm/funcs/census-send-by-number.d.ts.map +1 -0
- package/dist/esm/funcs/census-send-by-number.js +87 -0
- package/dist/esm/funcs/census-send-by-number.js.map +1 -0
- package/dist/esm/funcs/census-verify-token.d.ts +1 -1
- package/dist/esm/funcs/census-verify-token.js +1 -1
- package/dist/esm/funcs/gates-actions-request-cancel.d.ts +18 -0
- package/dist/esm/funcs/gates-actions-request-cancel.d.ts.map +1 -0
- package/dist/esm/funcs/gates-actions-request-cancel.js +87 -0
- package/dist/esm/funcs/gates-actions-request-cancel.js.map +1 -0
- package/dist/esm/funcs/gates-actions-request-status.js +1 -0
- package/dist/esm/funcs/gates-actions-request-status.js.map +1 -1
- package/dist/esm/funcs/gates-actions-request.d.ts +1 -1
- package/dist/esm/funcs/gates-actions-request.js +1 -1
- package/dist/esm/funcs/gates-actions-update.d.ts +18 -0
- package/dist/esm/funcs/gates-actions-update.d.ts.map +1 -0
- package/dist/esm/funcs/gates-actions-update.js +87 -0
- package/dist/esm/funcs/gates-actions-update.js.map +1 -0
- package/dist/esm/funcs/recovery-exchange.d.ts +18 -0
- package/dist/esm/funcs/recovery-exchange.d.ts.map +1 -0
- package/dist/esm/funcs/recovery-exchange.js +87 -0
- package/dist/esm/funcs/recovery-exchange.js.map +1 -0
- package/dist/esm/funcs/recovery-other-route.d.ts +18 -0
- package/dist/esm/funcs/recovery-other-route.d.ts.map +1 -0
- package/dist/esm/funcs/recovery-other-route.js +87 -0
- package/dist/esm/funcs/recovery-other-route.js.map +1 -0
- package/dist/esm/funcs/sign-in-confirm.d.ts +18 -0
- package/dist/esm/funcs/sign-in-confirm.d.ts.map +1 -0
- package/dist/esm/funcs/sign-in-confirm.js +87 -0
- package/dist/esm/funcs/sign-in-confirm.js.map +1 -0
- package/dist/esm/funcs/sign-in-request.d.ts +18 -0
- package/dist/esm/funcs/sign-in-request.d.ts.map +1 -0
- package/dist/esm/funcs/sign-in-request.js +87 -0
- package/dist/esm/funcs/sign-in-request.js.map +1 -0
- package/dist/esm/funcs/verification-get-status.d.ts +1 -1
- package/dist/esm/funcs/verification-get-status.js +3 -2
- package/dist/esm/funcs/verification-get-status.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.js +1 -1
- package/dist/esm/models/bot-shield-action.d.ts +46 -0
- package/dist/esm/models/bot-shield-action.d.ts.map +1 -1
- package/dist/esm/models/bot-shield-action.js +35 -0
- package/dist/esm/models/bot-shield-action.js.map +1 -1
- package/dist/esm/models/error-body.d.ts +6 -1
- package/dist/esm/models/error-body.d.ts.map +1 -1
- package/dist/esm/models/error-body.js +4 -0
- package/dist/esm/models/error-body.js.map +1 -1
- package/dist/esm/models/gate-unavailable-event.d.ts +112 -0
- package/dist/esm/models/gate-unavailable-event.d.ts.map +1 -0
- package/dist/esm/models/gate-unavailable-event.js +99 -0
- package/dist/esm/models/gate-unavailable-event.js.map +1 -0
- package/dist/esm/models/gates-api-error.d.ts +5 -0
- package/dist/esm/models/gates-api-error.d.ts.map +1 -1
- package/dist/esm/models/gates-api-error.js +11 -0
- package/dist/esm/models/gates-api-error.js.map +1 -1
- package/dist/esm/models/index.d.ts +1 -0
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +1 -0
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/operations/actions-propose.d.ts +21 -1
- package/dist/esm/models/operations/actions-propose.d.ts.map +1 -1
- package/dist/esm/models/operations/actions-propose.js +16 -0
- package/dist/esm/models/operations/actions-propose.js.map +1 -1
- package/dist/esm/models/operations/gates-api-actions-create.d.ts +11 -1
- package/dist/esm/models/operations/gates-api-actions-create.d.ts.map +1 -1
- package/dist/esm/models/operations/gates-api-actions-create.js +4 -0
- package/dist/esm/models/operations/gates-api-actions-create.js.map +1 -1
- package/dist/esm/models/operations/gates-api-actions-list.d.ts +1 -1
- package/dist/esm/models/operations/gates-api-actions-request-cancel.d.ts +113 -0
- package/dist/esm/models/operations/gates-api-actions-request-cancel.d.ts.map +1 -0
- package/dist/esm/models/operations/gates-api-actions-request-cancel.js +132 -0
- package/dist/esm/models/operations/gates-api-actions-request-cancel.js.map +1 -0
- package/dist/esm/models/operations/gates-api-actions-request-status.d.ts +5 -0
- package/dist/esm/models/operations/gates-api-actions-request-status.d.ts.map +1 -1
- package/dist/esm/models/operations/gates-api-actions-request-status.js +2 -0
- package/dist/esm/models/operations/gates-api-actions-request-status.js.map +1 -1
- package/dist/esm/models/operations/gates-api-actions-request.d.ts +34 -4
- package/dist/esm/models/operations/gates-api-actions-request.d.ts.map +1 -1
- package/dist/esm/models/operations/gates-api-actions-request.js +29 -2
- package/dist/esm/models/operations/gates-api-actions-request.js.map +1 -1
- package/dist/esm/models/operations/gates-api-actions-set-state.d.ts +1 -1
- package/dist/esm/models/operations/gates-api-actions-update.d.ts +99 -0
- package/dist/esm/models/operations/gates-api-actions-update.d.ts.map +1 -0
- package/dist/esm/models/operations/gates-api-actions-update.js +95 -0
- package/dist/esm/models/operations/gates-api-actions-update.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +9 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +9 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/recovery-exchange.d.ts +114 -0
- package/dist/esm/models/operations/recovery-exchange.d.ts.map +1 -0
- package/dist/esm/models/operations/recovery-exchange.js +118 -0
- package/dist/esm/models/operations/recovery-exchange.js.map +1 -0
- package/dist/esm/models/operations/recovery-other-route.d.ts +86 -0
- package/dist/esm/models/operations/recovery-other-route.d.ts.map +1 -0
- package/dist/esm/models/operations/recovery-other-route.js +99 -0
- package/dist/esm/models/operations/recovery-other-route.js.map +1 -0
- package/dist/esm/models/operations/request-passkey-complete.d.ts +1 -1
- package/dist/esm/models/operations/sdk-confirm-link.d.ts +130 -0
- package/dist/esm/models/operations/sdk-confirm-link.d.ts.map +1 -0
- package/dist/esm/models/operations/sdk-confirm-link.js +157 -0
- package/dist/esm/models/operations/sdk-confirm-link.js.map +1 -0
- package/dist/esm/models/operations/sdk-create-session.d.ts +1 -1
- package/dist/esm/models/operations/sdk-create-verification-link.d.ts +48 -2
- package/dist/esm/models/operations/sdk-create-verification-link.d.ts.map +1 -1
- package/dist/esm/models/operations/sdk-create-verification-link.js +33 -0
- package/dist/esm/models/operations/sdk-create-verification-link.js.map +1 -1
- package/dist/esm/models/operations/sdk-send-by-number.d.ts +124 -0
- package/dist/esm/models/operations/sdk-send-by-number.d.ts.map +1 -0
- package/dist/esm/models/operations/sdk-send-by-number.js +155 -0
- package/dist/esm/models/operations/sdk-send-by-number.js.map +1 -0
- package/dist/esm/models/operations/sdk-verify-resolution.d.ts +125 -0
- package/dist/esm/models/operations/sdk-verify-resolution.d.ts.map +1 -0
- package/dist/esm/models/operations/sdk-verify-resolution.js +136 -0
- package/dist/esm/models/operations/sdk-verify-resolution.js.map +1 -0
- package/dist/esm/models/operations/sdk-verify-token.d.ts +110 -1
- package/dist/esm/models/operations/sdk-verify-token.d.ts.map +1 -1
- package/dist/esm/models/operations/sdk-verify-token.js +93 -0
- package/dist/esm/models/operations/sdk-verify-token.js.map +1 -1
- package/dist/esm/models/operations/signin-confirm.d.ts +148 -0
- package/dist/esm/models/operations/signin-confirm.d.ts.map +1 -0
- package/dist/esm/models/operations/signin-confirm.js +156 -0
- package/dist/esm/models/operations/signin-confirm.js.map +1 -0
- package/dist/esm/models/operations/signin-request.d.ts +115 -0
- package/dist/esm/models/operations/signin-request.d.ts.map +1 -0
- package/dist/esm/models/operations/signin-request.js +128 -0
- package/dist/esm/models/operations/signin-request.js.map +1 -0
- package/dist/esm/models/operations/verification-get-status.d.ts +45 -5
- package/dist/esm/models/operations/verification-get-status.d.ts.map +1 -1
- package/dist/esm/models/operations/verification-get-status.js +36 -1
- package/dist/esm/models/operations/verification-get-status.js.map +1 -1
- package/dist/esm/models/passes-per-person.d.ts +1 -1
- package/dist/esm/sdk/actions.d.ts +8 -1
- package/dist/esm/sdk/actions.d.ts.map +1 -1
- package/dist/esm/sdk/actions.js +11 -1
- package/dist/esm/sdk/actions.js.map +1 -1
- package/dist/esm/sdk/census.d.ts +17 -1
- package/dist/esm/sdk/census.d.ts.map +1 -1
- package/dist/esm/sdk/census.js +23 -1
- package/dist/esm/sdk/census.js.map +1 -1
- package/dist/esm/sdk/gates-actions.d.ts +15 -1
- package/dist/esm/sdk/gates-actions.d.ts.map +1 -1
- package/dist/esm/sdk/gates-actions.js +21 -1
- package/dist/esm/sdk/gates-actions.js.map +1 -1
- package/dist/esm/sdk/recovery.d.ts +19 -0
- package/dist/esm/sdk/recovery.d.ts.map +1 -0
- package/dist/esm/sdk/recovery.js +28 -0
- package/dist/esm/sdk/recovery.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +8 -2
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +14 -4
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/dist/esm/sdk/sign-in.d.ts +19 -0
- package/dist/esm/sdk/sign-in.d.ts.map +1 -0
- package/dist/esm/sdk/sign-in.js +28 -0
- package/dist/esm/sdk/sign-in.js.map +1 -0
- package/dist/esm/sdk/verification.d.ts +1 -1
- package/dist/esm/sdk/verification.js +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/actions-propose-action.ts +1 -1
- package/src/funcs/actions-verify-resolution.ts +192 -0
- package/src/funcs/census-confirm-link.ts +171 -0
- package/src/funcs/census-create-verification-link.ts +2 -0
- package/src/funcs/census-send-by-number.ts +180 -0
- package/src/funcs/census-verify-token.ts +1 -1
- package/src/funcs/gates-actions-request-cancel.ts +187 -0
- package/src/funcs/gates-actions-request-status.ts +1 -0
- package/src/funcs/gates-actions-request.ts +1 -1
- package/src/funcs/gates-actions-update.ts +185 -0
- package/src/funcs/recovery-exchange.ts +184 -0
- package/src/funcs/recovery-other-route.ts +184 -0
- package/src/funcs/sign-in-confirm.ts +184 -0
- package/src/funcs/sign-in-request.ts +184 -0
- package/src/funcs/verification-get-status.ts +7 -2
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/models/bot-shield-action.ts +79 -0
- package/src/models/error-body.ts +10 -1
- package/src/models/gate-unavailable-event.ts +218 -0
- package/src/models/gates-api-error.ts +16 -0
- package/src/models/index.ts +1 -0
- package/src/models/operations/actions-propose.ts +37 -1
- package/src/models/operations/gates-api-actions-create.ts +15 -1
- package/src/models/operations/gates-api-actions-list.ts +1 -1
- package/src/models/operations/gates-api-actions-request-cancel.ts +339 -0
- package/src/models/operations/gates-api-actions-request-status.ts +7 -0
- package/src/models/operations/gates-api-actions-request.ts +83 -6
- package/src/models/operations/gates-api-actions-set-state.ts +1 -1
- package/src/models/operations/gates-api-actions-update.ts +281 -0
- package/src/models/operations/index.ts +9 -0
- package/src/models/operations/recovery-exchange.ts +308 -0
- package/src/models/operations/recovery-other-route.ts +262 -0
- package/src/models/operations/request-passkey-complete.ts +1 -1
- package/src/models/operations/sdk-confirm-link.ts +380 -0
- package/src/models/operations/sdk-create-session.ts +1 -1
- package/src/models/operations/sdk-create-verification-link.ts +78 -2
- package/src/models/operations/sdk-send-by-number.ts +372 -0
- package/src/models/operations/sdk-verify-resolution.ts +341 -0
- package/src/models/operations/sdk-verify-token.ts +214 -1
- package/src/models/operations/signin-confirm.ts +383 -0
- package/src/models/operations/signin-request.ts +319 -0
- package/src/models/operations/verification-get-status.ts +76 -5
- package/src/models/passes-per-person.ts +1 -1
- package/src/sdk/actions.ts +21 -1
- package/src/sdk/census.ts +43 -1
- package/src/sdk/gates-actions.ts +41 -1
- package/src/sdk/recovery.ts +49 -0
- package/src/sdk/sdk.ts +17 -5
- package/src/sdk/sign-in.ts +49 -0
- package/src/sdk/verification.ts +1 -1
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { BotShieldCore } from "../core.js";
|
|
6
|
+
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { resolveSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import { BotShieldError } from "../models/errors/bot-shield-error.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/http-client-errors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/response-validation-error.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Send a request to verify by phone number
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* 4.0: from your server, with your SECRET key, send a request to verify to the person whose BotShield ID carries this phone number. BotShield keeps none of your customer data: the number is used once and is not stored, logged or returned. The answer is the same whether or not anyone holds the number: status `sent`, the request id, its expiry and a two-digit `match_number` — show it to your customer; they pick it in the BotShield app before their passkey. Outcomes arrive as webhooks (or verification/status with this key): verified, declined, or expired. A person who has not linked your company first sees an introduction from you; your request can be answered only after they allow it. Production sends need a verified business. Limits: a cap per key per hour and on unanswered sends per company.
|
|
34
|
+
*/
|
|
35
|
+
export function censusSendByNumber(
|
|
36
|
+
client: BotShieldCore,
|
|
37
|
+
security: operations.SDKSendByNumberSecurity,
|
|
38
|
+
request: operations.SDKSendByNumberRequest,
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): APIPromise<
|
|
41
|
+
Result<
|
|
42
|
+
operations.SDKSendByNumberResponse,
|
|
43
|
+
| errors.ErrorResponse
|
|
44
|
+
| BotShieldError
|
|
45
|
+
| ResponseValidationError
|
|
46
|
+
| ConnectionError
|
|
47
|
+
| RequestAbortedError
|
|
48
|
+
| RequestTimeoutError
|
|
49
|
+
| InvalidRequestError
|
|
50
|
+
| UnexpectedClientError
|
|
51
|
+
| SDKValidationError
|
|
52
|
+
>
|
|
53
|
+
> {
|
|
54
|
+
return new APIPromise($do(
|
|
55
|
+
client,
|
|
56
|
+
security,
|
|
57
|
+
request,
|
|
58
|
+
options,
|
|
59
|
+
));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async function $do(
|
|
63
|
+
client: BotShieldCore,
|
|
64
|
+
security: operations.SDKSendByNumberSecurity,
|
|
65
|
+
request: operations.SDKSendByNumberRequest,
|
|
66
|
+
options?: RequestOptions,
|
|
67
|
+
): Promise<
|
|
68
|
+
[
|
|
69
|
+
Result<
|
|
70
|
+
operations.SDKSendByNumberResponse,
|
|
71
|
+
| errors.ErrorResponse
|
|
72
|
+
| BotShieldError
|
|
73
|
+
| ResponseValidationError
|
|
74
|
+
| ConnectionError
|
|
75
|
+
| RequestAbortedError
|
|
76
|
+
| RequestTimeoutError
|
|
77
|
+
| InvalidRequestError
|
|
78
|
+
| UnexpectedClientError
|
|
79
|
+
| SDKValidationError
|
|
80
|
+
>,
|
|
81
|
+
APICall,
|
|
82
|
+
]
|
|
83
|
+
> {
|
|
84
|
+
const parsed = safeParse(
|
|
85
|
+
request,
|
|
86
|
+
(value) => operations.SDKSendByNumberRequest$outboundSchema.parse(value),
|
|
87
|
+
"Input validation failed",
|
|
88
|
+
);
|
|
89
|
+
if (!parsed.ok) {
|
|
90
|
+
return [parsed, { status: "invalid" }];
|
|
91
|
+
}
|
|
92
|
+
const payload = parsed.value;
|
|
93
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
94
|
+
|
|
95
|
+
const path = pathToFunc("/sdk/send-by-number")();
|
|
96
|
+
|
|
97
|
+
const headers = new Headers(compactMap({
|
|
98
|
+
"Content-Type": "application/json",
|
|
99
|
+
Accept: "application/json",
|
|
100
|
+
}));
|
|
101
|
+
|
|
102
|
+
const requestSecurity = resolveSecurity(
|
|
103
|
+
[
|
|
104
|
+
{
|
|
105
|
+
fieldName: "Authorization",
|
|
106
|
+
type: "apiKey:header",
|
|
107
|
+
value: security?.apiKeyAuth,
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
const context = {
|
|
113
|
+
options: client._options,
|
|
114
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
115
|
+
operationID: "SdkSendByNumber",
|
|
116
|
+
oAuth2Scopes: null,
|
|
117
|
+
|
|
118
|
+
resolvedSecurity: requestSecurity,
|
|
119
|
+
|
|
120
|
+
securitySource: security,
|
|
121
|
+
retryConfig: options?.retries
|
|
122
|
+
|| client._options.retryConfig
|
|
123
|
+
|| { strategy: "none" },
|
|
124
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const requestRes = client._createRequest(context, {
|
|
128
|
+
security: requestSecurity,
|
|
129
|
+
method: "POST",
|
|
130
|
+
baseURL: options?.serverURL,
|
|
131
|
+
path: path,
|
|
132
|
+
headers: headers,
|
|
133
|
+
body: body,
|
|
134
|
+
userAgent: client._options.userAgent,
|
|
135
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
136
|
+
}, options);
|
|
137
|
+
if (!requestRes.ok) {
|
|
138
|
+
return [requestRes, { status: "invalid" }];
|
|
139
|
+
}
|
|
140
|
+
const req = requestRes.value;
|
|
141
|
+
|
|
142
|
+
const doResult = await client._do(req, {
|
|
143
|
+
context,
|
|
144
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
145
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
146
|
+
retryConfig: context.retryConfig,
|
|
147
|
+
retryCodes: context.retryCodes,
|
|
148
|
+
});
|
|
149
|
+
if (!doResult.ok) {
|
|
150
|
+
return [doResult, { status: "request-error", request: req }];
|
|
151
|
+
}
|
|
152
|
+
const response = doResult.value;
|
|
153
|
+
|
|
154
|
+
const responseFields = {
|
|
155
|
+
HttpMeta: { Response: response, Request: req },
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
const [result] = await M.match<
|
|
159
|
+
operations.SDKSendByNumberResponse,
|
|
160
|
+
| errors.ErrorResponse
|
|
161
|
+
| BotShieldError
|
|
162
|
+
| ResponseValidationError
|
|
163
|
+
| ConnectionError
|
|
164
|
+
| RequestAbortedError
|
|
165
|
+
| RequestTimeoutError
|
|
166
|
+
| InvalidRequestError
|
|
167
|
+
| UnexpectedClientError
|
|
168
|
+
| SDKValidationError
|
|
169
|
+
>(
|
|
170
|
+
M.json(200, operations.SDKSendByNumberResponse$inboundSchema),
|
|
171
|
+
M.jsonErr(500, errors.ErrorResponse$inboundSchema),
|
|
172
|
+
M.fail([401, "4XX"]),
|
|
173
|
+
M.fail("5XX"),
|
|
174
|
+
)(response, req, { extraFields: responseFields });
|
|
175
|
+
if (!result.ok) {
|
|
176
|
+
return [result, { status: "complete", request: req, response }];
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return [result, { status: "complete", request: req, response }];
|
|
180
|
+
}
|
|
@@ -30,7 +30,7 @@ import { Result } from "../types/fp.js";
|
|
|
30
30
|
* Validate a verification token
|
|
31
31
|
*
|
|
32
32
|
* @remarks
|
|
33
|
-
* Validates a BotShield attestation JWT — the primary server-side check. Attestations are ES256-signed; the public key is published at /.well-known/jwks.json (kid in the header), so you may also verify locally with any JWT library. Claims are anonymous by construction: the token attests the event, never the person. Each attestation is for one organization (aud = its organization_id; pass `audience` to enforce it) and one check: a repeat check is refused (`valid: false`, `replayed: true`). Check it once, on your server.
|
|
33
|
+
* Validates a BotShield attestation JWT — the primary server-side check. Attestations are ES256-signed; the public key is published at /.well-known/jwks.json (kid in the header), so you may also verify locally with any JWT library. Claims are anonymous by construction: the token attests the event, never the person. Each attestation is for one organization (aud = its organization_id; pass `audience` to enforce it) and one check: a repeat check is refused (`valid: false`, `replayed: true`). Check it once, on your server. Each token names its `kind` (`verification` or `action`) and the `environment` it was issued in. A token of any other kind is refused, and when you call with your secret key (`Authorization: Bearer bs_…`) a token from the other environment is refused (a development token never passes a production check). A refused token is not spent. 4.0: the check needs your secret key (`Authorization: Bearer bs_…`); without it the answer is `valid: false, code: secret_key_required` and the token is not spent. Send `expected_request_id` (the request your server made) and a token for any other request is refused (`code: request_mismatch`), unspent. A passkey sign-in's token is refused here: redeem a sign-in with signin/confirm.
|
|
34
34
|
*/
|
|
35
35
|
export function censusVerifyToken(
|
|
36
36
|
client: BotShieldCore,
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { BotShieldCore } from "../core.js";
|
|
6
|
+
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { resolveSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import { BotShieldError } from "../models/errors/bot-shield-error.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/http-client-errors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/response-validation-error.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Withdraw an action request
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Withdraws a request you sent with actions/request while it is still waiting for the person. The card leaves their BotShield app. A request that was already answered, expired or withdrawn comes back as it stands with already_resolved true; an approval cannot be undone here. A withdrawn request is not billed.
|
|
34
|
+
*/
|
|
35
|
+
export function gatesActionsRequestCancel(
|
|
36
|
+
client: BotShieldCore,
|
|
37
|
+
security: operations.GatesApiActionsRequestCancelSecurity,
|
|
38
|
+
request: operations.GatesApiActionsRequestCancelRequest,
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): APIPromise<
|
|
41
|
+
Result<
|
|
42
|
+
operations.GatesApiActionsRequestCancelResponse,
|
|
43
|
+
| errors.InvalidInputError
|
|
44
|
+
| errors.ErrorResponse
|
|
45
|
+
| BotShieldError
|
|
46
|
+
| ResponseValidationError
|
|
47
|
+
| ConnectionError
|
|
48
|
+
| RequestAbortedError
|
|
49
|
+
| RequestTimeoutError
|
|
50
|
+
| InvalidRequestError
|
|
51
|
+
| UnexpectedClientError
|
|
52
|
+
| SDKValidationError
|
|
53
|
+
>
|
|
54
|
+
> {
|
|
55
|
+
return new APIPromise($do(
|
|
56
|
+
client,
|
|
57
|
+
security,
|
|
58
|
+
request,
|
|
59
|
+
options,
|
|
60
|
+
));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async function $do(
|
|
64
|
+
client: BotShieldCore,
|
|
65
|
+
security: operations.GatesApiActionsRequestCancelSecurity,
|
|
66
|
+
request: operations.GatesApiActionsRequestCancelRequest,
|
|
67
|
+
options?: RequestOptions,
|
|
68
|
+
): Promise<
|
|
69
|
+
[
|
|
70
|
+
Result<
|
|
71
|
+
operations.GatesApiActionsRequestCancelResponse,
|
|
72
|
+
| errors.InvalidInputError
|
|
73
|
+
| errors.ErrorResponse
|
|
74
|
+
| BotShieldError
|
|
75
|
+
| ResponseValidationError
|
|
76
|
+
| ConnectionError
|
|
77
|
+
| RequestAbortedError
|
|
78
|
+
| RequestTimeoutError
|
|
79
|
+
| InvalidRequestError
|
|
80
|
+
| UnexpectedClientError
|
|
81
|
+
| SDKValidationError
|
|
82
|
+
>,
|
|
83
|
+
APICall,
|
|
84
|
+
]
|
|
85
|
+
> {
|
|
86
|
+
const parsed = safeParse(
|
|
87
|
+
request,
|
|
88
|
+
(value) =>
|
|
89
|
+
operations.GatesApiActionsRequestCancelRequest$outboundSchema.parse(
|
|
90
|
+
value,
|
|
91
|
+
),
|
|
92
|
+
"Input validation failed",
|
|
93
|
+
);
|
|
94
|
+
if (!parsed.ok) {
|
|
95
|
+
return [parsed, { status: "invalid" }];
|
|
96
|
+
}
|
|
97
|
+
const payload = parsed.value;
|
|
98
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
99
|
+
|
|
100
|
+
const path = pathToFunc("/gates-api/actions/request-cancel")();
|
|
101
|
+
|
|
102
|
+
const headers = new Headers(compactMap({
|
|
103
|
+
"Content-Type": "application/json",
|
|
104
|
+
Accept: "application/json",
|
|
105
|
+
}));
|
|
106
|
+
|
|
107
|
+
const requestSecurity = resolveSecurity(
|
|
108
|
+
[
|
|
109
|
+
{
|
|
110
|
+
fieldName: "Authorization",
|
|
111
|
+
type: "apiKey:header",
|
|
112
|
+
value: security?.gatesKeyAuth,
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
const context = {
|
|
118
|
+
options: client._options,
|
|
119
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
120
|
+
operationID: "GatesApiActionsRequestCancel",
|
|
121
|
+
oAuth2Scopes: null,
|
|
122
|
+
|
|
123
|
+
resolvedSecurity: requestSecurity,
|
|
124
|
+
|
|
125
|
+
securitySource: security,
|
|
126
|
+
retryConfig: options?.retries
|
|
127
|
+
|| client._options.retryConfig
|
|
128
|
+
|| { strategy: "none" },
|
|
129
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const requestRes = client._createRequest(context, {
|
|
133
|
+
security: requestSecurity,
|
|
134
|
+
method: "POST",
|
|
135
|
+
baseURL: options?.serverURL,
|
|
136
|
+
path: path,
|
|
137
|
+
headers: headers,
|
|
138
|
+
body: body,
|
|
139
|
+
userAgent: client._options.userAgent,
|
|
140
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
141
|
+
}, options);
|
|
142
|
+
if (!requestRes.ok) {
|
|
143
|
+
return [requestRes, { status: "invalid" }];
|
|
144
|
+
}
|
|
145
|
+
const req = requestRes.value;
|
|
146
|
+
|
|
147
|
+
const doResult = await client._do(req, {
|
|
148
|
+
context,
|
|
149
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
150
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
151
|
+
retryConfig: context.retryConfig,
|
|
152
|
+
retryCodes: context.retryCodes,
|
|
153
|
+
});
|
|
154
|
+
if (!doResult.ok) {
|
|
155
|
+
return [doResult, { status: "request-error", request: req }];
|
|
156
|
+
}
|
|
157
|
+
const response = doResult.value;
|
|
158
|
+
|
|
159
|
+
const responseFields = {
|
|
160
|
+
HttpMeta: { Response: response, Request: req },
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
const [result] = await M.match<
|
|
164
|
+
operations.GatesApiActionsRequestCancelResponse,
|
|
165
|
+
| errors.InvalidInputError
|
|
166
|
+
| errors.ErrorResponse
|
|
167
|
+
| BotShieldError
|
|
168
|
+
| ResponseValidationError
|
|
169
|
+
| ConnectionError
|
|
170
|
+
| RequestAbortedError
|
|
171
|
+
| RequestTimeoutError
|
|
172
|
+
| InvalidRequestError
|
|
173
|
+
| UnexpectedClientError
|
|
174
|
+
| SDKValidationError
|
|
175
|
+
>(
|
|
176
|
+
M.json(200, operations.GatesApiActionsRequestCancelResponse$inboundSchema),
|
|
177
|
+
M.jsonErr(400, errors.InvalidInputError$inboundSchema),
|
|
178
|
+
M.jsonErr(500, errors.ErrorResponse$inboundSchema),
|
|
179
|
+
M.fail("4XX"),
|
|
180
|
+
M.fail("5XX"),
|
|
181
|
+
)(response, req, { extraFields: responseFields });
|
|
182
|
+
if (!result.ok) {
|
|
183
|
+
return [result, { status: "complete", request: req, response }];
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
return [result, { status: "complete", request: req, response }];
|
|
187
|
+
}
|
|
@@ -30,7 +30,7 @@ import { Result } from "../types/fp.js";
|
|
|
30
30
|
* Ask a linked person to confirm an action
|
|
31
31
|
*
|
|
32
32
|
* @remarks
|
|
33
|
-
* An agent asks, a person confirms. Puts ONE BotShield Action in front of a person already linked to your company, as a card in their BotShield app naming the agent that asked. The person approves with their passkey, which signs the act itself. Collect the action token with gates-api/actions/request-status and check it with sdk/verify-token (claims.act), exactly as for a tapped action. Idempotent on (agent, request_id).
|
|
33
|
+
* An agent asks, a person confirms. Puts ONE BotShield Action in front of a person already linked to your company, as a card in their BotShield app naming the agent that asked. The person approves with their passkey, which signs the act itself. Collect the action token with gates-api/actions/request-status and check it with sdk/verify-token (claims.act), exactly as for a tapped action. Idempotent on (agent, request_id). Or address the person by `phone_number` (no link needed beforehand; see the field).
|
|
34
34
|
*/
|
|
35
35
|
export function gatesActionsRequest(
|
|
36
36
|
client: BotShieldCore,
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { BotShieldCore } from "../core.js";
|
|
6
|
+
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { resolveSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import { BotShieldError } from "../models/errors/bot-shield-error.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/http-client-errors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/response-validation-error.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Rename a BotShield Action, or mark it staff can send
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Change an action's `name` (what the person reads on their card) or `staffCanSend` (your support team can send it to a customer), by its key. Send at least one.
|
|
34
|
+
*/
|
|
35
|
+
export function gatesActionsUpdate(
|
|
36
|
+
client: BotShieldCore,
|
|
37
|
+
security: operations.GatesApiActionsUpdateSecurity,
|
|
38
|
+
request: operations.GatesApiActionsUpdateRequest,
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): APIPromise<
|
|
41
|
+
Result<
|
|
42
|
+
operations.GatesApiActionsUpdateResponse,
|
|
43
|
+
| errors.InvalidInputError
|
|
44
|
+
| errors.ErrorResponse
|
|
45
|
+
| BotShieldError
|
|
46
|
+
| ResponseValidationError
|
|
47
|
+
| ConnectionError
|
|
48
|
+
| RequestAbortedError
|
|
49
|
+
| RequestTimeoutError
|
|
50
|
+
| InvalidRequestError
|
|
51
|
+
| UnexpectedClientError
|
|
52
|
+
| SDKValidationError
|
|
53
|
+
>
|
|
54
|
+
> {
|
|
55
|
+
return new APIPromise($do(
|
|
56
|
+
client,
|
|
57
|
+
security,
|
|
58
|
+
request,
|
|
59
|
+
options,
|
|
60
|
+
));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async function $do(
|
|
64
|
+
client: BotShieldCore,
|
|
65
|
+
security: operations.GatesApiActionsUpdateSecurity,
|
|
66
|
+
request: operations.GatesApiActionsUpdateRequest,
|
|
67
|
+
options?: RequestOptions,
|
|
68
|
+
): Promise<
|
|
69
|
+
[
|
|
70
|
+
Result<
|
|
71
|
+
operations.GatesApiActionsUpdateResponse,
|
|
72
|
+
| errors.InvalidInputError
|
|
73
|
+
| errors.ErrorResponse
|
|
74
|
+
| BotShieldError
|
|
75
|
+
| ResponseValidationError
|
|
76
|
+
| ConnectionError
|
|
77
|
+
| RequestAbortedError
|
|
78
|
+
| RequestTimeoutError
|
|
79
|
+
| InvalidRequestError
|
|
80
|
+
| UnexpectedClientError
|
|
81
|
+
| SDKValidationError
|
|
82
|
+
>,
|
|
83
|
+
APICall,
|
|
84
|
+
]
|
|
85
|
+
> {
|
|
86
|
+
const parsed = safeParse(
|
|
87
|
+
request,
|
|
88
|
+
(value) =>
|
|
89
|
+
operations.GatesApiActionsUpdateRequest$outboundSchema.parse(value),
|
|
90
|
+
"Input validation failed",
|
|
91
|
+
);
|
|
92
|
+
if (!parsed.ok) {
|
|
93
|
+
return [parsed, { status: "invalid" }];
|
|
94
|
+
}
|
|
95
|
+
const payload = parsed.value;
|
|
96
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
97
|
+
|
|
98
|
+
const path = pathToFunc("/gates-api/actions/update")();
|
|
99
|
+
|
|
100
|
+
const headers = new Headers(compactMap({
|
|
101
|
+
"Content-Type": "application/json",
|
|
102
|
+
Accept: "application/json",
|
|
103
|
+
}));
|
|
104
|
+
|
|
105
|
+
const requestSecurity = resolveSecurity(
|
|
106
|
+
[
|
|
107
|
+
{
|
|
108
|
+
fieldName: "Authorization",
|
|
109
|
+
type: "apiKey:header",
|
|
110
|
+
value: security?.gatesKeyAuth,
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
const context = {
|
|
116
|
+
options: client._options,
|
|
117
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
118
|
+
operationID: "GatesApiActionsUpdate",
|
|
119
|
+
oAuth2Scopes: null,
|
|
120
|
+
|
|
121
|
+
resolvedSecurity: requestSecurity,
|
|
122
|
+
|
|
123
|
+
securitySource: security,
|
|
124
|
+
retryConfig: options?.retries
|
|
125
|
+
|| client._options.retryConfig
|
|
126
|
+
|| { strategy: "none" },
|
|
127
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const requestRes = client._createRequest(context, {
|
|
131
|
+
security: requestSecurity,
|
|
132
|
+
method: "POST",
|
|
133
|
+
baseURL: options?.serverURL,
|
|
134
|
+
path: path,
|
|
135
|
+
headers: headers,
|
|
136
|
+
body: body,
|
|
137
|
+
userAgent: client._options.userAgent,
|
|
138
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
139
|
+
}, options);
|
|
140
|
+
if (!requestRes.ok) {
|
|
141
|
+
return [requestRes, { status: "invalid" }];
|
|
142
|
+
}
|
|
143
|
+
const req = requestRes.value;
|
|
144
|
+
|
|
145
|
+
const doResult = await client._do(req, {
|
|
146
|
+
context,
|
|
147
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
148
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
149
|
+
retryConfig: context.retryConfig,
|
|
150
|
+
retryCodes: context.retryCodes,
|
|
151
|
+
});
|
|
152
|
+
if (!doResult.ok) {
|
|
153
|
+
return [doResult, { status: "request-error", request: req }];
|
|
154
|
+
}
|
|
155
|
+
const response = doResult.value;
|
|
156
|
+
|
|
157
|
+
const responseFields = {
|
|
158
|
+
HttpMeta: { Response: response, Request: req },
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
const [result] = await M.match<
|
|
162
|
+
operations.GatesApiActionsUpdateResponse,
|
|
163
|
+
| errors.InvalidInputError
|
|
164
|
+
| errors.ErrorResponse
|
|
165
|
+
| BotShieldError
|
|
166
|
+
| ResponseValidationError
|
|
167
|
+
| ConnectionError
|
|
168
|
+
| RequestAbortedError
|
|
169
|
+
| RequestTimeoutError
|
|
170
|
+
| InvalidRequestError
|
|
171
|
+
| UnexpectedClientError
|
|
172
|
+
| SDKValidationError
|
|
173
|
+
>(
|
|
174
|
+
M.json(200, operations.GatesApiActionsUpdateResponse$inboundSchema),
|
|
175
|
+
M.jsonErr(400, errors.InvalidInputError$inboundSchema),
|
|
176
|
+
M.jsonErr(500, errors.ErrorResponse$inboundSchema),
|
|
177
|
+
M.fail("4XX"),
|
|
178
|
+
M.fail("5XX"),
|
|
179
|
+
)(response, req, { extraFields: responseFields });
|
|
180
|
+
if (!result.ok) {
|
|
181
|
+
return [result, { status: "complete", request: req, response }];
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
return [result, { status: "complete", request: req, response }];
|
|
185
|
+
}
|