botshield-sdk 2.1.0 → 2.2.0

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 (218) hide show
  1. package/README.md +14 -9
  2. package/bin/mcp-server.js +433 -68
  3. package/bin/mcp-server.js.map +22 -18
  4. package/dist/commonjs/funcs/actions-propose-action.d.ts +1 -1
  5. package/dist/commonjs/funcs/actions-propose-action.js +1 -1
  6. package/dist/commonjs/funcs/census-get-partner-config.d.ts +18 -0
  7. package/dist/commonjs/funcs/census-get-partner-config.d.ts.map +1 -0
  8. package/dist/commonjs/funcs/census-get-partner-config.js +134 -0
  9. package/dist/commonjs/funcs/census-get-partner-config.js.map +1 -0
  10. package/dist/commonjs/funcs/census-verify-token.js +0 -12
  11. package/dist/commonjs/funcs/census-verify-token.js.map +1 -1
  12. package/dist/commonjs/funcs/secured-accounts-get-status.d.ts +18 -0
  13. package/dist/commonjs/funcs/secured-accounts-get-status.d.ts.map +1 -0
  14. package/dist/commonjs/funcs/secured-accounts-get-status.js +126 -0
  15. package/dist/commonjs/funcs/secured-accounts-get-status.js.map +1 -0
  16. package/dist/commonjs/funcs/secured-accounts-list.d.ts +18 -0
  17. package/dist/commonjs/funcs/secured-accounts-list.d.ts.map +1 -0
  18. package/dist/commonjs/funcs/secured-accounts-list.js +129 -0
  19. package/dist/commonjs/funcs/secured-accounts-list.js.map +1 -0
  20. package/dist/commonjs/funcs/secured-accounts-revoke.d.ts +18 -0
  21. package/dist/commonjs/funcs/secured-accounts-revoke.d.ts.map +1 -0
  22. package/dist/commonjs/funcs/secured-accounts-revoke.js +123 -0
  23. package/dist/commonjs/funcs/secured-accounts-revoke.js.map +1 -0
  24. package/dist/commonjs/funcs/verification-get-status.js +0 -12
  25. package/dist/commonjs/funcs/verification-get-status.js.map +1 -1
  26. package/dist/commonjs/lib/config.d.ts +2 -2
  27. package/dist/commonjs/lib/config.js +2 -2
  28. package/dist/commonjs/lib/security.d.ts.map +1 -1
  29. package/dist/commonjs/lib/security.js +0 -14
  30. package/dist/commonjs/lib/security.js.map +1 -1
  31. package/dist/commonjs/mcp-server/cli/start/command.d.ts.map +1 -1
  32. package/dist/commonjs/mcp-server/cli/start/command.js +0 -16
  33. package/dist/commonjs/mcp-server/cli/start/command.js.map +1 -1
  34. package/dist/commonjs/mcp-server/cli/start/impl.d.ts +0 -2
  35. package/dist/commonjs/mcp-server/cli/start/impl.d.ts.map +1 -1
  36. package/dist/commonjs/mcp-server/cli/start/impl.js +0 -4
  37. package/dist/commonjs/mcp-server/cli/start/impl.js.map +1 -1
  38. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  39. package/dist/commonjs/mcp-server/server.js +1 -1
  40. package/dist/commonjs/mcp-server/tools/actions-cancel-action.js +1 -1
  41. package/dist/commonjs/mcp-server/tools/actions-cancel-action.js.map +1 -1
  42. package/dist/commonjs/mcp-server/tools/actions-check-action-status.js +1 -1
  43. package/dist/commonjs/mcp-server/tools/actions-check-action-status.js.map +1 -1
  44. package/dist/commonjs/mcp-server/tools/actions-propose-action.js +1 -1
  45. package/dist/commonjs/mcp-server/tools/actions-propose-action.js.map +1 -1
  46. package/dist/commonjs/models/operations/index.d.ts +4 -0
  47. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  48. package/dist/commonjs/models/operations/index.js +4 -0
  49. package/dist/commonjs/models/operations/index.js.map +1 -1
  50. package/dist/commonjs/models/operations/sdk-create-session.d.ts +5 -5
  51. package/dist/commonjs/models/operations/sdk-create-session.d.ts.map +1 -1
  52. package/dist/commonjs/models/operations/sdk-create-session.js +6 -6
  53. package/dist/commonjs/models/operations/sdk-create-session.js.map +1 -1
  54. package/dist/commonjs/models/operations/sdk-get-partner-config.d.ts +148 -0
  55. package/dist/commonjs/models/operations/sdk-get-partner-config.d.ts.map +1 -0
  56. package/dist/commonjs/models/operations/sdk-get-partner-config.js +197 -0
  57. package/dist/commonjs/models/operations/sdk-get-partner-config.js.map +1 -0
  58. package/dist/commonjs/models/operations/sdk-verify-token.d.ts +0 -4
  59. package/dist/commonjs/models/operations/sdk-verify-token.d.ts.map +1 -1
  60. package/dist/commonjs/models/operations/sdk-verify-token.js +0 -4
  61. package/dist/commonjs/models/operations/sdk-verify-token.js.map +1 -1
  62. package/dist/commonjs/models/operations/secured-accounts-list.d.ts +212 -0
  63. package/dist/commonjs/models/operations/secured-accounts-list.d.ts.map +1 -0
  64. package/dist/commonjs/models/operations/secured-accounts-list.js +254 -0
  65. package/dist/commonjs/models/operations/secured-accounts-list.js.map +1 -0
  66. package/dist/commonjs/models/operations/secured-accounts-revoke.d.ts +130 -0
  67. package/dist/commonjs/models/operations/secured-accounts-revoke.d.ts.map +1 -0
  68. package/dist/commonjs/models/operations/secured-accounts-revoke.js +185 -0
  69. package/dist/commonjs/models/operations/secured-accounts-revoke.js.map +1 -0
  70. package/dist/commonjs/models/operations/secured-accounts-status.d.ts +97 -0
  71. package/dist/commonjs/models/operations/secured-accounts-status.d.ts.map +1 -0
  72. package/dist/commonjs/models/operations/secured-accounts-status.js +163 -0
  73. package/dist/commonjs/models/operations/secured-accounts-status.js.map +1 -0
  74. package/dist/commonjs/models/operations/verification-get-status.d.ts +0 -4
  75. package/dist/commonjs/models/operations/verification-get-status.d.ts.map +1 -1
  76. package/dist/commonjs/models/operations/verification-get-status.js +0 -4
  77. package/dist/commonjs/models/operations/verification-get-status.js.map +1 -1
  78. package/dist/commonjs/models/security.d.ts +0 -4
  79. package/dist/commonjs/models/security.d.ts.map +1 -1
  80. package/dist/commonjs/models/security.js +0 -4
  81. package/dist/commonjs/models/security.js.map +1 -1
  82. package/dist/commonjs/sdk/actions.d.ts +1 -1
  83. package/dist/commonjs/sdk/actions.js +1 -1
  84. package/dist/commonjs/sdk/census.d.ts +7 -0
  85. package/dist/commonjs/sdk/census.d.ts.map +1 -1
  86. package/dist/commonjs/sdk/census.js +10 -0
  87. package/dist/commonjs/sdk/census.js.map +1 -1
  88. package/dist/commonjs/sdk/sdk.d.ts +3 -0
  89. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  90. package/dist/commonjs/sdk/sdk.js +5 -0
  91. package/dist/commonjs/sdk/sdk.js.map +1 -1
  92. package/dist/commonjs/sdk/secured-accounts.d.ts +26 -0
  93. package/dist/commonjs/sdk/secured-accounts.d.ts.map +1 -0
  94. package/dist/commonjs/sdk/secured-accounts.js +42 -0
  95. package/dist/commonjs/sdk/secured-accounts.js.map +1 -0
  96. package/dist/esm/funcs/actions-propose-action.d.ts +1 -1
  97. package/dist/esm/funcs/actions-propose-action.js +1 -1
  98. package/dist/esm/funcs/census-get-partner-config.d.ts +18 -0
  99. package/dist/esm/funcs/census-get-partner-config.d.ts.map +1 -0
  100. package/dist/esm/funcs/census-get-partner-config.js +98 -0
  101. package/dist/esm/funcs/census-get-partner-config.js.map +1 -0
  102. package/dist/esm/funcs/census-verify-token.js +0 -12
  103. package/dist/esm/funcs/census-verify-token.js.map +1 -1
  104. package/dist/esm/funcs/secured-accounts-get-status.d.ts +18 -0
  105. package/dist/esm/funcs/secured-accounts-get-status.d.ts.map +1 -0
  106. package/dist/esm/funcs/secured-accounts-get-status.js +90 -0
  107. package/dist/esm/funcs/secured-accounts-get-status.js.map +1 -0
  108. package/dist/esm/funcs/secured-accounts-list.d.ts +18 -0
  109. package/dist/esm/funcs/secured-accounts-list.d.ts.map +1 -0
  110. package/dist/esm/funcs/secured-accounts-list.js +93 -0
  111. package/dist/esm/funcs/secured-accounts-list.js.map +1 -0
  112. package/dist/esm/funcs/secured-accounts-revoke.d.ts +18 -0
  113. package/dist/esm/funcs/secured-accounts-revoke.d.ts.map +1 -0
  114. package/dist/esm/funcs/secured-accounts-revoke.js +87 -0
  115. package/dist/esm/funcs/secured-accounts-revoke.js.map +1 -0
  116. package/dist/esm/funcs/verification-get-status.js +0 -12
  117. package/dist/esm/funcs/verification-get-status.js.map +1 -1
  118. package/dist/esm/lib/config.d.ts +2 -2
  119. package/dist/esm/lib/config.js +2 -2
  120. package/dist/esm/lib/security.d.ts.map +1 -1
  121. package/dist/esm/lib/security.js +0 -14
  122. package/dist/esm/lib/security.js.map +1 -1
  123. package/dist/esm/mcp-server/cli/start/command.d.ts.map +1 -1
  124. package/dist/esm/mcp-server/cli/start/command.js +0 -16
  125. package/dist/esm/mcp-server/cli/start/command.js.map +1 -1
  126. package/dist/esm/mcp-server/cli/start/impl.d.ts +0 -2
  127. package/dist/esm/mcp-server/cli/start/impl.d.ts.map +1 -1
  128. package/dist/esm/mcp-server/cli/start/impl.js +0 -4
  129. package/dist/esm/mcp-server/cli/start/impl.js.map +1 -1
  130. package/dist/esm/mcp-server/mcp-server.js +1 -1
  131. package/dist/esm/mcp-server/server.js +1 -1
  132. package/dist/esm/mcp-server/tools/actions-cancel-action.js +1 -1
  133. package/dist/esm/mcp-server/tools/actions-cancel-action.js.map +1 -1
  134. package/dist/esm/mcp-server/tools/actions-check-action-status.js +1 -1
  135. package/dist/esm/mcp-server/tools/actions-check-action-status.js.map +1 -1
  136. package/dist/esm/mcp-server/tools/actions-propose-action.js +1 -1
  137. package/dist/esm/mcp-server/tools/actions-propose-action.js.map +1 -1
  138. package/dist/esm/models/operations/index.d.ts +4 -0
  139. package/dist/esm/models/operations/index.d.ts.map +1 -1
  140. package/dist/esm/models/operations/index.js +4 -0
  141. package/dist/esm/models/operations/index.js.map +1 -1
  142. package/dist/esm/models/operations/sdk-create-session.d.ts +5 -5
  143. package/dist/esm/models/operations/sdk-create-session.d.ts.map +1 -1
  144. package/dist/esm/models/operations/sdk-create-session.js +5 -5
  145. package/dist/esm/models/operations/sdk-create-session.js.map +1 -1
  146. package/dist/esm/models/operations/sdk-get-partner-config.d.ts +148 -0
  147. package/dist/esm/models/operations/sdk-get-partner-config.d.ts.map +1 -0
  148. package/dist/esm/models/operations/sdk-get-partner-config.js +149 -0
  149. package/dist/esm/models/operations/sdk-get-partner-config.js.map +1 -0
  150. package/dist/esm/models/operations/sdk-verify-token.d.ts +0 -4
  151. package/dist/esm/models/operations/sdk-verify-token.d.ts.map +1 -1
  152. package/dist/esm/models/operations/sdk-verify-token.js +0 -4
  153. package/dist/esm/models/operations/sdk-verify-token.js.map +1 -1
  154. package/dist/esm/models/operations/secured-accounts-list.d.ts +212 -0
  155. package/dist/esm/models/operations/secured-accounts-list.d.ts.map +1 -0
  156. package/dist/esm/models/operations/secured-accounts-list.js +206 -0
  157. package/dist/esm/models/operations/secured-accounts-list.js.map +1 -0
  158. package/dist/esm/models/operations/secured-accounts-revoke.d.ts +130 -0
  159. package/dist/esm/models/operations/secured-accounts-revoke.d.ts.map +1 -0
  160. package/dist/esm/models/operations/secured-accounts-revoke.js +139 -0
  161. package/dist/esm/models/operations/secured-accounts-revoke.js.map +1 -0
  162. package/dist/esm/models/operations/secured-accounts-status.d.ts +97 -0
  163. package/dist/esm/models/operations/secured-accounts-status.d.ts.map +1 -0
  164. package/dist/esm/models/operations/secured-accounts-status.js +117 -0
  165. package/dist/esm/models/operations/secured-accounts-status.js.map +1 -0
  166. package/dist/esm/models/operations/verification-get-status.d.ts +0 -4
  167. package/dist/esm/models/operations/verification-get-status.d.ts.map +1 -1
  168. package/dist/esm/models/operations/verification-get-status.js +0 -4
  169. package/dist/esm/models/operations/verification-get-status.js.map +1 -1
  170. package/dist/esm/models/security.d.ts +0 -4
  171. package/dist/esm/models/security.d.ts.map +1 -1
  172. package/dist/esm/models/security.js +0 -4
  173. package/dist/esm/models/security.js.map +1 -1
  174. package/dist/esm/sdk/actions.d.ts +1 -1
  175. package/dist/esm/sdk/actions.js +1 -1
  176. package/dist/esm/sdk/census.d.ts +7 -0
  177. package/dist/esm/sdk/census.d.ts.map +1 -1
  178. package/dist/esm/sdk/census.js +10 -0
  179. package/dist/esm/sdk/census.js.map +1 -1
  180. package/dist/esm/sdk/sdk.d.ts +3 -0
  181. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  182. package/dist/esm/sdk/sdk.js +5 -0
  183. package/dist/esm/sdk/sdk.js.map +1 -1
  184. package/dist/esm/sdk/secured-accounts.d.ts +26 -0
  185. package/dist/esm/sdk/secured-accounts.d.ts.map +1 -0
  186. package/dist/esm/sdk/secured-accounts.js +38 -0
  187. package/dist/esm/sdk/secured-accounts.js.map +1 -0
  188. package/jsr.json +1 -1
  189. package/package.json +1 -1
  190. package/src/funcs/actions-propose-action.ts +1 -1
  191. package/src/funcs/census-get-partner-config.ts +198 -0
  192. package/src/funcs/census-verify-token.ts +0 -14
  193. package/src/funcs/secured-accounts-get-status.ts +189 -0
  194. package/src/funcs/secured-accounts-list.ts +194 -0
  195. package/src/funcs/secured-accounts-revoke.ts +185 -0
  196. package/src/funcs/verification-get-status.ts +0 -14
  197. package/src/lib/config.ts +2 -2
  198. package/src/lib/security.ts +0 -14
  199. package/src/mcp-server/cli/start/command.ts +0 -16
  200. package/src/mcp-server/cli/start/impl.ts +0 -6
  201. package/src/mcp-server/mcp-server.ts +1 -1
  202. package/src/mcp-server/server.ts +1 -1
  203. package/src/mcp-server/tools/actions-cancel-action.ts +1 -1
  204. package/src/mcp-server/tools/actions-check-action-status.ts +1 -1
  205. package/src/mcp-server/tools/actions-propose-action.ts +1 -1
  206. package/src/models/operations/index.ts +4 -0
  207. package/src/models/operations/sdk-create-session.ts +13 -11
  208. package/src/models/operations/sdk-get-partner-config.ts +385 -0
  209. package/src/models/operations/sdk-verify-token.ts +0 -8
  210. package/src/models/operations/secured-accounts-list.ts +507 -0
  211. package/src/models/operations/secured-accounts-revoke.ts +359 -0
  212. package/src/models/operations/secured-accounts-status.ts +296 -0
  213. package/src/models/operations/verification-get-status.ts +0 -8
  214. package/src/models/security.ts +0 -8
  215. package/src/sdk/actions.ts +1 -1
  216. package/src/sdk/census.ts +20 -0
  217. package/src/sdk/sdk.ts +6 -0
  218. package/src/sdk/secured-accounts.ts +69 -0
@@ -1 +1 @@
1
- {"version":3,"file":"census.js","sourceRoot":"","sources":["../../../src/sdk/census.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAA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AQ,EACR,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IAAA,CACJ;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CACV,QAAsC,EACtC,OAAoC,EACpC,OAAwB,EACe;QACvC,OAAO,WAAW,CAAC,YAAY,CAC7B,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IAAA,CACJ;CACF"}
@@ -1,6 +1,7 @@
1
1
  import { ClientSDK } from "../lib/sdks.js";
2
2
  import { Actions } from "./actions.js";
3
3
  import { Census } from "./census.js";
4
+ import { SecuredAccounts } from "./secured-accounts.js";
4
5
  import { Verification } from "./verification.js";
5
6
  export declare class BotShield extends ClientSDK {
6
7
  private _census?;
@@ -9,5 +10,7 @@ export declare class BotShield extends ClientSDK {
9
10
  get verification(): Verification;
10
11
  private _actions?;
11
12
  get actions(): Actions;
13
+ private _securedAccounts?;
14
+ get securedAccounts(): SecuredAccounts;
12
15
  }
13
16
  //# sourceMappingURL=sdk.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../../src/sdk/sdk.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,qBAAa,SAAU,SAAQ,SAAS;IACtC,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,OAAO,CAAC,aAAa,CAAC,CAAe;IACrC,IAAI,YAAY,IAAI,YAAY,CAE/B;IAED,OAAO,CAAC,QAAQ,CAAC,CAAU;IAC3B,IAAI,OAAO,IAAI,OAAO,CAErB;CACF"}
1
+ {"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../../src/sdk/sdk.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,qBAAa,SAAU,SAAQ,SAAS;IACtC,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,OAAO,CAAC,aAAa,CAAC,CAAe;IACrC,IAAI,YAAY,IAAI,YAAY,CAE/B;IAED,OAAO,CAAC,QAAQ,CAAC,CAAU;IAC3B,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,OAAO,CAAC,gBAAgB,CAAC,CAAkB;IAC3C,IAAI,eAAe,IAAI,eAAe,CAErC;CACF"}
@@ -4,6 +4,7 @@
4
4
  import { ClientSDK } from "../lib/sdks.js";
5
5
  import { Actions } from "./actions.js";
6
6
  import { Census } from "./census.js";
7
+ import { SecuredAccounts } from "./secured-accounts.js";
7
8
  import { Verification } from "./verification.js";
8
9
  export class BotShield extends ClientSDK {
9
10
  _census;
@@ -18,5 +19,9 @@ export class BotShield extends ClientSDK {
18
19
  get actions() {
19
20
  return (this._actions ?? (this._actions = new Actions(this._options)));
20
21
  }
22
+ _securedAccounts;
23
+ get securedAccounts() {
24
+ return (this._securedAccounts ?? (this._securedAccounts = new SecuredAccounts(this._options)));
25
+ }
21
26
  }
22
27
  //# sourceMappingURL=sdk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../../src/sdk/sdk.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EA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,CAAgB;IACrC,IAAI,YAAY,GAAiB;QAC/B,OAAO,CAAC,IAAI,CAAC,aAAa,KAAlB,IAAI,CAAC,aAAa,GAAK,IAAI,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAAA,CACjE;IAEO,QAAQ,CAAW;IAC3B,IAAI,OAAO,GAAY;QACrB,OAAO,CAAC,IAAI,CAAC,QAAQ,KAAb,IAAI,CAAC,QAAQ,GAAK,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAAA,CACvD;IAEO,gBAAgB,CAAmB;IAC3C,IAAI,eAAe,GAAoB;QACrC,OAAO,CAAC,IAAI,CAAC,gBAAgB,KAArB,IAAI,CAAC,gBAAgB,GAAK,IAAI,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAAA,CACvE;CACF"}
@@ -0,0 +1,26 @@
1
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
2
+ import * as operations from "../models/operations/index.js";
3
+ export declare class SecuredAccounts extends ClientSDK {
4
+ /**
5
+ * List Secured Accounts
6
+ *
7
+ * @remarks
8
+ * Your Secured Accounts, newest first. Filter to one account with `platform_user_ref` (exact match) or by `status`. Rows carry the handle and binding facts — never your ref or anything that identifies the person. The environment is your API key's: a `bs_dev_…` key sees and changes development Secured Accounts only, a `bs_prod_…` key production only. Server API keys only — site keys (`pk_…`) are refused.
9
+ */
10
+ list(security: operations.SecuredAccountsListSecurity, request?: operations.SecuredAccountsListRequest | undefined, options?: RequestOptions): Promise<operations.SecuredAccountsListResponse>;
11
+ /**
12
+ * Revoke a Secured Account
13
+ *
14
+ * @remarks
15
+ * End a Secured Account from your server. Send `reason: 'credential_changed'` when a primary sign-in detail changed on your side (password reset, email change, …) — the Secured Accounts spec requires it; the person's app then shows the account as Unlinked with a Re-link action. Your company's agents for that person are revoked with it, `account.unlinked { handle, by: 'platform', unlinked_at, reason, surface_id }` is sent to your webhook endpoints, live widgets for the account update at once, and the person is told. The next passkey ceremony on that account secures it again from scratch. Idempotent: an account that is not secured (or already unlinked) returns `revoked: false`. Select it by `platform_user_ref` or by `handle` — exactly one. The environment is your API key's: a `bs_dev_…` key sees and changes development Secured Accounts only, a `bs_prod_…` key production only. Server API keys only — site keys (`pk_…`) are refused.
16
+ */
17
+ revoke(security: operations.SecuredAccountsRevokeSecurity, request: operations.SecuredAccountsRevokeRequest, options?: RequestOptions): Promise<operations.SecuredAccountsRevokeResponse>;
18
+ /**
19
+ * Get Secured Account status
20
+ *
21
+ * @remarks
22
+ * Is this account a Secured Account, and is the person's recent presence fresh? Returns exactly what the embed widget's live presence stream reports for the same account, so your server and the page always agree: `none` (not secured), `fresh` (secured, recent passkey presence until `fresh_until`), `stale` (secured, presence has lapsed — ask for a passkey again). The environment is your API key's: a `bs_dev_…` key sees and changes development Secured Accounts only, a `bs_prod_…` key production only. Server API keys only — site keys (`pk_…`) are refused.
23
+ */
24
+ getStatus(security: operations.SecuredAccountsStatusSecurity, request: operations.SecuredAccountsStatusRequest, options?: RequestOptions): Promise<operations.SecuredAccountsStatusResponse>;
25
+ }
26
+ //# sourceMappingURL=secured-accounts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secured-accounts.d.ts","sourceRoot":"","sources":["../../../src/sdk/secured-accounts.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,eAAgB,SAAQ,SAAS;IAC5C;;;;;OAKG;IACG,IAAI,CACR,QAAQ,EAAE,UAAU,CAAC,2BAA2B,EAChD,OAAO,CAAC,EAAE,UAAU,CAAC,0BAA0B,GAAG,SAAS,EAC3D,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,2BAA2B,CAAC,CAOjD;IAED;;;;;OAKG;IACG,MAAM,CACV,QAAQ,EAAE,UAAU,CAAC,6BAA6B,EAClD,OAAO,EAAE,UAAU,CAAC,4BAA4B,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,6BAA6B,CAAC,CAOnD;IAED;;;;;OAKG;IACG,SAAS,CACb,QAAQ,EAAE,UAAU,CAAC,6BAA6B,EAClD,OAAO,EAAE,UAAU,CAAC,4BAA4B,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,6BAA6B,CAAC,CAOnD;CACF"}
@@ -0,0 +1,38 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import { securedAccountsGetStatus } from "../funcs/secured-accounts-get-status.js";
5
+ import { securedAccountsList } from "../funcs/secured-accounts-list.js";
6
+ import { securedAccountsRevoke } from "../funcs/secured-accounts-revoke.js";
7
+ import { ClientSDK } from "../lib/sdks.js";
8
+ import { unwrapAsync } from "../types/fp.js";
9
+ export class SecuredAccounts extends ClientSDK {
10
+ /**
11
+ * List Secured Accounts
12
+ *
13
+ * @remarks
14
+ * Your Secured Accounts, newest first. Filter to one account with `platform_user_ref` (exact match) or by `status`. Rows carry the handle and binding facts — never your ref or anything that identifies the person. The environment is your API key's: a `bs_dev_…` key sees and changes development Secured Accounts only, a `bs_prod_…` key production only. Server API keys only — site keys (`pk_…`) are refused.
15
+ */
16
+ async list(security, request, options) {
17
+ return unwrapAsync(securedAccountsList(this, security, request, options));
18
+ }
19
+ /**
20
+ * Revoke a Secured Account
21
+ *
22
+ * @remarks
23
+ * End a Secured Account from your server. Send `reason: 'credential_changed'` when a primary sign-in detail changed on your side (password reset, email change, …) — the Secured Accounts spec requires it; the person's app then shows the account as Unlinked with a Re-link action. Your company's agents for that person are revoked with it, `account.unlinked { handle, by: 'platform', unlinked_at, reason, surface_id }` is sent to your webhook endpoints, live widgets for the account update at once, and the person is told. The next passkey ceremony on that account secures it again from scratch. Idempotent: an account that is not secured (or already unlinked) returns `revoked: false`. Select it by `platform_user_ref` or by `handle` — exactly one. The environment is your API key's: a `bs_dev_…` key sees and changes development Secured Accounts only, a `bs_prod_…` key production only. Server API keys only — site keys (`pk_…`) are refused.
24
+ */
25
+ async revoke(security, request, options) {
26
+ return unwrapAsync(securedAccountsRevoke(this, security, request, options));
27
+ }
28
+ /**
29
+ * Get Secured Account status
30
+ *
31
+ * @remarks
32
+ * Is this account a Secured Account, and is the person's recent presence fresh? Returns exactly what the embed widget's live presence stream reports for the same account, so your server and the page always agree: `none` (not secured), `fresh` (secured, recent passkey presence until `fresh_until`), `stale` (secured, presence has lapsed — ask for a passkey again). The environment is your API key's: a `bs_dev_…` key sees and changes development Secured Accounts only, a `bs_prod_…` key production only. Server API keys only — site keys (`pk_…`) are refused.
33
+ */
34
+ async getStatus(security, request, options) {
35
+ return unwrapAsync(securedAccountsGetStatus(this, security, request, options));
36
+ }
37
+ }
38
+ //# sourceMappingURL=secured-accounts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secured-accounts.js","sourceRoot":"","sources":["../../../src/sdk/secured-accounts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAC5C;;;;;OAKG;IACH,KAAK,CAAC,IAAI,CACR,QAAgD,EAChD,OAA2D,EAC3D,OAAwB,EACyB;QACjD,OAAO,WAAW,CAAC,mBAAmB,CACpC,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IAAA,CACJ;IAED;;;;;OAKG;IACH,KAAK,CAAC,MAAM,CACV,QAAkD,EAClD,OAAgD,EAChD,OAAwB,EAC2B;QACnD,OAAO,WAAW,CAAC,qBAAqB,CACtC,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IAAA,CACJ;IAED;;;;;OAKG;IACH,KAAK,CAAC,SAAS,CACb,QAAkD,EAClD,OAAgD,EAChD,OAAwB,EAC2B;QACnD,OAAO,WAAW,CAAC,wBAAwB,CACzC,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IAAA,CACJ;CACF"}
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "botshield-sdk",
5
- "version": "2.1.0",
5
+ "version": "2.2.0",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "botshield-sdk",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "author": "BotShield",
5
5
  "description": "Official TypeScript SDK for BotShield — privacy-first human verification (passkeys, no PII) and Agents Ask approvals",
6
6
  "homepage": "https://docs.botshield.ai",
@@ -30,7 +30,7 @@ import { Result } from "../types/fp.js";
30
30
  * Propose an action for human confirmation
31
31
  *
32
32
  * @remarks
33
- * Queue a human-presence-gated action for a BotShield user. The user receives the card in the BotShield app (Agents Ask), confirms or denies with a biometric ceremony, and BotShield delivers a signed Proof of Resolution JWT to your registered callback URL (or poll check-status). Identify the user by opaque_id — the pairwise id from the bind ceremony. Authentication: agent key (bs_agent_<name>__<secret>) in the Authorization header.
33
+ * Queue a human-presence-gated action for a BotShield user. The user receives the card in the BotShield app (Agents Ask), confirms or denies with their passkey, and BotShield delivers a signed Proof of Resolution JWT to your registered callback URL (or poll check-status). Identify the user by opaque_id — the pairwise id from the bind ceremony. Authentication: agent key (bs_agent_<name>__<secret>) in the Authorization header.
34
34
  */
35
35
  export function actionsProposeAction(
36
36
  client: BotShieldCore,
@@ -0,0 +1,198 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { BotShieldCore } from "../core.js";
6
+ import { encodeFormQuery } from "../lib/encodings.js";
7
+ import { matchStatusCode } from "../lib/http.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { safeParse } from "../lib/schemas.js";
11
+ import { RequestOptions } from "../lib/sdks.js";
12
+ import { resolveSecurity } from "../lib/security.js";
13
+ import { pathToFunc } from "../lib/url.js";
14
+ import { BotShieldError } from "../models/errors/bot-shield-error.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/http-client-errors.js";
22
+ import * as errors from "../models/errors/index.js";
23
+ import { ResponseValidationError } from "../models/errors/response-validation-error.js";
24
+ import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * Get partner configuration
31
+ *
32
+ * @remarks
33
+ * Returns enabled integrations (Turnstile, etc.) for a site key. Public config only — secret keys never exposed.
34
+ */
35
+ export function censusGetPartnerConfig(
36
+ client: BotShieldCore,
37
+ security: operations.SDKGetPartnerConfigSecurity,
38
+ request: operations.SDKGetPartnerConfigRequest,
39
+ options?: RequestOptions,
40
+ ): APIPromise<
41
+ Result<
42
+ operations.SDKGetPartnerConfigResponse,
43
+ | errors.InvalidInputError
44
+ | errors.ErrorResponse
45
+ | BotShieldError
46
+ | ResponseValidationError
47
+ | ConnectionError
48
+ | RequestAbortedError
49
+ | RequestTimeoutError
50
+ | InvalidRequestError
51
+ | UnexpectedClientError
52
+ | SDKValidationError
53
+ >
54
+ > {
55
+ return new APIPromise($do(
56
+ client,
57
+ security,
58
+ request,
59
+ options,
60
+ ));
61
+ }
62
+
63
+ async function $do(
64
+ client: BotShieldCore,
65
+ security: operations.SDKGetPartnerConfigSecurity,
66
+ request: operations.SDKGetPartnerConfigRequest,
67
+ options?: RequestOptions,
68
+ ): Promise<
69
+ [
70
+ Result<
71
+ operations.SDKGetPartnerConfigResponse,
72
+ | errors.InvalidInputError
73
+ | errors.ErrorResponse
74
+ | BotShieldError
75
+ | ResponseValidationError
76
+ | ConnectionError
77
+ | RequestAbortedError
78
+ | RequestTimeoutError
79
+ | InvalidRequestError
80
+ | UnexpectedClientError
81
+ | SDKValidationError
82
+ >,
83
+ APICall,
84
+ ]
85
+ > {
86
+ const parsed = safeParse(
87
+ request,
88
+ (value) =>
89
+ operations.SDKGetPartnerConfigRequest$outboundSchema.parse(value),
90
+ "Input validation failed",
91
+ );
92
+ if (!parsed.ok) {
93
+ return [parsed, { status: "invalid" }];
94
+ }
95
+ const payload = parsed.value;
96
+ const body = null;
97
+
98
+ const path = pathToFunc("/sdk/partner-config")();
99
+
100
+ const query = encodeFormQuery({
101
+ "gate": payload.gate,
102
+ "scope": payload.scope,
103
+ "site_key": payload.site_key,
104
+ });
105
+
106
+ const headers = new Headers(compactMap({
107
+ Accept: "application/json",
108
+ }));
109
+
110
+ const requestSecurity = resolveSecurity(
111
+ [
112
+ {
113
+ fieldName: "Authorization",
114
+ type: "apiKey:header",
115
+ value: security?.apiKeyAuth,
116
+ },
117
+ ],
118
+ [
119
+ {
120
+ fieldName: "Authorization",
121
+ type: "apiKey:header",
122
+ value: security?.apiKeyAuth1,
123
+ },
124
+ ],
125
+ );
126
+
127
+ const context = {
128
+ options: client._options,
129
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
130
+ operationID: "SdkGetPartnerConfig",
131
+ oAuth2Scopes: null,
132
+
133
+ resolvedSecurity: requestSecurity,
134
+
135
+ securitySource: security,
136
+ retryConfig: options?.retries
137
+ || client._options.retryConfig
138
+ || { strategy: "none" },
139
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
140
+ };
141
+
142
+ const requestRes = client._createRequest(context, {
143
+ security: requestSecurity,
144
+ method: "GET",
145
+ baseURL: options?.serverURL,
146
+ path: path,
147
+ headers: headers,
148
+ query: query,
149
+ body: body,
150
+ userAgent: client._options.userAgent,
151
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
152
+ }, options);
153
+ if (!requestRes.ok) {
154
+ return [requestRes, { status: "invalid" }];
155
+ }
156
+ const req = requestRes.value;
157
+
158
+ const doResult = await client._do(req, {
159
+ context,
160
+ isErrorStatusCode: (statusCode: number) =>
161
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
162
+ retryConfig: context.retryConfig,
163
+ retryCodes: context.retryCodes,
164
+ });
165
+ if (!doResult.ok) {
166
+ return [doResult, { status: "request-error", request: req }];
167
+ }
168
+ const response = doResult.value;
169
+
170
+ const responseFields = {
171
+ HttpMeta: { Response: response, Request: req },
172
+ };
173
+
174
+ const [result] = await M.match<
175
+ operations.SDKGetPartnerConfigResponse,
176
+ | errors.InvalidInputError
177
+ | errors.ErrorResponse
178
+ | BotShieldError
179
+ | ResponseValidationError
180
+ | ConnectionError
181
+ | RequestAbortedError
182
+ | RequestTimeoutError
183
+ | InvalidRequestError
184
+ | UnexpectedClientError
185
+ | SDKValidationError
186
+ >(
187
+ M.json(200, operations.SDKGetPartnerConfigResponse$inboundSchema),
188
+ M.jsonErr(400, errors.InvalidInputError$inboundSchema),
189
+ M.jsonErr(500, errors.ErrorResponse$inboundSchema),
190
+ M.fail("4XX"),
191
+ M.fail("5XX"),
192
+ )(response, req, { extraFields: responseFields });
193
+ if (!result.ok) {
194
+ return [result, { status: "complete", request: req, response }];
195
+ }
196
+
197
+ return [result, { status: "complete", request: req, response }];
198
+ }
@@ -116,20 +116,6 @@ async function $do(
116
116
  value: security?.apiKeyAuth1,
117
117
  },
118
118
  ],
119
- [
120
- {
121
- fieldName: "Authorization",
122
- type: "apiKey:header",
123
- value: security?.apiKeyAuth2,
124
- },
125
- ],
126
- [
127
- {
128
- fieldName: "Authorization",
129
- type: "apiKey:header",
130
- value: security?.apiKeyAuth3,
131
- },
132
- ],
133
119
  );
134
120
 
135
121
  const context = {
@@ -0,0 +1,189 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { BotShieldCore } from "../core.js";
6
+ import { encodeFormQuery } from "../lib/encodings.js";
7
+ import { matchStatusCode } from "../lib/http.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { safeParse } from "../lib/schemas.js";
11
+ import { RequestOptions } from "../lib/sdks.js";
12
+ import { resolveSecurity } from "../lib/security.js";
13
+ import { pathToFunc } from "../lib/url.js";
14
+ import { BotShieldError } from "../models/errors/bot-shield-error.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/http-client-errors.js";
22
+ import * as errors from "../models/errors/index.js";
23
+ import { ResponseValidationError } from "../models/errors/response-validation-error.js";
24
+ import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * Get Secured Account status
31
+ *
32
+ * @remarks
33
+ * Is this account a Secured Account, and is the person's recent presence fresh? Returns exactly what the embed widget's live presence stream reports for the same account, so your server and the page always agree: `none` (not secured), `fresh` (secured, recent passkey presence until `fresh_until`), `stale` (secured, presence has lapsed — ask for a passkey again). The environment is your API key's: a `bs_dev_…` key sees and changes development Secured Accounts only, a `bs_prod_…` key production only. Server API keys only — site keys (`pk_…`) are refused.
34
+ */
35
+ export function securedAccountsGetStatus(
36
+ client: BotShieldCore,
37
+ security: operations.SecuredAccountsStatusSecurity,
38
+ request: operations.SecuredAccountsStatusRequest,
39
+ options?: RequestOptions,
40
+ ): APIPromise<
41
+ Result<
42
+ operations.SecuredAccountsStatusResponse,
43
+ | errors.InvalidInputError
44
+ | errors.ErrorResponse
45
+ | BotShieldError
46
+ | ResponseValidationError
47
+ | ConnectionError
48
+ | RequestAbortedError
49
+ | RequestTimeoutError
50
+ | InvalidRequestError
51
+ | UnexpectedClientError
52
+ | SDKValidationError
53
+ >
54
+ > {
55
+ return new APIPromise($do(
56
+ client,
57
+ security,
58
+ request,
59
+ options,
60
+ ));
61
+ }
62
+
63
+ async function $do(
64
+ client: BotShieldCore,
65
+ security: operations.SecuredAccountsStatusSecurity,
66
+ request: operations.SecuredAccountsStatusRequest,
67
+ options?: RequestOptions,
68
+ ): Promise<
69
+ [
70
+ Result<
71
+ operations.SecuredAccountsStatusResponse,
72
+ | errors.InvalidInputError
73
+ | errors.ErrorResponse
74
+ | BotShieldError
75
+ | ResponseValidationError
76
+ | ConnectionError
77
+ | RequestAbortedError
78
+ | RequestTimeoutError
79
+ | InvalidRequestError
80
+ | UnexpectedClientError
81
+ | SDKValidationError
82
+ >,
83
+ APICall,
84
+ ]
85
+ > {
86
+ const parsed = safeParse(
87
+ request,
88
+ (value) =>
89
+ operations.SecuredAccountsStatusRequest$outboundSchema.parse(value),
90
+ "Input validation failed",
91
+ );
92
+ if (!parsed.ok) {
93
+ return [parsed, { status: "invalid" }];
94
+ }
95
+ const payload = parsed.value;
96
+ const body = null;
97
+
98
+ const path = pathToFunc("/secured-accounts/status")();
99
+
100
+ const query = encodeFormQuery({
101
+ "platform_user_ref": payload.platform_user_ref,
102
+ });
103
+
104
+ const headers = new Headers(compactMap({
105
+ Accept: "application/json",
106
+ }));
107
+
108
+ const requestSecurity = resolveSecurity(
109
+ [
110
+ {
111
+ fieldName: "Authorization",
112
+ type: "apiKey:header",
113
+ value: security?.apiKeyAuth,
114
+ },
115
+ ],
116
+ );
117
+
118
+ const context = {
119
+ options: client._options,
120
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
121
+ operationID: "SecuredAccountsStatus",
122
+ oAuth2Scopes: null,
123
+
124
+ resolvedSecurity: requestSecurity,
125
+
126
+ securitySource: security,
127
+ retryConfig: options?.retries
128
+ || client._options.retryConfig
129
+ || { strategy: "none" },
130
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
131
+ };
132
+
133
+ const requestRes = client._createRequest(context, {
134
+ security: requestSecurity,
135
+ method: "GET",
136
+ baseURL: options?.serverURL,
137
+ path: path,
138
+ headers: headers,
139
+ query: query,
140
+ body: body,
141
+ userAgent: client._options.userAgent,
142
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
143
+ }, options);
144
+ if (!requestRes.ok) {
145
+ return [requestRes, { status: "invalid" }];
146
+ }
147
+ const req = requestRes.value;
148
+
149
+ const doResult = await client._do(req, {
150
+ context,
151
+ isErrorStatusCode: (statusCode: number) =>
152
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
153
+ retryConfig: context.retryConfig,
154
+ retryCodes: context.retryCodes,
155
+ });
156
+ if (!doResult.ok) {
157
+ return [doResult, { status: "request-error", request: req }];
158
+ }
159
+ const response = doResult.value;
160
+
161
+ const responseFields = {
162
+ HttpMeta: { Response: response, Request: req },
163
+ };
164
+
165
+ const [result] = await M.match<
166
+ operations.SecuredAccountsStatusResponse,
167
+ | errors.InvalidInputError
168
+ | errors.ErrorResponse
169
+ | BotShieldError
170
+ | ResponseValidationError
171
+ | ConnectionError
172
+ | RequestAbortedError
173
+ | RequestTimeoutError
174
+ | InvalidRequestError
175
+ | UnexpectedClientError
176
+ | SDKValidationError
177
+ >(
178
+ M.json(200, operations.SecuredAccountsStatusResponse$inboundSchema),
179
+ M.jsonErr(400, errors.InvalidInputError$inboundSchema),
180
+ M.jsonErr(500, errors.ErrorResponse$inboundSchema),
181
+ M.fail("4XX"),
182
+ M.fail("5XX"),
183
+ )(response, req, { extraFields: responseFields });
184
+ if (!result.ok) {
185
+ return [result, { status: "complete", request: req, response }];
186
+ }
187
+
188
+ return [result, { status: "complete", request: req, response }];
189
+ }