botshield-sdk 1.9.0 → 2.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 (1154) hide show
  1. package/FUNCTIONS.md +87 -0
  2. package/README.md +482 -295
  3. package/RUNTIMES.md +48 -0
  4. package/bin/mcp-server.js +52952 -0
  5. package/bin/mcp-server.js.map +379 -0
  6. package/dist/commonjs/core.d.ts +10 -0
  7. package/dist/commonjs/core.d.ts.map +1 -0
  8. package/dist/commonjs/core.js +17 -0
  9. package/dist/commonjs/core.js.map +1 -0
  10. package/dist/commonjs/funcs/actions-cancel-action.d.ts +18 -0
  11. package/dist/commonjs/funcs/actions-cancel-action.d.ts.map +1 -0
  12. package/dist/commonjs/funcs/actions-cancel-action.js +118 -0
  13. package/dist/commonjs/funcs/actions-cancel-action.js.map +1 -0
  14. package/dist/commonjs/funcs/actions-check-action-status.d.ts +18 -0
  15. package/dist/commonjs/funcs/actions-check-action-status.d.ts.map +1 -0
  16. package/dist/commonjs/funcs/actions-check-action-status.js +122 -0
  17. package/dist/commonjs/funcs/actions-check-action-status.js.map +1 -0
  18. package/dist/commonjs/funcs/actions-propose-action.d.ts +18 -0
  19. package/dist/commonjs/funcs/actions-propose-action.d.ts.map +1 -0
  20. package/dist/commonjs/funcs/actions-propose-action.js +118 -0
  21. package/dist/commonjs/funcs/actions-propose-action.js.map +1 -0
  22. package/dist/commonjs/funcs/census-create-session.d.ts +18 -0
  23. package/dist/commonjs/funcs/census-create-session.d.ts.map +1 -0
  24. package/dist/commonjs/funcs/census-create-session.js +123 -0
  25. package/dist/commonjs/funcs/census-create-session.js.map +1 -0
  26. package/dist/commonjs/funcs/census-create-verification-link.d.ts +18 -0
  27. package/dist/commonjs/funcs/census-create-verification-link.d.ts.map +1 -0
  28. package/dist/commonjs/funcs/census-create-verification-link.js +123 -0
  29. package/dist/commonjs/funcs/census-create-verification-link.js.map +1 -0
  30. package/dist/commonjs/funcs/census-get-partner-config.d.ts +18 -0
  31. package/dist/commonjs/funcs/census-get-partner-config.d.ts.map +1 -0
  32. package/dist/commonjs/funcs/census-get-partner-config.js +132 -0
  33. package/dist/commonjs/funcs/census-get-partner-config.js.map +1 -0
  34. package/dist/commonjs/funcs/census-logout.d.ts +15 -0
  35. package/dist/commonjs/funcs/census-logout.d.ts.map +1 -0
  36. package/dist/commonjs/funcs/census-logout.js +120 -0
  37. package/dist/commonjs/funcs/census-logout.js.map +1 -0
  38. package/dist/commonjs/funcs/census-revoke-verification.d.ts +18 -0
  39. package/dist/commonjs/funcs/census-revoke-verification.d.ts.map +1 -0
  40. package/dist/commonjs/funcs/census-revoke-verification.js +123 -0
  41. package/dist/commonjs/funcs/census-revoke-verification.js.map +1 -0
  42. package/dist/commonjs/funcs/census-store-signal.d.ts +18 -0
  43. package/dist/commonjs/funcs/census-store-signal.d.ts.map +1 -0
  44. package/dist/commonjs/funcs/census-store-signal.js +114 -0
  45. package/dist/commonjs/funcs/census-store-signal.js.map +1 -0
  46. package/dist/commonjs/funcs/census-validate-signal.d.ts +18 -0
  47. package/dist/commonjs/funcs/census-validate-signal.d.ts.map +1 -0
  48. package/dist/commonjs/funcs/census-validate-signal.js +114 -0
  49. package/dist/commonjs/funcs/census-validate-signal.js.map +1 -0
  50. package/dist/commonjs/funcs/census-verify-token.d.ts +18 -0
  51. package/dist/commonjs/funcs/census-verify-token.d.ts.map +1 -0
  52. package/dist/commonjs/funcs/census-verify-token.js +129 -0
  53. package/dist/commonjs/funcs/census-verify-token.js.map +1 -0
  54. package/dist/commonjs/funcs/verification-get-status.d.ts +18 -0
  55. package/dist/commonjs/funcs/verification-get-status.d.ts.map +1 -0
  56. package/dist/commonjs/funcs/verification-get-status.js +132 -0
  57. package/dist/commonjs/funcs/verification-get-status.js.map +1 -0
  58. package/dist/commonjs/hooks/hooks.d.ts +25 -0
  59. package/dist/commonjs/hooks/hooks.d.ts.map +1 -0
  60. package/dist/commonjs/hooks/hooks.js +84 -0
  61. package/dist/commonjs/hooks/hooks.js.map +1 -0
  62. package/dist/commonjs/hooks/index.d.ts +3 -0
  63. package/dist/commonjs/hooks/index.d.ts.map +1 -0
  64. package/dist/commonjs/hooks/index.js +22 -0
  65. package/dist/commonjs/hooks/index.js.map +1 -0
  66. package/dist/commonjs/hooks/types.d.ts +77 -0
  67. package/dist/commonjs/hooks/types.d.ts.map +1 -0
  68. package/dist/commonjs/hooks/types.js +6 -0
  69. package/dist/commonjs/hooks/types.js.map +1 -0
  70. package/dist/commonjs/index.d.ts +6 -0
  71. package/dist/commonjs/index.d.ts.map +1 -0
  72. package/dist/commonjs/index.js +48 -0
  73. package/dist/commonjs/index.js.map +1 -0
  74. package/dist/commonjs/lib/base64.d.ts +10 -0
  75. package/dist/commonjs/lib/base64.d.ts.map +1 -0
  76. package/dist/commonjs/lib/base64.js +71 -0
  77. package/dist/commonjs/lib/base64.js.map +1 -0
  78. package/dist/commonjs/lib/config.d.ts +42 -0
  79. package/dist/commonjs/lib/config.d.ts.map +1 -0
  80. package/dist/commonjs/lib/config.js +42 -0
  81. package/dist/commonjs/lib/config.js.map +1 -0
  82. package/dist/commonjs/lib/encodings.d.ts +55 -0
  83. package/dist/commonjs/lib/encodings.d.ts.map +1 -0
  84. package/dist/commonjs/lib/encodings.js +422 -0
  85. package/dist/commonjs/lib/encodings.js.map +1 -0
  86. package/dist/commonjs/lib/files.d.ts +26 -0
  87. package/dist/commonjs/lib/files.d.ts.map +1 -0
  88. package/dist/commonjs/lib/files.js +96 -0
  89. package/dist/commonjs/lib/files.js.map +1 -0
  90. package/dist/commonjs/lib/http.d.ts +67 -0
  91. package/dist/commonjs/lib/http.d.ts.map +1 -0
  92. package/dist/commonjs/lib/http.js +219 -0
  93. package/dist/commonjs/lib/http.js.map +1 -0
  94. package/dist/commonjs/lib/logger.d.ts +6 -0
  95. package/dist/commonjs/lib/logger.d.ts.map +1 -0
  96. package/dist/commonjs/lib/logger.js +6 -0
  97. package/dist/commonjs/lib/logger.js.map +1 -0
  98. package/dist/commonjs/lib/matchers.d.ts +59 -0
  99. package/dist/commonjs/lib/matchers.d.ts.map +1 -0
  100. package/dist/commonjs/lib/matchers.js +221 -0
  101. package/dist/commonjs/lib/matchers.js.map +1 -0
  102. package/dist/commonjs/lib/primitives.d.ts +27 -0
  103. package/dist/commonjs/lib/primitives.d.ts.map +1 -0
  104. package/dist/commonjs/lib/primitives.js +129 -0
  105. package/dist/commonjs/lib/primitives.js.map +1 -0
  106. package/dist/commonjs/lib/retries.d.ts +38 -0
  107. package/dist/commonjs/lib/retries.d.ts.map +1 -0
  108. package/dist/commonjs/lib/retries.js +163 -0
  109. package/dist/commonjs/lib/retries.js.map +1 -0
  110. package/dist/commonjs/lib/schemas.d.ts +19 -0
  111. package/dist/commonjs/lib/schemas.d.ts.map +1 -0
  112. package/dist/commonjs/lib/schemas.js +62 -0
  113. package/dist/commonjs/lib/schemas.js.map +1 -0
  114. package/dist/commonjs/lib/sdks.d.ts +63 -0
  115. package/dist/commonjs/lib/sdks.d.ts.map +1 -0
  116. package/dist/commonjs/lib/sdks.js +294 -0
  117. package/dist/commonjs/lib/sdks.js.map +1 -0
  118. package/dist/commonjs/lib/security.d.ts +84 -0
  119. package/dist/commonjs/lib/security.d.ts.map +1 -0
  120. package/dist/commonjs/lib/security.js +160 -0
  121. package/dist/commonjs/lib/security.js.map +1 -0
  122. package/dist/commonjs/lib/url.d.ts +5 -0
  123. package/dist/commonjs/lib/url.d.ts.map +1 -0
  124. package/dist/commonjs/lib/url.js +27 -0
  125. package/dist/commonjs/lib/url.js.map +1 -0
  126. package/dist/commonjs/mcp-server/cli/start/command.d.ts +2 -0
  127. package/dist/commonjs/mcp-server/cli/start/command.d.ts.map +1 -0
  128. package/dist/commonjs/mcp-server/cli/start/command.js +141 -0
  129. package/dist/commonjs/mcp-server/cli/start/command.js.map +1 -0
  130. package/dist/commonjs/mcp-server/cli/start/impl.d.ts +19 -0
  131. package/dist/commonjs/mcp-server/cli/start/impl.d.ts.map +1 -0
  132. package/dist/commonjs/mcp-server/cli/start/impl.js +110 -0
  133. package/dist/commonjs/mcp-server/cli/start/impl.js.map +1 -0
  134. package/dist/commonjs/mcp-server/cli.d.ts +6 -0
  135. package/dist/commonjs/mcp-server/cli.d.ts.map +1 -0
  136. package/dist/commonjs/mcp-server/cli.js +10 -0
  137. package/dist/commonjs/mcp-server/cli.js.map +1 -0
  138. package/dist/commonjs/mcp-server/console-logger.d.ts +7 -0
  139. package/dist/commonjs/mcp-server/console-logger.d.ts.map +1 -0
  140. package/dist/commonjs/mcp-server/console-logger.js +59 -0
  141. package/dist/commonjs/mcp-server/console-logger.js.map +1 -0
  142. package/dist/commonjs/mcp-server/extensions.d.ts +11 -0
  143. package/dist/commonjs/mcp-server/extensions.d.ts.map +1 -0
  144. package/dist/commonjs/mcp-server/extensions.js +6 -0
  145. package/dist/commonjs/mcp-server/extensions.js.map +1 -0
  146. package/dist/commonjs/mcp-server/mcp-server.d.ts +2 -0
  147. package/dist/commonjs/mcp-server/mcp-server.d.ts.map +1 -0
  148. package/dist/commonjs/mcp-server/mcp-server.js +29 -0
  149. package/dist/commonjs/mcp-server/mcp-server.js.map +1 -0
  150. package/dist/commonjs/mcp-server/prompts.d.ts +26 -0
  151. package/dist/commonjs/mcp-server/prompts.d.ts.map +1 -0
  152. package/dist/commonjs/mcp-server/prompts.js +51 -0
  153. package/dist/commonjs/mcp-server/prompts.js.map +1 -0
  154. package/dist/commonjs/mcp-server/resources.d.ts +32 -0
  155. package/dist/commonjs/mcp-server/resources.d.ts.map +1 -0
  156. package/dist/commonjs/mcp-server/resources.js +87 -0
  157. package/dist/commonjs/mcp-server/resources.js.map +1 -0
  158. package/dist/commonjs/mcp-server/scopes.d.ts +3 -0
  159. package/dist/commonjs/mcp-server/scopes.d.ts.map +1 -0
  160. package/dist/commonjs/mcp-server/scopes.js +10 -0
  161. package/dist/commonjs/mcp-server/scopes.js.map +1 -0
  162. package/dist/commonjs/mcp-server/server.d.ts +13 -0
  163. package/dist/commonjs/mcp-server/server.d.ts.map +1 -0
  164. package/dist/commonjs/mcp-server/server.js +38 -0
  165. package/dist/commonjs/mcp-server/server.js.map +1 -0
  166. package/dist/commonjs/mcp-server/shared.d.ts +7 -0
  167. package/dist/commonjs/mcp-server/shared.d.ts.map +1 -0
  168. package/dist/commonjs/mcp-server/shared.js +98 -0
  169. package/dist/commonjs/mcp-server/shared.js.map +1 -0
  170. package/dist/commonjs/mcp-server/tools/actions-cancel-action.d.ts +8 -0
  171. package/dist/commonjs/mcp-server/tools/actions-cancel-action.d.ts.map +1 -0
  172. package/dist/commonjs/mcp-server/tools/actions-cancel-action.js +63 -0
  173. package/dist/commonjs/mcp-server/tools/actions-cancel-action.js.map +1 -0
  174. package/dist/commonjs/mcp-server/tools/actions-check-action-status.d.ts +8 -0
  175. package/dist/commonjs/mcp-server/tools/actions-check-action-status.d.ts.map +1 -0
  176. package/dist/commonjs/mcp-server/tools/actions-check-action-status.js +63 -0
  177. package/dist/commonjs/mcp-server/tools/actions-check-action-status.js.map +1 -0
  178. package/dist/commonjs/mcp-server/tools/actions-propose-action.d.ts +8 -0
  179. package/dist/commonjs/mcp-server/tools/actions-propose-action.d.ts.map +1 -0
  180. package/dist/commonjs/mcp-server/tools/actions-propose-action.js +63 -0
  181. package/dist/commonjs/mcp-server/tools/actions-propose-action.js.map +1 -0
  182. package/dist/commonjs/mcp-server/tools.d.ts +25 -0
  183. package/dist/commonjs/mcp-server/tools.d.ts.map +1 -0
  184. package/dist/commonjs/mcp-server/tools.js +82 -0
  185. package/dist/commonjs/mcp-server/tools.js.map +1 -0
  186. package/dist/commonjs/models/error-body.d.ts +56 -0
  187. package/dist/commonjs/models/error-body.d.ts.map +1 -0
  188. package/dist/commonjs/models/error-body.js +100 -0
  189. package/dist/commonjs/models/error-body.js.map +1 -0
  190. package/dist/commonjs/models/error-response.d.ts +19 -0
  191. package/dist/commonjs/models/error-response.d.ts.map +1 -0
  192. package/dist/commonjs/models/error-response.js +61 -0
  193. package/dist/commonjs/models/error-response.js.map +1 -0
  194. package/dist/commonjs/models/errors/bot-shield-default-error.d.ts +10 -0
  195. package/dist/commonjs/models/errors/bot-shield-default-error.d.ts.map +1 -0
  196. package/dist/commonjs/models/errors/bot-shield-default-error.js +34 -0
  197. package/dist/commonjs/models/errors/bot-shield-default-error.js.map +1 -0
  198. package/dist/commonjs/models/errors/bot-shield-error.d.ts +19 -0
  199. package/dist/commonjs/models/errors/bot-shield-error.d.ts.map +1 -0
  200. package/dist/commonjs/models/errors/bot-shield-error.js +30 -0
  201. package/dist/commonjs/models/errors/bot-shield-error.js.map +1 -0
  202. package/dist/commonjs/models/errors/error-response.d.ts +31 -0
  203. package/dist/commonjs/models/errors/error-response.d.ts.map +1 -0
  204. package/dist/commonjs/models/errors/error-response.js +80 -0
  205. package/dist/commonjs/models/errors/error-response.js.map +1 -0
  206. package/dist/commonjs/models/errors/http-client-errors.d.ts +44 -0
  207. package/dist/commonjs/models/errors/http-client-errors.d.ts.map +1 -0
  208. package/dist/commonjs/models/errors/http-client-errors.js +65 -0
  209. package/dist/commonjs/models/errors/http-client-errors.js.map +1 -0
  210. package/dist/commonjs/models/errors/index.d.ts +8 -0
  211. package/dist/commonjs/models/errors/index.d.ts.map +1 -0
  212. package/dist/commonjs/models/errors/index.js +27 -0
  213. package/dist/commonjs/models/errors/index.js.map +1 -0
  214. package/dist/commonjs/models/errors/invalid-input-error.d.ts +42 -0
  215. package/dist/commonjs/models/errors/invalid-input-error.d.ts.map +1 -0
  216. package/dist/commonjs/models/errors/invalid-input-error.js +86 -0
  217. package/dist/commonjs/models/errors/invalid-input-error.js.map +1 -0
  218. package/dist/commonjs/models/errors/response-validation-error.d.ts +26 -0
  219. package/dist/commonjs/models/errors/response-validation-error.d.ts.map +1 -0
  220. package/dist/commonjs/models/errors/response-validation-error.js +74 -0
  221. package/dist/commonjs/models/errors/response-validation-error.js.map +1 -0
  222. package/dist/commonjs/models/errors/sdk-validation-error.d.ts +21 -0
  223. package/dist/commonjs/models/errors/sdk-validation-error.d.ts.map +1 -0
  224. package/dist/commonjs/models/errors/sdk-validation-error.js +137 -0
  225. package/dist/commonjs/models/errors/sdk-validation-error.js.map +1 -0
  226. package/dist/commonjs/models/index.d.ts +5 -0
  227. package/dist/commonjs/models/index.d.ts.map +1 -0
  228. package/dist/commonjs/models/index.js +24 -0
  229. package/dist/commonjs/models/index.js.map +1 -0
  230. package/dist/commonjs/models/invalid-input-error.d.ts +24 -0
  231. package/dist/commonjs/models/invalid-input-error.d.ts.map +1 -0
  232. package/dist/commonjs/models/invalid-input-error.js +63 -0
  233. package/dist/commonjs/models/invalid-input-error.js.map +1 -0
  234. package/dist/commonjs/models/operations/actions-cancel.d.ts +104 -0
  235. package/dist/commonjs/models/operations/actions-cancel.d.ts.map +1 -0
  236. package/dist/commonjs/models/operations/actions-cancel.js +154 -0
  237. package/dist/commonjs/models/operations/actions-cancel.js.map +1 -0
  238. package/dist/commonjs/models/operations/actions-check-status.d.ts +121 -0
  239. package/dist/commonjs/models/operations/actions-check-status.d.ts.map +1 -0
  240. package/dist/commonjs/models/operations/actions-check-status.js +176 -0
  241. package/dist/commonjs/models/operations/actions-check-status.js.map +1 -0
  242. package/dist/commonjs/models/operations/actions-propose.d.ts +187 -0
  243. package/dist/commonjs/models/operations/actions-propose.d.ts.map +1 -0
  244. package/dist/commonjs/models/operations/actions-propose.js +227 -0
  245. package/dist/commonjs/models/operations/actions-propose.js.map +1 -0
  246. package/dist/commonjs/models/operations/index.d.ts +13 -0
  247. package/dist/commonjs/models/operations/index.d.ts.map +1 -0
  248. package/dist/commonjs/models/operations/index.js +32 -0
  249. package/dist/commonjs/models/operations/index.js.map +1 -0
  250. package/dist/commonjs/models/operations/sdk-create-session.d.ts +139 -0
  251. package/dist/commonjs/models/operations/sdk-create-session.d.ts.map +1 -0
  252. package/dist/commonjs/models/operations/sdk-create-session.js +205 -0
  253. package/dist/commonjs/models/operations/sdk-create-session.js.map +1 -0
  254. package/dist/commonjs/models/operations/sdk-create-verification-link.d.ts +220 -0
  255. package/dist/commonjs/models/operations/sdk-create-verification-link.d.ts.map +1 -0
  256. package/dist/commonjs/models/operations/sdk-create-verification-link.js +270 -0
  257. package/dist/commonjs/models/operations/sdk-create-verification-link.js.map +1 -0
  258. package/dist/commonjs/models/operations/sdk-get-partner-config.d.ts +126 -0
  259. package/dist/commonjs/models/operations/sdk-get-partner-config.d.ts.map +1 -0
  260. package/dist/commonjs/models/operations/sdk-get-partner-config.js +179 -0
  261. package/dist/commonjs/models/operations/sdk-get-partner-config.js.map +1 -0
  262. package/dist/commonjs/models/operations/sdk-logout.d.ts +74 -0
  263. package/dist/commonjs/models/operations/sdk-logout.d.ts.map +1 -0
  264. package/dist/commonjs/models/operations/sdk-logout.js +143 -0
  265. package/dist/commonjs/models/operations/sdk-logout.js.map +1 -0
  266. package/dist/commonjs/models/operations/sdk-revoke-verification.d.ts +97 -0
  267. package/dist/commonjs/models/operations/sdk-revoke-verification.d.ts.map +1 -0
  268. package/dist/commonjs/models/operations/sdk-revoke-verification.js +161 -0
  269. package/dist/commonjs/models/operations/sdk-revoke-verification.js.map +1 -0
  270. package/dist/commonjs/models/operations/sdk-store-signal.d.ts +93 -0
  271. package/dist/commonjs/models/operations/sdk-store-signal.d.ts.map +1 -0
  272. package/dist/commonjs/models/operations/sdk-store-signal.js +155 -0
  273. package/dist/commonjs/models/operations/sdk-store-signal.js.map +1 -0
  274. package/dist/commonjs/models/operations/sdk-validate-signal.d.ts +101 -0
  275. package/dist/commonjs/models/operations/sdk-validate-signal.d.ts.map +1 -0
  276. package/dist/commonjs/models/operations/sdk-validate-signal.js +164 -0
  277. package/dist/commonjs/models/operations/sdk-validate-signal.js.map +1 -0
  278. package/dist/commonjs/models/operations/sdk-verify-token.d.ts +120 -0
  279. package/dist/commonjs/models/operations/sdk-verify-token.d.ts.map +1 -0
  280. package/dist/commonjs/models/operations/sdk-verify-token.js +186 -0
  281. package/dist/commonjs/models/operations/sdk-verify-token.js.map +1 -0
  282. package/dist/commonjs/models/operations/verification-get-status.d.ts +161 -0
  283. package/dist/commonjs/models/operations/verification-get-status.d.ts.map +1 -0
  284. package/dist/commonjs/models/operations/verification-get-status.js +236 -0
  285. package/dist/commonjs/models/operations/verification-get-status.js.map +1 -0
  286. package/dist/commonjs/models/security.d.ts +19 -0
  287. package/dist/commonjs/models/security.d.ts.map +1 -0
  288. package/dist/commonjs/models/security.js +61 -0
  289. package/dist/commonjs/models/security.js.map +1 -0
  290. package/dist/commonjs/package.json +3 -0
  291. package/dist/commonjs/sdk/actions.d.ts +26 -0
  292. package/dist/commonjs/sdk/actions.d.ts.map +1 -0
  293. package/dist/commonjs/sdk/actions.js +42 -0
  294. package/dist/commonjs/sdk/actions.js.map +1 -0
  295. package/dist/commonjs/sdk/census.d.ts +58 -0
  296. package/dist/commonjs/sdk/census.d.ts.map +1 -0
  297. package/dist/commonjs/sdk/census.js +89 -0
  298. package/dist/commonjs/sdk/census.js.map +1 -0
  299. package/dist/commonjs/sdk/index.d.ts +2 -0
  300. package/dist/commonjs/sdk/index.d.ts.map +1 -0
  301. package/dist/commonjs/sdk/index.js +21 -0
  302. package/dist/commonjs/sdk/index.js.map +1 -0
  303. package/dist/commonjs/sdk/sdk.d.ts +13 -0
  304. package/dist/commonjs/sdk/sdk.d.ts.map +1 -0
  305. package/dist/commonjs/sdk/sdk.js +26 -0
  306. package/dist/commonjs/sdk/sdk.js.map +1 -0
  307. package/dist/commonjs/sdk/verification.d.ts +12 -0
  308. package/dist/commonjs/sdk/verification.d.ts.map +1 -0
  309. package/dist/commonjs/sdk/verification.js +22 -0
  310. package/dist/commonjs/sdk/verification.js.map +1 -0
  311. package/dist/commonjs/types/async.d.ts +23 -0
  312. package/dist/commonjs/types/async.d.ts.map +1 -0
  313. package/dist/commonjs/types/async.js +32 -0
  314. package/dist/commonjs/types/async.js.map +1 -0
  315. package/dist/commonjs/types/blobs.d.ts +4 -0
  316. package/dist/commonjs/types/blobs.d.ts.map +1 -0
  317. package/dist/commonjs/types/blobs.js +62 -0
  318. package/dist/commonjs/types/blobs.js.map +1 -0
  319. package/dist/commonjs/types/const-date-time.d.ts +3 -0
  320. package/dist/commonjs/types/const-date-time.d.ts.map +1 -0
  321. package/dist/commonjs/types/const-date-time.js +46 -0
  322. package/dist/commonjs/types/const-date-time.js.map +1 -0
  323. package/dist/commonjs/types/default-to-zero-value.d.ts +12 -0
  324. package/dist/commonjs/types/default-to-zero-value.d.ts.map +1 -0
  325. package/dist/commonjs/types/default-to-zero-value.js +35 -0
  326. package/dist/commonjs/types/default-to-zero-value.js.map +1 -0
  327. package/dist/commonjs/types/enums.d.ts +9 -0
  328. package/dist/commonjs/types/enums.d.ts.map +1 -0
  329. package/dist/commonjs/types/enums.js +66 -0
  330. package/dist/commonjs/types/enums.js.map +1 -0
  331. package/dist/commonjs/types/fp.d.ts +31 -0
  332. package/dist/commonjs/types/fp.d.ts.map +1 -0
  333. package/dist/commonjs/types/fp.js +37 -0
  334. package/dist/commonjs/types/fp.js.map +1 -0
  335. package/dist/commonjs/types/index.d.ts +10 -0
  336. package/dist/commonjs/types/index.d.ts.map +1 -0
  337. package/dist/commonjs/types/index.js +31 -0
  338. package/dist/commonjs/types/index.js.map +1 -0
  339. package/dist/commonjs/types/operations.d.ts +27 -0
  340. package/dist/commonjs/types/operations.d.ts.map +1 -0
  341. package/dist/commonjs/types/operations.js +83 -0
  342. package/dist/commonjs/types/operations.js.map +1 -0
  343. package/dist/commonjs/types/primitives.d.ts +9 -0
  344. package/dist/commonjs/types/primitives.d.ts.map +1 -0
  345. package/dist/commonjs/types/primitives.js +147 -0
  346. package/dist/commonjs/types/primitives.js.map +1 -0
  347. package/dist/commonjs/types/rfcdate.d.ts +21 -0
  348. package/dist/commonjs/types/rfcdate.d.ts.map +1 -0
  349. package/dist/commonjs/types/rfcdate.js +47 -0
  350. package/dist/commonjs/types/rfcdate.js.map +1 -0
  351. package/dist/commonjs/types/smart-union.d.ts +7 -0
  352. package/dist/commonjs/types/smart-union.d.ts.map +1 -0
  353. package/dist/commonjs/types/smart-union.js +152 -0
  354. package/dist/commonjs/types/smart-union.js.map +1 -0
  355. package/dist/commonjs/types/streams.d.ts +2 -0
  356. package/dist/commonjs/types/streams.d.ts.map +1 -0
  357. package/dist/commonjs/types/streams.js +18 -0
  358. package/dist/commonjs/types/streams.js.map +1 -0
  359. package/dist/commonjs/types/unrecognized.d.ts +16 -0
  360. package/dist/commonjs/types/unrecognized.d.ts.map +1 -0
  361. package/dist/commonjs/types/unrecognized.js +34 -0
  362. package/dist/commonjs/types/unrecognized.js.map +1 -0
  363. package/dist/esm/core.d.ts +10 -0
  364. package/dist/esm/core.d.ts.map +1 -0
  365. package/dist/esm/core.js +13 -0
  366. package/dist/esm/core.js.map +1 -0
  367. package/dist/esm/funcs/actions-cancel-action.d.ts +18 -0
  368. package/dist/esm/funcs/actions-cancel-action.d.ts.map +1 -0
  369. package/dist/esm/funcs/actions-cancel-action.js +82 -0
  370. package/dist/esm/funcs/actions-cancel-action.js.map +1 -0
  371. package/dist/esm/funcs/actions-check-action-status.d.ts +18 -0
  372. package/dist/esm/funcs/actions-check-action-status.d.ts.map +1 -0
  373. package/dist/esm/funcs/actions-check-action-status.js +86 -0
  374. package/dist/esm/funcs/actions-check-action-status.js.map +1 -0
  375. package/dist/esm/funcs/actions-propose-action.d.ts +18 -0
  376. package/dist/esm/funcs/actions-propose-action.d.ts.map +1 -0
  377. package/dist/esm/funcs/actions-propose-action.js +82 -0
  378. package/dist/esm/funcs/actions-propose-action.js.map +1 -0
  379. package/dist/esm/funcs/census-create-session.d.ts +18 -0
  380. package/dist/esm/funcs/census-create-session.d.ts.map +1 -0
  381. package/dist/esm/funcs/census-create-session.js +87 -0
  382. package/dist/esm/funcs/census-create-session.js.map +1 -0
  383. package/dist/esm/funcs/census-create-verification-link.d.ts +18 -0
  384. package/dist/esm/funcs/census-create-verification-link.d.ts.map +1 -0
  385. package/dist/esm/funcs/census-create-verification-link.js +87 -0
  386. package/dist/esm/funcs/census-create-verification-link.js.map +1 -0
  387. package/dist/esm/funcs/census-get-partner-config.d.ts +18 -0
  388. package/dist/esm/funcs/census-get-partner-config.d.ts.map +1 -0
  389. package/dist/esm/funcs/census-get-partner-config.js +96 -0
  390. package/dist/esm/funcs/census-get-partner-config.js.map +1 -0
  391. package/dist/esm/funcs/census-logout.d.ts +15 -0
  392. package/dist/esm/funcs/census-logout.d.ts.map +1 -0
  393. package/dist/esm/funcs/census-logout.js +84 -0
  394. package/dist/esm/funcs/census-logout.js.map +1 -0
  395. package/dist/esm/funcs/census-revoke-verification.d.ts +18 -0
  396. package/dist/esm/funcs/census-revoke-verification.d.ts.map +1 -0
  397. package/dist/esm/funcs/census-revoke-verification.js +87 -0
  398. package/dist/esm/funcs/census-revoke-verification.js.map +1 -0
  399. package/dist/esm/funcs/census-store-signal.d.ts +18 -0
  400. package/dist/esm/funcs/census-store-signal.d.ts.map +1 -0
  401. package/dist/esm/funcs/census-store-signal.js +78 -0
  402. package/dist/esm/funcs/census-store-signal.js.map +1 -0
  403. package/dist/esm/funcs/census-validate-signal.d.ts +18 -0
  404. package/dist/esm/funcs/census-validate-signal.d.ts.map +1 -0
  405. package/dist/esm/funcs/census-validate-signal.js +78 -0
  406. package/dist/esm/funcs/census-validate-signal.js.map +1 -0
  407. package/dist/esm/funcs/census-verify-token.d.ts +18 -0
  408. package/dist/esm/funcs/census-verify-token.d.ts.map +1 -0
  409. package/dist/esm/funcs/census-verify-token.js +93 -0
  410. package/dist/esm/funcs/census-verify-token.js.map +1 -0
  411. package/dist/esm/funcs/verification-get-status.d.ts +18 -0
  412. package/dist/esm/funcs/verification-get-status.d.ts.map +1 -0
  413. package/dist/esm/funcs/verification-get-status.js +96 -0
  414. package/dist/esm/funcs/verification-get-status.js.map +1 -0
  415. package/dist/esm/hooks/hooks.d.ts +25 -0
  416. package/dist/esm/hooks/hooks.d.ts.map +1 -0
  417. package/dist/esm/hooks/hooks.js +80 -0
  418. package/dist/esm/hooks/hooks.js.map +1 -0
  419. package/dist/esm/hooks/index.d.ts +3 -0
  420. package/dist/esm/hooks/index.d.ts.map +1 -0
  421. package/dist/esm/hooks/index.js +6 -0
  422. package/dist/esm/hooks/index.js.map +1 -0
  423. package/dist/esm/hooks/types.d.ts +77 -0
  424. package/dist/esm/hooks/types.d.ts.map +1 -0
  425. package/dist/esm/hooks/types.js +5 -0
  426. package/dist/esm/hooks/types.js.map +1 -0
  427. package/dist/esm/index.d.ts +6 -0
  428. package/dist/esm/index.d.ts.map +1 -0
  429. package/dist/esm/index.js +8 -0
  430. package/dist/esm/index.js.map +1 -0
  431. package/dist/esm/lib/base64.d.ts +10 -0
  432. package/dist/esm/lib/base64.d.ts.map +1 -0
  433. package/dist/esm/lib/base64.js +29 -0
  434. package/dist/esm/lib/base64.js.map +1 -0
  435. package/dist/esm/lib/config.d.ts +42 -0
  436. package/dist/esm/lib/config.d.ts.map +1 -0
  437. package/dist/esm/lib/config.js +38 -0
  438. package/dist/esm/lib/config.js.map +1 -0
  439. package/dist/esm/lib/encodings.d.ts +55 -0
  440. package/dist/esm/lib/encodings.d.ts.map +1 -0
  441. package/dist/esm/lib/encodings.js +407 -0
  442. package/dist/esm/lib/encodings.js.map +1 -0
  443. package/dist/esm/lib/files.d.ts +26 -0
  444. package/dist/esm/lib/files.d.ts.map +1 -0
  445. package/dist/esm/lib/files.js +91 -0
  446. package/dist/esm/lib/files.js.map +1 -0
  447. package/dist/esm/lib/http.d.ts +67 -0
  448. package/dist/esm/lib/http.d.ts.map +1 -0
  449. package/dist/esm/lib/http.js +209 -0
  450. package/dist/esm/lib/http.js.map +1 -0
  451. package/dist/esm/lib/logger.d.ts +6 -0
  452. package/dist/esm/lib/logger.d.ts.map +1 -0
  453. package/dist/esm/lib/logger.js +5 -0
  454. package/dist/esm/lib/logger.js.map +1 -0
  455. package/dist/esm/lib/matchers.d.ts +59 -0
  456. package/dist/esm/lib/matchers.d.ts.map +1 -0
  457. package/dist/esm/lib/matchers.js +202 -0
  458. package/dist/esm/lib/matchers.js.map +1 -0
  459. package/dist/esm/lib/primitives.d.ts +27 -0
  460. package/dist/esm/lib/primitives.d.ts.map +1 -0
  461. package/dist/esm/lib/primitives.js +120 -0
  462. package/dist/esm/lib/primitives.js.map +1 -0
  463. package/dist/esm/lib/retries.d.ts +38 -0
  464. package/dist/esm/lib/retries.d.ts.map +1 -0
  465. package/dist/esm/lib/retries.js +157 -0
  466. package/dist/esm/lib/retries.js.map +1 -0
  467. package/dist/esm/lib/schemas.d.ts +19 -0
  468. package/dist/esm/lib/schemas.d.ts.map +1 -0
  469. package/dist/esm/lib/schemas.js +57 -0
  470. package/dist/esm/lib/schemas.js.map +1 -0
  471. package/dist/esm/lib/sdks.d.ts +63 -0
  472. package/dist/esm/lib/sdks.d.ts.map +1 -0
  473. package/dist/esm/lib/sdks.js +290 -0
  474. package/dist/esm/lib/sdks.js.map +1 -0
  475. package/dist/esm/lib/security.d.ts +84 -0
  476. package/dist/esm/lib/security.d.ts.map +1 -0
  477. package/dist/esm/lib/security.js +153 -0
  478. package/dist/esm/lib/security.js.map +1 -0
  479. package/dist/esm/lib/url.d.ts +5 -0
  480. package/dist/esm/lib/url.d.ts.map +1 -0
  481. package/dist/esm/lib/url.js +24 -0
  482. package/dist/esm/lib/url.js.map +1 -0
  483. package/dist/esm/mcp-server/build.d.mts.map +1 -0
  484. package/dist/esm/mcp-server/build.mjs +14 -0
  485. package/dist/esm/mcp-server/build.mjs.map +1 -0
  486. package/dist/esm/mcp-server/cli/start/command.d.ts +2 -0
  487. package/dist/esm/mcp-server/cli/start/command.d.ts.map +1 -0
  488. package/dist/esm/mcp-server/cli/start/command.js +105 -0
  489. package/dist/esm/mcp-server/cli/start/command.js.map +1 -0
  490. package/dist/esm/mcp-server/cli/start/impl.d.ts +19 -0
  491. package/dist/esm/mcp-server/cli/start/impl.d.ts.map +1 -0
  492. package/dist/esm/mcp-server/cli/start/impl.js +104 -0
  493. package/dist/esm/mcp-server/cli/start/impl.js.map +1 -0
  494. package/dist/esm/mcp-server/cli.d.ts +6 -0
  495. package/dist/esm/mcp-server/cli.d.ts.map +1 -0
  496. package/dist/esm/mcp-server/cli.js +7 -0
  497. package/dist/esm/mcp-server/cli.js.map +1 -0
  498. package/dist/esm/mcp-server/console-logger.d.ts +7 -0
  499. package/dist/esm/mcp-server/console-logger.d.ts.map +1 -0
  500. package/dist/esm/mcp-server/console-logger.js +55 -0
  501. package/dist/esm/mcp-server/console-logger.js.map +1 -0
  502. package/dist/esm/mcp-server/extensions.d.ts +11 -0
  503. package/dist/esm/mcp-server/extensions.d.ts.map +1 -0
  504. package/dist/esm/mcp-server/extensions.js +5 -0
  505. package/dist/esm/mcp-server/extensions.js.map +1 -0
  506. package/dist/esm/mcp-server/mcp-server.d.ts +2 -0
  507. package/dist/esm/mcp-server/mcp-server.d.ts.map +1 -0
  508. package/dist/esm/mcp-server/mcp-server.js +23 -0
  509. package/dist/esm/mcp-server/mcp-server.js.map +1 -0
  510. package/dist/esm/mcp-server/prompts.d.ts +26 -0
  511. package/dist/esm/mcp-server/prompts.d.ts.map +1 -0
  512. package/dist/esm/mcp-server/prompts.js +47 -0
  513. package/dist/esm/mcp-server/prompts.js.map +1 -0
  514. package/dist/esm/mcp-server/resources.d.ts +32 -0
  515. package/dist/esm/mcp-server/resources.d.ts.map +1 -0
  516. package/dist/esm/mcp-server/resources.js +82 -0
  517. package/dist/esm/mcp-server/resources.js.map +1 -0
  518. package/dist/esm/mcp-server/scopes.d.ts +3 -0
  519. package/dist/esm/mcp-server/scopes.d.ts.map +1 -0
  520. package/dist/esm/mcp-server/scopes.js +7 -0
  521. package/dist/esm/mcp-server/scopes.js.map +1 -0
  522. package/dist/esm/mcp-server/server.d.ts +13 -0
  523. package/dist/esm/mcp-server/server.d.ts.map +1 -0
  524. package/dist/esm/mcp-server/server.js +35 -0
  525. package/dist/esm/mcp-server/server.js.map +1 -0
  526. package/dist/esm/mcp-server/shared.d.ts +7 -0
  527. package/dist/esm/mcp-server/shared.d.ts.map +1 -0
  528. package/dist/esm/mcp-server/shared.js +59 -0
  529. package/dist/esm/mcp-server/shared.js.map +1 -0
  530. package/dist/esm/mcp-server/tools/actions-cancel-action.d.ts +8 -0
  531. package/dist/esm/mcp-server/tools/actions-cancel-action.d.ts.map +1 -0
  532. package/dist/esm/mcp-server/tools/actions-cancel-action.js +27 -0
  533. package/dist/esm/mcp-server/tools/actions-cancel-action.js.map +1 -0
  534. package/dist/esm/mcp-server/tools/actions-check-action-status.d.ts +8 -0
  535. package/dist/esm/mcp-server/tools/actions-check-action-status.d.ts.map +1 -0
  536. package/dist/esm/mcp-server/tools/actions-check-action-status.js +27 -0
  537. package/dist/esm/mcp-server/tools/actions-check-action-status.js.map +1 -0
  538. package/dist/esm/mcp-server/tools/actions-propose-action.d.ts +8 -0
  539. package/dist/esm/mcp-server/tools/actions-propose-action.d.ts.map +1 -0
  540. package/dist/esm/mcp-server/tools/actions-propose-action.js +27 -0
  541. package/dist/esm/mcp-server/tools/actions-propose-action.js.map +1 -0
  542. package/dist/esm/mcp-server/tools.d.ts +25 -0
  543. package/dist/esm/mcp-server/tools.d.ts.map +1 -0
  544. package/dist/esm/mcp-server/tools.js +78 -0
  545. package/dist/esm/mcp-server/tools.js.map +1 -0
  546. package/dist/esm/models/error-body.d.ts +56 -0
  547. package/dist/esm/models/error-body.d.ts.map +1 -0
  548. package/dist/esm/models/error-body.js +60 -0
  549. package/dist/esm/models/error-body.js.map +1 -0
  550. package/dist/esm/models/error-response.d.ts +19 -0
  551. package/dist/esm/models/error-response.d.ts.map +1 -0
  552. package/dist/esm/models/error-response.js +23 -0
  553. package/dist/esm/models/error-response.js.map +1 -0
  554. package/dist/esm/models/errors/bot-shield-default-error.d.ts +10 -0
  555. package/dist/esm/models/errors/bot-shield-default-error.d.ts.map +1 -0
  556. package/dist/esm/models/errors/bot-shield-default-error.js +30 -0
  557. package/dist/esm/models/errors/bot-shield-default-error.js.map +1 -0
  558. package/dist/esm/models/errors/bot-shield-error.d.ts +19 -0
  559. package/dist/esm/models/errors/bot-shield-error.d.ts.map +1 -0
  560. package/dist/esm/models/errors/bot-shield-error.js +26 -0
  561. package/dist/esm/models/errors/bot-shield-error.js.map +1 -0
  562. package/dist/esm/models/errors/error-response.d.ts +31 -0
  563. package/dist/esm/models/errors/error-response.d.ts.map +1 -0
  564. package/dist/esm/models/errors/error-response.js +43 -0
  565. package/dist/esm/models/errors/error-response.js.map +1 -0
  566. package/dist/esm/models/errors/http-client-errors.d.ts +44 -0
  567. package/dist/esm/models/errors/http-client-errors.d.ts.map +1 -0
  568. package/dist/esm/models/errors/http-client-errors.js +56 -0
  569. package/dist/esm/models/errors/http-client-errors.js.map +1 -0
  570. package/dist/esm/models/errors/index.d.ts +8 -0
  571. package/dist/esm/models/errors/index.d.ts.map +1 -0
  572. package/dist/esm/models/errors/index.js +11 -0
  573. package/dist/esm/models/errors/index.js.map +1 -0
  574. package/dist/esm/models/errors/invalid-input-error.d.ts +42 -0
  575. package/dist/esm/models/errors/invalid-input-error.d.ts.map +1 -0
  576. package/dist/esm/models/errors/invalid-input-error.js +49 -0
  577. package/dist/esm/models/errors/invalid-input-error.js.map +1 -0
  578. package/dist/esm/models/errors/response-validation-error.d.ts +26 -0
  579. package/dist/esm/models/errors/response-validation-error.d.ts.map +1 -0
  580. package/dist/esm/models/errors/response-validation-error.js +37 -0
  581. package/dist/esm/models/errors/response-validation-error.js.map +1 -0
  582. package/dist/esm/models/errors/sdk-validation-error.d.ts +21 -0
  583. package/dist/esm/models/errors/sdk-validation-error.d.ts.map +1 -0
  584. package/dist/esm/models/errors/sdk-validation-error.js +99 -0
  585. package/dist/esm/models/errors/sdk-validation-error.js.map +1 -0
  586. package/dist/esm/models/index.d.ts +5 -0
  587. package/dist/esm/models/index.d.ts.map +1 -0
  588. package/dist/esm/models/index.js +8 -0
  589. package/dist/esm/models/index.js.map +1 -0
  590. package/dist/esm/models/invalid-input-error.d.ts +24 -0
  591. package/dist/esm/models/invalid-input-error.d.ts.map +1 -0
  592. package/dist/esm/models/invalid-input-error.js +25 -0
  593. package/dist/esm/models/invalid-input-error.js.map +1 -0
  594. package/dist/esm/models/operations/actions-cancel.d.ts +104 -0
  595. package/dist/esm/models/operations/actions-cancel.d.ts.map +1 -0
  596. package/dist/esm/models/operations/actions-cancel.js +110 -0
  597. package/dist/esm/models/operations/actions-cancel.js.map +1 -0
  598. package/dist/esm/models/operations/actions-check-status.d.ts +121 -0
  599. package/dist/esm/models/operations/actions-check-status.d.ts.map +1 -0
  600. package/dist/esm/models/operations/actions-check-status.js +132 -0
  601. package/dist/esm/models/operations/actions-check-status.js.map +1 -0
  602. package/dist/esm/models/operations/actions-propose.d.ts +187 -0
  603. package/dist/esm/models/operations/actions-propose.d.ts.map +1 -0
  604. package/dist/esm/models/operations/actions-propose.js +179 -0
  605. package/dist/esm/models/operations/actions-propose.js.map +1 -0
  606. package/dist/esm/models/operations/index.d.ts +13 -0
  607. package/dist/esm/models/operations/index.d.ts.map +1 -0
  608. package/dist/esm/models/operations/index.js +16 -0
  609. package/dist/esm/models/operations/index.js.map +1 -0
  610. package/dist/esm/models/operations/sdk-create-session.d.ts +139 -0
  611. package/dist/esm/models/operations/sdk-create-session.d.ts.map +1 -0
  612. package/dist/esm/models/operations/sdk-create-session.js +157 -0
  613. package/dist/esm/models/operations/sdk-create-session.js.map +1 -0
  614. package/dist/esm/models/operations/sdk-create-verification-link.d.ts +220 -0
  615. package/dist/esm/models/operations/sdk-create-verification-link.d.ts.map +1 -0
  616. package/dist/esm/models/operations/sdk-create-verification-link.js +222 -0
  617. package/dist/esm/models/operations/sdk-create-verification-link.js.map +1 -0
  618. package/dist/esm/models/operations/sdk-get-partner-config.d.ts +126 -0
  619. package/dist/esm/models/operations/sdk-get-partner-config.d.ts.map +1 -0
  620. package/dist/esm/models/operations/sdk-get-partner-config.js +131 -0
  621. package/dist/esm/models/operations/sdk-get-partner-config.js.map +1 -0
  622. package/dist/esm/models/operations/sdk-logout.d.ts +74 -0
  623. package/dist/esm/models/operations/sdk-logout.d.ts.map +1 -0
  624. package/dist/esm/models/operations/sdk-logout.js +99 -0
  625. package/dist/esm/models/operations/sdk-logout.js.map +1 -0
  626. package/dist/esm/models/operations/sdk-revoke-verification.d.ts +97 -0
  627. package/dist/esm/models/operations/sdk-revoke-verification.d.ts.map +1 -0
  628. package/dist/esm/models/operations/sdk-revoke-verification.js +115 -0
  629. package/dist/esm/models/operations/sdk-revoke-verification.js.map +1 -0
  630. package/dist/esm/models/operations/sdk-store-signal.d.ts +93 -0
  631. package/dist/esm/models/operations/sdk-store-signal.d.ts.map +1 -0
  632. package/dist/esm/models/operations/sdk-store-signal.js +111 -0
  633. package/dist/esm/models/operations/sdk-store-signal.js.map +1 -0
  634. package/dist/esm/models/operations/sdk-validate-signal.d.ts +101 -0
  635. package/dist/esm/models/operations/sdk-validate-signal.d.ts.map +1 -0
  636. package/dist/esm/models/operations/sdk-validate-signal.js +120 -0
  637. package/dist/esm/models/operations/sdk-validate-signal.js.map +1 -0
  638. package/dist/esm/models/operations/sdk-verify-token.d.ts +120 -0
  639. package/dist/esm/models/operations/sdk-verify-token.d.ts.map +1 -0
  640. package/dist/esm/models/operations/sdk-verify-token.js +138 -0
  641. package/dist/esm/models/operations/sdk-verify-token.js.map +1 -0
  642. package/dist/esm/models/operations/verification-get-status.d.ts +161 -0
  643. package/dist/esm/models/operations/verification-get-status.d.ts.map +1 -0
  644. package/dist/esm/models/operations/verification-get-status.js +190 -0
  645. package/dist/esm/models/operations/verification-get-status.js.map +1 -0
  646. package/dist/esm/models/security.d.ts +19 -0
  647. package/dist/esm/models/security.d.ts.map +1 -0
  648. package/dist/esm/models/security.js +23 -0
  649. package/dist/esm/models/security.js.map +1 -0
  650. package/dist/esm/package.json +3 -0
  651. package/dist/esm/sdk/actions.d.ts +26 -0
  652. package/dist/esm/sdk/actions.d.ts.map +1 -0
  653. package/dist/esm/sdk/actions.js +38 -0
  654. package/dist/esm/sdk/actions.js.map +1 -0
  655. package/dist/esm/sdk/census.d.ts +58 -0
  656. package/dist/esm/sdk/census.d.ts.map +1 -0
  657. package/dist/esm/sdk/census.js +85 -0
  658. package/dist/esm/sdk/census.js.map +1 -0
  659. package/dist/esm/sdk/index.d.ts +2 -0
  660. package/dist/esm/sdk/index.d.ts.map +1 -0
  661. package/dist/esm/sdk/index.js +5 -0
  662. package/dist/esm/sdk/index.js.map +1 -0
  663. package/dist/esm/sdk/sdk.d.ts +13 -0
  664. package/dist/esm/sdk/sdk.d.ts.map +1 -0
  665. package/dist/esm/sdk/sdk.js +22 -0
  666. package/dist/esm/sdk/sdk.js.map +1 -0
  667. package/dist/esm/sdk/verification.d.ts +12 -0
  668. package/dist/esm/sdk/verification.d.ts.map +1 -0
  669. package/dist/esm/sdk/verification.js +18 -0
  670. package/dist/esm/sdk/verification.js.map +1 -0
  671. package/dist/esm/types/async.d.ts +23 -0
  672. package/dist/esm/types/async.d.ts.map +1 -0
  673. package/dist/esm/types/async.js +28 -0
  674. package/dist/esm/types/async.js.map +1 -0
  675. package/dist/esm/types/blobs.d.ts +4 -0
  676. package/dist/esm/types/blobs.d.ts.map +1 -0
  677. package/dist/esm/types/blobs.js +25 -0
  678. package/dist/esm/types/blobs.js.map +1 -0
  679. package/dist/esm/types/const-date-time.d.ts +3 -0
  680. package/dist/esm/types/const-date-time.d.ts.map +1 -0
  681. package/dist/esm/types/const-date-time.js +10 -0
  682. package/dist/esm/types/const-date-time.js.map +1 -0
  683. package/dist/esm/types/default-to-zero-value.d.ts +12 -0
  684. package/dist/esm/types/default-to-zero-value.d.ts.map +1 -0
  685. package/dist/esm/types/default-to-zero-value.js +31 -0
  686. package/dist/esm/types/default-to-zero-value.js.map +1 -0
  687. package/dist/esm/types/enums.d.ts +9 -0
  688. package/dist/esm/types/enums.d.ts.map +1 -0
  689. package/dist/esm/types/enums.js +27 -0
  690. package/dist/esm/types/enums.js.map +1 -0
  691. package/dist/esm/types/fp.d.ts +31 -0
  692. package/dist/esm/types/fp.d.ts.map +1 -0
  693. package/dist/esm/types/fp.js +31 -0
  694. package/dist/esm/types/fp.js.map +1 -0
  695. package/dist/esm/types/index.d.ts +10 -0
  696. package/dist/esm/types/index.d.ts.map +1 -0
  697. package/dist/esm/types/index.js +10 -0
  698. package/dist/esm/types/index.js.map +1 -0
  699. package/dist/esm/types/operations.d.ts +27 -0
  700. package/dist/esm/types/operations.d.ts.map +1 -0
  701. package/dist/esm/types/operations.js +77 -0
  702. package/dist/esm/types/operations.js.map +1 -0
  703. package/dist/esm/types/primitives.d.ts +9 -0
  704. package/dist/esm/types/primitives.d.ts.map +1 -0
  705. package/dist/esm/types/primitives.js +105 -0
  706. package/dist/esm/types/primitives.js.map +1 -0
  707. package/dist/esm/types/rfcdate.d.ts +21 -0
  708. package/dist/esm/types/rfcdate.d.ts.map +1 -0
  709. package/dist/esm/types/rfcdate.js +43 -0
  710. package/dist/esm/types/rfcdate.js.map +1 -0
  711. package/dist/esm/types/smart-union.d.ts +7 -0
  712. package/dist/esm/types/smart-union.d.ts.map +1 -0
  713. package/dist/esm/types/smart-union.js +116 -0
  714. package/dist/esm/types/smart-union.js.map +1 -0
  715. package/dist/esm/types/streams.d.ts +2 -0
  716. package/dist/esm/types/streams.d.ts.map +1 -0
  717. package/dist/esm/types/streams.js +15 -0
  718. package/dist/esm/types/streams.js.map +1 -0
  719. package/dist/esm/types/unrecognized.d.ts +16 -0
  720. package/dist/esm/types/unrecognized.d.ts.map +1 -0
  721. package/dist/esm/types/unrecognized.js +31 -0
  722. package/dist/esm/types/unrecognized.js.map +1 -0
  723. package/examples/censusCreateSession.example.ts +26 -0
  724. package/jsr.json +27 -0
  725. package/package.json +124 -132
  726. package/src/core.ts +13 -0
  727. package/src/funcs/actions-cancel-action.ts +174 -0
  728. package/src/funcs/actions-check-action-status.ts +179 -0
  729. package/src/funcs/actions-propose-action.ts +174 -0
  730. package/src/funcs/census-create-session.ts +184 -0
  731. package/src/funcs/census-create-verification-link.ts +185 -0
  732. package/src/funcs/census-get-partner-config.ts +196 -0
  733. package/src/funcs/census-logout.ts +181 -0
  734. package/src/funcs/census-revoke-verification.ts +185 -0
  735. package/src/funcs/census-store-signal.ts +169 -0
  736. package/src/funcs/census-validate-signal.ts +169 -0
  737. package/src/funcs/census-verify-token.ts +191 -0
  738. package/src/funcs/verification-get-status.ts +196 -0
  739. package/src/hooks/hooks.ts +129 -0
  740. package/src/hooks/index.ts +6 -0
  741. package/src/hooks/types.ts +108 -0
  742. package/src/index.ts +8 -21
  743. package/src/lib/base64.ts +37 -0
  744. package/src/lib/config.ts +75 -0
  745. package/src/lib/encodings.ts +564 -0
  746. package/src/lib/files.ts +104 -0
  747. package/src/lib/http.ts +325 -0
  748. package/src/lib/logger.ts +9 -0
  749. package/src/lib/matchers.ts +353 -0
  750. package/src/lib/primitives.ts +166 -0
  751. package/src/lib/retries.ts +226 -0
  752. package/src/lib/schemas.ts +91 -0
  753. package/src/lib/sdks.ts +438 -0
  754. package/src/lib/security.ts +286 -0
  755. package/src/lib/url.ts +35 -0
  756. package/src/mcp-server/cli/start/command.ts +109 -0
  757. package/src/mcp-server/cli/start/impl.ts +141 -0
  758. package/src/mcp-server/cli.ts +13 -0
  759. package/src/mcp-server/console-logger.ts +71 -0
  760. package/src/mcp-server/extensions.ts +17 -0
  761. package/src/mcp-server/mcp-server.ts +26 -0
  762. package/src/mcp-server/prompts.ts +121 -0
  763. package/src/mcp-server/resources.ts +176 -0
  764. package/src/mcp-server/scopes.ts +9 -0
  765. package/src/mcp-server/server.ts +65 -0
  766. package/src/mcp-server/shared.ts +74 -0
  767. package/src/mcp-server/tools/actions-cancel-action.ts +37 -0
  768. package/src/mcp-server/tools/actions-check-action-status.ts +37 -0
  769. package/src/mcp-server/tools/actions-propose-action.ts +37 -0
  770. package/src/mcp-server/tools.ts +133 -0
  771. package/src/models/error-body.ts +138 -0
  772. package/src/models/error-response.ts +56 -0
  773. package/src/models/errors/bot-shield-default-error.ts +40 -0
  774. package/src/models/errors/bot-shield-error.ts +35 -0
  775. package/src/models/errors/error-response.ts +72 -0
  776. package/src/models/errors/http-client-errors.ts +62 -0
  777. package/src/models/errors/index.ts +11 -0
  778. package/src/models/errors/invalid-input-error.ts +82 -0
  779. package/src/models/errors/response-validation-error.ts +50 -0
  780. package/src/models/errors/sdk-validation-error.ts +109 -0
  781. package/src/models/index.ts +8 -0
  782. package/src/models/invalid-input-error.ts +63 -0
  783. package/src/models/operations/actions-cancel.ts +271 -0
  784. package/src/models/operations/actions-check-status.ts +308 -0
  785. package/src/models/operations/actions-propose.ts +439 -0
  786. package/src/models/operations/index.ts +16 -0
  787. package/src/models/operations/sdk-create-session.ts +388 -0
  788. package/src/models/operations/sdk-create-verification-link.ts +550 -0
  789. package/src/models/operations/sdk-get-partner-config.ts +345 -0
  790. package/src/models/operations/sdk-logout.ts +230 -0
  791. package/src/models/operations/sdk-revoke-verification.ts +299 -0
  792. package/src/models/operations/sdk-store-signal.ts +261 -0
  793. package/src/models/operations/sdk-validate-signal.ts +274 -0
  794. package/src/models/operations/sdk-verify-token.ts +343 -0
  795. package/src/models/operations/verification-get-status.ts +430 -0
  796. package/src/models/security.ts +52 -0
  797. package/src/sdk/actions.ts +63 -0
  798. package/src/sdk/census.ts +162 -0
  799. package/src/sdk/index.ts +5 -0
  800. package/src/sdk/sdk.ts +25 -0
  801. package/src/sdk/verification.ts +29 -0
  802. package/src/types/async.ts +69 -0
  803. package/src/types/blobs.ts +32 -0
  804. package/src/types/const-date-time.ts +15 -0
  805. package/src/types/default-to-zero-value.ts +33 -0
  806. package/src/types/enums.ts +45 -0
  807. package/src/types/fp.ts +50 -0
  808. package/src/types/index.ts +13 -0
  809. package/src/types/operations.ts +105 -0
  810. package/src/types/primitives.ts +122 -0
  811. package/src/types/rfcdate.ts +54 -0
  812. package/src/types/smart-union.ts +153 -0
  813. package/src/types/streams.ts +21 -0
  814. package/src/types/unrecognized.ts +35 -0
  815. package/CHANGELOG.md +0 -270
  816. package/LICENSE +0 -201
  817. package/api-promise.d.mts +0 -3
  818. package/api-promise.d.mts.map +0 -1
  819. package/api-promise.d.ts +0 -3
  820. package/api-promise.d.ts.map +0 -1
  821. package/api-promise.js +0 -6
  822. package/api-promise.js.map +0 -1
  823. package/api-promise.mjs +0 -3
  824. package/api-promise.mjs.map +0 -1
  825. package/client.d.mts +0 -218
  826. package/client.d.mts.map +0 -1
  827. package/client.d.ts +0 -218
  828. package/client.d.ts.map +0 -1
  829. package/client.js +0 -534
  830. package/client.js.map +0 -1
  831. package/client.mjs +0 -530
  832. package/client.mjs.map +0 -1
  833. package/core/api-promise.d.mts +0 -46
  834. package/core/api-promise.d.mts.map +0 -1
  835. package/core/api-promise.d.ts +0 -46
  836. package/core/api-promise.d.ts.map +0 -1
  837. package/core/api-promise.js +0 -74
  838. package/core/api-promise.js.map +0 -1
  839. package/core/api-promise.mjs +0 -70
  840. package/core/api-promise.mjs.map +0 -1
  841. package/core/error.d.mts +0 -46
  842. package/core/error.d.mts.map +0 -1
  843. package/core/error.d.ts +0 -46
  844. package/core/error.d.ts.map +0 -1
  845. package/core/error.js +0 -113
  846. package/core/error.js.map +0 -1
  847. package/core/error.mjs +0 -97
  848. package/core/error.mjs.map +0 -1
  849. package/core/resource.d.mts +0 -6
  850. package/core/resource.d.mts.map +0 -1
  851. package/core/resource.d.ts +0 -6
  852. package/core/resource.d.ts.map +0 -1
  853. package/core/resource.js +0 -11
  854. package/core/resource.js.map +0 -1
  855. package/core/resource.mjs +0 -7
  856. package/core/resource.mjs.map +0 -1
  857. package/core/uploads.d.mts +0 -3
  858. package/core/uploads.d.mts.map +0 -1
  859. package/core/uploads.d.ts +0 -3
  860. package/core/uploads.d.ts.map +0 -1
  861. package/core/uploads.js +0 -6
  862. package/core/uploads.js.map +0 -1
  863. package/core/uploads.mjs +0 -2
  864. package/core/uploads.mjs.map +0 -1
  865. package/error.d.mts +0 -3
  866. package/error.d.mts.map +0 -1
  867. package/error.d.ts +0 -3
  868. package/error.d.ts.map +0 -1
  869. package/error.js +0 -6
  870. package/error.js.map +0 -1
  871. package/error.mjs +0 -3
  872. package/error.mjs.map +0 -1
  873. package/index.d.mts +0 -6
  874. package/index.d.mts.map +0 -1
  875. package/index.d.ts +0 -6
  876. package/index.d.ts.map +0 -1
  877. package/index.js +0 -30
  878. package/index.js.map +0 -1
  879. package/index.mjs +0 -7
  880. package/index.mjs.map +0 -1
  881. package/internal/builtin-types.d.mts +0 -73
  882. package/internal/builtin-types.d.mts.map +0 -1
  883. package/internal/builtin-types.d.ts +0 -73
  884. package/internal/builtin-types.d.ts.map +0 -1
  885. package/internal/builtin-types.js +0 -4
  886. package/internal/builtin-types.js.map +0 -1
  887. package/internal/builtin-types.mjs +0 -3
  888. package/internal/builtin-types.mjs.map +0 -1
  889. package/internal/detect-platform.d.mts +0 -15
  890. package/internal/detect-platform.d.mts.map +0 -1
  891. package/internal/detect-platform.d.ts +0 -15
  892. package/internal/detect-platform.d.ts.map +0 -1
  893. package/internal/detect-platform.js +0 -162
  894. package/internal/detect-platform.js.map +0 -1
  895. package/internal/detect-platform.mjs +0 -157
  896. package/internal/detect-platform.mjs.map +0 -1
  897. package/internal/errors.d.mts +0 -3
  898. package/internal/errors.d.mts.map +0 -1
  899. package/internal/errors.d.ts +0 -3
  900. package/internal/errors.d.ts.map +0 -1
  901. package/internal/errors.js +0 -41
  902. package/internal/errors.js.map +0 -1
  903. package/internal/errors.mjs +0 -36
  904. package/internal/errors.mjs.map +0 -1
  905. package/internal/headers.d.mts +0 -20
  906. package/internal/headers.d.mts.map +0 -1
  907. package/internal/headers.d.ts +0 -20
  908. package/internal/headers.d.ts.map +0 -1
  909. package/internal/headers.js +0 -79
  910. package/internal/headers.js.map +0 -1
  911. package/internal/headers.mjs +0 -74
  912. package/internal/headers.mjs.map +0 -1
  913. package/internal/parse.d.mts +0 -12
  914. package/internal/parse.d.mts.map +0 -1
  915. package/internal/parse.d.ts +0 -12
  916. package/internal/parse.d.ts.map +0 -1
  917. package/internal/parse.js +0 -40
  918. package/internal/parse.js.map +0 -1
  919. package/internal/parse.mjs +0 -37
  920. package/internal/parse.mjs.map +0 -1
  921. package/internal/request-options.d.mts +0 -75
  922. package/internal/request-options.d.mts.map +0 -1
  923. package/internal/request-options.d.ts +0 -75
  924. package/internal/request-options.d.ts.map +0 -1
  925. package/internal/request-options.js +0 -14
  926. package/internal/request-options.js.map +0 -1
  927. package/internal/request-options.mjs +0 -10
  928. package/internal/request-options.mjs.map +0 -1
  929. package/internal/shim-types.d.mts +0 -17
  930. package/internal/shim-types.d.mts.map +0 -1
  931. package/internal/shim-types.d.ts +0 -17
  932. package/internal/shim-types.d.ts.map +0 -1
  933. package/internal/shim-types.js +0 -4
  934. package/internal/shim-types.js.map +0 -1
  935. package/internal/shim-types.mjs +0 -3
  936. package/internal/shim-types.mjs.map +0 -1
  937. package/internal/shims.d.mts +0 -26
  938. package/internal/shims.d.mts.map +0 -1
  939. package/internal/shims.d.ts +0 -26
  940. package/internal/shims.d.ts.map +0 -1
  941. package/internal/shims.js +0 -92
  942. package/internal/shims.js.map +0 -1
  943. package/internal/shims.mjs +0 -85
  944. package/internal/shims.mjs.map +0 -1
  945. package/internal/to-file.d.mts +0 -45
  946. package/internal/to-file.d.mts.map +0 -1
  947. package/internal/to-file.d.ts +0 -45
  948. package/internal/to-file.d.ts.map +0 -1
  949. package/internal/to-file.js +0 -91
  950. package/internal/to-file.js.map +0 -1
  951. package/internal/to-file.mjs +0 -88
  952. package/internal/to-file.mjs.map +0 -1
  953. package/internal/tslib.js +0 -81
  954. package/internal/tslib.mjs +0 -17
  955. package/internal/types.d.mts +0 -69
  956. package/internal/types.d.mts.map +0 -1
  957. package/internal/types.d.ts +0 -69
  958. package/internal/types.d.ts.map +0 -1
  959. package/internal/types.js +0 -4
  960. package/internal/types.js.map +0 -1
  961. package/internal/types.mjs +0 -3
  962. package/internal/types.mjs.map +0 -1
  963. package/internal/uploads.d.mts +0 -42
  964. package/internal/uploads.d.mts.map +0 -1
  965. package/internal/uploads.d.ts +0 -42
  966. package/internal/uploads.d.ts.map +0 -1
  967. package/internal/uploads.js +0 -141
  968. package/internal/uploads.js.map +0 -1
  969. package/internal/uploads.mjs +0 -131
  970. package/internal/uploads.mjs.map +0 -1
  971. package/internal/utils/base64.d.mts +0 -3
  972. package/internal/utils/base64.d.mts.map +0 -1
  973. package/internal/utils/base64.d.ts +0 -3
  974. package/internal/utils/base64.d.ts.map +0 -1
  975. package/internal/utils/base64.js +0 -38
  976. package/internal/utils/base64.js.map +0 -1
  977. package/internal/utils/base64.mjs +0 -33
  978. package/internal/utils/base64.mjs.map +0 -1
  979. package/internal/utils/bytes.d.mts +0 -4
  980. package/internal/utils/bytes.d.mts.map +0 -1
  981. package/internal/utils/bytes.d.ts +0 -4
  982. package/internal/utils/bytes.d.ts.map +0 -1
  983. package/internal/utils/bytes.js +0 -31
  984. package/internal/utils/bytes.js.map +0 -1
  985. package/internal/utils/bytes.mjs +0 -26
  986. package/internal/utils/bytes.mjs.map +0 -1
  987. package/internal/utils/env.d.mts +0 -9
  988. package/internal/utils/env.d.mts.map +0 -1
  989. package/internal/utils/env.d.ts +0 -9
  990. package/internal/utils/env.d.ts.map +0 -1
  991. package/internal/utils/env.js +0 -22
  992. package/internal/utils/env.js.map +0 -1
  993. package/internal/utils/env.mjs +0 -18
  994. package/internal/utils/env.mjs.map +0 -1
  995. package/internal/utils/log.d.mts +0 -37
  996. package/internal/utils/log.d.mts.map +0 -1
  997. package/internal/utils/log.d.ts +0 -37
  998. package/internal/utils/log.d.ts.map +0 -1
  999. package/internal/utils/log.js +0 -87
  1000. package/internal/utils/log.js.map +0 -1
  1001. package/internal/utils/log.mjs +0 -81
  1002. package/internal/utils/log.mjs.map +0 -1
  1003. package/internal/utils/path.d.mts +0 -15
  1004. package/internal/utils/path.d.mts.map +0 -1
  1005. package/internal/utils/path.d.ts +0 -15
  1006. package/internal/utils/path.d.ts.map +0 -1
  1007. package/internal/utils/path.js +0 -79
  1008. package/internal/utils/path.js.map +0 -1
  1009. package/internal/utils/path.mjs +0 -74
  1010. package/internal/utils/path.mjs.map +0 -1
  1011. package/internal/utils/query.d.mts +0 -5
  1012. package/internal/utils/query.d.mts.map +0 -1
  1013. package/internal/utils/query.d.ts +0 -5
  1014. package/internal/utils/query.d.ts.map +0 -1
  1015. package/internal/utils/query.js +0 -23
  1016. package/internal/utils/query.js.map +0 -1
  1017. package/internal/utils/query.mjs +0 -20
  1018. package/internal/utils/query.mjs.map +0 -1
  1019. package/internal/utils/sleep.d.mts +0 -2
  1020. package/internal/utils/sleep.d.mts.map +0 -1
  1021. package/internal/utils/sleep.d.ts +0 -2
  1022. package/internal/utils/sleep.d.ts.map +0 -1
  1023. package/internal/utils/sleep.js +0 -7
  1024. package/internal/utils/sleep.js.map +0 -1
  1025. package/internal/utils/sleep.mjs +0 -3
  1026. package/internal/utils/sleep.mjs.map +0 -1
  1027. package/internal/utils/uuid.d.mts +0 -5
  1028. package/internal/utils/uuid.d.mts.map +0 -1
  1029. package/internal/utils/uuid.d.ts +0 -5
  1030. package/internal/utils/uuid.d.ts.map +0 -1
  1031. package/internal/utils/uuid.js +0 -19
  1032. package/internal/utils/uuid.js.map +0 -1
  1033. package/internal/utils/uuid.mjs +0 -15
  1034. package/internal/utils/uuid.mjs.map +0 -1
  1035. package/internal/utils/values.d.mts +0 -18
  1036. package/internal/utils/values.d.mts.map +0 -1
  1037. package/internal/utils/values.d.ts +0 -18
  1038. package/internal/utils/values.d.ts.map +0 -1
  1039. package/internal/utils/values.js +0 -112
  1040. package/internal/utils/values.js.map +0 -1
  1041. package/internal/utils/values.mjs +0 -94
  1042. package/internal/utils/values.mjs.map +0 -1
  1043. package/internal/utils.d.mts +0 -8
  1044. package/internal/utils.d.mts.map +0 -1
  1045. package/internal/utils.d.ts +0 -8
  1046. package/internal/utils.d.ts.map +0 -1
  1047. package/internal/utils.js +0 -12
  1048. package/internal/utils.js.map +0 -1
  1049. package/internal/utils.mjs +0 -9
  1050. package/internal/utils.mjs.map +0 -1
  1051. package/resource.d.mts +0 -3
  1052. package/resource.d.mts.map +0 -1
  1053. package/resource.d.ts +0 -3
  1054. package/resource.d.ts.map +0 -1
  1055. package/resource.js +0 -6
  1056. package/resource.js.map +0 -1
  1057. package/resource.mjs +0 -3
  1058. package/resource.mjs.map +0 -1
  1059. package/resources/actions.d.mts +0 -133
  1060. package/resources/actions.d.mts.map +0 -1
  1061. package/resources/actions.d.ts +0 -133
  1062. package/resources/actions.d.ts.map +0 -1
  1063. package/resources/actions.js +0 -36
  1064. package/resources/actions.js.map +0 -1
  1065. package/resources/actions.mjs +0 -32
  1066. package/resources/actions.mjs.map +0 -1
  1067. package/resources/index.d.mts +0 -4
  1068. package/resources/index.d.mts.map +0 -1
  1069. package/resources/index.d.ts +0 -4
  1070. package/resources/index.d.ts.map +0 -1
  1071. package/resources/index.js +0 -11
  1072. package/resources/index.js.map +0 -1
  1073. package/resources/index.mjs +0 -5
  1074. package/resources/index.mjs.map +0 -1
  1075. package/resources/sdk.d.mts +0 -261
  1076. package/resources/sdk.d.mts.map +0 -1
  1077. package/resources/sdk.d.ts +0 -261
  1078. package/resources/sdk.d.ts.map +0 -1
  1079. package/resources/sdk.js +0 -69
  1080. package/resources/sdk.js.map +0 -1
  1081. package/resources/sdk.mjs +0 -65
  1082. package/resources/sdk.mjs.map +0 -1
  1083. package/resources/verification.d.mts +0 -64
  1084. package/resources/verification.d.mts.map +0 -1
  1085. package/resources/verification.d.ts +0 -64
  1086. package/resources/verification.d.ts.map +0 -1
  1087. package/resources/verification.js +0 -25
  1088. package/resources/verification.js.map +0 -1
  1089. package/resources/verification.mjs +0 -21
  1090. package/resources/verification.mjs.map +0 -1
  1091. package/resources.d.mts +0 -2
  1092. package/resources.d.mts.map +0 -1
  1093. package/resources.d.ts +0 -2
  1094. package/resources.d.ts.map +0 -1
  1095. package/resources.js +0 -5
  1096. package/resources.js.map +0 -1
  1097. package/resources.mjs +0 -2
  1098. package/resources.mjs.map +0 -1
  1099. package/src/api-promise.ts +0 -2
  1100. package/src/client.ts +0 -892
  1101. package/src/core/README.md +0 -3
  1102. package/src/core/api-promise.ts +0 -92
  1103. package/src/core/error.ts +0 -130
  1104. package/src/core/resource.ts +0 -11
  1105. package/src/core/uploads.ts +0 -2
  1106. package/src/error.ts +0 -2
  1107. package/src/internal/README.md +0 -3
  1108. package/src/internal/builtin-types.ts +0 -93
  1109. package/src/internal/detect-platform.ts +0 -196
  1110. package/src/internal/errors.ts +0 -33
  1111. package/src/internal/headers.ts +0 -97
  1112. package/src/internal/parse.ts +0 -56
  1113. package/src/internal/request-options.ts +0 -91
  1114. package/src/internal/shim-types.ts +0 -26
  1115. package/src/internal/shims.ts +0 -107
  1116. package/src/internal/to-file.ts +0 -154
  1117. package/src/internal/types.ts +0 -93
  1118. package/src/internal/uploads.ts +0 -187
  1119. package/src/internal/utils/base64.ts +0 -40
  1120. package/src/internal/utils/bytes.ts +0 -32
  1121. package/src/internal/utils/env.ts +0 -18
  1122. package/src/internal/utils/log.ts +0 -128
  1123. package/src/internal/utils/path.ts +0 -88
  1124. package/src/internal/utils/query.ts +0 -23
  1125. package/src/internal/utils/sleep.ts +0 -3
  1126. package/src/internal/utils/uuid.ts +0 -17
  1127. package/src/internal/utils/values.ts +0 -105
  1128. package/src/internal/utils.ts +0 -9
  1129. package/src/lib/.keep +0 -4
  1130. package/src/resource.ts +0 -2
  1131. package/src/resources/actions.ts +0 -184
  1132. package/src/resources/index.ts +0 -37
  1133. package/src/resources/sdk.ts +0 -403
  1134. package/src/resources/verification.ts +0 -107
  1135. package/src/resources.ts +0 -1
  1136. package/src/tsconfig.json +0 -11
  1137. package/src/uploads.ts +0 -2
  1138. package/src/version.ts +0 -1
  1139. package/uploads.d.mts +0 -3
  1140. package/uploads.d.mts.map +0 -1
  1141. package/uploads.d.ts +0 -3
  1142. package/uploads.d.ts.map +0 -1
  1143. package/uploads.js +0 -6
  1144. package/uploads.js.map +0 -1
  1145. package/uploads.mjs +0 -3
  1146. package/uploads.mjs.map +0 -1
  1147. package/version.d.mts +0 -2
  1148. package/version.d.mts.map +0 -1
  1149. package/version.d.ts +0 -2
  1150. package/version.d.ts.map +0 -1
  1151. package/version.js +0 -5
  1152. package/version.js.map +0 -1
  1153. package/version.mjs +0 -2
  1154. package/version.mjs.map +0 -1
package/README.md CHANGED
@@ -1,410 +1,597 @@
1
- # Bot Shield TypeScript API Library
1
+ # botshield-sdk
2
2
 
3
- [![NPM version](<https://img.shields.io/npm/v/botshield-sdk.svg?label=npm%20(stable)>)](https://npmjs.org/package/botshield-sdk) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/botshield-sdk)
3
+ Developer-friendly & type-safe Typescript SDK specifically catered to leverage *botshield-sdk* API.
4
4
 
5
- This library provides convenient access to the Bot Shield REST API from server-side TypeScript or JavaScript.
5
+ [![Built by Speakeasy](https://img.shields.io/badge/Built_by-SPEAKEASY-374151?style=for-the-badge&labelColor=f3f4f6)](https://www.speakeasy.com/?utm_source=botshield-sdk&utm_campaign=typescript)
6
+ [![License: MIT](https://img.shields.io/badge/LICENSE_//_MIT-3b5bdb?style=for-the-badge&labelColor=eff6ff)](https://opensource.org/licenses/MIT)
6
7
 
7
- The REST API documentation can be found on [docs.botshield.ai](https://docs.botshield.ai). The full API of this library can be found in [api.md](api.md).
8
8
 
9
- It is generated with [Stainless](https://www.stainless.com/).
9
+ <br /><br />
10
+ > [!IMPORTANT]
10
11
 
11
- ## MCP Server
12
+ <!-- Start Summary [summary] -->
13
+ ## Summary
12
14
 
13
- Use the Bot Shield MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.
15
+ BotShield API: Human presence verification protocol.
14
16
 
15
- [![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=botshield-sdk-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImJvdHNoaWVsZC1zZGstbWNwIl0sImVudiI6eyJCT1RTSElFTERfQVBJX0tFWSI6Ik15IEFQSSBLZXkiLCJCT1RTSElFTERfQUdFTlRfS0VZIjoiTXkgQWdlbnQgS2V5In19)
16
- [![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22botshield-sdk-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22botshield-sdk-mcp%22%5D%2C%22env%22%3A%7B%22BOTSHIELD_API_KEY%22%3A%22My%20API%20Key%22%2C%22BOTSHIELD_AGENT_KEY%22%3A%22My%20Agent%20Key%22%7D%7D)
17
+ **BotShield Human Verification** — a BotShield Gate (checkout, sign-up, any action moment) asks whether a live human is present. The client pre-check returns the two-result-state contract `result_state: human_verified | unavailable`; when presence is required the person confirms with a device biometric in the BotShield app and the gate receives an ES256 attestation JWT, verifiable against the public JWKS at /.well-known/jwks.json. No identity crosses the boundary.
17
18
 
18
- > Note: You may need to set environment variables in your MCP client.
19
+ **Agents Ask** — an agent proposes an action; the human confirms in the BotShield app and BotShield signs a Proof of Resolution JWT.
19
20
 
20
- ## Installation
21
+ **Frontend:** load the BotShield client script from https://cdn.botshield.ai/sdk.js and place the botshield-verify element.
21
22
 
22
- ```sh
23
- npm install botshield-sdk
24
- ```
23
+ **Backend SDK:** install `botshield-sdk` from npm and use `client.census.*`, `client.verification.*`, `client.actions.*`.
25
24
 
26
- ## Usage
25
+ **Response envelope:** every operation answers HTTP 200 with `{ data: ... }`. Most carry the result one level deeper (`data.data`); `logout` and `verification/status` carry it directly. Handler errors are also HTTP 200 — `data.error = { message, statusCode }` — so check `data.error` before reading a result. HTTP 400 is reserved for input validation (`InvalidInputError`), 500 for unhandled failures.
26
+ <!-- End Summary [summary] -->
27
27
 
28
- The full API of this library can be found in [api.md](api.md).
28
+ <!-- Start Table of Contents [toc] -->
29
+ ## Table of Contents
30
+ <!-- $toc-max-depth=2 -->
31
+ * [botshield-sdk](#botshield-sdk)
32
+ * [SDK Installation](#sdk-installation)
33
+ * [Requirements](#requirements)
34
+ * [SDK Example Usage](#sdk-example-usage)
35
+ * [Authentication](#authentication)
36
+ * [Available Resources and Operations](#available-resources-and-operations)
37
+ * [Standalone functions](#standalone-functions)
38
+ * [Retries](#retries)
39
+ * [Error Handling](#error-handling)
40
+ * [Server Selection](#server-selection)
41
+ * [Custom HTTP Client](#custom-http-client)
42
+ * [Debugging](#debugging)
43
+ * [Development](#development)
44
+ * [Maturity](#maturity)
45
+ * [Contributions](#contributions)
29
46
 
30
- <!-- prettier-ignore -->
31
- ```js
32
- import BotShield from 'botshield-sdk';
47
+ <!-- End Table of Contents [toc] -->
33
48
 
34
- const client = new BotShield({
35
- apiKey: process.env['BOTSHIELD_API_KEY'], // This is the default and can be omitted
36
- environment: 'development', // defaults to 'production'
37
- });
49
+ <!-- Start SDK Installation [installation] -->
50
+ ## SDK Installation
38
51
 
39
- const response = await client.sdk.createVerificationLink({
40
- return_url: 'https://yourapp.com/verified',
41
- user_email: 'user@example.com',
42
- });
52
+ The SDK can be installed with either [npm](https://www.npmjs.com/), [pnpm](https://pnpm.io/), [bun](https://bun.sh/) or [yarn](https://classic.yarnpkg.com/en/) package managers.
43
53
 
44
- console.log(response.data);
45
- ```
54
+ ### NPM
46
55
 
47
- ### Request & Response types
56
+ ```bash
57
+ npm add botshield-sdk
58
+ ```
48
59
 
49
- This library includes TypeScript definitions for all request params and response fields. You may import and use them like so:
60
+ ### PNPM
50
61
 
51
- <!-- prettier-ignore -->
52
- ```ts
53
- import BotShield from 'botshield-sdk';
62
+ ```bash
63
+ pnpm add botshield-sdk
64
+ ```
54
65
 
55
- const client = new BotShield({
56
- apiKey: process.env['BOTSHIELD_API_KEY'], // This is the default and can be omitted
57
- environment: 'development', // defaults to 'production'
58
- });
66
+ ### Bun
59
67
 
60
- const params: BotShield.SDKCreateVerificationLinkParams = {
61
- metadata: { cart_id: 'cart_123', action: 'checkout' },
62
- mode: 'linked-account',
63
- return_url: 'https://yourapp.com/verified',
64
- user_email: 'user@example.com',
65
- };
66
- const response: BotShield.SDKCreateVerificationLinkResponse =
67
- await client.sdk.createVerificationLink(params);
68
+ ```bash
69
+ bun add botshield-sdk
68
70
  ```
69
71
 
70
- Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
71
-
72
- ## Handling errors
73
-
74
- When the library is unable to connect to the API,
75
- or if the API returns a non-success status code (i.e., 4xx or 5xx response),
76
- a subclass of `APIError` will be thrown:
77
-
78
- <!-- prettier-ignore -->
79
- ```ts
80
- const response = await client.sdk
81
- .createVerificationLink({
82
- metadata: { cart_id: 'cart_123', action: 'checkout' },
83
- mode: 'linked-account',
84
- return_url: 'https://yourapp.com/verified',
85
- user_email: 'user@example.com',
86
- })
87
- .catch(async (err) => {
88
- if (err instanceof BotShield.APIError) {
89
- console.log(err.status); // 400
90
- console.log(err.name); // BadRequestError
91
- console.log(err.headers); // {server: 'nginx', ...}
92
- } else {
93
- throw err;
94
- }
95
- });
72
+ ### Yarn
73
+
74
+ ```bash
75
+ yarn add botshield-sdk
96
76
  ```
97
77
 
98
- Error codes are as follows:
78
+ > [!NOTE]
79
+ > This package is published with CommonJS and ES Modules (ESM) support.
99
80
 
100
- | Status Code | Error Type |
101
- | ----------- | -------------------------- |
102
- | 400 | `BadRequestError` |
103
- | 401 | `AuthenticationError` |
104
- | 403 | `PermissionDeniedError` |
105
- | 404 | `NotFoundError` |
106
- | 422 | `UnprocessableEntityError` |
107
- | 429 | `RateLimitError` |
108
- | >=500 | `InternalServerError` |
109
- | N/A | `APIConnectionError` |
110
81
 
111
- ### Retries
82
+ ### Model Context Protocol (MCP) Server
112
83
 
113
- Certain errors will be automatically retried 2 times by default, with a short exponential backoff.
114
- Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,
115
- 429 Rate Limit, and >=500 Internal errors will all be retried by default.
84
+ This SDK is also an installable MCP server where the various SDK methods are
85
+ exposed as tools that can be invoked by AI applications.
116
86
 
117
- You can use the `maxRetries` option to configure or disable this:
87
+ > Node.js v20 or greater is required to run the MCP server from npm.
118
88
 
119
- <!-- prettier-ignore -->
120
- ```js
121
- // Configure the default for all requests:
122
- const client = new BotShield({
123
- maxRetries: 0, // default is 2
124
- });
89
+ <details>
90
+ <summary>Claude installation steps</summary>
125
91
 
126
- // Or, configure per-request:
127
- await client.sdk.createVerificationLink({
128
- metadata: { cart_id: 'cart_123', action: 'checkout' },
129
- mode: 'linked-account',
130
- return_url: 'https://yourapp.com/verified',
131
- user_email: 'user@example.com',
132
- }, {
133
- maxRetries: 5,
134
- });
92
+ Add the following server definition to your `claude_desktop_config.json` file:
93
+
94
+ ```json
95
+ {
96
+ "mcpServers": {
97
+ "BotShield": {
98
+ "command": "npx",
99
+ "args": [
100
+ "-y", "--package", "botshield-sdk",
101
+ "--",
102
+ "mcp", "start",
103
+ "--agent-key-auth", "...",
104
+ "--agent-key-auth1", "..."
105
+ ]
106
+ }
107
+ }
108
+ }
135
109
  ```
136
110
 
137
- ### Timeouts
111
+ </details>
112
+
113
+ <details>
114
+ <summary>Cursor installation steps</summary>
115
+
116
+ Create a `.cursor/mcp.json` file in your project root with the following content:
117
+
118
+ ```json
119
+ {
120
+ "mcpServers": {
121
+ "BotShield": {
122
+ "command": "npx",
123
+ "args": [
124
+ "-y", "--package", "botshield-sdk",
125
+ "--",
126
+ "mcp", "start",
127
+ "--agent-key-auth", "...",
128
+ "--agent-key-auth1", "..."
129
+ ]
130
+ }
131
+ }
132
+ }
133
+ ```
138
134
 
139
- Requests time out after 1 minute by default. You can configure this with a `timeout` option:
135
+ </details>
140
136
 
141
- <!-- prettier-ignore -->
142
- ```ts
143
- // Configure the default for all requests:
144
- const client = new BotShield({
145
- timeout: 20 * 1000, // 20 seconds (default is 1 minute)
146
- });
137
+ You can also run MCP servers as a standalone binary with no additional dependencies. You must pull these binaries from available Github releases:
147
138
 
148
- // Override per-request:
149
- await client.sdk.createVerificationLink({
150
- metadata: { cart_id: 'cart_123', action: 'checkout' },
151
- mode: 'linked-account',
152
- return_url: 'https://yourapp.com/verified',
153
- user_email: 'user@example.com',
154
- }, {
155
- timeout: 5 * 1000,
156
- });
139
+ ```bash
140
+ curl -L -o mcp-server \
141
+ https://github.com/{org}/{repo}/releases/download/{tag}/mcp-server-bun-darwin-arm64 && \
142
+ chmod +x mcp-server
143
+ ```
144
+
145
+ If the repo is a private repo you must add your Github PAT to download a release `-H "Authorization: Bearer {GITHUB_PAT}"`.
146
+
147
+
148
+ ```json
149
+ {
150
+ "mcpServers": {
151
+ "Todos": {
152
+ "command": "./DOWNLOAD/PATH/mcp-server",
153
+ "args": [
154
+ "start"
155
+ ]
156
+ }
157
+ }
158
+ }
157
159
  ```
158
160
 
159
- On timeout, an `APIConnectionTimeoutError` is thrown.
160
-
161
- Note that requests which time out will be [retried twice by default](#retries).
162
-
163
- ## Advanced Usage
164
-
165
- ### Accessing raw Response data (e.g., headers)
166
-
167
- The "raw" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.
168
- This method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.
169
-
170
- You can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.
171
- Unlike `.asResponse()` this method consumes the body, returning once it is parsed.
172
-
173
- <!-- prettier-ignore -->
174
- ```ts
175
- const client = new BotShield();
176
-
177
- const response = await client.sdk
178
- .createVerificationLink({
179
- metadata: { cart_id: 'cart_123', action: 'checkout' },
180
- mode: 'linked-account',
181
- return_url: 'https://yourapp.com/verified',
182
- user_email: 'user@example.com',
183
- })
184
- .asResponse();
185
- console.log(response.headers.get('X-My-Header'));
186
- console.log(response.statusText); // access the underlying Response object
187
-
188
- const { data: response, response: raw } = await client.sdk
189
- .createVerificationLink({
190
- metadata: { cart_id: 'cart_123', action: 'checkout' },
191
- mode: 'linked-account',
192
- return_url: 'https://yourapp.com/verified',
193
- user_email: 'user@example.com',
194
- })
195
- .withResponse();
196
- console.log(raw.headers.get('X-My-Header'));
197
- console.log(response.data);
161
+ For a full list of server arguments, run:
162
+
163
+ ```sh
164
+ npx -y --package botshield-sdk -- mcp start --help
198
165
  ```
166
+ <!-- End SDK Installation [installation] -->
199
167
 
200
- ### Logging
168
+ <!-- Start Requirements [requirements] -->
169
+ ## Requirements
201
170
 
202
- > [!IMPORTANT]
203
- > All log messages are intended for debugging only. The format and content of log messages
204
- > may change between releases.
171
+ For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
172
+ <!-- End Requirements [requirements] -->
205
173
 
206
- #### Log levels
174
+ <!-- Start SDK Example Usage [usage] -->
175
+ ## SDK Example Usage
207
176
 
208
- The log level can be configured in two ways:
177
+ ### Example
209
178
 
210
- 1. Via the `BOT_SHIELD_LOG` environment variable
211
- 2. Using the `logLevel` client option (overrides the environment variable if set)
179
+ ```typescript
180
+ import { BotShield } from "botshield-sdk";
212
181
 
213
- ```ts
214
- import BotShield from 'botshield-sdk';
182
+ const botShield = new BotShield();
215
183
 
216
- const client = new BotShield({
217
- logLevel: 'debug', // Show all log messages
218
- });
219
- ```
184
+ async function run() {
185
+ const result = await botShield.census.createSession({
186
+ apiKeyAuth: "<YOUR_API_KEY_HERE>",
187
+ }, {});
220
188
 
221
- Available log levels, from most to least verbose:
189
+ console.log(result);
190
+ }
222
191
 
223
- - `'debug'` - Show debug messages, info, warnings, and errors
224
- - `'info'` - Show info messages, warnings, and errors
225
- - `'warn'` - Show warnings and errors (default)
226
- - `'error'` - Show only errors
227
- - `'off'` - Disable all logging
192
+ run();
228
193
 
229
- At the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.
230
- Some authentication-related headers are redacted, but sensitive data in request and response bodies
231
- may still be visible.
194
+ ```
195
+ <!-- End SDK Example Usage [usage] -->
232
196
 
233
- #### Custom logger
197
+ <!-- Start Authentication [security] -->
198
+ ## Authentication
234
199
 
235
- By default, this library logs to `globalThis.console`. You can also provide a custom logger.
236
- Most logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.
200
+ ### Per-Client Security Schemes
237
201
 
238
- When providing a custom logger, the `logLevel` option still controls which messages are emitted, messages
239
- below the configured level will not be sent to your logger.
202
+ This SDK supports the following security schemes globally:
240
203
 
241
- ```ts
242
- import BotShield from 'botshield-sdk';
243
- import pino from 'pino';
204
+ | Name | Type | Scheme |
205
+ | --------------- | ------ | ------- |
206
+ | `agentKeyAuth` | apiKey | API key |
207
+ | `agentKeyAuth1` | apiKey | API key |
244
208
 
245
- const logger = pino();
209
+ You can set the security parameters through the `security` optional parameter when initializing the SDK client instance. The selected scheme will be used by default to authenticate with the API for all operations that support it. For example:
210
+ ```typescript
211
+ import { BotShield } from "botshield-sdk";
246
212
 
247
- const client = new BotShield({
248
- logger: logger.child({ name: 'BotShield' }),
249
- logLevel: 'debug', // Send all messages to pino, allowing it to filter
213
+ const botShield = new BotShield({
214
+ security: {
215
+ agentKeyAuth: "<YOUR_API_KEY_HERE>",
216
+ },
250
217
  });
218
+
219
+ async function run() {
220
+ const result = await botShield.census.storeSignal({
221
+ siteKey: "<value>",
222
+ score: 229498,
223
+ });
224
+
225
+ console.log(result);
226
+ }
227
+
228
+ run();
229
+
251
230
  ```
252
231
 
253
- ### Making custom/undocumented requests
232
+ ### Per-Operation Security Schemes
254
233
 
255
- This library is typed for convenient access to the documented API. If you need to access undocumented
256
- endpoints, params, or response properties, the library can still be used.
234
+ Some operations in this SDK require the security scheme to be specified at the request level. For example:
235
+ ```typescript
236
+ import { BotShield } from "botshield-sdk";
257
237
 
258
- #### Undocumented endpoints
238
+ const botShield = new BotShield();
259
239
 
260
- To make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs.
261
- Options on the client, such as retries, will be respected when making these requests.
240
+ async function run() {
241
+ const result = await botShield.census.createSession({
242
+ apiKeyAuth: "<YOUR_API_KEY_HERE>",
243
+ }, {});
244
+
245
+ console.log(result);
246
+ }
247
+
248
+ run();
262
249
 
263
- ```ts
264
- await client.post('/some/path', {
265
- body: { some_prop: 'foo' },
266
- query: { some_query_arg: 'bar' },
267
- });
268
250
  ```
251
+ <!-- End Authentication [security] -->
269
252
 
270
- #### Undocumented request params
253
+ <!-- Start Available Resources and Operations [operations] -->
254
+ ## Available Resources and Operations
271
255
 
272
- To make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented
273
- parameter. This library doesn't validate at runtime that the request matches the type, so any extra values you
274
- send will be sent as-is.
256
+ <details open>
257
+ <summary>Available methods</summary>
275
258
 
276
- ```ts
277
- client.sdk.createVerificationLink({
278
- // ...
279
- // @ts-expect-error baz is not yet public
280
- baz: 'undocumented option',
281
- });
282
- ```
259
+ ### [Actions](docs/sdks/actions/README.md)
283
260
 
284
- For requests with the `GET` verb, any extra params will be in the query, all other requests will send the
285
- extra param in the body.
261
+ * [proposeAction](docs/sdks/actions/README.md#proposeaction) - Propose an action for human confirmation
262
+ * [checkActionStatus](docs/sdks/actions/README.md#checkactionstatus) - Check action proposal status
263
+ * [cancelAction](docs/sdks/actions/README.md#cancelaction) - Cancel a queued action proposal
286
264
 
287
- If you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request
288
- options.
265
+ ### [Census](docs/sdks/census/README.md)
289
266
 
290
- #### Undocumented response properties
267
+ * [createSession](docs/sdks/census/README.md#createsession) - Create a grant token
268
+ * [createVerificationLink](docs/sdks/census/README.md#createverificationlink) - Create a verification request
269
+ * [verifyToken](docs/sdks/census/README.md#verifytoken) - Validate a verification token
270
+ * [storeSignal](docs/sdks/census/README.md#storesignal) - Store a Signal Pixel bot score
271
+ * [validateSignal](docs/sdks/census/README.md#validatesignal) - Validate a signal token
272
+ * [getPartnerConfig](docs/sdks/census/README.md#getpartnerconfig) - Get partner configuration
273
+ * [revokeVerification](docs/sdks/census/README.md#revokeverification) - Revoke a pending verification
274
+ * [logout](docs/sdks/census/README.md#logout) - Revoke a grant token
291
275
 
292
- To access undocumented response properties, you may access the response object with `// @ts-expect-error` on
293
- the response object, or cast the response object to the requisite type. Like the request params, we do not
294
- validate or strip extra properties from the response from the API.
276
+ ### [Verification](docs/sdks/verification/README.md)
295
277
 
296
- ### Customizing the fetch client
278
+ * [getStatus](docs/sdks/verification/README.md#getstatus) - Check verification status
297
279
 
298
- By default, this library expects a global `fetch` function is defined.
280
+ </details>
281
+ <!-- End Available Resources and Operations [operations] -->
299
282
 
300
- If you want to use a different `fetch` function, you can either polyfill the global:
283
+ <!-- Start Standalone functions [standalone-funcs] -->
284
+ ## Standalone functions
301
285
 
302
- ```ts
303
- import fetch from 'my-fetch';
286
+ All the methods listed above are available as standalone functions. These
287
+ functions are ideal for use in applications running in the browser, serverless
288
+ runtimes or other environments where application bundle size is a primary
289
+ concern. When using a bundler to build your application, all unused
290
+ functionality will be either excluded from the final bundle or tree-shaken away.
304
291
 
305
- globalThis.fetch = fetch;
306
- ```
292
+ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
307
293
 
308
- Or pass it to the client:
294
+ <details>
309
295
 
310
- ```ts
311
- import BotShield from 'botshield-sdk';
312
- import fetch from 'my-fetch';
296
+ <summary>Available standalone functions</summary>
313
297
 
314
- const client = new BotShield({ fetch });
315
- ```
298
+ - [`actionsCancelAction`](docs/sdks/actions/README.md#cancelaction) - Cancel a queued action proposal
299
+ - [`actionsCheckActionStatus`](docs/sdks/actions/README.md#checkactionstatus) - Check action proposal status
300
+ - [`actionsProposeAction`](docs/sdks/actions/README.md#proposeaction) - Propose an action for human confirmation
301
+ - [`censusCreateSession`](docs/sdks/census/README.md#createsession) - Create a grant token
302
+ - [`censusCreateVerificationLink`](docs/sdks/census/README.md#createverificationlink) - Create a verification request
303
+ - [`censusGetPartnerConfig`](docs/sdks/census/README.md#getpartnerconfig) - Get partner configuration
304
+ - [`censusLogout`](docs/sdks/census/README.md#logout) - Revoke a grant token
305
+ - [`censusRevokeVerification`](docs/sdks/census/README.md#revokeverification) - Revoke a pending verification
306
+ - [`censusStoreSignal`](docs/sdks/census/README.md#storesignal) - Store a Signal Pixel bot score
307
+ - [`censusValidateSignal`](docs/sdks/census/README.md#validatesignal) - Validate a signal token
308
+ - [`censusVerifyToken`](docs/sdks/census/README.md#verifytoken) - Validate a verification token
309
+ - [`verificationGetStatus`](docs/sdks/verification/README.md#getstatus) - Check verification status
310
+
311
+ </details>
312
+ <!-- End Standalone functions [standalone-funcs] -->
313
+
314
+ <!-- Start Retries [retries] -->
315
+ ## Retries
316
+
317
+ Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
318
+
319
+ To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
320
+ ```typescript
321
+ import { BotShield } from "botshield-sdk";
322
+
323
+ const botShield = new BotShield();
316
324
 
317
- ### Fetch options
325
+ async function run() {
326
+ const result = await botShield.census.createSession(
327
+ {
328
+ apiKeyAuth: "<YOUR_API_KEY_HERE>",
329
+ },
330
+ {},
331
+ {
332
+ retries: {
333
+ strategy: "backoff",
334
+ backoff: {
335
+ initialInterval: 1,
336
+ maxInterval: 50,
337
+ exponent: 1.1,
338
+ maxElapsedTime: 100,
339
+ },
340
+ retryConnectionErrors: false,
341
+ },
342
+ },
343
+ );
318
344
 
319
- If you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)
345
+ console.log(result);
346
+ }
320
347
 
321
- ```ts
322
- import BotShield from 'botshield-sdk';
348
+ run();
323
349
 
324
- const client = new BotShield({
325
- fetchOptions: {
326
- // `RequestInit` options
350
+ ```
351
+
352
+ If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
353
+ ```typescript
354
+ import { BotShield } from "botshield-sdk";
355
+
356
+ const botShield = new BotShield({
357
+ retryConfig: {
358
+ strategy: "backoff",
359
+ backoff: {
360
+ initialInterval: 1,
361
+ maxInterval: 50,
362
+ exponent: 1.1,
363
+ maxElapsedTime: 100,
364
+ },
365
+ retryConnectionErrors: false,
327
366
  },
328
367
  });
368
+
369
+ async function run() {
370
+ const result = await botShield.census.createSession({
371
+ apiKeyAuth: "<YOUR_API_KEY_HERE>",
372
+ }, {});
373
+
374
+ console.log(result);
375
+ }
376
+
377
+ run();
378
+
379
+ ```
380
+ <!-- End Retries [retries] -->
381
+
382
+ <!-- Start Error Handling [errors] -->
383
+ ## Error Handling
384
+
385
+ [`BotShieldError`](./src/models/errors/bot-shield-error.ts) is the base class for all HTTP error responses. It has the following properties:
386
+
387
+ | Property | Type | Description |
388
+ | ------------------- | ---------- | --------------------------------------------------------------------------------------- |
389
+ | `error.message` | `string` | Error message |
390
+ | `error.statusCode` | `number` | HTTP response status code eg `404` |
391
+ | `error.headers` | `Headers` | HTTP response headers |
392
+ | `error.body` | `string` | HTTP body. Can be empty string if no body is returned. |
393
+ | `error.rawResponse` | `Response` | Raw HTTP response |
394
+ | `error.data$` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). |
395
+
396
+ ### Example
397
+ ```typescript
398
+ import { BotShield } from "botshield-sdk";
399
+ import * as errors from "botshield-sdk/models/errors";
400
+
401
+ const botShield = new BotShield();
402
+
403
+ async function run() {
404
+ try {
405
+ const result = await botShield.census.createSession({
406
+ apiKeyAuth: "<YOUR_API_KEY_HERE>",
407
+ }, {});
408
+
409
+ console.log(result);
410
+ } catch (error) {
411
+ // The base class for HTTP error responses
412
+ if (error instanceof errors.BotShieldError) {
413
+ console.log(error.message);
414
+ console.log(error.statusCode);
415
+ console.log(error.body);
416
+ console.log(error.headers);
417
+
418
+ // Depending on the method different errors may be thrown
419
+ if (error instanceof errors.InvalidInputError) {
420
+ console.log(error.data$.message); // string
421
+ console.log(error.data$.input); // { [k: string]: any }
422
+ console.log(error.data$.errors); // InvalidInputErrorError[]
423
+ }
424
+ }
425
+ }
426
+ }
427
+
428
+ run();
429
+
329
430
  ```
330
431
 
331
- #### Configuring proxies
432
+ ### Error Classes
433
+ **Primary errors:**
434
+ * [`BotShieldError`](./src/models/errors/bot-shield-error.ts): The base class for HTTP error responses.
435
+ * [`InvalidInputError`](./src/models/errors/invalid-input-error.ts): Invalid input. Status code `400`.
436
+ * [`ErrorResponse`](./src/models/errors/error-response.ts): Internal server error. Status code `500`.
332
437
 
333
- To modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy
334
- options to requests:
438
+ <details><summary>Less common errors (6)</summary>
335
439
 
336
- <img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg" align="top" width="18" height="21"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>
440
+ <br />
337
441
 
338
- ```ts
339
- import BotShield from 'botshield-sdk';
340
- import * as undici from 'undici';
442
+ **Network errors:**
443
+ * [`ConnectionError`](./src/models/errors/http-client-errors.ts): HTTP client was unable to make a request to a server.
444
+ * [`RequestTimeoutError`](./src/models/errors/http-client-errors.ts): HTTP request timed out due to an AbortSignal signal.
445
+ * [`RequestAbortedError`](./src/models/errors/http-client-errors.ts): HTTP request was aborted by the client.
446
+ * [`InvalidRequestError`](./src/models/errors/http-client-errors.ts): Any input used to create a request is invalid.
447
+ * [`UnexpectedClientError`](./src/models/errors/http-client-errors.ts): Unrecognised or unexpected error.
341
448
 
342
- const proxyAgent = new undici.ProxyAgent('http://localhost:8888');
343
- const client = new BotShield({
344
- fetchOptions: {
345
- dispatcher: proxyAgent,
346
- },
449
+
450
+ **Inherit from [`BotShieldError`](./src/models/errors/bot-shield-error.ts)**:
451
+ * [`ResponseValidationError`](./src/models/errors/response-validation-error.ts): Type mismatch between the data returned from the server and the structure expected by the SDK. See `error.rawValue` for the raw value and `error.pretty()` for a nicely formatted multi-line string.
452
+
453
+ </details>
454
+ <!-- End Error Handling [errors] -->
455
+
456
+ <!-- Start Server Selection [server] -->
457
+ ## Server Selection
458
+
459
+ ### Select Server by Index
460
+
461
+ You can override the default server globally by passing a server index to the `serverIdx: number` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:
462
+
463
+ | # | Server | Description |
464
+ | --- | ------------------------------------- | ----------------- |
465
+ | 0 | `http://localhost:9991/operations` | Local development |
466
+ | 1 | `https://api.botshield.ai/operations` | Production |
467
+
468
+ #### Example
469
+
470
+ ```typescript
471
+ import { BotShield } from "botshield-sdk";
472
+
473
+ const botShield = new BotShield({
474
+ serverIdx: 0,
347
475
  });
476
+
477
+ async function run() {
478
+ const result = await botShield.census.createSession({
479
+ apiKeyAuth: "<YOUR_API_KEY_HERE>",
480
+ }, {});
481
+
482
+ console.log(result);
483
+ }
484
+
485
+ run();
486
+
348
487
  ```
349
488
 
350
- <img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg" align="top" width="18" height="21"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>
489
+ ### Override Server URL Per-Client
351
490
 
352
- ```ts
353
- import BotShield from 'botshield-sdk';
491
+ The default server can also be overridden globally by passing a URL to the `serverURL: string` optional parameter when initializing the SDK client instance. For example:
492
+ ```typescript
493
+ import { BotShield } from "botshield-sdk";
354
494
 
355
- const client = new BotShield({
356
- fetchOptions: {
357
- proxy: 'http://localhost:8888',
358
- },
495
+ const botShield = new BotShield({
496
+ serverURL: "https://api.botshield.ai/operations",
359
497
  });
498
+
499
+ async function run() {
500
+ const result = await botShield.census.createSession({
501
+ apiKeyAuth: "<YOUR_API_KEY_HERE>",
502
+ }, {});
503
+
504
+ console.log(result);
505
+ }
506
+
507
+ run();
508
+
360
509
  ```
510
+ <!-- End Server Selection [server] -->
511
+
512
+ <!-- Start Custom HTTP Client [http-client] -->
513
+ ## Custom HTTP Client
514
+
515
+ The TypeScript SDK makes API calls using an `HTTPClient` that wraps the native
516
+ [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). This
517
+ client is a thin wrapper around `fetch` and provides the ability to attach hooks
518
+ around the request lifecycle that can be used to modify the request or handle
519
+ errors and response.
520
+
521
+ The `HTTPClient` constructor takes an optional `fetcher` argument that can be
522
+ used to integrate a third-party HTTP client or when writing tests to mock out
523
+ the HTTP client and feed in fixtures.
524
+
525
+ The following example shows how to:
526
+ - route requests through a proxy server using [undici](https://www.npmjs.com/package/undici)'s ProxyAgent
527
+ - use the `"beforeRequest"` hook to add a custom header and a timeout to requests
528
+ - use the `"requestError"` hook to log errors
529
+
530
+ ```typescript
531
+ import { BotShield } from "botshield-sdk";
532
+ import { ProxyAgent } from "undici";
533
+ import { HTTPClient } from "botshield-sdk/lib/http";
534
+
535
+ const dispatcher = new ProxyAgent("http://proxy.example.com:8080");
536
+
537
+ const httpClient = new HTTPClient({
538
+ // 'fetcher' takes a function that has the same signature as native 'fetch'.
539
+ fetcher: (input, init) =>
540
+ // 'dispatcher' is specific to undici and not part of the standard Fetch API.
541
+ fetch(input, { ...init, dispatcher } as RequestInit),
542
+ });
361
543
 
362
- <img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg" align="top" width="18" height="21"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>
544
+ httpClient.addHook("beforeRequest", (request) => {
545
+ const nextRequest = new Request(request, {
546
+ signal: request.signal || AbortSignal.timeout(5000)
547
+ });
363
548
 
364
- ```ts
365
- import BotShield from 'npm:botshield-sdk';
549
+ nextRequest.headers.set("x-custom-header", "custom value");
366
550
 
367
- const httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });
368
- const client = new BotShield({
369
- fetchOptions: {
370
- client: httpClient,
371
- },
551
+ return nextRequest;
372
552
  });
373
- ```
374
553
 
375
- ## Frequently Asked Questions
554
+ httpClient.addHook("requestError", (error, request) => {
555
+ console.group("Request Error");
556
+ console.log("Reason:", `${error}`);
557
+ console.log("Endpoint:", `${request.method} ${request.url}`);
558
+ console.groupEnd();
559
+ });
376
560
 
377
- ## Semantic versioning
561
+ const sdk = new BotShield({ httpClient: httpClient });
562
+ ```
563
+ <!-- End Custom HTTP Client [http-client] -->
378
564
 
379
- This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
565
+ <!-- Start Debugging [debug] -->
566
+ ## Debugging
380
567
 
381
- 1. Changes that only affect static types, without breaking runtime behavior.
382
- 2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_
383
- 3. Changes that we do not expect to impact the vast majority of users in practice.
568
+ You can setup your SDK to emit debug logs for SDK requests and responses.
384
569
 
385
- We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
570
+ You can pass a logger that matches `console`'s interface as an SDK option.
386
571
 
387
- We are keen for your feedback; please open an [issue](https://www.github.com/Bot-Shield/botshield-sdk-typescript/issues) with questions, bugs, or suggestions.
572
+ > [!WARNING]
573
+ > Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production.
388
574
 
389
- ## Requirements
575
+ ```typescript
576
+ import { BotShield } from "botshield-sdk";
577
+
578
+ const sdk = new BotShield({ debugLogger: console });
579
+ ```
580
+ <!-- End Debugging [debug] -->
390
581
 
391
- TypeScript >= 4.9 is supported.
582
+ <!-- Placeholder for Future Speakeasy SDK Sections -->
392
583
 
393
- The following runtimes are supported:
584
+ # Development
394
585
 
395
- - Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)
396
- - Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.
397
- - Deno v1.28.0 or higher.
398
- - Bun 1.0 or later.
399
- - Cloudflare Workers.
400
- - Vercel Edge Runtime.
401
- - Jest 28 or greater with the `"node"` environment (`"jsdom"` is not supported at this time).
402
- - Nitro v2.6 or greater.
586
+ ## Maturity
403
587
 
404
- Note that React Native is not supported at this time.
588
+ This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
589
+ to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
590
+ looking for the latest version.
405
591
 
406
- If you are interested in other runtime environments, please open or upvote an issue on GitHub.
592
+ ## Contributions
407
593
 
408
- ## Contributing
594
+ While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation.
595
+ We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.
409
596
 
410
- See [the contributing documentation](./CONTRIBUTING.md).
597
+ ### SDK Created by [Speakeasy](https://www.speakeasy.com/?utm_source=botshield-sdk&utm_campaign=typescript)