@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
package/error.d.ts CHANGED
@@ -1,47 +1,2 @@
1
- import { Headers } from "./core.js";
2
- export declare class NirvanaLabsError extends Error {
3
- }
4
- export declare class APIError<TStatus extends number | undefined = number | undefined, THeaders extends Headers | undefined = Headers | undefined, TError extends Object | undefined = Object | undefined> extends NirvanaLabsError {
5
- /** HTTP status for the response that caused the error */
6
- readonly status: TStatus;
7
- /** HTTP headers for the response that caused the error */
8
- readonly headers: THeaders;
9
- /** JSON body of the response that caused the error */
10
- readonly error: TError;
11
- constructor(status: TStatus, error: TError, message: string | undefined, headers: THeaders);
12
- private static makeMessage;
13
- static generate(status: number | undefined, errorResponse: Object | undefined, message: string | undefined, headers: Headers | undefined): APIError;
14
- }
15
- export declare class APIUserAbortError extends APIError<undefined, undefined, undefined> {
16
- constructor({ message }?: {
17
- message?: string;
18
- });
19
- }
20
- export declare class APIConnectionError extends APIError<undefined, undefined, undefined> {
21
- constructor({ message, cause }: {
22
- message?: string | undefined;
23
- cause?: Error | undefined;
24
- });
25
- }
26
- export declare class APIConnectionTimeoutError extends APIConnectionError {
27
- constructor({ message }?: {
28
- message?: string;
29
- });
30
- }
31
- export declare class BadRequestError extends APIError<400, Headers> {
32
- }
33
- export declare class AuthenticationError extends APIError<401, Headers> {
34
- }
35
- export declare class PermissionDeniedError extends APIError<403, Headers> {
36
- }
37
- export declare class NotFoundError extends APIError<404, Headers> {
38
- }
39
- export declare class ConflictError extends APIError<409, Headers> {
40
- }
41
- export declare class UnprocessableEntityError extends APIError<422, Headers> {
42
- }
43
- export declare class RateLimitError extends APIError<429, Headers> {
44
- }
45
- export declare class InternalServerError extends APIError<number, Headers> {
46
- }
1
+ export * from "./core/error.js";
47
2
  //# sourceMappingURL=error.d.ts.map
package/error.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["src/error.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,OAAO,EAAE,MAAM,QAAQ,CAAC;AAE9C,qBAAa,gBAAiB,SAAQ,KAAK;CAAG;AAE9C,qBAAa,QAAQ,CACnB,OAAO,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,EACvD,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,EAC1D,MAAM,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CACtD,SAAQ,gBAAgB;IACxB,yDAAyD;IACzD,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,0DAA0D;IAC1D,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;IAC3B,sDAAsD;IACtD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;gBAEX,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,QAAQ;IAO1F,OAAO,CAAC,MAAM,CAAC,WAAW;IAqB1B,MAAM,CAAC,QAAQ,CACb,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,OAAO,EAAE,OAAO,GAAG,SAAS,GAC3B,QAAQ;CAyCZ;AAED,qBAAa,iBAAkB,SAAQ,QAAQ,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC;gBAClE,EAAE,OAAO,EAAE,GAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAO;CAGnD;AAED,qBAAa,kBAAmB,SAAQ,QAAQ,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC;gBACnE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,KAAK,CAAC,EAAE,KAAK,GAAG,SAAS,CAAA;KAAE;CAM5F;AAED,qBAAa,yBAA0B,SAAQ,kBAAkB;gBACnD,EAAE,OAAO,EAAE,GAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAO;CAGnD;AAED,qBAAa,eAAgB,SAAQ,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;CAAG;AAE9D,qBAAa,mBAAoB,SAAQ,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;CAAG;AAElE,qBAAa,qBAAsB,SAAQ,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;CAAG;AAEpE,qBAAa,aAAc,SAAQ,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;CAAG;AAE5D,qBAAa,aAAc,SAAQ,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;CAAG;AAE5D,qBAAa,wBAAyB,SAAQ,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;CAAG;AAEvE,qBAAa,cAAe,SAAQ,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;CAAG;AAE7D,qBAAa,mBAAoB,SAAQ,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAAG"}
1
+ {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["src/error.ts"],"names":[],"mappings":""}
package/error.js CHANGED
@@ -1,113 +1,19 @@
1
1
  "use strict";
2
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.InternalServerError = exports.RateLimitError = exports.UnprocessableEntityError = exports.ConflictError = exports.NotFoundError = exports.PermissionDeniedError = exports.AuthenticationError = exports.BadRequestError = exports.APIConnectionTimeoutError = exports.APIConnectionError = exports.APIUserAbortError = exports.APIError = exports.NirvanaLabsError = void 0;
5
- const core_1 = require("./core.js");
6
- class NirvanaLabsError extends Error {
7
- }
8
- exports.NirvanaLabsError = NirvanaLabsError;
9
- class APIError extends NirvanaLabsError {
10
- constructor(status, error, message, headers) {
11
- super(`${APIError.makeMessage(status, error, message)}`);
12
- this.status = status;
13
- this.headers = headers;
14
- this.error = error;
15
- }
16
- static makeMessage(status, error, message) {
17
- const msg = error?.message ?
18
- typeof error.message === 'string' ?
19
- error.message
20
- : JSON.stringify(error.message)
21
- : error ? JSON.stringify(error)
22
- : message;
23
- if (status && msg) {
24
- return `${status} ${msg}`;
25
- }
26
- if (status) {
27
- return `${status} status code (no body)`;
28
- }
29
- if (msg) {
30
- return msg;
31
- }
32
- return '(no status code or body)';
33
- }
34
- static generate(status, errorResponse, message, headers) {
35
- if (!status || !headers) {
36
- return new APIConnectionError({ message, cause: (0, core_1.castToError)(errorResponse) });
37
- }
38
- const error = errorResponse;
39
- if (status === 400) {
40
- return new BadRequestError(status, error, message, headers);
41
- }
42
- if (status === 401) {
43
- return new AuthenticationError(status, error, message, headers);
44
- }
45
- if (status === 403) {
46
- return new PermissionDeniedError(status, error, message, headers);
47
- }
48
- if (status === 404) {
49
- return new NotFoundError(status, error, message, headers);
50
- }
51
- if (status === 409) {
52
- return new ConflictError(status, error, message, headers);
53
- }
54
- if (status === 422) {
55
- return new UnprocessableEntityError(status, error, message, headers);
56
- }
57
- if (status === 429) {
58
- return new RateLimitError(status, error, message, headers);
59
- }
60
- if (status >= 500) {
61
- return new InternalServerError(status, error, message, headers);
62
- }
63
- return new APIError(status, error, message, headers);
64
- }
65
- }
66
- exports.APIError = APIError;
67
- class APIUserAbortError extends APIError {
68
- constructor({ message } = {}) {
69
- super(undefined, undefined, message || 'Request was aborted.', undefined);
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
70
7
  }
71
- }
72
- exports.APIUserAbortError = APIUserAbortError;
73
- class APIConnectionError extends APIError {
74
- constructor({ message, cause }) {
75
- super(undefined, undefined, message || 'Connection error.', undefined);
76
- // in some environments the 'cause' property is already declared
77
- // @ts-ignore
78
- if (cause)
79
- this.cause = cause;
80
- }
81
- }
82
- exports.APIConnectionError = APIConnectionError;
83
- class APIConnectionTimeoutError extends APIConnectionError {
84
- constructor({ message } = {}) {
85
- super({ message: message ?? 'Request timed out.' });
86
- }
87
- }
88
- exports.APIConnectionTimeoutError = APIConnectionTimeoutError;
89
- class BadRequestError extends APIError {
90
- }
91
- exports.BadRequestError = BadRequestError;
92
- class AuthenticationError extends APIError {
93
- }
94
- exports.AuthenticationError = AuthenticationError;
95
- class PermissionDeniedError extends APIError {
96
- }
97
- exports.PermissionDeniedError = PermissionDeniedError;
98
- class NotFoundError extends APIError {
99
- }
100
- exports.NotFoundError = NotFoundError;
101
- class ConflictError extends APIError {
102
- }
103
- exports.ConflictError = ConflictError;
104
- class UnprocessableEntityError extends APIError {
105
- }
106
- exports.UnprocessableEntityError = UnprocessableEntityError;
107
- class RateLimitError extends APIError {
108
- }
109
- exports.RateLimitError = RateLimitError;
110
- class InternalServerError extends APIError {
111
- }
112
- exports.InternalServerError = InternalServerError;
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /** @deprecated Import from ./core/error instead */
18
+ __exportStar(require("./core/error.js"), exports);
113
19
  //# sourceMappingURL=error.js.map
package/error.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"error.js","sourceRoot":"","sources":["src/error.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,oCAA8C;AAE9C,MAAa,gBAAiB,SAAQ,KAAK;CAAG;AAA9C,4CAA8C;AAE9C,MAAa,QAIX,SAAQ,gBAAgB;IAQxB,YAAY,MAAe,EAAE,KAAa,EAAE,OAA2B,EAAE,OAAiB;QACxF,KAAK,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;QACzD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAEO,MAAM,CAAC,WAAW,CAAC,MAA0B,EAAE,KAAU,EAAE,OAA2B;QAC5F,MAAM,GAAG,GACP,KAAK,EAAE,OAAO,CAAC,CAAC;YACd,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC;gBACjC,KAAK,CAAC,OAAO;gBACf,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC;YACjC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;gBAC/B,CAAC,CAAC,OAAO,CAAC;QAEZ,IAAI,MAAM,IAAI,GAAG,EAAE;YACjB,OAAO,GAAG,MAAM,IAAI,GAAG,EAAE,CAAC;SAC3B;QACD,IAAI,MAAM,EAAE;YACV,OAAO,GAAG,MAAM,wBAAwB,CAAC;SAC1C;QACD,IAAI,GAAG,EAAE;YACP,OAAO,GAAG,CAAC;SACZ;QACD,OAA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CAAG;AAA7D,wCAA6D;AAE7D,MAAa,mBAAoB,SAAQ,QAAyB;CAAG;AAArE,kDAAqE"}
1
+ {"version":3,"file":"error.js","sourceRoot":"","sources":["src/error.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAmD;AACnD,kDAA6B"}
package/error.mjs CHANGED
@@ -1,97 +1,2 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- import { castToError } from "./core.mjs";
3
- export class NirvanaLabsError extends Error {
4
- }
5
- export class APIError extends NirvanaLabsError {
6
- constructor(status, error, message, headers) {
7
- super(`${APIError.makeMessage(status, error, message)}`);
8
- this.status = status;
9
- this.headers = headers;
10
- this.error = error;
11
- }
12
- static makeMessage(status, error, message) {
13
- const msg = error?.message ?
14
- typeof error.message === 'string' ?
15
- error.message
16
- : JSON.stringify(error.message)
17
- : error ? JSON.stringify(error)
18
- : message;
19
- if (status && msg) {
20
- return `${status} ${msg}`;
21
- }
22
- if (status) {
23
- return `${status} status code (no body)`;
24
- }
25
- if (msg) {
26
- return msg;
27
- }
28
- return '(no status code or body)';
29
- }
30
- static generate(status, errorResponse, message, headers) {
31
- if (!status || !headers) {
32
- return new APIConnectionError({ message, cause: castToError(errorResponse) });
33
- }
34
- const error = errorResponse;
35
- if (status === 400) {
36
- return new BadRequestError(status, error, message, headers);
37
- }
38
- if (status === 401) {
39
- return new AuthenticationError(status, error, message, headers);
40
- }
41
- if (status === 403) {
42
- return new PermissionDeniedError(status, error, message, headers);
43
- }
44
- if (status === 404) {
45
- return new NotFoundError(status, error, message, headers);
46
- }
47
- if (status === 409) {
48
- return new ConflictError(status, error, message, headers);
49
- }
50
- if (status === 422) {
51
- return new UnprocessableEntityError(status, error, message, headers);
52
- }
53
- if (status === 429) {
54
- return new RateLimitError(status, error, message, headers);
55
- }
56
- if (status >= 500) {
57
- return new InternalServerError(status, error, message, headers);
58
- }
59
- return new APIError(status, error, message, headers);
60
- }
61
- }
62
- export class APIUserAbortError extends APIError {
63
- constructor({ message } = {}) {
64
- super(undefined, undefined, message || 'Request was aborted.', undefined);
65
- }
66
- }
67
- export class APIConnectionError extends APIError {
68
- constructor({ message, cause }) {
69
- super(undefined, undefined, message || 'Connection error.', undefined);
70
- // in some environments the 'cause' property is already declared
71
- // @ts-ignore
72
- if (cause)
73
- this.cause = cause;
74
- }
75
- }
76
- export class APIConnectionTimeoutError extends APIConnectionError {
77
- constructor({ message } = {}) {
78
- super({ message: message ?? 'Request timed out.' });
79
- }
80
- }
81
- export class BadRequestError extends APIError {
82
- }
83
- export class AuthenticationError extends APIError {
84
- }
85
- export class PermissionDeniedError extends APIError {
86
- }
87
- export class NotFoundError extends APIError {
88
- }
89
- export class ConflictError extends APIError {
90
- }
91
- export class UnprocessableEntityError extends APIError {
92
- }
93
- export class RateLimitError extends APIError {
94
- }
95
- export class InternalServerError extends APIError {
96
- }
1
+ export * from "./core/error.mjs";
97
2
  //# sourceMappingURL=error.mjs.map
package/error.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"error.mjs","sourceRoot":"","sources":["src/error.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAW;AAE/B,MAAM,OAAO,gBAAiB,SAAQ,KAAK;CAAG;AAE9C,MAAM,OAAO,QAIX,SAAQ,gBAAgB;IAQxB,YAAY,MAAe,EAAE,KAAa,EAAE,OAA2B,EAAE,OAAiB;QACxF,KAAK,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;QACzD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAEO,MAAM,CAAC,WAAW,CAAC,MAA0B,EAAE,KAAU,EAAE,OAA2B;QAC5F,MAAM,GAAG,GACP,KAAK,EAAE,OAAO,CAAC,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,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,CAAC,CAAC;IACtD,CAAC;CACF;AAED,MAAM,OAAO,eAAgB,SAAQ,QAAsB;CAAG;AAE9D,MAAM,OAAO,mBAAoB,SAAQ,QAAsB;CAAG;AAElE,MAAM,OAAO,qBAAsB,SAAQ,QAAsB;CAAG;AAEpE,MAAM,OAAO,aAAc,SAAQ,QAAsB;CAAG;AAE5D,MAAM,OAAO,aAAc,SAAQ,QAAsB;CAAG;AAE5D,MAAM,OAAO,wBAAyB,SAAQ,QAAsB;CAAG;AAEvE,MAAM,OAAO,cAAe,SAAQ,QAAsB;CAAG;AAE7D,MAAM,OAAO,mBAAoB,SAAQ,QAAyB;CAAG"}
1
+ {"version":3,"file":"error.mjs","sourceRoot":"","sources":["src/error.ts"],"names":[],"mappings":""}
package/index.d.mts CHANGED
@@ -1,124 +1,6 @@
1
- import { type Agent } from "./_shims/index.js";
2
- import * as Core from "./core.js";
3
- import * as Errors from "./error.js";
4
- import * as Uploads from "./uploads.js";
5
- import * as API from "./resources/index.js";
6
- import { APIKeys } from "./resources/api-keys.js";
7
- import { Operations } from "./resources/operations.js";
8
- import { UserResource } from "./resources/user.js";
9
- import { Compute } from "./resources/compute/compute.js";
10
- import { Networking } from "./resources/networking/networking.js";
11
- export interface ClientOptions {
12
- /**
13
- * Defaults to process.env['NIRVANA_LABS_API_KEY'].
14
- */
15
- apiKey?: string | undefined;
16
- /**
17
- * Override the default base URL for the API, e.g., "https://api.example.com/v2/"
18
- *
19
- * Defaults to process.env['NIRVANA_LABS_BASE_URL'].
20
- */
21
- baseURL?: string | null | undefined;
22
- /**
23
- * The maximum amount of time (in milliseconds) that the client should wait for a response
24
- * from the server before timing out a single request.
25
- *
26
- * Note that request timeouts are retried by default, so in a worst-case scenario you may wait
27
- * much longer than this timeout before the promise succeeds or fails.
28
- */
29
- timeout?: number | undefined;
30
- /**
31
- * An HTTP agent used to manage HTTP(S) connections.
32
- *
33
- * If not provided, an agent will be constructed by default in the Node.js environment,
34
- * otherwise no agent is used.
35
- */
36
- httpAgent?: Agent | undefined;
37
- /**
38
- * Specify a custom `fetch` function implementation.
39
- *
40
- * If not provided, we use `node-fetch` on Node.js and otherwise expect that `fetch` is
41
- * defined globally.
42
- */
43
- fetch?: Core.Fetch | undefined;
44
- /**
45
- * The maximum number of times that the client will retry a request in case of a
46
- * temporary failure, like a network error or a 5XX error from the server.
47
- *
48
- * @default 2
49
- */
50
- maxRetries?: number | undefined;
51
- /**
52
- * Default headers to include with every request to the API.
53
- *
54
- * These can be removed in individual requests by explicitly setting the
55
- * header to `undefined` or `null` in request options.
56
- */
57
- defaultHeaders?: Core.Headers | undefined;
58
- /**
59
- * Default query parameters to include with every request to the API.
60
- *
61
- * These can be removed in individual requests by explicitly setting the
62
- * param to `undefined` in request options.
63
- */
64
- defaultQuery?: Core.DefaultQuery | undefined;
65
- }
66
- /**
67
- * API Client for interfacing with the Nirvana Labs API.
68
- */
69
- export declare class NirvanaLabs extends Core.APIClient {
70
- apiKey: string;
71
- private _options;
72
- /**
73
- * API Client for interfacing with the Nirvana Labs API.
74
- *
75
- * @param {string | undefined} [opts.apiKey=process.env['NIRVANA_LABS_API_KEY'] ?? undefined]
76
- * @param {string} [opts.baseURL=process.env['NIRVANA_LABS_BASE_URL'] ?? https://api.nirvanalabs.io/] - Override the default base URL for the API.
77
- * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
78
- * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
79
- * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
80
- * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
81
- * @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
82
- * @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
83
- */
84
- constructor({ baseURL, apiKey, ...opts }?: ClientOptions);
85
- user: API.UserResource;
86
- apiKeys: API.APIKeys;
87
- operations: API.Operations;
88
- compute: API.Compute;
89
- networking: API.Networking;
90
- protected defaultQuery(): Core.DefaultQuery | undefined;
91
- protected defaultHeaders(opts: Core.FinalRequestOptions): Core.Headers;
92
- protected authHeaders(opts: Core.FinalRequestOptions): Core.Headers;
93
- static NirvanaLabs: typeof NirvanaLabs;
94
- static DEFAULT_TIMEOUT: number;
95
- static NirvanaLabsError: typeof Errors.NirvanaLabsError;
96
- static APIError: typeof Errors.APIError;
97
- static APIConnectionError: typeof Errors.APIConnectionError;
98
- static APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError;
99
- static APIUserAbortError: typeof Errors.APIUserAbortError;
100
- static NotFoundError: typeof Errors.NotFoundError;
101
- static ConflictError: typeof Errors.ConflictError;
102
- static RateLimitError: typeof Errors.RateLimitError;
103
- static BadRequestError: typeof Errors.BadRequestError;
104
- static AuthenticationError: typeof Errors.AuthenticationError;
105
- static InternalServerError: typeof Errors.InternalServerError;
106
- static PermissionDeniedError: typeof Errors.PermissionDeniedError;
107
- static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
108
- static toFile: typeof Uploads.toFile;
109
- static fileFromPath: typeof Uploads.fileFromPath;
110
- }
111
- export declare namespace NirvanaLabs {
112
- export type RequestOptions = Core.RequestOptions;
113
- export { UserResource as UserResource };
114
- export { APIKeys as APIKeys };
115
- export { Operations as Operations };
116
- export { Compute as Compute };
117
- export { Networking as Networking };
118
- export type RegionName = API.RegionName;
119
- export type ResourceStatus = API.ResourceStatus;
120
- }
121
- export { toFile, fileFromPath } from "./uploads.js";
122
- export { NirvanaLabsError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./error.js";
123
- export default NirvanaLabs;
124
- //# sourceMappingURL=index.d.ts.map
1
+ export { NirvanaLabs as default } from "./client.mjs";
2
+ export { type Uploadable, toFile } from "./core/uploads.mjs";
3
+ export { APIPromise } from "./core/api-promise.mjs";
4
+ export { NirvanaLabs, type ClientOptions } from "./client.mjs";
5
+ export { NirvanaLabsError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./core/error.mjs";
6
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,IAAI,OAAO,EAAE;OAE1B,EAAE,KAAK,UAAU,EAAE,MAAM,EAAE;OAC3B,EAAE,UAAU,EAAE;OACd,EAAE,WAAW,EAAE,KAAK,aAAa,EAAE;OACnC,EACL,gBAAgB,EAChB,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,GACzB"}
package/index.d.ts CHANGED
@@ -1,124 +1,6 @@
1
- import { type Agent } from "./_shims/index.js";
2
- import * as Core from "./core.js";
3
- import * as Errors from "./error.js";
4
- import * as Uploads from "./uploads.js";
5
- import * as API from "./resources/index.js";
6
- import { APIKeys } from "./resources/api-keys.js";
7
- import { Operations } from "./resources/operations.js";
8
- import { UserResource } from "./resources/user.js";
9
- import { Compute } from "./resources/compute/compute.js";
10
- import { Networking } from "./resources/networking/networking.js";
11
- export interface ClientOptions {
12
- /**
13
- * Defaults to process.env['NIRVANA_LABS_API_KEY'].
14
- */
15
- apiKey?: string | undefined;
16
- /**
17
- * Override the default base URL for the API, e.g., "https://api.example.com/v2/"
18
- *
19
- * Defaults to process.env['NIRVANA_LABS_BASE_URL'].
20
- */
21
- baseURL?: string | null | undefined;
22
- /**
23
- * The maximum amount of time (in milliseconds) that the client should wait for a response
24
- * from the server before timing out a single request.
25
- *
26
- * Note that request timeouts are retried by default, so in a worst-case scenario you may wait
27
- * much longer than this timeout before the promise succeeds or fails.
28
- */
29
- timeout?: number | undefined;
30
- /**
31
- * An HTTP agent used to manage HTTP(S) connections.
32
- *
33
- * If not provided, an agent will be constructed by default in the Node.js environment,
34
- * otherwise no agent is used.
35
- */
36
- httpAgent?: Agent | undefined;
37
- /**
38
- * Specify a custom `fetch` function implementation.
39
- *
40
- * If not provided, we use `node-fetch` on Node.js and otherwise expect that `fetch` is
41
- * defined globally.
42
- */
43
- fetch?: Core.Fetch | undefined;
44
- /**
45
- * The maximum number of times that the client will retry a request in case of a
46
- * temporary failure, like a network error or a 5XX error from the server.
47
- *
48
- * @default 2
49
- */
50
- maxRetries?: number | undefined;
51
- /**
52
- * Default headers to include with every request to the API.
53
- *
54
- * These can be removed in individual requests by explicitly setting the
55
- * header to `undefined` or `null` in request options.
56
- */
57
- defaultHeaders?: Core.Headers | undefined;
58
- /**
59
- * Default query parameters to include with every request to the API.
60
- *
61
- * These can be removed in individual requests by explicitly setting the
62
- * param to `undefined` in request options.
63
- */
64
- defaultQuery?: Core.DefaultQuery | undefined;
65
- }
66
- /**
67
- * API Client for interfacing with the Nirvana Labs API.
68
- */
69
- export declare class NirvanaLabs extends Core.APIClient {
70
- apiKey: string;
71
- private _options;
72
- /**
73
- * API Client for interfacing with the Nirvana Labs API.
74
- *
75
- * @param {string | undefined} [opts.apiKey=process.env['NIRVANA_LABS_API_KEY'] ?? undefined]
76
- * @param {string} [opts.baseURL=process.env['NIRVANA_LABS_BASE_URL'] ?? https://api.nirvanalabs.io/] - Override the default base URL for the API.
77
- * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
78
- * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
79
- * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
80
- * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
81
- * @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
82
- * @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
83
- */
84
- constructor({ baseURL, apiKey, ...opts }?: ClientOptions);
85
- user: API.UserResource;
86
- apiKeys: API.APIKeys;
87
- operations: API.Operations;
88
- compute: API.Compute;
89
- networking: API.Networking;
90
- protected defaultQuery(): Core.DefaultQuery | undefined;
91
- protected defaultHeaders(opts: Core.FinalRequestOptions): Core.Headers;
92
- protected authHeaders(opts: Core.FinalRequestOptions): Core.Headers;
93
- static NirvanaLabs: typeof NirvanaLabs;
94
- static DEFAULT_TIMEOUT: number;
95
- static NirvanaLabsError: typeof Errors.NirvanaLabsError;
96
- static APIError: typeof Errors.APIError;
97
- static APIConnectionError: typeof Errors.APIConnectionError;
98
- static APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError;
99
- static APIUserAbortError: typeof Errors.APIUserAbortError;
100
- static NotFoundError: typeof Errors.NotFoundError;
101
- static ConflictError: typeof Errors.ConflictError;
102
- static RateLimitError: typeof Errors.RateLimitError;
103
- static BadRequestError: typeof Errors.BadRequestError;
104
- static AuthenticationError: typeof Errors.AuthenticationError;
105
- static InternalServerError: typeof Errors.InternalServerError;
106
- static PermissionDeniedError: typeof Errors.PermissionDeniedError;
107
- static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
108
- static toFile: typeof Uploads.toFile;
109
- static fileFromPath: typeof Uploads.fileFromPath;
110
- }
111
- export declare namespace NirvanaLabs {
112
- export type RequestOptions = Core.RequestOptions;
113
- export { UserResource as UserResource };
114
- export { APIKeys as APIKeys };
115
- export { Operations as Operations };
116
- export { Compute as Compute };
117
- export { Networking as Networking };
118
- export type RegionName = API.RegionName;
119
- export type ResourceStatus = API.ResourceStatus;
120
- }
121
- export { toFile, fileFromPath } from "./uploads.js";
122
- export { NirvanaLabsError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./error.js";
123
- export default NirvanaLabs;
1
+ export { NirvanaLabs as default } from "./client.js";
2
+ export { type Uploadable, toFile } from "./core/uploads.js";
3
+ export { APIPromise } from "./core/api-promise.js";
4
+ export { NirvanaLabs, type ClientOptions } from "./client.js";
5
+ export { NirvanaLabsError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./core/error.js";
124
6
  //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,SAAS,CAAC;AAClC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAE/D,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE5B;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAEpC;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE7B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;IAE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