cribl-mgmt-plane 0.0.2

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 (430) hide show
  1. package/.devcontainer/README.md +30 -0
  2. package/.devcontainer/devcontainer.json +45 -0
  3. package/FUNCTIONS.md +88 -0
  4. package/README.md +342 -0
  5. package/RUNTIMES.md +48 -0
  6. package/dist/commonjs/__tests__/assertions.d.ts +2 -0
  7. package/dist/commonjs/__tests__/assertions.d.ts.map +1 -0
  8. package/dist/commonjs/__tests__/assertions.js +14 -0
  9. package/dist/commonjs/__tests__/assertions.js.map +1 -0
  10. package/dist/commonjs/__tests__/criblmgmtplane.test.d.ts +2 -0
  11. package/dist/commonjs/__tests__/criblmgmtplane.test.d.ts.map +1 -0
  12. package/dist/commonjs/__tests__/criblmgmtplane.test.js +18 -0
  13. package/dist/commonjs/__tests__/criblmgmtplane.test.js.map +1 -0
  14. package/dist/commonjs/__tests__/files.d.ts +6 -0
  15. package/dist/commonjs/__tests__/files.d.ts.map +1 -0
  16. package/dist/commonjs/__tests__/files.js +51 -0
  17. package/dist/commonjs/__tests__/files.js.map +1 -0
  18. package/dist/commonjs/__tests__/testclient.d.ts +3 -0
  19. package/dist/commonjs/__tests__/testclient.d.ts.map +1 -0
  20. package/dist/commonjs/__tests__/testclient.js +38 -0
  21. package/dist/commonjs/__tests__/testclient.js.map +1 -0
  22. package/dist/commonjs/core.d.ts +10 -0
  23. package/dist/commonjs/core.d.ts.map +1 -0
  24. package/dist/commonjs/core.js +17 -0
  25. package/dist/commonjs/core.js.map +1 -0
  26. package/dist/commonjs/funcs/dummyServiceStatus.d.ts +13 -0
  27. package/dist/commonjs/funcs/dummyServiceStatus.d.ts.map +1 -0
  28. package/dist/commonjs/funcs/dummyServiceStatus.js +101 -0
  29. package/dist/commonjs/funcs/dummyServiceStatus.js.map +1 -0
  30. package/dist/commonjs/hooks/hooks.d.ts +25 -0
  31. package/dist/commonjs/hooks/hooks.d.ts.map +1 -0
  32. package/dist/commonjs/hooks/hooks.js +86 -0
  33. package/dist/commonjs/hooks/hooks.js.map +1 -0
  34. package/dist/commonjs/hooks/index.d.ts +3 -0
  35. package/dist/commonjs/hooks/index.d.ts.map +1 -0
  36. package/dist/commonjs/hooks/index.js +22 -0
  37. package/dist/commonjs/hooks/index.js.map +1 -0
  38. package/dist/commonjs/hooks/registration.d.ts +3 -0
  39. package/dist/commonjs/hooks/registration.d.ts.map +1 -0
  40. package/dist/commonjs/hooks/registration.js +15 -0
  41. package/dist/commonjs/hooks/registration.js.map +1 -0
  42. package/dist/commonjs/hooks/types.d.ts +76 -0
  43. package/dist/commonjs/hooks/types.d.ts.map +1 -0
  44. package/dist/commonjs/hooks/types.js +6 -0
  45. package/dist/commonjs/hooks/types.js.map +1 -0
  46. package/dist/commonjs/index.d.ts +6 -0
  47. package/dist/commonjs/index.d.ts.map +1 -0
  48. package/dist/commonjs/index.js +48 -0
  49. package/dist/commonjs/index.js.map +1 -0
  50. package/dist/commonjs/lib/base64.d.ts +10 -0
  51. package/dist/commonjs/lib/base64.d.ts.map +1 -0
  52. package/dist/commonjs/lib/base64.js +71 -0
  53. package/dist/commonjs/lib/base64.js.map +1 -0
  54. package/dist/commonjs/lib/config.d.ts +38 -0
  55. package/dist/commonjs/lib/config.d.ts.map +1 -0
  56. package/dist/commonjs/lib/config.js +35 -0
  57. package/dist/commonjs/lib/config.js.map +1 -0
  58. package/dist/commonjs/lib/dlv.d.ts +14 -0
  59. package/dist/commonjs/lib/dlv.d.ts.map +1 -0
  60. package/dist/commonjs/lib/dlv.js +49 -0
  61. package/dist/commonjs/lib/dlv.js.map +1 -0
  62. package/dist/commonjs/lib/encodings.d.ts +52 -0
  63. package/dist/commonjs/lib/encodings.d.ts.map +1 -0
  64. package/dist/commonjs/lib/encodings.js +368 -0
  65. package/dist/commonjs/lib/encodings.js.map +1 -0
  66. package/dist/commonjs/lib/env.d.ts +15 -0
  67. package/dist/commonjs/lib/env.d.ts.map +1 -0
  68. package/dist/commonjs/lib/env.js +65 -0
  69. package/dist/commonjs/lib/env.js.map +1 -0
  70. package/dist/commonjs/lib/files.d.ts +13 -0
  71. package/dist/commonjs/lib/files.d.ts.map +1 -0
  72. package/dist/commonjs/lib/files.js +77 -0
  73. package/dist/commonjs/lib/files.js.map +1 -0
  74. package/dist/commonjs/lib/http.d.ts +67 -0
  75. package/dist/commonjs/lib/http.d.ts.map +1 -0
  76. package/dist/commonjs/lib/http.js +217 -0
  77. package/dist/commonjs/lib/http.js.map +1 -0
  78. package/dist/commonjs/lib/is-plain-object.d.ts +2 -0
  79. package/dist/commonjs/lib/is-plain-object.d.ts.map +1 -0
  80. package/dist/commonjs/lib/is-plain-object.js +41 -0
  81. package/dist/commonjs/lib/is-plain-object.js.map +1 -0
  82. package/dist/commonjs/lib/logger.d.ts +6 -0
  83. package/dist/commonjs/lib/logger.d.ts.map +1 -0
  84. package/dist/commonjs/lib/logger.js +6 -0
  85. package/dist/commonjs/lib/logger.js.map +1 -0
  86. package/dist/commonjs/lib/matchers.d.ts +59 -0
  87. package/dist/commonjs/lib/matchers.d.ts.map +1 -0
  88. package/dist/commonjs/lib/matchers.js +222 -0
  89. package/dist/commonjs/lib/matchers.js.map +1 -0
  90. package/dist/commonjs/lib/primitives.d.ts +26 -0
  91. package/dist/commonjs/lib/primitives.d.ts.map +1 -0
  92. package/dist/commonjs/lib/primitives.js +111 -0
  93. package/dist/commonjs/lib/primitives.js.map +1 -0
  94. package/dist/commonjs/lib/retries.d.ts +38 -0
  95. package/dist/commonjs/lib/retries.d.ts.map +1 -0
  96. package/dist/commonjs/lib/retries.js +153 -0
  97. package/dist/commonjs/lib/retries.js.map +1 -0
  98. package/dist/commonjs/lib/schemas.d.ts +19 -0
  99. package/dist/commonjs/lib/schemas.d.ts.map +1 -0
  100. package/dist/commonjs/lib/schemas.js +62 -0
  101. package/dist/commonjs/lib/schemas.js.map +1 -0
  102. package/dist/commonjs/lib/sdks.d.ts +63 -0
  103. package/dist/commonjs/lib/sdks.d.ts.map +1 -0
  104. package/dist/commonjs/lib/sdks.js +273 -0
  105. package/dist/commonjs/lib/sdks.js.map +1 -0
  106. package/dist/commonjs/lib/security.d.ts +83 -0
  107. package/dist/commonjs/lib/security.d.ts.map +1 -0
  108. package/dist/commonjs/lib/security.js +144 -0
  109. package/dist/commonjs/lib/security.js.map +1 -0
  110. package/dist/commonjs/lib/url.d.ts +5 -0
  111. package/dist/commonjs/lib/url.d.ts.map +1 -0
  112. package/dist/commonjs/lib/url.js +25 -0
  113. package/dist/commonjs/lib/url.js.map +1 -0
  114. package/dist/commonjs/models/errors/criblmgmtplanedefaulterror.d.ts +10 -0
  115. package/dist/commonjs/models/errors/criblmgmtplanedefaulterror.d.ts.map +1 -0
  116. package/dist/commonjs/models/errors/criblmgmtplanedefaulterror.js +34 -0
  117. package/dist/commonjs/models/errors/criblmgmtplanedefaulterror.js.map +1 -0
  118. package/dist/commonjs/models/errors/criblmgmtplaneerror.d.ts +19 -0
  119. package/dist/commonjs/models/errors/criblmgmtplaneerror.d.ts.map +1 -0
  120. package/dist/commonjs/models/errors/criblmgmtplaneerror.js +20 -0
  121. package/dist/commonjs/models/errors/criblmgmtplaneerror.js.map +1 -0
  122. package/dist/commonjs/models/errors/httpclienterrors.d.ts +44 -0
  123. package/dist/commonjs/models/errors/httpclienterrors.d.ts.map +1 -0
  124. package/dist/commonjs/models/errors/httpclienterrors.js +78 -0
  125. package/dist/commonjs/models/errors/httpclienterrors.js.map +1 -0
  126. package/dist/commonjs/models/errors/index.d.ts +5 -0
  127. package/dist/commonjs/models/errors/index.d.ts.map +1 -0
  128. package/dist/commonjs/models/errors/index.js +24 -0
  129. package/dist/commonjs/models/errors/index.js.map +1 -0
  130. package/dist/commonjs/models/errors/responsevalidationerror.d.ts +26 -0
  131. package/dist/commonjs/models/errors/responsevalidationerror.d.ts.map +1 -0
  132. package/dist/commonjs/models/errors/responsevalidationerror.js +66 -0
  133. package/dist/commonjs/models/errors/responsevalidationerror.js.map +1 -0
  134. package/dist/commonjs/models/errors/sdkvalidationerror.d.ts +21 -0
  135. package/dist/commonjs/models/errors/sdkvalidationerror.d.ts.map +1 -0
  136. package/dist/commonjs/models/errors/sdkvalidationerror.js +129 -0
  137. package/dist/commonjs/models/errors/sdkvalidationerror.js.map +1 -0
  138. package/dist/commonjs/models/index.d.ts +2 -0
  139. package/dist/commonjs/models/index.d.ts.map +1 -0
  140. package/dist/commonjs/models/index.js +21 -0
  141. package/dist/commonjs/models/index.js.map +1 -0
  142. package/dist/commonjs/models/security.d.ts +29 -0
  143. package/dist/commonjs/models/security.d.ts.map +1 -0
  144. package/dist/commonjs/models/security.js +69 -0
  145. package/dist/commonjs/models/security.js.map +1 -0
  146. package/dist/commonjs/package.json +3 -0
  147. package/dist/commonjs/sdk/index.d.ts +2 -0
  148. package/dist/commonjs/sdk/index.d.ts.map +1 -0
  149. package/dist/commonjs/sdk/index.js +21 -0
  150. package/dist/commonjs/sdk/index.js.map +1 -0
  151. package/dist/commonjs/sdk/sdk.d.ts +8 -0
  152. package/dist/commonjs/sdk/sdk.d.ts.map +1 -0
  153. package/dist/commonjs/sdk/sdk.js +19 -0
  154. package/dist/commonjs/sdk/sdk.js.map +1 -0
  155. package/dist/commonjs/types/async.d.ts +23 -0
  156. package/dist/commonjs/types/async.d.ts.map +1 -0
  157. package/dist/commonjs/types/async.js +44 -0
  158. package/dist/commonjs/types/async.js.map +1 -0
  159. package/dist/commonjs/types/blobs.d.ts +4 -0
  160. package/dist/commonjs/types/blobs.d.ts.map +1 -0
  161. package/dist/commonjs/types/blobs.js +62 -0
  162. package/dist/commonjs/types/blobs.js.map +1 -0
  163. package/dist/commonjs/types/constdatetime.d.ts +3 -0
  164. package/dist/commonjs/types/constdatetime.d.ts.map +1 -0
  165. package/dist/commonjs/types/constdatetime.js +46 -0
  166. package/dist/commonjs/types/constdatetime.js.map +1 -0
  167. package/dist/commonjs/types/enums.d.ts +12 -0
  168. package/dist/commonjs/types/enums.d.ts.map +1 -0
  169. package/dist/commonjs/types/enums.js +10 -0
  170. package/dist/commonjs/types/enums.js.map +1 -0
  171. package/dist/commonjs/types/fp.d.ts +31 -0
  172. package/dist/commonjs/types/fp.d.ts.map +1 -0
  173. package/dist/commonjs/types/fp.js +37 -0
  174. package/dist/commonjs/types/fp.js.map +1 -0
  175. package/dist/commonjs/types/index.d.ts +8 -0
  176. package/dist/commonjs/types/index.d.ts.map +1 -0
  177. package/dist/commonjs/types/index.js +16 -0
  178. package/dist/commonjs/types/index.js.map +1 -0
  179. package/dist/commonjs/types/operations.d.ts +27 -0
  180. package/dist/commonjs/types/operations.d.ts.map +1 -0
  181. package/dist/commonjs/types/operations.js +83 -0
  182. package/dist/commonjs/types/operations.js.map +1 -0
  183. package/dist/commonjs/types/rfcdate.d.ts +21 -0
  184. package/dist/commonjs/types/rfcdate.d.ts.map +1 -0
  185. package/dist/commonjs/types/rfcdate.js +46 -0
  186. package/dist/commonjs/types/rfcdate.js.map +1 -0
  187. package/dist/commonjs/types/streams.d.ts +2 -0
  188. package/dist/commonjs/types/streams.d.ts.map +1 -0
  189. package/dist/commonjs/types/streams.js +18 -0
  190. package/dist/commonjs/types/streams.js.map +1 -0
  191. package/dist/esm/__tests__/assertions.d.ts +2 -0
  192. package/dist/esm/__tests__/assertions.d.ts.map +1 -0
  193. package/dist/esm/__tests__/assertions.js +11 -0
  194. package/dist/esm/__tests__/assertions.js.map +1 -0
  195. package/dist/esm/__tests__/criblmgmtplane.test.d.ts +2 -0
  196. package/dist/esm/__tests__/criblmgmtplane.test.d.ts.map +1 -0
  197. package/dist/esm/__tests__/criblmgmtplane.test.js +16 -0
  198. package/dist/esm/__tests__/criblmgmtplane.test.js.map +1 -0
  199. package/dist/esm/__tests__/files.d.ts +6 -0
  200. package/dist/esm/__tests__/files.d.ts.map +1 -0
  201. package/dist/esm/__tests__/files.js +44 -0
  202. package/dist/esm/__tests__/files.js.map +1 -0
  203. package/dist/esm/__tests__/testclient.d.ts +3 -0
  204. package/dist/esm/__tests__/testclient.d.ts.map +1 -0
  205. package/dist/esm/__tests__/testclient.js +35 -0
  206. package/dist/esm/__tests__/testclient.js.map +1 -0
  207. package/dist/esm/core.d.ts +10 -0
  208. package/dist/esm/core.d.ts.map +1 -0
  209. package/dist/esm/core.js +13 -0
  210. package/dist/esm/core.js.map +1 -0
  211. package/dist/esm/funcs/dummyServiceStatus.d.ts +13 -0
  212. package/dist/esm/funcs/dummyServiceStatus.d.ts.map +1 -0
  213. package/dist/esm/funcs/dummyServiceStatus.js +65 -0
  214. package/dist/esm/funcs/dummyServiceStatus.js.map +1 -0
  215. package/dist/esm/hooks/hooks.d.ts +25 -0
  216. package/dist/esm/hooks/hooks.d.ts.map +1 -0
  217. package/dist/esm/hooks/hooks.js +82 -0
  218. package/dist/esm/hooks/hooks.js.map +1 -0
  219. package/dist/esm/hooks/index.d.ts +3 -0
  220. package/dist/esm/hooks/index.d.ts.map +1 -0
  221. package/dist/esm/hooks/index.js +6 -0
  222. package/dist/esm/hooks/index.js.map +1 -0
  223. package/dist/esm/hooks/registration.d.ts +3 -0
  224. package/dist/esm/hooks/registration.d.ts.map +1 -0
  225. package/dist/esm/hooks/registration.js +12 -0
  226. package/dist/esm/hooks/registration.js.map +1 -0
  227. package/dist/esm/hooks/types.d.ts +76 -0
  228. package/dist/esm/hooks/types.d.ts.map +1 -0
  229. package/dist/esm/hooks/types.js +5 -0
  230. package/dist/esm/hooks/types.js.map +1 -0
  231. package/dist/esm/index.d.ts +6 -0
  232. package/dist/esm/index.d.ts.map +1 -0
  233. package/dist/esm/index.js +8 -0
  234. package/dist/esm/index.js.map +1 -0
  235. package/dist/esm/lib/base64.d.ts +10 -0
  236. package/dist/esm/lib/base64.d.ts.map +1 -0
  237. package/dist/esm/lib/base64.js +29 -0
  238. package/dist/esm/lib/base64.js.map +1 -0
  239. package/dist/esm/lib/config.d.ts +38 -0
  240. package/dist/esm/lib/config.d.ts.map +1 -0
  241. package/dist/esm/lib/config.js +31 -0
  242. package/dist/esm/lib/config.js.map +1 -0
  243. package/dist/esm/lib/dlv.d.ts +14 -0
  244. package/dist/esm/lib/dlv.d.ts.map +1 -0
  245. package/dist/esm/lib/dlv.js +46 -0
  246. package/dist/esm/lib/dlv.js.map +1 -0
  247. package/dist/esm/lib/encodings.d.ts +52 -0
  248. package/dist/esm/lib/encodings.d.ts.map +1 -0
  249. package/dist/esm/lib/encodings.js +354 -0
  250. package/dist/esm/lib/encodings.js.map +1 -0
  251. package/dist/esm/lib/env.d.ts +15 -0
  252. package/dist/esm/lib/env.d.ts.map +1 -0
  253. package/dist/esm/lib/env.js +27 -0
  254. package/dist/esm/lib/env.js.map +1 -0
  255. package/dist/esm/lib/files.d.ts +13 -0
  256. package/dist/esm/lib/files.d.ts.map +1 -0
  257. package/dist/esm/lib/files.js +73 -0
  258. package/dist/esm/lib/files.js.map +1 -0
  259. package/dist/esm/lib/http.d.ts +67 -0
  260. package/dist/esm/lib/http.d.ts.map +1 -0
  261. package/dist/esm/lib/http.js +207 -0
  262. package/dist/esm/lib/http.js.map +1 -0
  263. package/dist/esm/lib/is-plain-object.d.ts +2 -0
  264. package/dist/esm/lib/is-plain-object.d.ts.map +1 -0
  265. package/dist/esm/lib/is-plain-object.js +38 -0
  266. package/dist/esm/lib/is-plain-object.js.map +1 -0
  267. package/dist/esm/lib/logger.d.ts +6 -0
  268. package/dist/esm/lib/logger.d.ts.map +1 -0
  269. package/dist/esm/lib/logger.js +5 -0
  270. package/dist/esm/lib/logger.js.map +1 -0
  271. package/dist/esm/lib/matchers.d.ts +59 -0
  272. package/dist/esm/lib/matchers.d.ts.map +1 -0
  273. package/dist/esm/lib/matchers.js +203 -0
  274. package/dist/esm/lib/matchers.js.map +1 -0
  275. package/dist/esm/lib/primitives.d.ts +26 -0
  276. package/dist/esm/lib/primitives.d.ts.map +1 -0
  277. package/dist/esm/lib/primitives.js +103 -0
  278. package/dist/esm/lib/primitives.js.map +1 -0
  279. package/dist/esm/lib/retries.d.ts +38 -0
  280. package/dist/esm/lib/retries.d.ts.map +1 -0
  281. package/dist/esm/lib/retries.js +147 -0
  282. package/dist/esm/lib/retries.js.map +1 -0
  283. package/dist/esm/lib/schemas.d.ts +19 -0
  284. package/dist/esm/lib/schemas.d.ts.map +1 -0
  285. package/dist/esm/lib/schemas.js +57 -0
  286. package/dist/esm/lib/schemas.js.map +1 -0
  287. package/dist/esm/lib/sdks.d.ts +63 -0
  288. package/dist/esm/lib/sdks.d.ts.map +1 -0
  289. package/dist/esm/lib/sdks.js +269 -0
  290. package/dist/esm/lib/sdks.js.map +1 -0
  291. package/dist/esm/lib/security.d.ts +83 -0
  292. package/dist/esm/lib/security.d.ts.map +1 -0
  293. package/dist/esm/lib/security.js +137 -0
  294. package/dist/esm/lib/security.js.map +1 -0
  295. package/dist/esm/lib/url.d.ts +5 -0
  296. package/dist/esm/lib/url.d.ts.map +1 -0
  297. package/dist/esm/lib/url.js +22 -0
  298. package/dist/esm/lib/url.js.map +1 -0
  299. package/dist/esm/models/errors/criblmgmtplanedefaulterror.d.ts +10 -0
  300. package/dist/esm/models/errors/criblmgmtplanedefaulterror.d.ts.map +1 -0
  301. package/dist/esm/models/errors/criblmgmtplanedefaulterror.js +30 -0
  302. package/dist/esm/models/errors/criblmgmtplanedefaulterror.js.map +1 -0
  303. package/dist/esm/models/errors/criblmgmtplaneerror.d.ts +19 -0
  304. package/dist/esm/models/errors/criblmgmtplaneerror.d.ts.map +1 -0
  305. package/dist/esm/models/errors/criblmgmtplaneerror.js +16 -0
  306. package/dist/esm/models/errors/criblmgmtplaneerror.js.map +1 -0
  307. package/dist/esm/models/errors/httpclienterrors.d.ts +44 -0
  308. package/dist/esm/models/errors/httpclienterrors.d.ts.map +1 -0
  309. package/dist/esm/models/errors/httpclienterrors.js +69 -0
  310. package/dist/esm/models/errors/httpclienterrors.js.map +1 -0
  311. package/dist/esm/models/errors/index.d.ts +5 -0
  312. package/dist/esm/models/errors/index.d.ts.map +1 -0
  313. package/dist/esm/models/errors/index.js +8 -0
  314. package/dist/esm/models/errors/index.js.map +1 -0
  315. package/dist/esm/models/errors/responsevalidationerror.d.ts +26 -0
  316. package/dist/esm/models/errors/responsevalidationerror.d.ts.map +1 -0
  317. package/dist/esm/models/errors/responsevalidationerror.js +29 -0
  318. package/dist/esm/models/errors/responsevalidationerror.js.map +1 -0
  319. package/dist/esm/models/errors/sdkvalidationerror.d.ts +21 -0
  320. package/dist/esm/models/errors/sdkvalidationerror.d.ts.map +1 -0
  321. package/dist/esm/models/errors/sdkvalidationerror.js +91 -0
  322. package/dist/esm/models/errors/sdkvalidationerror.js.map +1 -0
  323. package/dist/esm/models/index.d.ts +2 -0
  324. package/dist/esm/models/index.d.ts.map +1 -0
  325. package/dist/esm/models/index.js +5 -0
  326. package/dist/esm/models/index.js.map +1 -0
  327. package/dist/esm/models/security.d.ts +29 -0
  328. package/dist/esm/models/security.d.ts.map +1 -0
  329. package/dist/esm/models/security.js +31 -0
  330. package/dist/esm/models/security.js.map +1 -0
  331. package/dist/esm/package.json +3 -0
  332. package/dist/esm/sdk/index.d.ts +2 -0
  333. package/dist/esm/sdk/index.d.ts.map +1 -0
  334. package/dist/esm/sdk/index.js +5 -0
  335. package/dist/esm/sdk/index.js.map +1 -0
  336. package/dist/esm/sdk/sdk.d.ts +8 -0
  337. package/dist/esm/sdk/sdk.d.ts.map +1 -0
  338. package/dist/esm/sdk/sdk.js +15 -0
  339. package/dist/esm/sdk/sdk.js.map +1 -0
  340. package/dist/esm/types/async.d.ts +23 -0
  341. package/dist/esm/types/async.d.ts.map +1 -0
  342. package/dist/esm/types/async.js +40 -0
  343. package/dist/esm/types/async.js.map +1 -0
  344. package/dist/esm/types/blobs.d.ts +4 -0
  345. package/dist/esm/types/blobs.d.ts.map +1 -0
  346. package/dist/esm/types/blobs.js +25 -0
  347. package/dist/esm/types/blobs.js.map +1 -0
  348. package/dist/esm/types/constdatetime.d.ts +3 -0
  349. package/dist/esm/types/constdatetime.d.ts.map +1 -0
  350. package/dist/esm/types/constdatetime.js +10 -0
  351. package/dist/esm/types/constdatetime.js.map +1 -0
  352. package/dist/esm/types/enums.d.ts +12 -0
  353. package/dist/esm/types/enums.d.ts.map +1 -0
  354. package/dist/esm/types/enums.js +7 -0
  355. package/dist/esm/types/enums.js.map +1 -0
  356. package/dist/esm/types/fp.d.ts +31 -0
  357. package/dist/esm/types/fp.d.ts.map +1 -0
  358. package/dist/esm/types/fp.js +31 -0
  359. package/dist/esm/types/fp.js.map +1 -0
  360. package/dist/esm/types/index.d.ts +8 -0
  361. package/dist/esm/types/index.d.ts.map +1 -0
  362. package/dist/esm/types/index.js +8 -0
  363. package/dist/esm/types/index.js.map +1 -0
  364. package/dist/esm/types/operations.d.ts +27 -0
  365. package/dist/esm/types/operations.d.ts.map +1 -0
  366. package/dist/esm/types/operations.js +77 -0
  367. package/dist/esm/types/operations.js.map +1 -0
  368. package/dist/esm/types/rfcdate.d.ts +21 -0
  369. package/dist/esm/types/rfcdate.d.ts.map +1 -0
  370. package/dist/esm/types/rfcdate.js +42 -0
  371. package/dist/esm/types/rfcdate.js.map +1 -0
  372. package/dist/esm/types/streams.d.ts +2 -0
  373. package/dist/esm/types/streams.d.ts.map +1 -0
  374. package/dist/esm/types/streams.js +15 -0
  375. package/dist/esm/types/streams.js.map +1 -0
  376. package/docs/sdks/criblmgmtplane/README.md +78 -0
  377. package/examples/README.md +26 -0
  378. package/examples/dummyServiceStatus.example.ts +23 -0
  379. package/examples/package-lock.json +614 -0
  380. package/examples/package.json +18 -0
  381. package/jsr.json +27 -0
  382. package/package.json +115 -0
  383. package/src/__tests__/assertions.ts +13 -0
  384. package/src/__tests__/criblmgmtplane.test.ts +19 -0
  385. package/src/__tests__/files.ts +56 -0
  386. package/src/__tests__/mockserver/README.md +52 -0
  387. package/src/__tests__/testclient.ts +48 -0
  388. package/src/core.ts +13 -0
  389. package/src/funcs/dummyServiceStatus.ts +139 -0
  390. package/src/hooks/hooks.ts +132 -0
  391. package/src/hooks/index.ts +6 -0
  392. package/src/hooks/registration.ts +14 -0
  393. package/src/hooks/types.ts +107 -0
  394. package/src/index.ts +9 -0
  395. package/src/lib/base64.ts +37 -0
  396. package/src/lib/config.ts +64 -0
  397. package/src/lib/dlv.ts +53 -0
  398. package/src/lib/encodings.ts +483 -0
  399. package/src/lib/env.ts +41 -0
  400. package/src/lib/files.ts +82 -0
  401. package/src/lib/http.ts +323 -0
  402. package/src/lib/is-plain-object.ts +43 -0
  403. package/src/lib/logger.ts +9 -0
  404. package/src/lib/matchers.ts +358 -0
  405. package/src/lib/primitives.ts +150 -0
  406. package/src/lib/retries.ts +218 -0
  407. package/src/lib/schemas.ts +91 -0
  408. package/src/lib/sdks.ts +406 -0
  409. package/src/lib/security.ts +261 -0
  410. package/src/lib/url.ts +33 -0
  411. package/src/models/errors/criblmgmtplanedefaulterror.ts +40 -0
  412. package/src/models/errors/criblmgmtplaneerror.ts +35 -0
  413. package/src/models/errors/httpclienterrors.ts +62 -0
  414. package/src/models/errors/index.ts +8 -0
  415. package/src/models/errors/responsevalidationerror.ts +50 -0
  416. package/src/models/errors/sdkvalidationerror.ts +109 -0
  417. package/src/models/index.ts +5 -0
  418. package/src/models/security.ts +62 -0
  419. package/src/sdk/index.ts +5 -0
  420. package/src/sdk/sdk.ts +21 -0
  421. package/src/types/async.ts +68 -0
  422. package/src/types/blobs.ts +31 -0
  423. package/src/types/constdatetime.ts +15 -0
  424. package/src/types/enums.ts +16 -0
  425. package/src/types/fp.ts +50 -0
  426. package/src/types/index.ts +11 -0
  427. package/src/types/operations.ts +105 -0
  428. package/src/types/rfcdate.ts +54 -0
  429. package/src/types/streams.ts +21 -0
  430. package/tsconfig.json +41 -0
@@ -0,0 +1,30 @@
1
+
2
+ > **Remember to shutdown a GitHub Codespace when it is not in use!**
3
+
4
+ # Dev Containers Quick Start
5
+
6
+ The default location for usage snippets is the `samples` directory.
7
+
8
+ ## Running a Usage Sample
9
+
10
+ A sample usage example has been provided in a `root.ts` file. As you work with the SDK, it's expected that you will modify these samples to fit your needs. To execute this particular snippet, use the command below.
11
+
12
+ ```
13
+ ts-node root.ts
14
+ ```
15
+
16
+ ## Generating Additional Usage Samples
17
+
18
+ The speakeasy CLI allows you to generate more usage snippets. Here's how:
19
+
20
+ - To generate a sample for a specific operation by providing an operation ID, use:
21
+
22
+ ```
23
+ speakeasy generate usage -s .speakeasy/out.openapi.yaml -l typescript -i {INPUT_OPERATION_ID} -o ./samples
24
+ ```
25
+
26
+ - To generate samples for an entire namespace (like a tag or group name), use:
27
+
28
+ ```
29
+ speakeasy generate usage -s .speakeasy/out.openapi.yaml -l typescript -n {INPUT_TAG_NAME} -o ./samples
30
+ ```
@@ -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
+ }
package/FUNCTIONS.md ADDED
@@ -0,0 +1,88 @@
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 { CriblMgmtPlaneCore } from "cribl-mgmt-plane/core.js";
23
+ import { dummyServiceStatus } from "cribl-mgmt-plane/funcs/dummyServiceStatus.js";
24
+
25
+ // Use `CriblMgmtPlaneCore` for best tree-shaking performance.
26
+ // You can create one instance of it to use across an application.
27
+ const criblMgmtPlane = new CriblMgmtPlaneCore({
28
+ serverURL: "https://api.example.com",
29
+ bearerAuth: process.env["CRIBLMGMTPLANE_BEARER_AUTH"] ?? "",
30
+ });
31
+
32
+ async function run() {
33
+ const res = await dummyServiceStatus(criblMgmtPlane);
34
+ if (res.ok) {
35
+ const { value: result } = res;
36
+
37
+ } else {
38
+ console.log("dummyServiceStatus failed:", res.error);
39
+ }
40
+ }
41
+
42
+ run();
43
+ ```
44
+
45
+ ## Result types
46
+
47
+ Standalone functions differ from SDK methods in that they return a
48
+ `Result<Value, Error>` type to capture _known errors_ and document them using
49
+ the type system. By avoiding throwing errors, application code maintains clear
50
+ control flow and error-handling become part of the regular flow of application
51
+ code.
52
+
53
+ > We use the term "known errors" because standalone functions, and JavaScript
54
+ > code in general, can still throw unexpected errors such as `TypeError`s,
55
+ > `RangeError`s and `DOMException`s. Exhaustively catching all errors may be
56
+ > something this SDK addresses in the future. Nevertheless, there is still a lot
57
+ > of benefit from capturing most errors and turning them into values.
58
+
59
+ The second reason for this style of programming is because these functions will
60
+ typically be used in front-end applications where exception throwing is
61
+ sometimes discouraged or considered unidiomatic. React and similar ecosystems
62
+ and libraries tend to promote this style of programming so that components
63
+ render useful content under all states (loading, success, error and so on).
64
+
65
+ The general pattern when calling standalone functions looks like this:
66
+
67
+ ```typescript
68
+ import { Core } from "<sdk-package-name>";
69
+ import { fetchSomething } from "<sdk-package-name>/funcs/fetchSomething.js";
70
+
71
+ const client = new Core();
72
+
73
+ async function run() {
74
+ const result = await fetchSomething(client, { id: "123" });
75
+ if (!result.ok) {
76
+ // You can throw the error or handle it. It's your choice now.
77
+ throw result.error;
78
+ }
79
+
80
+ console.log(result.value);
81
+ }
82
+
83
+ run();
84
+ ```
85
+
86
+ Notably, `result.error` above will have an explicit type compared to a try-catch
87
+ variation where the error in the catch block can only be of type `unknown` (or
88
+ `any` depending on your TypeScript settings).
package/README.md ADDED
@@ -0,0 +1,342 @@
1
+ # cribl-cloud-management-sdk-typescript
2
+ <!-- Start Summary [summary] -->
3
+ ## Summary
4
+
5
+ Cribl Cloud Management API: Lorem Ipsum
6
+ <!-- End Summary [summary] -->
7
+
8
+ <!-- Start Table of Contents [toc] -->
9
+ ## Table of Contents
10
+ <!-- $toc-max-depth=2 -->
11
+ * [cribl-cloud-management-sdk-typescript](#cribl-cloud-management-sdk-typescript)
12
+ * [SDK Installation](#sdk-installation)
13
+ * [Requirements](#requirements)
14
+ * [SDK Example Usage](#sdk-example-usage)
15
+ * [Authentication](#authentication)
16
+ * [Available Resources and Operations](#available-resources-and-operations)
17
+ * [Standalone functions](#standalone-functions)
18
+ * [Retries](#retries)
19
+ * [Error Handling](#error-handling)
20
+ * [Custom HTTP Client](#custom-http-client)
21
+ * [Debugging](#debugging)
22
+
23
+ <!-- End Table of Contents [toc] -->
24
+
25
+ <!-- Start SDK Installation [installation] -->
26
+ ## SDK Installation
27
+
28
+ 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.
29
+
30
+ ### NPM
31
+
32
+ ```bash
33
+ npm add cribl-mgmt-plane
34
+ ```
35
+
36
+ ### PNPM
37
+
38
+ ```bash
39
+ pnpm add cribl-mgmt-plane
40
+ ```
41
+
42
+ ### Bun
43
+
44
+ ```bash
45
+ bun add cribl-mgmt-plane
46
+ ```
47
+
48
+ ### Yarn
49
+
50
+ ```bash
51
+ yarn add cribl-mgmt-plane zod
52
+
53
+ # Note that Yarn does not install peer dependencies automatically. You will need
54
+ # to install zod as shown above.
55
+ ```
56
+
57
+ > [!NOTE]
58
+ > This package is published with CommonJS and ES Modules (ESM) support.
59
+ <!-- End SDK Installation [installation] -->
60
+
61
+ <!-- Start Requirements [requirements] -->
62
+ ## Requirements
63
+
64
+ For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
65
+ <!-- End Requirements [requirements] -->
66
+
67
+ <!-- Start SDK Example Usage [usage] -->
68
+ ## SDK Example Usage
69
+
70
+ ### Example
71
+
72
+ ```typescript
73
+ import { CriblMgmtPlane } from "cribl-mgmt-plane";
74
+
75
+ const criblMgmtPlane = new CriblMgmtPlane({
76
+ serverURL: "https://api.example.com",
77
+ bearerAuth: process.env["CRIBLMGMTPLANE_BEARER_AUTH"] ?? "",
78
+ });
79
+
80
+ async function run() {
81
+ await criblMgmtPlane.dummyServiceStatus();
82
+ }
83
+
84
+ run();
85
+
86
+ ```
87
+ <!-- End SDK Example Usage [usage] -->
88
+
89
+ <!-- Start Authentication [security] -->
90
+ ## Authentication
91
+
92
+ ### Per-Client Security Schemes
93
+
94
+ This SDK supports the following security scheme globally:
95
+
96
+ | Name | Type | Scheme | Environment Variable |
97
+ | ------------ | ---- | ----------- | ---------------------------- |
98
+ | `bearerAuth` | http | HTTP Bearer | `CRIBLMGMTPLANE_BEARER_AUTH` |
99
+
100
+ To authenticate with the API the `bearerAuth` parameter must be set when initializing the SDK client instance. For example:
101
+ ```typescript
102
+ import { CriblMgmtPlane } from "cribl-mgmt-plane";
103
+
104
+ const criblMgmtPlane = new CriblMgmtPlane({
105
+ serverURL: "https://api.example.com",
106
+ bearerAuth: process.env["CRIBLMGMTPLANE_BEARER_AUTH"] ?? "",
107
+ });
108
+
109
+ async function run() {
110
+ await criblMgmtPlane.dummyServiceStatus();
111
+ }
112
+
113
+ run();
114
+
115
+ ```
116
+ <!-- End Authentication [security] -->
117
+
118
+ <!-- Start Available Resources and Operations [operations] -->
119
+ ## Available Resources and Operations
120
+
121
+ <details open>
122
+ <summary>Available methods</summary>
123
+
124
+ ### [CriblMgmtPlane SDK](docs/sdks/criblmgmtplane/README.md)
125
+
126
+ * [dummyServiceStatus](docs/sdks/criblmgmtplane/README.md#dummyservicestatus) - Service status
127
+
128
+ </details>
129
+ <!-- End Available Resources and Operations [operations] -->
130
+
131
+ <!-- Start Standalone functions [standalone-funcs] -->
132
+ ## Standalone functions
133
+
134
+ All the methods listed above are available as standalone functions. These
135
+ functions are ideal for use in applications running in the browser, serverless
136
+ runtimes or other environments where application bundle size is a primary
137
+ concern. When using a bundler to build your application, all unused
138
+ functionality will be either excluded from the final bundle or tree-shaken away.
139
+
140
+ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
141
+
142
+ <details>
143
+
144
+ <summary>Available standalone functions</summary>
145
+
146
+ - [`dummyServiceStatus`](docs/sdks/criblmgmtplane/README.md#dummyservicestatus) - Service status
147
+
148
+ </details>
149
+ <!-- End Standalone functions [standalone-funcs] -->
150
+
151
+ <!-- Start Retries [retries] -->
152
+ ## Retries
153
+
154
+ 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.
155
+
156
+ To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
157
+ ```typescript
158
+ import { CriblMgmtPlane } from "cribl-mgmt-plane";
159
+
160
+ const criblMgmtPlane = new CriblMgmtPlane({
161
+ serverURL: "https://api.example.com",
162
+ bearerAuth: process.env["CRIBLMGMTPLANE_BEARER_AUTH"] ?? "",
163
+ });
164
+
165
+ async function run() {
166
+ await criblMgmtPlane.dummyServiceStatus({
167
+ retries: {
168
+ strategy: "backoff",
169
+ backoff: {
170
+ initialInterval: 1,
171
+ maxInterval: 50,
172
+ exponent: 1.1,
173
+ maxElapsedTime: 100,
174
+ },
175
+ retryConnectionErrors: false,
176
+ },
177
+ });
178
+ }
179
+
180
+ run();
181
+
182
+ ```
183
+
184
+ If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
185
+ ```typescript
186
+ import { CriblMgmtPlane } from "cribl-mgmt-plane";
187
+
188
+ const criblMgmtPlane = new CriblMgmtPlane({
189
+ serverURL: "https://api.example.com",
190
+ retryConfig: {
191
+ strategy: "backoff",
192
+ backoff: {
193
+ initialInterval: 1,
194
+ maxInterval: 50,
195
+ exponent: 1.1,
196
+ maxElapsedTime: 100,
197
+ },
198
+ retryConnectionErrors: false,
199
+ },
200
+ bearerAuth: process.env["CRIBLMGMTPLANE_BEARER_AUTH"] ?? "",
201
+ });
202
+
203
+ async function run() {
204
+ await criblMgmtPlane.dummyServiceStatus();
205
+ }
206
+
207
+ run();
208
+
209
+ ```
210
+ <!-- End Retries [retries] -->
211
+
212
+ <!-- Start Error Handling [errors] -->
213
+ ## Error Handling
214
+
215
+ [`CriblMgmtPlaneError`](./src/models/errors/criblmgmtplaneerror.ts) is the base class for all HTTP error responses. It has the following properties:
216
+
217
+ | Property | Type | Description |
218
+ | ------------------- | ---------- | ------------------------------------------------------ |
219
+ | `error.message` | `string` | Error message |
220
+ | `error.statusCode` | `number` | HTTP response status code eg `404` |
221
+ | `error.headers` | `Headers` | HTTP response headers |
222
+ | `error.body` | `string` | HTTP body. Can be empty string if no body is returned. |
223
+ | `error.rawResponse` | `Response` | Raw HTTP response |
224
+
225
+ ### Example
226
+ ```typescript
227
+ import { CriblMgmtPlane } from "cribl-mgmt-plane";
228
+ import * as errors from "cribl-mgmt-plane/models/errors";
229
+
230
+ const criblMgmtPlane = new CriblMgmtPlane({
231
+ serverURL: "https://api.example.com",
232
+ bearerAuth: process.env["CRIBLMGMTPLANE_BEARER_AUTH"] ?? "",
233
+ });
234
+
235
+ async function run() {
236
+ try {
237
+ await criblMgmtPlane.dummyServiceStatus();
238
+ } catch (error) {
239
+ if (error instanceof errors.CriblMgmtPlaneError) {
240
+ console.log(error.message);
241
+ console.log(error.statusCode);
242
+ console.log(error.body);
243
+ console.log(error.headers);
244
+ }
245
+ }
246
+ }
247
+
248
+ run();
249
+
250
+ ```
251
+
252
+ ### Error Classes
253
+ **Primary error:**
254
+ * [`CriblMgmtPlaneError`](./src/models/errors/criblmgmtplaneerror.ts): The base class for HTTP error responses.
255
+
256
+ <details><summary>Less common errors (6)</summary>
257
+
258
+ <br />
259
+
260
+ **Network errors:**
261
+ * [`ConnectionError`](./src/models/errors/httpclienterrors.ts): HTTP client was unable to make a request to a server.
262
+ * [`RequestTimeoutError`](./src/models/errors/httpclienterrors.ts): HTTP request timed out due to an AbortSignal signal.
263
+ * [`RequestAbortedError`](./src/models/errors/httpclienterrors.ts): HTTP request was aborted by the client.
264
+ * [`InvalidRequestError`](./src/models/errors/httpclienterrors.ts): Any input used to create a request is invalid.
265
+ * [`UnexpectedClientError`](./src/models/errors/httpclienterrors.ts): Unrecognised or unexpected error.
266
+
267
+
268
+ **Inherit from [`CriblMgmtPlaneError`](./src/models/errors/criblmgmtplaneerror.ts)**:
269
+ * [`ResponseValidationError`](./src/models/errors/responsevalidationerror.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 Custom HTTP Client [http-client] -->
275
+ ## Custom HTTP Client
276
+
277
+ The TypeScript SDK makes API calls using an `HTTPClient` that wraps the native
278
+ [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). This
279
+ client is a thin wrapper around `fetch` and provides the ability to attach hooks
280
+ around the request lifecycle that can be used to modify the request or handle
281
+ errors and response.
282
+
283
+ The `HTTPClient` constructor takes an optional `fetcher` argument that can be
284
+ used to integrate a third-party HTTP client or when writing tests to mock out
285
+ the HTTP client and feed in fixtures.
286
+
287
+ The following example shows how to use the `"beforeRequest"` hook to to add a
288
+ custom header and a timeout to requests and how to use the `"requestError"` hook
289
+ to log errors:
290
+
291
+ ```typescript
292
+ import { CriblMgmtPlane } from "cribl-mgmt-plane";
293
+ import { HTTPClient } from "cribl-mgmt-plane/lib/http";
294
+
295
+ const httpClient = new HTTPClient({
296
+ // fetcher takes a function that has the same signature as native `fetch`.
297
+ fetcher: (request) => {
298
+ return fetch(request);
299
+ }
300
+ });
301
+
302
+ httpClient.addHook("beforeRequest", (request) => {
303
+ const nextRequest = new Request(request, {
304
+ signal: request.signal || AbortSignal.timeout(5000)
305
+ });
306
+
307
+ nextRequest.headers.set("x-custom-header", "custom value");
308
+
309
+ return nextRequest;
310
+ });
311
+
312
+ httpClient.addHook("requestError", (error, request) => {
313
+ console.group("Request Error");
314
+ console.log("Reason:", `${error}`);
315
+ console.log("Endpoint:", `${request.method} ${request.url}`);
316
+ console.groupEnd();
317
+ });
318
+
319
+ const sdk = new CriblMgmtPlane({ httpClient });
320
+ ```
321
+ <!-- End Custom HTTP Client [http-client] -->
322
+
323
+ <!-- Start Debugging [debug] -->
324
+ ## Debugging
325
+
326
+ You can setup your SDK to emit debug logs for SDK requests and responses.
327
+
328
+ You can pass a logger that matches `console`'s interface as an SDK option.
329
+
330
+ > [!WARNING]
331
+ > 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.
332
+
333
+ ```typescript
334
+ import { CriblMgmtPlane } from "cribl-mgmt-plane";
335
+
336
+ const sdk = new CriblMgmtPlane({ debugLogger: console });
337
+ ```
338
+
339
+ You can also enable a default debug logger by setting an environment variable `CRIBLMGMTPLANE_DEBUG` to true.
340
+ <!-- End Debugging [debug] -->
341
+
342
+ <!-- Placeholder for Future Speakeasy SDK Sections -->
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,2 @@
1
+ export declare function assertDefined(value: any): any;
2
+ //# sourceMappingURL=assertions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertions.d.ts","sourceRoot":"","sources":["../../../src/__tests__/assertions.ts"],"names":[],"mappings":"AAMA,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,GAAG,CAM7C"}
@@ -0,0 +1,14 @@
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.assertDefined = assertDefined;
7
+ const assert_1 = require("assert");
8
+ function assertDefined(value) {
9
+ if (value === undefined) {
10
+ (0, assert_1.fail)("value is undefined");
11
+ }
12
+ return value;
13
+ }
14
+ //# sourceMappingURL=assertions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertions.js","sourceRoot":"","sources":["../../../src/__tests__/assertions.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAIH,sCAMC;AARD,mCAA8B;AAE9B,SAAgB,aAAa,CAAC,KAAU;IACtC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,IAAA,aAAI,EAAC,oBAAoB,CAAC,CAAC;IAC7B,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=criblmgmtplane.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"criblmgmtplane.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/criblmgmtplane.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ /*
3
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const vitest_1 = require("vitest");
7
+ const index_js_1 = require("../index.js");
8
+ const testclient_js_1 = require("./testclient.js");
9
+ (0, vitest_1.test)("Criblmgmtplane Dummy Service Status", async () => {
10
+ const testHttpClient = (0, testclient_js_1.createTestHTTPClient)("dummyServiceStatus");
11
+ const criblMgmtPlane = new index_js_1.CriblMgmtPlane({
12
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
13
+ httpClient: testHttpClient,
14
+ bearerAuth: process.env["CRIBLMGMTPLANE_BEARER_AUTH"] ?? "value",
15
+ });
16
+ await criblMgmtPlane.dummyServiceStatus();
17
+ });
18
+ //# sourceMappingURL=criblmgmtplane.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"criblmgmtplane.test.js","sourceRoot":"","sources":["../../../src/__tests__/criblmgmtplane.test.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAEH,mCAA8B;AAC9B,0CAA6C;AAC7C,mDAAuD;AAEvD,IAAA,aAAI,EAAC,qCAAqC,EAAE,KAAK,IAAI,EAAE;IACrD,MAAM,cAAc,GAAG,IAAA,oCAAoB,EAAC,oBAAoB,CAAC,CAAC;IAElE,MAAM,cAAc,GAAG,IAAI,yBAAc,CAAC;QACxC,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,wBAAwB;QACrE,UAAU,EAAE,cAAc;QAC1B,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,IAAI,OAAO;KACjE,CAAC,CAAC;IAEH,MAAM,cAAc,CAAC,kBAAkB,EAAE,CAAC;AAC5C,CAAC,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare function filesToStream(filePath: string): ReadableStream<Uint8Array>;
2
+ export declare function filesToByteArray(filePath: string): Promise<Uint8Array>;
3
+ export declare function filesToString(filePath: string): Promise<string>;
4
+ export declare function streamToByteArray(stream?: ReadableStream<Uint8Array>): Promise<Buffer>;
5
+ export declare function bytesToStream(bytes: Uint8Array): ReadableStream<Uint8Array>;
6
+ //# sourceMappingURL=files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../src/__tests__/files.ts"],"names":[],"mappings":"AAQA,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC,CAI1E;AAED,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAE5E;AAED,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAErE;AAED,wBAAsB,iBAAiB,CACrC,MAAM,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,GAClC,OAAO,CAAC,MAAM,CAAC,CAkBjB;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,cAAc,CAAC,UAAU,CAAC,CAW3E"}
@@ -0,0 +1,51 @@
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.filesToStream = filesToStream;
7
+ exports.filesToByteArray = filesToByteArray;
8
+ exports.filesToString = filesToString;
9
+ exports.streamToByteArray = streamToByteArray;
10
+ exports.bytesToStream = bytesToStream;
11
+ const node_fs_1 = require("node:fs");
12
+ const promises_1 = require("node:fs/promises");
13
+ const node_stream_1 = require("node:stream");
14
+ function filesToStream(filePath) {
15
+ return node_stream_1.Readable.toWeb((0, node_fs_1.createReadStream)(filePath));
16
+ }
17
+ async function filesToByteArray(filePath) {
18
+ return new Uint8Array(await (0, promises_1.readFile)(filePath));
19
+ }
20
+ async function filesToString(filePath) {
21
+ return (0, promises_1.readFile)(filePath, "utf8");
22
+ }
23
+ async function streamToByteArray(stream) {
24
+ if (!stream) {
25
+ return Buffer.from("");
26
+ }
27
+ const chunks = [];
28
+ const reader = stream.getReader();
29
+ let done = false;
30
+ while (!done) {
31
+ const res = await reader.read();
32
+ done = res.done;
33
+ if (res.value) {
34
+ chunks.push(res.value);
35
+ }
36
+ }
37
+ return Buffer.concat(chunks);
38
+ }
39
+ function bytesToStream(bytes) {
40
+ return new ReadableStream({
41
+ start(controller) {
42
+ controller.enqueue(bytes);
43
+ },
44
+ pull(controller) {
45
+ controller.close();
46
+ },
47
+ cancel() {
48
+ },
49
+ });
50
+ }
51
+ //# sourceMappingURL=files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"files.js","sourceRoot":"","sources":["../../../src/__tests__/files.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAMH,sCAIC;AAED,4CAEC;AAED,sCAEC;AAED,8CAoBC;AAED,sCAWC;AAnDD,qCAA2C;AAC3C,+CAA4C;AAC5C,6CAAuC;AAEvC,SAAgB,aAAa,CAAC,QAAgB;IAC5C,OAAO,sBAAQ,CAAC,KAAK,CACnB,IAAA,0BAAgB,EAAC,QAAQ,CAAC,CACc,CAAC;AAC7C,CAAC;AAEM,KAAK,UAAU,gBAAgB,CAAC,QAAgB;IACrD,OAAO,IAAI,UAAU,CAAC,MAAM,IAAA,mBAAQ,EAAC,QAAQ,CAAC,CAAC,CAAC;AAClD,CAAC;AAEM,KAAK,UAAU,aAAa,CAAC,QAAgB;IAClD,OAAO,IAAA,mBAAQ,EAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AACpC,CAAC;AAEM,KAAK,UAAU,iBAAiB,CACrC,MAAmC;IAEnC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACzB,CAAC;IAED,MAAM,MAAM,GAAG,EAAE,CAAC;IAClB,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;IAElC,IAAI,IAAI,GAAG,KAAK,CAAC;IACjB,OAAO,CAAC,IAAI,EAAE,CAAC;QACb,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;QAChC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;QAChB,IAAI,GAAG,CAAC,KAAK,EAAE,CAAC;YACd,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC;AAED,SAAgB,aAAa,CAAC,KAAiB;IAC7C,OAAO,IAAI,cAAc,CAAC;QACxB,KAAK,CAAC,UAAU;YACd,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC;QACD,IAAI,CAAC,UAAU;YACb,UAAU,CAAC,KAAK,EAAE,CAAC;QACrB,CAAC;QACD,MAAM;QACN,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}