@nirvana-labs/nirvana 0.9.1 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (548) hide show
  1. package/CHANGELOG.md +9 -6
  2. package/README.md +108 -50
  3. package/api-promise.d.mts +2 -0
  4. package/api-promise.d.mts.map +1 -0
  5. package/api-promise.d.ts +2 -0
  6. package/api-promise.d.ts.map +1 -0
  7. package/{_shims/auto/runtime.js → api-promise.js} +3 -5
  8. package/api-promise.js.map +1 -0
  9. package/api-promise.mjs +2 -0
  10. package/api-promise.mjs.map +1 -0
  11. package/client.d.mts +189 -0
  12. package/client.d.mts.map +1 -0
  13. package/client.d.ts +189 -0
  14. package/client.d.ts.map +1 -0
  15. package/client.js +481 -0
  16. package/client.js.map +1 -0
  17. package/client.mjs +454 -0
  18. package/client.mjs.map +1 -0
  19. package/core/api-promise.d.mts +47 -0
  20. package/core/api-promise.d.mts.map +1 -0
  21. package/core/api-promise.d.ts +47 -0
  22. package/core/api-promise.d.ts.map +1 -0
  23. package/core/api-promise.js +84 -0
  24. package/core/api-promise.js.map +1 -0
  25. package/core/api-promise.mjs +80 -0
  26. package/core/api-promise.mjs.map +1 -0
  27. package/core/error.d.mts +47 -0
  28. package/core/error.d.mts.map +1 -0
  29. package/core/error.d.ts +47 -0
  30. package/core/error.d.ts.map +1 -0
  31. package/core/error.js +113 -0
  32. package/core/error.js.map +1 -0
  33. package/core/error.mjs +97 -0
  34. package/core/error.mjs.map +1 -0
  35. package/core/resource.d.mts +6 -0
  36. package/core/resource.d.mts.map +1 -0
  37. package/core/resource.d.ts +6 -0
  38. package/core/resource.d.ts.map +1 -0
  39. package/core/resource.js +11 -0
  40. package/core/resource.js.map +1 -0
  41. package/core/resource.mjs +7 -0
  42. package/core/resource.mjs.map +1 -0
  43. package/core/uploads.d.mts +3 -0
  44. package/core/uploads.d.mts.map +1 -0
  45. package/core/uploads.d.ts +3 -0
  46. package/core/uploads.d.ts.map +1 -0
  47. package/core/uploads.js +6 -0
  48. package/core/uploads.js.map +1 -0
  49. package/core/uploads.mjs +2 -0
  50. package/core/uploads.mjs.map +1 -0
  51. package/error.d.mts +2 -0
  52. package/error.d.mts.map +1 -0
  53. package/error.d.ts +1 -46
  54. package/error.d.ts.map +1 -1
  55. package/error.js +16 -110
  56. package/error.js.map +1 -1
  57. package/error.mjs +1 -96
  58. package/error.mjs.map +1 -1
  59. package/index.d.mts +6 -124
  60. package/index.d.mts.map +1 -0
  61. package/index.d.ts +5 -123
  62. package/index.d.ts.map +1 -1
  63. package/index.js +12 -116
  64. package/index.js.map +1 -1
  65. package/index.mjs +5 -89
  66. package/index.mjs.map +1 -1
  67. package/internal/builtin-types.d.mts +75 -0
  68. package/internal/builtin-types.d.mts.map +1 -0
  69. package/internal/builtin-types.d.ts +75 -0
  70. package/internal/builtin-types.d.ts.map +1 -0
  71. package/internal/builtin-types.js +4 -0
  72. package/internal/builtin-types.js.map +1 -0
  73. package/internal/builtin-types.mjs +3 -0
  74. package/internal/builtin-types.mjs.map +1 -0
  75. package/internal/detect-platform.d.mts +15 -0
  76. package/internal/detect-platform.d.mts.map +1 -0
  77. package/internal/detect-platform.d.ts +15 -0
  78. package/internal/detect-platform.d.ts.map +1 -0
  79. package/internal/detect-platform.js +162 -0
  80. package/internal/detect-platform.js.map +1 -0
  81. package/internal/detect-platform.mjs +157 -0
  82. package/internal/detect-platform.mjs.map +1 -0
  83. package/internal/errors.d.mts +3 -0
  84. package/internal/errors.d.mts.map +1 -0
  85. package/internal/errors.d.ts +3 -0
  86. package/internal/errors.d.ts.map +1 -0
  87. package/internal/errors.js +41 -0
  88. package/internal/errors.js.map +1 -0
  89. package/internal/errors.mjs +36 -0
  90. package/internal/errors.mjs.map +1 -0
  91. package/internal/headers.d.mts +21 -0
  92. package/internal/headers.d.mts.map +1 -0
  93. package/internal/headers.d.ts +21 -0
  94. package/internal/headers.d.ts.map +1 -0
  95. package/internal/headers.js +77 -0
  96. package/internal/headers.js.map +1 -0
  97. package/internal/headers.mjs +72 -0
  98. package/internal/headers.mjs.map +1 -0
  99. package/internal/parse.d.mts +13 -0
  100. package/internal/parse.d.mts.map +1 -0
  101. package/internal/parse.d.ts +13 -0
  102. package/internal/parse.d.ts.map +1 -0
  103. package/internal/parse.js +36 -0
  104. package/internal/parse.js.map +1 -0
  105. package/internal/parse.mjs +32 -0
  106. package/internal/parse.mjs.map +1 -0
  107. package/internal/request-options.d.mts +33 -0
  108. package/internal/request-options.d.mts.map +1 -0
  109. package/internal/request-options.d.ts +33 -0
  110. package/internal/request-options.d.ts.map +1 -0
  111. package/internal/request-options.js +14 -0
  112. package/internal/request-options.js.map +1 -0
  113. package/internal/request-options.mjs +10 -0
  114. package/internal/request-options.mjs.map +1 -0
  115. package/internal/shim-types.d.mts +28 -0
  116. package/internal/shim-types.d.ts +28 -0
  117. package/internal/shims/crypto.d.mts +13 -0
  118. package/internal/shims/crypto.d.mts.map +1 -0
  119. package/internal/shims/crypto.d.ts +13 -0
  120. package/internal/shims/crypto.d.ts.map +1 -0
  121. package/internal/shims/crypto.js +13 -0
  122. package/internal/shims/crypto.js.map +1 -0
  123. package/internal/shims/crypto.mjs +9 -0
  124. package/internal/shims/crypto.mjs.map +1 -0
  125. package/internal/shims/file.d.mts +23 -0
  126. package/internal/shims/file.d.mts.map +1 -0
  127. package/internal/shims/file.d.ts +23 -0
  128. package/internal/shims/file.d.ts.map +1 -0
  129. package/internal/shims/file.js +16 -0
  130. package/internal/shims/file.js.map +1 -0
  131. package/internal/shims/file.mjs +12 -0
  132. package/internal/shims/file.mjs.map +1 -0
  133. package/internal/shims/getBuiltinModule.d.mts +11 -0
  134. package/internal/shims/getBuiltinModule.d.mts.map +1 -0
  135. package/internal/shims/getBuiltinModule.d.ts +11 -0
  136. package/internal/shims/getBuiltinModule.d.ts.map +1 -0
  137. package/internal/shims/getBuiltinModule.js +71 -0
  138. package/internal/shims/getBuiltinModule.js.map +1 -0
  139. package/internal/shims/getBuiltinModule.mjs +67 -0
  140. package/internal/shims/getBuiltinModule.mjs.map +1 -0
  141. package/internal/shims/nullGetBuiltinModule.d.mts +2 -0
  142. package/internal/shims/nullGetBuiltinModule.d.mts.map +1 -0
  143. package/internal/shims/nullGetBuiltinModule.d.ts +2 -0
  144. package/internal/shims/nullGetBuiltinModule.d.ts.map +1 -0
  145. package/internal/shims/nullGetBuiltinModule.js +5 -0
  146. package/internal/shims/nullGetBuiltinModule.js.map +1 -0
  147. package/internal/shims/nullGetBuiltinModule.mjs +2 -0
  148. package/internal/shims/nullGetBuiltinModule.mjs.map +1 -0
  149. package/internal/shims.d.mts +20 -0
  150. package/internal/shims.d.mts.map +1 -0
  151. package/internal/shims.d.ts +20 -0
  152. package/internal/shims.d.ts.map +1 -0
  153. package/internal/shims.js +93 -0
  154. package/internal/shims.js.map +1 -0
  155. package/internal/shims.mjs +85 -0
  156. package/internal/shims.mjs.map +1 -0
  157. package/internal/to-file.d.mts +46 -0
  158. package/internal/to-file.d.mts.map +1 -0
  159. package/internal/to-file.d.ts +46 -0
  160. package/internal/to-file.d.ts.map +1 -0
  161. package/internal/to-file.js +91 -0
  162. package/internal/to-file.js.map +1 -0
  163. package/internal/to-file.mjs +87 -0
  164. package/internal/to-file.mjs.map +1 -0
  165. package/internal/types.d.mts +68 -0
  166. package/internal/types.d.mts.map +1 -0
  167. package/internal/types.d.ts +68 -0
  168. package/internal/types.d.ts.map +1 -0
  169. package/internal/types.js +4 -0
  170. package/internal/types.js.map +1 -0
  171. package/internal/types.mjs +3 -0
  172. package/internal/types.mjs.map +1 -0
  173. package/internal/uploads.d.mts +44 -0
  174. package/internal/uploads.d.mts.map +1 -0
  175. package/internal/uploads.d.ts +44 -0
  176. package/internal/uploads.d.ts.map +1 -0
  177. package/internal/uploads.js +131 -0
  178. package/internal/uploads.js.map +1 -0
  179. package/internal/uploads.mjs +122 -0
  180. package/internal/uploads.mjs.map +1 -0
  181. package/internal/utils/base64.d.mts +3 -0
  182. package/internal/utils/base64.d.mts.map +1 -0
  183. package/internal/utils/base64.d.ts +3 -0
  184. package/internal/utils/base64.d.ts.map +1 -0
  185. package/internal/utils/base64.js +33 -0
  186. package/internal/utils/base64.js.map +1 -0
  187. package/internal/utils/base64.mjs +28 -0
  188. package/internal/utils/base64.mjs.map +1 -0
  189. package/internal/utils/env.d.mts +9 -0
  190. package/internal/utils/env.d.mts.map +1 -0
  191. package/internal/utils/env.d.ts +9 -0
  192. package/internal/utils/env.d.ts.map +1 -0
  193. package/internal/utils/env.js +22 -0
  194. package/internal/utils/env.js.map +1 -0
  195. package/internal/utils/env.mjs +18 -0
  196. package/internal/utils/env.mjs.map +1 -0
  197. package/internal/utils/log.d.mts +38 -0
  198. package/internal/utils/log.d.mts.map +1 -0
  199. package/internal/utils/log.d.ts +38 -0
  200. package/internal/utils/log.d.ts.map +1 -0
  201. package/internal/utils/log.js +85 -0
  202. package/internal/utils/log.js.map +1 -0
  203. package/internal/utils/log.mjs +79 -0
  204. package/internal/utils/log.mjs.map +1 -0
  205. package/internal/utils/path.d.mts +15 -0
  206. package/internal/utils/path.d.mts.map +1 -0
  207. package/internal/utils/path.d.ts +15 -0
  208. package/internal/utils/path.d.ts.map +1 -0
  209. package/internal/utils/path.js +58 -0
  210. package/internal/utils/path.js.map +1 -0
  211. package/internal/utils/path.mjs +53 -0
  212. package/internal/utils/path.mjs.map +1 -0
  213. package/internal/utils/sleep.d.mts +2 -0
  214. package/internal/utils/sleep.d.mts.map +1 -0
  215. package/internal/utils/sleep.d.ts +2 -0
  216. package/internal/utils/sleep.d.ts.map +1 -0
  217. package/internal/utils/sleep.js +7 -0
  218. package/internal/utils/sleep.js.map +1 -0
  219. package/internal/utils/sleep.mjs +3 -0
  220. package/internal/utils/sleep.mjs.map +1 -0
  221. package/internal/utils/uuid.d.mts +5 -0
  222. package/internal/utils/uuid.d.mts.map +1 -0
  223. package/internal/utils/uuid.d.ts +5 -0
  224. package/internal/utils/uuid.d.ts.map +1 -0
  225. package/internal/utils/uuid.js +20 -0
  226. package/internal/utils/uuid.js.map +1 -0
  227. package/internal/utils/uuid.mjs +16 -0
  228. package/internal/utils/uuid.mjs.map +1 -0
  229. package/internal/utils/values.d.mts +16 -0
  230. package/internal/utils/values.d.mts.map +1 -0
  231. package/internal/utils/values.d.ts +16 -0
  232. package/internal/utils/values.d.ts.map +1 -0
  233. package/internal/utils/values.js +109 -0
  234. package/internal/utils/values.js.map +1 -0
  235. package/internal/utils/values.mjs +92 -0
  236. package/internal/utils/values.mjs.map +1 -0
  237. package/internal/utils.d.mts +7 -0
  238. package/internal/utils.d.mts.map +1 -0
  239. package/internal/utils.d.ts +7 -0
  240. package/internal/utils.d.ts.map +1 -0
  241. package/{_shims/auto/runtime-bun.js → internal/utils.js} +8 -5
  242. package/internal/utils.js.map +1 -0
  243. package/internal/utils.mjs +8 -0
  244. package/internal/utils.mjs.map +1 -0
  245. package/package.json +106 -63
  246. package/resource.d.mts +2 -0
  247. package/resource.d.mts.map +1 -0
  248. package/resource.d.ts +1 -5
  249. package/resource.d.ts.map +1 -1
  250. package/resource.js +16 -8
  251. package/resource.js.map +1 -1
  252. package/resource.mjs +1 -6
  253. package/resource.mjs.map +1 -1
  254. package/resources/api-keys.d.mts +93 -0
  255. package/resources/api-keys.d.mts.map +1 -0
  256. package/resources/api-keys.d.ts +8 -7
  257. package/resources/api-keys.d.ts.map +1 -1
  258. package/resources/api-keys.js +10 -8
  259. package/resources/api-keys.js.map +1 -1
  260. package/resources/api-keys.mjs +10 -8
  261. package/resources/api-keys.mjs.map +1 -1
  262. package/resources/compute/compute.d.mts +14 -0
  263. package/resources/compute/compute.d.mts.map +1 -0
  264. package/resources/compute/compute.d.ts +1 -1
  265. package/resources/compute/compute.d.ts.map +1 -1
  266. package/resources/compute/compute.js +1 -1
  267. package/resources/compute/compute.js.map +1 -1
  268. package/resources/compute/compute.mjs +1 -1
  269. package/resources/compute/index.d.mts +4 -0
  270. package/resources/compute/index.d.mts.map +1 -0
  271. package/resources/compute/index.d.ts.map +1 -1
  272. package/resources/compute/vms/index.d.mts +4 -0
  273. package/resources/compute/vms/index.d.mts.map +1 -0
  274. package/resources/compute/vms/index.d.ts.map +1 -1
  275. package/resources/compute/vms/os-images.d.mts +15 -0
  276. package/resources/compute/vms/os-images.d.mts.map +1 -0
  277. package/resources/compute/vms/os-images.d.ts +4 -3
  278. package/resources/compute/vms/os-images.d.ts.map +1 -1
  279. package/resources/compute/vms/os-images.js +1 -1
  280. package/resources/compute/vms/os-images.js.map +1 -1
  281. package/resources/compute/vms/os-images.mjs +1 -1
  282. package/resources/compute/vms/os-images.mjs.map +1 -1
  283. package/resources/compute/vms/vms.d.mts +148 -0
  284. package/resources/compute/vms/vms.d.mts.map +1 -0
  285. package/resources/compute/vms/vms.d.ts +8 -7
  286. package/resources/compute/vms/vms.d.ts.map +1 -1
  287. package/resources/compute/vms/vms.js +8 -7
  288. package/resources/compute/vms/vms.js.map +1 -1
  289. package/resources/compute/vms/vms.mjs +8 -7
  290. package/resources/compute/vms/vms.mjs.map +1 -1
  291. package/resources/compute/vms/volumes.d.mts +11 -0
  292. package/resources/compute/vms/volumes.d.mts.map +1 -0
  293. package/resources/compute/vms/volumes.d.ts +4 -3
  294. package/resources/compute/vms/volumes.d.ts.map +1 -1
  295. package/resources/compute/vms/volumes.js +4 -3
  296. package/resources/compute/vms/volumes.js.map +1 -1
  297. package/resources/compute/vms/volumes.mjs +4 -3
  298. package/resources/compute/vms/volumes.mjs.map +1 -1
  299. package/resources/compute/vms.d.mts +2 -0
  300. package/resources/compute/vms.d.mts.map +1 -0
  301. package/resources/compute/vms.d.ts.map +1 -1
  302. package/resources/compute/volumes.d.mts +72 -0
  303. package/resources/compute/volumes.d.mts.map +1 -0
  304. package/resources/compute/volumes.d.ts +8 -7
  305. package/resources/compute/volumes.d.ts.map +1 -1
  306. package/resources/compute/volumes.js +8 -7
  307. package/resources/compute/volumes.js.map +1 -1
  308. package/resources/compute/volumes.mjs +8 -7
  309. package/resources/compute/volumes.mjs.map +1 -1
  310. package/resources/compute.d.mts +2 -0
  311. package/resources/compute.d.mts.map +1 -0
  312. package/resources/compute.d.ts.map +1 -1
  313. package/resources/index.d.mts +7 -0
  314. package/resources/index.d.mts.map +1 -0
  315. package/resources/index.d.ts.map +1 -1
  316. package/resources/networking/firewall-rules.d.mts +100 -0
  317. package/resources/networking/firewall-rules.d.mts.map +1 -0
  318. package/resources/networking/firewall-rules.d.ts +38 -9
  319. package/resources/networking/firewall-rules.d.ts.map +1 -1
  320. package/resources/networking/firewall-rules.js +15 -11
  321. package/resources/networking/firewall-rules.js.map +1 -1
  322. package/resources/networking/firewall-rules.mjs +15 -11
  323. package/resources/networking/firewall-rules.mjs.map +1 -1
  324. package/resources/networking/index.d.mts +4 -0
  325. package/resources/networking/index.d.mts.map +1 -0
  326. package/resources/networking/index.d.ts +1 -1
  327. package/resources/networking/index.d.ts.map +1 -1
  328. package/resources/networking/index.js.map +1 -1
  329. package/resources/networking/index.mjs.map +1 -1
  330. package/resources/networking/networking.d.mts +14 -0
  331. package/resources/networking/networking.d.mts.map +1 -0
  332. package/resources/networking/networking.d.ts +3 -3
  333. package/resources/networking/networking.d.ts.map +1 -1
  334. package/resources/networking/networking.js +1 -1
  335. package/resources/networking/networking.js.map +1 -1
  336. package/resources/networking/networking.mjs +1 -1
  337. package/resources/networking/networking.mjs.map +1 -1
  338. package/resources/networking/vpcs.d.mts +69 -0
  339. package/resources/networking/vpcs.d.mts.map +1 -0
  340. package/resources/networking/vpcs.d.ts +8 -7
  341. package/resources/networking/vpcs.d.ts.map +1 -1
  342. package/resources/networking/vpcs.js +8 -7
  343. package/resources/networking/vpcs.js.map +1 -1
  344. package/resources/networking/vpcs.mjs +8 -7
  345. package/resources/networking/vpcs.mjs.map +1 -1
  346. package/resources/networking.d.mts +2 -0
  347. package/resources/networking.d.mts.map +1 -0
  348. package/resources/networking.d.ts.map +1 -1
  349. package/resources/operations.d.mts +35 -0
  350. package/resources/operations.d.mts.map +1 -0
  351. package/resources/operations.d.ts +5 -4
  352. package/resources/operations.d.ts.map +1 -1
  353. package/resources/operations.js +4 -3
  354. package/resources/operations.js.map +1 -1
  355. package/resources/operations.mjs +4 -3
  356. package/resources/operations.mjs.map +1 -1
  357. package/resources/shared.d.mts +3 -0
  358. package/resources/shared.d.mts.map +1 -0
  359. package/resources/user.d.mts +23 -0
  360. package/resources/user.d.mts.map +1 -0
  361. package/resources/user.d.ts +4 -3
  362. package/resources/user.d.ts.map +1 -1
  363. package/resources/user.js +1 -1
  364. package/resources/user.js.map +1 -1
  365. package/resources/user.mjs +1 -1
  366. package/resources/user.mjs.map +1 -1
  367. package/resources.d.mts +2 -0
  368. package/resources.d.mts.map +1 -0
  369. package/resources.d.ts.map +1 -1
  370. package/src/api-promise.ts +2 -0
  371. package/src/client.ts +707 -0
  372. package/src/core/README.md +3 -0
  373. package/src/core/api-promise.ts +92 -0
  374. package/src/core/error.ts +130 -0
  375. package/src/core/resource.ts +11 -0
  376. package/src/core/uploads.ts +2 -0
  377. package/src/error.ts +2 -130
  378. package/src/index.ts +5 -191
  379. package/src/internal/README.md +3 -0
  380. package/src/internal/builtin-types.ts +93 -0
  381. package/src/internal/detect-platform.ts +196 -0
  382. package/src/internal/errors.ts +33 -0
  383. package/src/internal/headers.ts +96 -0
  384. package/src/internal/parse.ts +50 -0
  385. package/src/internal/request-options.ts +37 -0
  386. package/src/internal/shim-types.d.ts +28 -0
  387. package/src/internal/shims/crypto.ts +18 -0
  388. package/src/internal/shims/file.ts +32 -0
  389. package/src/internal/shims/getBuiltinModule.ts +66 -0
  390. package/src/internal/shims/nullGetBuiltinModule.ts +1 -0
  391. package/src/internal/shims.ts +107 -0
  392. package/src/internal/to-file.ts +152 -0
  393. package/src/internal/types.ts +92 -0
  394. package/src/internal/uploads.ts +175 -0
  395. package/src/internal/utils/base64.ts +37 -0
  396. package/src/internal/utils/env.ts +18 -0
  397. package/src/internal/utils/log.ts +126 -0
  398. package/src/internal/utils/path.ts +65 -0
  399. package/src/internal/utils/sleep.ts +3 -0
  400. package/src/internal/utils/uuid.ts +19 -0
  401. package/src/internal/utils/values.ts +102 -0
  402. package/src/internal/utils.ts +8 -0
  403. package/src/resource.ts +2 -11
  404. package/src/resources/api-keys.ts +14 -11
  405. package/src/resources/compute/compute.ts +1 -1
  406. package/src/resources/compute/vms/os-images.ts +4 -3
  407. package/src/resources/compute/vms/vms.ts +12 -14
  408. package/src/resources/compute/vms/volumes.ts +6 -4
  409. package/src/resources/compute/volumes.ts +14 -12
  410. package/src/resources/networking/firewall-rules.ts +63 -22
  411. package/src/resources/networking/index.ts +2 -0
  412. package/src/resources/networking/networking.ts +5 -1
  413. package/src/resources/networking/vpcs.ts +14 -12
  414. package/src/resources/operations.ts +7 -5
  415. package/src/resources/user.ts +4 -3
  416. package/src/tsconfig.json +2 -2
  417. package/src/uploads.ts +2 -255
  418. package/src/version.ts +1 -1
  419. package/uploads.d.mts +2 -0
  420. package/uploads.d.mts.map +1 -0
  421. package/uploads.d.ts +1 -74
  422. package/uploads.d.ts.map +1 -1
  423. package/uploads.js +16 -168
  424. package/uploads.js.map +1 -1
  425. package/uploads.mjs +1 -157
  426. package/uploads.mjs.map +1 -1
  427. package/version.d.mts +2 -0
  428. package/version.d.mts.map +1 -0
  429. package/version.d.ts +1 -1
  430. package/version.d.ts.map +1 -1
  431. package/version.js +1 -1
  432. package/version.js.map +1 -1
  433. package/version.mjs +1 -1
  434. package/version.mjs.map +1 -1
  435. package/_shims/MultipartBody.d.ts +0 -9
  436. package/_shims/MultipartBody.d.ts.map +0 -1
  437. package/_shims/MultipartBody.js +0 -16
  438. package/_shims/MultipartBody.js.map +0 -1
  439. package/_shims/MultipartBody.mjs +0 -12
  440. package/_shims/MultipartBody.mjs.map +0 -1
  441. package/_shims/README.md +0 -46
  442. package/_shims/auto/runtime-bun.d.ts +0 -5
  443. package/_shims/auto/runtime-bun.d.ts.map +0 -1
  444. package/_shims/auto/runtime-bun.js.map +0 -1
  445. package/_shims/auto/runtime-bun.mjs +0 -2
  446. package/_shims/auto/runtime-bun.mjs.map +0 -1
  447. package/_shims/auto/runtime-node.d.ts +0 -5
  448. package/_shims/auto/runtime-node.d.ts.map +0 -1
  449. package/_shims/auto/runtime-node.js +0 -21
  450. package/_shims/auto/runtime-node.js.map +0 -1
  451. package/_shims/auto/runtime-node.mjs +0 -2
  452. package/_shims/auto/runtime-node.mjs.map +0 -1
  453. package/_shims/auto/runtime.d.ts +0 -5
  454. package/_shims/auto/runtime.d.ts.map +0 -1
  455. package/_shims/auto/runtime.js.map +0 -1
  456. package/_shims/auto/runtime.mjs +0 -2
  457. package/_shims/auto/runtime.mjs.map +0 -1
  458. package/_shims/auto/types-node.d.ts +0 -5
  459. package/_shims/auto/types-node.d.ts.map +0 -1
  460. package/_shims/auto/types-node.js +0 -21
  461. package/_shims/auto/types-node.js.map +0 -1
  462. package/_shims/auto/types-node.mjs +0 -2
  463. package/_shims/auto/types-node.mjs.map +0 -1
  464. package/_shims/auto/types.d.ts +0 -101
  465. package/_shims/auto/types.js +0 -3
  466. package/_shims/auto/types.mjs +0 -3
  467. package/_shims/bun-runtime.d.ts +0 -6
  468. package/_shims/bun-runtime.d.ts.map +0 -1
  469. package/_shims/bun-runtime.js +0 -14
  470. package/_shims/bun-runtime.js.map +0 -1
  471. package/_shims/bun-runtime.mjs +0 -10
  472. package/_shims/bun-runtime.mjs.map +0 -1
  473. package/_shims/index.d.ts +0 -83
  474. package/_shims/index.js +0 -17
  475. package/_shims/index.mjs +0 -11
  476. package/_shims/manual-types.d.ts +0 -12
  477. package/_shims/manual-types.js +0 -3
  478. package/_shims/manual-types.mjs +0 -3
  479. package/_shims/node-runtime.d.ts +0 -3
  480. package/_shims/node-runtime.d.ts.map +0 -1
  481. package/_shims/node-runtime.js +0 -89
  482. package/_shims/node-runtime.js.map +0 -1
  483. package/_shims/node-runtime.mjs +0 -56
  484. package/_shims/node-runtime.mjs.map +0 -1
  485. package/_shims/node-types.d.ts +0 -42
  486. package/_shims/node-types.js +0 -3
  487. package/_shims/node-types.mjs +0 -3
  488. package/_shims/registry.d.ts +0 -37
  489. package/_shims/registry.d.ts.map +0 -1
  490. package/_shims/registry.js +0 -41
  491. package/_shims/registry.js.map +0 -1
  492. package/_shims/registry.mjs +0 -37
  493. package/_shims/registry.mjs.map +0 -1
  494. package/_shims/web-runtime.d.ts +0 -5
  495. package/_shims/web-runtime.d.ts.map +0 -1
  496. package/_shims/web-runtime.js +0 -78
  497. package/_shims/web-runtime.js.map +0 -1
  498. package/_shims/web-runtime.mjs +0 -71
  499. package/_shims/web-runtime.mjs.map +0 -1
  500. package/_shims/web-types.d.ts +0 -83
  501. package/_shims/web-types.js +0 -3
  502. package/_shims/web-types.mjs +0 -3
  503. package/core.d.ts +0 -252
  504. package/core.d.ts.map +0 -1
  505. package/core.js +0 -917
  506. package/core.js.map +0 -1
  507. package/core.mjs +0 -885
  508. package/core.mjs.map +0 -1
  509. package/shims/node.d.ts +0 -30
  510. package/shims/node.d.ts.map +0 -1
  511. package/shims/node.js +0 -31
  512. package/shims/node.js.map +0 -1
  513. package/shims/node.mjs +0 -5
  514. package/shims/node.mjs.map +0 -1
  515. package/shims/web.d.ts +0 -26
  516. package/shims/web.d.ts.map +0 -1
  517. package/shims/web.js +0 -31
  518. package/shims/web.js.map +0 -1
  519. package/shims/web.mjs +0 -5
  520. package/shims/web.mjs.map +0 -1
  521. package/src/_shims/MultipartBody.ts +0 -9
  522. package/src/_shims/README.md +0 -46
  523. package/src/_shims/auto/runtime-bun.ts +0 -4
  524. package/src/_shims/auto/runtime-node.ts +0 -4
  525. package/src/_shims/auto/runtime.ts +0 -4
  526. package/src/_shims/auto/types-node.ts +0 -4
  527. package/src/_shims/auto/types.d.ts +0 -101
  528. package/src/_shims/auto/types.js +0 -3
  529. package/src/_shims/auto/types.mjs +0 -3
  530. package/src/_shims/bun-runtime.ts +0 -14
  531. package/src/_shims/index.d.ts +0 -83
  532. package/src/_shims/index.js +0 -17
  533. package/src/_shims/index.mjs +0 -11
  534. package/src/_shims/manual-types.d.ts +0 -12
  535. package/src/_shims/manual-types.js +0 -3
  536. package/src/_shims/manual-types.mjs +0 -3
  537. package/src/_shims/node-runtime.ts +0 -81
  538. package/src/_shims/node-types.d.ts +0 -42
  539. package/src/_shims/node-types.js +0 -3
  540. package/src/_shims/node-types.mjs +0 -3
  541. package/src/_shims/registry.ts +0 -67
  542. package/src/_shims/web-runtime.ts +0 -103
  543. package/src/_shims/web-types.d.ts +0 -83
  544. package/src/_shims/web-types.js +0 -3
  545. package/src/_shims/web-types.mjs +0 -3
  546. package/src/core.ts +0 -1228
  547. package/src/shims/node.ts +0 -50
  548. package/src/shims/web.ts +0 -50
@@ -0,0 +1,19 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { getCrypto } from '../shims/crypto';
4
+
5
+ /**
6
+ * https://stackoverflow.com/a/2117523
7
+ */
8
+ export let uuid4 = function () {
9
+ const crypto = getCrypto();
10
+ if (crypto?.randomUUID) {
11
+ uuid4 = crypto.randomUUID.bind(crypto);
12
+ return crypto.randomUUID();
13
+ }
14
+ const u8 = new Uint8Array(1);
15
+ const randomByte = crypto ? () => crypto.getRandomValues(u8)[0]! : () => (Math.random() * 0xff) & 0xff;
16
+ return '10000000-1000-4000-8000-100000000000'.replace(/[018]/g, (c) =>
17
+ (+c ^ (randomByte() & (15 >> (+c / 4)))).toString(16),
18
+ );
19
+ };
@@ -0,0 +1,102 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { NirvanaLabsError } from '../../core/error';
4
+
5
+ // https://url.spec.whatwg.org/#url-scheme-string
6
+ const startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;
7
+
8
+ export const isAbsoluteURL = (url: string): boolean => {
9
+ return startsWithSchemeRegexp.test(url);
10
+ };
11
+
12
+ /** Returns an object if the given value isn't an object, otherwise returns as-is */
13
+ export function maybeObj(x: unknown): object {
14
+ if (typeof x !== 'object') {
15
+ return {};
16
+ }
17
+
18
+ return x ?? {};
19
+ }
20
+
21
+ // https://stackoverflow.com/a/34491287
22
+ export function isEmptyObj(obj: Object | null | undefined): boolean {
23
+ if (!obj) return true;
24
+ for (const _k in obj) return false;
25
+ return true;
26
+ }
27
+
28
+ // https://eslint.org/docs/latest/rules/no-prototype-builtins
29
+ export function hasOwn<T extends object = object>(obj: T, key: PropertyKey): key is keyof T {
30
+ return Object.prototype.hasOwnProperty.call(obj, key);
31
+ }
32
+
33
+ export function isObj(obj: unknown): obj is Record<string, unknown> {
34
+ return obj != null && typeof obj === 'object' && !Array.isArray(obj);
35
+ }
36
+
37
+ export const ensurePresent = <T>(value: T | null | undefined): T => {
38
+ if (value == null) {
39
+ throw new NirvanaLabsError(`Expected a value to be given but received ${value} instead.`);
40
+ }
41
+
42
+ return value;
43
+ };
44
+
45
+ export const validatePositiveInteger = (name: string, n: unknown): number => {
46
+ if (typeof n !== 'number' || !Number.isInteger(n)) {
47
+ throw new NirvanaLabsError(`${name} must be an integer`);
48
+ }
49
+ if (n < 0) {
50
+ throw new NirvanaLabsError(`${name} must be a positive integer`);
51
+ }
52
+ return n;
53
+ };
54
+
55
+ export const coerceInteger = (value: unknown): number => {
56
+ if (typeof value === 'number') return Math.round(value);
57
+ if (typeof value === 'string') return parseInt(value, 10);
58
+
59
+ throw new NirvanaLabsError(`Could not coerce ${value} (type: ${typeof value}) into a number`);
60
+ };
61
+
62
+ export const coerceFloat = (value: unknown): number => {
63
+ if (typeof value === 'number') return value;
64
+ if (typeof value === 'string') return parseFloat(value);
65
+
66
+ throw new NirvanaLabsError(`Could not coerce ${value} (type: ${typeof value}) into a number`);
67
+ };
68
+
69
+ export const coerceBoolean = (value: unknown): boolean => {
70
+ if (typeof value === 'boolean') return value;
71
+ if (typeof value === 'string') return value === 'true';
72
+ return Boolean(value);
73
+ };
74
+
75
+ export const maybeCoerceInteger = (value: unknown): number | undefined => {
76
+ if (value === undefined) {
77
+ return undefined;
78
+ }
79
+ return coerceInteger(value);
80
+ };
81
+
82
+ export const maybeCoerceFloat = (value: unknown): number | undefined => {
83
+ if (value === undefined) {
84
+ return undefined;
85
+ }
86
+ return coerceFloat(value);
87
+ };
88
+
89
+ export const maybeCoerceBoolean = (value: unknown): boolean | undefined => {
90
+ if (value === undefined) {
91
+ return undefined;
92
+ }
93
+ return coerceBoolean(value);
94
+ };
95
+
96
+ export const safeJSON = (text: string) => {
97
+ try {
98
+ return JSON.parse(text);
99
+ } catch (err) {
100
+ return undefined;
101
+ }
102
+ };
@@ -0,0 +1,8 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './utils/values';
4
+ export * from './utils/base64';
5
+ export * from './utils/env';
6
+ export * from './utils/log';
7
+ export * from './utils/uuid';
8
+ export * from './utils/sleep';
package/src/resource.ts CHANGED
@@ -1,11 +1,2 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import type { NirvanaLabs } from './index';
4
-
5
- export class APIResource {
6
- protected _client: NirvanaLabs;
7
-
8
- constructor(client: NirvanaLabs) {
9
- this._client = client;
10
- }
11
- }
1
+ /** @deprecated Import from ./core/resource instead */
2
+ export * from './core/resource';
@@ -1,45 +1,48 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../resource';
4
- import * as Core from '../core';
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { buildHeaders } from '../internal/headers';
6
+ import { RequestOptions } from '../internal/request-options';
7
+ import { path } from '../internal/utils/path';
5
8
 
6
9
  export class APIKeys extends APIResource {
7
10
  /**
8
11
  * Create a new API key
9
12
  */
10
- create(body: APIKeyCreateParams, options?: Core.RequestOptions): Core.APIPromise<APIKey> {
13
+ create(body: APIKeyCreateParams, options?: RequestOptions): APIPromise<APIKey> {
11
14
  return this._client.post('/v1/api_keys', { body, ...options });
12
15
  }
13
16
 
14
17
  /**
15
18
  * Update an API key's name
16
19
  */
17
- update(apiKeyId: string, body: APIKeyUpdateParams, options?: Core.RequestOptions): Core.APIPromise<APIKey> {
18
- return this._client.patch(`/v1/api_keys/${apiKeyId}`, { body, ...options });
20
+ update(apiKeyID: string, body: APIKeyUpdateParams, options?: RequestOptions): APIPromise<APIKey> {
21
+ return this._client.patch(path`/v1/api_keys/${apiKeyID}`, { body, ...options });
19
22
  }
20
23
 
21
24
  /**
22
25
  * List all API keys you created
23
26
  */
24
- list(options?: Core.RequestOptions): Core.APIPromise<APIKeyList> {
27
+ list(options?: RequestOptions): APIPromise<APIKeyList> {
25
28
  return this._client.get('/v1/api_keys', options);
26
29
  }
27
30
 
28
31
  /**
29
32
  * Delete an API key
30
33
  */
31
- delete(apiKeyId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
32
- return this._client.delete(`/v1/api_keys/${apiKeyId}`, {
34
+ delete(apiKeyID: string, options?: RequestOptions): APIPromise<void> {
35
+ return this._client.delete(path`/v1/api_keys/${apiKeyID}`, {
33
36
  ...options,
34
- headers: { Accept: '*/*', ...options?.headers },
37
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
35
38
  });
36
39
  }
37
40
 
38
41
  /**
39
42
  * Get details about an API key
40
43
  */
41
- get(apiKeyId: string, options?: Core.RequestOptions): Core.APIPromise<APIKey> {
42
- return this._client.get(`/v1/api_keys/${apiKeyId}`, options);
44
+ get(apiKeyID: string, options?: RequestOptions): APIPromise<APIKey> {
45
+ return this._client.get(path`/v1/api_keys/${apiKeyID}`, options);
43
46
  }
44
47
  }
45
48
 
@@ -1,6 +1,6 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../../resource';
3
+ import { APIResource } from '../../core/resource';
4
4
  import * as VolumesAPI from './volumes';
5
5
  import {
6
6
  StorageType,
@@ -1,14 +1,15 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../../../resource';
4
- import * as Core from '../../../core';
3
+ import { APIResource } from '../../../core/resource';
5
4
  import * as VMsAPI from './vms';
5
+ import { APIPromise } from '../../../core/api-promise';
6
+ import { RequestOptions } from '../../../internal/request-options';
6
7
 
7
8
  export class OSImages extends APIResource {
8
9
  /**
9
10
  * List all OS Images
10
11
  */
11
- list(options?: Core.RequestOptions): Core.APIPromise<OSImageListResponse> {
12
+ list(options?: RequestOptions): APIPromise<OSImageListResponse> {
12
13
  return this._client.get('/v1/compute/vms/os_images', options);
13
14
  }
14
15
  }
@@ -1,13 +1,15 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../../../resource';
4
- import * as Core from '../../../core';
3
+ import { APIResource } from '../../../core/resource';
5
4
  import * as OperationsAPI from '../../operations';
6
5
  import * as Shared from '../../shared';
7
6
  import * as OSImagesAPI from './os-images';
8
7
  import { OSImageListResponse, OSImages } from './os-images';
9
8
  import * as VolumesAPI from './volumes';
10
9
  import { Volumes } from './volumes';
10
+ import { APIPromise } from '../../../core/api-promise';
11
+ import { RequestOptions } from '../../../internal/request-options';
12
+ import { path } from '../../../internal/utils/path';
11
13
 
12
14
  export class VMs extends APIResource {
13
15
  volumes: VolumesAPI.Volumes = new VolumesAPI.Volumes(this._client);
@@ -16,40 +18,36 @@ export class VMs extends APIResource {
16
18
  /**
17
19
  * Create a VM
18
20
  */
19
- create(body: VMCreateParams, options?: Core.RequestOptions): Core.APIPromise<OperationsAPI.Operation> {
21
+ create(body: VMCreateParams, options?: RequestOptions): APIPromise<OperationsAPI.Operation> {
20
22
  return this._client.post('/v1/compute/vms', { body, ...options });
21
23
  }
22
24
 
23
25
  /**
24
26
  * Update a VM
25
27
  */
26
- update(
27
- vmId: string,
28
- body: VMUpdateParams,
29
- options?: Core.RequestOptions,
30
- ): Core.APIPromise<OperationsAPI.Operation> {
31
- return this._client.patch(`/v1/compute/vms/${vmId}`, { body, ...options });
28
+ update(vmID: string, body: VMUpdateParams, options?: RequestOptions): APIPromise<OperationsAPI.Operation> {
29
+ return this._client.patch(path`/v1/compute/vms/${vmID}`, { body, ...options });
32
30
  }
33
31
 
34
32
  /**
35
33
  * List all VMs
36
34
  */
37
- list(options?: Core.RequestOptions): Core.APIPromise<VMList> {
35
+ list(options?: RequestOptions): APIPromise<VMList> {
38
36
  return this._client.get('/v1/compute/vms', options);
39
37
  }
40
38
 
41
39
  /**
42
40
  * Delete a VM
43
41
  */
44
- delete(vmId: string, options?: Core.RequestOptions): Core.APIPromise<OperationsAPI.Operation> {
45
- return this._client.delete(`/v1/compute/vms/${vmId}`, options);
42
+ delete(vmID: string, options?: RequestOptions): APIPromise<OperationsAPI.Operation> {
43
+ return this._client.delete(path`/v1/compute/vms/${vmID}`, options);
46
44
  }
47
45
 
48
46
  /**
49
47
  * Get details about a VM
50
48
  */
51
- get(vmId: string, options?: Core.RequestOptions): Core.APIPromise<VM> {
52
- return this._client.get(`/v1/compute/vms/${vmId}`, options);
49
+ get(vmID: string, options?: RequestOptions): APIPromise<VM> {
50
+ return this._client.get(path`/v1/compute/vms/${vmID}`, options);
53
51
  }
54
52
  }
55
53
 
@@ -1,14 +1,16 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../../../resource';
4
- import * as Core from '../../../core';
3
+ import { APIResource } from '../../../core/resource';
5
4
  import * as VolumesAPI from '../volumes';
5
+ import { APIPromise } from '../../../core/api-promise';
6
+ import { RequestOptions } from '../../../internal/request-options';
7
+ import { path } from '../../../internal/utils/path';
6
8
 
7
9
  export class Volumes extends APIResource {
8
10
  /**
9
11
  * List VM's Volumes
10
12
  */
11
- list(vmId: string, options?: Core.RequestOptions): Core.APIPromise<VolumesAPI.VolumeList> {
12
- return this._client.get(`/v1/compute/vms/${vmId}/volumes`, options);
13
+ list(vmID: string, options?: RequestOptions): APIPromise<VolumesAPI.VolumeList> {
14
+ return this._client.get(path`/v1/compute/vms/${vmID}/volumes`, options);
13
15
  }
14
16
  }
@@ -1,15 +1,17 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../../resource';
4
- import * as Core from '../../core';
3
+ import { APIResource } from '../../core/resource';
5
4
  import * as OperationsAPI from '../operations';
6
5
  import * as Shared from '../shared';
6
+ import { APIPromise } from '../../core/api-promise';
7
+ import { RequestOptions } from '../../internal/request-options';
8
+ import { path } from '../../internal/utils/path';
7
9
 
8
10
  export class Volumes extends APIResource {
9
11
  /**
10
12
  * Create a Volume. Only data volumes can be created.
11
13
  */
12
- create(body: VolumeCreateParams, options?: Core.RequestOptions): Core.APIPromise<OperationsAPI.Operation> {
14
+ create(body: VolumeCreateParams, options?: RequestOptions): APIPromise<OperationsAPI.Operation> {
13
15
  return this._client.post('/v1/compute/volumes', { body, ...options });
14
16
  }
15
17
 
@@ -17,32 +19,32 @@ export class Volumes extends APIResource {
17
19
  * Update a Volume. Boot or data volumes can be updated.
18
20
  */
19
21
  update(
20
- volumeId: string,
22
+ volumeID: string,
21
23
  body: VolumeUpdateParams,
22
- options?: Core.RequestOptions,
23
- ): Core.APIPromise<OperationsAPI.Operation> {
24
- return this._client.patch(`/v1/compute/volumes/${volumeId}`, { body, ...options });
24
+ options?: RequestOptions,
25
+ ): APIPromise<OperationsAPI.Operation> {
26
+ return this._client.patch(path`/v1/compute/volumes/${volumeID}`, { body, ...options });
25
27
  }
26
28
 
27
29
  /**
28
30
  * List all volumes
29
31
  */
30
- list(options?: Core.RequestOptions): Core.APIPromise<VolumeList> {
32
+ list(options?: RequestOptions): APIPromise<VolumeList> {
31
33
  return this._client.get('/v1/compute/volumes', options);
32
34
  }
33
35
 
34
36
  /**
35
37
  * Delete a Volume. Boot or data volumes can be deleted.
36
38
  */
37
- delete(volumeId: string, options?: Core.RequestOptions): Core.APIPromise<OperationsAPI.Operation> {
38
- return this._client.delete(`/v1/compute/volumes/${volumeId}`, options);
39
+ delete(volumeID: string, options?: RequestOptions): APIPromise<OperationsAPI.Operation> {
40
+ return this._client.delete(path`/v1/compute/volumes/${volumeID}`, options);
39
41
  }
40
42
 
41
43
  /**
42
44
  * Get a Volume.
43
45
  */
44
- get(volumeId: string, options?: Core.RequestOptions): Core.APIPromise<Volume> {
45
- return this._client.get(`/v1/compute/volumes/${volumeId}`, options);
46
+ get(volumeID: string, options?: RequestOptions): APIPromise<Volume> {
47
+ return this._client.get(path`/v1/compute/volumes/${volumeID}`, options);
46
48
  }
47
49
  }
48
50
 
@@ -1,32 +1,34 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../../resource';
4
- import * as Core from '../../core';
3
+ import { APIResource } from '../../core/resource';
5
4
  import * as OperationsAPI from '../operations';
6
5
  import * as Shared from '../shared';
6
+ import { APIPromise } from '../../core/api-promise';
7
+ import { RequestOptions } from '../../internal/request-options';
8
+ import { path } from '../../internal/utils/path';
7
9
 
8
10
  export class FirewallRules extends APIResource {
9
11
  /**
10
12
  * Create a firewall rule
11
13
  */
12
14
  create(
13
- vpcId: string,
15
+ vpcID: string,
14
16
  body: FirewallRuleCreateParams,
15
- options?: Core.RequestOptions,
16
- ): Core.APIPromise<OperationsAPI.Operation> {
17
- return this._client.post(`/v1/networking/vpcs/${vpcId}/firewall_rules`, { body, ...options });
17
+ options?: RequestOptions,
18
+ ): APIPromise<OperationsAPI.Operation> {
19
+ return this._client.post(path`/v1/networking/vpcs/${vpcID}/firewall_rules`, { body, ...options });
18
20
  }
19
21
 
20
22
  /**
21
23
  * Update a firewall rule
22
24
  */
23
25
  update(
24
- vpcId: string,
25
- firewallRuleId: string,
26
- body: FirewallRuleUpdateParams,
27
- options?: Core.RequestOptions,
28
- ): Core.APIPromise<OperationsAPI.Operation> {
29
- return this._client.patch(`/v1/networking/vpcs/${vpcId}/firewall_rules/${firewallRuleId}`, {
26
+ firewallRuleID: string,
27
+ params: FirewallRuleUpdateParams,
28
+ options?: RequestOptions,
29
+ ): APIPromise<OperationsAPI.Operation> {
30
+ const { vpc_id, ...body } = params;
31
+ return this._client.patch(path`/v1/networking/vpcs/${vpc_id}/firewall_rules/${firewallRuleID}`, {
30
32
  body,
31
33
  ...options,
32
34
  });
@@ -35,26 +37,32 @@ export class FirewallRules extends APIResource {
35
37
  /**
36
38
  * List all firewall rules
37
39
  */
38
- list(vpcId: string, options?: Core.RequestOptions): Core.APIPromise<FirewallRuleList> {
39
- return this._client.get(`/v1/networking/vpcs/${vpcId}/firewall_rules`, options);
40
+ list(vpcID: string, options?: RequestOptions): APIPromise<FirewallRuleList> {
41
+ return this._client.get(path`/v1/networking/vpcs/${vpcID}/firewall_rules`, options);
40
42
  }
41
43
 
42
44
  /**
43
45
  * Delete a firewall rule
44
46
  */
45
47
  delete(
46
- vpcId: string,
47
- firewallRuleId: string,
48
- options?: Core.RequestOptions,
49
- ): Core.APIPromise<OperationsAPI.Operation> {
50
- return this._client.delete(`/v1/networking/vpcs/${vpcId}/firewall_rules/${firewallRuleId}`, options);
48
+ firewallRuleID: string,
49
+ params: FirewallRuleDeleteParams,
50
+ options?: RequestOptions,
51
+ ): APIPromise<OperationsAPI.Operation> {
52
+ const { vpc_id } = params;
53
+ return this._client.delete(path`/v1/networking/vpcs/${vpc_id}/firewall_rules/${firewallRuleID}`, options);
51
54
  }
52
55
 
53
56
  /**
54
57
  * Get details about a firewall rule
55
58
  */
56
- get(vpcId: string, firewallRuleId: string, options?: Core.RequestOptions): Core.APIPromise<FirewallRule> {
57
- return this._client.get(`/v1/networking/vpcs/${vpcId}/firewall_rules/${firewallRuleId}`, options);
59
+ get(
60
+ firewallRuleID: string,
61
+ params: FirewallRuleGetParams,
62
+ options?: RequestOptions,
63
+ ): APIPromise<FirewallRule> {
64
+ const { vpc_id } = params;
65
+ return this._client.get(path`/v1/networking/vpcs/${vpc_id}/firewall_rules/${firewallRuleID}`, options);
58
66
  }
59
67
  }
60
68
 
@@ -106,25 +114,58 @@ export interface FirewallRuleCreateParams {
106
114
  }
107
115
 
108
116
  export interface FirewallRuleUpdateParams {
117
+ /**
118
+ * Path param: VPC ID
119
+ */
120
+ vpc_id: string;
121
+
122
+ /**
123
+ * Body param:
124
+ */
109
125
  destination_address?: string;
110
126
 
127
+ /**
128
+ * Body param:
129
+ */
111
130
  destination_ports?: Array<string>;
112
131
 
132
+ /**
133
+ * Body param:
134
+ */
113
135
  name?: string;
114
136
 
115
137
  /**
116
- * Supported Firewall Rule protocols.
138
+ * Body param: Supported Firewall Rule protocols.
117
139
  */
118
140
  protocol?: 'tcp' | 'udp';
119
141
 
142
+ /**
143
+ * Body param:
144
+ */
120
145
  source_address?: string;
121
146
  }
122
147
 
148
+ export interface FirewallRuleDeleteParams {
149
+ /**
150
+ * VPC ID
151
+ */
152
+ vpc_id: string;
153
+ }
154
+
155
+ export interface FirewallRuleGetParams {
156
+ /**
157
+ * VPC ID
158
+ */
159
+ vpc_id: string;
160
+ }
161
+
123
162
  export declare namespace FirewallRules {
124
163
  export {
125
164
  type FirewallRule as FirewallRule,
126
165
  type FirewallRuleList as FirewallRuleList,
127
166
  type FirewallRuleCreateParams as FirewallRuleCreateParams,
128
167
  type FirewallRuleUpdateParams as FirewallRuleUpdateParams,
168
+ type FirewallRuleDeleteParams as FirewallRuleDeleteParams,
169
+ type FirewallRuleGetParams as FirewallRuleGetParams,
129
170
  };
130
171
  }
@@ -6,6 +6,8 @@ export {
6
6
  type FirewallRuleList,
7
7
  type FirewallRuleCreateParams,
8
8
  type FirewallRuleUpdateParams,
9
+ type FirewallRuleDeleteParams,
10
+ type FirewallRuleGetParams,
9
11
  } from './firewall-rules';
10
12
  export { Networking } from './networking';
11
13
  export {
@@ -1,10 +1,12 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../../resource';
3
+ import { APIResource } from '../../core/resource';
4
4
  import * as FirewallRulesAPI from './firewall-rules';
5
5
  import {
6
6
  FirewallRule,
7
7
  FirewallRuleCreateParams,
8
+ FirewallRuleDeleteParams,
9
+ FirewallRuleGetParams,
8
10
  FirewallRuleList,
9
11
  FirewallRuleUpdateParams,
10
12
  FirewallRules,
@@ -36,5 +38,7 @@ export declare namespace Networking {
36
38
  type FirewallRuleList as FirewallRuleList,
37
39
  type FirewallRuleCreateParams as FirewallRuleCreateParams,
38
40
  type FirewallRuleUpdateParams as FirewallRuleUpdateParams,
41
+ type FirewallRuleDeleteParams as FirewallRuleDeleteParams,
42
+ type FirewallRuleGetParams as FirewallRuleGetParams,
39
43
  };
40
44
  }
@@ -1,15 +1,17 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../../resource';
4
- import * as Core from '../../core';
3
+ import { APIResource } from '../../core/resource';
5
4
  import * as OperationsAPI from '../operations';
6
5
  import * as Shared from '../shared';
6
+ import { APIPromise } from '../../core/api-promise';
7
+ import { RequestOptions } from '../../internal/request-options';
8
+ import { path } from '../../internal/utils/path';
7
9
 
8
10
  export class VPCs extends APIResource {
9
11
  /**
10
12
  * Create a VPC
11
13
  */
12
- create(body: VPCCreateParams, options?: Core.RequestOptions): Core.APIPromise<OperationsAPI.Operation> {
14
+ create(body: VPCCreateParams, options?: RequestOptions): APIPromise<OperationsAPI.Operation> {
13
15
  return this._client.post('/v1/networking/vpcs', { body, ...options });
14
16
  }
15
17
 
@@ -17,32 +19,32 @@ export class VPCs extends APIResource {
17
19
  * Update a VPC
18
20
  */
19
21
  update(
20
- vpcId: string,
22
+ vpcID: string,
21
23
  body: VPCUpdateParams,
22
- options?: Core.RequestOptions,
23
- ): Core.APIPromise<OperationsAPI.Operation> {
24
- return this._client.patch(`/v1/networking/vpcs/${vpcId}`, { body, ...options });
24
+ options?: RequestOptions,
25
+ ): APIPromise<OperationsAPI.Operation> {
26
+ return this._client.patch(path`/v1/networking/vpcs/${vpcID}`, { body, ...options });
25
27
  }
26
28
 
27
29
  /**
28
30
  * List all VPCs
29
31
  */
30
- list(options?: Core.RequestOptions): Core.APIPromise<VPCList> {
32
+ list(options?: RequestOptions): APIPromise<VPCList> {
31
33
  return this._client.get('/v1/networking/vpcs', options);
32
34
  }
33
35
 
34
36
  /**
35
37
  * Delete a VPC
36
38
  */
37
- delete(vpcId: string, options?: Core.RequestOptions): Core.APIPromise<OperationsAPI.Operation> {
38
- return this._client.delete(`/v1/networking/vpcs/${vpcId}`, options);
39
+ delete(vpcID: string, options?: RequestOptions): APIPromise<OperationsAPI.Operation> {
40
+ return this._client.delete(path`/v1/networking/vpcs/${vpcID}`, options);
39
41
  }
40
42
 
41
43
  /**
42
44
  * Get details about a VPC
43
45
  */
44
- get(vpcId: string, options?: Core.RequestOptions): Core.APIPromise<VPC> {
45
- return this._client.get(`/v1/networking/vpcs/${vpcId}`, options);
46
+ get(vpcID: string, options?: RequestOptions): APIPromise<VPC> {
47
+ return this._client.get(path`/v1/networking/vpcs/${vpcID}`, options);
46
48
  }
47
49
  }
48
50
 
@@ -1,21 +1,23 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../resource';
4
- import * as Core from '../core';
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { RequestOptions } from '../internal/request-options';
6
+ import { path } from '../internal/utils/path';
5
7
 
6
8
  export class Operations extends APIResource {
7
9
  /**
8
10
  * List all operations
9
11
  */
10
- list(options?: Core.RequestOptions): Core.APIPromise<OperationList> {
12
+ list(options?: RequestOptions): APIPromise<OperationList> {
11
13
  return this._client.get('/v1/operations', options);
12
14
  }
13
15
 
14
16
  /**
15
17
  * Get details about a specific operation
16
18
  */
17
- get(operationId: string, options?: Core.RequestOptions): Core.APIPromise<Operation> {
18
- return this._client.get(`/v1/operations/${operationId}`, options);
19
+ get(operationID: string, options?: RequestOptions): APIPromise<Operation> {
20
+ return this._client.get(path`/v1/operations/${operationID}`, options);
19
21
  }
20
22
  }
21
23