@continuous-labs/sdk 0.0.4

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 (675) hide show
  1. package/FUNCTIONS.md +87 -0
  2. package/LICENSE +21 -0
  3. package/README.md +493 -0
  4. package/RUNTIMES.md +48 -0
  5. package/esm/core.d.ts +10 -0
  6. package/esm/core.d.ts.map +1 -0
  7. package/esm/core.js +13 -0
  8. package/esm/core.js.map +1 -0
  9. package/esm/funcs/simulations-create-simulation.d.ts +18 -0
  10. package/esm/funcs/simulations-create-simulation.d.ts.map +1 -0
  11. package/esm/funcs/simulations-create-simulation.js +86 -0
  12. package/esm/funcs/simulations-create-simulation.js.map +1 -0
  13. package/esm/funcs/simulations-delete-simulation.d.ts +18 -0
  14. package/esm/funcs/simulations-delete-simulation.d.ts.map +1 -0
  15. package/esm/funcs/simulations-delete-simulation.js +93 -0
  16. package/esm/funcs/simulations-delete-simulation.js.map +1 -0
  17. package/esm/funcs/simulations-fork-simulation.d.ts +19 -0
  18. package/esm/funcs/simulations-fork-simulation.d.ts.map +1 -0
  19. package/esm/funcs/simulations-fork-simulation.js +93 -0
  20. package/esm/funcs/simulations-fork-simulation.js.map +1 -0
  21. package/esm/funcs/simulations-get-simulation.d.ts +19 -0
  22. package/esm/funcs/simulations-get-simulation.d.ts.map +1 -0
  23. package/esm/funcs/simulations-get-simulation.js +94 -0
  24. package/esm/funcs/simulations-get-simulation.js.map +1 -0
  25. package/esm/funcs/simulations-list-simulation-steps.d.ts +19 -0
  26. package/esm/funcs/simulations-list-simulation-steps.d.ts.map +1 -0
  27. package/esm/funcs/simulations-list-simulation-steps.js +99 -0
  28. package/esm/funcs/simulations-list-simulation-steps.js.map +1 -0
  29. package/esm/funcs/simulations-list-simulations.d.ts +19 -0
  30. package/esm/funcs/simulations-list-simulations.d.ts.map +1 -0
  31. package/esm/funcs/simulations-list-simulations.js +95 -0
  32. package/esm/funcs/simulations-list-simulations.js.map +1 -0
  33. package/esm/funcs/simulations-mint-simulation-token.d.ts +19 -0
  34. package/esm/funcs/simulations-mint-simulation-token.d.ts.map +1 -0
  35. package/esm/funcs/simulations-mint-simulation-token.js +93 -0
  36. package/esm/funcs/simulations-mint-simulation-token.js.map +1 -0
  37. package/esm/funcs/simulations-start-simulation.d.ts +19 -0
  38. package/esm/funcs/simulations-start-simulation.d.ts.map +1 -0
  39. package/esm/funcs/simulations-start-simulation.js +94 -0
  40. package/esm/funcs/simulations-start-simulation.js.map +1 -0
  41. package/esm/funcs/simulations-stop-simulation.d.ts +19 -0
  42. package/esm/funcs/simulations-stop-simulation.d.ts.map +1 -0
  43. package/esm/funcs/simulations-stop-simulation.js +94 -0
  44. package/esm/funcs/simulations-stop-simulation.js.map +1 -0
  45. package/esm/funcs/simulators-build-simulator.d.ts +19 -0
  46. package/esm/funcs/simulators-build-simulator.d.ts.map +1 -0
  47. package/esm/funcs/simulators-build-simulator.js +109 -0
  48. package/esm/funcs/simulators-build-simulator.js.map +1 -0
  49. package/esm/funcs/simulators-cancel-simulator-build.d.ts +19 -0
  50. package/esm/funcs/simulators-cancel-simulator-build.d.ts.map +1 -0
  51. package/esm/funcs/simulators-cancel-simulator-build.js +94 -0
  52. package/esm/funcs/simulators-cancel-simulator-build.js.map +1 -0
  53. package/esm/funcs/simulators-delete-simulator.d.ts +18 -0
  54. package/esm/funcs/simulators-delete-simulator.d.ts.map +1 -0
  55. package/esm/funcs/simulators-delete-simulator.js +93 -0
  56. package/esm/funcs/simulators-delete-simulator.js.map +1 -0
  57. package/esm/funcs/simulators-get-simulator.d.ts +19 -0
  58. package/esm/funcs/simulators-get-simulator.d.ts.map +1 -0
  59. package/esm/funcs/simulators-get-simulator.js +94 -0
  60. package/esm/funcs/simulators-get-simulator.js.map +1 -0
  61. package/esm/funcs/simulators-list-simulators.d.ts +19 -0
  62. package/esm/funcs/simulators-list-simulators.d.ts.map +1 -0
  63. package/esm/funcs/simulators-list-simulators.js +95 -0
  64. package/esm/funcs/simulators-list-simulators.js.map +1 -0
  65. package/esm/funcs/worlds-build-world.d.ts +18 -0
  66. package/esm/funcs/worlds-build-world.d.ts.map +1 -0
  67. package/esm/funcs/worlds-build-world.js +86 -0
  68. package/esm/funcs/worlds-build-world.js.map +1 -0
  69. package/esm/funcs/worlds-cancel-world-build.d.ts +19 -0
  70. package/esm/funcs/worlds-cancel-world-build.d.ts.map +1 -0
  71. package/esm/funcs/worlds-cancel-world-build.js +94 -0
  72. package/esm/funcs/worlds-cancel-world-build.js.map +1 -0
  73. package/esm/funcs/worlds-delete-world.d.ts +18 -0
  74. package/esm/funcs/worlds-delete-world.d.ts.map +1 -0
  75. package/esm/funcs/worlds-delete-world.js +93 -0
  76. package/esm/funcs/worlds-delete-world.js.map +1 -0
  77. package/esm/funcs/worlds-get-world.d.ts +19 -0
  78. package/esm/funcs/worlds-get-world.d.ts.map +1 -0
  79. package/esm/funcs/worlds-get-world.js +94 -0
  80. package/esm/funcs/worlds-get-world.js.map +1 -0
  81. package/esm/funcs/worlds-list-worlds.d.ts +19 -0
  82. package/esm/funcs/worlds-list-worlds.d.ts.map +1 -0
  83. package/esm/funcs/worlds-list-worlds.js +93 -0
  84. package/esm/funcs/worlds-list-worlds.js.map +1 -0
  85. package/esm/funcs/worlds-start-world.d.ts +19 -0
  86. package/esm/funcs/worlds-start-world.d.ts.map +1 -0
  87. package/esm/funcs/worlds-start-world.js +94 -0
  88. package/esm/funcs/worlds-start-world.js.map +1 -0
  89. package/esm/funcs/worlds-stop-world.d.ts +19 -0
  90. package/esm/funcs/worlds-stop-world.d.ts.map +1 -0
  91. package/esm/funcs/worlds-stop-world.js +94 -0
  92. package/esm/funcs/worlds-stop-world.js.map +1 -0
  93. package/esm/hooks/hooks.d.ts +25 -0
  94. package/esm/hooks/hooks.d.ts.map +1 -0
  95. package/esm/hooks/hooks.js +82 -0
  96. package/esm/hooks/hooks.js.map +1 -0
  97. package/esm/hooks/index.d.ts +3 -0
  98. package/esm/hooks/index.d.ts.map +1 -0
  99. package/esm/hooks/index.js +6 -0
  100. package/esm/hooks/index.js.map +1 -0
  101. package/esm/hooks/registration.d.ts +3 -0
  102. package/esm/hooks/registration.d.ts.map +1 -0
  103. package/esm/hooks/registration.js +12 -0
  104. package/esm/hooks/registration.js.map +1 -0
  105. package/esm/hooks/types.d.ts +77 -0
  106. package/esm/hooks/types.d.ts.map +1 -0
  107. package/esm/hooks/types.js +5 -0
  108. package/esm/hooks/types.js.map +1 -0
  109. package/esm/index.d.ts +6 -0
  110. package/esm/index.d.ts.map +1 -0
  111. package/esm/index.js +8 -0
  112. package/esm/index.js.map +1 -0
  113. package/esm/lib/base64.d.ts +10 -0
  114. package/esm/lib/base64.d.ts.map +1 -0
  115. package/esm/lib/base64.js +31 -0
  116. package/esm/lib/base64.js.map +1 -0
  117. package/esm/lib/config.d.ts +38 -0
  118. package/esm/lib/config.d.ts.map +1 -0
  119. package/esm/lib/config.js +34 -0
  120. package/esm/lib/config.js.map +1 -0
  121. package/esm/lib/encodings.d.ts +55 -0
  122. package/esm/lib/encodings.d.ts.map +1 -0
  123. package/esm/lib/encodings.js +407 -0
  124. package/esm/lib/encodings.js.map +1 -0
  125. package/esm/lib/env.d.ts +15 -0
  126. package/esm/lib/env.d.ts.map +1 -0
  127. package/esm/lib/env.js +44 -0
  128. package/esm/lib/env.js.map +1 -0
  129. package/esm/lib/files.d.ts +26 -0
  130. package/esm/lib/files.d.ts.map +1 -0
  131. package/esm/lib/files.js +91 -0
  132. package/esm/lib/files.js.map +1 -0
  133. package/esm/lib/http.d.ts +67 -0
  134. package/esm/lib/http.d.ts.map +1 -0
  135. package/esm/lib/http.js +209 -0
  136. package/esm/lib/http.js.map +1 -0
  137. package/esm/lib/logger.d.ts +6 -0
  138. package/esm/lib/logger.d.ts.map +1 -0
  139. package/esm/lib/logger.js +5 -0
  140. package/esm/lib/logger.js.map +1 -0
  141. package/esm/lib/matchers.d.ts +59 -0
  142. package/esm/lib/matchers.d.ts.map +1 -0
  143. package/esm/lib/matchers.js +202 -0
  144. package/esm/lib/matchers.js.map +1 -0
  145. package/esm/lib/primitives.d.ts +27 -0
  146. package/esm/lib/primitives.d.ts.map +1 -0
  147. package/esm/lib/primitives.js +120 -0
  148. package/esm/lib/primitives.js.map +1 -0
  149. package/esm/lib/retries.d.ts +38 -0
  150. package/esm/lib/retries.d.ts.map +1 -0
  151. package/esm/lib/retries.js +157 -0
  152. package/esm/lib/retries.js.map +1 -0
  153. package/esm/lib/schemas.d.ts +21 -0
  154. package/esm/lib/schemas.d.ts.map +1 -0
  155. package/esm/lib/schemas.js +57 -0
  156. package/esm/lib/schemas.js.map +1 -0
  157. package/esm/lib/sdks.d.ts +63 -0
  158. package/esm/lib/sdks.d.ts.map +1 -0
  159. package/esm/lib/sdks.js +294 -0
  160. package/esm/lib/sdks.js.map +1 -0
  161. package/esm/lib/security.d.ts +84 -0
  162. package/esm/lib/security.d.ts.map +1 -0
  163. package/esm/lib/security.js +147 -0
  164. package/esm/lib/security.js.map +1 -0
  165. package/esm/lib/url.d.ts +5 -0
  166. package/esm/lib/url.d.ts.map +1 -0
  167. package/esm/lib/url.js +24 -0
  168. package/esm/lib/url.js.map +1 -0
  169. package/esm/models/build-simulator-request.d.ts +67 -0
  170. package/esm/models/build-simulator-request.d.ts.map +1 -0
  171. package/esm/models/build-simulator-request.js +41 -0
  172. package/esm/models/build-simulator-request.js.map +1 -0
  173. package/esm/models/build-world-request.d.ts +20 -0
  174. package/esm/models/build-world-request.d.ts.map +1 -0
  175. package/esm/models/build-world-request.js +13 -0
  176. package/esm/models/build-world-request.js.map +1 -0
  177. package/esm/models/create-simulation-request.d.ts +20 -0
  178. package/esm/models/create-simulation-request.d.ts.map +1 -0
  179. package/esm/models/create-simulation-request.js +18 -0
  180. package/esm/models/create-simulation-request.js.map +1 -0
  181. package/esm/models/created-simulation.d.ts +60 -0
  182. package/esm/models/created-simulation.d.ts.map +1 -0
  183. package/esm/models/created-simulation.js +41 -0
  184. package/esm/models/created-simulation.js.map +1 -0
  185. package/esm/models/errors/continuous-default-error.d.ts +10 -0
  186. package/esm/models/errors/continuous-default-error.d.ts.map +1 -0
  187. package/esm/models/errors/continuous-default-error.js +30 -0
  188. package/esm/models/errors/continuous-default-error.js.map +1 -0
  189. package/esm/models/errors/continuous-error.d.ts +19 -0
  190. package/esm/models/errors/continuous-error.d.ts.map +1 -0
  191. package/esm/models/errors/continuous-error.js +26 -0
  192. package/esm/models/errors/continuous-error.js.map +1 -0
  193. package/esm/models/errors/continuous-simulation-default-error.d.ts +10 -0
  194. package/esm/models/errors/continuous-simulation-default-error.d.ts.map +1 -0
  195. package/esm/models/errors/continuous-simulation-default-error.js +30 -0
  196. package/esm/models/errors/continuous-simulation-default-error.js.map +1 -0
  197. package/esm/models/errors/continuous-simulation-error.d.ts +19 -0
  198. package/esm/models/errors/continuous-simulation-error.d.ts.map +1 -0
  199. package/esm/models/errors/continuous-simulation-error.js +26 -0
  200. package/esm/models/errors/continuous-simulation-error.js.map +1 -0
  201. package/esm/models/errors/error.d.ts +32 -0
  202. package/esm/models/errors/error.d.ts.map +1 -0
  203. package/esm/models/errors/error.js +43 -0
  204. package/esm/models/errors/error.js.map +1 -0
  205. package/esm/models/errors/http-client-errors.d.ts +44 -0
  206. package/esm/models/errors/http-client-errors.d.ts.map +1 -0
  207. package/esm/models/errors/http-client-errors.js +56 -0
  208. package/esm/models/errors/http-client-errors.js.map +1 -0
  209. package/esm/models/errors/index.d.ts +7 -0
  210. package/esm/models/errors/index.d.ts.map +1 -0
  211. package/esm/models/errors/index.js +10 -0
  212. package/esm/models/errors/index.js.map +1 -0
  213. package/esm/models/errors/response-validation-error.d.ts +26 -0
  214. package/esm/models/errors/response-validation-error.d.ts.map +1 -0
  215. package/esm/models/errors/response-validation-error.js +37 -0
  216. package/esm/models/errors/response-validation-error.js.map +1 -0
  217. package/esm/models/errors/sdk-validation-error.d.ts +21 -0
  218. package/esm/models/errors/sdk-validation-error.d.ts.map +1 -0
  219. package/esm/models/errors/sdk-validation-error.js +52 -0
  220. package/esm/models/errors/sdk-validation-error.js.map +1 -0
  221. package/esm/models/fork-simulation-request.d.ts +20 -0
  222. package/esm/models/fork-simulation-request.d.ts.map +1 -0
  223. package/esm/models/fork-simulation-request.js +18 -0
  224. package/esm/models/fork-simulation-request.js.map +1 -0
  225. package/esm/models/index.d.ts +19 -0
  226. package/esm/models/index.d.ts.map +1 -0
  227. package/esm/models/index.js +22 -0
  228. package/esm/models/index.js.map +1 -0
  229. package/esm/models/list-simulation-steps-response.d.ts +18 -0
  230. package/esm/models/list-simulation-steps-response.d.ts.map +1 -0
  231. package/esm/models/list-simulation-steps-response.js +21 -0
  232. package/esm/models/list-simulation-steps-response.js.map +1 -0
  233. package/esm/models/list-simulations-response.d.ts +18 -0
  234. package/esm/models/list-simulations-response.d.ts.map +1 -0
  235. package/esm/models/list-simulations-response.js +21 -0
  236. package/esm/models/list-simulations-response.js.map +1 -0
  237. package/esm/models/list-simulators-response.d.ts +18 -0
  238. package/esm/models/list-simulators-response.d.ts.map +1 -0
  239. package/esm/models/list-simulators-response.js +21 -0
  240. package/esm/models/list-simulators-response.js.map +1 -0
  241. package/esm/models/list-worlds-response.d.ts +18 -0
  242. package/esm/models/list-worlds-response.d.ts.map +1 -0
  243. package/esm/models/list-worlds-response.js +21 -0
  244. package/esm/models/list-worlds-response.js.map +1 -0
  245. package/esm/models/mint-simulation-token-request.d.ts +15 -0
  246. package/esm/models/mint-simulation-token-request.d.ts.map +1 -0
  247. package/esm/models/mint-simulation-token-request.js +17 -0
  248. package/esm/models/mint-simulation-token-request.js.map +1 -0
  249. package/esm/models/operations/build-simulator.d.ts +30 -0
  250. package/esm/models/operations/build-simulator.d.ts.map +1 -0
  251. package/esm/models/operations/build-simulator.js +28 -0
  252. package/esm/models/operations/build-simulator.js.map +1 -0
  253. package/esm/models/operations/cancel-simulator-build.d.ts +15 -0
  254. package/esm/models/operations/cancel-simulator-build.d.ts.map +1 -0
  255. package/esm/models/operations/cancel-simulator-build.js +12 -0
  256. package/esm/models/operations/cancel-simulator-build.js.map +1 -0
  257. package/esm/models/operations/cancel-world-build.d.ts +15 -0
  258. package/esm/models/operations/cancel-world-build.d.ts.map +1 -0
  259. package/esm/models/operations/cancel-world-build.js +12 -0
  260. package/esm/models/operations/cancel-world-build.js.map +1 -0
  261. package/esm/models/operations/delete-simulation.d.ts +15 -0
  262. package/esm/models/operations/delete-simulation.d.ts.map +1 -0
  263. package/esm/models/operations/delete-simulation.js +12 -0
  264. package/esm/models/operations/delete-simulation.js.map +1 -0
  265. package/esm/models/operations/delete-simulator.d.ts +15 -0
  266. package/esm/models/operations/delete-simulator.d.ts.map +1 -0
  267. package/esm/models/operations/delete-simulator.js +12 -0
  268. package/esm/models/operations/delete-simulator.js.map +1 -0
  269. package/esm/models/operations/delete-world.d.ts +15 -0
  270. package/esm/models/operations/delete-world.d.ts.map +1 -0
  271. package/esm/models/operations/delete-world.js +12 -0
  272. package/esm/models/operations/delete-world.js.map +1 -0
  273. package/esm/models/operations/fork-simulation.d.ts +18 -0
  274. package/esm/models/operations/fork-simulation.d.ts.map +1 -0
  275. package/esm/models/operations/fork-simulation.js +14 -0
  276. package/esm/models/operations/fork-simulation.js.map +1 -0
  277. package/esm/models/operations/get-simulation.d.ts +15 -0
  278. package/esm/models/operations/get-simulation.d.ts.map +1 -0
  279. package/esm/models/operations/get-simulation.js +12 -0
  280. package/esm/models/operations/get-simulation.js.map +1 -0
  281. package/esm/models/operations/get-simulator.d.ts +15 -0
  282. package/esm/models/operations/get-simulator.d.ts.map +1 -0
  283. package/esm/models/operations/get-simulator.js +12 -0
  284. package/esm/models/operations/get-simulator.js.map +1 -0
  285. package/esm/models/operations/get-world.d.ts +15 -0
  286. package/esm/models/operations/get-world.d.ts.map +1 -0
  287. package/esm/models/operations/get-world.js +12 -0
  288. package/esm/models/operations/get-world.js.map +1 -0
  289. package/esm/models/operations/index.d.ts +20 -0
  290. package/esm/models/operations/index.d.ts.map +1 -0
  291. package/esm/models/operations/index.js +23 -0
  292. package/esm/models/operations/index.js.map +1 -0
  293. package/esm/models/operations/list-simulation-steps.d.ts +25 -0
  294. package/esm/models/operations/list-simulation-steps.d.ts.map +1 -0
  295. package/esm/models/operations/list-simulation-steps.js +14 -0
  296. package/esm/models/operations/list-simulation-steps.js.map +1 -0
  297. package/esm/models/operations/list-simulations.d.ts +45 -0
  298. package/esm/models/operations/list-simulations.d.ts.map +1 -0
  299. package/esm/models/operations/list-simulations.js +30 -0
  300. package/esm/models/operations/list-simulations.js.map +1 -0
  301. package/esm/models/operations/list-simulators.d.ts +46 -0
  302. package/esm/models/operations/list-simulators.d.ts.map +1 -0
  303. package/esm/models/operations/list-simulators.js +26 -0
  304. package/esm/models/operations/list-simulators.js.map +1 -0
  305. package/esm/models/operations/list-worlds.d.ts +20 -0
  306. package/esm/models/operations/list-worlds.d.ts.map +1 -0
  307. package/esm/models/operations/list-worlds.js +13 -0
  308. package/esm/models/operations/list-worlds.js.map +1 -0
  309. package/esm/models/operations/mint-simulation-token.d.ts +18 -0
  310. package/esm/models/operations/mint-simulation-token.d.ts.map +1 -0
  311. package/esm/models/operations/mint-simulation-token.js +14 -0
  312. package/esm/models/operations/mint-simulation-token.js.map +1 -0
  313. package/esm/models/operations/start-simulation.d.ts +15 -0
  314. package/esm/models/operations/start-simulation.d.ts.map +1 -0
  315. package/esm/models/operations/start-simulation.js +12 -0
  316. package/esm/models/operations/start-simulation.js.map +1 -0
  317. package/esm/models/operations/start-world.d.ts +15 -0
  318. package/esm/models/operations/start-world.d.ts.map +1 -0
  319. package/esm/models/operations/start-world.js +12 -0
  320. package/esm/models/operations/start-world.js.map +1 -0
  321. package/esm/models/operations/stop-simulation.d.ts +15 -0
  322. package/esm/models/operations/stop-simulation.d.ts.map +1 -0
  323. package/esm/models/operations/stop-simulation.js +12 -0
  324. package/esm/models/operations/stop-simulation.js.map +1 -0
  325. package/esm/models/operations/stop-world.d.ts +15 -0
  326. package/esm/models/operations/stop-world.d.ts.map +1 -0
  327. package/esm/models/operations/stop-world.js +12 -0
  328. package/esm/models/operations/stop-world.js.map +1 -0
  329. package/esm/models/resource-error.d.ts +17 -0
  330. package/esm/models/resource-error.d.ts.map +1 -0
  331. package/esm/models/resource-error.js +15 -0
  332. package/esm/models/resource-error.js.map +1 -0
  333. package/esm/models/security.d.ts +12 -0
  334. package/esm/models/security.d.ts.map +1 -0
  335. package/esm/models/security.js +12 -0
  336. package/esm/models/security.js.map +1 -0
  337. package/esm/models/simulation-token.d.ts +17 -0
  338. package/esm/models/simulation-token.d.ts.map +1 -0
  339. package/esm/models/simulation-token.js +20 -0
  340. package/esm/models/simulation-token.js.map +1 -0
  341. package/esm/models/simulation.d.ts +52 -0
  342. package/esm/models/simulation.d.ts.map +1 -0
  343. package/esm/models/simulation.js +39 -0
  344. package/esm/models/simulation.js.map +1 -0
  345. package/esm/models/simulator.d.ts +64 -0
  346. package/esm/models/simulator.d.ts.map +1 -0
  347. package/esm/models/simulator.js +50 -0
  348. package/esm/models/simulator.js.map +1 -0
  349. package/esm/models/step.d.ts +17 -0
  350. package/esm/models/step.d.ts.map +1 -0
  351. package/esm/models/step.js +15 -0
  352. package/esm/models/step.js.map +1 -0
  353. package/esm/models/world-simulation.d.ts +17 -0
  354. package/esm/models/world-simulation.d.ts.map +1 -0
  355. package/esm/models/world-simulation.js +20 -0
  356. package/esm/models/world-simulation.js.map +1 -0
  357. package/esm/models/world.d.ts +54 -0
  358. package/esm/models/world.d.ts.map +1 -0
  359. package/esm/models/world.js +41 -0
  360. package/esm/models/world.js.map +1 -0
  361. package/esm/sdk/index.d.ts +2 -0
  362. package/esm/sdk/index.d.ts.map +1 -0
  363. package/esm/sdk/index.js +5 -0
  364. package/esm/sdk/index.js.map +1 -0
  365. package/esm/sdk/sdk.d.ts +13 -0
  366. package/esm/sdk/sdk.d.ts.map +1 -0
  367. package/esm/sdk/sdk.js +22 -0
  368. package/esm/sdk/sdk.js.map +1 -0
  369. package/esm/sdk/simulations.d.ts +69 -0
  370. package/esm/sdk/simulations.d.ts.map +1 -0
  371. package/esm/sdk/simulations.js +98 -0
  372. package/esm/sdk/simulations.js.map +1 -0
  373. package/esm/sdk/simulators.d.ts +41 -0
  374. package/esm/sdk/simulators.d.ts.map +1 -0
  375. package/esm/sdk/simulators.js +58 -0
  376. package/esm/sdk/simulators.js.map +1 -0
  377. package/esm/sdk/worlds.d.ts +55 -0
  378. package/esm/sdk/worlds.d.ts.map +1 -0
  379. package/esm/sdk/worlds.js +78 -0
  380. package/esm/sdk/worlds.js.map +1 -0
  381. package/esm/types/async.d.ts +23 -0
  382. package/esm/types/async.d.ts.map +1 -0
  383. package/esm/types/async.js +28 -0
  384. package/esm/types/async.js.map +1 -0
  385. package/esm/types/blobs.d.ts +4 -0
  386. package/esm/types/blobs.d.ts.map +1 -0
  387. package/esm/types/blobs.js +25 -0
  388. package/esm/types/blobs.js.map +1 -0
  389. package/esm/types/const-date-time.d.ts +3 -0
  390. package/esm/types/const-date-time.d.ts.map +1 -0
  391. package/esm/types/const-date-time.js +10 -0
  392. package/esm/types/const-date-time.js.map +1 -0
  393. package/esm/types/default-to-zero-value.d.ts +12 -0
  394. package/esm/types/default-to-zero-value.d.ts.map +1 -0
  395. package/esm/types/default-to-zero-value.js +31 -0
  396. package/esm/types/default-to-zero-value.js.map +1 -0
  397. package/esm/types/enums.d.ts +9 -0
  398. package/esm/types/enums.d.ts.map +1 -0
  399. package/esm/types/enums.js +27 -0
  400. package/esm/types/enums.js.map +1 -0
  401. package/esm/types/fp.d.ts +31 -0
  402. package/esm/types/fp.d.ts.map +1 -0
  403. package/esm/types/fp.js +31 -0
  404. package/esm/types/fp.js.map +1 -0
  405. package/esm/types/index.d.ts +10 -0
  406. package/esm/types/index.d.ts.map +1 -0
  407. package/esm/types/index.js +10 -0
  408. package/esm/types/index.js.map +1 -0
  409. package/esm/types/operations.d.ts +27 -0
  410. package/esm/types/operations.d.ts.map +1 -0
  411. package/esm/types/operations.js +77 -0
  412. package/esm/types/operations.js.map +1 -0
  413. package/esm/types/primitives.d.ts +9 -0
  414. package/esm/types/primitives.d.ts.map +1 -0
  415. package/esm/types/primitives.js +109 -0
  416. package/esm/types/primitives.js.map +1 -0
  417. package/esm/types/rfcdate.d.ts +21 -0
  418. package/esm/types/rfcdate.d.ts.map +1 -0
  419. package/esm/types/rfcdate.js +43 -0
  420. package/esm/types/rfcdate.js.map +1 -0
  421. package/esm/types/smart-union.d.ts +7 -0
  422. package/esm/types/smart-union.d.ts.map +1 -0
  423. package/esm/types/smart-union.js +117 -0
  424. package/esm/types/smart-union.js.map +1 -0
  425. package/esm/types/streams.d.ts +2 -0
  426. package/esm/types/streams.d.ts.map +1 -0
  427. package/esm/types/streams.js +15 -0
  428. package/esm/types/streams.js.map +1 -0
  429. package/esm/types/unrecognized.d.ts +16 -0
  430. package/esm/types/unrecognized.d.ts.map +1 -0
  431. package/esm/types/unrecognized.js +31 -0
  432. package/esm/types/unrecognized.js.map +1 -0
  433. package/examples/node_modules/@types/node/assert/strict.d.ts +8 -0
  434. package/examples/node_modules/@types/node/assert.d.ts +1062 -0
  435. package/examples/node_modules/@types/node/async_hooks.d.ts +605 -0
  436. package/examples/node_modules/@types/node/buffer.buffer.d.ts +471 -0
  437. package/examples/node_modules/@types/node/buffer.d.ts +1936 -0
  438. package/examples/node_modules/@types/node/child_process.d.ts +1475 -0
  439. package/examples/node_modules/@types/node/cluster.d.ts +577 -0
  440. package/examples/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
  441. package/examples/node_modules/@types/node/compatibility/index.d.ts +9 -0
  442. package/examples/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
  443. package/examples/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  444. package/examples/node_modules/@types/node/console.d.ts +452 -0
  445. package/examples/node_modules/@types/node/constants.d.ts +21 -0
  446. package/examples/node_modules/@types/node/crypto.d.ts +4590 -0
  447. package/examples/node_modules/@types/node/dgram.d.ts +597 -0
  448. package/examples/node_modules/@types/node/diagnostics_channel.d.ts +578 -0
  449. package/examples/node_modules/@types/node/dns/promises.d.ts +479 -0
  450. package/examples/node_modules/@types/node/dns.d.ts +871 -0
  451. package/examples/node_modules/@types/node/domain.d.ts +170 -0
  452. package/examples/node_modules/@types/node/events.d.ts +977 -0
  453. package/examples/node_modules/@types/node/fs/promises.d.ts +1270 -0
  454. package/examples/node_modules/@types/node/fs.d.ts +4375 -0
  455. package/examples/node_modules/@types/node/globals.d.ts +172 -0
  456. package/examples/node_modules/@types/node/globals.typedarray.d.ts +38 -0
  457. package/examples/node_modules/@types/node/http.d.ts +2049 -0
  458. package/examples/node_modules/@types/node/http2.d.ts +2712 -0
  459. package/examples/node_modules/@types/node/https.d.ts +578 -0
  460. package/examples/node_modules/@types/node/index.d.ts +93 -0
  461. package/examples/node_modules/@types/node/inspector.generated.d.ts +3966 -0
  462. package/examples/node_modules/@types/node/module.d.ts +539 -0
  463. package/examples/node_modules/@types/node/net.d.ts +1031 -0
  464. package/examples/node_modules/@types/node/os.d.ts +506 -0
  465. package/examples/node_modules/@types/node/path.d.ts +200 -0
  466. package/examples/node_modules/@types/node/perf_hooks.d.ts +961 -0
  467. package/examples/node_modules/@types/node/process.d.ts +1961 -0
  468. package/examples/node_modules/@types/node/punycode.d.ts +117 -0
  469. package/examples/node_modules/@types/node/querystring.d.ts +152 -0
  470. package/examples/node_modules/@types/node/readline/promises.d.ts +162 -0
  471. package/examples/node_modules/@types/node/readline.d.ts +589 -0
  472. package/examples/node_modules/@types/node/repl.d.ts +430 -0
  473. package/examples/node_modules/@types/node/sea.d.ts +153 -0
  474. package/examples/node_modules/@types/node/stream/consumers.d.ts +38 -0
  475. package/examples/node_modules/@types/node/stream/promises.d.ts +90 -0
  476. package/examples/node_modules/@types/node/stream/web.d.ts +533 -0
  477. package/examples/node_modules/@types/node/stream.d.ts +1698 -0
  478. package/examples/node_modules/@types/node/string_decoder.d.ts +67 -0
  479. package/examples/node_modules/@types/node/test.d.ts +1787 -0
  480. package/examples/node_modules/@types/node/timers/promises.d.ts +108 -0
  481. package/examples/node_modules/@types/node/timers.d.ts +286 -0
  482. package/examples/node_modules/@types/node/tls.d.ts +1259 -0
  483. package/examples/node_modules/@types/node/trace_events.d.ts +197 -0
  484. package/examples/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +468 -0
  485. package/examples/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +34 -0
  486. package/examples/node_modules/@types/node/ts5.6/index.d.ts +93 -0
  487. package/examples/node_modules/@types/node/tty.d.ts +208 -0
  488. package/examples/node_modules/@types/node/url.d.ts +964 -0
  489. package/examples/node_modules/@types/node/util.d.ts +2331 -0
  490. package/examples/node_modules/@types/node/v8.d.ts +809 -0
  491. package/examples/node_modules/@types/node/vm.d.ts +1001 -0
  492. package/examples/node_modules/@types/node/wasi.d.ts +181 -0
  493. package/examples/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
  494. package/examples/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
  495. package/examples/node_modules/@types/node/web-globals/events.d.ts +97 -0
  496. package/examples/node_modules/@types/node/web-globals/fetch.d.ts +55 -0
  497. package/examples/node_modules/@types/node/worker_threads.d.ts +715 -0
  498. package/examples/node_modules/@types/node/zlib.d.ts +598 -0
  499. package/examples/node_modules/dotenv/config.d.ts +1 -0
  500. package/examples/node_modules/dotenv/config.js +9 -0
  501. package/examples/node_modules/dotenv/lib/cli-options.js +17 -0
  502. package/examples/node_modules/dotenv/lib/env-options.js +28 -0
  503. package/examples/node_modules/dotenv/lib/main.d.ts +162 -0
  504. package/examples/node_modules/dotenv/lib/main.js +386 -0
  505. package/examples/node_modules/esbuild/install.js +300 -0
  506. package/examples/node_modules/esbuild/lib/main.d.ts +720 -0
  507. package/examples/node_modules/esbuild/lib/main.js +2536 -0
  508. package/examples/node_modules/tsx/dist/cjs/api/index.mjs +1 -0
  509. package/examples/node_modules/tsx/dist/cjs/index.mjs +1 -0
  510. package/examples/node_modules/tsx/dist/cli.mjs +55 -0
  511. package/examples/node_modules/tsx/dist/client-D_mPDF5S.mjs +1 -0
  512. package/examples/node_modules/tsx/dist/esm/api/index.mjs +1 -0
  513. package/examples/node_modules/tsx/dist/esm/index.mjs +1 -0
  514. package/examples/node_modules/tsx/dist/get-pipe-path-_tAJyU_v.mjs +1 -0
  515. package/examples/node_modules/tsx/dist/index-DCefr8NP.mjs +14 -0
  516. package/examples/node_modules/tsx/dist/index-gbaejti9.mjs +1 -0
  517. package/examples/node_modules/tsx/dist/lexer-DQCqS3nf.mjs +3 -0
  518. package/examples/node_modules/tsx/dist/loader.mjs +1 -0
  519. package/examples/node_modules/tsx/dist/node-features-JeyyvQz6.mjs +1 -0
  520. package/examples/node_modules/tsx/dist/package-BL7Whz21.mjs +1 -0
  521. package/examples/node_modules/tsx/dist/patch-repl.mjs +1 -0
  522. package/examples/node_modules/tsx/dist/preflight.mjs +1 -0
  523. package/examples/node_modules/tsx/dist/register-DHgpdRjs.mjs +10 -0
  524. package/examples/node_modules/tsx/dist/register-SoqaU4rg.mjs +2 -0
  525. package/examples/node_modules/tsx/dist/repl.mjs +3 -0
  526. package/examples/node_modules/tsx/dist/require-Cuv-0BLU.mjs +1 -0
  527. package/examples/node_modules/tsx/dist/suppress-warnings.mjs +1 -0
  528. package/examples/node_modules/tsx/dist/temporary-directory-BDDVQOvU.mjs +1 -0
  529. package/examples/node_modules/tsx/dist/types-Cxp8y2TL.d.ts +5 -0
  530. package/examples/node_modules/undici-types/agent.d.ts +31 -0
  531. package/examples/node_modules/undici-types/api.d.ts +43 -0
  532. package/examples/node_modules/undici-types/balanced-pool.d.ts +29 -0
  533. package/examples/node_modules/undici-types/cache.d.ts +36 -0
  534. package/examples/node_modules/undici-types/client.d.ts +108 -0
  535. package/examples/node_modules/undici-types/connector.d.ts +34 -0
  536. package/examples/node_modules/undici-types/content-type.d.ts +21 -0
  537. package/examples/node_modules/undici-types/cookies.d.ts +28 -0
  538. package/examples/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
  539. package/examples/node_modules/undici-types/dispatcher.d.ts +256 -0
  540. package/examples/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
  541. package/examples/node_modules/undici-types/errors.d.ts +149 -0
  542. package/examples/node_modules/undici-types/eventsource.d.ts +61 -0
  543. package/examples/node_modules/undici-types/fetch.d.ts +209 -0
  544. package/examples/node_modules/undici-types/file.d.ts +39 -0
  545. package/examples/node_modules/undici-types/filereader.d.ts +54 -0
  546. package/examples/node_modules/undici-types/formdata.d.ts +108 -0
  547. package/examples/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  548. package/examples/node_modules/undici-types/global-origin.d.ts +7 -0
  549. package/examples/node_modules/undici-types/handlers.d.ts +15 -0
  550. package/examples/node_modules/undici-types/header.d.ts +4 -0
  551. package/examples/node_modules/undici-types/index.d.ts +71 -0
  552. package/examples/node_modules/undici-types/interceptors.d.ts +17 -0
  553. package/examples/node_modules/undici-types/mock-agent.d.ts +50 -0
  554. package/examples/node_modules/undici-types/mock-client.d.ts +25 -0
  555. package/examples/node_modules/undici-types/mock-errors.d.ts +12 -0
  556. package/examples/node_modules/undici-types/mock-interceptor.d.ts +93 -0
  557. package/examples/node_modules/undici-types/mock-pool.d.ts +25 -0
  558. package/examples/node_modules/undici-types/patch.d.ts +33 -0
  559. package/examples/node_modules/undici-types/pool-stats.d.ts +19 -0
  560. package/examples/node_modules/undici-types/pool.d.ts +39 -0
  561. package/examples/node_modules/undici-types/proxy-agent.d.ts +28 -0
  562. package/examples/node_modules/undici-types/readable.d.ts +65 -0
  563. package/examples/node_modules/undici-types/retry-agent.d.ts +8 -0
  564. package/examples/node_modules/undici-types/retry-handler.d.ts +116 -0
  565. package/examples/node_modules/undici-types/util.d.ts +18 -0
  566. package/examples/node_modules/undici-types/webidl.d.ts +228 -0
  567. package/examples/node_modules/undici-types/websocket.d.ts +150 -0
  568. package/examples/simulationsListSimulations.example.ts +26 -0
  569. package/jsr.json +27 -0
  570. package/package.json +67 -0
  571. package/src/core.ts +13 -0
  572. package/src/funcs/simulations-create-simulation.ts +179 -0
  573. package/src/funcs/simulations-delete-simulation.ts +183 -0
  574. package/src/funcs/simulations-fork-simulation.ts +186 -0
  575. package/src/funcs/simulations-get-simulation.ts +183 -0
  576. package/src/funcs/simulations-list-simulation-steps.ts +190 -0
  577. package/src/funcs/simulations-list-simulations.ts +189 -0
  578. package/src/funcs/simulations-mint-simulation-token.ts +187 -0
  579. package/src/funcs/simulations-start-simulation.ts +183 -0
  580. package/src/funcs/simulations-stop-simulation.ts +183 -0
  581. package/src/funcs/simulators-build-simulator.ts +219 -0
  582. package/src/funcs/simulators-cancel-simulator-build.ts +184 -0
  583. package/src/funcs/simulators-delete-simulator.ts +182 -0
  584. package/src/funcs/simulators-get-simulator.ts +183 -0
  585. package/src/funcs/simulators-list-simulators.ts +189 -0
  586. package/src/funcs/worlds-build-world.ts +179 -0
  587. package/src/funcs/worlds-cancel-world-build.ts +184 -0
  588. package/src/funcs/worlds-delete-world.ts +182 -0
  589. package/src/funcs/worlds-get-world.ts +183 -0
  590. package/src/funcs/worlds-list-worlds.ts +184 -0
  591. package/src/funcs/worlds-start-world.ts +183 -0
  592. package/src/funcs/worlds-stop-world.ts +183 -0
  593. package/src/hooks/hooks.ts +132 -0
  594. package/src/hooks/index.ts +6 -0
  595. package/src/hooks/registration.ts +14 -0
  596. package/src/hooks/types.ts +108 -0
  597. package/src/index.ts +9 -0
  598. package/src/lib/base64.ts +39 -0
  599. package/src/lib/config.ts +67 -0
  600. package/src/lib/encodings.ts +564 -0
  601. package/src/lib/env.ts +61 -0
  602. package/src/lib/files.ts +104 -0
  603. package/src/lib/http.ts +325 -0
  604. package/src/lib/logger.ts +9 -0
  605. package/src/lib/matchers.ts +353 -0
  606. package/src/lib/primitives.ts +166 -0
  607. package/src/lib/retries.ts +226 -0
  608. package/src/lib/schemas.ts +94 -0
  609. package/src/lib/sdks.ts +442 -0
  610. package/src/lib/security.ts +280 -0
  611. package/src/lib/url.ts +35 -0
  612. package/src/models/build-simulator-request.ts +107 -0
  613. package/src/models/build-world-request.ts +39 -0
  614. package/src/models/create-simulation-request.ts +47 -0
  615. package/src/models/created-simulation.ts +106 -0
  616. package/src/models/errors/continuous-default-error.ts +40 -0
  617. package/src/models/errors/continuous-error.ts +35 -0
  618. package/src/models/errors/error.ts +65 -0
  619. package/src/models/errors/http-client-errors.ts +62 -0
  620. package/src/models/errors/index.ts +10 -0
  621. package/src/models/errors/response-validation-error.ts +50 -0
  622. package/src/models/errors/sdk-validation-error.ts +54 -0
  623. package/src/models/fork-simulation-request.ts +47 -0
  624. package/src/models/index.ts +22 -0
  625. package/src/models/list-simulation-steps-response.ts +48 -0
  626. package/src/models/list-simulations-response.ts +48 -0
  627. package/src/models/list-simulators-response.ts +48 -0
  628. package/src/models/list-worlds-response.ts +48 -0
  629. package/src/models/mint-simulation-token-request.ts +41 -0
  630. package/src/models/operations/build-simulator.ts +68 -0
  631. package/src/models/operations/cancel-simulator-build.ts +35 -0
  632. package/src/models/operations/cancel-world-build.ts +33 -0
  633. package/src/models/operations/delete-simulation.ts +33 -0
  634. package/src/models/operations/delete-simulator.ts +33 -0
  635. package/src/models/operations/delete-world.ts +33 -0
  636. package/src/models/operations/fork-simulation.ts +37 -0
  637. package/src/models/operations/get-simulation.ts +33 -0
  638. package/src/models/operations/get-simulator.ts +33 -0
  639. package/src/models/operations/get-world.ts +31 -0
  640. package/src/models/operations/index.ts +23 -0
  641. package/src/models/operations/list-simulation-steps.ts +45 -0
  642. package/src/models/operations/list-simulations.ts +78 -0
  643. package/src/models/operations/list-simulators.ts +71 -0
  644. package/src/models/operations/list-worlds.ts +39 -0
  645. package/src/models/operations/mint-simulation-token.ts +37 -0
  646. package/src/models/operations/start-simulation.ts +33 -0
  647. package/src/models/operations/start-world.ts +33 -0
  648. package/src/models/operations/stop-simulation.ts +33 -0
  649. package/src/models/operations/stop-world.ts +33 -0
  650. package/src/models/resource-error.ts +39 -0
  651. package/src/models/security.ts +26 -0
  652. package/src/models/simulation-token.ts +47 -0
  653. package/src/models/simulation.ts +93 -0
  654. package/src/models/simulator.ts +110 -0
  655. package/src/models/step.ts +36 -0
  656. package/src/models/world-simulation.ts +47 -0
  657. package/src/models/world.ts +96 -0
  658. package/src/sdk/index.ts +5 -0
  659. package/src/sdk/sdk.ts +25 -0
  660. package/src/sdk/simulations.ts +172 -0
  661. package/src/sdk/simulators.ts +100 -0
  662. package/src/sdk/worlds.ts +136 -0
  663. package/src/types/async.ts +69 -0
  664. package/src/types/blobs.ts +33 -0
  665. package/src/types/const-date-time.ts +15 -0
  666. package/src/types/default-to-zero-value.ts +33 -0
  667. package/src/types/enums.ts +45 -0
  668. package/src/types/fp.ts +50 -0
  669. package/src/types/index.ts +13 -0
  670. package/src/types/operations.ts +105 -0
  671. package/src/types/primitives.ts +140 -0
  672. package/src/types/rfcdate.ts +54 -0
  673. package/src/types/smart-union.ts +153 -0
  674. package/src/types/streams.ts +21 -0
  675. package/src/types/unrecognized.ts +35 -0
@@ -0,0 +1,564 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { bytesToBase64 } from "./base64.js";
6
+ import { isPlainObject } from "./primitives.js";
7
+
8
+ export class EncodingError extends Error {
9
+ constructor(message: string) {
10
+ super(message);
11
+ this.name = "EncodingError";
12
+ }
13
+ }
14
+
15
+ export type CharEncoding = "percent" | "percentExceptReserved" | "none";
16
+
17
+ const reservedEscapes = /%(2[346bcf]|3[abdf]|40|5[bd])/gi;
18
+
19
+ function encodeKeyChars(
20
+ v: string,
21
+ charEncoding: CharEncoding | undefined,
22
+ ): string {
23
+ return encodeChars(
24
+ v,
25
+ charEncoding === "percentExceptReserved" ? "percent" : charEncoding,
26
+ );
27
+ }
28
+
29
+ function encodeChars(
30
+ v: string,
31
+ charEncoding: CharEncoding | undefined,
32
+ ): string {
33
+ switch (charEncoding) {
34
+ case "percent":
35
+ return encodeURIComponent(v);
36
+ case "percentExceptReserved":
37
+ return encodeURIComponent(v).replace(
38
+ reservedEscapes,
39
+ (m) => decodeURIComponent(m),
40
+ );
41
+ default:
42
+ return v;
43
+ }
44
+ }
45
+
46
+ export function encodeMatrix(
47
+ key: string,
48
+ value: unknown,
49
+ options?: { explode?: boolean; charEncoding?: CharEncoding },
50
+ ): string | undefined {
51
+ let out = "";
52
+ const pairs: [string, unknown][] = options?.explode
53
+ ? explode(key, value)
54
+ : [[key, value]];
55
+
56
+ if (pairs.every(([_, v]) => v == null)) {
57
+ return;
58
+ }
59
+
60
+ const encodeString = (v: string) => {
61
+ return encodeChars(v, options?.charEncoding);
62
+ };
63
+ const encodeValue = (v: unknown) => encodeString(serializeValue(v));
64
+
65
+ pairs.forEach(([pk, pv]) => {
66
+ let tmp = "";
67
+ let encValue: string | null | undefined = null;
68
+
69
+ if (pv == null) {
70
+ return;
71
+ } else if (Array.isArray(pv)) {
72
+ encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(",");
73
+ } else if (isPlainObject(pv)) {
74
+ const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => {
75
+ return `,${encodeString(k)},${encodeValue(v)}`;
76
+ });
77
+ encValue = mapped?.join("").slice(1);
78
+ } else {
79
+ encValue = `${encodeValue(pv)}`;
80
+ }
81
+
82
+ if (encValue == null) {
83
+ return;
84
+ }
85
+
86
+ const keyPrefix = encodeKeyChars(pk, options?.charEncoding);
87
+ tmp = `${keyPrefix}=${encValue}`;
88
+ // trim trailing '=' if value was empty
89
+ if (tmp === `${keyPrefix}=`) {
90
+ tmp = tmp.slice(0, -1);
91
+ }
92
+
93
+ // If we end up with the nothing then skip forward
94
+ if (!tmp) {
95
+ return;
96
+ }
97
+
98
+ out += `;${tmp}`;
99
+ });
100
+
101
+ return out;
102
+ }
103
+
104
+ export function encodeLabel(
105
+ key: string,
106
+ value: unknown,
107
+ options?: { explode?: boolean; charEncoding?: CharEncoding },
108
+ ): string | undefined {
109
+ let out = "";
110
+ const pairs: [string, unknown][] = options?.explode
111
+ ? explode(key, value)
112
+ : [[key, value]];
113
+
114
+ if (pairs.every(([_, v]) => v == null)) {
115
+ return;
116
+ }
117
+
118
+ const encodeString = (v: string) => {
119
+ return encodeChars(v, options?.charEncoding);
120
+ };
121
+ const encodeValue = (v: unknown) => encodeString(serializeValue(v));
122
+
123
+ pairs.forEach(([pk, pv]) => {
124
+ let encValue: string | null | undefined = "";
125
+
126
+ if (pv == null) {
127
+ return;
128
+ } else if (Array.isArray(pv)) {
129
+ encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(".");
130
+ } else if (isPlainObject(pv)) {
131
+ const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => {
132
+ return `.${encodeString(k)}.${encodeValue(v)}`;
133
+ });
134
+ encValue = mapped?.join("").slice(1);
135
+ } else {
136
+ const k = options?.explode && isPlainObject(value)
137
+ ? `${encodeKeyChars(pk, options?.charEncoding)}=`
138
+ : "";
139
+ encValue = `${k}${encodeValue(pv)}`;
140
+ }
141
+
142
+ out += encValue == null ? "" : `.${encValue}`;
143
+ });
144
+
145
+ return out;
146
+ }
147
+
148
+ type FormEncoder = (
149
+ key: string,
150
+ value: unknown,
151
+ options?: { explode?: boolean; charEncoding?: CharEncoding },
152
+ ) => string | undefined;
153
+
154
+ function formEncoder(sep: string): FormEncoder {
155
+ return (
156
+ key: string,
157
+ value: unknown,
158
+ options?: { explode?: boolean; charEncoding?: CharEncoding },
159
+ ) => {
160
+ let out = "";
161
+ const pairs: [string, unknown][] = options?.explode
162
+ ? explode(key, value)
163
+ : [[key, value]];
164
+
165
+ if (pairs.every(([_, v]) => v == null)) {
166
+ return;
167
+ }
168
+
169
+ const encodeString = (v: string) => {
170
+ return encodeChars(v, options?.charEncoding);
171
+ };
172
+
173
+ const encodeValue = (v: unknown) => encodeString(serializeValue(v));
174
+
175
+ const encodedSep = encodeString(sep);
176
+
177
+ pairs.forEach(([pk, pv]) => {
178
+ let tmp = "";
179
+ let encValue: string | null | undefined = null;
180
+
181
+ if (pv == null) {
182
+ return;
183
+ } else if (Array.isArray(pv)) {
184
+ encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(encodedSep);
185
+ } else if (isPlainObject(pv)) {
186
+ encValue = mapDefinedEntries(Object.entries(pv), ([k, v]) => {
187
+ return `${encodeString(k)}${encodedSep}${encodeValue(v)}`;
188
+ })?.join(encodedSep);
189
+ } else {
190
+ encValue = `${encodeValue(pv)}`;
191
+ }
192
+
193
+ if (encValue == null) {
194
+ return;
195
+ }
196
+
197
+ tmp = `${encodeKeyChars(pk, options?.charEncoding)}=${encValue}`;
198
+
199
+ // If we end up with the nothing then skip forward
200
+ if (!tmp || tmp === "=") {
201
+ return;
202
+ }
203
+
204
+ out += `&${tmp}`;
205
+ });
206
+
207
+ return out.slice(1);
208
+ };
209
+ }
210
+
211
+ export const encodeForm = formEncoder(",");
212
+ export const encodeSpaceDelimited = formEncoder(" ");
213
+ export const encodePipeDelimited = formEncoder("|");
214
+
215
+ export function encodeBodyForm(
216
+ key: string,
217
+ value: unknown,
218
+ options?: { explode?: boolean; charEncoding?: CharEncoding },
219
+ ): string {
220
+ let out = "";
221
+ const pairs: [string, unknown][] = options?.explode
222
+ ? explode(key, value)
223
+ : [[key, value]];
224
+
225
+ const encodeString = (v: string) => {
226
+ return encodeChars(v, options?.charEncoding);
227
+ };
228
+
229
+ const encodeValue = (v: unknown) => encodeString(serializeValue(v));
230
+
231
+ pairs.forEach(([pk, pv]) => {
232
+ let tmp = "";
233
+ let encValue = "";
234
+
235
+ if (pv == null) {
236
+ return;
237
+ } else if (Array.isArray(pv)) {
238
+ encValue = JSON.stringify(pv, jsonReplacer);
239
+ } else if (isPlainObject(pv)) {
240
+ encValue = JSON.stringify(pv, jsonReplacer);
241
+ } else {
242
+ encValue = `${encodeValue(pv)}`;
243
+ }
244
+
245
+ tmp = `${encodeKeyChars(pk, options?.charEncoding)}=${encValue}`;
246
+
247
+ // If we end up with the nothing then skip forward
248
+ if (!tmp || tmp === "=") {
249
+ return;
250
+ }
251
+
252
+ out += `&${tmp}`;
253
+ });
254
+
255
+ return out.slice(1);
256
+ }
257
+
258
+ export function encodeDeepObject(
259
+ key: string,
260
+ value: unknown,
261
+ options?: { charEncoding?: CharEncoding },
262
+ ): string | undefined {
263
+ if (value == null) {
264
+ return;
265
+ }
266
+
267
+ if (!isPlainObject(value)) {
268
+ throw new EncodingError(
269
+ `Value of parameter '${key}' which uses deepObject encoding must be an object or null`,
270
+ );
271
+ }
272
+
273
+ return encodeDeepObjectObject(key, value, options);
274
+ }
275
+
276
+ export function encodeDeepObjectObject(
277
+ key: string,
278
+ value: unknown,
279
+ options?: { charEncoding?: CharEncoding },
280
+ ): string | undefined {
281
+ if (value == null) {
282
+ return;
283
+ }
284
+
285
+ let out = "";
286
+
287
+ const encodeString = (v: string) => {
288
+ return encodeChars(v, options?.charEncoding);
289
+ };
290
+
291
+ if (!isPlainObject(value)) {
292
+ throw new EncodingError(`Expected parameter '${key}' to be an object.`);
293
+ }
294
+
295
+ Object.entries(value).forEach(([ck, cv]) => {
296
+ if (cv == null) {
297
+ return;
298
+ }
299
+
300
+ const pk = `${key}[${ck}]`;
301
+
302
+ if (isPlainObject(cv)) {
303
+ const objOut = encodeDeepObjectObject(pk, cv, options);
304
+
305
+ out += objOut == null ? "" : `&${objOut}`;
306
+
307
+ return;
308
+ }
309
+
310
+ const pairs: unknown[] = Array.isArray(cv) ? cv : [cv];
311
+ const encoded = mapDefined(pairs, (v) => {
312
+ return `${encodeKeyChars(pk, options?.charEncoding)}=${
313
+ encodeString(serializeValue(v))
314
+ }`;
315
+ })?.join("&");
316
+
317
+ out += encoded == null ? "" : `&${encoded}`;
318
+ });
319
+
320
+ return out.slice(1);
321
+ }
322
+
323
+ export function encodeJSON(
324
+ key: string,
325
+ value: unknown,
326
+ options?: { explode?: boolean; charEncoding?: CharEncoding },
327
+ ): string | undefined {
328
+ if (typeof value === "undefined") {
329
+ return;
330
+ }
331
+
332
+ const encodeString = (v: string) => {
333
+ return encodeChars(v, options?.charEncoding);
334
+ };
335
+
336
+ const encVal = encodeString(JSON.stringify(value, jsonReplacer));
337
+
338
+ return options?.explode
339
+ ? encVal
340
+ : `${encodeKeyChars(key, options?.charEncoding)}=${encVal}`;
341
+ }
342
+
343
+ export const encodeSimple = (
344
+ key: string,
345
+ value: unknown,
346
+ options?: { explode?: boolean; charEncoding?: CharEncoding },
347
+ ): string | undefined => {
348
+ let out = "";
349
+ const pairs: [string, unknown][] = options?.explode
350
+ ? explode(key, value)
351
+ : [[key, value]];
352
+
353
+ if (pairs.every(([_, v]) => v == null)) {
354
+ return;
355
+ }
356
+
357
+ const encodeString = (v: string) => {
358
+ return encodeChars(v, options?.charEncoding);
359
+ };
360
+ const encodeValue = (v: unknown) => encodeString(serializeValue(v));
361
+
362
+ pairs.forEach(([pk, pv]) => {
363
+ let tmp: string | null | undefined = "";
364
+
365
+ if (pv == null) {
366
+ return;
367
+ } else if (Array.isArray(pv)) {
368
+ tmp = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(",");
369
+ } else if (isPlainObject(pv)) {
370
+ const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => {
371
+ return `,${encodeString(k)},${encodeValue(v)}`;
372
+ });
373
+ tmp = mapped?.join("").slice(1);
374
+ } else {
375
+ const k = options?.explode && isPlainObject(value) ? `${pk}=` : "";
376
+ tmp = `${k}${encodeValue(pv)}`;
377
+ }
378
+
379
+ out += tmp ? `,${tmp}` : "";
380
+ });
381
+
382
+ return out.slice(1);
383
+ };
384
+
385
+ function explode(key: string, value: unknown): [string, unknown][] {
386
+ if (Array.isArray(value)) {
387
+ return value.map((v) => [key, v]);
388
+ } else if (isPlainObject(value)) {
389
+ const o = value ?? {};
390
+ return Object.entries(o).map(([k, v]) => [k, v]);
391
+ } else {
392
+ return [[key, value]];
393
+ }
394
+ }
395
+
396
+ function serializeValue(value: unknown): string {
397
+ if (value == null) {
398
+ return "";
399
+ } else if (value instanceof Date) {
400
+ return value.toISOString();
401
+ } else if (value instanceof Uint8Array) {
402
+ return bytesToBase64(value);
403
+ } else if (typeof value === "object") {
404
+ return JSON.stringify(value, jsonReplacer);
405
+ }
406
+
407
+ return `${value}`;
408
+ }
409
+
410
+ function jsonReplacer(_: string, value: unknown): unknown {
411
+ if (value instanceof Uint8Array) {
412
+ return bytesToBase64(value);
413
+ } else {
414
+ return value;
415
+ }
416
+ }
417
+
418
+ function mapDefined<T, R>(inp: T[], mapper: (v: T) => R): R[] | null {
419
+ const res = inp.reduce<R[]>((acc, v) => {
420
+ if (v == null) {
421
+ return acc;
422
+ }
423
+
424
+ const m = mapper(v);
425
+ if (m == null) {
426
+ return acc;
427
+ }
428
+
429
+ acc.push(m);
430
+
431
+ return acc;
432
+ }, []);
433
+
434
+ return res.length ? res : null;
435
+ }
436
+
437
+ function mapDefinedEntries<K, V, R>(
438
+ inp: Iterable<[K, V]>,
439
+ mapper: (v: [K, V]) => R,
440
+ ): R[] | null {
441
+ const acc: R[] = [];
442
+ for (const [k, v] of inp) {
443
+ if (v == null) {
444
+ continue;
445
+ }
446
+
447
+ const m = mapper([k, v]);
448
+ if (m == null) {
449
+ continue;
450
+ }
451
+
452
+ acc.push(m);
453
+ }
454
+
455
+ return acc.length ? acc : null;
456
+ }
457
+
458
+ export function queryJoin(...args: (string | undefined)[]): string {
459
+ return args.filter(Boolean).join("&");
460
+ }
461
+
462
+ type QueryEncoderOptions = {
463
+ explode?: boolean;
464
+ charEncoding?: CharEncoding;
465
+ allowEmptyValue?: string[];
466
+ };
467
+
468
+ type QueryEncoder = (
469
+ key: string,
470
+ value: unknown,
471
+ options?: QueryEncoderOptions,
472
+ ) => string | undefined;
473
+
474
+ type BulkQueryEncoder = (
475
+ values: Record<string, unknown>,
476
+ options?: QueryEncoderOptions,
477
+ ) => string;
478
+
479
+ export function queryEncoder(f: QueryEncoder): BulkQueryEncoder {
480
+ const bulkEncode = function(
481
+ values: Record<string, unknown>,
482
+ options?: QueryEncoderOptions,
483
+ ): string {
484
+ const opts: QueryEncoderOptions = {
485
+ ...options,
486
+ explode: options?.explode ?? true,
487
+ charEncoding: options?.charEncoding ?? "percent",
488
+ };
489
+
490
+ const allowEmptySet = new Set(options?.allowEmptyValue ?? []);
491
+
492
+ const encoded = Object.entries(values).map(([key, value]) => {
493
+ if (allowEmptySet.has(key)) {
494
+ if (
495
+ value === undefined
496
+ || value === null
497
+ || value === ""
498
+ || (Array.isArray(value) && value.length === 0)
499
+ ) {
500
+ return `${encodeURIComponent(key)}=`;
501
+ }
502
+ }
503
+ return f(key, value, opts);
504
+ });
505
+ return queryJoin(...encoded);
506
+ };
507
+
508
+ return bulkEncode;
509
+ }
510
+
511
+ export const encodeJSONQuery = queryEncoder(encodeJSON);
512
+ export const encodeFormQuery = queryEncoder(encodeForm);
513
+ export const encodeSpaceDelimitedQuery = queryEncoder(encodeSpaceDelimited);
514
+ export const encodePipeDelimitedQuery = queryEncoder(encodePipeDelimited);
515
+ export const encodeDeepObjectQuery = queryEncoder(encodeDeepObject);
516
+
517
+ function isBlobLike(val: unknown): val is Blob {
518
+ if (val instanceof Blob) {
519
+ return true;
520
+ }
521
+
522
+ if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) {
523
+ return false;
524
+ }
525
+
526
+ const tag = val[Symbol.toStringTag];
527
+ if (tag !== "Blob" && tag !== "File") {
528
+ return false;
529
+ }
530
+
531
+ return "stream" in val && typeof val.stream === "function";
532
+ }
533
+
534
+ export function appendForm(
535
+ fd: FormData,
536
+ key: string,
537
+ value: unknown,
538
+ fileName?: string,
539
+ ): void {
540
+ if (value == null) {
541
+ return;
542
+ } else if (isBlobLike(value)) {
543
+ if (fileName) {
544
+ fd.append(key, value as Blob, fileName);
545
+ } else {
546
+ fd.append(key, value as Blob);
547
+ }
548
+ } else if (Array.isArray(value)) {
549
+ value.forEach((v) => {
550
+ appendForm(fd, key, v);
551
+ });
552
+ } else {
553
+ fd.append(key, String(value));
554
+ }
555
+ }
556
+
557
+ export async function normalizeBlob(
558
+ value: Pick<Blob, "arrayBuffer" | "type">,
559
+ ): Promise<Blob> {
560
+ if (value instanceof Blob) {
561
+ return value;
562
+ }
563
+ return new Blob([await value.arrayBuffer()], { type: value.type });
564
+ }
package/src/lib/env.ts ADDED
@@ -0,0 +1,61 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+
7
+ export interface Env {
8
+ CONTINUOUS_API_KEY_AUTH?: string | undefined;
9
+
10
+ CONTINUOUS_DEBUG?: boolean | undefined;
11
+ }
12
+
13
+ export const envSchema: z.ZodMiniType<Env, unknown> = z.object({
14
+ CONTINUOUS_API_KEY_AUTH: z.optional(z.string()),
15
+
16
+ CONTINUOUS_DEBUG: z.optional(z.coerce.boolean()),
17
+ });
18
+
19
+ /**
20
+ * Checks for the existence of the Deno global object to determine the environment.
21
+ * @returns {boolean} True if the runtime is Deno, false otherwise.
22
+ */
23
+ function isDeno() {
24
+ if ("Deno" in globalThis) {
25
+ return true;
26
+ }
27
+
28
+ return false;
29
+ }
30
+
31
+ let envMemo: Env | undefined = undefined;
32
+ /**
33
+ * Reads and validates environment variables.
34
+ */
35
+ export function env(): Env {
36
+ if (envMemo) {
37
+ return envMemo;
38
+ }
39
+
40
+ const globals = globalThis as {
41
+ Deno?: { env?: { toObject?: () => Record<string, string | undefined> } };
42
+ process?: { env?: Record<string, string | undefined> };
43
+ };
44
+
45
+ let envObject: Record<string, unknown> = {};
46
+ if (isDeno()) {
47
+ envObject = globals.Deno?.env?.toObject?.() ?? {};
48
+ } else {
49
+ envObject = globals.process?.env ?? {};
50
+ }
51
+
52
+ envMemo = envSchema.parse(envObject);
53
+ return envMemo;
54
+ }
55
+
56
+ /**
57
+ * Clears the cached env object. Useful for testing with a fresh environment.
58
+ */
59
+ export function resetEnv() {
60
+ envMemo = undefined;
61
+ }
@@ -0,0 +1,104 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ /**
6
+ * Consumes a stream and returns a concatenated array buffer. Useful in
7
+ * situations where we need to read the whole file because it forms part of a
8
+ * larger payload containing other fields, and we can't modify the underlying
9
+ * request structure.
10
+ */
11
+ export async function readableStreamToArrayBuffer(
12
+ readable: ReadableStream<Uint8Array>,
13
+ ): Promise<ArrayBuffer> {
14
+ const reader = readable.getReader();
15
+ const chunks: Uint8Array[] = [];
16
+
17
+ let totalLength = 0;
18
+ let done = false;
19
+
20
+ while (!done) {
21
+ const { value, done: doneReading } = await reader.read();
22
+
23
+ if (doneReading) {
24
+ done = true;
25
+ } else {
26
+ chunks.push(value);
27
+ totalLength += value.length;
28
+ }
29
+ }
30
+
31
+ const concatenatedChunks = new Uint8Array(totalLength);
32
+ let offset = 0;
33
+
34
+ for (const chunk of chunks) {
35
+ concatenatedChunks.set(chunk, offset);
36
+ offset += chunk.length;
37
+ }
38
+
39
+ return concatenatedChunks.buffer as ArrayBuffer;
40
+ }
41
+
42
+ /**
43
+ * Determines the MIME content type based on a file's extension.
44
+ * Returns null if the extension is not recognized.
45
+ */
46
+ export function getContentTypeFromFileName(fileName: string): string | null {
47
+ if (!fileName) return null;
48
+
49
+ const ext = fileName.toLowerCase().split(".").pop();
50
+ if (!ext) return null;
51
+
52
+ const mimeTypes: Record<string, string> = {
53
+ json: "application/json",
54
+ xml: "application/xml",
55
+ html: "text/html",
56
+ htm: "text/html",
57
+ txt: "text/plain",
58
+ csv: "text/csv",
59
+ pdf: "application/pdf",
60
+ png: "image/png",
61
+ jpg: "image/jpeg",
62
+ jpeg: "image/jpeg",
63
+ gif: "image/gif",
64
+ svg: "image/svg+xml",
65
+ js: "application/javascript",
66
+ css: "text/css",
67
+ zip: "application/zip",
68
+ tar: "application/x-tar",
69
+ gz: "application/gzip",
70
+ mp4: "video/mp4",
71
+ mp3: "audio/mpeg",
72
+ wav: "audio/wav",
73
+ webp: "image/webp",
74
+ ico: "image/x-icon",
75
+ woff: "font/woff",
76
+ woff2: "font/woff2",
77
+ ttf: "font/ttf",
78
+ otf: "font/otf",
79
+ };
80
+
81
+ return mimeTypes[ext] || null;
82
+ }
83
+
84
+ /**
85
+ * Creates a Blob from file content with the given MIME type.
86
+ *
87
+ * Node.js Buffers are Uint8Array subclasses that may share a pooled
88
+ * ArrayBuffer (byteOffset > 0, byteLength < buffer.byteLength). Passing
89
+ * such a Buffer directly to `new Blob([buf])` can include the entire
90
+ * underlying pool on some runtimes, producing a Blob with extra bytes
91
+ * that corrupts multipart uploads.
92
+ *
93
+ * Copying into a standalone Uint8Array ensures the Blob receives only the
94
+ * intended bytes regardless of runtime behaviour.
95
+ */
96
+ export function bytesToBlob(
97
+ content: Uint8Array<ArrayBufferLike> | ArrayBuffer | Blob | string,
98
+ contentType: string,
99
+ ): Blob {
100
+ if (content instanceof Uint8Array) {
101
+ return new Blob([new Uint8Array(content)], { type: contentType });
102
+ }
103
+ return new Blob([content as BlobPart], { type: contentType });
104
+ }