botshield-sdk 2.2.0 → 2.2.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 +30 -0
- package/bin/mcp-server.js +1230 -42
- package/bin/mcp-server.js.map +31 -13
- 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-create.d.ts +18 -0
- package/dist/commonjs/funcs/gates-actions-create.d.ts.map +1 -0
- package/dist/commonjs/funcs/gates-actions-create.js +123 -0
- package/dist/commonjs/funcs/gates-actions-create.js.map +1 -0
- package/dist/commonjs/funcs/gates-actions-list.d.ts +18 -0
- package/dist/commonjs/funcs/gates-actions-list.d.ts.map +1 -0
- package/dist/commonjs/funcs/gates-actions-list.js +113 -0
- package/dist/commonjs/funcs/gates-actions-list.js.map +1 -0
- package/dist/commonjs/funcs/gates-actions-request-status.d.ts +18 -0
- package/dist/commonjs/funcs/gates-actions-request-status.d.ts.map +1 -0
- package/dist/commonjs/funcs/gates-actions-request-status.js +127 -0
- package/dist/commonjs/funcs/gates-actions-request-status.js.map +1 -0
- package/dist/commonjs/funcs/gates-actions-request.d.ts +18 -0
- package/dist/commonjs/funcs/gates-actions-request.d.ts.map +1 -0
- package/dist/commonjs/funcs/gates-actions-request.js +123 -0
- package/dist/commonjs/funcs/gates-actions-request.js.map +1 -0
- package/dist/commonjs/funcs/gates-actions-set-state.d.ts +18 -0
- package/dist/commonjs/funcs/gates-actions-set-state.d.ts.map +1 -0
- package/dist/commonjs/funcs/gates-actions-set-state.js +123 -0
- package/dist/commonjs/funcs/gates-actions-set-state.js.map +1 -0
- package/dist/commonjs/funcs/gates-activate.d.ts +18 -0
- package/dist/commonjs/funcs/gates-activate.d.ts.map +1 -0
- package/dist/commonjs/funcs/gates-activate.js +123 -0
- package/dist/commonjs/funcs/gates-activate.js.map +1 -0
- package/dist/commonjs/funcs/gates-cancel.d.ts +18 -0
- package/dist/commonjs/funcs/gates-cancel.d.ts.map +1 -0
- package/dist/commonjs/funcs/gates-cancel.js +123 -0
- package/dist/commonjs/funcs/gates-cancel.js.map +1 -0
- package/dist/commonjs/funcs/gates-close.d.ts +18 -0
- package/dist/commonjs/funcs/gates-close.d.ts.map +1 -0
- package/dist/commonjs/funcs/gates-close.js +123 -0
- package/dist/commonjs/funcs/gates-close.js.map +1 -0
- package/dist/commonjs/funcs/gates-create.d.ts +18 -0
- package/dist/commonjs/funcs/gates-create.d.ts.map +1 -0
- package/dist/commonjs/funcs/gates-create.js +123 -0
- package/dist/commonjs/funcs/gates-create.js.map +1 -0
- package/dist/commonjs/funcs/gates-extend.d.ts +18 -0
- package/dist/commonjs/funcs/gates-extend.d.ts.map +1 -0
- package/dist/commonjs/funcs/gates-extend.js +123 -0
- package/dist/commonjs/funcs/gates-extend.js.map +1 -0
- package/dist/commonjs/funcs/gates-get.d.ts +18 -0
- package/dist/commonjs/funcs/gates-get.d.ts.map +1 -0
- package/dist/commonjs/funcs/gates-get.js +126 -0
- package/dist/commonjs/funcs/gates-get.js.map +1 -0
- package/dist/commonjs/funcs/gates-list.d.ts +18 -0
- package/dist/commonjs/funcs/gates-list.d.ts.map +1 -0
- package/dist/commonjs/funcs/gates-list.js +126 -0
- package/dist/commonjs/funcs/gates-list.js.map +1 -0
- 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 +71 -0
- package/dist/commonjs/models/bot-shield-action.d.ts.map +1 -0
- package/dist/commonjs/models/bot-shield-action.js +108 -0
- package/dist/commonjs/models/bot-shield-action.js.map +1 -0
- package/dist/commonjs/models/gate-policy-doc.d.ts +126 -0
- package/dist/commonjs/models/gate-policy-doc.d.ts.map +1 -0
- package/dist/commonjs/models/gate-policy-doc.js +125 -0
- package/dist/commonjs/models/gate-policy-doc.js.map +1 -0
- package/dist/commonjs/models/gate-schedule.d.ts +28 -0
- package/dist/commonjs/models/gate-schedule.d.ts.map +1 -0
- package/dist/commonjs/models/gate-schedule.js +61 -0
- package/dist/commonjs/models/gate-schedule.js.map +1 -0
- package/dist/commonjs/models/gate.d.ts +215 -0
- package/dist/commonjs/models/gate.d.ts.map +1 -0
- package/dist/commonjs/models/gate.js +236 -0
- package/dist/commonjs/models/gate.js.map +1 -0
- package/dist/commonjs/models/gates-api-error.d.ts +24 -0
- package/dist/commonjs/models/gates-api-error.d.ts.map +1 -0
- package/dist/commonjs/models/gates-api-error.js +63 -0
- package/dist/commonjs/models/gates-api-error.js.map +1 -0
- package/dist/commonjs/models/index.d.ts +6 -0
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +6 -0
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/operations/actions-propose.d.ts +8 -8
- package/dist/commonjs/models/operations/actions-propose.d.ts.map +1 -1
- package/dist/commonjs/models/operations/actions-propose.js +11 -12
- package/dist/commonjs/models/operations/actions-propose.js.map +1 -1
- package/dist/commonjs/models/operations/gates-api-actions-create.d.ts +94 -0
- package/dist/commonjs/models/operations/gates-api-actions-create.d.ts.map +1 -0
- package/dist/commonjs/models/operations/gates-api-actions-create.js +139 -0
- package/dist/commonjs/models/operations/gates-api-actions-create.js.map +1 -0
- package/dist/commonjs/models/operations/gates-api-actions-list.d.ts +65 -0
- package/dist/commonjs/models/operations/gates-api-actions-list.d.ts.map +1 -0
- package/dist/commonjs/models/operations/gates-api-actions-list.js +119 -0
- package/dist/commonjs/models/operations/gates-api-actions-list.js.map +1 -0
- package/dist/commonjs/models/operations/gates-api-actions-request-status.d.ts +108 -0
- package/dist/commonjs/models/operations/gates-api-actions-request-status.d.ts.map +1 -0
- package/dist/commonjs/models/operations/gates-api-actions-request-status.js +186 -0
- package/dist/commonjs/models/operations/gates-api-actions-request-status.js.map +1 -0
- package/dist/commonjs/models/operations/gates-api-actions-request.d.ts +128 -0
- package/dist/commonjs/models/operations/gates-api-actions-request.d.ts.map +1 -0
- package/dist/commonjs/models/operations/gates-api-actions-request.js +189 -0
- package/dist/commonjs/models/operations/gates-api-actions-request.js.map +1 -0
- package/dist/commonjs/models/operations/gates-api-actions-set-state.d.ts +96 -0
- package/dist/commonjs/models/operations/gates-api-actions-set-state.d.ts.map +1 -0
- package/dist/commonjs/models/operations/gates-api-actions-set-state.js +145 -0
- package/dist/commonjs/models/operations/gates-api-actions-set-state.js.map +1 -0
- package/dist/commonjs/models/operations/gates-api-activate.d.ts +84 -0
- package/dist/commonjs/models/operations/gates-api-activate.d.ts.map +1 -0
- package/dist/commonjs/models/operations/gates-api-activate.js +135 -0
- package/dist/commonjs/models/operations/gates-api-activate.js.map +1 -0
- package/dist/commonjs/models/operations/gates-api-cancel.d.ts +84 -0
- package/dist/commonjs/models/operations/gates-api-cancel.d.ts.map +1 -0
- package/dist/commonjs/models/operations/gates-api-cancel.js +135 -0
- package/dist/commonjs/models/operations/gates-api-cancel.js.map +1 -0
- package/dist/commonjs/models/operations/gates-api-close.d.ts +89 -0
- package/dist/commonjs/models/operations/gates-api-close.d.ts.map +1 -0
- package/dist/commonjs/models/operations/gates-api-close.js +145 -0
- package/dist/commonjs/models/operations/gates-api-close.js.map +1 -0
- package/dist/commonjs/models/operations/gates-api-create.d.ts +173 -0
- package/dist/commonjs/models/operations/gates-api-create.d.ts.map +1 -0
- package/dist/commonjs/models/operations/gates-api-create.js +198 -0
- package/dist/commonjs/models/operations/gates-api-create.js.map +1 -0
- package/dist/commonjs/models/operations/gates-api-extend.d.ts +99 -0
- package/dist/commonjs/models/operations/gates-api-extend.d.ts.map +1 -0
- package/dist/commonjs/models/operations/gates-api-extend.js +141 -0
- package/dist/commonjs/models/operations/gates-api-extend.js.map +1 -0
- package/dist/commonjs/models/operations/gates-api-get.d.ts +84 -0
- package/dist/commonjs/models/operations/gates-api-get.d.ts.map +1 -0
- package/dist/commonjs/models/operations/gates-api-get.js +135 -0
- package/dist/commonjs/models/operations/gates-api-get.js.map +1 -0
- package/dist/commonjs/models/operations/gates-api-list.d.ts +81 -0
- package/dist/commonjs/models/operations/gates-api-list.d.ts.map +1 -0
- package/dist/commonjs/models/operations/gates-api-list.js +135 -0
- package/dist/commonjs/models/operations/gates-api-list.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +12 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +12 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/sdk-create-verification-link.d.ts +22 -12
- package/dist/commonjs/models/operations/sdk-create-verification-link.d.ts.map +1 -1
- package/dist/commonjs/models/operations/sdk-create-verification-link.js +17 -11
- package/dist/commonjs/models/operations/sdk-create-verification-link.js.map +1 -1
- package/dist/commonjs/models/operations/sdk-verify-token.d.ts +6 -6
- package/dist/commonjs/models/operations/sdk-verify-token.d.ts.map +1 -1
- package/dist/commonjs/models/operations/sdk-verify-token.js +2 -4
- package/dist/commonjs/models/operations/sdk-verify-token.js.map +1 -1
- package/dist/commonjs/models/operations/secured-accounts-status.d.ts +5 -5
- package/dist/commonjs/models/operations/secured-accounts-status.d.ts.map +1 -1
- package/dist/commonjs/models/operations/secured-accounts-status.js +6 -6
- package/dist/commonjs/models/operations/secured-accounts-status.js.map +1 -1
- package/dist/commonjs/models/operations/verification-get-status.d.ts +141 -0
- package/dist/commonjs/models/operations/verification-get-status.d.ts.map +1 -1
- package/dist/commonjs/models/operations/verification-get-status.js +127 -1
- package/dist/commonjs/models/operations/verification-get-status.js.map +1 -1
- package/dist/commonjs/models/passes-per-person.d.ts +34 -0
- package/dist/commonjs/models/passes-per-person.d.ts.map +1 -0
- package/dist/commonjs/models/passes-per-person.js +72 -0
- package/dist/commonjs/models/passes-per-person.js.map +1 -0
- package/dist/commonjs/sdk/census.d.ts +1 -1
- package/dist/commonjs/sdk/census.js +1 -1
- package/dist/commonjs/sdk/gates-actions.d.ts +40 -0
- package/dist/commonjs/sdk/gates-actions.d.ts.map +1 -0
- package/dist/commonjs/sdk/gates-actions.js +62 -0
- package/dist/commonjs/sdk/gates-actions.js.map +1 -0
- package/dist/commonjs/sdk/gates.d.ts +57 -0
- package/dist/commonjs/sdk/gates.d.ts.map +1 -0
- package/dist/commonjs/sdk/gates.js +87 -0
- package/dist/commonjs/sdk/gates.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +3 -0
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +5 -0
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- 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-create.d.ts +18 -0
- package/dist/esm/funcs/gates-actions-create.d.ts.map +1 -0
- package/dist/esm/funcs/gates-actions-create.js +87 -0
- package/dist/esm/funcs/gates-actions-create.js.map +1 -0
- package/dist/esm/funcs/gates-actions-list.d.ts +18 -0
- package/dist/esm/funcs/gates-actions-list.d.ts.map +1 -0
- package/dist/esm/funcs/gates-actions-list.js +77 -0
- package/dist/esm/funcs/gates-actions-list.js.map +1 -0
- package/dist/esm/funcs/gates-actions-request-status.d.ts +18 -0
- package/dist/esm/funcs/gates-actions-request-status.d.ts.map +1 -0
- package/dist/esm/funcs/gates-actions-request-status.js +91 -0
- package/dist/esm/funcs/gates-actions-request-status.js.map +1 -0
- package/dist/esm/funcs/gates-actions-request.d.ts +18 -0
- package/dist/esm/funcs/gates-actions-request.d.ts.map +1 -0
- package/dist/esm/funcs/gates-actions-request.js +87 -0
- package/dist/esm/funcs/gates-actions-request.js.map +1 -0
- package/dist/esm/funcs/gates-actions-set-state.d.ts +18 -0
- package/dist/esm/funcs/gates-actions-set-state.d.ts.map +1 -0
- package/dist/esm/funcs/gates-actions-set-state.js +87 -0
- package/dist/esm/funcs/gates-actions-set-state.js.map +1 -0
- package/dist/esm/funcs/gates-activate.d.ts +18 -0
- package/dist/esm/funcs/gates-activate.d.ts.map +1 -0
- package/dist/esm/funcs/gates-activate.js +87 -0
- package/dist/esm/funcs/gates-activate.js.map +1 -0
- package/dist/esm/funcs/gates-cancel.d.ts +18 -0
- package/dist/esm/funcs/gates-cancel.d.ts.map +1 -0
- package/dist/esm/funcs/gates-cancel.js +87 -0
- package/dist/esm/funcs/gates-cancel.js.map +1 -0
- package/dist/esm/funcs/gates-close.d.ts +18 -0
- package/dist/esm/funcs/gates-close.d.ts.map +1 -0
- package/dist/esm/funcs/gates-close.js +87 -0
- package/dist/esm/funcs/gates-close.js.map +1 -0
- package/dist/esm/funcs/gates-create.d.ts +18 -0
- package/dist/esm/funcs/gates-create.d.ts.map +1 -0
- package/dist/esm/funcs/gates-create.js +87 -0
- package/dist/esm/funcs/gates-create.js.map +1 -0
- package/dist/esm/funcs/gates-extend.d.ts +18 -0
- package/dist/esm/funcs/gates-extend.d.ts.map +1 -0
- package/dist/esm/funcs/gates-extend.js +87 -0
- package/dist/esm/funcs/gates-extend.js.map +1 -0
- package/dist/esm/funcs/gates-get.d.ts +18 -0
- package/dist/esm/funcs/gates-get.d.ts.map +1 -0
- package/dist/esm/funcs/gates-get.js +90 -0
- package/dist/esm/funcs/gates-get.js.map +1 -0
- package/dist/esm/funcs/gates-list.d.ts +18 -0
- package/dist/esm/funcs/gates-list.d.ts.map +1 -0
- package/dist/esm/funcs/gates-list.js +90 -0
- package/dist/esm/funcs/gates-list.js.map +1 -0
- 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 +71 -0
- package/dist/esm/models/bot-shield-action.d.ts.map +1 -0
- package/dist/esm/models/bot-shield-action.js +70 -0
- package/dist/esm/models/bot-shield-action.js.map +1 -0
- package/dist/esm/models/gate-policy-doc.d.ts +126 -0
- package/dist/esm/models/gate-policy-doc.d.ts.map +1 -0
- package/dist/esm/models/gate-policy-doc.js +87 -0
- package/dist/esm/models/gate-policy-doc.js.map +1 -0
- package/dist/esm/models/gate-schedule.d.ts +28 -0
- package/dist/esm/models/gate-schedule.d.ts.map +1 -0
- package/dist/esm/models/gate-schedule.js +23 -0
- package/dist/esm/models/gate-schedule.js.map +1 -0
- package/dist/esm/models/gate.d.ts +215 -0
- package/dist/esm/models/gate.d.ts.map +1 -0
- package/dist/esm/models/gate.js +194 -0
- package/dist/esm/models/gate.js.map +1 -0
- package/dist/esm/models/gates-api-error.d.ts +24 -0
- package/dist/esm/models/gates-api-error.d.ts.map +1 -0
- package/dist/esm/models/gates-api-error.js +25 -0
- package/dist/esm/models/gates-api-error.js.map +1 -0
- package/dist/esm/models/index.d.ts +6 -0
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +6 -0
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/operations/actions-propose.d.ts +8 -8
- package/dist/esm/models/operations/actions-propose.d.ts.map +1 -1
- package/dist/esm/models/operations/actions-propose.js +8 -9
- package/dist/esm/models/operations/actions-propose.js.map +1 -1
- package/dist/esm/models/operations/gates-api-actions-create.d.ts +94 -0
- package/dist/esm/models/operations/gates-api-actions-create.d.ts.map +1 -0
- package/dist/esm/models/operations/gates-api-actions-create.js +93 -0
- package/dist/esm/models/operations/gates-api-actions-create.js.map +1 -0
- package/dist/esm/models/operations/gates-api-actions-list.d.ts +65 -0
- package/dist/esm/models/operations/gates-api-actions-list.d.ts.map +1 -0
- package/dist/esm/models/operations/gates-api-actions-list.js +75 -0
- package/dist/esm/models/operations/gates-api-actions-list.js.map +1 -0
- package/dist/esm/models/operations/gates-api-actions-request-status.d.ts +108 -0
- package/dist/esm/models/operations/gates-api-actions-request-status.d.ts.map +1 -0
- package/dist/esm/models/operations/gates-api-actions-request-status.js +140 -0
- package/dist/esm/models/operations/gates-api-actions-request-status.js.map +1 -0
- package/dist/esm/models/operations/gates-api-actions-request.d.ts +128 -0
- package/dist/esm/models/operations/gates-api-actions-request.d.ts.map +1 -0
- package/dist/esm/models/operations/gates-api-actions-request.js +143 -0
- package/dist/esm/models/operations/gates-api-actions-request.js.map +1 -0
- package/dist/esm/models/operations/gates-api-actions-set-state.d.ts +96 -0
- package/dist/esm/models/operations/gates-api-actions-set-state.d.ts.map +1 -0
- package/dist/esm/models/operations/gates-api-actions-set-state.js +99 -0
- package/dist/esm/models/operations/gates-api-actions-set-state.js.map +1 -0
- package/dist/esm/models/operations/gates-api-activate.d.ts +84 -0
- package/dist/esm/models/operations/gates-api-activate.d.ts.map +1 -0
- package/dist/esm/models/operations/gates-api-activate.js +89 -0
- package/dist/esm/models/operations/gates-api-activate.js.map +1 -0
- package/dist/esm/models/operations/gates-api-cancel.d.ts +84 -0
- package/dist/esm/models/operations/gates-api-cancel.d.ts.map +1 -0
- package/dist/esm/models/operations/gates-api-cancel.js +89 -0
- package/dist/esm/models/operations/gates-api-cancel.js.map +1 -0
- package/dist/esm/models/operations/gates-api-close.d.ts +89 -0
- package/dist/esm/models/operations/gates-api-close.d.ts.map +1 -0
- package/dist/esm/models/operations/gates-api-close.js +99 -0
- package/dist/esm/models/operations/gates-api-close.js.map +1 -0
- package/dist/esm/models/operations/gates-api-create.d.ts +173 -0
- package/dist/esm/models/operations/gates-api-create.d.ts.map +1 -0
- package/dist/esm/models/operations/gates-api-create.js +152 -0
- package/dist/esm/models/operations/gates-api-create.js.map +1 -0
- package/dist/esm/models/operations/gates-api-extend.d.ts +99 -0
- package/dist/esm/models/operations/gates-api-extend.d.ts.map +1 -0
- package/dist/esm/models/operations/gates-api-extend.js +95 -0
- package/dist/esm/models/operations/gates-api-extend.js.map +1 -0
- package/dist/esm/models/operations/gates-api-get.d.ts +84 -0
- package/dist/esm/models/operations/gates-api-get.d.ts.map +1 -0
- package/dist/esm/models/operations/gates-api-get.js +89 -0
- package/dist/esm/models/operations/gates-api-get.js.map +1 -0
- package/dist/esm/models/operations/gates-api-list.d.ts +81 -0
- package/dist/esm/models/operations/gates-api-list.d.ts.map +1 -0
- package/dist/esm/models/operations/gates-api-list.js +89 -0
- package/dist/esm/models/operations/gates-api-list.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +12 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +12 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/sdk-create-verification-link.d.ts +22 -12
- package/dist/esm/models/operations/sdk-create-verification-link.d.ts.map +1 -1
- package/dist/esm/models/operations/sdk-create-verification-link.js +16 -10
- package/dist/esm/models/operations/sdk-create-verification-link.js.map +1 -1
- package/dist/esm/models/operations/sdk-verify-token.d.ts +6 -6
- package/dist/esm/models/operations/sdk-verify-token.d.ts.map +1 -1
- package/dist/esm/models/operations/sdk-verify-token.js +2 -4
- package/dist/esm/models/operations/sdk-verify-token.js.map +1 -1
- package/dist/esm/models/operations/secured-accounts-status.d.ts +5 -5
- package/dist/esm/models/operations/secured-accounts-status.d.ts.map +1 -1
- package/dist/esm/models/operations/secured-accounts-status.js +5 -5
- package/dist/esm/models/operations/secured-accounts-status.js.map +1 -1
- package/dist/esm/models/operations/verification-get-status.d.ts +141 -0
- package/dist/esm/models/operations/verification-get-status.d.ts.map +1 -1
- package/dist/esm/models/operations/verification-get-status.js +122 -0
- package/dist/esm/models/operations/verification-get-status.js.map +1 -1
- package/dist/esm/models/passes-per-person.d.ts +34 -0
- package/dist/esm/models/passes-per-person.d.ts.map +1 -0
- package/dist/esm/models/passes-per-person.js +34 -0
- package/dist/esm/models/passes-per-person.js.map +1 -0
- package/dist/esm/sdk/census.d.ts +1 -1
- package/dist/esm/sdk/census.js +1 -1
- package/dist/esm/sdk/gates-actions.d.ts +40 -0
- package/dist/esm/sdk/gates-actions.d.ts.map +1 -0
- package/dist/esm/sdk/gates-actions.js +58 -0
- package/dist/esm/sdk/gates-actions.js.map +1 -0
- package/dist/esm/sdk/gates.d.ts +57 -0
- package/dist/esm/sdk/gates.d.ts.map +1 -0
- package/dist/esm/sdk/gates.js +83 -0
- package/dist/esm/sdk/gates.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +3 -0
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +5 -0
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/census-verify-token.ts +1 -1
- package/src/funcs/gates-actions-create.ts +185 -0
- package/src/funcs/gates-actions-list.ts +166 -0
- package/src/funcs/gates-actions-request-status.ts +192 -0
- package/src/funcs/gates-actions-request.ts +185 -0
- package/src/funcs/gates-actions-set-state.ts +185 -0
- package/src/funcs/gates-activate.ts +184 -0
- package/src/funcs/gates-cancel.ts +184 -0
- package/src/funcs/gates-close.ts +184 -0
- package/src/funcs/gates-create.ts +184 -0
- package/src/funcs/gates-extend.ts +184 -0
- package/src/funcs/gates-get.ts +188 -0
- package/src/funcs/gates-list.ts +189 -0
- 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 +156 -0
- package/src/models/gate-policy-doc.ts +202 -0
- package/src/models/gate-schedule.ts +61 -0
- package/src/models/gate.ts +424 -0
- package/src/models/gates-api-error.ts +59 -0
- package/src/models/index.ts +6 -0
- package/src/models/operations/actions-propose.ts +34 -27
- package/src/models/operations/gates-api-actions-create.ts +274 -0
- package/src/models/operations/gates-api-actions-list.ts +207 -0
- package/src/models/operations/gates-api-actions-request-status.ts +342 -0
- package/src/models/operations/gates-api-actions-request.ts +359 -0
- package/src/models/operations/gates-api-actions-set-state.ts +284 -0
- package/src/models/operations/gates-api-activate.ts +250 -0
- package/src/models/operations/gates-api-cancel.ts +250 -0
- package/src/models/operations/gates-api-close.ts +265 -0
- package/src/models/operations/gates-api-create.ts +387 -0
- package/src/models/operations/gates-api-extend.ts +271 -0
- package/src/models/operations/gates-api-get.ts +248 -0
- package/src/models/operations/gates-api-list.ts +247 -0
- package/src/models/operations/index.ts +12 -0
- package/src/models/operations/sdk-create-verification-link.ts +46 -24
- package/src/models/operations/sdk-verify-token.ts +8 -10
- package/src/models/operations/secured-accounts-status.ts +17 -9
- package/src/models/operations/verification-get-status.ts +281 -0
- package/src/models/passes-per-person.ts +74 -0
- package/src/sdk/census.ts +1 -1
- package/src/sdk/gates-actions.ts +107 -0
- package/src/sdk/gates.ts +155 -0
- package/src/sdk/sdk.ts +6 -0
|
@@ -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
|
+
* Ask a linked person to confirm an action
|
|
31
|
+
*
|
|
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).
|
|
34
|
+
*/
|
|
35
|
+
export function gatesActionsRequest(
|
|
36
|
+
client: BotShieldCore,
|
|
37
|
+
security: operations.GatesApiActionsRequestSecurity,
|
|
38
|
+
request: operations.GatesApiActionsRequestRequest,
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): APIPromise<
|
|
41
|
+
Result<
|
|
42
|
+
operations.GatesApiActionsRequestResponse,
|
|
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.GatesApiActionsRequestSecurity,
|
|
66
|
+
request: operations.GatesApiActionsRequestRequest,
|
|
67
|
+
options?: RequestOptions,
|
|
68
|
+
): Promise<
|
|
69
|
+
[
|
|
70
|
+
Result<
|
|
71
|
+
operations.GatesApiActionsRequestResponse,
|
|
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.GatesApiActionsRequestRequest$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/request")();
|
|
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: "GatesApiActionsRequest",
|
|
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.GatesApiActionsRequestResponse,
|
|
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.GatesApiActionsRequestResponse$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
|
+
}
|
|
@@ -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
|
+
* Turn a BotShield Action on or off
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Turn an action on (`live`) or `off` by its key. Off takes effect at once — new requests are refused with `action_off`, and a tap in flight fails at completion. Idempotent.
|
|
34
|
+
*/
|
|
35
|
+
export function gatesActionsSetState(
|
|
36
|
+
client: BotShieldCore,
|
|
37
|
+
security: operations.GatesApiActionsSetStateSecurity,
|
|
38
|
+
request: operations.GatesApiActionsSetStateRequest,
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): APIPromise<
|
|
41
|
+
Result<
|
|
42
|
+
operations.GatesApiActionsSetStateResponse,
|
|
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.GatesApiActionsSetStateSecurity,
|
|
66
|
+
request: operations.GatesApiActionsSetStateRequest,
|
|
67
|
+
options?: RequestOptions,
|
|
68
|
+
): Promise<
|
|
69
|
+
[
|
|
70
|
+
Result<
|
|
71
|
+
operations.GatesApiActionsSetStateResponse,
|
|
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.GatesApiActionsSetStateRequest$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/set-state")();
|
|
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: "GatesApiActionsSetState",
|
|
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.GatesApiActionsSetStateResponse,
|
|
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.GatesApiActionsSetStateResponse$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
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
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
|
+
* Activate a gate
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Make a draft gate live. Idempotent — an active gate is returned as-is. In Production the gate goes live only when the business is verified, a domain is verified and the plan's gate allowance has room.
|
|
34
|
+
*/
|
|
35
|
+
export function gatesActivate(
|
|
36
|
+
client: BotShieldCore,
|
|
37
|
+
security: operations.GatesApiActivateSecurity,
|
|
38
|
+
request: operations.GatesApiActivateRequest,
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): APIPromise<
|
|
41
|
+
Result<
|
|
42
|
+
operations.GatesApiActivateResponse,
|
|
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.GatesApiActivateSecurity,
|
|
66
|
+
request: operations.GatesApiActivateRequest,
|
|
67
|
+
options?: RequestOptions,
|
|
68
|
+
): Promise<
|
|
69
|
+
[
|
|
70
|
+
Result<
|
|
71
|
+
operations.GatesApiActivateResponse,
|
|
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) => operations.GatesApiActivateRequest$outboundSchema.parse(value),
|
|
89
|
+
"Input validation failed",
|
|
90
|
+
);
|
|
91
|
+
if (!parsed.ok) {
|
|
92
|
+
return [parsed, { status: "invalid" }];
|
|
93
|
+
}
|
|
94
|
+
const payload = parsed.value;
|
|
95
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
96
|
+
|
|
97
|
+
const path = pathToFunc("/gates-api/activate")();
|
|
98
|
+
|
|
99
|
+
const headers = new Headers(compactMap({
|
|
100
|
+
"Content-Type": "application/json",
|
|
101
|
+
Accept: "application/json",
|
|
102
|
+
}));
|
|
103
|
+
|
|
104
|
+
const requestSecurity = resolveSecurity(
|
|
105
|
+
[
|
|
106
|
+
{
|
|
107
|
+
fieldName: "Authorization",
|
|
108
|
+
type: "apiKey:header",
|
|
109
|
+
value: security?.gatesKeyAuth,
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
const context = {
|
|
115
|
+
options: client._options,
|
|
116
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
117
|
+
operationID: "GatesApiActivate",
|
|
118
|
+
oAuth2Scopes: null,
|
|
119
|
+
|
|
120
|
+
resolvedSecurity: requestSecurity,
|
|
121
|
+
|
|
122
|
+
securitySource: security,
|
|
123
|
+
retryConfig: options?.retries
|
|
124
|
+
|| client._options.retryConfig
|
|
125
|
+
|| { strategy: "none" },
|
|
126
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const requestRes = client._createRequest(context, {
|
|
130
|
+
security: requestSecurity,
|
|
131
|
+
method: "POST",
|
|
132
|
+
baseURL: options?.serverURL,
|
|
133
|
+
path: path,
|
|
134
|
+
headers: headers,
|
|
135
|
+
body: body,
|
|
136
|
+
userAgent: client._options.userAgent,
|
|
137
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
138
|
+
}, options);
|
|
139
|
+
if (!requestRes.ok) {
|
|
140
|
+
return [requestRes, { status: "invalid" }];
|
|
141
|
+
}
|
|
142
|
+
const req = requestRes.value;
|
|
143
|
+
|
|
144
|
+
const doResult = await client._do(req, {
|
|
145
|
+
context,
|
|
146
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
147
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
148
|
+
retryConfig: context.retryConfig,
|
|
149
|
+
retryCodes: context.retryCodes,
|
|
150
|
+
});
|
|
151
|
+
if (!doResult.ok) {
|
|
152
|
+
return [doResult, { status: "request-error", request: req }];
|
|
153
|
+
}
|
|
154
|
+
const response = doResult.value;
|
|
155
|
+
|
|
156
|
+
const responseFields = {
|
|
157
|
+
HttpMeta: { Response: response, Request: req },
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const [result] = await M.match<
|
|
161
|
+
operations.GatesApiActivateResponse,
|
|
162
|
+
| errors.InvalidInputError
|
|
163
|
+
| errors.ErrorResponse
|
|
164
|
+
| BotShieldError
|
|
165
|
+
| ResponseValidationError
|
|
166
|
+
| ConnectionError
|
|
167
|
+
| RequestAbortedError
|
|
168
|
+
| RequestTimeoutError
|
|
169
|
+
| InvalidRequestError
|
|
170
|
+
| UnexpectedClientError
|
|
171
|
+
| SDKValidationError
|
|
172
|
+
>(
|
|
173
|
+
M.json(200, operations.GatesApiActivateResponse$inboundSchema),
|
|
174
|
+
M.jsonErr(400, errors.InvalidInputError$inboundSchema),
|
|
175
|
+
M.jsonErr(500, errors.ErrorResponse$inboundSchema),
|
|
176
|
+
M.fail("4XX"),
|
|
177
|
+
M.fail("5XX"),
|
|
178
|
+
)(response, req, { extraFields: responseFields });
|
|
179
|
+
if (!result.ok) {
|
|
180
|
+
return [result, { status: "complete", request: req, response }];
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
return [result, { status: "complete", request: req, response }];
|
|
184
|
+
}
|