botshield-sdk 4.0.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.
Files changed (203) hide show
  1. package/README.md +14 -0
  2. package/bin/mcp-server.js +385 -14
  3. package/bin/mcp-server.js.map +22 -18
  4. package/dist/commonjs/funcs/census-verify-token.d.ts +1 -1
  5. package/dist/commonjs/funcs/census-verify-token.js +1 -1
  6. package/dist/commonjs/funcs/recovery-exchange.d.ts +18 -0
  7. package/dist/commonjs/funcs/recovery-exchange.d.ts.map +1 -0
  8. package/dist/commonjs/funcs/recovery-exchange.js +123 -0
  9. package/dist/commonjs/funcs/recovery-exchange.js.map +1 -0
  10. package/dist/commonjs/funcs/recovery-other-route.d.ts +18 -0
  11. package/dist/commonjs/funcs/recovery-other-route.d.ts.map +1 -0
  12. package/dist/commonjs/funcs/recovery-other-route.js +123 -0
  13. package/dist/commonjs/funcs/recovery-other-route.js.map +1 -0
  14. package/dist/commonjs/funcs/sign-in-confirm.d.ts +18 -0
  15. package/dist/commonjs/funcs/sign-in-confirm.d.ts.map +1 -0
  16. package/dist/commonjs/funcs/sign-in-confirm.js +123 -0
  17. package/dist/commonjs/funcs/sign-in-confirm.js.map +1 -0
  18. package/dist/commonjs/funcs/sign-in-request.d.ts +18 -0
  19. package/dist/commonjs/funcs/sign-in-request.d.ts.map +1 -0
  20. package/dist/commonjs/funcs/sign-in-request.js +123 -0
  21. package/dist/commonjs/funcs/sign-in-request.js.map +1 -0
  22. package/dist/commonjs/funcs/verification-get-status.d.ts +1 -1
  23. package/dist/commonjs/funcs/verification-get-status.js +2 -1
  24. package/dist/commonjs/funcs/verification-get-status.js.map +1 -1
  25. package/dist/commonjs/lib/config.d.ts +2 -2
  26. package/dist/commonjs/lib/config.js +2 -2
  27. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  28. package/dist/commonjs/mcp-server/server.js +1 -1
  29. package/dist/commonjs/models/bot-shield-action.d.ts +36 -0
  30. package/dist/commonjs/models/bot-shield-action.d.ts.map +1 -1
  31. package/dist/commonjs/models/bot-shield-action.js +28 -1
  32. package/dist/commonjs/models/bot-shield-action.js.map +1 -1
  33. package/dist/commonjs/models/error-body.d.ts +1 -1
  34. package/dist/commonjs/models/operations/gates-api-actions-create.d.ts +1 -1
  35. package/dist/commonjs/models/operations/gates-api-actions-list.d.ts +1 -1
  36. package/dist/commonjs/models/operations/gates-api-actions-request.d.ts +1 -1
  37. package/dist/commonjs/models/operations/gates-api-actions-set-state.d.ts +1 -1
  38. package/dist/commonjs/models/operations/gates-api-actions-update.d.ts +1 -1
  39. package/dist/commonjs/models/operations/index.d.ts +4 -0
  40. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  41. package/dist/commonjs/models/operations/index.js +4 -0
  42. package/dist/commonjs/models/operations/index.js.map +1 -1
  43. package/dist/commonjs/models/operations/recovery-exchange.d.ts +114 -0
  44. package/dist/commonjs/models/operations/recovery-exchange.d.ts.map +1 -0
  45. package/dist/commonjs/models/operations/recovery-exchange.js +164 -0
  46. package/dist/commonjs/models/operations/recovery-exchange.js.map +1 -0
  47. package/dist/commonjs/models/operations/recovery-other-route.d.ts +86 -0
  48. package/dist/commonjs/models/operations/recovery-other-route.d.ts.map +1 -0
  49. package/dist/commonjs/models/operations/recovery-other-route.js +145 -0
  50. package/dist/commonjs/models/operations/recovery-other-route.js.map +1 -0
  51. package/dist/commonjs/models/operations/sdk-create-verification-link.d.ts +6 -1
  52. package/dist/commonjs/models/operations/sdk-create-verification-link.d.ts.map +1 -1
  53. package/dist/commonjs/models/operations/sdk-create-verification-link.js +4 -0
  54. package/dist/commonjs/models/operations/sdk-create-verification-link.js.map +1 -1
  55. package/dist/commonjs/models/operations/sdk-send-by-number.d.ts +1 -1
  56. package/dist/commonjs/models/operations/sdk-verify-token.d.ts +15 -0
  57. package/dist/commonjs/models/operations/sdk-verify-token.d.ts.map +1 -1
  58. package/dist/commonjs/models/operations/sdk-verify-token.js +10 -0
  59. package/dist/commonjs/models/operations/sdk-verify-token.js.map +1 -1
  60. package/dist/commonjs/models/operations/signin-confirm.d.ts +148 -0
  61. package/dist/commonjs/models/operations/signin-confirm.d.ts.map +1 -0
  62. package/dist/commonjs/models/operations/signin-confirm.js +202 -0
  63. package/dist/commonjs/models/operations/signin-confirm.js.map +1 -0
  64. package/dist/commonjs/models/operations/signin-request.d.ts +115 -0
  65. package/dist/commonjs/models/operations/signin-request.d.ts.map +1 -0
  66. package/dist/commonjs/models/operations/signin-request.js +174 -0
  67. package/dist/commonjs/models/operations/signin-request.js.map +1 -0
  68. package/dist/commonjs/models/operations/verification-get-status.d.ts +5 -0
  69. package/dist/commonjs/models/operations/verification-get-status.d.ts.map +1 -1
  70. package/dist/commonjs/models/operations/verification-get-status.js +4 -0
  71. package/dist/commonjs/models/operations/verification-get-status.js.map +1 -1
  72. package/dist/commonjs/sdk/census.d.ts +1 -1
  73. package/dist/commonjs/sdk/census.js +1 -1
  74. package/dist/commonjs/sdk/recovery.d.ts +19 -0
  75. package/dist/commonjs/sdk/recovery.d.ts.map +1 -0
  76. package/dist/commonjs/sdk/recovery.js +32 -0
  77. package/dist/commonjs/sdk/recovery.js.map +1 -0
  78. package/dist/commonjs/sdk/sdk.d.ts +6 -0
  79. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  80. package/dist/commonjs/sdk/sdk.js +10 -0
  81. package/dist/commonjs/sdk/sdk.js.map +1 -1
  82. package/dist/commonjs/sdk/sign-in.d.ts +19 -0
  83. package/dist/commonjs/sdk/sign-in.d.ts.map +1 -0
  84. package/dist/commonjs/sdk/sign-in.js +32 -0
  85. package/dist/commonjs/sdk/sign-in.js.map +1 -0
  86. package/dist/commonjs/sdk/verification.d.ts +1 -1
  87. package/dist/commonjs/sdk/verification.js +1 -1
  88. package/dist/esm/funcs/census-verify-token.d.ts +1 -1
  89. package/dist/esm/funcs/census-verify-token.js +1 -1
  90. package/dist/esm/funcs/recovery-exchange.d.ts +18 -0
  91. package/dist/esm/funcs/recovery-exchange.d.ts.map +1 -0
  92. package/dist/esm/funcs/recovery-exchange.js +87 -0
  93. package/dist/esm/funcs/recovery-exchange.js.map +1 -0
  94. package/dist/esm/funcs/recovery-other-route.d.ts +18 -0
  95. package/dist/esm/funcs/recovery-other-route.d.ts.map +1 -0
  96. package/dist/esm/funcs/recovery-other-route.js +87 -0
  97. package/dist/esm/funcs/recovery-other-route.js.map +1 -0
  98. package/dist/esm/funcs/sign-in-confirm.d.ts +18 -0
  99. package/dist/esm/funcs/sign-in-confirm.d.ts.map +1 -0
  100. package/dist/esm/funcs/sign-in-confirm.js +87 -0
  101. package/dist/esm/funcs/sign-in-confirm.js.map +1 -0
  102. package/dist/esm/funcs/sign-in-request.d.ts +18 -0
  103. package/dist/esm/funcs/sign-in-request.d.ts.map +1 -0
  104. package/dist/esm/funcs/sign-in-request.js +87 -0
  105. package/dist/esm/funcs/sign-in-request.js.map +1 -0
  106. package/dist/esm/funcs/verification-get-status.d.ts +1 -1
  107. package/dist/esm/funcs/verification-get-status.js +3 -2
  108. package/dist/esm/funcs/verification-get-status.js.map +1 -1
  109. package/dist/esm/lib/config.d.ts +2 -2
  110. package/dist/esm/lib/config.js +2 -2
  111. package/dist/esm/mcp-server/mcp-server.js +1 -1
  112. package/dist/esm/mcp-server/server.js +1 -1
  113. package/dist/esm/models/bot-shield-action.d.ts +36 -0
  114. package/dist/esm/models/bot-shield-action.d.ts.map +1 -1
  115. package/dist/esm/models/bot-shield-action.js +27 -0
  116. package/dist/esm/models/bot-shield-action.js.map +1 -1
  117. package/dist/esm/models/error-body.d.ts +1 -1
  118. package/dist/esm/models/operations/gates-api-actions-create.d.ts +1 -1
  119. package/dist/esm/models/operations/gates-api-actions-list.d.ts +1 -1
  120. package/dist/esm/models/operations/gates-api-actions-request.d.ts +1 -1
  121. package/dist/esm/models/operations/gates-api-actions-set-state.d.ts +1 -1
  122. package/dist/esm/models/operations/gates-api-actions-update.d.ts +1 -1
  123. package/dist/esm/models/operations/index.d.ts +4 -0
  124. package/dist/esm/models/operations/index.d.ts.map +1 -1
  125. package/dist/esm/models/operations/index.js +4 -0
  126. package/dist/esm/models/operations/index.js.map +1 -1
  127. package/dist/esm/models/operations/recovery-exchange.d.ts +114 -0
  128. package/dist/esm/models/operations/recovery-exchange.d.ts.map +1 -0
  129. package/dist/esm/models/operations/recovery-exchange.js +118 -0
  130. package/dist/esm/models/operations/recovery-exchange.js.map +1 -0
  131. package/dist/esm/models/operations/recovery-other-route.d.ts +86 -0
  132. package/dist/esm/models/operations/recovery-other-route.d.ts.map +1 -0
  133. package/dist/esm/models/operations/recovery-other-route.js +99 -0
  134. package/dist/esm/models/operations/recovery-other-route.js.map +1 -0
  135. package/dist/esm/models/operations/sdk-create-verification-link.d.ts +6 -1
  136. package/dist/esm/models/operations/sdk-create-verification-link.d.ts.map +1 -1
  137. package/dist/esm/models/operations/sdk-create-verification-link.js +4 -0
  138. package/dist/esm/models/operations/sdk-create-verification-link.js.map +1 -1
  139. package/dist/esm/models/operations/sdk-send-by-number.d.ts +1 -1
  140. package/dist/esm/models/operations/sdk-verify-token.d.ts +15 -0
  141. package/dist/esm/models/operations/sdk-verify-token.d.ts.map +1 -1
  142. package/dist/esm/models/operations/sdk-verify-token.js +10 -0
  143. package/dist/esm/models/operations/sdk-verify-token.js.map +1 -1
  144. package/dist/esm/models/operations/signin-confirm.d.ts +148 -0
  145. package/dist/esm/models/operations/signin-confirm.d.ts.map +1 -0
  146. package/dist/esm/models/operations/signin-confirm.js +156 -0
  147. package/dist/esm/models/operations/signin-confirm.js.map +1 -0
  148. package/dist/esm/models/operations/signin-request.d.ts +115 -0
  149. package/dist/esm/models/operations/signin-request.d.ts.map +1 -0
  150. package/dist/esm/models/operations/signin-request.js +128 -0
  151. package/dist/esm/models/operations/signin-request.js.map +1 -0
  152. package/dist/esm/models/operations/verification-get-status.d.ts +5 -0
  153. package/dist/esm/models/operations/verification-get-status.d.ts.map +1 -1
  154. package/dist/esm/models/operations/verification-get-status.js +4 -0
  155. package/dist/esm/models/operations/verification-get-status.js.map +1 -1
  156. package/dist/esm/sdk/census.d.ts +1 -1
  157. package/dist/esm/sdk/census.js +1 -1
  158. package/dist/esm/sdk/recovery.d.ts +19 -0
  159. package/dist/esm/sdk/recovery.d.ts.map +1 -0
  160. package/dist/esm/sdk/recovery.js +28 -0
  161. package/dist/esm/sdk/recovery.js.map +1 -0
  162. package/dist/esm/sdk/sdk.d.ts +6 -0
  163. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  164. package/dist/esm/sdk/sdk.js +10 -0
  165. package/dist/esm/sdk/sdk.js.map +1 -1
  166. package/dist/esm/sdk/sign-in.d.ts +19 -0
  167. package/dist/esm/sdk/sign-in.d.ts.map +1 -0
  168. package/dist/esm/sdk/sign-in.js +28 -0
  169. package/dist/esm/sdk/sign-in.js.map +1 -0
  170. package/dist/esm/sdk/verification.d.ts +1 -1
  171. package/dist/esm/sdk/verification.js +1 -1
  172. package/jsr.json +1 -1
  173. package/package.json +1 -1
  174. package/src/funcs/census-verify-token.ts +1 -1
  175. package/src/funcs/recovery-exchange.ts +184 -0
  176. package/src/funcs/recovery-other-route.ts +184 -0
  177. package/src/funcs/sign-in-confirm.ts +184 -0
  178. package/src/funcs/sign-in-request.ts +184 -0
  179. package/src/funcs/verification-get-status.ts +7 -2
  180. package/src/lib/config.ts +2 -2
  181. package/src/mcp-server/mcp-server.ts +1 -1
  182. package/src/mcp-server/server.ts +1 -1
  183. package/src/models/bot-shield-action.ts +61 -0
  184. package/src/models/error-body.ts +1 -1
  185. package/src/models/operations/gates-api-actions-create.ts +1 -1
  186. package/src/models/operations/gates-api-actions-list.ts +1 -1
  187. package/src/models/operations/gates-api-actions-request.ts +1 -1
  188. package/src/models/operations/gates-api-actions-set-state.ts +1 -1
  189. package/src/models/operations/gates-api-actions-update.ts +1 -1
  190. package/src/models/operations/index.ts +4 -0
  191. package/src/models/operations/recovery-exchange.ts +308 -0
  192. package/src/models/operations/recovery-other-route.ts +262 -0
  193. package/src/models/operations/sdk-create-verification-link.ts +10 -1
  194. package/src/models/operations/sdk-send-by-number.ts +1 -1
  195. package/src/models/operations/sdk-verify-token.ts +25 -0
  196. package/src/models/operations/signin-confirm.ts +383 -0
  197. package/src/models/operations/signin-request.ts +319 -0
  198. package/src/models/operations/verification-get-status.ts +9 -0
  199. package/src/sdk/census.ts +1 -1
  200. package/src/sdk/recovery.ts +49 -0
  201. package/src/sdk/sdk.ts +12 -0
  202. package/src/sdk/sign-in.ts +49 -0
  203. package/src/sdk/verification.ts +1 -1
@@ -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
+ * Ask for a passkey sign-in
31
+ *
32
+ * @remarks
33
+ * Your SERVER asks for a sign-in for ONE of your accounts, after the password has passed or after the customer named their account. Hand the page only `request_id`. Answers only for an account that is already an active verified account here; otherwise `not_verified`, nothing is started, and you do not show the button. It never links an account. A paused account is refused (`account_paused`). The request lives 2 minutes. Needs a live Sign-on Action with your sign-in page's address (BotShield Console › Verified Accounts › BotShield Actions).
34
+ */
35
+ export function signInRequest(
36
+ client: BotShieldCore,
37
+ security: operations.SigninRequestSecurity,
38
+ request: operations.SigninRequestRequest,
39
+ options?: RequestOptions,
40
+ ): APIPromise<
41
+ Result<
42
+ operations.SigninRequestResponse,
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.SigninRequestSecurity,
66
+ request: operations.SigninRequestRequest,
67
+ options?: RequestOptions,
68
+ ): Promise<
69
+ [
70
+ Result<
71
+ operations.SigninRequestResponse,
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.SigninRequestRequest$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("/signin/request")();
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?.apiKeyAuth,
110
+ },
111
+ ],
112
+ );
113
+
114
+ const context = {
115
+ options: client._options,
116
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
117
+ operationID: "SigninRequest",
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.SigninRequestResponse,
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.SigninRequestResponse$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
+ }
@@ -3,7 +3,7 @@
3
3
  */
4
4
 
5
5
  import { BotShieldCore } from "../core.js";
6
- import { encodeFormQuery } from "../lib/encodings.js";
6
+ import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
7
7
  import { matchStatusCode } from "../lib/http.js";
8
8
  import * as M from "../lib/matchers.js";
9
9
  import { compactMap } from "../lib/primitives.js";
@@ -30,7 +30,7 @@ import { Result } from "../types/fp.js";
30
30
  * Check verification status
31
31
  *
32
32
  * @remarks
33
- * Poll a verification request. Carries the signed attestation on completion and NO identity — no user_email, partner_user_id, auth_mode, or botshield_user_id ever cross this boundary. Called without a key, it is rate-limited per client address (a page polling every 2 seconds stays well inside it); over the limit the call is refused with HTTP 403 and `errors[0].code = "RATE_LIMITED"`.
33
+ * Poll a verification request. Carries the signed attestation on completion and NO identity — no user_email, partner_user_id, auth_mode, or botshield_user_id ever cross this boundary. Called without a key, it is rate-limited per client address (a page polling every 2 seconds stays well inside it); over the limit the call is refused with HTTP 403 and `errors[0].code = "RATE_LIMITED"`. 4.0: knowing the request id is not enough to read the finished tokens. A request started with a site key returns them only with its `read_secret` (`X-BotShield-Request-Secret`); a request your server started, only to your secret key. A passkey sign-in's tokens are never returned here.
34
34
  */
35
35
  export function verificationGetStatus(
36
36
  client: BotShieldCore,
@@ -103,6 +103,11 @@ async function $do(
103
103
 
104
104
  const headers = new Headers(compactMap({
105
105
  Accept: "application/json",
106
+ "X-BotShield-Request-Secret": encodeSimple(
107
+ "X-BotShield-Request-Secret",
108
+ payload["X-BotShield-Request-Secret"],
109
+ { explode: false, charEncoding: "none" },
110
+ ),
106
111
  }));
107
112
 
108
113
  const requestSecurity = resolveSecurity(
package/src/lib/config.ts CHANGED
@@ -73,7 +73,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
73
73
  export const SDK_METADATA = {
74
74
  language: "typescript",
75
75
  openapiDocVersion: "2.0.0",
76
- sdkVersion: "4.0.0",
76
+ sdkVersion: "4.0.1",
77
77
  genVersion: "2.934.1",
78
- userAgent: "speakeasy-sdk/typescript 4.0.0 2.934.1 2.0.0 botshield-sdk",
78
+ userAgent: "speakeasy-sdk/typescript 4.0.1 2.934.1 2.0.0 botshield-sdk",
79
79
  } as const;
@@ -19,7 +19,7 @@ const routes = buildRouteMap({
19
19
  export const app = buildApplication(routes, {
20
20
  name: "mcp",
21
21
  versionInfo: {
22
- currentVersion: "4.0.0",
22
+ currentVersion: "4.0.1",
23
23
  },
24
24
  });
25
25
 
@@ -27,7 +27,7 @@ export function createMCPServer(deps: {
27
27
  }) {
28
28
  const server = new McpServer({
29
29
  name: "BotShield",
30
- version: "4.0.0",
30
+ version: "4.0.1",
31
31
  });
32
32
 
33
33
  const client = new BotShieldCore({
@@ -31,6 +31,19 @@ export type BotShieldActionEnvironment = OpenEnum<
31
31
  typeof BotShieldActionEnvironment
32
32
  >;
33
33
 
34
+ /**
35
+ * 4.0: `action` (a BotShield Action), `recovery` (your one Recovery Action: only your customer starts it, from the Recover Account with BotShield button) or `signin` (your one Sign-on Action: only signin/request starts it). Recovery and Sign-on Actions are placed in the Console; no `act`, server ask, send by number or staff send reaches them (`action_is_recovery` / `action_is_signin`). `action` on an engine before 4.0.
36
+ */
37
+ export const BotShieldActionKind = {
38
+ Action: "action",
39
+ Recovery: "recovery",
40
+ Signin: "signin",
41
+ } as const;
42
+ /**
43
+ * 4.0: `action` (a BotShield Action), `recovery` (your one Recovery Action: only your customer starts it, from the Recover Account with BotShield button) or `signin` (your one Sign-on Action: only signin/request starts it). Recovery and Sign-on Actions are placed in the Console; no `act`, server ask, send by number or staff send reaches them (`action_is_recovery` / `action_is_signin`). `action` on an engine before 4.0.
44
+ */
45
+ export type BotShieldActionKind = OpenEnum<typeof BotShieldActionKind>;
46
+
34
47
  /**
35
48
  * A BotShield Action: one act on your own surface keyed to a passkey. Not a gate — no schedule, no levers — and it always stands on a verified account, so a tap runs the linking ceremony.
36
49
  */
@@ -59,6 +72,22 @@ export type BotShieldAction = {
59
72
  * Your support team can send this to a customer; its name is what the customer reads. Set with `staffCanSend` on create or update.
60
73
  */
61
74
  staffCanSend?: boolean | undefined;
75
+ /**
76
+ * 4.0: `action` (a BotShield Action), `recovery` (your one Recovery Action: only your customer starts it, from the Recover Account with BotShield button) or `signin` (your one Sign-on Action: only signin/request starts it). Recovery and Sign-on Actions are placed in the Console; no `act`, server ask, send by number or staff send reaches them (`action_is_recovery` / `action_is_signin`). `action` on an engine before 4.0.
77
+ */
78
+ kind?: BotShieldActionKind | undefined;
79
+ /**
80
+ * 4.0: on a Sign-on Action, whether BotShield's own QR may finish a sign-in (default off: your page's passkey only). Always false on other kinds.
81
+ */
82
+ signinQr?: boolean | undefined;
83
+ /**
84
+ * 4.0: a Recovery Action's new landing address while it waits to take effect (24 hours in Production; every admin is told). `where_url` is the address in effect until then.
85
+ */
86
+ pendingWhereUrl?: string | null | undefined;
87
+ /**
88
+ * 4.0: when `pending_where_url` takes effect.
89
+ */
90
+ pendingWhereUrlAt?: Date | null | undefined;
62
91
  /**
63
92
  * 4.0: high-value. It starts only from your customer's signed-in session (your server naming the account by your own reference); by phone number or by staff it is refused (`action_requires_signed_in`). Set with `highValue` on create or update.
64
93
  */
@@ -91,6 +120,19 @@ export const BotShieldActionEnvironment$outboundSchema: z.ZodType<
91
120
  BotShieldActionEnvironment
92
121
  > = openEnums.outboundSchema(BotShieldActionEnvironment);
93
122
 
123
+ /** @internal */
124
+ export const BotShieldActionKind$inboundSchema: z.ZodType<
125
+ BotShieldActionKind,
126
+ z.ZodTypeDef,
127
+ unknown
128
+ > = openEnums.inboundSchema(BotShieldActionKind);
129
+ /** @internal */
130
+ export const BotShieldActionKind$outboundSchema: z.ZodType<
131
+ string,
132
+ z.ZodTypeDef,
133
+ BotShieldActionKind
134
+ > = openEnums.outboundSchema(BotShieldActionKind);
135
+
94
136
  /** @internal */
95
137
  export const BotShieldAction$inboundSchema: z.ZodType<
96
138
  BotShieldAction,
@@ -106,6 +148,10 @@ export const BotShieldAction$inboundSchema: z.ZodType<
106
148
  placed_at: types.date(),
107
149
  turned_off_at: types.nullable(types.date()),
108
150
  staff_can_send: types.optional(types.boolean()),
151
+ kind: types.optional(BotShieldActionKind$inboundSchema),
152
+ signin_qr: types.optional(types.boolean()),
153
+ pending_where_url: z.nullable(types.string()).optional(),
154
+ pending_where_url_at: z.nullable(types.date()).optional(),
109
155
  high_value: types.optional(types.boolean()),
110
156
  }).transform((v) => {
111
157
  return remap$(v, {
@@ -114,6 +160,9 @@ export const BotShieldAction$inboundSchema: z.ZodType<
114
160
  "placed_at": "placedAt",
115
161
  "turned_off_at": "turnedOffAt",
116
162
  "staff_can_send": "staffCanSend",
163
+ "signin_qr": "signinQr",
164
+ "pending_where_url": "pendingWhereUrl",
165
+ "pending_where_url_at": "pendingWhereUrlAt",
117
166
  "high_value": "highValue",
118
167
  });
119
168
  });
@@ -128,6 +177,10 @@ export type BotShieldAction$Outbound = {
128
177
  placed_at: string;
129
178
  turned_off_at: string | null;
130
179
  staff_can_send?: boolean | undefined;
180
+ kind?: string | undefined;
181
+ signin_qr?: boolean | undefined;
182
+ pending_where_url?: string | null | undefined;
183
+ pending_where_url_at?: string | null | undefined;
131
184
  high_value?: boolean | undefined;
132
185
  };
133
186
 
@@ -146,6 +199,11 @@ export const BotShieldAction$outboundSchema: z.ZodType<
146
199
  placedAt: z.date().transform(v => v.toISOString()),
147
200
  turnedOffAt: z.nullable(z.date().transform(v => v.toISOString())),
148
201
  staffCanSend: z.boolean().optional(),
202
+ kind: BotShieldActionKind$outboundSchema.optional(),
203
+ signinQr: z.boolean().optional(),
204
+ pendingWhereUrl: z.nullable(z.string()).optional(),
205
+ pendingWhereUrlAt: z.nullable(z.date().transform(v => v.toISOString()))
206
+ .optional(),
149
207
  highValue: z.boolean().optional(),
150
208
  }).transform((v) => {
151
209
  return remap$(v, {
@@ -154,6 +212,9 @@ export const BotShieldAction$outboundSchema: z.ZodType<
154
212
  placedAt: "placed_at",
155
213
  turnedOffAt: "turned_off_at",
156
214
  staffCanSend: "staff_can_send",
215
+ signinQr: "signin_qr",
216
+ pendingWhereUrl: "pending_where_url",
217
+ pendingWhereUrlAt: "pending_where_url_at",
157
218
  highValue: "high_value",
158
219
  });
159
220
  });
@@ -36,7 +36,7 @@ export type ErrorBody = {
36
36
  message: string;
37
37
  statusCode: number;
38
38
  /**
39
- * `ttl_below_floor`, `ttl_above_ceiling`, `trust_layer_rejected`, `trust_layer_unavailable`, `gate_required`, `alias_retired`, `RATE_LIMITED`, `inline_not_for_age_gate`, `act_label_has_link`.
39
+ * `ttl_below_floor`, `ttl_above_ceiling`, `trust_layer_rejected`, `trust_layer_unavailable`, `gate_required`, `alias_retired`, `RATE_LIMITED`, `inline_not_for_age_gate`, `act_label_has_link`, and in 4.0 `link_requires_server_session`, `account_override_refused`, `action_is_recovery`, `action_is_signin`, `invalid_key`, `recovery_code_invalid`, `handle_invalid`, `signin_not_set_up`, `not_verified`, `account_paused`, `signin_unknown`, `signin_pending`, `signin_refused`, `signin_expired`, `signin_used`, `signin_wrong_account`, `unavailable`.
40
40
  */
41
41
  code?: string | undefined;
42
42
  minTtlSeconds?: number | undefined;
@@ -53,7 +53,7 @@ export type GatesApiActionsCreateData = {
53
53
  };
54
54
 
55
55
  /**
56
- * The placed action. NOTE: handler errors also arrive here (HTTP 200) as data.error — codes: `invalid_key` (401 — missing, malformed or inactive key), `gates_scope_required` (403 — the key lacks Gates API access), `org_not_found` (404), `action_key_taken` (409), `not_migrated` (503 — `staffCanSend` is not available yet), `internal` (500).
56
+ * The placed action. NOTE: handler errors also arrive here (HTTP 200) as data.error — codes: `invalid_key` (401 — missing, malformed or inactive key), `gates_scope_required` (403 — the key lacks Gates API access), `org_not_found` (404), `action_key_taken` (409), `not_migrated` (503 — `staffCanSend` is not available yet), `internal` (500). 4.0: each action carries `kind` (`action`, `recovery` or `signin`), `signin_qr` and, for a Recovery Action, `pending_where_url` / `pending_where_url_at`. Recovery and Sign-on Actions are placed in the Console, not here.
57
57
  */
58
58
  export type GatesApiActionsCreateResponse = {
59
59
  data: GatesApiActionsCreateData;
@@ -27,7 +27,7 @@ export type GatesApiActionsListData = {
27
27
  };
28
28
 
29
29
  /**
30
- * Actions. NOTE: handler errors also arrive here (HTTP 200) as data.error — codes: `invalid_key` (401 — missing, malformed or inactive key), `gates_scope_required` (403 — the key lacks Gates API access), `org_not_found` (404), `internal` (500). Each action carries `staff_can_send`.
30
+ * Actions. NOTE: handler errors also arrive here (HTTP 200) as data.error — codes: `invalid_key` (401 — missing, malformed or inactive key), `gates_scope_required` (403 — the key lacks Gates API access), `org_not_found` (404), `internal` (500). Each action carries `staff_can_send`. 4.0: each action carries `kind` (`action`, `recovery` or `signin`), `signin_qr` and, for a Recovery Action, `pending_where_url` / `pending_where_url_at`. Recovery and Sign-on Actions are placed in the Console, not here.
31
31
  */
32
32
  export type GatesApiActionsListResponse = {
33
33
  data: GatesApiActionsListData;
@@ -90,7 +90,7 @@ export type GatesApiActionsRequestData = {
90
90
  };
91
91
 
92
92
  /**
93
- * Queued. NOTE: handler errors also arrive here (HTTP 200) as data.error — codes: `invalid_key` (401), `gates_scope_required` (403), `org_not_found` (404), `action_invalid` (400), `action_not_found` (404), `action_off` (404), `agent_not_found` (404), `not_linked` (409 — the person isn't linked to your company), `details_invalid` (400), `agent_removed_by_person` (409 — the person removed this agent), `account_reconfirm_required` (409 — the customer changed their phone number without approval from another phone, so they must confirm this account with BotShield again from your signed-in page before anything can be sent to them; nothing is counted or sent), `request_id_reused` (409 — also when the same request_id is sent with other terms), `too_many_open_requests` (429 — this person already has 5 of your requests waiting; carries `retry_after_seconds`), `daily_request_limit` (429 — 50 requests to this person in 24 hours; carries `retry_after_seconds`), `request_limit_unavailable` (503 — the request could not be counted, so it was not sent; retry), `one_addressee_required` (400 — send exactly one of partner_user_ref and phone_number), `phone_invalid` (400), `org_not_verified` (403 — by phone number in production), `send_rate_limited` (429 — asks by phone number per key per hour), `unanswered_limit_reached` (429 — too many unanswered asks by phone number in 24 hours), `unavailable` (503), `internal` (500).
93
+ * Queued. NOTE: handler errors also arrive here (HTTP 200) as data.error — codes: `invalid_key` (401), `gates_scope_required` (403), `org_not_found` (404), `action_invalid` (400), `action_not_found` (404), `action_off` (404), `agent_not_found` (404), `not_linked` (409 — the person isn't linked to your company), `details_invalid` (400), `agent_removed_by_person` (409 — the person removed this agent), `account_reconfirm_required` (409 — the customer changed their phone number without approval from another phone, so they must confirm this account with BotShield again from your signed-in page before anything can be sent to them; nothing is counted or sent), `request_id_reused` (409 — also when the same request_id is sent with other terms), `too_many_open_requests` (429 — this person already has 5 of your requests waiting; carries `retry_after_seconds`), `daily_request_limit` (429 — 50 requests to this person in 24 hours; carries `retry_after_seconds`), `request_limit_unavailable` (503 — the request could not be counted, so it was not sent; retry), `one_addressee_required` (400 — send exactly one of partner_user_ref and phone_number), `phone_invalid` (400), `org_not_verified` (403 — by phone number in production), `send_rate_limited` (429 — asks by phone number per key per hour), `unanswered_limit_reached` (429 — too many unanswered asks by phone number in 24 hours), `unavailable` (503), `internal` (500). 4.0: `action_is_recovery` / `action_is_signin` (404 — that act is your Recovery Action or Sign-on Action, which no request starts).
94
94
  */
95
95
  export type GatesApiActionsRequestResponse = {
96
96
  data: GatesApiActionsRequestData;
@@ -47,7 +47,7 @@ export type GatesApiActionsSetStateData = {
47
47
  };
48
48
 
49
49
  /**
50
- * The action. NOTE: handler errors also arrive here (HTTP 200) as data.error — codes: `invalid_key` (401 — missing, malformed or inactive key), `gates_scope_required` (403 — the key lacks Gates API access), `org_not_found` (404), `action_not_found` (404), `internal` (500). Each action carries `staff_can_send`.
50
+ * The action. NOTE: handler errors also arrive here (HTTP 200) as data.error — codes: `invalid_key` (401 — missing, malformed or inactive key), `gates_scope_required` (403 — the key lacks Gates API access), `org_not_found` (404), `action_not_found` (404), `internal` (500). Each action carries `staff_can_send`. 4.0: each action carries `kind` (`action`, `recovery` or `signin`), `signin_qr` and, for a Recovery Action, `pending_where_url` / `pending_where_url_at`. Recovery and Sign-on Actions are placed in the Console, not here.
51
51
  */
52
52
  export type GatesApiActionsSetStateResponse = {
53
53
  data: GatesApiActionsSetStateData;
@@ -49,7 +49,7 @@ export type GatesApiActionsUpdateData = {
49
49
  };
50
50
 
51
51
  /**
52
- * The action. NOTE: handler errors also arrive here (HTTP 200) as data.error — codes: `invalid_key` (401 — missing, malformed or inactive key), `gates_scope_required` (403 — the key lacks Gates API access), `org_not_found` (404), `nothing_to_change` (400), `action_not_found` (404), `not_migrated` (503), `internal` (500).
52
+ * The action. NOTE: handler errors also arrive here (HTTP 200) as data.error — codes: `invalid_key` (401 — missing, malformed or inactive key), `gates_scope_required` (403 — the key lacks Gates API access), `org_not_found` (404), `nothing_to_change` (400), `action_not_found` (404), `not_migrated` (503), `internal` (500). 4.0: each action carries `kind` (`action`, `recovery` or `signin`), `signin_qr` and, for a Recovery Action, `pending_where_url` / `pending_where_url_at`. Recovery and Sign-on Actions are placed in the Console, not here.
53
53
  */
54
54
  export type GatesApiActionsUpdateResponse = {
55
55
  data: GatesApiActionsUpdateData;
@@ -19,6 +19,8 @@ export * from "./gates-api-create.js";
19
19
  export * from "./gates-api-extend.js";
20
20
  export * from "./gates-api-get.js";
21
21
  export * from "./gates-api-list.js";
22
+ export * from "./recovery-exchange.js";
23
+ export * from "./recovery-other-route.js";
22
24
  export * from "./request-passkey-complete.js";
23
25
  export * from "./request-passkey-options.js";
24
26
  export * from "./sdk-confirm-link.js";
@@ -35,4 +37,6 @@ export * from "./sdk-verify-token.js";
35
37
  export * from "./secured-accounts-list.js";
36
38
  export * from "./secured-accounts-revoke.js";
37
39
  export * from "./secured-accounts-status.js";
40
+ export * from "./signin-confirm.js";
41
+ export * from "./signin-request.js";
38
42
  export * from "./verification-get-status.js";