@detent/sdk 0.0.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 (694) hide show
  1. package/.devcontainer/devcontainer.json +45 -0
  2. package/.speakeasy/temp/downloaded_DebOqZlrza.json +1 -0
  3. package/.speakeasy/temp/downloaded_YLnaAbCoUV.json +1 -0
  4. package/FUNCTIONS.md +87 -0
  5. package/README.md +413 -0
  6. package/RUNTIMES.md +48 -0
  7. package/dist/commonjs/core.d.ts +10 -0
  8. package/dist/commonjs/core.d.ts.map +1 -0
  9. package/dist/commonjs/core.js +17 -0
  10. package/dist/commonjs/core.js.map +1 -0
  11. package/dist/commonjs/funcs/diagnostics-create.d.ts +24 -0
  12. package/dist/commonjs/funcs/diagnostics-create.d.ts.map +1 -0
  13. package/dist/commonjs/funcs/diagnostics-create.js +120 -0
  14. package/dist/commonjs/funcs/diagnostics-create.js.map +1 -0
  15. package/dist/commonjs/hooks/hooks.d.ts +25 -0
  16. package/dist/commonjs/hooks/hooks.d.ts.map +1 -0
  17. package/dist/commonjs/hooks/hooks.js +86 -0
  18. package/dist/commonjs/hooks/hooks.js.map +1 -0
  19. package/dist/commonjs/hooks/index.d.ts +3 -0
  20. package/dist/commonjs/hooks/index.d.ts.map +1 -0
  21. package/dist/commonjs/hooks/index.js +22 -0
  22. package/dist/commonjs/hooks/index.js.map +1 -0
  23. package/dist/commonjs/hooks/registration.d.ts +3 -0
  24. package/dist/commonjs/hooks/registration.d.ts.map +1 -0
  25. package/dist/commonjs/hooks/registration.js +15 -0
  26. package/dist/commonjs/hooks/registration.js.map +1 -0
  27. package/dist/commonjs/hooks/types.d.ts +76 -0
  28. package/dist/commonjs/hooks/types.d.ts.map +1 -0
  29. package/dist/commonjs/hooks/types.js +6 -0
  30. package/dist/commonjs/hooks/types.js.map +1 -0
  31. package/dist/commonjs/index.d.ts +6 -0
  32. package/dist/commonjs/index.d.ts.map +1 -0
  33. package/dist/commonjs/index.js +48 -0
  34. package/dist/commonjs/index.js.map +1 -0
  35. package/dist/commonjs/lib/base64.d.ts +10 -0
  36. package/dist/commonjs/lib/base64.d.ts.map +1 -0
  37. package/dist/commonjs/lib/base64.js +73 -0
  38. package/dist/commonjs/lib/base64.js.map +1 -0
  39. package/dist/commonjs/lib/config.d.ts +37 -0
  40. package/dist/commonjs/lib/config.d.ts.map +1 -0
  41. package/dist/commonjs/lib/config.js +42 -0
  42. package/dist/commonjs/lib/config.js.map +1 -0
  43. package/dist/commonjs/lib/dlv.d.ts +14 -0
  44. package/dist/commonjs/lib/dlv.d.ts.map +1 -0
  45. package/dist/commonjs/lib/dlv.js +49 -0
  46. package/dist/commonjs/lib/dlv.js.map +1 -0
  47. package/dist/commonjs/lib/encodings.d.ts +53 -0
  48. package/dist/commonjs/lib/encodings.d.ts.map +1 -0
  49. package/dist/commonjs/lib/encodings.js +384 -0
  50. package/dist/commonjs/lib/encodings.js.map +1 -0
  51. package/dist/commonjs/lib/env.d.ts +14 -0
  52. package/dist/commonjs/lib/env.d.ts.map +1 -0
  53. package/dist/commonjs/lib/env.js +81 -0
  54. package/dist/commonjs/lib/env.js.map +1 -0
  55. package/dist/commonjs/lib/files.d.ts +13 -0
  56. package/dist/commonjs/lib/files.d.ts.map +1 -0
  57. package/dist/commonjs/lib/files.js +77 -0
  58. package/dist/commonjs/lib/files.js.map +1 -0
  59. package/dist/commonjs/lib/http.d.ts +67 -0
  60. package/dist/commonjs/lib/http.d.ts.map +1 -0
  61. package/dist/commonjs/lib/http.js +217 -0
  62. package/dist/commonjs/lib/http.js.map +1 -0
  63. package/dist/commonjs/lib/is-plain-object.d.ts +2 -0
  64. package/dist/commonjs/lib/is-plain-object.d.ts.map +1 -0
  65. package/dist/commonjs/lib/is-plain-object.js +41 -0
  66. package/dist/commonjs/lib/is-plain-object.js.map +1 -0
  67. package/dist/commonjs/lib/logger.d.ts +6 -0
  68. package/dist/commonjs/lib/logger.d.ts.map +1 -0
  69. package/dist/commonjs/lib/logger.js +6 -0
  70. package/dist/commonjs/lib/logger.js.map +1 -0
  71. package/dist/commonjs/lib/matchers.d.ts +59 -0
  72. package/dist/commonjs/lib/matchers.d.ts.map +1 -0
  73. package/dist/commonjs/lib/matchers.js +222 -0
  74. package/dist/commonjs/lib/matchers.js.map +1 -0
  75. package/dist/commonjs/lib/primitives.d.ts +26 -0
  76. package/dist/commonjs/lib/primitives.d.ts.map +1 -0
  77. package/dist/commonjs/lib/primitives.js +111 -0
  78. package/dist/commonjs/lib/primitives.js.map +1 -0
  79. package/dist/commonjs/lib/retries.d.ts +38 -0
  80. package/dist/commonjs/lib/retries.d.ts.map +1 -0
  81. package/dist/commonjs/lib/retries.js +153 -0
  82. package/dist/commonjs/lib/retries.js.map +1 -0
  83. package/dist/commonjs/lib/schemas.d.ts +21 -0
  84. package/dist/commonjs/lib/schemas.d.ts.map +1 -0
  85. package/dist/commonjs/lib/schemas.js +95 -0
  86. package/dist/commonjs/lib/schemas.js.map +1 -0
  87. package/dist/commonjs/lib/sdks.d.ts +63 -0
  88. package/dist/commonjs/lib/sdks.d.ts.map +1 -0
  89. package/dist/commonjs/lib/sdks.js +273 -0
  90. package/dist/commonjs/lib/sdks.js.map +1 -0
  91. package/dist/commonjs/lib/security.d.ts +80 -0
  92. package/dist/commonjs/lib/security.d.ts.map +1 -0
  93. package/dist/commonjs/lib/security.js +126 -0
  94. package/dist/commonjs/lib/security.js.map +1 -0
  95. package/dist/commonjs/lib/url.d.ts +5 -0
  96. package/dist/commonjs/lib/url.d.ts.map +1 -0
  97. package/dist/commonjs/lib/url.js +25 -0
  98. package/dist/commonjs/lib/url.js.map +1 -0
  99. package/dist/commonjs/models/detected-tool.d.ts +19 -0
  100. package/dist/commonjs/models/detected-tool.d.ts.map +1 -0
  101. package/dist/commonjs/models/detected-tool.js +54 -0
  102. package/dist/commonjs/models/detected-tool.js.map +1 -0
  103. package/dist/commonjs/models/diagnostic-lite.d.ts +25 -0
  104. package/dist/commonjs/models/diagnostic-lite.d.ts.map +1 -0
  105. package/dist/commonjs/models/diagnostic-lite.js +59 -0
  106. package/dist/commonjs/models/diagnostic-lite.js.map +1 -0
  107. package/dist/commonjs/models/diagnostic-summary.d.ts +24 -0
  108. package/dist/commonjs/models/diagnostic-summary.d.ts.map +1 -0
  109. package/dist/commonjs/models/diagnostic-summary.js +53 -0
  110. package/dist/commonjs/models/diagnostic-summary.js.map +1 -0
  111. package/dist/commonjs/models/diagnostic.d.ts +46 -0
  112. package/dist/commonjs/models/diagnostic.d.ts.map +1 -0
  113. package/dist/commonjs/models/diagnostic.js +68 -0
  114. package/dist/commonjs/models/diagnostic.js.map +1 -0
  115. package/dist/commonjs/models/diagnostics-request.d.ts +27 -0
  116. package/dist/commonjs/models/diagnostics-request.d.ts.map +1 -0
  117. package/dist/commonjs/models/diagnostics-request.js +53 -0
  118. package/dist/commonjs/models/diagnostics-request.js.map +1 -0
  119. package/dist/commonjs/models/diagnostics-response-full.d.ts +31 -0
  120. package/dist/commonjs/models/diagnostics-response-full.d.ts.map +1 -0
  121. package/dist/commonjs/models/diagnostics-response-full.js +62 -0
  122. package/dist/commonjs/models/diagnostics-response-full.js.map +1 -0
  123. package/dist/commonjs/models/diagnostics-response-lite.d.ts +26 -0
  124. package/dist/commonjs/models/diagnostics-response-lite.d.ts.map +1 -0
  125. package/dist/commonjs/models/diagnostics-response-lite.js +60 -0
  126. package/dist/commonjs/models/diagnostics-response-lite.js.map +1 -0
  127. package/dist/commonjs/models/diagnostics-response.d.ts +11 -0
  128. package/dist/commonjs/models/diagnostics-response.d.ts.map +1 -0
  129. package/dist/commonjs/models/diagnostics-response.js +20 -0
  130. package/dist/commonjs/models/diagnostics-response.js.map +1 -0
  131. package/dist/commonjs/models/errors/detent-sdk-default-error.d.ts +10 -0
  132. package/dist/commonjs/models/errors/detent-sdk-default-error.d.ts.map +1 -0
  133. package/dist/commonjs/models/errors/detent-sdk-default-error.js +34 -0
  134. package/dist/commonjs/models/errors/detent-sdk-default-error.js.map +1 -0
  135. package/dist/commonjs/models/errors/detent-sdk-error.d.ts +19 -0
  136. package/dist/commonjs/models/errors/detent-sdk-error.d.ts.map +1 -0
  137. package/dist/commonjs/models/errors/detent-sdk-error.js +20 -0
  138. package/dist/commonjs/models/errors/detent-sdk-error.js.map +1 -0
  139. package/dist/commonjs/models/errors/error-response.d.ts +24 -0
  140. package/dist/commonjs/models/errors/error-response.d.ts.map +1 -0
  141. package/dist/commonjs/models/errors/error-response.js +68 -0
  142. package/dist/commonjs/models/errors/error-response.js.map +1 -0
  143. package/dist/commonjs/models/errors/http-client-errors.d.ts +44 -0
  144. package/dist/commonjs/models/errors/http-client-errors.d.ts.map +1 -0
  145. package/dist/commonjs/models/errors/http-client-errors.js +78 -0
  146. package/dist/commonjs/models/errors/http-client-errors.js.map +1 -0
  147. package/dist/commonjs/models/errors/index.d.ts +8 -0
  148. package/dist/commonjs/models/errors/index.d.ts.map +1 -0
  149. package/dist/commonjs/models/errors/index.js +27 -0
  150. package/dist/commonjs/models/errors/index.js.map +1 -0
  151. package/dist/commonjs/models/errors/rate-limit-error.d.ts +32 -0
  152. package/dist/commonjs/models/errors/rate-limit-error.d.ts.map +1 -0
  153. package/dist/commonjs/models/errors/rate-limit-error.js +70 -0
  154. package/dist/commonjs/models/errors/rate-limit-error.js.map +1 -0
  155. package/dist/commonjs/models/errors/response-validation-error.d.ts +26 -0
  156. package/dist/commonjs/models/errors/response-validation-error.d.ts.map +1 -0
  157. package/dist/commonjs/models/errors/response-validation-error.js +66 -0
  158. package/dist/commonjs/models/errors/response-validation-error.js.map +1 -0
  159. package/dist/commonjs/models/errors/sdk-validation-error.d.ts +21 -0
  160. package/dist/commonjs/models/errors/sdk-validation-error.d.ts.map +1 -0
  161. package/dist/commonjs/models/errors/sdk-validation-error.js +82 -0
  162. package/dist/commonjs/models/errors/sdk-validation-error.js.map +1 -0
  163. package/dist/commonjs/models/index.d.ts +11 -0
  164. package/dist/commonjs/models/index.d.ts.map +1 -0
  165. package/dist/commonjs/models/index.js +30 -0
  166. package/dist/commonjs/models/index.js.map +1 -0
  167. package/dist/commonjs/models/mode-enum.d.ts +16 -0
  168. package/dist/commonjs/models/mode-enum.d.ts.map +1 -0
  169. package/dist/commonjs/models/mode-enum.js +50 -0
  170. package/dist/commonjs/models/mode-enum.js.map +1 -0
  171. package/dist/commonjs/models/severity.d.ts +16 -0
  172. package/dist/commonjs/models/severity.d.ts.map +1 -0
  173. package/dist/commonjs/models/severity.js +50 -0
  174. package/dist/commonjs/models/severity.js.map +1 -0
  175. package/dist/commonjs/package.json +3 -0
  176. package/dist/commonjs/sdk/diagnostics.d.ts +18 -0
  177. package/dist/commonjs/sdk/diagnostics.d.ts.map +1 -0
  178. package/dist/commonjs/sdk/diagnostics.js +28 -0
  179. package/dist/commonjs/sdk/diagnostics.js.map +1 -0
  180. package/dist/commonjs/sdk/index.d.ts +2 -0
  181. package/dist/commonjs/sdk/index.d.ts.map +1 -0
  182. package/dist/commonjs/sdk/index.js +21 -0
  183. package/dist/commonjs/sdk/index.js.map +1 -0
  184. package/dist/commonjs/sdk/sdk.d.ts +7 -0
  185. package/dist/commonjs/sdk/sdk.d.ts.map +1 -0
  186. package/dist/commonjs/sdk/sdk.js +15 -0
  187. package/dist/commonjs/sdk/sdk.js.map +1 -0
  188. package/dist/commonjs/types/async.d.ts +23 -0
  189. package/dist/commonjs/types/async.d.ts.map +1 -0
  190. package/dist/commonjs/types/async.js +44 -0
  191. package/dist/commonjs/types/async.js.map +1 -0
  192. package/dist/commonjs/types/blobs.d.ts +4 -0
  193. package/dist/commonjs/types/blobs.d.ts.map +1 -0
  194. package/dist/commonjs/types/blobs.js +62 -0
  195. package/dist/commonjs/types/blobs.js.map +1 -0
  196. package/dist/commonjs/types/const-date-time.d.ts +3 -0
  197. package/dist/commonjs/types/const-date-time.d.ts.map +1 -0
  198. package/dist/commonjs/types/const-date-time.js +46 -0
  199. package/dist/commonjs/types/const-date-time.js.map +1 -0
  200. package/dist/commonjs/types/default-to-zero-value.d.ts +12 -0
  201. package/dist/commonjs/types/default-to-zero-value.d.ts.map +1 -0
  202. package/dist/commonjs/types/default-to-zero-value.js +35 -0
  203. package/dist/commonjs/types/default-to-zero-value.js.map +1 -0
  204. package/dist/commonjs/types/discriminated-union.d.ts +25 -0
  205. package/dist/commonjs/types/discriminated-union.d.ts.map +1 -0
  206. package/dist/commonjs/types/discriminated-union.js +98 -0
  207. package/dist/commonjs/types/discriminated-union.js.map +1 -0
  208. package/dist/commonjs/types/enums.d.ts +9 -0
  209. package/dist/commonjs/types/enums.d.ts.map +1 -0
  210. package/dist/commonjs/types/enums.js +66 -0
  211. package/dist/commonjs/types/enums.js.map +1 -0
  212. package/dist/commonjs/types/fp.d.ts +31 -0
  213. package/dist/commonjs/types/fp.d.ts.map +1 -0
  214. package/dist/commonjs/types/fp.js +37 -0
  215. package/dist/commonjs/types/fp.js.map +1 -0
  216. package/dist/commonjs/types/index.d.ts +10 -0
  217. package/dist/commonjs/types/index.d.ts.map +1 -0
  218. package/dist/commonjs/types/index.js +31 -0
  219. package/dist/commonjs/types/index.js.map +1 -0
  220. package/dist/commonjs/types/operations.d.ts +27 -0
  221. package/dist/commonjs/types/operations.d.ts.map +1 -0
  222. package/dist/commonjs/types/operations.js +83 -0
  223. package/dist/commonjs/types/operations.js.map +1 -0
  224. package/dist/commonjs/types/primitives.d.ts +11 -0
  225. package/dist/commonjs/types/primitives.d.ts.map +1 -0
  226. package/dist/commonjs/types/primitives.js +176 -0
  227. package/dist/commonjs/types/primitives.js.map +1 -0
  228. package/dist/commonjs/types/rfcdate.d.ts +21 -0
  229. package/dist/commonjs/types/rfcdate.d.ts.map +1 -0
  230. package/dist/commonjs/types/rfcdate.js +46 -0
  231. package/dist/commonjs/types/rfcdate.js.map +1 -0
  232. package/dist/commonjs/types/smart-union.d.ts +7 -0
  233. package/dist/commonjs/types/smart-union.d.ts.map +1 -0
  234. package/dist/commonjs/types/smart-union.js +147 -0
  235. package/dist/commonjs/types/smart-union.js.map +1 -0
  236. package/dist/commonjs/types/streams.d.ts +2 -0
  237. package/dist/commonjs/types/streams.d.ts.map +1 -0
  238. package/dist/commonjs/types/streams.js +18 -0
  239. package/dist/commonjs/types/streams.js.map +1 -0
  240. package/dist/commonjs/types/unrecognized.d.ts +16 -0
  241. package/dist/commonjs/types/unrecognized.d.ts.map +1 -0
  242. package/dist/commonjs/types/unrecognized.js +34 -0
  243. package/dist/commonjs/types/unrecognized.js.map +1 -0
  244. package/dist/esm/core.d.ts +10 -0
  245. package/dist/esm/core.d.ts.map +1 -0
  246. package/dist/esm/core.js +13 -0
  247. package/dist/esm/core.js.map +1 -0
  248. package/dist/esm/funcs/diagnostics-create.d.ts +24 -0
  249. package/dist/esm/funcs/diagnostics-create.d.ts.map +1 -0
  250. package/dist/esm/funcs/diagnostics-create.js +84 -0
  251. package/dist/esm/funcs/diagnostics-create.js.map +1 -0
  252. package/dist/esm/hooks/hooks.d.ts +25 -0
  253. package/dist/esm/hooks/hooks.d.ts.map +1 -0
  254. package/dist/esm/hooks/hooks.js +82 -0
  255. package/dist/esm/hooks/hooks.js.map +1 -0
  256. package/dist/esm/hooks/index.d.ts +3 -0
  257. package/dist/esm/hooks/index.d.ts.map +1 -0
  258. package/dist/esm/hooks/index.js +6 -0
  259. package/dist/esm/hooks/index.js.map +1 -0
  260. package/dist/esm/hooks/registration.d.ts +3 -0
  261. package/dist/esm/hooks/registration.d.ts.map +1 -0
  262. package/dist/esm/hooks/registration.js +12 -0
  263. package/dist/esm/hooks/registration.js.map +1 -0
  264. package/dist/esm/hooks/types.d.ts +76 -0
  265. package/dist/esm/hooks/types.d.ts.map +1 -0
  266. package/dist/esm/hooks/types.js +5 -0
  267. package/dist/esm/hooks/types.js.map +1 -0
  268. package/dist/esm/index.d.ts +6 -0
  269. package/dist/esm/index.d.ts.map +1 -0
  270. package/dist/esm/index.js +8 -0
  271. package/dist/esm/index.js.map +1 -0
  272. package/dist/esm/lib/base64.d.ts +10 -0
  273. package/dist/esm/lib/base64.d.ts.map +1 -0
  274. package/dist/esm/lib/base64.js +31 -0
  275. package/dist/esm/lib/base64.js.map +1 -0
  276. package/dist/esm/lib/config.d.ts +37 -0
  277. package/dist/esm/lib/config.d.ts.map +1 -0
  278. package/dist/esm/lib/config.js +38 -0
  279. package/dist/esm/lib/config.js.map +1 -0
  280. package/dist/esm/lib/dlv.d.ts +14 -0
  281. package/dist/esm/lib/dlv.d.ts.map +1 -0
  282. package/dist/esm/lib/dlv.js +46 -0
  283. package/dist/esm/lib/dlv.js.map +1 -0
  284. package/dist/esm/lib/encodings.d.ts +53 -0
  285. package/dist/esm/lib/encodings.d.ts.map +1 -0
  286. package/dist/esm/lib/encodings.js +370 -0
  287. package/dist/esm/lib/encodings.js.map +1 -0
  288. package/dist/esm/lib/env.d.ts +14 -0
  289. package/dist/esm/lib/env.d.ts.map +1 -0
  290. package/dist/esm/lib/env.js +43 -0
  291. package/dist/esm/lib/env.js.map +1 -0
  292. package/dist/esm/lib/files.d.ts +13 -0
  293. package/dist/esm/lib/files.d.ts.map +1 -0
  294. package/dist/esm/lib/files.js +73 -0
  295. package/dist/esm/lib/files.js.map +1 -0
  296. package/dist/esm/lib/http.d.ts +67 -0
  297. package/dist/esm/lib/http.d.ts.map +1 -0
  298. package/dist/esm/lib/http.js +207 -0
  299. package/dist/esm/lib/http.js.map +1 -0
  300. package/dist/esm/lib/is-plain-object.d.ts +2 -0
  301. package/dist/esm/lib/is-plain-object.d.ts.map +1 -0
  302. package/dist/esm/lib/is-plain-object.js +38 -0
  303. package/dist/esm/lib/is-plain-object.js.map +1 -0
  304. package/dist/esm/lib/logger.d.ts +6 -0
  305. package/dist/esm/lib/logger.d.ts.map +1 -0
  306. package/dist/esm/lib/logger.js +5 -0
  307. package/dist/esm/lib/logger.js.map +1 -0
  308. package/dist/esm/lib/matchers.d.ts +59 -0
  309. package/dist/esm/lib/matchers.d.ts.map +1 -0
  310. package/dist/esm/lib/matchers.js +203 -0
  311. package/dist/esm/lib/matchers.js.map +1 -0
  312. package/dist/esm/lib/primitives.d.ts +26 -0
  313. package/dist/esm/lib/primitives.d.ts.map +1 -0
  314. package/dist/esm/lib/primitives.js +103 -0
  315. package/dist/esm/lib/primitives.js.map +1 -0
  316. package/dist/esm/lib/retries.d.ts +38 -0
  317. package/dist/esm/lib/retries.d.ts.map +1 -0
  318. package/dist/esm/lib/retries.js +147 -0
  319. package/dist/esm/lib/retries.js.map +1 -0
  320. package/dist/esm/lib/schemas.d.ts +21 -0
  321. package/dist/esm/lib/schemas.d.ts.map +1 -0
  322. package/dist/esm/lib/schemas.js +57 -0
  323. package/dist/esm/lib/schemas.js.map +1 -0
  324. package/dist/esm/lib/sdks.d.ts +63 -0
  325. package/dist/esm/lib/sdks.d.ts.map +1 -0
  326. package/dist/esm/lib/sdks.js +269 -0
  327. package/dist/esm/lib/sdks.js.map +1 -0
  328. package/dist/esm/lib/security.d.ts +80 -0
  329. package/dist/esm/lib/security.d.ts.map +1 -0
  330. package/dist/esm/lib/security.js +121 -0
  331. package/dist/esm/lib/security.js.map +1 -0
  332. package/dist/esm/lib/url.d.ts +5 -0
  333. package/dist/esm/lib/url.d.ts.map +1 -0
  334. package/dist/esm/lib/url.js +22 -0
  335. package/dist/esm/lib/url.js.map +1 -0
  336. package/dist/esm/models/detected-tool.d.ts +19 -0
  337. package/dist/esm/models/detected-tool.d.ts.map +1 -0
  338. package/dist/esm/models/detected-tool.js +18 -0
  339. package/dist/esm/models/detected-tool.js.map +1 -0
  340. package/dist/esm/models/diagnostic-lite.d.ts +25 -0
  341. package/dist/esm/models/diagnostic-lite.d.ts.map +1 -0
  342. package/dist/esm/models/diagnostic-lite.js +22 -0
  343. package/dist/esm/models/diagnostic-lite.js.map +1 -0
  344. package/dist/esm/models/diagnostic-summary.d.ts +24 -0
  345. package/dist/esm/models/diagnostic-summary.d.ts.map +1 -0
  346. package/dist/esm/models/diagnostic-summary.js +16 -0
  347. package/dist/esm/models/diagnostic-summary.js.map +1 -0
  348. package/dist/esm/models/diagnostic.d.ts +46 -0
  349. package/dist/esm/models/diagnostic.d.ts.map +1 -0
  350. package/dist/esm/models/diagnostic.js +31 -0
  351. package/dist/esm/models/diagnostic.js.map +1 -0
  352. package/dist/esm/models/diagnostics-request.d.ts +27 -0
  353. package/dist/esm/models/diagnostics-request.d.ts.map +1 -0
  354. package/dist/esm/models/diagnostics-request.js +16 -0
  355. package/dist/esm/models/diagnostics-request.js.map +1 -0
  356. package/dist/esm/models/diagnostics-response-full.d.ts +31 -0
  357. package/dist/esm/models/diagnostics-response-full.d.ts.map +1 -0
  358. package/dist/esm/models/diagnostics-response-full.js +25 -0
  359. package/dist/esm/models/diagnostics-response-full.js.map +1 -0
  360. package/dist/esm/models/diagnostics-response-lite.d.ts +26 -0
  361. package/dist/esm/models/diagnostics-response-lite.d.ts.map +1 -0
  362. package/dist/esm/models/diagnostics-response-lite.js +23 -0
  363. package/dist/esm/models/diagnostics-response-lite.js.map +1 -0
  364. package/dist/esm/models/diagnostics-response.d.ts +11 -0
  365. package/dist/esm/models/diagnostics-response.d.ts.map +1 -0
  366. package/dist/esm/models/diagnostics-response.js +16 -0
  367. package/dist/esm/models/diagnostics-response.js.map +1 -0
  368. package/dist/esm/models/errors/detent-sdk-default-error.d.ts +10 -0
  369. package/dist/esm/models/errors/detent-sdk-default-error.d.ts.map +1 -0
  370. package/dist/esm/models/errors/detent-sdk-default-error.js +30 -0
  371. package/dist/esm/models/errors/detent-sdk-default-error.js.map +1 -0
  372. package/dist/esm/models/errors/detent-sdk-error.d.ts +19 -0
  373. package/dist/esm/models/errors/detent-sdk-error.d.ts.map +1 -0
  374. package/dist/esm/models/errors/detent-sdk-error.js +16 -0
  375. package/dist/esm/models/errors/detent-sdk-error.js.map +1 -0
  376. package/dist/esm/models/errors/error-response.d.ts +24 -0
  377. package/dist/esm/models/errors/error-response.d.ts.map +1 -0
  378. package/dist/esm/models/errors/error-response.js +31 -0
  379. package/dist/esm/models/errors/error-response.js.map +1 -0
  380. package/dist/esm/models/errors/http-client-errors.d.ts +44 -0
  381. package/dist/esm/models/errors/http-client-errors.d.ts.map +1 -0
  382. package/dist/esm/models/errors/http-client-errors.js +69 -0
  383. package/dist/esm/models/errors/http-client-errors.js.map +1 -0
  384. package/dist/esm/models/errors/index.d.ts +8 -0
  385. package/dist/esm/models/errors/index.d.ts.map +1 -0
  386. package/dist/esm/models/errors/index.js +11 -0
  387. package/dist/esm/models/errors/index.js.map +1 -0
  388. package/dist/esm/models/errors/rate-limit-error.d.ts +32 -0
  389. package/dist/esm/models/errors/rate-limit-error.d.ts.map +1 -0
  390. package/dist/esm/models/errors/rate-limit-error.js +33 -0
  391. package/dist/esm/models/errors/rate-limit-error.js.map +1 -0
  392. package/dist/esm/models/errors/response-validation-error.d.ts +26 -0
  393. package/dist/esm/models/errors/response-validation-error.d.ts.map +1 -0
  394. package/dist/esm/models/errors/response-validation-error.js +29 -0
  395. package/dist/esm/models/errors/response-validation-error.js.map +1 -0
  396. package/dist/esm/models/errors/sdk-validation-error.d.ts +21 -0
  397. package/dist/esm/models/errors/sdk-validation-error.d.ts.map +1 -0
  398. package/dist/esm/models/errors/sdk-validation-error.js +44 -0
  399. package/dist/esm/models/errors/sdk-validation-error.js.map +1 -0
  400. package/dist/esm/models/index.d.ts +11 -0
  401. package/dist/esm/models/index.d.ts.map +1 -0
  402. package/dist/esm/models/index.js +14 -0
  403. package/dist/esm/models/index.js.map +1 -0
  404. package/dist/esm/models/mode-enum.d.ts +16 -0
  405. package/dist/esm/models/mode-enum.d.ts.map +1 -0
  406. package/dist/esm/models/mode-enum.js +14 -0
  407. package/dist/esm/models/mode-enum.js.map +1 -0
  408. package/dist/esm/models/severity.d.ts +16 -0
  409. package/dist/esm/models/severity.d.ts.map +1 -0
  410. package/dist/esm/models/severity.js +14 -0
  411. package/dist/esm/models/severity.js.map +1 -0
  412. package/dist/esm/package.json +3 -0
  413. package/dist/esm/sdk/diagnostics.d.ts +18 -0
  414. package/dist/esm/sdk/diagnostics.d.ts.map +1 -0
  415. package/dist/esm/sdk/diagnostics.js +24 -0
  416. package/dist/esm/sdk/diagnostics.js.map +1 -0
  417. package/dist/esm/sdk/index.d.ts +2 -0
  418. package/dist/esm/sdk/index.d.ts.map +1 -0
  419. package/dist/esm/sdk/index.js +5 -0
  420. package/dist/esm/sdk/index.js.map +1 -0
  421. package/dist/esm/sdk/sdk.d.ts +7 -0
  422. package/dist/esm/sdk/sdk.d.ts.map +1 -0
  423. package/dist/esm/sdk/sdk.js +11 -0
  424. package/dist/esm/sdk/sdk.js.map +1 -0
  425. package/dist/esm/types/async.d.ts +23 -0
  426. package/dist/esm/types/async.d.ts.map +1 -0
  427. package/dist/esm/types/async.js +40 -0
  428. package/dist/esm/types/async.js.map +1 -0
  429. package/dist/esm/types/blobs.d.ts +4 -0
  430. package/dist/esm/types/blobs.d.ts.map +1 -0
  431. package/dist/esm/types/blobs.js +25 -0
  432. package/dist/esm/types/blobs.js.map +1 -0
  433. package/dist/esm/types/const-date-time.d.ts +3 -0
  434. package/dist/esm/types/const-date-time.d.ts.map +1 -0
  435. package/dist/esm/types/const-date-time.js +10 -0
  436. package/dist/esm/types/const-date-time.js.map +1 -0
  437. package/dist/esm/types/default-to-zero-value.d.ts +12 -0
  438. package/dist/esm/types/default-to-zero-value.d.ts.map +1 -0
  439. package/dist/esm/types/default-to-zero-value.js +31 -0
  440. package/dist/esm/types/default-to-zero-value.js.map +1 -0
  441. package/dist/esm/types/discriminated-union.d.ts +25 -0
  442. package/dist/esm/types/discriminated-union.d.ts.map +1 -0
  443. package/dist/esm/types/discriminated-union.js +61 -0
  444. package/dist/esm/types/discriminated-union.js.map +1 -0
  445. package/dist/esm/types/enums.d.ts +9 -0
  446. package/dist/esm/types/enums.d.ts.map +1 -0
  447. package/dist/esm/types/enums.js +27 -0
  448. package/dist/esm/types/enums.js.map +1 -0
  449. package/dist/esm/types/fp.d.ts +31 -0
  450. package/dist/esm/types/fp.d.ts.map +1 -0
  451. package/dist/esm/types/fp.js +31 -0
  452. package/dist/esm/types/fp.js.map +1 -0
  453. package/dist/esm/types/index.d.ts +10 -0
  454. package/dist/esm/types/index.d.ts.map +1 -0
  455. package/dist/esm/types/index.js +10 -0
  456. package/dist/esm/types/index.js.map +1 -0
  457. package/dist/esm/types/operations.d.ts +27 -0
  458. package/dist/esm/types/operations.d.ts.map +1 -0
  459. package/dist/esm/types/operations.js +77 -0
  460. package/dist/esm/types/operations.js.map +1 -0
  461. package/dist/esm/types/primitives.d.ts +11 -0
  462. package/dist/esm/types/primitives.d.ts.map +1 -0
  463. package/dist/esm/types/primitives.js +132 -0
  464. package/dist/esm/types/primitives.js.map +1 -0
  465. package/dist/esm/types/rfcdate.d.ts +21 -0
  466. package/dist/esm/types/rfcdate.d.ts.map +1 -0
  467. package/dist/esm/types/rfcdate.js +42 -0
  468. package/dist/esm/types/rfcdate.js.map +1 -0
  469. package/dist/esm/types/smart-union.d.ts +7 -0
  470. package/dist/esm/types/smart-union.d.ts.map +1 -0
  471. package/dist/esm/types/smart-union.js +111 -0
  472. package/dist/esm/types/smart-union.js.map +1 -0
  473. package/dist/esm/types/streams.d.ts +2 -0
  474. package/dist/esm/types/streams.d.ts.map +1 -0
  475. package/dist/esm/types/streams.js +15 -0
  476. package/dist/esm/types/streams.js.map +1 -0
  477. package/dist/esm/types/unrecognized.d.ts +16 -0
  478. package/dist/esm/types/unrecognized.d.ts.map +1 -0
  479. package/dist/esm/types/unrecognized.js +31 -0
  480. package/dist/esm/types/unrecognized.js.map +1 -0
  481. package/examples/diagnosticsCreate.example.ts +26 -0
  482. package/examples/node_modules/.package-lock.json +174 -0
  483. package/examples/node_modules/@esbuild/darwin-arm64/package.json +20 -0
  484. package/examples/node_modules/@types/node/assert/strict.d.ts +8 -0
  485. package/examples/node_modules/@types/node/assert.d.ts +1062 -0
  486. package/examples/node_modules/@types/node/async_hooks.d.ts +605 -0
  487. package/examples/node_modules/@types/node/buffer.buffer.d.ts +471 -0
  488. package/examples/node_modules/@types/node/buffer.d.ts +1936 -0
  489. package/examples/node_modules/@types/node/child_process.d.ts +1475 -0
  490. package/examples/node_modules/@types/node/cluster.d.ts +577 -0
  491. package/examples/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
  492. package/examples/node_modules/@types/node/compatibility/index.d.ts +9 -0
  493. package/examples/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
  494. package/examples/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  495. package/examples/node_modules/@types/node/console.d.ts +452 -0
  496. package/examples/node_modules/@types/node/constants.d.ts +21 -0
  497. package/examples/node_modules/@types/node/crypto.d.ts +4590 -0
  498. package/examples/node_modules/@types/node/dgram.d.ts +597 -0
  499. package/examples/node_modules/@types/node/diagnostics_channel.d.ts +578 -0
  500. package/examples/node_modules/@types/node/dns/promises.d.ts +479 -0
  501. package/examples/node_modules/@types/node/dns.d.ts +871 -0
  502. package/examples/node_modules/@types/node/domain.d.ts +170 -0
  503. package/examples/node_modules/@types/node/events.d.ts +977 -0
  504. package/examples/node_modules/@types/node/fs/promises.d.ts +1270 -0
  505. package/examples/node_modules/@types/node/fs.d.ts +4375 -0
  506. package/examples/node_modules/@types/node/globals.d.ts +172 -0
  507. package/examples/node_modules/@types/node/globals.typedarray.d.ts +38 -0
  508. package/examples/node_modules/@types/node/http.d.ts +2049 -0
  509. package/examples/node_modules/@types/node/http2.d.ts +2631 -0
  510. package/examples/node_modules/@types/node/https.d.ts +578 -0
  511. package/examples/node_modules/@types/node/index.d.ts +93 -0
  512. package/examples/node_modules/@types/node/inspector.generated.d.ts +3966 -0
  513. package/examples/node_modules/@types/node/module.d.ts +539 -0
  514. package/examples/node_modules/@types/node/net.d.ts +1012 -0
  515. package/examples/node_modules/@types/node/os.d.ts +506 -0
  516. package/examples/node_modules/@types/node/package.json +140 -0
  517. package/examples/node_modules/@types/node/path.d.ts +200 -0
  518. package/examples/node_modules/@types/node/perf_hooks.d.ts +961 -0
  519. package/examples/node_modules/@types/node/process.d.ts +1966 -0
  520. package/examples/node_modules/@types/node/punycode.d.ts +117 -0
  521. package/examples/node_modules/@types/node/querystring.d.ts +152 -0
  522. package/examples/node_modules/@types/node/readline/promises.d.ts +162 -0
  523. package/examples/node_modules/@types/node/readline.d.ts +589 -0
  524. package/examples/node_modules/@types/node/repl.d.ts +430 -0
  525. package/examples/node_modules/@types/node/sea.d.ts +153 -0
  526. package/examples/node_modules/@types/node/stream/consumers.d.ts +38 -0
  527. package/examples/node_modules/@types/node/stream/promises.d.ts +90 -0
  528. package/examples/node_modules/@types/node/stream/web.d.ts +533 -0
  529. package/examples/node_modules/@types/node/stream.d.ts +1675 -0
  530. package/examples/node_modules/@types/node/string_decoder.d.ts +67 -0
  531. package/examples/node_modules/@types/node/test.d.ts +1787 -0
  532. package/examples/node_modules/@types/node/timers/promises.d.ts +108 -0
  533. package/examples/node_modules/@types/node/timers.d.ts +286 -0
  534. package/examples/node_modules/@types/node/tls.d.ts +1259 -0
  535. package/examples/node_modules/@types/node/trace_events.d.ts +197 -0
  536. package/examples/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +468 -0
  537. package/examples/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +34 -0
  538. package/examples/node_modules/@types/node/ts5.6/index.d.ts +93 -0
  539. package/examples/node_modules/@types/node/tty.d.ts +208 -0
  540. package/examples/node_modules/@types/node/url.d.ts +964 -0
  541. package/examples/node_modules/@types/node/util.d.ts +2331 -0
  542. package/examples/node_modules/@types/node/v8.d.ts +809 -0
  543. package/examples/node_modules/@types/node/vm.d.ts +1001 -0
  544. package/examples/node_modules/@types/node/wasi.d.ts +181 -0
  545. package/examples/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
  546. package/examples/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
  547. package/examples/node_modules/@types/node/web-globals/events.d.ts +97 -0
  548. package/examples/node_modules/@types/node/web-globals/fetch.d.ts +46 -0
  549. package/examples/node_modules/@types/node/worker_threads.d.ts +715 -0
  550. package/examples/node_modules/@types/node/zlib.d.ts +540 -0
  551. package/examples/node_modules/dotenv/config.d.ts +1 -0
  552. package/examples/node_modules/dotenv/config.js +9 -0
  553. package/examples/node_modules/dotenv/lib/cli-options.js +17 -0
  554. package/examples/node_modules/dotenv/lib/env-options.js +28 -0
  555. package/examples/node_modules/dotenv/lib/main.d.ts +162 -0
  556. package/examples/node_modules/dotenv/lib/main.js +386 -0
  557. package/examples/node_modules/dotenv/package.json +62 -0
  558. package/examples/node_modules/esbuild/install.js +289 -0
  559. package/examples/node_modules/esbuild/lib/main.d.ts +716 -0
  560. package/examples/node_modules/esbuild/lib/main.js +2242 -0
  561. package/examples/node_modules/esbuild/package.json +49 -0
  562. package/examples/node_modules/fsevents/fsevents.d.ts +46 -0
  563. package/examples/node_modules/fsevents/fsevents.js +83 -0
  564. package/examples/node_modules/fsevents/package.json +62 -0
  565. package/examples/node_modules/get-tsconfig/dist/index.mjs +7 -0
  566. package/examples/node_modules/get-tsconfig/package.json +46 -0
  567. package/examples/node_modules/resolve-pkg-maps/dist/index.mjs +1 -0
  568. package/examples/node_modules/resolve-pkg-maps/package.json +42 -0
  569. package/examples/node_modules/tsx/dist/cjs/api/index.mjs +1 -0
  570. package/examples/node_modules/tsx/dist/cjs/index.mjs +1 -0
  571. package/examples/node_modules/tsx/dist/cli.mjs +55 -0
  572. package/examples/node_modules/tsx/dist/client-BQVF1NaW.mjs +1 -0
  573. package/examples/node_modules/tsx/dist/esm/api/index.mjs +1 -0
  574. package/examples/node_modules/tsx/dist/esm/index.mjs +2 -0
  575. package/examples/node_modules/tsx/dist/get-pipe-path-BHW2eJdv.mjs +1 -0
  576. package/examples/node_modules/tsx/dist/index-7AaEi15b.mjs +14 -0
  577. package/examples/node_modules/tsx/dist/index-gbaejti9.mjs +1 -0
  578. package/examples/node_modules/tsx/dist/lexer-DQCqS3nf.mjs +3 -0
  579. package/examples/node_modules/tsx/dist/loader.mjs +1 -0
  580. package/examples/node_modules/tsx/dist/node-features-_8ZFwP_x.mjs +1 -0
  581. package/examples/node_modules/tsx/dist/package-CeBgXWuR.mjs +1 -0
  582. package/examples/node_modules/tsx/dist/patch-repl.mjs +1 -0
  583. package/examples/node_modules/tsx/dist/preflight.mjs +1 -0
  584. package/examples/node_modules/tsx/dist/register-B7jrtLTO.mjs +1 -0
  585. package/examples/node_modules/tsx/dist/register-CFH5oNdT.mjs +4 -0
  586. package/examples/node_modules/tsx/dist/repl.mjs +3 -0
  587. package/examples/node_modules/tsx/dist/require-DQxpCAr4.mjs +1 -0
  588. package/examples/node_modules/tsx/dist/suppress-warnings.mjs +1 -0
  589. package/examples/node_modules/tsx/dist/temporary-directory-CwHp0_NW.mjs +1 -0
  590. package/examples/node_modules/tsx/dist/types-Cxp8y2TL.d.ts +5 -0
  591. package/examples/node_modules/tsx/package.json +68 -0
  592. package/examples/node_modules/undici-types/agent.d.ts +31 -0
  593. package/examples/node_modules/undici-types/api.d.ts +43 -0
  594. package/examples/node_modules/undici-types/balanced-pool.d.ts +29 -0
  595. package/examples/node_modules/undici-types/cache.d.ts +36 -0
  596. package/examples/node_modules/undici-types/client.d.ts +108 -0
  597. package/examples/node_modules/undici-types/connector.d.ts +34 -0
  598. package/examples/node_modules/undici-types/content-type.d.ts +21 -0
  599. package/examples/node_modules/undici-types/cookies.d.ts +28 -0
  600. package/examples/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
  601. package/examples/node_modules/undici-types/dispatcher.d.ts +256 -0
  602. package/examples/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
  603. package/examples/node_modules/undici-types/errors.d.ts +149 -0
  604. package/examples/node_modules/undici-types/eventsource.d.ts +61 -0
  605. package/examples/node_modules/undici-types/fetch.d.ts +209 -0
  606. package/examples/node_modules/undici-types/file.d.ts +39 -0
  607. package/examples/node_modules/undici-types/filereader.d.ts +54 -0
  608. package/examples/node_modules/undici-types/formdata.d.ts +108 -0
  609. package/examples/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  610. package/examples/node_modules/undici-types/global-origin.d.ts +7 -0
  611. package/examples/node_modules/undici-types/handlers.d.ts +15 -0
  612. package/examples/node_modules/undici-types/header.d.ts +4 -0
  613. package/examples/node_modules/undici-types/index.d.ts +71 -0
  614. package/examples/node_modules/undici-types/interceptors.d.ts +17 -0
  615. package/examples/node_modules/undici-types/mock-agent.d.ts +50 -0
  616. package/examples/node_modules/undici-types/mock-client.d.ts +25 -0
  617. package/examples/node_modules/undici-types/mock-errors.d.ts +12 -0
  618. package/examples/node_modules/undici-types/mock-interceptor.d.ts +93 -0
  619. package/examples/node_modules/undici-types/mock-pool.d.ts +25 -0
  620. package/examples/node_modules/undici-types/package.json +55 -0
  621. package/examples/node_modules/undici-types/patch.d.ts +33 -0
  622. package/examples/node_modules/undici-types/pool-stats.d.ts +19 -0
  623. package/examples/node_modules/undici-types/pool.d.ts +39 -0
  624. package/examples/node_modules/undici-types/proxy-agent.d.ts +28 -0
  625. package/examples/node_modules/undici-types/readable.d.ts +65 -0
  626. package/examples/node_modules/undici-types/retry-agent.d.ts +8 -0
  627. package/examples/node_modules/undici-types/retry-handler.d.ts +116 -0
  628. package/examples/node_modules/undici-types/util.d.ts +18 -0
  629. package/examples/node_modules/undici-types/webidl.d.ts +228 -0
  630. package/examples/node_modules/undici-types/websocket.d.ts +150 -0
  631. package/examples/package-lock.json +611 -0
  632. package/examples/package.json +18 -0
  633. package/jsr.json +27 -0
  634. package/package.json +110 -0
  635. package/src/core.ts +13 -0
  636. package/src/funcs/diagnostics-create.ts +174 -0
  637. package/src/hooks/hooks.ts +132 -0
  638. package/src/hooks/index.ts +6 -0
  639. package/src/hooks/registration.ts +14 -0
  640. package/src/hooks/types.ts +107 -0
  641. package/src/index.ts +9 -0
  642. package/src/lib/base64.ts +39 -0
  643. package/src/lib/config.ts +69 -0
  644. package/src/lib/dlv.ts +53 -0
  645. package/src/lib/encodings.ts +501 -0
  646. package/src/lib/env.ts +53 -0
  647. package/src/lib/files.ts +82 -0
  648. package/src/lib/http.ts +323 -0
  649. package/src/lib/is-plain-object.ts +43 -0
  650. package/src/lib/logger.ts +9 -0
  651. package/src/lib/matchers.ts +352 -0
  652. package/src/lib/primitives.ts +150 -0
  653. package/src/lib/retries.ts +218 -0
  654. package/src/lib/schemas.ts +94 -0
  655. package/src/lib/sdks.ts +406 -0
  656. package/src/lib/security.ts +237 -0
  657. package/src/lib/url.ts +33 -0
  658. package/src/models/detected-tool.ts +25 -0
  659. package/src/models/diagnostic-lite.ts +57 -0
  660. package/src/models/diagnostic-summary.ts +47 -0
  661. package/src/models/diagnostic.ts +83 -0
  662. package/src/models/diagnostics-request.ts +47 -0
  663. package/src/models/diagnostics-response-full.ts +67 -0
  664. package/src/models/diagnostics-response-lite.ts +61 -0
  665. package/src/models/diagnostics-response.ts +42 -0
  666. package/src/models/errors/detent-sdk-default-error.ts +40 -0
  667. package/src/models/errors/detent-sdk-error.ts +35 -0
  668. package/src/models/errors/error-response.ts +58 -0
  669. package/src/models/errors/http-client-errors.ts +62 -0
  670. package/src/models/errors/index.ts +11 -0
  671. package/src/models/errors/rate-limit-error.ts +68 -0
  672. package/src/models/errors/response-validation-error.ts +50 -0
  673. package/src/models/errors/sdk-validation-error.ts +54 -0
  674. package/src/models/index.ts +14 -0
  675. package/src/models/mode-enum.ts +23 -0
  676. package/src/models/severity.ts +23 -0
  677. package/src/sdk/diagnostics.ts +33 -0
  678. package/src/sdk/index.ts +5 -0
  679. package/src/sdk/sdk.ts +13 -0
  680. package/src/types/async.ts +68 -0
  681. package/src/types/blobs.ts +33 -0
  682. package/src/types/const-date-time.ts +15 -0
  683. package/src/types/default-to-zero-value.ts +33 -0
  684. package/src/types/discriminated-union.ts +101 -0
  685. package/src/types/enums.ts +45 -0
  686. package/src/types/fp.ts +50 -0
  687. package/src/types/index.ts +13 -0
  688. package/src/types/operations.ts +105 -0
  689. package/src/types/primitives.ts +168 -0
  690. package/src/types/rfcdate.ts +54 -0
  691. package/src/types/smart-union.ts +146 -0
  692. package/src/types/streams.ts +21 -0
  693. package/src/types/unrecognized.ts +35 -0
  694. package/tsconfig.json +40 -0
@@ -0,0 +1,45 @@
1
+ // For format details, see https://aka.ms/devcontainer.json. For config options, see the
2
+ // README at: https://github.com/devcontainers/images/tree/main/src/typescript-node
3
+ {
4
+ "name": "TypeScript",
5
+ "image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye",
6
+ // Features to add to the dev container. More info: https://containers.dev/features.
7
+ // "features": {},
8
+ // Use 'forwardPorts' to make a list of ports inside the container available locally.
9
+ // "forwardPorts": [],
10
+ // Use 'postCreateCommand' to run commands after the container is created.
11
+ "postCreateCommand": "sudo chmod +x ./.devcontainer/setup.sh && ./.devcontainer/setup.sh",
12
+ "customizations": {
13
+ "vscode": {
14
+ "extensions": [
15
+ "ms-vscode.vscode-typescript-tslint-plugin",
16
+ "esbenp.prettier-vscode",
17
+ "github.vscode-pull-request-github"
18
+ ],
19
+ "settings": {
20
+ "files.eol": "\n",
21
+ "editor.formatOnSave": true,
22
+ "typescript.tsc.autoDetect": "on",
23
+ "typescript.updateImportsOnFileMove.enabled": "always",
24
+ "typescript.preferences.importModuleSpecifier": "relative",
25
+ "[typescript]": {
26
+ "editor.codeActionsOnSave": {
27
+ "source.organizeImports": true
28
+ }
29
+ },
30
+ "[typescriptreact]": {
31
+ "editor.codeActionsOnSave": {
32
+ "source.organizeImports": true
33
+ }
34
+ }
35
+ }
36
+ },
37
+ "codespaces": {
38
+ "openFiles": [
39
+ ".devcontainer/README.md"
40
+ ]
41
+ }
42
+ }
43
+ // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
44
+ // "remoteUser": "root"
45
+ }
@@ -0,0 +1 @@
1
+ {"openapi":"3.1.0","info":{"title":"Detent API","version":"1.0.0","description":"Self-healing CI/CD platform. Parse CI logs, match error patterns, and trigger AI fixes."},"servers":[{"url":"https://backend.detent.sh","description":"Production"},{"url":"http://localhost:8787","description":"Local development"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"WorkOS access token obtained after login via navigator.detent.sh"},"apiKey":{"type":"apiKey","in":"header","name":"X-Detent-Token","description":"Detent API key (dtk_*) for CI/CD and machine-to-machine access. [Get your API key →](https://navigator.detent.sh/settings/api-keys)"}},"schemas":{"DiagnosticsResponse":{"oneOf":[{"$ref":"#/components/schemas/DiagnosticsResponseFull"},{"$ref":"#/components/schemas/DiagnosticsResponseLite"}],"discriminator":{"propertyName":"mode","mapping":{"full":"#/components/schemas/DiagnosticsResponseFull","lite":"#/components/schemas/DiagnosticsResponseLite"}}},"DiagnosticsResponseFull":{"type":"object","properties":{"mode":{"type":"string","enum":["full"],"description":"Response mode indicator (discriminator)"},"detected_tool":{"type":"string","nullable":true,"description":"Tool detected from output (null if unknown)","example":"typescript"},"diagnostics":{"type":"array","items":{"$ref":"#/components/schemas/Diagnostic"},"description":"Parsed diagnostics from the log"},"summary":{"$ref":"#/components/schemas/DiagnosticSummary"},"truncated":{"type":"boolean","description":"True if diagnostics were truncated (max 10,000)"}},"required":["mode","detected_tool","diagnostics","summary","truncated"]},"Diagnostic":{"type":"object","properties":{"message":{"type":"string","description":"Error or warning message","example":"Cannot find name 'foo'"},"file_path":{"type":"string","description":"File path where the issue occurred","example":"src/app.ts"},"line":{"type":"integer","minimum":1,"description":"Line number (1-indexed)","example":10},"column":{"type":"integer","minimum":1,"description":"Column number (1-indexed)","example":5},"severity":{"$ref":"#/components/schemas/Severity"},"rule_id":{"type":"string","description":"Tool-specific rule identifier","example":"TS2304"},"stack_trace":{"type":"string","description":"Stack trace if available (e.g., for test failures)"},"suggestions":{"type":"array","items":{"type":"string"},"description":"Suggested fixes from the tool"},"fixable":{"type":"boolean","description":"Whether the tool can auto-fix this issue"}},"required":["message","severity"]},"Severity":{"type":"string","enum":["error","warning"],"description":"Issue severity level"},"DiagnosticSummary":{"type":"object","properties":{"total":{"type":"integer","description":"Total number of diagnostics","example":5},"errors":{"type":"integer","description":"Number of errors","example":3},"warnings":{"type":"integer","description":"Number of warnings","example":2}},"required":["total","errors","warnings"],"description":"Aggregated counts"},"DiagnosticsResponseLite":{"type":"object","properties":{"mode":{"type":"string","enum":["lite"],"description":"Response mode indicator (discriminator)"},"detected_tool":{"type":"string","nullable":true,"description":"Tool detected from output (null if unknown)","example":"typescript"},"diagnostics":{"type":"array","items":{"$ref":"#/components/schemas/DiagnosticLite"},"description":"Parsed diagnostics (minimal fields)"},"truncated":{"type":"boolean","description":"True if diagnostics were truncated (max 10,000)"}},"required":["mode","detected_tool","diagnostics","truncated"]},"DiagnosticLite":{"type":"object","properties":{"message":{"type":"string","description":"Error or warning message","example":"Cannot find name 'foo'"},"file_path":{"type":"string","description":"File path where the issue occurred","example":"src/app.ts"},"line":{"type":"integer","minimum":1,"description":"Line number (1-indexed)","example":10},"column":{"type":"integer","minimum":1,"description":"Column number (1-indexed)","example":5}},"required":["message"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string","description":"Error message","example":"content must be a string"}},"required":["error"]},"RateLimitError":{"type":"object","properties":{"error":{"type":"string","description":"Rate limit error message","example":"Rate limit exceeded"},"retryAfter":{"type":"integer","description":"Unix timestamp when the rate limit resets","example":1706300000}},"required":["error","retryAfter"]},"DiagnosticsRequest":{"type":"object","properties":{"content":{"type":"string","minLength":1,"maxLength":10485760,"description":"Raw CI/build log content to parse","example":"src/app.ts:10:5 - error TS2304: Cannot find name 'foo'"},"tool":{"$ref":"#/components/schemas/DetectedTool"},"mode":{"$ref":"#/components/schemas/Mode"}},"required":["content"]},"DetectedTool":{"type":"string","enum":["eslint","vitest","typescript","cargo","golangci"],"description":"Hint for which tool produced the output. Auto-detected if omitted."},"Mode":{"type":"string","enum":["full","lite"],"default":"full","description":"Response detail level. 'full' includes severity, ruleId, suggestions. 'lite' is minimal."}},"parameters":{}},"paths":{"/v1/diagnostics":{"post":{"tags":["Diagnostics"],"summary":"Parse CI/build logs into structured diagnostics","description":"Extracts structured error and warning information from raw CI/build log output.\n\nSupports auto-detection of common tools (ESLint, TypeScript, Vitest, Cargo, golangci-lint) or accepts a hint via the `tool` parameter.\n\nReturns parsed diagnostics with file locations, severity, and tool-specific metadata.\n\n**Note:** Sensitive data (API keys, tokens, credentials) detected in the output is automatically redacted for security.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiagnosticsRequest"}}}},"responses":{"200":{"description":"Successfully parsed diagnostics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiagnosticsResponse"}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded (30 requests per minute per IP)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitError"}}}}}}}}}
@@ -0,0 +1 @@
1
+ {"openapi":"3.1.0","info":{"title":"Detent API","version":"1.0.0","description":"Self-healing CI/CD platform. Parse CI logs, match error patterns, and trigger AI fixes."},"servers":[{"url":"https://backend.detent.sh","description":"Production"},{"url":"http://localhost:8787","description":"Local development"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"WorkOS access token obtained after login via navigator.detent.sh"},"apiKey":{"type":"apiKey","in":"header","name":"X-Detent-Token","description":"Detent API key (dtk_*) for CI/CD and machine-to-machine access. [Get your API key →](https://navigator.detent.sh/settings/api-keys)"}},"schemas":{"DiagnosticsResponse":{"oneOf":[{"$ref":"#/components/schemas/DiagnosticsResponseFull"},{"$ref":"#/components/schemas/DiagnosticsResponseLite"}],"discriminator":{"propertyName":"mode","mapping":{"full":"#/components/schemas/DiagnosticsResponseFull","lite":"#/components/schemas/DiagnosticsResponseLite"}}},"DiagnosticsResponseFull":{"type":"object","properties":{"mode":{"type":"string","enum":["full"],"description":"Response mode indicator (discriminator)"},"detected_tool":{"type":"string","nullable":true,"description":"Tool detected from output (null if unknown)","example":"typescript"},"diagnostics":{"type":"array","items":{"$ref":"#/components/schemas/Diagnostic"},"description":"Parsed diagnostics from the log"},"summary":{"$ref":"#/components/schemas/DiagnosticSummary"},"truncated":{"type":"boolean","description":"True if diagnostics were truncated (max 10,000)"}},"required":["mode","detected_tool","diagnostics","summary","truncated"]},"Diagnostic":{"type":"object","properties":{"message":{"type":"string","description":"Error or warning message","example":"Cannot find name 'foo'"},"file_path":{"type":"string","description":"File path where the issue occurred","example":"src/app.ts"},"line":{"type":"integer","minimum":1,"description":"Line number (1-indexed)","example":10},"column":{"type":"integer","minimum":1,"description":"Column number (1-indexed)","example":5},"severity":{"$ref":"#/components/schemas/Severity"},"rule_id":{"type":"string","description":"Tool-specific rule identifier","example":"TS2304"},"stack_trace":{"type":"string","description":"Stack trace if available (e.g., for test failures)"},"suggestions":{"type":"array","items":{"type":"string"},"description":"Suggested fixes from the tool"},"fixable":{"type":"boolean","description":"Whether the tool can auto-fix this issue"}},"required":["message","severity"]},"Severity":{"type":"string","enum":["error","warning"],"description":"Issue severity level"},"DiagnosticSummary":{"type":"object","properties":{"total":{"type":"integer","description":"Total number of diagnostics","example":5},"errors":{"type":"integer","description":"Number of errors","example":3},"warnings":{"type":"integer","description":"Number of warnings","example":2}},"required":["total","errors","warnings"],"description":"Aggregated counts"},"DiagnosticsResponseLite":{"type":"object","properties":{"mode":{"type":"string","enum":["lite"],"description":"Response mode indicator (discriminator)"},"detected_tool":{"type":"string","nullable":true,"description":"Tool detected from output (null if unknown)","example":"typescript"},"diagnostics":{"type":"array","items":{"$ref":"#/components/schemas/DiagnosticLite"},"description":"Parsed diagnostics (minimal fields)"},"truncated":{"type":"boolean","description":"True if diagnostics were truncated (max 10,000)"}},"required":["mode","detected_tool","diagnostics","truncated"]},"DiagnosticLite":{"type":"object","properties":{"message":{"type":"string","description":"Error or warning message","example":"Cannot find name 'foo'"},"file_path":{"type":"string","description":"File path where the issue occurred","example":"src/app.ts"},"line":{"type":"integer","minimum":1,"description":"Line number (1-indexed)","example":10},"column":{"type":"integer","minimum":1,"description":"Column number (1-indexed)","example":5}},"required":["message"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string","description":"Error message","example":"content must be a string"}},"required":["error"]},"RateLimitError":{"type":"object","properties":{"error":{"type":"string","description":"Rate limit error message","example":"Rate limit exceeded"},"retryAfter":{"type":"integer","description":"Unix timestamp when the rate limit resets","example":1706300000}},"required":["error","retryAfter"]},"DiagnosticsRequest":{"type":"object","properties":{"content":{"type":"string","minLength":1,"maxLength":10485760,"description":"Raw CI/build log content to parse","example":"src/app.ts:10:5 - error TS2304: Cannot find name 'foo'"},"tool":{"$ref":"#/components/schemas/DetectedTool"},"mode":{"$ref":"#/components/schemas/Mode"}},"required":["content"]},"DetectedTool":{"type":"string","enum":["eslint","vitest","typescript","cargo","golangci"],"description":"Hint for which tool produced the output. Auto-detected if omitted."},"Mode":{"type":"string","enum":["full","lite"],"default":"full","description":"Response detail level. 'full' includes severity, ruleId, suggestions. 'lite' is minimal."}},"parameters":{}},"paths":{"/v1/diagnostics":{"post":{"tags":["Diagnostics"],"summary":"Parse CI/build logs into structured diagnostics","description":"Extracts structured error and warning information from raw CI/build log output.\n\nSupports auto-detection of common tools (ESLint, TypeScript, Vitest, Cargo, golangci-lint) or accepts a hint via the `tool` parameter.\n\nReturns parsed diagnostics with file locations, severity, and tool-specific metadata.\n\n**Note:** Sensitive data (API keys, tokens, credentials) detected in the output is automatically redacted for security.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiagnosticsRequest"}}}},"responses":{"200":{"description":"Successfully parsed diagnostics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiagnosticsResponse"}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded (30 requests per minute per IP)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitError"}}}}}}}}}
package/FUNCTIONS.md ADDED
@@ -0,0 +1,87 @@
1
+ # Standalone Functions
2
+
3
+ > [!NOTE]
4
+ > This section is useful if you are using a bundler and targetting browsers and
5
+ > runtimes where the size of an application affects performance and load times.
6
+
7
+ Every method in this SDK is also available as a standalone function. This
8
+ alternative API is suitable when targetting the browser or serverless runtimes
9
+ and using a bundler to build your application since all unused functionality
10
+ will be tree-shaken away. This includes code for unused methods, Zod schemas,
11
+ encoding helpers and response handlers. The result is dramatically smaller
12
+ impact on the application's final bundle size which grows very slowly as you use
13
+ more and more functionality from this SDK.
14
+
15
+ Calling methods through the main SDK class remains a valid and generally more
16
+ more ergonomic option. Standalone functions represent an optimisation for a
17
+ specific category of applications.
18
+
19
+ ## Example
20
+
21
+ ```typescript
22
+ import { DetentSDKCore } from "@detent/sdk/core.js";
23
+ import { diagnosticsCreate } from "@detent/sdk/funcs/diagnostics-create.js";
24
+
25
+ // Use `DetentSDKCore` for best tree-shaking performance.
26
+ // You can create one instance of it to use across an application.
27
+ const detentSDK = new DetentSDKCore();
28
+
29
+ async function run() {
30
+ const res = await diagnosticsCreate(detentSDK, {
31
+ content: "src/app.ts:10:5 - error TS2304: Cannot find name 'foo'",
32
+ });
33
+ if (res.ok) {
34
+ const { value: result } = res;
35
+ console.log(result);
36
+ } else {
37
+ console.log("diagnosticsCreate failed:", res.error);
38
+ }
39
+ }
40
+
41
+ run();
42
+ ```
43
+
44
+ ## Result types
45
+
46
+ Standalone functions differ from SDK methods in that they return a
47
+ `Result<Value, Error>` type to capture _known errors_ and document them using
48
+ the type system. By avoiding throwing errors, application code maintains clear
49
+ control flow and error-handling become part of the regular flow of application
50
+ code.
51
+
52
+ > We use the term "known errors" because standalone functions, and JavaScript
53
+ > code in general, can still throw unexpected errors such as `TypeError`s,
54
+ > `RangeError`s and `DOMException`s. Exhaustively catching all errors may be
55
+ > something this SDK addresses in the future. Nevertheless, there is still a lot
56
+ > of benefit from capturing most errors and turning them into values.
57
+
58
+ The second reason for this style of programming is because these functions will
59
+ typically be used in front-end applications where exception throwing is
60
+ sometimes discouraged or considered unidiomatic. React and similar ecosystems
61
+ and libraries tend to promote this style of programming so that components
62
+ render useful content under all states (loading, success, error and so on).
63
+
64
+ The general pattern when calling standalone functions looks like this:
65
+
66
+ ```typescript
67
+ import { Core } from "<sdk-package-name>";
68
+ import { fetchSomething } from "<sdk-package-name>/funcs/fetchSomething.js";
69
+
70
+ const client = new Core();
71
+
72
+ async function run() {
73
+ const result = await fetchSomething(client, { id: "123" });
74
+ if (!result.ok) {
75
+ // You can throw the error or handle it. It's your choice now.
76
+ throw result.error;
77
+ }
78
+
79
+ console.log(result.value);
80
+ }
81
+
82
+ run();
83
+ ```
84
+
85
+ Notably, `result.error` above will have an explicit type compared to a try-catch
86
+ variation where the error in the catch block can only be of type `unknown` (or
87
+ `any` depending on your TypeScript settings).
package/README.md ADDED
@@ -0,0 +1,413 @@
1
+ # @detent/sdk
2
+
3
+ Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@detent/sdk* API.
4
+
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=@detent/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)
7
+
8
+
9
+ <br /><br />
10
+ > [!IMPORTANT]
11
+ > This SDK is not yet ready for production use. To complete setup please follow the steps outlined in your [workspace](https://app.speakeasy.com/org/detent/detent). Delete this section before > publishing to a package manager.
12
+
13
+ <!-- Start Summary [summary] -->
14
+ ## Summary
15
+
16
+ Detent API: Self-healing CI/CD platform. Parse CI logs, match error patterns, and trigger AI fixes.
17
+ <!-- End Summary [summary] -->
18
+
19
+ <!-- Start Table of Contents [toc] -->
20
+ ## Table of Contents
21
+ <!-- $toc-max-depth=2 -->
22
+ * [@detent/sdk](#detentsdk)
23
+ * [SDK Installation](#sdk-installation)
24
+ * [Requirements](#requirements)
25
+ * [SDK Example Usage](#sdk-example-usage)
26
+ * [Available Resources and Operations](#available-resources-and-operations)
27
+ * [Standalone functions](#standalone-functions)
28
+ * [Retries](#retries)
29
+ * [Error Handling](#error-handling)
30
+ * [Server Selection](#server-selection)
31
+ * [Custom HTTP Client](#custom-http-client)
32
+ * [Debugging](#debugging)
33
+ * [Development](#development)
34
+ * [Maturity](#maturity)
35
+ * [Contributions](#contributions)
36
+
37
+ <!-- End Table of Contents [toc] -->
38
+
39
+ <!-- Start SDK Installation [installation] -->
40
+ ## SDK Installation
41
+
42
+ > [!TIP]
43
+ > To finish publishing your SDK to npm and others you must [run your first generation action](https://www.speakeasy.com/docs/github-setup#step-by-step-guide).
44
+
45
+
46
+ 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.
47
+
48
+ ### NPM
49
+
50
+ ```bash
51
+ npm add <UNSET>
52
+ ```
53
+
54
+ ### PNPM
55
+
56
+ ```bash
57
+ pnpm add <UNSET>
58
+ ```
59
+
60
+ ### Bun
61
+
62
+ ```bash
63
+ bun add <UNSET>
64
+ ```
65
+
66
+ ### Yarn
67
+
68
+ ```bash
69
+ yarn add <UNSET>
70
+ ```
71
+
72
+ > [!NOTE]
73
+ > This package is published with CommonJS and ES Modules (ESM) support.
74
+ <!-- End SDK Installation [installation] -->
75
+
76
+ <!-- Start Requirements [requirements] -->
77
+ ## Requirements
78
+
79
+ For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
80
+ <!-- End Requirements [requirements] -->
81
+
82
+ <!-- Start SDK Example Usage [usage] -->
83
+ ## SDK Example Usage
84
+
85
+ ### Example
86
+
87
+ ```typescript
88
+ import { DetentSDK } from "@detent/sdk";
89
+
90
+ const detentSDK = new DetentSDK();
91
+
92
+ async function run() {
93
+ const result = await detentSDK.diagnostics.create({
94
+ content: "src/app.ts:10:5 - error TS2304: Cannot find name 'foo'",
95
+ });
96
+
97
+ console.log(result);
98
+ }
99
+
100
+ run();
101
+
102
+ ```
103
+ <!-- End SDK Example Usage [usage] -->
104
+
105
+ <!-- Start Available Resources and Operations [operations] -->
106
+ ## Available Resources and Operations
107
+
108
+ <details open>
109
+ <summary>Available methods</summary>
110
+
111
+ ### [Diagnostics](docs/sdks/diagnostics/README.md)
112
+
113
+ * [create](docs/sdks/diagnostics/README.md#create) - Parse CI/build logs into structured diagnostics
114
+
115
+ </details>
116
+ <!-- End Available Resources and Operations [operations] -->
117
+
118
+ <!-- Start Standalone functions [standalone-funcs] -->
119
+ ## Standalone functions
120
+
121
+ All the methods listed above are available as standalone functions. These
122
+ functions are ideal for use in applications running in the browser, serverless
123
+ runtimes or other environments where application bundle size is a primary
124
+ concern. When using a bundler to build your application, all unused
125
+ functionality will be either excluded from the final bundle or tree-shaken away.
126
+
127
+ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
128
+
129
+ <details>
130
+
131
+ <summary>Available standalone functions</summary>
132
+
133
+ - [`diagnosticsCreate`](docs/sdks/diagnostics/README.md#create) - Parse CI/build logs into structured diagnostics
134
+
135
+ </details>
136
+ <!-- End Standalone functions [standalone-funcs] -->
137
+
138
+ <!-- Start Retries [retries] -->
139
+ ## Retries
140
+
141
+ 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.
142
+
143
+ To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
144
+ ```typescript
145
+ import { DetentSDK } from "@detent/sdk";
146
+
147
+ const detentSDK = new DetentSDK();
148
+
149
+ async function run() {
150
+ const result = await detentSDK.diagnostics.create({
151
+ content: "src/app.ts:10:5 - error TS2304: Cannot find name 'foo'",
152
+ }, {
153
+ retries: {
154
+ strategy: "backoff",
155
+ backoff: {
156
+ initialInterval: 1,
157
+ maxInterval: 50,
158
+ exponent: 1.1,
159
+ maxElapsedTime: 100,
160
+ },
161
+ retryConnectionErrors: false,
162
+ },
163
+ });
164
+
165
+ console.log(result);
166
+ }
167
+
168
+ run();
169
+
170
+ ```
171
+
172
+ If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
173
+ ```typescript
174
+ import { DetentSDK } from "@detent/sdk";
175
+
176
+ const detentSDK = new DetentSDK({
177
+ retryConfig: {
178
+ strategy: "backoff",
179
+ backoff: {
180
+ initialInterval: 1,
181
+ maxInterval: 50,
182
+ exponent: 1.1,
183
+ maxElapsedTime: 100,
184
+ },
185
+ retryConnectionErrors: false,
186
+ },
187
+ });
188
+
189
+ async function run() {
190
+ const result = await detentSDK.diagnostics.create({
191
+ content: "src/app.ts:10:5 - error TS2304: Cannot find name 'foo'",
192
+ });
193
+
194
+ console.log(result);
195
+ }
196
+
197
+ run();
198
+
199
+ ```
200
+ <!-- End Retries [retries] -->
201
+
202
+ <!-- Start Error Handling [errors] -->
203
+ ## Error Handling
204
+
205
+ [`DetentSDKError`](./src/models/errors/detent-sdk-error.ts) is the base class for all HTTP error responses. It has the following properties:
206
+
207
+ | Property | Type | Description |
208
+ | ------------------- | ---------- | --------------------------------------------------------------------------------------- |
209
+ | `error.message` | `string` | Error message |
210
+ | `error.statusCode` | `number` | HTTP response status code eg `404` |
211
+ | `error.headers` | `Headers` | HTTP response headers |
212
+ | `error.body` | `string` | HTTP body. Can be empty string if no body is returned. |
213
+ | `error.rawResponse` | `Response` | Raw HTTP response |
214
+ | `error.data$` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). |
215
+
216
+ ### Example
217
+ ```typescript
218
+ import { DetentSDK } from "@detent/sdk";
219
+ import * as errors from "@detent/sdk/models/errors";
220
+
221
+ const detentSDK = new DetentSDK();
222
+
223
+ async function run() {
224
+ try {
225
+ const result = await detentSDK.diagnostics.create({
226
+ content: "src/app.ts:10:5 - error TS2304: Cannot find name 'foo'",
227
+ });
228
+
229
+ console.log(result);
230
+ } catch (error) {
231
+ // The base class for HTTP error responses
232
+ if (error instanceof errors.DetentSDKError) {
233
+ console.log(error.message);
234
+ console.log(error.statusCode);
235
+ console.log(error.body);
236
+ console.log(error.headers);
237
+
238
+ // Depending on the method different errors may be thrown
239
+ if (error instanceof errors.ErrorResponse) {
240
+ console.log(error.data$.error); // string
241
+ }
242
+ }
243
+ }
244
+ }
245
+
246
+ run();
247
+
248
+ ```
249
+
250
+ ### Error Classes
251
+ **Primary errors:**
252
+ * [`DetentSDKError`](./src/models/errors/detent-sdk-error.ts): The base class for HTTP error responses.
253
+ * [`ErrorResponse`](./src/models/errors/error-response.ts): Invalid request body. Status code `400`.
254
+ * [`RateLimitError`](./src/models/errors/rate-limit-error.ts): Rate limit exceeded (30 requests per minute per IP). Status code `429`.
255
+
256
+ <details><summary>Less common errors (6)</summary>
257
+
258
+ <br />
259
+
260
+ **Network errors:**
261
+ * [`ConnectionError`](./src/models/errors/http-client-errors.ts): HTTP client was unable to make a request to a server.
262
+ * [`RequestTimeoutError`](./src/models/errors/http-client-errors.ts): HTTP request timed out due to an AbortSignal signal.
263
+ * [`RequestAbortedError`](./src/models/errors/http-client-errors.ts): HTTP request was aborted by the client.
264
+ * [`InvalidRequestError`](./src/models/errors/http-client-errors.ts): Any input used to create a request is invalid.
265
+ * [`UnexpectedClientError`](./src/models/errors/http-client-errors.ts): Unrecognised or unexpected error.
266
+
267
+
268
+ **Inherit from [`DetentSDKError`](./src/models/errors/detent-sdk-error.ts)**:
269
+ * [`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.
270
+
271
+ </details>
272
+ <!-- End Error Handling [errors] -->
273
+
274
+ <!-- Start Server Selection [server] -->
275
+ ## Server Selection
276
+
277
+ ### Select Server by Index
278
+
279
+ 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:
280
+
281
+ | # | Server | Description |
282
+ | --- | --------------------------- | ----------------- |
283
+ | 0 | `https://backend.detent.sh` | Production |
284
+ | 1 | `http://localhost:8787` | Local development |
285
+
286
+ #### Example
287
+
288
+ ```typescript
289
+ import { DetentSDK } from "@detent/sdk";
290
+
291
+ const detentSDK = new DetentSDK({
292
+ serverIdx: 0,
293
+ });
294
+
295
+ async function run() {
296
+ const result = await detentSDK.diagnostics.create({
297
+ content: "src/app.ts:10:5 - error TS2304: Cannot find name 'foo'",
298
+ });
299
+
300
+ console.log(result);
301
+ }
302
+
303
+ run();
304
+
305
+ ```
306
+
307
+ ### Override Server URL Per-Client
308
+
309
+ 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:
310
+ ```typescript
311
+ import { DetentSDK } from "@detent/sdk";
312
+
313
+ const detentSDK = new DetentSDK({
314
+ serverURL: "http://localhost:8787",
315
+ });
316
+
317
+ async function run() {
318
+ const result = await detentSDK.diagnostics.create({
319
+ content: "src/app.ts:10:5 - error TS2304: Cannot find name 'foo'",
320
+ });
321
+
322
+ console.log(result);
323
+ }
324
+
325
+ run();
326
+
327
+ ```
328
+ <!-- End Server Selection [server] -->
329
+
330
+ <!-- Start Custom HTTP Client [http-client] -->
331
+ ## Custom HTTP Client
332
+
333
+ The TypeScript SDK makes API calls using an `HTTPClient` that wraps the native
334
+ [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). This
335
+ client is a thin wrapper around `fetch` and provides the ability to attach hooks
336
+ around the request lifecycle that can be used to modify the request or handle
337
+ errors and response.
338
+
339
+ The `HTTPClient` constructor takes an optional `fetcher` argument that can be
340
+ used to integrate a third-party HTTP client or when writing tests to mock out
341
+ the HTTP client and feed in fixtures.
342
+
343
+ The following example shows how to use the `"beforeRequest"` hook to to add a
344
+ custom header and a timeout to requests and how to use the `"requestError"` hook
345
+ to log errors:
346
+
347
+ ```typescript
348
+ import { DetentSDK } from "@detent/sdk";
349
+ import { HTTPClient } from "@detent/sdk/lib/http";
350
+
351
+ const httpClient = new HTTPClient({
352
+ // fetcher takes a function that has the same signature as native `fetch`.
353
+ fetcher: (request) => {
354
+ return fetch(request);
355
+ }
356
+ });
357
+
358
+ httpClient.addHook("beforeRequest", (request) => {
359
+ const nextRequest = new Request(request, {
360
+ signal: request.signal || AbortSignal.timeout(5000)
361
+ });
362
+
363
+ nextRequest.headers.set("x-custom-header", "custom value");
364
+
365
+ return nextRequest;
366
+ });
367
+
368
+ httpClient.addHook("requestError", (error, request) => {
369
+ console.group("Request Error");
370
+ console.log("Reason:", `${error}`);
371
+ console.log("Endpoint:", `${request.method} ${request.url}`);
372
+ console.groupEnd();
373
+ });
374
+
375
+ const sdk = new DetentSDK({ httpClient: httpClient });
376
+ ```
377
+ <!-- End Custom HTTP Client [http-client] -->
378
+
379
+ <!-- Start Debugging [debug] -->
380
+ ## Debugging
381
+
382
+ You can setup your SDK to emit debug logs for SDK requests and responses.
383
+
384
+ You can pass a logger that matches `console`'s interface as an SDK option.
385
+
386
+ > [!WARNING]
387
+ > 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
+
389
+ ```typescript
390
+ import { DetentSDK } from "@detent/sdk";
391
+
392
+ const sdk = new DetentSDK({ debugLogger: console });
393
+ ```
394
+
395
+ You can also enable a default debug logger by setting an environment variable `DETENTSDK_DEBUG` to true.
396
+ <!-- End Debugging [debug] -->
397
+
398
+ <!-- Placeholder for Future Speakeasy SDK Sections -->
399
+
400
+ # Development
401
+
402
+ ## Maturity
403
+
404
+ This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
405
+ to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
406
+ looking for the latest version.
407
+
408
+ ## Contributions
409
+
410
+ 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.
411
+ 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.
412
+
413
+ ### SDK Created by [Speakeasy](https://www.speakeasy.com/?utm_source=@detent/sdk&utm_campaign=typescript)
package/RUNTIMES.md ADDED
@@ -0,0 +1,48 @@
1
+ # Supported JavaScript runtimes
2
+
3
+ This SDK is intended to be used in JavaScript runtimes that support ECMAScript 2020 or newer. The SDK uses the following features:
4
+
5
+ - [Web Fetch API][web-fetch]
6
+ - [Web Streams API][web-streams] and in particular `ReadableStream`
7
+ - [Async iterables][async-iter] using `Symbol.asyncIterator`
8
+
9
+ [web-fetch]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
10
+ [web-streams]: https://developer.mozilla.org/en-US/docs/Web/API/Streams_API
11
+ [async-iter]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols
12
+
13
+ Runtime environments that are explicitly supported are:
14
+
15
+ - Evergreen browsers which include: Chrome, Safari, Edge, Firefox
16
+ - Node.js active and maintenance LTS releases
17
+ - Currently, this is v18 and v20
18
+ - Bun v1 and above
19
+ - Deno v1.39
20
+ - Note that Deno does not currently have native support for streaming file uploads backed by the filesystem ([issue link][deno-file-streaming])
21
+
22
+ [deno-file-streaming]: https://github.com/denoland/deno/issues/11018
23
+
24
+ ## Recommended TypeScript compiler options
25
+
26
+ The following `tsconfig.json` options are recommended for projects using this
27
+ SDK in order to get static type support for features like async iterables,
28
+ streams and `fetch`-related APIs ([`for await...of`][for-await-of],
29
+ [`AbortSignal`][abort-signal], [`Request`][request], [`Response`][response] and
30
+ so on):
31
+
32
+ [for-await-of]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of
33
+ [abort-signal]: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
34
+ [request]: https://developer.mozilla.org/en-US/docs/Web/API/Request
35
+ [response]: https://developer.mozilla.org/en-US/docs/Web/API/Response
36
+
37
+ ```jsonc
38
+ {
39
+ "compilerOptions": {
40
+ "target": "es2020", // or higher
41
+ "lib": ["es2020", "dom", "dom.iterable"]
42
+ }
43
+ }
44
+ ```
45
+
46
+ While `target` can be set to older ECMAScript versions, it may result in extra,
47
+ unnecessary compatibility code being generated if you are not targeting old
48
+ runtimes.
@@ -0,0 +1,10 @@
1
+ import { ClientSDK } from "./lib/sdks.js";
2
+ /**
3
+ * A minimal client to use when calling standalone SDK functions. Typically, an
4
+ * instance of this class would be instantiated once at the start of an
5
+ * application and passed around through some dependency injection mechanism to
6
+ * parts of an application that need to make SDK calls.
7
+ */
8
+ export declare class DetentSDKCore extends ClientSDK {
9
+ }
10
+ //# sourceMappingURL=core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/core.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C;;;;;GAKG;AACH,qBAAa,aAAc,SAAQ,SAAS;CAAG"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ /*
3
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.DetentSDKCore = void 0;
7
+ const sdks_js_1 = require("./lib/sdks.js");
8
+ /**
9
+ * A minimal client to use when calling standalone SDK functions. Typically, an
10
+ * instance of this class would be instantiated once at the start of an
11
+ * application and passed around through some dependency injection mechanism to
12
+ * parts of an application that need to make SDK calls.
13
+ */
14
+ class DetentSDKCore extends sdks_js_1.ClientSDK {
15
+ }
16
+ exports.DetentSDKCore = DetentSDKCore;
17
+ //# sourceMappingURL=core.js.map