botshield-sdk 4.0.0 → 4.0.3

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 (238) hide show
  1. package/README.md +17 -5
  2. package/bin/mcp-server.js +395 -22
  3. package/bin/mcp-server.js.map +25 -21
  4. package/dist/commonjs/funcs/census-confirm-link.d.ts +1 -1
  5. package/dist/commonjs/funcs/census-confirm-link.js +1 -1
  6. package/dist/commonjs/funcs/census-send-by-number.d.ts +1 -1
  7. package/dist/commonjs/funcs/census-send-by-number.js +1 -1
  8. package/dist/commonjs/funcs/census-verify-token.d.ts +1 -1
  9. package/dist/commonjs/funcs/census-verify-token.js +1 -1
  10. package/dist/commonjs/funcs/recovery-exchange.d.ts +18 -0
  11. package/dist/commonjs/funcs/recovery-exchange.d.ts.map +1 -0
  12. package/dist/commonjs/funcs/recovery-exchange.js +123 -0
  13. package/dist/commonjs/funcs/recovery-exchange.js.map +1 -0
  14. package/dist/commonjs/funcs/recovery-other-route.d.ts +18 -0
  15. package/dist/commonjs/funcs/recovery-other-route.d.ts.map +1 -0
  16. package/dist/commonjs/funcs/recovery-other-route.js +123 -0
  17. package/dist/commonjs/funcs/recovery-other-route.js.map +1 -0
  18. package/dist/commonjs/funcs/sign-in-confirm.d.ts +18 -0
  19. package/dist/commonjs/funcs/sign-in-confirm.d.ts.map +1 -0
  20. package/dist/commonjs/funcs/sign-in-confirm.js +123 -0
  21. package/dist/commonjs/funcs/sign-in-confirm.js.map +1 -0
  22. package/dist/commonjs/funcs/sign-in-request.d.ts +18 -0
  23. package/dist/commonjs/funcs/sign-in-request.d.ts.map +1 -0
  24. package/dist/commonjs/funcs/sign-in-request.js +123 -0
  25. package/dist/commonjs/funcs/sign-in-request.js.map +1 -0
  26. package/dist/commonjs/funcs/verification-get-status.d.ts +1 -1
  27. package/dist/commonjs/funcs/verification-get-status.js +2 -1
  28. package/dist/commonjs/funcs/verification-get-status.js.map +1 -1
  29. package/dist/commonjs/lib/config.d.ts +2 -12
  30. package/dist/commonjs/lib/config.d.ts.map +1 -1
  31. package/dist/commonjs/lib/config.js +3 -13
  32. package/dist/commonjs/lib/config.js.map +1 -1
  33. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  34. package/dist/commonjs/mcp-server/server.js +1 -1
  35. package/dist/commonjs/models/bot-shield-action.d.ts +37 -1
  36. package/dist/commonjs/models/bot-shield-action.d.ts.map +1 -1
  37. package/dist/commonjs/models/bot-shield-action.js +28 -1
  38. package/dist/commonjs/models/bot-shield-action.js.map +1 -1
  39. package/dist/commonjs/models/error-body.d.ts +1 -1
  40. package/dist/commonjs/models/operations/actions-propose.d.ts +1 -1
  41. package/dist/commonjs/models/operations/gates-api-actions-create.d.ts +2 -2
  42. package/dist/commonjs/models/operations/gates-api-actions-list.d.ts +1 -1
  43. package/dist/commonjs/models/operations/gates-api-actions-request.d.ts +2 -2
  44. package/dist/commonjs/models/operations/gates-api-actions-set-state.d.ts +1 -1
  45. package/dist/commonjs/models/operations/gates-api-actions-update.d.ts +2 -2
  46. package/dist/commonjs/models/operations/index.d.ts +4 -0
  47. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  48. package/dist/commonjs/models/operations/index.js +4 -0
  49. package/dist/commonjs/models/operations/index.js.map +1 -1
  50. package/dist/commonjs/models/operations/recovery-exchange.d.ts +114 -0
  51. package/dist/commonjs/models/operations/recovery-exchange.d.ts.map +1 -0
  52. package/dist/commonjs/models/operations/recovery-exchange.js +164 -0
  53. package/dist/commonjs/models/operations/recovery-exchange.js.map +1 -0
  54. package/dist/commonjs/models/operations/recovery-other-route.d.ts +86 -0
  55. package/dist/commonjs/models/operations/recovery-other-route.d.ts.map +1 -0
  56. package/dist/commonjs/models/operations/recovery-other-route.js +145 -0
  57. package/dist/commonjs/models/operations/recovery-other-route.js.map +1 -0
  58. package/dist/commonjs/models/operations/sdk-create-verification-link.d.ts +6 -1
  59. package/dist/commonjs/models/operations/sdk-create-verification-link.d.ts.map +1 -1
  60. package/dist/commonjs/models/operations/sdk-create-verification-link.js +4 -0
  61. package/dist/commonjs/models/operations/sdk-create-verification-link.js.map +1 -1
  62. package/dist/commonjs/models/operations/sdk-send-by-number.d.ts +1 -1
  63. package/dist/commonjs/models/operations/sdk-verify-token.d.ts +19 -4
  64. package/dist/commonjs/models/operations/sdk-verify-token.d.ts.map +1 -1
  65. package/dist/commonjs/models/operations/sdk-verify-token.js +10 -0
  66. package/dist/commonjs/models/operations/sdk-verify-token.js.map +1 -1
  67. package/dist/commonjs/models/operations/secured-accounts-list.d.ts +5 -0
  68. package/dist/commonjs/models/operations/secured-accounts-list.d.ts.map +1 -1
  69. package/dist/commonjs/models/operations/secured-accounts-list.js +2 -0
  70. package/dist/commonjs/models/operations/secured-accounts-list.js.map +1 -1
  71. package/dist/commonjs/models/operations/secured-accounts-status.d.ts +5 -0
  72. package/dist/commonjs/models/operations/secured-accounts-status.d.ts.map +1 -1
  73. package/dist/commonjs/models/operations/secured-accounts-status.js +2 -0
  74. package/dist/commonjs/models/operations/secured-accounts-status.js.map +1 -1
  75. package/dist/commonjs/models/operations/signin-confirm.d.ts +148 -0
  76. package/dist/commonjs/models/operations/signin-confirm.d.ts.map +1 -0
  77. package/dist/commonjs/models/operations/signin-confirm.js +202 -0
  78. package/dist/commonjs/models/operations/signin-confirm.js.map +1 -0
  79. package/dist/commonjs/models/operations/signin-request.d.ts +115 -0
  80. package/dist/commonjs/models/operations/signin-request.d.ts.map +1 -0
  81. package/dist/commonjs/models/operations/signin-request.js +174 -0
  82. package/dist/commonjs/models/operations/signin-request.js.map +1 -0
  83. package/dist/commonjs/models/operations/verification-get-status.d.ts +10 -5
  84. package/dist/commonjs/models/operations/verification-get-status.d.ts.map +1 -1
  85. package/dist/commonjs/models/operations/verification-get-status.js +5 -1
  86. package/dist/commonjs/models/operations/verification-get-status.js.map +1 -1
  87. package/dist/commonjs/sdk/census.d.ts +3 -3
  88. package/dist/commonjs/sdk/census.js +3 -3
  89. package/dist/commonjs/sdk/recovery.d.ts +19 -0
  90. package/dist/commonjs/sdk/recovery.d.ts.map +1 -0
  91. package/dist/commonjs/sdk/recovery.js +32 -0
  92. package/dist/commonjs/sdk/recovery.js.map +1 -0
  93. package/dist/commonjs/sdk/sdk.d.ts +6 -0
  94. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  95. package/dist/commonjs/sdk/sdk.js +10 -0
  96. package/dist/commonjs/sdk/sdk.js.map +1 -1
  97. package/dist/commonjs/sdk/sign-in.d.ts +19 -0
  98. package/dist/commonjs/sdk/sign-in.d.ts.map +1 -0
  99. package/dist/commonjs/sdk/sign-in.js +32 -0
  100. package/dist/commonjs/sdk/sign-in.js.map +1 -0
  101. package/dist/commonjs/sdk/verification.d.ts +1 -1
  102. package/dist/commonjs/sdk/verification.js +1 -1
  103. package/dist/esm/funcs/census-confirm-link.d.ts +1 -1
  104. package/dist/esm/funcs/census-confirm-link.js +1 -1
  105. package/dist/esm/funcs/census-send-by-number.d.ts +1 -1
  106. package/dist/esm/funcs/census-send-by-number.js +1 -1
  107. package/dist/esm/funcs/census-verify-token.d.ts +1 -1
  108. package/dist/esm/funcs/census-verify-token.js +1 -1
  109. package/dist/esm/funcs/recovery-exchange.d.ts +18 -0
  110. package/dist/esm/funcs/recovery-exchange.d.ts.map +1 -0
  111. package/dist/esm/funcs/recovery-exchange.js +87 -0
  112. package/dist/esm/funcs/recovery-exchange.js.map +1 -0
  113. package/dist/esm/funcs/recovery-other-route.d.ts +18 -0
  114. package/dist/esm/funcs/recovery-other-route.d.ts.map +1 -0
  115. package/dist/esm/funcs/recovery-other-route.js +87 -0
  116. package/dist/esm/funcs/recovery-other-route.js.map +1 -0
  117. package/dist/esm/funcs/sign-in-confirm.d.ts +18 -0
  118. package/dist/esm/funcs/sign-in-confirm.d.ts.map +1 -0
  119. package/dist/esm/funcs/sign-in-confirm.js +87 -0
  120. package/dist/esm/funcs/sign-in-confirm.js.map +1 -0
  121. package/dist/esm/funcs/sign-in-request.d.ts +18 -0
  122. package/dist/esm/funcs/sign-in-request.d.ts.map +1 -0
  123. package/dist/esm/funcs/sign-in-request.js +87 -0
  124. package/dist/esm/funcs/sign-in-request.js.map +1 -0
  125. package/dist/esm/funcs/verification-get-status.d.ts +1 -1
  126. package/dist/esm/funcs/verification-get-status.js +3 -2
  127. package/dist/esm/funcs/verification-get-status.js.map +1 -1
  128. package/dist/esm/lib/config.d.ts +2 -12
  129. package/dist/esm/lib/config.d.ts.map +1 -1
  130. package/dist/esm/lib/config.js +2 -12
  131. package/dist/esm/lib/config.js.map +1 -1
  132. package/dist/esm/mcp-server/mcp-server.js +1 -1
  133. package/dist/esm/mcp-server/server.js +1 -1
  134. package/dist/esm/models/bot-shield-action.d.ts +37 -1
  135. package/dist/esm/models/bot-shield-action.d.ts.map +1 -1
  136. package/dist/esm/models/bot-shield-action.js +27 -0
  137. package/dist/esm/models/bot-shield-action.js.map +1 -1
  138. package/dist/esm/models/error-body.d.ts +1 -1
  139. package/dist/esm/models/operations/actions-propose.d.ts +1 -1
  140. package/dist/esm/models/operations/gates-api-actions-create.d.ts +2 -2
  141. package/dist/esm/models/operations/gates-api-actions-list.d.ts +1 -1
  142. package/dist/esm/models/operations/gates-api-actions-request.d.ts +2 -2
  143. package/dist/esm/models/operations/gates-api-actions-set-state.d.ts +1 -1
  144. package/dist/esm/models/operations/gates-api-actions-update.d.ts +2 -2
  145. package/dist/esm/models/operations/index.d.ts +4 -0
  146. package/dist/esm/models/operations/index.d.ts.map +1 -1
  147. package/dist/esm/models/operations/index.js +4 -0
  148. package/dist/esm/models/operations/index.js.map +1 -1
  149. package/dist/esm/models/operations/recovery-exchange.d.ts +114 -0
  150. package/dist/esm/models/operations/recovery-exchange.d.ts.map +1 -0
  151. package/dist/esm/models/operations/recovery-exchange.js +118 -0
  152. package/dist/esm/models/operations/recovery-exchange.js.map +1 -0
  153. package/dist/esm/models/operations/recovery-other-route.d.ts +86 -0
  154. package/dist/esm/models/operations/recovery-other-route.d.ts.map +1 -0
  155. package/dist/esm/models/operations/recovery-other-route.js +99 -0
  156. package/dist/esm/models/operations/recovery-other-route.js.map +1 -0
  157. package/dist/esm/models/operations/sdk-create-verification-link.d.ts +6 -1
  158. package/dist/esm/models/operations/sdk-create-verification-link.d.ts.map +1 -1
  159. package/dist/esm/models/operations/sdk-create-verification-link.js +4 -0
  160. package/dist/esm/models/operations/sdk-create-verification-link.js.map +1 -1
  161. package/dist/esm/models/operations/sdk-send-by-number.d.ts +1 -1
  162. package/dist/esm/models/operations/sdk-verify-token.d.ts +19 -4
  163. package/dist/esm/models/operations/sdk-verify-token.d.ts.map +1 -1
  164. package/dist/esm/models/operations/sdk-verify-token.js +10 -0
  165. package/dist/esm/models/operations/sdk-verify-token.js.map +1 -1
  166. package/dist/esm/models/operations/secured-accounts-list.d.ts +5 -0
  167. package/dist/esm/models/operations/secured-accounts-list.d.ts.map +1 -1
  168. package/dist/esm/models/operations/secured-accounts-list.js +2 -0
  169. package/dist/esm/models/operations/secured-accounts-list.js.map +1 -1
  170. package/dist/esm/models/operations/secured-accounts-status.d.ts +5 -0
  171. package/dist/esm/models/operations/secured-accounts-status.d.ts.map +1 -1
  172. package/dist/esm/models/operations/secured-accounts-status.js +2 -0
  173. package/dist/esm/models/operations/secured-accounts-status.js.map +1 -1
  174. package/dist/esm/models/operations/signin-confirm.d.ts +148 -0
  175. package/dist/esm/models/operations/signin-confirm.d.ts.map +1 -0
  176. package/dist/esm/models/operations/signin-confirm.js +156 -0
  177. package/dist/esm/models/operations/signin-confirm.js.map +1 -0
  178. package/dist/esm/models/operations/signin-request.d.ts +115 -0
  179. package/dist/esm/models/operations/signin-request.d.ts.map +1 -0
  180. package/dist/esm/models/operations/signin-request.js +128 -0
  181. package/dist/esm/models/operations/signin-request.js.map +1 -0
  182. package/dist/esm/models/operations/verification-get-status.d.ts +10 -5
  183. package/dist/esm/models/operations/verification-get-status.d.ts.map +1 -1
  184. package/dist/esm/models/operations/verification-get-status.js +5 -1
  185. package/dist/esm/models/operations/verification-get-status.js.map +1 -1
  186. package/dist/esm/sdk/census.d.ts +3 -3
  187. package/dist/esm/sdk/census.js +3 -3
  188. package/dist/esm/sdk/recovery.d.ts +19 -0
  189. package/dist/esm/sdk/recovery.d.ts.map +1 -0
  190. package/dist/esm/sdk/recovery.js +28 -0
  191. package/dist/esm/sdk/recovery.js.map +1 -0
  192. package/dist/esm/sdk/sdk.d.ts +6 -0
  193. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  194. package/dist/esm/sdk/sdk.js +10 -0
  195. package/dist/esm/sdk/sdk.js.map +1 -1
  196. package/dist/esm/sdk/sign-in.d.ts +19 -0
  197. package/dist/esm/sdk/sign-in.d.ts.map +1 -0
  198. package/dist/esm/sdk/sign-in.js +28 -0
  199. package/dist/esm/sdk/sign-in.js.map +1 -0
  200. package/dist/esm/sdk/verification.d.ts +1 -1
  201. package/dist/esm/sdk/verification.js +1 -1
  202. package/jsr.json +1 -1
  203. package/package.json +1 -1
  204. package/src/funcs/census-confirm-link.ts +1 -1
  205. package/src/funcs/census-send-by-number.ts +1 -1
  206. package/src/funcs/census-verify-token.ts +1 -1
  207. package/src/funcs/recovery-exchange.ts +184 -0
  208. package/src/funcs/recovery-other-route.ts +184 -0
  209. package/src/funcs/sign-in-confirm.ts +184 -0
  210. package/src/funcs/sign-in-request.ts +184 -0
  211. package/src/funcs/verification-get-status.ts +7 -2
  212. package/src/lib/config.ts +2 -12
  213. package/src/mcp-server/mcp-server.ts +1 -1
  214. package/src/mcp-server/server.ts +1 -1
  215. package/src/models/bot-shield-action.ts +62 -1
  216. package/src/models/error-body.ts +1 -1
  217. package/src/models/operations/actions-propose.ts +1 -1
  218. package/src/models/operations/gates-api-actions-create.ts +2 -2
  219. package/src/models/operations/gates-api-actions-list.ts +1 -1
  220. package/src/models/operations/gates-api-actions-request.ts +2 -2
  221. package/src/models/operations/gates-api-actions-set-state.ts +1 -1
  222. package/src/models/operations/gates-api-actions-update.ts +2 -2
  223. package/src/models/operations/index.ts +4 -0
  224. package/src/models/operations/recovery-exchange.ts +308 -0
  225. package/src/models/operations/recovery-other-route.ts +262 -0
  226. package/src/models/operations/sdk-create-verification-link.ts +10 -1
  227. package/src/models/operations/sdk-send-by-number.ts +1 -1
  228. package/src/models/operations/sdk-verify-token.ts +29 -4
  229. package/src/models/operations/secured-accounts-list.ts +7 -0
  230. package/src/models/operations/secured-accounts-status.ts +7 -0
  231. package/src/models/operations/signin-confirm.ts +383 -0
  232. package/src/models/operations/signin-request.ts +319 -0
  233. package/src/models/operations/verification-get-status.ts +14 -5
  234. package/src/sdk/census.ts +3 -3
  235. package/src/sdk/recovery.ts +49 -0
  236. package/src/sdk/sdk.ts +12 -0
  237. package/src/sdk/sign-in.ts +49 -0
  238. package/src/sdk/verification.ts +1 -1
@@ -0,0 +1,262 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import * as types from "../../types/primitives.js";
10
+ import { SDKValidationError } from "../errors/sdk-validation-error.js";
11
+ import * as models from "../index.js";
12
+
13
+ export type RecoveryOtherRouteSecurity = {
14
+ apiKeyAuth: string;
15
+ };
16
+
17
+ export type RecoveryOtherRouteRequest = {
18
+ /**
19
+ * The account's handle (`OP_…`), as BotShield gave it to you.
20
+ */
21
+ handle: string;
22
+ };
23
+
24
+ export type RecoveryOtherRouteDataData = {
25
+ received: boolean;
26
+ /**
27
+ * When your other route may take effect: the person has until then to say it was not them.
28
+ */
29
+ worksFrom: Date;
30
+ };
31
+
32
+ export type RecoveryOtherRouteData = {
33
+ data?: RecoveryOtherRouteDataData | undefined;
34
+ /**
35
+ * Handler error. Arrives inside `data.error` with HTTP 200. Check for it before reading the result.
36
+ */
37
+ error?: models.ErrorBody | undefined;
38
+ };
39
+
40
+ /**
41
+ * Received. NOTE: handler errors also arrive here (HTTP 200) as data.error — codes: `invalid_key` (401 — missing, malformed or inactive key; a site key `pk_…` is refused), `org_not_found` (404), `handle_invalid` (400), `unavailable` (503).
42
+ */
43
+ export type RecoveryOtherRouteResponse = {
44
+ data: RecoveryOtherRouteData;
45
+ };
46
+
47
+ /** @internal */
48
+ export const RecoveryOtherRouteSecurity$inboundSchema: z.ZodType<
49
+ RecoveryOtherRouteSecurity,
50
+ z.ZodTypeDef,
51
+ unknown
52
+ > = z.object({
53
+ ApiKeyAuth: types.string(),
54
+ }).transform((v) => {
55
+ return remap$(v, {
56
+ "ApiKeyAuth": "apiKeyAuth",
57
+ });
58
+ });
59
+ /** @internal */
60
+ export type RecoveryOtherRouteSecurity$Outbound = {
61
+ ApiKeyAuth: string;
62
+ };
63
+
64
+ /** @internal */
65
+ export const RecoveryOtherRouteSecurity$outboundSchema: z.ZodType<
66
+ RecoveryOtherRouteSecurity$Outbound,
67
+ z.ZodTypeDef,
68
+ RecoveryOtherRouteSecurity
69
+ > = z.object({
70
+ apiKeyAuth: z.string(),
71
+ }).transform((v) => {
72
+ return remap$(v, {
73
+ apiKeyAuth: "ApiKeyAuth",
74
+ });
75
+ });
76
+
77
+ export function recoveryOtherRouteSecurityToJSON(
78
+ recoveryOtherRouteSecurity: RecoveryOtherRouteSecurity,
79
+ ): string {
80
+ return JSON.stringify(
81
+ RecoveryOtherRouteSecurity$outboundSchema.parse(recoveryOtherRouteSecurity),
82
+ );
83
+ }
84
+ export function recoveryOtherRouteSecurityFromJSON(
85
+ jsonString: string,
86
+ ): SafeParseResult<RecoveryOtherRouteSecurity, SDKValidationError> {
87
+ return safeParse(
88
+ jsonString,
89
+ (x) => RecoveryOtherRouteSecurity$inboundSchema.parse(JSON.parse(x)),
90
+ `Failed to parse 'RecoveryOtherRouteSecurity' from JSON`,
91
+ );
92
+ }
93
+
94
+ /** @internal */
95
+ export const RecoveryOtherRouteRequest$inboundSchema: z.ZodType<
96
+ RecoveryOtherRouteRequest,
97
+ z.ZodTypeDef,
98
+ unknown
99
+ > = z.object({
100
+ handle: types.string(),
101
+ });
102
+ /** @internal */
103
+ export type RecoveryOtherRouteRequest$Outbound = {
104
+ handle: string;
105
+ };
106
+
107
+ /** @internal */
108
+ export const RecoveryOtherRouteRequest$outboundSchema: z.ZodType<
109
+ RecoveryOtherRouteRequest$Outbound,
110
+ z.ZodTypeDef,
111
+ RecoveryOtherRouteRequest
112
+ > = z.object({
113
+ handle: z.string(),
114
+ });
115
+
116
+ export function recoveryOtherRouteRequestToJSON(
117
+ recoveryOtherRouteRequest: RecoveryOtherRouteRequest,
118
+ ): string {
119
+ return JSON.stringify(
120
+ RecoveryOtherRouteRequest$outboundSchema.parse(recoveryOtherRouteRequest),
121
+ );
122
+ }
123
+ export function recoveryOtherRouteRequestFromJSON(
124
+ jsonString: string,
125
+ ): SafeParseResult<RecoveryOtherRouteRequest, SDKValidationError> {
126
+ return safeParse(
127
+ jsonString,
128
+ (x) => RecoveryOtherRouteRequest$inboundSchema.parse(JSON.parse(x)),
129
+ `Failed to parse 'RecoveryOtherRouteRequest' from JSON`,
130
+ );
131
+ }
132
+
133
+ /** @internal */
134
+ export const RecoveryOtherRouteDataData$inboundSchema: z.ZodType<
135
+ RecoveryOtherRouteDataData,
136
+ z.ZodTypeDef,
137
+ unknown
138
+ > = z.object({
139
+ received: types.boolean(),
140
+ works_from: types.date(),
141
+ }).transform((v) => {
142
+ return remap$(v, {
143
+ "works_from": "worksFrom",
144
+ });
145
+ });
146
+ /** @internal */
147
+ export type RecoveryOtherRouteDataData$Outbound = {
148
+ received: boolean;
149
+ works_from: string;
150
+ };
151
+
152
+ /** @internal */
153
+ export const RecoveryOtherRouteDataData$outboundSchema: z.ZodType<
154
+ RecoveryOtherRouteDataData$Outbound,
155
+ z.ZodTypeDef,
156
+ RecoveryOtherRouteDataData
157
+ > = z.object({
158
+ received: z.boolean(),
159
+ worksFrom: z.date().transform(v => v.toISOString()),
160
+ }).transform((v) => {
161
+ return remap$(v, {
162
+ worksFrom: "works_from",
163
+ });
164
+ });
165
+
166
+ export function recoveryOtherRouteDataDataToJSON(
167
+ recoveryOtherRouteDataData: RecoveryOtherRouteDataData,
168
+ ): string {
169
+ return JSON.stringify(
170
+ RecoveryOtherRouteDataData$outboundSchema.parse(recoveryOtherRouteDataData),
171
+ );
172
+ }
173
+ export function recoveryOtherRouteDataDataFromJSON(
174
+ jsonString: string,
175
+ ): SafeParseResult<RecoveryOtherRouteDataData, SDKValidationError> {
176
+ return safeParse(
177
+ jsonString,
178
+ (x) => RecoveryOtherRouteDataData$inboundSchema.parse(JSON.parse(x)),
179
+ `Failed to parse 'RecoveryOtherRouteDataData' from JSON`,
180
+ );
181
+ }
182
+
183
+ /** @internal */
184
+ export const RecoveryOtherRouteData$inboundSchema: z.ZodType<
185
+ RecoveryOtherRouteData,
186
+ z.ZodTypeDef,
187
+ unknown
188
+ > = z.object({
189
+ data: types.optional(z.lazy(() => RecoveryOtherRouteDataData$inboundSchema)),
190
+ error: types.optional(models.ErrorBody$inboundSchema),
191
+ });
192
+ /** @internal */
193
+ export type RecoveryOtherRouteData$Outbound = {
194
+ data?: RecoveryOtherRouteDataData$Outbound | undefined;
195
+ error?: models.ErrorBody$Outbound | undefined;
196
+ };
197
+
198
+ /** @internal */
199
+ export const RecoveryOtherRouteData$outboundSchema: z.ZodType<
200
+ RecoveryOtherRouteData$Outbound,
201
+ z.ZodTypeDef,
202
+ RecoveryOtherRouteData
203
+ > = z.object({
204
+ data: z.lazy(() => RecoveryOtherRouteDataData$outboundSchema).optional(),
205
+ error: models.ErrorBody$outboundSchema.optional(),
206
+ });
207
+
208
+ export function recoveryOtherRouteDataToJSON(
209
+ recoveryOtherRouteData: RecoveryOtherRouteData,
210
+ ): string {
211
+ return JSON.stringify(
212
+ RecoveryOtherRouteData$outboundSchema.parse(recoveryOtherRouteData),
213
+ );
214
+ }
215
+ export function recoveryOtherRouteDataFromJSON(
216
+ jsonString: string,
217
+ ): SafeParseResult<RecoveryOtherRouteData, SDKValidationError> {
218
+ return safeParse(
219
+ jsonString,
220
+ (x) => RecoveryOtherRouteData$inboundSchema.parse(JSON.parse(x)),
221
+ `Failed to parse 'RecoveryOtherRouteData' from JSON`,
222
+ );
223
+ }
224
+
225
+ /** @internal */
226
+ export const RecoveryOtherRouteResponse$inboundSchema: z.ZodType<
227
+ RecoveryOtherRouteResponse,
228
+ z.ZodTypeDef,
229
+ unknown
230
+ > = z.object({
231
+ data: z.lazy(() => RecoveryOtherRouteData$inboundSchema),
232
+ });
233
+ /** @internal */
234
+ export type RecoveryOtherRouteResponse$Outbound = {
235
+ data: RecoveryOtherRouteData$Outbound;
236
+ };
237
+
238
+ /** @internal */
239
+ export const RecoveryOtherRouteResponse$outboundSchema: z.ZodType<
240
+ RecoveryOtherRouteResponse$Outbound,
241
+ z.ZodTypeDef,
242
+ RecoveryOtherRouteResponse
243
+ > = z.object({
244
+ data: z.lazy(() => RecoveryOtherRouteData$outboundSchema),
245
+ });
246
+
247
+ export function recoveryOtherRouteResponseToJSON(
248
+ recoveryOtherRouteResponse: RecoveryOtherRouteResponse,
249
+ ): string {
250
+ return JSON.stringify(
251
+ RecoveryOtherRouteResponse$outboundSchema.parse(recoveryOtherRouteResponse),
252
+ );
253
+ }
254
+ export function recoveryOtherRouteResponseFromJSON(
255
+ jsonString: string,
256
+ ): SafeParseResult<RecoveryOtherRouteResponse, SDKValidationError> {
257
+ return safeParse(
258
+ jsonString,
259
+ (x) => RecoveryOtherRouteResponse$inboundSchema.parse(JSON.parse(x)),
260
+ `Failed to parse 'RecoveryOtherRouteResponse' from JSON`,
261
+ );
262
+ }
@@ -191,6 +191,10 @@ export type SDKCreateVerificationLinkNotarizeFallbackReason = OpenEnum<
191
191
 
192
192
  export type SDKCreateVerificationLinkDataData = {
193
193
  requestId: string;
194
+ /**
195
+ * Only on a request started with your site key (`pk_…`, a page's grant). The one secret that reads this request's answer: send it as `X-BotShield-Request-Secret` to verification/status, which returns the finished tokens only with it. Returned once, here; BotShield keeps only its hash. A request your server started with its secret key has none (its tokens go to that key).
196
+ */
197
+ readSecret?: string | undefined;
194
198
  deepLink: string;
195
199
  webUrl: string;
196
200
  /**
@@ -258,7 +262,7 @@ export type SDKCreateVerificationLinkData = {
258
262
  };
259
263
 
260
264
  /**
261
- * Verification link created. NOTE: handler errors also arrive here (HTTP 200) as data.error — codes for this operation: 400 (partner not found / gate not active), 401, 403 (gate not in the token allowlist), 409 (pending request already exists — call revoke-verification). BotShield Actions and linking codes (`data.error.code`): `act_label_without_act` (400), `act_label_has_link` (400 — `act_label` may not contain a link, a domain or a URI scheme), `action_not_a_gate` (400), `action_invalid` (400 — act malformed), `action_not_found` (400 — no action with that key here), `action_off` (409), `action_requires_user_ref` (400), `link_requires_user_ref` (400 — the gate's policy is `link: required` and no partner_user_ref was sent), `account_reconfirm_required` (409 — the customer changed their phone number without approval from another phone; only the link ceremony (`notarize`) can be started for this partner_user_ref until they confirm the account again from your signed-in page). A development key over its limit: `RATE_LIMITED`.
265
+ * Verification link created. NOTE: handler errors also arrive here (HTTP 200) as data.error — codes for this operation: 400 (partner not found / gate not active), 401, 403 (gate not in the token allowlist), 409 (pending request already exists — call revoke-verification). BotShield Actions and linking codes (`data.error.code`): `act_label_without_act` (400), `act_label_has_link` (400 — `act_label` may not contain a link, a domain or a URI scheme), `action_not_a_gate` (400), `action_invalid` (400 — act malformed), `action_not_found` (400 — no action with that key here), `action_off` (409), `action_requires_user_ref` (400), `link_requires_user_ref` (400 — the gate's policy is `link: required` and no partner_user_ref was sent), `account_reconfirm_required` (409 — the customer changed their phone number without approval from another phone; only the link ceremony (`notarize`) can be started for this partner_user_ref until they confirm the account again from your signed-in page). A development key over its limit: `RATE_LIMITED`. `link_requires_server_session` (403 — a request on a site-key grant that would write a NEW link: a `notarize` ceremony, or an `act` on an account not linked here yet; open the session from your server with your secret key, naming the signed-in customer), `account_override_refused` (403 — `partner_user_ref` names a different account from the one the session names), `action_is_recovery` / `action_is_signin` (400 — that `act` is your Recovery Action or your Sign-on Action, which no request starts), and 503 when BotShield could not tell whether the account is already linked (nothing was written; retry).
262
266
  */
263
267
  export type SDKCreateVerificationLinkResponse = {
264
268
  data: SDKCreateVerificationLinkData;
@@ -579,6 +583,7 @@ export const SDKCreateVerificationLinkDataData$inboundSchema: z.ZodType<
579
583
  unknown
580
584
  > = z.object({
581
585
  request_id: types.string(),
586
+ read_secret: types.optional(types.string()),
582
587
  deep_link: types.string(),
583
588
  web_url: types.string(),
584
589
  qr_code_url: types.string(),
@@ -607,6 +612,7 @@ export const SDKCreateVerificationLinkDataData$inboundSchema: z.ZodType<
607
612
  }).transform((v) => {
608
613
  return remap$(v, {
609
614
  "request_id": "requestId",
615
+ "read_secret": "readSecret",
610
616
  "deep_link": "deepLink",
611
617
  "web_url": "webUrl",
612
618
  "qr_code_url": "qrCodeUrl",
@@ -623,6 +629,7 @@ export const SDKCreateVerificationLinkDataData$inboundSchema: z.ZodType<
623
629
  /** @internal */
624
630
  export type SDKCreateVerificationLinkDataData$Outbound = {
625
631
  request_id: string;
632
+ read_secret?: string | undefined;
626
633
  deep_link: string;
627
634
  web_url: string;
628
635
  qr_code_url: string;
@@ -649,6 +656,7 @@ export const SDKCreateVerificationLinkDataData$outboundSchema: z.ZodType<
649
656
  SDKCreateVerificationLinkDataData
650
657
  > = z.object({
651
658
  requestId: z.string(),
659
+ readSecret: z.string().optional(),
652
660
  deepLink: z.string(),
653
661
  webUrl: z.string(),
654
662
  qrCodeUrl: z.string(),
@@ -672,6 +680,7 @@ export const SDKCreateVerificationLinkDataData$outboundSchema: z.ZodType<
672
680
  }).transform((v) => {
673
681
  return remap$(v, {
674
682
  requestId: "request_id",
683
+ readSecret: "read_secret",
675
684
  deepLink: "deep_link",
676
685
  webUrl: "web_url",
677
686
  qrCodeUrl: "qr_code_url",
@@ -57,7 +57,7 @@ export type SDKSendByNumberData = {
57
57
  };
58
58
 
59
59
  /**
60
- * Result. NOTE: handler errors arrive here (HTTP 200) as data.error — codes: secret_key_required · invalid_key · phone_invalid · action_invalid · action_not_found · action_off · act_label_has_link · org_not_verified · send_rate_limited · unanswered_limit_reached · unavailable.
60
+ * Result. NOTE: handler errors arrive here (HTTP 200) as data.error — codes: secret_key_required · invalid_key · phone_invalid · action_invalid · action_not_found · action_off · act_label_has_link · org_not_verified · send_rate_limited · unanswered_limit_reached · unavailable. Action_is_recovery · action_is_signin (400 — your Recovery Action and Sign-on Action are never sent).
61
61
  */
62
62
  export type SDKSendByNumberResponse = {
63
63
  data?: SDKSendByNumberData | undefined;
@@ -27,9 +27,13 @@ export type SDKVerifyTokenRequest = {
27
27
  */
28
28
  audience?: string | undefined;
29
29
  /**
30
- * 4.0: with your secret key, on a token whose link is pending, this confirms the link (same as sdk/confirm-link). The answer's `link` says whether it went live.
30
+ * With your secret key, on a token whose link is pending, this confirms the link (same as sdk/confirm-link). The answer's `link` says whether it went live.
31
31
  */
32
32
  partnerUserRef?: string | undefined;
33
+ /**
34
+ * The request YOUR server made for this attempt. When given, a token for any other request is refused (`valid: false`, `code: request_mismatch`) and is not spent.
35
+ */
36
+ expectedRequestId?: string | undefined;
33
37
  };
34
38
 
35
39
  /**
@@ -112,7 +116,11 @@ export type Claims = {
112
116
  */
113
117
  environment?: SDKVerifyTokenEnvironment | null | undefined;
114
118
  /**
115
- * 4.0: where the link stood for this token: `pending`, `live`, `expired` or `refused`. Absent on a plain check.
119
+ * Present for 72 hours after this verified account was recovered with Recover Account with BotShield: when it was recovered. Only when `trusted` is true.
120
+ */
121
+ recoveredAt?: Date | undefined;
122
+ /**
123
+ * Where the link stood for this token: `pending`, `live`, `expired` or `refused`. Absent on a plain check.
116
124
  */
117
125
  linkState?: string | undefined;
118
126
  };
@@ -137,7 +145,7 @@ export const SDKVerifyTokenState = {
137
145
  export type SDKVerifyTokenState = OpenEnum<typeof SDKVerifyTokenState>;
138
146
 
139
147
  /**
140
- * 4.0: present only on a token whose link waited for your server. `pending`: not confirmed (send your secret key and `partner_user_ref`, or call sdk/confirm-link). `live` with `confirmed: true`: this check confirmed it. `not_live`: the confirm was refused (`code`).
148
+ * Present only on a token whose link waited for your server. `pending`: not confirmed (send your secret key and `partner_user_ref`, or call sdk/confirm-link). `live` with `confirmed: true`: this check confirmed it. `not_live`: the confirm was refused (`code`).
141
149
  */
142
150
  export type SDKVerifyTokenLink = {
143
151
  state?: SDKVerifyTokenState | undefined;
@@ -157,6 +165,10 @@ export type SDKVerifyTokenDataData = {
157
165
  * Present when valid is false. A plain line, not a code. Includes: `Invalid token — not a BotShield verification token` (a token of another kind), `Invalid token — unknown environment`, and `Token was issued in the development environment; this key is production.` (or the reverse).
158
166
  */
159
167
  reason?: string | undefined;
168
+ /**
169
+ * On some refusals (`valid: false`), a code beside `reason`: `secret_key_required` (called without your secret key; the token was not spent), `request_mismatch` (the token is for another request than `expected_request_id`; not spent).
170
+ */
171
+ code?: string | undefined;
160
172
  /**
161
173
  * Present when the token was valid but has expired.
162
174
  */
@@ -171,7 +183,7 @@ export type SDKVerifyTokenDataData = {
171
183
  */
172
184
  verdict?: SDKVerifyTokenVerdict | undefined;
173
185
  /**
174
- * 4.0: present only on a token whose link waited for your server. `pending`: not confirmed (send your secret key and `partner_user_ref`, or call sdk/confirm-link). `live` with `confirmed: true`: this check confirmed it. `not_live`: the confirm was refused (`code`).
186
+ * Present only on a token whose link waited for your server. `pending`: not confirmed (send your secret key and `partner_user_ref`, or call sdk/confirm-link). `live` with `confirmed: true`: this check confirmed it. `not_live`: the confirm was refused (`code`).
175
187
  */
176
188
  link?: SDKVerifyTokenLink | undefined;
177
189
  };
@@ -242,9 +254,11 @@ export const SDKVerifyTokenRequest$inboundSchema: z.ZodType<
242
254
  token: types.string(),
243
255
  audience: types.optional(types.string()),
244
256
  partner_user_ref: types.optional(types.string()),
257
+ expected_request_id: types.optional(types.string()),
245
258
  }).transform((v) => {
246
259
  return remap$(v, {
247
260
  "partner_user_ref": "partnerUserRef",
261
+ "expected_request_id": "expectedRequestId",
248
262
  });
249
263
  });
250
264
  /** @internal */
@@ -252,6 +266,7 @@ export type SDKVerifyTokenRequest$Outbound = {
252
266
  token: string;
253
267
  audience?: string | undefined;
254
268
  partner_user_ref?: string | undefined;
269
+ expected_request_id?: string | undefined;
255
270
  };
256
271
 
257
272
  /** @internal */
@@ -263,9 +278,11 @@ export const SDKVerifyTokenRequest$outboundSchema: z.ZodType<
263
278
  token: z.string(),
264
279
  audience: z.string().optional(),
265
280
  partnerUserRef: z.string().optional(),
281
+ expectedRequestId: z.string().optional(),
266
282
  }).transform((v) => {
267
283
  return remap$(v, {
268
284
  partnerUserRef: "partner_user_ref",
285
+ expectedRequestId: "expected_request_id",
269
286
  });
270
287
  });
271
288
 
@@ -331,6 +348,7 @@ export const Claims$inboundSchema: z.ZodType<Claims, z.ZodTypeDef, unknown> = z
331
348
  act: types.optional(types.string()),
332
349
  kind: z.nullable(Kind$inboundSchema).optional(),
333
350
  environment: z.nullable(SDKVerifyTokenEnvironment$inboundSchema).optional(),
351
+ recovered_at: types.optional(types.date()),
334
352
  link_state: types.optional(types.string()),
335
353
  }).transform((v) => {
336
354
  return remap$(v, {
@@ -341,6 +359,7 @@ export const Claims$inboundSchema: z.ZodType<Claims, z.ZodTypeDef, unknown> = z
341
359
  "age_over": "ageOver",
342
360
  "trusted_since": "trustedSince",
343
361
  "last_pass_at": "lastPassAt",
362
+ "recovered_at": "recoveredAt",
344
363
  "link_state": "linkState",
345
364
  });
346
365
  });
@@ -361,6 +380,7 @@ export type Claims$Outbound = {
361
380
  act?: string | undefined;
362
381
  kind?: string | null | undefined;
363
382
  environment?: string | null | undefined;
383
+ recovered_at?: string | undefined;
364
384
  link_state?: string | undefined;
365
385
  };
366
386
 
@@ -385,6 +405,7 @@ export const Claims$outboundSchema: z.ZodType<
385
405
  act: z.string().optional(),
386
406
  kind: z.nullable(Kind$outboundSchema).optional(),
387
407
  environment: z.nullable(SDKVerifyTokenEnvironment$outboundSchema).optional(),
408
+ recoveredAt: z.date().transform(v => v.toISOString()).optional(),
388
409
  linkState: z.string().optional(),
389
410
  }).transform((v) => {
390
411
  return remap$(v, {
@@ -395,6 +416,7 @@ export const Claims$outboundSchema: z.ZodType<
395
416
  ageOver: "age_over",
396
417
  trustedSince: "trusted_since",
397
418
  lastPassAt: "last_pass_at",
419
+ recoveredAt: "recovered_at",
398
420
  linkState: "link_state",
399
421
  });
400
422
  });
@@ -508,6 +530,7 @@ export const SDKVerifyTokenDataData$inboundSchema: z.ZodType<
508
530
  > = z.object({
509
531
  valid: types.boolean(),
510
532
  reason: types.optional(types.string()),
533
+ code: types.optional(types.string()),
511
534
  expired_at: z.nullable(types.date()).optional(),
512
535
  claims: z.nullable(z.lazy(() => Claims$inboundSchema)).optional(),
513
536
  replayed: types.optional(types.boolean()),
@@ -522,6 +545,7 @@ export const SDKVerifyTokenDataData$inboundSchema: z.ZodType<
522
545
  export type SDKVerifyTokenDataData$Outbound = {
523
546
  valid: boolean;
524
547
  reason?: string | undefined;
548
+ code?: string | undefined;
525
549
  expired_at?: string | null | undefined;
526
550
  claims?: Claims$Outbound | null | undefined;
527
551
  replayed?: boolean | undefined;
@@ -537,6 +561,7 @@ export const SDKVerifyTokenDataData$outboundSchema: z.ZodType<
537
561
  > = z.object({
538
562
  valid: z.boolean(),
539
563
  reason: z.string().optional(),
564
+ code: z.string().optional(),
540
565
  expiredAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
541
566
  claims: z.nullable(z.lazy(() => Claims$outboundSchema)).optional(),
542
567
  replayed: z.boolean().optional(),
@@ -94,6 +94,10 @@ export type Row = {
94
94
  * The Link with BotShield ID surface the account was secured through; null when it was secured at a Gate.
95
95
  */
96
96
  surfaceId: string | null;
97
+ /**
98
+ * True while the person's number changed without approval from another phone: this account answers nothing (refusals say account_reconfirm_required) until your signed-in link ceremony completes again. Never true for an unlinked account.
99
+ */
100
+ paused: boolean;
97
101
  };
98
102
 
99
103
  /**
@@ -304,6 +308,7 @@ export const Row$inboundSchema: z.ZodType<Row, z.ZodTypeDef, unknown> = z
304
308
  SecuredAccountsListUnlinkReason$inboundSchema,
305
309
  ),
306
310
  surface_id: types.nullable(types.string()),
311
+ paused: types.boolean(),
307
312
  }).transform((v) => {
308
313
  return remap$(v, {
309
314
  "secured_at": "securedAt",
@@ -322,6 +327,7 @@ export type Row$Outbound = {
322
327
  unlinked_by: string | null;
323
328
  unlink_reason: string | null;
324
329
  surface_id: string | null;
330
+ paused: boolean;
325
331
  };
326
332
 
327
333
  /** @internal */
@@ -334,6 +340,7 @@ export const Row$outboundSchema: z.ZodType<Row$Outbound, z.ZodTypeDef, Row> = z
334
340
  unlinkedBy: z.nullable(UnlinkedBy$outboundSchema),
335
341
  unlinkReason: z.nullable(SecuredAccountsListUnlinkReason$outboundSchema),
336
342
  surfaceId: z.nullable(z.string()),
343
+ paused: z.boolean(),
337
344
  }).transform((v) => {
338
345
  return remap$(v, {
339
346
  securedAt: "secured_at",
@@ -38,6 +38,10 @@ export type SecuredAccountsStatusDataData = {
38
38
  * When recent presence lapses (in the past when `stale`); null when `none`.
39
39
  */
40
40
  freshUntil: Date | null;
41
+ /**
42
+ * True while the person's number changed without approval from another phone: this account answers nothing (refusals say account_reconfirm_required) until your signed-in link ceremony completes again. null when it can't be read; false when there is no live account.
43
+ */
44
+ paused?: boolean | null | undefined;
41
45
  };
42
46
 
43
47
  export type SecuredAccountsStatusData = {
@@ -174,6 +178,7 @@ export const SecuredAccountsStatusDataData$inboundSchema: z.ZodType<
174
178
  > = z.object({
175
179
  state: SecuredAccountsStatusState$inboundSchema,
176
180
  fresh_until: types.nullable(types.date()),
181
+ paused: z.nullable(types.boolean()).optional(),
177
182
  }).transform((v) => {
178
183
  return remap$(v, {
179
184
  "fresh_until": "freshUntil",
@@ -183,6 +188,7 @@ export const SecuredAccountsStatusDataData$inboundSchema: z.ZodType<
183
188
  export type SecuredAccountsStatusDataData$Outbound = {
184
189
  state: string;
185
190
  fresh_until: string | null;
191
+ paused?: boolean | null | undefined;
186
192
  };
187
193
 
188
194
  /** @internal */
@@ -193,6 +199,7 @@ export const SecuredAccountsStatusDataData$outboundSchema: z.ZodType<
193
199
  > = z.object({
194
200
  state: SecuredAccountsStatusState$outboundSchema,
195
201
  freshUntil: z.nullable(z.date().transform(v => v.toISOString())),
202
+ paused: z.nullable(z.boolean()).optional(),
196
203
  }).transform((v) => {
197
204
  return remap$(v, {
198
205
  freshUntil: "fresh_until",