cribl-control-plane 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (590) hide show
  1. package/.devcontainer/README.md +30 -0
  2. package/.devcontainer/devcontainer.json +45 -0
  3. package/FUNCTIONS.md +87 -0
  4. package/README.md +452 -0
  5. package/RUNTIMES.md +48 -0
  6. package/bin/mcp-server.js +36958 -0
  7. package/bin/mcp-server.js.map +266 -0
  8. package/dist/commonjs/__tests__/assertions.d.ts +2 -0
  9. package/dist/commonjs/__tests__/assertions.d.ts.map +1 -0
  10. package/dist/commonjs/__tests__/assertions.js +14 -0
  11. package/dist/commonjs/__tests__/assertions.js.map +1 -0
  12. package/dist/commonjs/__tests__/diag.test.d.ts +2 -0
  13. package/dist/commonjs/__tests__/diag.test.d.ts.map +1 -0
  14. package/dist/commonjs/__tests__/diag.test.js +22 -0
  15. package/dist/commonjs/__tests__/diag.test.js.map +1 -0
  16. package/dist/commonjs/__tests__/files.d.ts +6 -0
  17. package/dist/commonjs/__tests__/files.d.ts.map +1 -0
  18. package/dist/commonjs/__tests__/files.js +51 -0
  19. package/dist/commonjs/__tests__/files.js.map +1 -0
  20. package/dist/commonjs/__tests__/testclient.d.ts +3 -0
  21. package/dist/commonjs/__tests__/testclient.d.ts.map +1 -0
  22. package/dist/commonjs/__tests__/testclient.js +38 -0
  23. package/dist/commonjs/__tests__/testclient.js.map +1 -0
  24. package/dist/commonjs/core.d.ts +10 -0
  25. package/dist/commonjs/core.d.ts.map +1 -0
  26. package/dist/commonjs/core.js +17 -0
  27. package/dist/commonjs/core.js.map +1 -0
  28. package/dist/commonjs/funcs/diagGetHealthInfo.d.ts +15 -0
  29. package/dist/commonjs/funcs/diagGetHealthInfo.d.ts.map +1 -0
  30. package/dist/commonjs/funcs/diagGetHealthInfo.js +100 -0
  31. package/dist/commonjs/funcs/diagGetHealthInfo.js.map +1 -0
  32. package/dist/commonjs/hooks/hooks.d.ts +25 -0
  33. package/dist/commonjs/hooks/hooks.d.ts.map +1 -0
  34. package/dist/commonjs/hooks/hooks.js +86 -0
  35. package/dist/commonjs/hooks/hooks.js.map +1 -0
  36. package/dist/commonjs/hooks/index.d.ts +3 -0
  37. package/dist/commonjs/hooks/index.d.ts.map +1 -0
  38. package/dist/commonjs/hooks/index.js +22 -0
  39. package/dist/commonjs/hooks/index.js.map +1 -0
  40. package/dist/commonjs/hooks/registration.d.ts +3 -0
  41. package/dist/commonjs/hooks/registration.d.ts.map +1 -0
  42. package/dist/commonjs/hooks/registration.js +15 -0
  43. package/dist/commonjs/hooks/registration.js.map +1 -0
  44. package/dist/commonjs/hooks/types.d.ts +76 -0
  45. package/dist/commonjs/hooks/types.d.ts.map +1 -0
  46. package/dist/commonjs/hooks/types.js +6 -0
  47. package/dist/commonjs/hooks/types.js.map +1 -0
  48. package/dist/commonjs/index.d.ts +6 -0
  49. package/dist/commonjs/index.d.ts.map +1 -0
  50. package/dist/commonjs/index.js +48 -0
  51. package/dist/commonjs/index.js.map +1 -0
  52. package/dist/commonjs/lib/base64.d.ts +10 -0
  53. package/dist/commonjs/lib/base64.d.ts.map +1 -0
  54. package/dist/commonjs/lib/base64.js +71 -0
  55. package/dist/commonjs/lib/base64.js.map +1 -0
  56. package/dist/commonjs/lib/config.d.ts +38 -0
  57. package/dist/commonjs/lib/config.d.ts.map +1 -0
  58. package/dist/commonjs/lib/config.js +35 -0
  59. package/dist/commonjs/lib/config.js.map +1 -0
  60. package/dist/commonjs/lib/dlv.d.ts +14 -0
  61. package/dist/commonjs/lib/dlv.d.ts.map +1 -0
  62. package/dist/commonjs/lib/dlv.js +49 -0
  63. package/dist/commonjs/lib/dlv.js.map +1 -0
  64. package/dist/commonjs/lib/encodings.d.ts +52 -0
  65. package/dist/commonjs/lib/encodings.d.ts.map +1 -0
  66. package/dist/commonjs/lib/encodings.js +368 -0
  67. package/dist/commonjs/lib/encodings.js.map +1 -0
  68. package/dist/commonjs/lib/env.d.ts +15 -0
  69. package/dist/commonjs/lib/env.d.ts.map +1 -0
  70. package/dist/commonjs/lib/env.js +65 -0
  71. package/dist/commonjs/lib/env.js.map +1 -0
  72. package/dist/commonjs/lib/files.d.ts +13 -0
  73. package/dist/commonjs/lib/files.d.ts.map +1 -0
  74. package/dist/commonjs/lib/files.js +77 -0
  75. package/dist/commonjs/lib/files.js.map +1 -0
  76. package/dist/commonjs/lib/http.d.ts +67 -0
  77. package/dist/commonjs/lib/http.d.ts.map +1 -0
  78. package/dist/commonjs/lib/http.js +217 -0
  79. package/dist/commonjs/lib/http.js.map +1 -0
  80. package/dist/commonjs/lib/is-plain-object.d.ts +2 -0
  81. package/dist/commonjs/lib/is-plain-object.d.ts.map +1 -0
  82. package/dist/commonjs/lib/is-plain-object.js +41 -0
  83. package/dist/commonjs/lib/is-plain-object.js.map +1 -0
  84. package/dist/commonjs/lib/logger.d.ts +6 -0
  85. package/dist/commonjs/lib/logger.d.ts.map +1 -0
  86. package/dist/commonjs/lib/logger.js +6 -0
  87. package/dist/commonjs/lib/logger.js.map +1 -0
  88. package/dist/commonjs/lib/matchers.d.ts +59 -0
  89. package/dist/commonjs/lib/matchers.d.ts.map +1 -0
  90. package/dist/commonjs/lib/matchers.js +222 -0
  91. package/dist/commonjs/lib/matchers.js.map +1 -0
  92. package/dist/commonjs/lib/primitives.d.ts +26 -0
  93. package/dist/commonjs/lib/primitives.d.ts.map +1 -0
  94. package/dist/commonjs/lib/primitives.js +111 -0
  95. package/dist/commonjs/lib/primitives.js.map +1 -0
  96. package/dist/commonjs/lib/retries.d.ts +38 -0
  97. package/dist/commonjs/lib/retries.d.ts.map +1 -0
  98. package/dist/commonjs/lib/retries.js +153 -0
  99. package/dist/commonjs/lib/retries.js.map +1 -0
  100. package/dist/commonjs/lib/schemas.d.ts +19 -0
  101. package/dist/commonjs/lib/schemas.d.ts.map +1 -0
  102. package/dist/commonjs/lib/schemas.js +62 -0
  103. package/dist/commonjs/lib/schemas.js.map +1 -0
  104. package/dist/commonjs/lib/sdks.d.ts +63 -0
  105. package/dist/commonjs/lib/sdks.d.ts.map +1 -0
  106. package/dist/commonjs/lib/sdks.js +273 -0
  107. package/dist/commonjs/lib/sdks.js.map +1 -0
  108. package/dist/commonjs/lib/security.d.ts +83 -0
  109. package/dist/commonjs/lib/security.d.ts.map +1 -0
  110. package/dist/commonjs/lib/security.js +144 -0
  111. package/dist/commonjs/lib/security.js.map +1 -0
  112. package/dist/commonjs/lib/url.d.ts +5 -0
  113. package/dist/commonjs/lib/url.d.ts.map +1 -0
  114. package/dist/commonjs/lib/url.js +25 -0
  115. package/dist/commonjs/lib/url.js.map +1 -0
  116. package/dist/commonjs/mcp-server/cli/start/command.d.ts +2 -0
  117. package/dist/commonjs/mcp-server/cli/start/command.d.ts.map +1 -0
  118. package/dist/commonjs/mcp-server/cli/start/command.js +126 -0
  119. package/dist/commonjs/mcp-server/cli/start/command.js.map +1 -0
  120. package/dist/commonjs/mcp-server/cli/start/impl.d.ts +16 -0
  121. package/dist/commonjs/mcp-server/cli/start/impl.d.ts.map +1 -0
  122. package/dist/commonjs/mcp-server/cli/start/impl.js +102 -0
  123. package/dist/commonjs/mcp-server/cli/start/impl.js.map +1 -0
  124. package/dist/commonjs/mcp-server/cli.d.ts +6 -0
  125. package/dist/commonjs/mcp-server/cli.d.ts.map +1 -0
  126. package/dist/commonjs/mcp-server/cli.js +10 -0
  127. package/dist/commonjs/mcp-server/cli.js.map +1 -0
  128. package/dist/commonjs/mcp-server/console-logger.d.ts +7 -0
  129. package/dist/commonjs/mcp-server/console-logger.d.ts.map +1 -0
  130. package/dist/commonjs/mcp-server/console-logger.js +59 -0
  131. package/dist/commonjs/mcp-server/console-logger.js.map +1 -0
  132. package/dist/commonjs/mcp-server/extensions.d.ts +11 -0
  133. package/dist/commonjs/mcp-server/extensions.d.ts.map +1 -0
  134. package/dist/commonjs/mcp-server/extensions.js +6 -0
  135. package/dist/commonjs/mcp-server/extensions.js.map +1 -0
  136. package/dist/commonjs/mcp-server/mcp-server.d.ts +2 -0
  137. package/dist/commonjs/mcp-server/mcp-server.d.ts.map +1 -0
  138. package/dist/commonjs/mcp-server/mcp-server.js +29 -0
  139. package/dist/commonjs/mcp-server/mcp-server.js.map +1 -0
  140. package/dist/commonjs/mcp-server/prompts.d.ts +26 -0
  141. package/dist/commonjs/mcp-server/prompts.d.ts.map +1 -0
  142. package/dist/commonjs/mcp-server/prompts.js +51 -0
  143. package/dist/commonjs/mcp-server/prompts.js.map +1 -0
  144. package/dist/commonjs/mcp-server/resources.d.ts +32 -0
  145. package/dist/commonjs/mcp-server/resources.d.ts.map +1 -0
  146. package/dist/commonjs/mcp-server/resources.js +87 -0
  147. package/dist/commonjs/mcp-server/resources.js.map +1 -0
  148. package/dist/commonjs/mcp-server/scopes.d.ts +3 -0
  149. package/dist/commonjs/mcp-server/scopes.d.ts.map +1 -0
  150. package/dist/commonjs/mcp-server/scopes.js +8 -0
  151. package/dist/commonjs/mcp-server/scopes.js.map +1 -0
  152. package/dist/commonjs/mcp-server/server.d.ts +13 -0
  153. package/dist/commonjs/mcp-server/server.d.ts.map +1 -0
  154. package/dist/commonjs/mcp-server/server.js +34 -0
  155. package/dist/commonjs/mcp-server/server.js.map +1 -0
  156. package/dist/commonjs/mcp-server/shared.d.ts +7 -0
  157. package/dist/commonjs/mcp-server/shared.d.ts.map +1 -0
  158. package/dist/commonjs/mcp-server/shared.js +98 -0
  159. package/dist/commonjs/mcp-server/shared.js.map +1 -0
  160. package/dist/commonjs/mcp-server/tools/diagGetHealthInfo.d.ts +3 -0
  161. package/dist/commonjs/mcp-server/tools/diagGetHealthInfo.d.ts.map +1 -0
  162. package/dist/commonjs/mcp-server/tools/diagGetHealthInfo.js +24 -0
  163. package/dist/commonjs/mcp-server/tools/diagGetHealthInfo.js.map +1 -0
  164. package/dist/commonjs/mcp-server/tools.d.ts +25 -0
  165. package/dist/commonjs/mcp-server/tools.d.ts.map +1 -0
  166. package/dist/commonjs/mcp-server/tools.js +82 -0
  167. package/dist/commonjs/mcp-server/tools.js.map +1 -0
  168. package/dist/commonjs/models/errors/criblcontrolplanedefaulterror.d.ts +10 -0
  169. package/dist/commonjs/models/errors/criblcontrolplanedefaulterror.d.ts.map +1 -0
  170. package/dist/commonjs/models/errors/criblcontrolplanedefaulterror.js +34 -0
  171. package/dist/commonjs/models/errors/criblcontrolplanedefaulterror.js.map +1 -0
  172. package/dist/commonjs/models/errors/criblcontrolplaneerror.d.ts +19 -0
  173. package/dist/commonjs/models/errors/criblcontrolplaneerror.d.ts.map +1 -0
  174. package/dist/commonjs/models/errors/criblcontrolplaneerror.js +20 -0
  175. package/dist/commonjs/models/errors/criblcontrolplaneerror.js.map +1 -0
  176. package/dist/commonjs/models/errors/healthstatuserror.d.ts +43 -0
  177. package/dist/commonjs/models/errors/healthstatuserror.d.ts.map +1 -0
  178. package/dist/commonjs/models/errors/healthstatuserror.js +93 -0
  179. package/dist/commonjs/models/errors/healthstatuserror.js.map +1 -0
  180. package/dist/commonjs/models/errors/httpclienterrors.d.ts +44 -0
  181. package/dist/commonjs/models/errors/httpclienterrors.d.ts.map +1 -0
  182. package/dist/commonjs/models/errors/httpclienterrors.js +78 -0
  183. package/dist/commonjs/models/errors/httpclienterrors.js.map +1 -0
  184. package/dist/commonjs/models/errors/index.d.ts +6 -0
  185. package/dist/commonjs/models/errors/index.d.ts.map +1 -0
  186. package/dist/commonjs/models/errors/index.js +25 -0
  187. package/dist/commonjs/models/errors/index.js.map +1 -0
  188. package/dist/commonjs/models/errors/responsevalidationerror.d.ts +26 -0
  189. package/dist/commonjs/models/errors/responsevalidationerror.d.ts.map +1 -0
  190. package/dist/commonjs/models/errors/responsevalidationerror.js +66 -0
  191. package/dist/commonjs/models/errors/responsevalidationerror.js.map +1 -0
  192. package/dist/commonjs/models/errors/sdkvalidationerror.d.ts +21 -0
  193. package/dist/commonjs/models/errors/sdkvalidationerror.d.ts.map +1 -0
  194. package/dist/commonjs/models/errors/sdkvalidationerror.js +129 -0
  195. package/dist/commonjs/models/errors/sdkvalidationerror.js.map +1 -0
  196. package/dist/commonjs/models/healthstatus.d.ts +87 -0
  197. package/dist/commonjs/models/healthstatus.d.ts.map +1 -0
  198. package/dist/commonjs/models/healthstatus.js +113 -0
  199. package/dist/commonjs/models/healthstatus.js.map +1 -0
  200. package/dist/commonjs/models/index.d.ts +3 -0
  201. package/dist/commonjs/models/index.d.ts.map +1 -0
  202. package/dist/commonjs/models/index.js +22 -0
  203. package/dist/commonjs/models/index.js.map +1 -0
  204. package/dist/commonjs/models/security.d.ts +29 -0
  205. package/dist/commonjs/models/security.d.ts.map +1 -0
  206. package/dist/commonjs/models/security.js +69 -0
  207. package/dist/commonjs/models/security.js.map +1 -0
  208. package/dist/commonjs/package.json +3 -0
  209. package/dist/commonjs/sdk/diag.d.ts +9 -0
  210. package/dist/commonjs/sdk/diag.d.ts.map +1 -0
  211. package/dist/commonjs/sdk/diag.js +19 -0
  212. package/dist/commonjs/sdk/diag.js.map +1 -0
  213. package/dist/commonjs/sdk/health.d.ts +9 -0
  214. package/dist/commonjs/sdk/health.d.ts.map +1 -0
  215. package/dist/commonjs/sdk/health.js +19 -0
  216. package/dist/commonjs/sdk/health.js.map +1 -0
  217. package/dist/commonjs/sdk/index.d.ts +2 -0
  218. package/dist/commonjs/sdk/index.d.ts.map +1 -0
  219. package/dist/commonjs/sdk/index.js +21 -0
  220. package/dist/commonjs/sdk/index.js.map +1 -0
  221. package/dist/commonjs/sdk/sdk.d.ts +10 -0
  222. package/dist/commonjs/sdk/sdk.d.ts.map +1 -0
  223. package/dist/commonjs/sdk/sdk.js +19 -0
  224. package/dist/commonjs/sdk/sdk.js.map +1 -0
  225. package/dist/commonjs/types/async.d.ts +23 -0
  226. package/dist/commonjs/types/async.d.ts.map +1 -0
  227. package/dist/commonjs/types/async.js +44 -0
  228. package/dist/commonjs/types/async.js.map +1 -0
  229. package/dist/commonjs/types/blobs.d.ts +4 -0
  230. package/dist/commonjs/types/blobs.d.ts.map +1 -0
  231. package/dist/commonjs/types/blobs.js +62 -0
  232. package/dist/commonjs/types/blobs.js.map +1 -0
  233. package/dist/commonjs/types/constdatetime.d.ts +3 -0
  234. package/dist/commonjs/types/constdatetime.d.ts.map +1 -0
  235. package/dist/commonjs/types/constdatetime.js +46 -0
  236. package/dist/commonjs/types/constdatetime.js.map +1 -0
  237. package/dist/commonjs/types/enums.d.ts +12 -0
  238. package/dist/commonjs/types/enums.d.ts.map +1 -0
  239. package/dist/commonjs/types/enums.js +10 -0
  240. package/dist/commonjs/types/enums.js.map +1 -0
  241. package/dist/commonjs/types/fp.d.ts +31 -0
  242. package/dist/commonjs/types/fp.d.ts.map +1 -0
  243. package/dist/commonjs/types/fp.js +37 -0
  244. package/dist/commonjs/types/fp.js.map +1 -0
  245. package/dist/commonjs/types/index.d.ts +8 -0
  246. package/dist/commonjs/types/index.d.ts.map +1 -0
  247. package/dist/commonjs/types/index.js +16 -0
  248. package/dist/commonjs/types/index.js.map +1 -0
  249. package/dist/commonjs/types/operations.d.ts +27 -0
  250. package/dist/commonjs/types/operations.d.ts.map +1 -0
  251. package/dist/commonjs/types/operations.js +83 -0
  252. package/dist/commonjs/types/operations.js.map +1 -0
  253. package/dist/commonjs/types/rfcdate.d.ts +21 -0
  254. package/dist/commonjs/types/rfcdate.d.ts.map +1 -0
  255. package/dist/commonjs/types/rfcdate.js +46 -0
  256. package/dist/commonjs/types/rfcdate.js.map +1 -0
  257. package/dist/commonjs/types/streams.d.ts +2 -0
  258. package/dist/commonjs/types/streams.d.ts.map +1 -0
  259. package/dist/commonjs/types/streams.js +18 -0
  260. package/dist/commonjs/types/streams.js.map +1 -0
  261. package/dist/esm/__tests__/assertions.d.ts +2 -0
  262. package/dist/esm/__tests__/assertions.d.ts.map +1 -0
  263. package/dist/esm/__tests__/assertions.js +11 -0
  264. package/dist/esm/__tests__/assertions.js.map +1 -0
  265. package/dist/esm/__tests__/diag.test.d.ts +2 -0
  266. package/dist/esm/__tests__/diag.test.d.ts.map +1 -0
  267. package/dist/esm/__tests__/diag.test.js +20 -0
  268. package/dist/esm/__tests__/diag.test.js.map +1 -0
  269. package/dist/esm/__tests__/files.d.ts +6 -0
  270. package/dist/esm/__tests__/files.d.ts.map +1 -0
  271. package/dist/esm/__tests__/files.js +44 -0
  272. package/dist/esm/__tests__/files.js.map +1 -0
  273. package/dist/esm/__tests__/testclient.d.ts +3 -0
  274. package/dist/esm/__tests__/testclient.d.ts.map +1 -0
  275. package/dist/esm/__tests__/testclient.js +35 -0
  276. package/dist/esm/__tests__/testclient.js.map +1 -0
  277. package/dist/esm/core.d.ts +10 -0
  278. package/dist/esm/core.d.ts.map +1 -0
  279. package/dist/esm/core.js +13 -0
  280. package/dist/esm/core.js.map +1 -0
  281. package/dist/esm/funcs/diagGetHealthInfo.d.ts +15 -0
  282. package/dist/esm/funcs/diagGetHealthInfo.d.ts.map +1 -0
  283. package/dist/esm/funcs/diagGetHealthInfo.js +64 -0
  284. package/dist/esm/funcs/diagGetHealthInfo.js.map +1 -0
  285. package/dist/esm/hooks/hooks.d.ts +25 -0
  286. package/dist/esm/hooks/hooks.d.ts.map +1 -0
  287. package/dist/esm/hooks/hooks.js +82 -0
  288. package/dist/esm/hooks/hooks.js.map +1 -0
  289. package/dist/esm/hooks/index.d.ts +3 -0
  290. package/dist/esm/hooks/index.d.ts.map +1 -0
  291. package/dist/esm/hooks/index.js +6 -0
  292. package/dist/esm/hooks/index.js.map +1 -0
  293. package/dist/esm/hooks/registration.d.ts +3 -0
  294. package/dist/esm/hooks/registration.d.ts.map +1 -0
  295. package/dist/esm/hooks/registration.js +12 -0
  296. package/dist/esm/hooks/registration.js.map +1 -0
  297. package/dist/esm/hooks/types.d.ts +76 -0
  298. package/dist/esm/hooks/types.d.ts.map +1 -0
  299. package/dist/esm/hooks/types.js +5 -0
  300. package/dist/esm/hooks/types.js.map +1 -0
  301. package/dist/esm/index.d.ts +6 -0
  302. package/dist/esm/index.d.ts.map +1 -0
  303. package/dist/esm/index.js +8 -0
  304. package/dist/esm/index.js.map +1 -0
  305. package/dist/esm/lib/base64.d.ts +10 -0
  306. package/dist/esm/lib/base64.d.ts.map +1 -0
  307. package/dist/esm/lib/base64.js +29 -0
  308. package/dist/esm/lib/base64.js.map +1 -0
  309. package/dist/esm/lib/config.d.ts +38 -0
  310. package/dist/esm/lib/config.d.ts.map +1 -0
  311. package/dist/esm/lib/config.js +31 -0
  312. package/dist/esm/lib/config.js.map +1 -0
  313. package/dist/esm/lib/dlv.d.ts +14 -0
  314. package/dist/esm/lib/dlv.d.ts.map +1 -0
  315. package/dist/esm/lib/dlv.js +46 -0
  316. package/dist/esm/lib/dlv.js.map +1 -0
  317. package/dist/esm/lib/encodings.d.ts +52 -0
  318. package/dist/esm/lib/encodings.d.ts.map +1 -0
  319. package/dist/esm/lib/encodings.js +354 -0
  320. package/dist/esm/lib/encodings.js.map +1 -0
  321. package/dist/esm/lib/env.d.ts +15 -0
  322. package/dist/esm/lib/env.d.ts.map +1 -0
  323. package/dist/esm/lib/env.js +27 -0
  324. package/dist/esm/lib/env.js.map +1 -0
  325. package/dist/esm/lib/files.d.ts +13 -0
  326. package/dist/esm/lib/files.d.ts.map +1 -0
  327. package/dist/esm/lib/files.js +73 -0
  328. package/dist/esm/lib/files.js.map +1 -0
  329. package/dist/esm/lib/http.d.ts +67 -0
  330. package/dist/esm/lib/http.d.ts.map +1 -0
  331. package/dist/esm/lib/http.js +207 -0
  332. package/dist/esm/lib/http.js.map +1 -0
  333. package/dist/esm/lib/is-plain-object.d.ts +2 -0
  334. package/dist/esm/lib/is-plain-object.d.ts.map +1 -0
  335. package/dist/esm/lib/is-plain-object.js +38 -0
  336. package/dist/esm/lib/is-plain-object.js.map +1 -0
  337. package/dist/esm/lib/logger.d.ts +6 -0
  338. package/dist/esm/lib/logger.d.ts.map +1 -0
  339. package/dist/esm/lib/logger.js +5 -0
  340. package/dist/esm/lib/logger.js.map +1 -0
  341. package/dist/esm/lib/matchers.d.ts +59 -0
  342. package/dist/esm/lib/matchers.d.ts.map +1 -0
  343. package/dist/esm/lib/matchers.js +203 -0
  344. package/dist/esm/lib/matchers.js.map +1 -0
  345. package/dist/esm/lib/primitives.d.ts +26 -0
  346. package/dist/esm/lib/primitives.d.ts.map +1 -0
  347. package/dist/esm/lib/primitives.js +103 -0
  348. package/dist/esm/lib/primitives.js.map +1 -0
  349. package/dist/esm/lib/retries.d.ts +38 -0
  350. package/dist/esm/lib/retries.d.ts.map +1 -0
  351. package/dist/esm/lib/retries.js +147 -0
  352. package/dist/esm/lib/retries.js.map +1 -0
  353. package/dist/esm/lib/schemas.d.ts +19 -0
  354. package/dist/esm/lib/schemas.d.ts.map +1 -0
  355. package/dist/esm/lib/schemas.js +57 -0
  356. package/dist/esm/lib/schemas.js.map +1 -0
  357. package/dist/esm/lib/sdks.d.ts +63 -0
  358. package/dist/esm/lib/sdks.d.ts.map +1 -0
  359. package/dist/esm/lib/sdks.js +269 -0
  360. package/dist/esm/lib/sdks.js.map +1 -0
  361. package/dist/esm/lib/security.d.ts +83 -0
  362. package/dist/esm/lib/security.d.ts.map +1 -0
  363. package/dist/esm/lib/security.js +137 -0
  364. package/dist/esm/lib/security.js.map +1 -0
  365. package/dist/esm/lib/url.d.ts +5 -0
  366. package/dist/esm/lib/url.d.ts.map +1 -0
  367. package/dist/esm/lib/url.js +22 -0
  368. package/dist/esm/lib/url.js.map +1 -0
  369. package/dist/esm/mcp-server/build.d.mts.map +1 -0
  370. package/dist/esm/mcp-server/build.mjs +14 -0
  371. package/dist/esm/mcp-server/build.mjs.map +1 -0
  372. package/dist/esm/mcp-server/cli/start/command.d.ts +2 -0
  373. package/dist/esm/mcp-server/cli/start/command.d.ts.map +1 -0
  374. package/dist/esm/mcp-server/cli/start/command.js +90 -0
  375. package/dist/esm/mcp-server/cli/start/command.js.map +1 -0
  376. package/dist/esm/mcp-server/cli/start/impl.d.ts +16 -0
  377. package/dist/esm/mcp-server/cli/start/impl.d.ts.map +1 -0
  378. package/dist/esm/mcp-server/cli/start/impl.js +96 -0
  379. package/dist/esm/mcp-server/cli/start/impl.js.map +1 -0
  380. package/dist/esm/mcp-server/cli.d.ts +6 -0
  381. package/dist/esm/mcp-server/cli.d.ts.map +1 -0
  382. package/dist/esm/mcp-server/cli.js +7 -0
  383. package/dist/esm/mcp-server/cli.js.map +1 -0
  384. package/dist/esm/mcp-server/console-logger.d.ts +7 -0
  385. package/dist/esm/mcp-server/console-logger.d.ts.map +1 -0
  386. package/dist/esm/mcp-server/console-logger.js +55 -0
  387. package/dist/esm/mcp-server/console-logger.js.map +1 -0
  388. package/dist/esm/mcp-server/extensions.d.ts +11 -0
  389. package/dist/esm/mcp-server/extensions.d.ts.map +1 -0
  390. package/dist/esm/mcp-server/extensions.js +5 -0
  391. package/dist/esm/mcp-server/extensions.js.map +1 -0
  392. package/dist/esm/mcp-server/mcp-server.d.ts +2 -0
  393. package/dist/esm/mcp-server/mcp-server.d.ts.map +1 -0
  394. package/dist/esm/mcp-server/mcp-server.js +23 -0
  395. package/dist/esm/mcp-server/mcp-server.js.map +1 -0
  396. package/dist/esm/mcp-server/prompts.d.ts +26 -0
  397. package/dist/esm/mcp-server/prompts.d.ts.map +1 -0
  398. package/dist/esm/mcp-server/prompts.js +47 -0
  399. package/dist/esm/mcp-server/prompts.js.map +1 -0
  400. package/dist/esm/mcp-server/resources.d.ts +32 -0
  401. package/dist/esm/mcp-server/resources.d.ts.map +1 -0
  402. package/dist/esm/mcp-server/resources.js +82 -0
  403. package/dist/esm/mcp-server/resources.js.map +1 -0
  404. package/dist/esm/mcp-server/scopes.d.ts +3 -0
  405. package/dist/esm/mcp-server/scopes.d.ts.map +1 -0
  406. package/dist/esm/mcp-server/scopes.js +5 -0
  407. package/dist/esm/mcp-server/scopes.js.map +1 -0
  408. package/dist/esm/mcp-server/server.d.ts +13 -0
  409. package/dist/esm/mcp-server/server.d.ts.map +1 -0
  410. package/dist/esm/mcp-server/server.js +31 -0
  411. package/dist/esm/mcp-server/server.js.map +1 -0
  412. package/dist/esm/mcp-server/shared.d.ts +7 -0
  413. package/dist/esm/mcp-server/shared.d.ts.map +1 -0
  414. package/dist/esm/mcp-server/shared.js +59 -0
  415. package/dist/esm/mcp-server/shared.js.map +1 -0
  416. package/dist/esm/mcp-server/tools/diagGetHealthInfo.d.ts +3 -0
  417. package/dist/esm/mcp-server/tools/diagGetHealthInfo.d.ts.map +1 -0
  418. package/dist/esm/mcp-server/tools/diagGetHealthInfo.js +21 -0
  419. package/dist/esm/mcp-server/tools/diagGetHealthInfo.js.map +1 -0
  420. package/dist/esm/mcp-server/tools.d.ts +25 -0
  421. package/dist/esm/mcp-server/tools.d.ts.map +1 -0
  422. package/dist/esm/mcp-server/tools.js +78 -0
  423. package/dist/esm/mcp-server/tools.js.map +1 -0
  424. package/dist/esm/models/errors/criblcontrolplanedefaulterror.d.ts +10 -0
  425. package/dist/esm/models/errors/criblcontrolplanedefaulterror.d.ts.map +1 -0
  426. package/dist/esm/models/errors/criblcontrolplanedefaulterror.js +30 -0
  427. package/dist/esm/models/errors/criblcontrolplanedefaulterror.js.map +1 -0
  428. package/dist/esm/models/errors/criblcontrolplaneerror.d.ts +19 -0
  429. package/dist/esm/models/errors/criblcontrolplaneerror.d.ts.map +1 -0
  430. package/dist/esm/models/errors/criblcontrolplaneerror.js +16 -0
  431. package/dist/esm/models/errors/criblcontrolplaneerror.js.map +1 -0
  432. package/dist/esm/models/errors/healthstatuserror.d.ts +43 -0
  433. package/dist/esm/models/errors/healthstatuserror.d.ts.map +1 -0
  434. package/dist/esm/models/errors/healthstatuserror.js +56 -0
  435. package/dist/esm/models/errors/healthstatuserror.js.map +1 -0
  436. package/dist/esm/models/errors/httpclienterrors.d.ts +44 -0
  437. package/dist/esm/models/errors/httpclienterrors.d.ts.map +1 -0
  438. package/dist/esm/models/errors/httpclienterrors.js +69 -0
  439. package/dist/esm/models/errors/httpclienterrors.js.map +1 -0
  440. package/dist/esm/models/errors/index.d.ts +6 -0
  441. package/dist/esm/models/errors/index.d.ts.map +1 -0
  442. package/dist/esm/models/errors/index.js +9 -0
  443. package/dist/esm/models/errors/index.js.map +1 -0
  444. package/dist/esm/models/errors/responsevalidationerror.d.ts +26 -0
  445. package/dist/esm/models/errors/responsevalidationerror.d.ts.map +1 -0
  446. package/dist/esm/models/errors/responsevalidationerror.js +29 -0
  447. package/dist/esm/models/errors/responsevalidationerror.js.map +1 -0
  448. package/dist/esm/models/errors/sdkvalidationerror.d.ts +21 -0
  449. package/dist/esm/models/errors/sdkvalidationerror.d.ts.map +1 -0
  450. package/dist/esm/models/errors/sdkvalidationerror.js +91 -0
  451. package/dist/esm/models/errors/sdkvalidationerror.js.map +1 -0
  452. package/dist/esm/models/healthstatus.d.ts +87 -0
  453. package/dist/esm/models/healthstatus.d.ts.map +1 -0
  454. package/dist/esm/models/healthstatus.js +75 -0
  455. package/dist/esm/models/healthstatus.js.map +1 -0
  456. package/dist/esm/models/index.d.ts +3 -0
  457. package/dist/esm/models/index.d.ts.map +1 -0
  458. package/dist/esm/models/index.js +6 -0
  459. package/dist/esm/models/index.js.map +1 -0
  460. package/dist/esm/models/security.d.ts +29 -0
  461. package/dist/esm/models/security.d.ts.map +1 -0
  462. package/dist/esm/models/security.js +31 -0
  463. package/dist/esm/models/security.js.map +1 -0
  464. package/dist/esm/package.json +3 -0
  465. package/dist/esm/sdk/diag.d.ts +9 -0
  466. package/dist/esm/sdk/diag.d.ts.map +1 -0
  467. package/dist/esm/sdk/diag.js +15 -0
  468. package/dist/esm/sdk/diag.js.map +1 -0
  469. package/dist/esm/sdk/health.d.ts +9 -0
  470. package/dist/esm/sdk/health.d.ts.map +1 -0
  471. package/dist/esm/sdk/health.js +15 -0
  472. package/dist/esm/sdk/health.js.map +1 -0
  473. package/dist/esm/sdk/index.d.ts +2 -0
  474. package/dist/esm/sdk/index.d.ts.map +1 -0
  475. package/dist/esm/sdk/index.js +5 -0
  476. package/dist/esm/sdk/index.js.map +1 -0
  477. package/dist/esm/sdk/sdk.d.ts +10 -0
  478. package/dist/esm/sdk/sdk.d.ts.map +1 -0
  479. package/dist/esm/sdk/sdk.js +15 -0
  480. package/dist/esm/sdk/sdk.js.map +1 -0
  481. package/dist/esm/types/async.d.ts +23 -0
  482. package/dist/esm/types/async.d.ts.map +1 -0
  483. package/dist/esm/types/async.js +40 -0
  484. package/dist/esm/types/async.js.map +1 -0
  485. package/dist/esm/types/blobs.d.ts +4 -0
  486. package/dist/esm/types/blobs.d.ts.map +1 -0
  487. package/dist/esm/types/blobs.js +25 -0
  488. package/dist/esm/types/blobs.js.map +1 -0
  489. package/dist/esm/types/constdatetime.d.ts +3 -0
  490. package/dist/esm/types/constdatetime.d.ts.map +1 -0
  491. package/dist/esm/types/constdatetime.js +10 -0
  492. package/dist/esm/types/constdatetime.js.map +1 -0
  493. package/dist/esm/types/enums.d.ts +12 -0
  494. package/dist/esm/types/enums.d.ts.map +1 -0
  495. package/dist/esm/types/enums.js +7 -0
  496. package/dist/esm/types/enums.js.map +1 -0
  497. package/dist/esm/types/fp.d.ts +31 -0
  498. package/dist/esm/types/fp.d.ts.map +1 -0
  499. package/dist/esm/types/fp.js +31 -0
  500. package/dist/esm/types/fp.js.map +1 -0
  501. package/dist/esm/types/index.d.ts +8 -0
  502. package/dist/esm/types/index.d.ts.map +1 -0
  503. package/dist/esm/types/index.js +8 -0
  504. package/dist/esm/types/index.js.map +1 -0
  505. package/dist/esm/types/operations.d.ts +27 -0
  506. package/dist/esm/types/operations.d.ts.map +1 -0
  507. package/dist/esm/types/operations.js +77 -0
  508. package/dist/esm/types/operations.js.map +1 -0
  509. package/dist/esm/types/rfcdate.d.ts +21 -0
  510. package/dist/esm/types/rfcdate.d.ts.map +1 -0
  511. package/dist/esm/types/rfcdate.js +42 -0
  512. package/dist/esm/types/rfcdate.js.map +1 -0
  513. package/dist/esm/types/streams.d.ts +2 -0
  514. package/dist/esm/types/streams.d.ts.map +1 -0
  515. package/dist/esm/types/streams.js +15 -0
  516. package/dist/esm/types/streams.js.map +1 -0
  517. package/docs/sdks/criblcontrolplane/README.md +7 -0
  518. package/docs/sdks/diag/README.md +78 -0
  519. package/docs/sdks/health/README.md +78 -0
  520. package/examples/README.md +26 -0
  521. package/examples/diagGetHealthInfo.example.ts +24 -0
  522. package/examples/package-lock.json +629 -0
  523. package/examples/package.json +18 -0
  524. package/jsr.json +27 -0
  525. package/package.json +131 -0
  526. package/src/__tests__/assertions.ts +13 -0
  527. package/src/__tests__/diag.test.ts +23 -0
  528. package/src/__tests__/files.ts +56 -0
  529. package/src/__tests__/mockserver/README.md +52 -0
  530. package/src/__tests__/testclient.ts +48 -0
  531. package/src/core.ts +13 -0
  532. package/src/funcs/diagGetHealthInfo.ts +142 -0
  533. package/src/hooks/hooks.ts +132 -0
  534. package/src/hooks/index.ts +6 -0
  535. package/src/hooks/registration.ts +14 -0
  536. package/src/hooks/types.ts +107 -0
  537. package/src/index.ts +9 -0
  538. package/src/lib/base64.ts +37 -0
  539. package/src/lib/config.ts +65 -0
  540. package/src/lib/dlv.ts +53 -0
  541. package/src/lib/encodings.ts +483 -0
  542. package/src/lib/env.ts +41 -0
  543. package/src/lib/files.ts +82 -0
  544. package/src/lib/http.ts +323 -0
  545. package/src/lib/is-plain-object.ts +43 -0
  546. package/src/lib/logger.ts +9 -0
  547. package/src/lib/matchers.ts +358 -0
  548. package/src/lib/primitives.ts +150 -0
  549. package/src/lib/retries.ts +218 -0
  550. package/src/lib/schemas.ts +91 -0
  551. package/src/lib/sdks.ts +406 -0
  552. package/src/lib/security.ts +261 -0
  553. package/src/lib/url.ts +33 -0
  554. package/src/mcp-server/cli/start/command.ts +94 -0
  555. package/src/mcp-server/cli/start/impl.ts +130 -0
  556. package/src/mcp-server/cli.ts +13 -0
  557. package/src/mcp-server/console-logger.ts +71 -0
  558. package/src/mcp-server/extensions.ts +17 -0
  559. package/src/mcp-server/mcp-server.ts +26 -0
  560. package/src/mcp-server/prompts.ts +117 -0
  561. package/src/mcp-server/resources.ts +172 -0
  562. package/src/mcp-server/scopes.ts +7 -0
  563. package/src/mcp-server/server.ts +61 -0
  564. package/src/mcp-server/shared.ts +75 -0
  565. package/src/mcp-server/tools/diagGetHealthInfo.ts +28 -0
  566. package/src/mcp-server/tools.ts +129 -0
  567. package/src/models/errors/criblcontrolplanedefaulterror.ts +40 -0
  568. package/src/models/errors/criblcontrolplaneerror.ts +35 -0
  569. package/src/models/errors/healthstatuserror.ts +92 -0
  570. package/src/models/errors/httpclienterrors.ts +62 -0
  571. package/src/models/errors/index.ts +9 -0
  572. package/src/models/errors/responsevalidationerror.ts +50 -0
  573. package/src/models/errors/sdkvalidationerror.ts +109 -0
  574. package/src/models/healthstatus.ts +123 -0
  575. package/src/models/index.ts +6 -0
  576. package/src/models/security.ts +62 -0
  577. package/src/sdk/diag.ts +22 -0
  578. package/src/sdk/health.ts +22 -0
  579. package/src/sdk/index.ts +5 -0
  580. package/src/sdk/sdk.ts +19 -0
  581. package/src/types/async.ts +68 -0
  582. package/src/types/blobs.ts +31 -0
  583. package/src/types/constdatetime.ts +15 -0
  584. package/src/types/enums.ts +16 -0
  585. package/src/types/fp.ts +50 -0
  586. package/src/types/index.ts +11 -0
  587. package/src/types/operations.ts +105 -0
  588. package/src/types/rfcdate.ts +54 -0
  589. package/src/types/streams.ts +21 -0
  590. package/tsconfig.json +41 -0
@@ -0,0 +1,92 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import * as models from "../index.js";
7
+ import { CriblControlPlaneError } from "./criblcontrolplaneerror.js";
8
+
9
+ export type HealthStatusErrorData = {
10
+ role?: models.Role | undefined;
11
+ status: models.Status;
12
+ startTime: number;
13
+ };
14
+
15
+ export class HealthStatusError extends CriblControlPlaneError {
16
+ role?: models.Role | undefined;
17
+ status: models.Status;
18
+ startTime: number;
19
+
20
+ /** The original data that was passed to this error instance. */
21
+ data$: HealthStatusErrorData;
22
+
23
+ constructor(
24
+ err: HealthStatusErrorData,
25
+ httpMeta: { response: Response; request: Request; body: string },
26
+ ) {
27
+ const message = "message" in err && typeof err.message === "string"
28
+ ? err.message
29
+ : `API error occurred: ${JSON.stringify(err)}`;
30
+ super(message, httpMeta);
31
+ this.data$ = err;
32
+ if (err.role != null) this.role = err.role;
33
+ this.status = err.status;
34
+ this.startTime = err.startTime;
35
+
36
+ this.name = "HealthStatusError";
37
+ }
38
+ }
39
+
40
+ /** @internal */
41
+ export const HealthStatusError$inboundSchema: z.ZodType<
42
+ HealthStatusError,
43
+ z.ZodTypeDef,
44
+ unknown
45
+ > = z.object({
46
+ role: models.Role$inboundSchema.optional(),
47
+ status: models.Status$inboundSchema,
48
+ startTime: z.number(),
49
+ request$: z.instanceof(Request),
50
+ response$: z.instanceof(Response),
51
+ body$: z.string(),
52
+ })
53
+ .transform((v) => {
54
+ return new HealthStatusError(v, {
55
+ request: v.request$,
56
+ response: v.response$,
57
+ body: v.body$,
58
+ });
59
+ });
60
+
61
+ /** @internal */
62
+ export type HealthStatusError$Outbound = {
63
+ role?: string | undefined;
64
+ status: string;
65
+ startTime: number;
66
+ };
67
+
68
+ /** @internal */
69
+ export const HealthStatusError$outboundSchema: z.ZodType<
70
+ HealthStatusError$Outbound,
71
+ z.ZodTypeDef,
72
+ HealthStatusError
73
+ > = z.instanceof(HealthStatusError)
74
+ .transform(v => v.data$)
75
+ .pipe(z.object({
76
+ role: models.Role$outboundSchema.optional(),
77
+ status: models.Status$outboundSchema,
78
+ startTime: z.number(),
79
+ }));
80
+
81
+ /**
82
+ * @internal
83
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
84
+ */
85
+ export namespace HealthStatusError$ {
86
+ /** @deprecated use `HealthStatusError$inboundSchema` instead. */
87
+ export const inboundSchema = HealthStatusError$inboundSchema;
88
+ /** @deprecated use `HealthStatusError$outboundSchema` instead. */
89
+ export const outboundSchema = HealthStatusError$outboundSchema;
90
+ /** @deprecated use `HealthStatusError$Outbound` instead. */
91
+ export type Outbound = HealthStatusError$Outbound;
92
+ }
@@ -0,0 +1,62 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ /**
6
+ * Base class for all HTTP errors.
7
+ */
8
+ export class HTTPClientError extends Error {
9
+ /** The underlying cause of the error. */
10
+ override readonly cause: unknown;
11
+ override name = "HTTPClientError";
12
+ constructor(message: string, opts?: { cause?: unknown }) {
13
+ let msg = message;
14
+ if (opts?.cause) {
15
+ msg += `: ${opts.cause}`;
16
+ }
17
+
18
+ super(msg, opts);
19
+ // In older runtimes, the cause field would not have been assigned through
20
+ // the super() call.
21
+ if (typeof this.cause === "undefined") {
22
+ this.cause = opts?.cause;
23
+ }
24
+ }
25
+ }
26
+
27
+ /**
28
+ * An error to capture unrecognised or unexpected errors when making HTTP calls.
29
+ */
30
+ export class UnexpectedClientError extends HTTPClientError {
31
+ override name = "UnexpectedClientError";
32
+ }
33
+
34
+ /**
35
+ * An error that is raised when any inputs used to create a request are invalid.
36
+ */
37
+ export class InvalidRequestError extends HTTPClientError {
38
+ override name = "InvalidRequestError";
39
+ }
40
+
41
+ /**
42
+ * An error that is raised when a HTTP request was aborted by the client error.
43
+ */
44
+ export class RequestAbortedError extends HTTPClientError {
45
+ override readonly name = "RequestAbortedError";
46
+ }
47
+
48
+ /**
49
+ * An error that is raised when a HTTP request timed out due to an AbortSignal
50
+ * signal timeout.
51
+ */
52
+ export class RequestTimeoutError extends HTTPClientError {
53
+ override readonly name = "RequestTimeoutError";
54
+ }
55
+
56
+ /**
57
+ * An error that is raised when a HTTP client is unable to make a request to
58
+ * a server.
59
+ */
60
+ export class ConnectionError extends HTTPClientError {
61
+ override readonly name = "ConnectionError";
62
+ }
@@ -0,0 +1,9 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ export * from "./criblcontrolplanedefaulterror.js";
6
+ export * from "./healthstatuserror.js";
7
+ export * from "./httpclienterrors.js";
8
+ export * from "./responsevalidationerror.js";
9
+ export * from "./sdkvalidationerror.js";
@@ -0,0 +1,50 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { CriblControlPlaneError } from "./criblcontrolplaneerror.js";
7
+ import { formatZodError } from "./sdkvalidationerror.js";
8
+
9
+ export class ResponseValidationError extends CriblControlPlaneError {
10
+ /**
11
+ * The raw value that failed validation.
12
+ */
13
+ public readonly rawValue: unknown;
14
+
15
+ /**
16
+ * The raw message that failed validation.
17
+ */
18
+ public readonly rawMessage: unknown;
19
+
20
+ constructor(
21
+ message: string,
22
+ extra: {
23
+ response: Response;
24
+ request: Request;
25
+ body: string;
26
+ cause: unknown;
27
+ rawValue: unknown;
28
+ rawMessage: unknown;
29
+ },
30
+ ) {
31
+ super(message, extra);
32
+ this.name = "ResponseValidationError";
33
+ this.cause = extra.cause;
34
+ this.rawValue = extra.rawValue;
35
+ this.rawMessage = extra.rawMessage;
36
+ }
37
+
38
+ /**
39
+ * Return a pretty-formatted error message if the underlying validation error
40
+ * is a ZodError or some other recognized error type, otherwise return the
41
+ * default error message.
42
+ */
43
+ public pretty(): string {
44
+ if (this.cause instanceof z.ZodError) {
45
+ return `${this.rawMessage}\n${formatZodError(this.cause)}`;
46
+ } else {
47
+ return this.toString();
48
+ }
49
+ }
50
+ }
@@ -0,0 +1,109 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+
7
+ export class SDKValidationError extends Error {
8
+ /**
9
+ * The raw value that failed validation.
10
+ */
11
+ public readonly rawValue: unknown;
12
+
13
+ /**
14
+ * The raw message that failed validation.
15
+ */
16
+ public readonly rawMessage: unknown;
17
+
18
+ // Allows for backwards compatibility for `instanceof` checks of `ResponseValidationError`
19
+ static override [Symbol.hasInstance](
20
+ instance: unknown,
21
+ ): instance is SDKValidationError {
22
+ if (!(instance instanceof Error)) return false;
23
+ if (!("rawValue" in instance)) return false;
24
+ if (!("rawMessage" in instance)) return false;
25
+ if (!("pretty" in instance)) return false;
26
+ if (typeof instance.pretty !== "function") return false;
27
+ return true;
28
+ }
29
+
30
+ constructor(message: string, cause: unknown, rawValue: unknown) {
31
+ super(`${message}: ${cause}`);
32
+ this.name = "SDKValidationError";
33
+ this.cause = cause;
34
+ this.rawValue = rawValue;
35
+ this.rawMessage = message;
36
+ }
37
+
38
+ /**
39
+ * Return a pretty-formatted error message if the underlying validation error
40
+ * is a ZodError or some other recognized error type, otherwise return the
41
+ * default error message.
42
+ */
43
+ public pretty(): string {
44
+ if (this.cause instanceof z.ZodError) {
45
+ return `${this.rawMessage}\n${formatZodError(this.cause)}`;
46
+ } else {
47
+ return this.toString();
48
+ }
49
+ }
50
+ }
51
+
52
+ export function formatZodError(err: z.ZodError, level = 0): string {
53
+ let pre = " ".repeat(level);
54
+ pre = level > 0 ? `│${pre}` : pre;
55
+ pre += " ".repeat(level);
56
+
57
+ let message = "";
58
+ const append = (str: string) => (message += `\n${pre}${str}`);
59
+
60
+ const len = err.issues.length;
61
+ const headline = len === 1 ? `${len} issue found` : `${len} issues found`;
62
+
63
+ if (len) {
64
+ append(`┌ ${headline}:`);
65
+ }
66
+
67
+ for (const issue of err.issues) {
68
+ let path = issue.path.join(".");
69
+ path = path ? `<root>.${path}` : "<root>";
70
+ append(`│ • [${path}]: ${issue.message} (${issue.code})`);
71
+ switch (issue.code) {
72
+ case "invalid_literal":
73
+ case "invalid_type": {
74
+ append(`│ Want: ${issue.expected}`);
75
+ append(`│ Got: ${issue.received}`);
76
+ break;
77
+ }
78
+ case "unrecognized_keys": {
79
+ append(`│ Keys: ${issue.keys.join(", ")}`);
80
+ break;
81
+ }
82
+ case "invalid_enum_value": {
83
+ append(`│ Allowed: ${issue.options.join(", ")}`);
84
+ append(`│ Got: ${issue.received}`);
85
+ break;
86
+ }
87
+ case "invalid_union_discriminator": {
88
+ append(`│ Allowed: ${issue.options.join(", ")}`);
89
+ break;
90
+ }
91
+ case "invalid_union": {
92
+ const len = issue.unionErrors.length;
93
+ append(
94
+ `│ ✖︎ Attemped to deserialize into one of ${len} union members:`,
95
+ );
96
+ issue.unionErrors.forEach((err, i) => {
97
+ append(`│ ✖︎ Member ${i + 1} of ${len}`);
98
+ append(`${formatZodError(err, level + 1)}`);
99
+ });
100
+ }
101
+ }
102
+ }
103
+
104
+ if (err.issues.length) {
105
+ append(`└─*`);
106
+ }
107
+
108
+ return message.slice(1);
109
+ }
@@ -0,0 +1,123 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../lib/schemas.js";
7
+ import { ClosedEnum } from "../types/enums.js";
8
+ import { Result as SafeParseResult } from "../types/fp.js";
9
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
10
+
11
+ export const Role = {
12
+ Primary: "primary",
13
+ Standby: "standby",
14
+ } as const;
15
+ export type Role = ClosedEnum<typeof Role>;
16
+
17
+ export const Status = {
18
+ Healthy: "healthy",
19
+ ShuttingDown: "shutting down",
20
+ Standby: "standby",
21
+ } as const;
22
+ export type Status = ClosedEnum<typeof Status>;
23
+
24
+ export type HealthStatus = {
25
+ role?: Role | undefined;
26
+ status: Status;
27
+ startTime: number;
28
+ };
29
+
30
+ /** @internal */
31
+ export const Role$inboundSchema: z.ZodNativeEnum<typeof Role> = z.nativeEnum(
32
+ Role,
33
+ );
34
+
35
+ /** @internal */
36
+ export const Role$outboundSchema: z.ZodNativeEnum<typeof Role> =
37
+ Role$inboundSchema;
38
+
39
+ /**
40
+ * @internal
41
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
42
+ */
43
+ export namespace Role$ {
44
+ /** @deprecated use `Role$inboundSchema` instead. */
45
+ export const inboundSchema = Role$inboundSchema;
46
+ /** @deprecated use `Role$outboundSchema` instead. */
47
+ export const outboundSchema = Role$outboundSchema;
48
+ }
49
+
50
+ /** @internal */
51
+ export const Status$inboundSchema: z.ZodNativeEnum<typeof Status> = z
52
+ .nativeEnum(Status);
53
+
54
+ /** @internal */
55
+ export const Status$outboundSchema: z.ZodNativeEnum<typeof Status> =
56
+ Status$inboundSchema;
57
+
58
+ /**
59
+ * @internal
60
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
61
+ */
62
+ export namespace Status$ {
63
+ /** @deprecated use `Status$inboundSchema` instead. */
64
+ export const inboundSchema = Status$inboundSchema;
65
+ /** @deprecated use `Status$outboundSchema` instead. */
66
+ export const outboundSchema = Status$outboundSchema;
67
+ }
68
+
69
+ /** @internal */
70
+ export const HealthStatus$inboundSchema: z.ZodType<
71
+ HealthStatus,
72
+ z.ZodTypeDef,
73
+ unknown
74
+ > = z.object({
75
+ role: Role$inboundSchema.optional(),
76
+ status: Status$inboundSchema,
77
+ startTime: z.number(),
78
+ });
79
+
80
+ /** @internal */
81
+ export type HealthStatus$Outbound = {
82
+ role?: string | undefined;
83
+ status: string;
84
+ startTime: number;
85
+ };
86
+
87
+ /** @internal */
88
+ export const HealthStatus$outboundSchema: z.ZodType<
89
+ HealthStatus$Outbound,
90
+ z.ZodTypeDef,
91
+ HealthStatus
92
+ > = z.object({
93
+ role: Role$outboundSchema.optional(),
94
+ status: Status$outboundSchema,
95
+ startTime: z.number(),
96
+ });
97
+
98
+ /**
99
+ * @internal
100
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
101
+ */
102
+ export namespace HealthStatus$ {
103
+ /** @deprecated use `HealthStatus$inboundSchema` instead. */
104
+ export const inboundSchema = HealthStatus$inboundSchema;
105
+ /** @deprecated use `HealthStatus$outboundSchema` instead. */
106
+ export const outboundSchema = HealthStatus$outboundSchema;
107
+ /** @deprecated use `HealthStatus$Outbound` instead. */
108
+ export type Outbound = HealthStatus$Outbound;
109
+ }
110
+
111
+ export function healthStatusToJSON(healthStatus: HealthStatus): string {
112
+ return JSON.stringify(HealthStatus$outboundSchema.parse(healthStatus));
113
+ }
114
+
115
+ export function healthStatusFromJSON(
116
+ jsonString: string,
117
+ ): SafeParseResult<HealthStatus, SDKValidationError> {
118
+ return safeParse(
119
+ jsonString,
120
+ (x) => HealthStatus$inboundSchema.parse(JSON.parse(x)),
121
+ `Failed to parse 'HealthStatus' from JSON`,
122
+ );
123
+ }
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ export * from "./healthstatus.js";
6
+ export * from "./security.js";
@@ -0,0 +1,62 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../types/fp.js";
8
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
9
+
10
+ export type Security = {
11
+ bearerAuth?: string | undefined;
12
+ };
13
+
14
+ /** @internal */
15
+ export const Security$inboundSchema: z.ZodType<
16
+ Security,
17
+ z.ZodTypeDef,
18
+ unknown
19
+ > = z.object({
20
+ bearerAuth: z.string().optional(),
21
+ });
22
+
23
+ /** @internal */
24
+ export type Security$Outbound = {
25
+ bearerAuth?: string | undefined;
26
+ };
27
+
28
+ /** @internal */
29
+ export const Security$outboundSchema: z.ZodType<
30
+ Security$Outbound,
31
+ z.ZodTypeDef,
32
+ Security
33
+ > = z.object({
34
+ bearerAuth: z.string().optional(),
35
+ });
36
+
37
+ /**
38
+ * @internal
39
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
40
+ */
41
+ export namespace Security$ {
42
+ /** @deprecated use `Security$inboundSchema` instead. */
43
+ export const inboundSchema = Security$inboundSchema;
44
+ /** @deprecated use `Security$outboundSchema` instead. */
45
+ export const outboundSchema = Security$outboundSchema;
46
+ /** @deprecated use `Security$Outbound` instead. */
47
+ export type Outbound = Security$Outbound;
48
+ }
49
+
50
+ export function securityToJSON(security: Security): string {
51
+ return JSON.stringify(Security$outboundSchema.parse(security));
52
+ }
53
+
54
+ export function securityFromJSON(
55
+ jsonString: string,
56
+ ): SafeParseResult<Security, SDKValidationError> {
57
+ return safeParse(
58
+ jsonString,
59
+ (x) => Security$inboundSchema.parse(JSON.parse(x)),
60
+ `Failed to parse 'Security' from JSON`,
61
+ );
62
+ }
@@ -0,0 +1,22 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { diagGetHealthInfo } from "../funcs/diagGetHealthInfo.js";
6
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
7
+ import * as models from "../models/index.js";
8
+ import { unwrapAsync } from "../types/fp.js";
9
+
10
+ export class Diag extends ClientSDK {
11
+ /**
12
+ * Provides health info for REST server
13
+ */
14
+ async getHealthInfo(
15
+ options?: RequestOptions,
16
+ ): Promise<models.HealthStatus> {
17
+ return unwrapAsync(diagGetHealthInfo(
18
+ this,
19
+ options,
20
+ ));
21
+ }
22
+ }
@@ -0,0 +1,22 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { diagGetHealthInfo } from "../funcs/diagGetHealthInfo.js";
6
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
7
+ import * as models from "../models/index.js";
8
+ import { unwrapAsync } from "../types/fp.js";
9
+
10
+ export class Health extends ClientSDK {
11
+ /**
12
+ * Provides health info for REST server
13
+ */
14
+ async getHealthInfo(
15
+ options?: RequestOptions,
16
+ ): Promise<models.HealthStatus> {
17
+ return unwrapAsync(diagGetHealthInfo(
18
+ this,
19
+ options,
20
+ ));
21
+ }
22
+ }
@@ -0,0 +1,5 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ export * from "./sdk.js";
package/src/sdk/sdk.ts ADDED
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { ClientSDK } from "../lib/sdks.js";
6
+ import { Diag } from "./diag.js";
7
+ import { Health } from "./health.js";
8
+
9
+ export class CriblControlPlane extends ClientSDK {
10
+ private _diag?: Diag;
11
+ get diag(): Diag {
12
+ return (this._diag ??= new Diag(this._options));
13
+ }
14
+
15
+ private _health?: Health;
16
+ get health(): Health {
17
+ return (this._health ??= new Health(this._options));
18
+ }
19
+ }
@@ -0,0 +1,68 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ export type APICall =
6
+ | {
7
+ status: "complete";
8
+ request: Request;
9
+ response: Response;
10
+ }
11
+ | {
12
+ status: "request-error";
13
+ request: Request;
14
+ response?: undefined;
15
+ }
16
+ | {
17
+ status: "invalid";
18
+ request?: undefined;
19
+ response?: undefined;
20
+ };
21
+
22
+ export class APIPromise<T> implements Promise<T> {
23
+ readonly #promise: Promise<[T, APICall]>;
24
+ readonly #unwrapped: Promise<T>;
25
+
26
+ readonly [Symbol.toStringTag] = "APIPromise";
27
+
28
+ constructor(p: [T, APICall] | Promise<[T, APICall]>) {
29
+ this.#promise = p instanceof Promise ? p : Promise.resolve(p);
30
+ this.#unwrapped =
31
+ p instanceof Promise
32
+ ? this.#promise.then(([value]) => value)
33
+ : Promise.resolve(p[0]);
34
+ }
35
+
36
+ then<TResult1 = T, TResult2 = never>(
37
+ onfulfilled?:
38
+ | ((value: T) => TResult1 | PromiseLike<TResult1>)
39
+ | null
40
+ | undefined,
41
+ onrejected?:
42
+ | ((reason: any) => TResult2 | PromiseLike<TResult2>)
43
+ | null
44
+ | undefined,
45
+ ): Promise<TResult1 | TResult2> {
46
+ return this.#promise.then(
47
+ onfulfilled ? ([value]) => onfulfilled(value) : void 0,
48
+ onrejected,
49
+ );
50
+ }
51
+
52
+ catch<TResult = never>(
53
+ onrejected?:
54
+ | ((reason: any) => TResult | PromiseLike<TResult>)
55
+ | null
56
+ | undefined,
57
+ ): Promise<T | TResult> {
58
+ return this.#unwrapped.catch(onrejected);
59
+ }
60
+
61
+ finally(onfinally?: (() => void) | null | undefined): Promise<T> {
62
+ return this.#unwrapped.finally(onfinally);
63
+ }
64
+
65
+ $inspect(): Promise<[T, APICall]> {
66
+ return this.#promise;
67
+ }
68
+ }
@@ -0,0 +1,31 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+
7
+ export const blobLikeSchema: z.ZodType<Blob, z.ZodTypeDef, Blob> =
8
+ z.custom<Blob>(isBlobLike, {
9
+ message: "expected a Blob, File or Blob-like object",
10
+ fatal: true,
11
+ });
12
+
13
+ export function isBlobLike(val: unknown): val is Blob {
14
+ if (val instanceof Blob) {
15
+ return true;
16
+ }
17
+
18
+ if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) {
19
+ return false;
20
+ }
21
+
22
+ const name = val[Symbol.toStringTag];
23
+ if (typeof name !== "string") {
24
+ return false;
25
+ }
26
+ if (name !== "Blob" && name !== "File") {
27
+ return false;
28
+ }
29
+
30
+ return "stream" in val && typeof val.stream === "function";
31
+ }