@leonardo-ai/sdk 4.14.2 → 4.15.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 (368) hide show
  1. package/README.md +104 -7
  2. package/core.d.ts +10 -0
  3. package/core.d.ts.map +1 -0
  4. package/core.js +17 -0
  5. package/core.js.map +1 -0
  6. package/docs/sdks/dataset/README.md +169 -7
  7. package/docs/sdks/elements/README.md +33 -1
  8. package/docs/sdks/image/README.md +132 -7
  9. package/docs/sdks/initimages/README.md +136 -6
  10. package/docs/sdks/leonardo/README.md +1 -5
  11. package/docs/sdks/models/README.md +135 -6
  12. package/docs/sdks/motion/README.md +34 -4
  13. package/docs/sdks/pricingcalculator/README.md +34 -2
  14. package/docs/sdks/prompt/README.md +67 -2
  15. package/docs/sdks/realtimecanvas/README.md +133 -21
  16. package/docs/sdks/texture/README.md +67 -4
  17. package/docs/sdks/threedmodelassets/README.md +67 -4
  18. package/docs/sdks/user/README.md +33 -1
  19. package/docs/sdks/variation/README.md +166 -10
  20. package/funcs/datasetCreateDataset.d.ts +15 -0
  21. package/funcs/datasetCreateDataset.d.ts.map +1 -0
  22. package/funcs/datasetCreateDataset.js +101 -0
  23. package/funcs/datasetCreateDataset.js.map +1 -0
  24. package/funcs/datasetDeleteDatasetById.d.ts +15 -0
  25. package/funcs/datasetDeleteDatasetById.d.ts.map +1 -0
  26. package/funcs/datasetDeleteDatasetById.js +103 -0
  27. package/funcs/datasetDeleteDatasetById.js.map +1 -0
  28. package/funcs/datasetGetDatasetById.d.ts +15 -0
  29. package/funcs/datasetGetDatasetById.d.ts.map +1 -0
  30. package/funcs/datasetGetDatasetById.js +105 -0
  31. package/funcs/datasetGetDatasetById.js.map +1 -0
  32. package/funcs/datasetUploadDatasetImage.d.ts +15 -0
  33. package/funcs/datasetUploadDatasetImage.d.ts.map +1 -0
  34. package/funcs/datasetUploadDatasetImage.js +108 -0
  35. package/funcs/datasetUploadDatasetImage.js.map +1 -0
  36. package/funcs/datasetUploadDatasetImageFromGen.d.ts +15 -0
  37. package/funcs/datasetUploadDatasetImageFromGen.d.ts.map +1 -0
  38. package/funcs/datasetUploadDatasetImageFromGen.js +108 -0
  39. package/funcs/datasetUploadDatasetImageFromGen.js.map +1 -0
  40. package/funcs/elementsListElements.d.ts +15 -0
  41. package/funcs/elementsListElements.d.ts.map +1 -0
  42. package/funcs/elementsListElements.js +90 -0
  43. package/funcs/elementsListElements.js.map +1 -0
  44. package/funcs/imageCreateGeneration.d.ts +15 -0
  45. package/funcs/imageCreateGeneration.d.ts.map +1 -0
  46. package/funcs/imageCreateGeneration.js +99 -0
  47. package/funcs/imageCreateGeneration.js.map +1 -0
  48. package/funcs/imageDeleteGenerationById.d.ts +15 -0
  49. package/funcs/imageDeleteGenerationById.d.ts.map +1 -0
  50. package/funcs/imageDeleteGenerationById.js +103 -0
  51. package/funcs/imageDeleteGenerationById.js.map +1 -0
  52. package/funcs/imageGetGenerationById.d.ts +15 -0
  53. package/funcs/imageGetGenerationById.d.ts.map +1 -0
  54. package/funcs/imageGetGenerationById.js +103 -0
  55. package/funcs/imageGetGenerationById.js.map +1 -0
  56. package/funcs/imageGetGenerationsByUserId.d.ts +15 -0
  57. package/funcs/imageGetGenerationsByUserId.d.ts.map +1 -0
  58. package/funcs/imageGetGenerationsByUserId.js +113 -0
  59. package/funcs/imageGetGenerationsByUserId.js.map +1 -0
  60. package/funcs/initImagesDeleteInitImageById.d.ts +15 -0
  61. package/funcs/initImagesDeleteInitImageById.d.ts.map +1 -0
  62. package/funcs/initImagesDeleteInitImageById.js +103 -0
  63. package/funcs/initImagesDeleteInitImageById.js.map +1 -0
  64. package/funcs/initImagesGetInitImageById.d.ts +15 -0
  65. package/funcs/initImagesGetInitImageById.d.ts.map +1 -0
  66. package/funcs/initImagesGetInitImageById.js +103 -0
  67. package/funcs/initImagesGetInitImageById.js.map +1 -0
  68. package/funcs/initImagesUploadCanvasInitImage.d.ts +15 -0
  69. package/funcs/initImagesUploadCanvasInitImage.d.ts.map +1 -0
  70. package/funcs/initImagesUploadCanvasInitImage.js +99 -0
  71. package/funcs/initImagesUploadCanvasInitImage.js.map +1 -0
  72. package/funcs/initImagesUploadInitImage.d.ts +15 -0
  73. package/funcs/initImagesUploadInitImage.d.ts.map +1 -0
  74. package/funcs/initImagesUploadInitImage.js +101 -0
  75. package/funcs/initImagesUploadInitImage.js.map +1 -0
  76. package/funcs/modelsCreateModel.d.ts +15 -0
  77. package/funcs/modelsCreateModel.d.ts.map +1 -0
  78. package/funcs/modelsCreateModel.js +101 -0
  79. package/funcs/modelsCreateModel.js.map +1 -0
  80. package/funcs/modelsDeleteModelById.d.ts +15 -0
  81. package/funcs/modelsDeleteModelById.d.ts.map +1 -0
  82. package/funcs/modelsDeleteModelById.js +105 -0
  83. package/funcs/modelsDeleteModelById.js.map +1 -0
  84. package/funcs/modelsGetModelById.d.ts +15 -0
  85. package/funcs/modelsGetModelById.d.ts.map +1 -0
  86. package/funcs/modelsGetModelById.js +105 -0
  87. package/funcs/modelsGetModelById.js.map +1 -0
  88. package/funcs/modelsListPlatformModels.d.ts +15 -0
  89. package/funcs/modelsListPlatformModels.d.ts.map +1 -0
  90. package/funcs/modelsListPlatformModels.js +88 -0
  91. package/funcs/modelsListPlatformModels.js.map +1 -0
  92. package/funcs/motionCreateSVDMotionGeneration.d.ts +15 -0
  93. package/funcs/motionCreateSVDMotionGeneration.d.ts.map +1 -0
  94. package/funcs/motionCreateSVDMotionGeneration.js +99 -0
  95. package/funcs/motionCreateSVDMotionGeneration.js.map +1 -0
  96. package/funcs/pricingCalculatorPricingCalculator.d.ts +15 -0
  97. package/funcs/pricingCalculatorPricingCalculator.d.ts.map +1 -0
  98. package/funcs/pricingCalculatorPricingCalculator.js +99 -0
  99. package/funcs/pricingCalculatorPricingCalculator.js.map +1 -0
  100. package/funcs/promptPromptImprove.d.ts +15 -0
  101. package/funcs/promptPromptImprove.d.ts.map +1 -0
  102. package/funcs/promptPromptImprove.js +101 -0
  103. package/funcs/promptPromptImprove.js.map +1 -0
  104. package/funcs/promptPromptRandom.d.ts +15 -0
  105. package/funcs/promptPromptRandom.d.ts.map +1 -0
  106. package/funcs/promptPromptRandom.js +90 -0
  107. package/funcs/promptPromptRandom.js.map +1 -0
  108. package/funcs/realtimeCanvasCreateLCMGeneration.d.ts +15 -0
  109. package/funcs/realtimeCanvasCreateLCMGeneration.d.ts.map +1 -0
  110. package/funcs/realtimeCanvasCreateLCMGeneration.js +99 -0
  111. package/funcs/realtimeCanvasCreateLCMGeneration.js.map +1 -0
  112. package/funcs/realtimeCanvasPerformAlchemyUpscaleLCM.d.ts +15 -0
  113. package/funcs/realtimeCanvasPerformAlchemyUpscaleLCM.d.ts.map +1 -0
  114. package/funcs/realtimeCanvasPerformAlchemyUpscaleLCM.js +99 -0
  115. package/funcs/realtimeCanvasPerformAlchemyUpscaleLCM.js.map +1 -0
  116. package/funcs/realtimeCanvasPerformInpaintingLCM.d.ts +15 -0
  117. package/funcs/realtimeCanvasPerformInpaintingLCM.d.ts.map +1 -0
  118. package/funcs/realtimeCanvasPerformInpaintingLCM.js +99 -0
  119. package/funcs/realtimeCanvasPerformInpaintingLCM.js.map +1 -0
  120. package/funcs/realtimeCanvasPerformInstantRefine.d.ts +15 -0
  121. package/funcs/realtimeCanvasPerformInstantRefine.d.ts.map +1 -0
  122. package/funcs/realtimeCanvasPerformInstantRefine.js +99 -0
  123. package/funcs/realtimeCanvasPerformInstantRefine.js.map +1 -0
  124. package/funcs/textureCreateTextureGeneration.d.ts +15 -0
  125. package/funcs/textureCreateTextureGeneration.d.ts.map +1 -0
  126. package/funcs/textureCreateTextureGeneration.js +99 -0
  127. package/funcs/textureCreateTextureGeneration.js.map +1 -0
  128. package/funcs/textureDeleteTextureGenerationById.d.ts +15 -0
  129. package/funcs/textureDeleteTextureGenerationById.d.ts.map +1 -0
  130. package/funcs/textureDeleteTextureGenerationById.js +107 -0
  131. package/funcs/textureDeleteTextureGenerationById.js.map +1 -0
  132. package/funcs/threeDModelAssetsDelete3DModelById.d.ts +15 -0
  133. package/funcs/threeDModelAssetsDelete3DModelById.d.ts.map +1 -0
  134. package/funcs/threeDModelAssetsDelete3DModelById.js +105 -0
  135. package/funcs/threeDModelAssetsDelete3DModelById.js.map +1 -0
  136. package/funcs/threeDModelAssetsUploadModelAsset.d.ts +15 -0
  137. package/funcs/threeDModelAssetsUploadModelAsset.d.ts.map +1 -0
  138. package/funcs/threeDModelAssetsUploadModelAsset.js +99 -0
  139. package/funcs/threeDModelAssetsUploadModelAsset.js.map +1 -0
  140. package/funcs/userGetUserSelf.d.ts +15 -0
  141. package/funcs/userGetUserSelf.d.ts.map +1 -0
  142. package/funcs/userGetUserSelf.js +90 -0
  143. package/funcs/userGetUserSelf.js.map +1 -0
  144. package/funcs/variationCreateUniversalUpscalerJob.d.ts +15 -0
  145. package/funcs/variationCreateUniversalUpscalerJob.d.ts.map +1 -0
  146. package/funcs/variationCreateUniversalUpscalerJob.js +99 -0
  147. package/funcs/variationCreateUniversalUpscalerJob.js.map +1 -0
  148. package/funcs/variationCreateVariationNoBG.d.ts +15 -0
  149. package/funcs/variationCreateVariationNoBG.d.ts.map +1 -0
  150. package/funcs/variationCreateVariationNoBG.js +99 -0
  151. package/funcs/variationCreateVariationNoBG.js.map +1 -0
  152. package/funcs/variationCreateVariationUnzoom.d.ts +15 -0
  153. package/funcs/variationCreateVariationUnzoom.d.ts.map +1 -0
  154. package/funcs/variationCreateVariationUnzoom.js +99 -0
  155. package/funcs/variationCreateVariationUnzoom.js.map +1 -0
  156. package/funcs/variationCreateVariationUpscale.d.ts +15 -0
  157. package/funcs/variationCreateVariationUpscale.d.ts.map +1 -0
  158. package/funcs/variationCreateVariationUpscale.js +99 -0
  159. package/funcs/variationCreateVariationUpscale.js.map +1 -0
  160. package/funcs/variationGetVariationById.d.ts +15 -0
  161. package/funcs/variationGetVariationById.d.ts.map +1 -0
  162. package/funcs/variationGetVariationById.js +103 -0
  163. package/funcs/variationGetVariationById.js.map +1 -0
  164. package/index.d.ts +1 -0
  165. package/index.d.ts.map +1 -1
  166. package/index.js +14 -0
  167. package/index.js.map +1 -1
  168. package/lib/config.d.ts +5 -3
  169. package/lib/config.d.ts.map +1 -1
  170. package/lib/config.js +3 -3
  171. package/lib/config.js.map +1 -1
  172. package/lib/dlv.d.ts +14 -0
  173. package/lib/dlv.d.ts.map +1 -0
  174. package/lib/dlv.js +50 -0
  175. package/lib/dlv.js.map +1 -0
  176. package/lib/files.d.ts +12 -0
  177. package/lib/files.d.ts.map +1 -0
  178. package/lib/files.js +52 -0
  179. package/lib/files.js.map +1 -0
  180. package/lib/http.d.ts +11 -52
  181. package/lib/http.d.ts.map +1 -1
  182. package/lib/http.js +49 -173
  183. package/lib/http.js.map +1 -1
  184. package/lib/logger.d.ts +6 -0
  185. package/lib/logger.d.ts.map +1 -0
  186. package/lib/logger.js +6 -0
  187. package/lib/logger.js.map +1 -0
  188. package/lib/matchers.d.ts +64 -0
  189. package/lib/matchers.d.ts.map +1 -0
  190. package/lib/matchers.js +206 -0
  191. package/lib/matchers.js.map +1 -0
  192. package/lib/retries.d.ts.map +1 -1
  193. package/lib/retries.js +2 -28
  194. package/lib/retries.js.map +1 -1
  195. package/lib/schemas.d.ts +8 -0
  196. package/lib/schemas.d.ts.map +1 -1
  197. package/lib/schemas.js +16 -1
  198. package/lib/schemas.js.map +1 -1
  199. package/lib/sdks.d.ts +14 -16
  200. package/lib/sdks.d.ts.map +1 -1
  201. package/lib/sdks.js +144 -27
  202. package/lib/sdks.js.map +1 -1
  203. package/lib/security.d.ts +7 -1
  204. package/lib/security.d.ts.map +1 -1
  205. package/lib/security.js +13 -1
  206. package/lib/security.js.map +1 -1
  207. package/package.json +2 -1
  208. package/sdk/dataset.d.ts +0 -3
  209. package/sdk/dataset.d.ts.map +1 -1
  210. package/sdk/dataset.js +11 -332
  211. package/sdk/dataset.js.map +1 -1
  212. package/sdk/elements.d.ts +0 -3
  213. package/sdk/elements.d.ts.map +1 -1
  214. package/sdk/elements.js +3 -93
  215. package/sdk/elements.js.map +1 -1
  216. package/sdk/image.d.ts +0 -3
  217. package/sdk/image.d.ts.map +1 -1
  218. package/sdk/image.js +9 -273
  219. package/sdk/image.js.map +1 -1
  220. package/sdk/initimages.d.ts +0 -3
  221. package/sdk/initimages.d.ts.map +1 -1
  222. package/sdk/initimages.js +9 -261
  223. package/sdk/initimages.js.map +1 -1
  224. package/sdk/models/errors/httpclienterrors.d.ts +44 -0
  225. package/sdk/models/errors/httpclienterrors.d.ts.map +1 -0
  226. package/sdk/models/errors/httpclienterrors.js +78 -0
  227. package/sdk/models/errors/httpclienterrors.js.map +1 -0
  228. package/sdk/models/errors/index.d.ts +1 -0
  229. package/sdk/models/errors/index.d.ts.map +1 -1
  230. package/sdk/models/errors/index.js +1 -0
  231. package/sdk/models/errors/index.js.map +1 -1
  232. package/sdk/models/errors/sdkvalidationerror.d.ts +4 -1
  233. package/sdk/models/errors/sdkvalidationerror.d.ts.map +1 -1
  234. package/sdk/models/errors/sdkvalidationerror.js +3 -5
  235. package/sdk/models/errors/sdkvalidationerror.js.map +1 -1
  236. package/sdk/models/operations/pricingcalculator.d.ts +5 -0
  237. package/sdk/models/operations/pricingcalculator.d.ts.map +1 -1
  238. package/sdk/models/operations/pricingcalculator.js +2 -0
  239. package/sdk/models/operations/pricingcalculator.js.map +1 -1
  240. package/sdk/models.d.ts +0 -3
  241. package/sdk/models.d.ts.map +1 -1
  242. package/sdk/models.js +9 -256
  243. package/sdk/models.js.map +1 -1
  244. package/sdk/motion.d.ts +0 -3
  245. package/sdk/motion.d.ts.map +1 -1
  246. package/sdk/motion.js +3 -102
  247. package/sdk/motion.js.map +1 -1
  248. package/sdk/pricingcalculator.d.ts +0 -3
  249. package/sdk/pricingcalculator.d.ts.map +1 -1
  250. package/sdk/pricingcalculator.js +3 -100
  251. package/sdk/pricingcalculator.js.map +1 -1
  252. package/sdk/prompt.d.ts +0 -3
  253. package/sdk/prompt.d.ts.map +1 -1
  254. package/sdk/prompt.js +5 -146
  255. package/sdk/prompt.js.map +1 -1
  256. package/sdk/realtimecanvas.d.ts +0 -3
  257. package/sdk/realtimecanvas.d.ts.map +1 -1
  258. package/sdk/realtimecanvas.js +9 -253
  259. package/sdk/realtimecanvas.js.map +1 -1
  260. package/sdk/sdk.d.ts +0 -3
  261. package/sdk/sdk.d.ts.map +1 -1
  262. package/sdk/sdk.js +0 -23
  263. package/sdk/sdk.js.map +1 -1
  264. package/sdk/texture.d.ts +0 -3
  265. package/sdk/texture.d.ts.map +1 -1
  266. package/sdk/texture.js +5 -159
  267. package/sdk/texture.js.map +1 -1
  268. package/sdk/threedmodelassets.d.ts +0 -3
  269. package/sdk/threedmodelassets.d.ts.map +1 -1
  270. package/sdk/threedmodelassets.js +5 -157
  271. package/sdk/threedmodelassets.js.map +1 -1
  272. package/sdk/types/constdatetime.d.ts +3 -0
  273. package/sdk/types/constdatetime.d.ts.map +1 -0
  274. package/sdk/types/constdatetime.js +37 -0
  275. package/sdk/types/constdatetime.js.map +1 -0
  276. package/sdk/types/fp.d.ts +31 -0
  277. package/sdk/types/fp.d.ts.map +1 -0
  278. package/sdk/types/fp.js +38 -0
  279. package/sdk/types/fp.js.map +1 -0
  280. package/sdk/types/index.d.ts +1 -0
  281. package/sdk/types/index.d.ts.map +1 -1
  282. package/sdk/types/operations.d.ts +22 -8
  283. package/sdk/types/operations.d.ts.map +1 -1
  284. package/sdk/types/operations.js +64 -2
  285. package/sdk/types/operations.js.map +1 -1
  286. package/sdk/types/streams.d.ts +2 -0
  287. package/sdk/types/streams.d.ts.map +1 -0
  288. package/sdk/types/streams.js +19 -0
  289. package/sdk/types/streams.js.map +1 -0
  290. package/sdk/user.d.ts +0 -3
  291. package/sdk/user.d.ts.map +1 -1
  292. package/sdk/user.js +3 -93
  293. package/sdk/user.js.map +1 -1
  294. package/sdk/variation.d.ts +0 -3
  295. package/sdk/variation.d.ts.map +1 -1
  296. package/sdk/variation.js +11 -310
  297. package/sdk/variation.js.map +1 -1
  298. package/src/core.ts +13 -0
  299. package/src/funcs/datasetCreateDataset.ts +127 -0
  300. package/src/funcs/datasetDeleteDatasetById.ts +133 -0
  301. package/src/funcs/datasetGetDatasetById.ts +132 -0
  302. package/src/funcs/datasetUploadDatasetImage.ts +139 -0
  303. package/src/funcs/datasetUploadDatasetImageFromGen.ts +139 -0
  304. package/src/funcs/elementsListElements.ts +109 -0
  305. package/src/funcs/imageCreateGeneration.ts +128 -0
  306. package/src/funcs/imageDeleteGenerationById.ts +133 -0
  307. package/src/funcs/imageGetGenerationById.ts +133 -0
  308. package/src/funcs/imageGetGenerationsByUserId.ts +149 -0
  309. package/src/funcs/initImagesDeleteInitImageById.ts +133 -0
  310. package/src/funcs/initImagesGetInitImageById.ts +133 -0
  311. package/src/funcs/initImagesUploadCanvasInitImage.ts +128 -0
  312. package/src/funcs/initImagesUploadInitImage.ts +127 -0
  313. package/src/funcs/modelsCreateModel.ts +127 -0
  314. package/src/funcs/modelsDeleteModelById.ts +132 -0
  315. package/src/funcs/modelsGetModelById.ts +132 -0
  316. package/src/funcs/modelsListPlatformModels.ts +110 -0
  317. package/src/funcs/motionCreateSVDMotionGeneration.ts +129 -0
  318. package/src/funcs/pricingCalculatorPricingCalculator.ts +128 -0
  319. package/src/funcs/promptPromptImprove.ts +127 -0
  320. package/src/funcs/promptPromptRandom.ts +109 -0
  321. package/src/funcs/realtimeCanvasCreateLCMGeneration.ts +129 -0
  322. package/src/funcs/realtimeCanvasPerformAlchemyUpscaleLCM.ts +129 -0
  323. package/src/funcs/realtimeCanvasPerformInpaintingLCM.ts +129 -0
  324. package/src/funcs/realtimeCanvasPerformInstantRefine.ts +129 -0
  325. package/src/funcs/textureCreateTextureGeneration.ts +129 -0
  326. package/src/funcs/textureDeleteTextureGenerationById.ts +137 -0
  327. package/src/funcs/threeDModelAssetsDelete3DModelById.ts +136 -0
  328. package/src/funcs/threeDModelAssetsUploadModelAsset.ts +128 -0
  329. package/src/funcs/userGetUserSelf.ts +109 -0
  330. package/src/funcs/variationCreateUniversalUpscalerJob.ts +128 -0
  331. package/src/funcs/variationCreateVariationNoBG.ts +128 -0
  332. package/src/funcs/variationCreateVariationUnzoom.ts +129 -0
  333. package/src/funcs/variationCreateVariationUpscale.ts +129 -0
  334. package/src/funcs/variationGetVariationById.ts +133 -0
  335. package/src/index.ts +1 -0
  336. package/src/lib/config.ts +5 -3
  337. package/src/lib/dlv.ts +53 -0
  338. package/src/lib/files.ts +58 -0
  339. package/src/lib/http.ts +255 -438
  340. package/src/lib/logger.ts +9 -0
  341. package/src/lib/matchers.ts +305 -0
  342. package/src/lib/retries.ts +2 -41
  343. package/src/lib/schemas.ts +18 -0
  344. package/src/lib/sdks.ts +194 -35
  345. package/src/lib/security.ts +22 -1
  346. package/src/sdk/dataset.ts +11 -389
  347. package/src/sdk/elements.ts +3 -84
  348. package/src/sdk/image.ts +9 -319
  349. package/src/sdk/initimages.ts +9 -303
  350. package/src/sdk/models/errors/httpclienterrors.ts +62 -0
  351. package/src/sdk/models/errors/index.ts +1 -0
  352. package/src/sdk/models/errors/sdkvalidationerror.ts +8 -6
  353. package/src/sdk/models/operations/pricingcalculator.ts +7 -0
  354. package/src/sdk/models.ts +9 -292
  355. package/src/sdk/motion.ts +3 -103
  356. package/src/sdk/pricingcalculator.ts +3 -99
  357. package/src/sdk/prompt.ts +5 -152
  358. package/src/sdk/realtimecanvas.ts +9 -305
  359. package/src/sdk/sdk.ts +0 -29
  360. package/src/sdk/texture.ts +5 -175
  361. package/src/sdk/threedmodelassets.ts +5 -171
  362. package/src/sdk/types/constdatetime.ts +15 -0
  363. package/src/sdk/types/fp.ts +50 -0
  364. package/src/sdk/types/index.ts +1 -0
  365. package/src/sdk/types/operations.ts +81 -7
  366. package/src/sdk/types/streams.ts +21 -0
  367. package/src/sdk/user.ts +3 -84
  368. package/src/sdk/variation.ts +11 -374
@@ -0,0 +1,139 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { LeonardoCore } from "../core.js";
6
+ import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js";
7
+ import * as m$ from "../lib/matchers.js";
8
+ import * as schemas$ from "../lib/schemas.js";
9
+ import { RequestOptions } from "../lib/sdks.js";
10
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
+ import { pathToFunc } from "../lib/url.js";
12
+ import {
13
+ ConnectionError,
14
+ InvalidRequestError,
15
+ RequestAbortedError,
16
+ RequestTimeoutError,
17
+ UnexpectedClientError,
18
+ } from "../sdk/models/errors/httpclienterrors.js";
19
+ import { SDKError } from "../sdk/models/errors/sdkerror.js";
20
+ import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
21
+ import * as operations from "../sdk/models/operations/index.js";
22
+ import { Result } from "../sdk/types/fp.js";
23
+
24
+ /**
25
+ * Upload a Single Generated Image to a Dataset
26
+ *
27
+ * @remarks
28
+ * This endpoint will upload a previously generated image to the dataset
29
+ */
30
+ export async function datasetUploadDatasetImageFromGen(
31
+ client$: LeonardoCore,
32
+ requestBody: operations.UploadDatasetImageFromGenRequestBody,
33
+ datasetId: string,
34
+ options?: RequestOptions
35
+ ): Promise<
36
+ Result<
37
+ operations.UploadDatasetImageFromGenResponse,
38
+ | SDKError
39
+ | SDKValidationError
40
+ | UnexpectedClientError
41
+ | InvalidRequestError
42
+ | RequestAbortedError
43
+ | RequestTimeoutError
44
+ | ConnectionError
45
+ >
46
+ > {
47
+ const input$: operations.UploadDatasetImageFromGenRequest = {
48
+ requestBody: requestBody,
49
+ datasetId: datasetId,
50
+ };
51
+
52
+ const parsed$ = schemas$.safeParse(
53
+ input$,
54
+ (value$) => operations.UploadDatasetImageFromGenRequest$outboundSchema.parse(value$),
55
+ "Input validation failed"
56
+ );
57
+ if (!parsed$.ok) {
58
+ return parsed$;
59
+ }
60
+ const payload$ = parsed$.value;
61
+ const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true });
62
+
63
+ const pathParams$ = {
64
+ datasetId: encodeSimple$("datasetId", payload$.datasetId, {
65
+ explode: false,
66
+ charEncoding: "percent",
67
+ }),
68
+ };
69
+
70
+ const path$ = pathToFunc("/datasets/{datasetId}/upload/gen")(pathParams$);
71
+
72
+ const headers$ = new Headers({
73
+ "Content-Type": "application/json",
74
+ Accept: "application/json",
75
+ });
76
+
77
+ const bearerAuth$ = await extractSecurity(client$.options$.bearerAuth);
78
+ const security$ = bearerAuth$ == null ? {} : { bearerAuth: bearerAuth$ };
79
+ const context = {
80
+ operationID: "uploadDatasetImageFromGen",
81
+ oAuth2Scopes: [],
82
+ securitySource: client$.options$.bearerAuth,
83
+ };
84
+ const securitySettings$ = resolveGlobalSecurity(security$);
85
+
86
+ const requestRes = client$.createRequest$(
87
+ context,
88
+ {
89
+ security: securitySettings$,
90
+ method: "POST",
91
+ path: path$,
92
+ headers: headers$,
93
+ body: body$,
94
+ timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1,
95
+ },
96
+ options
97
+ );
98
+ if (!requestRes.ok) {
99
+ return requestRes;
100
+ }
101
+ const request$ = requestRes.value;
102
+
103
+ const doResult = await client$.do$(request$, {
104
+ context,
105
+ errorCodes: [],
106
+ retryConfig: options?.retries || client$.options$.retryConfig,
107
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
108
+ });
109
+ if (!doResult.ok) {
110
+ return doResult;
111
+ }
112
+ const response = doResult.value;
113
+
114
+ const responseFields$ = {
115
+ ContentType: response.headers.get("content-type") ?? "application/octet-stream",
116
+ StatusCode: response.status,
117
+ RawResponse: response,
118
+ Headers: {},
119
+ };
120
+
121
+ const [result$] = await m$.match<
122
+ operations.UploadDatasetImageFromGenResponse,
123
+ | SDKError
124
+ | SDKValidationError
125
+ | UnexpectedClientError
126
+ | InvalidRequestError
127
+ | RequestAbortedError
128
+ | RequestTimeoutError
129
+ | ConnectionError
130
+ >(m$.json(200, operations.UploadDatasetImageFromGenResponse$inboundSchema, { key: "object" }))(
131
+ response,
132
+ { extraFields: responseFields$ }
133
+ );
134
+ if (!result$.ok) {
135
+ return result$;
136
+ }
137
+
138
+ return result$;
139
+ }
@@ -0,0 +1,109 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { LeonardoCore } from "../core.js";
6
+ import * as m$ from "../lib/matchers.js";
7
+ import { RequestOptions } from "../lib/sdks.js";
8
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
9
+ import { pathToFunc } from "../lib/url.js";
10
+ import {
11
+ ConnectionError,
12
+ InvalidRequestError,
13
+ RequestAbortedError,
14
+ RequestTimeoutError,
15
+ UnexpectedClientError,
16
+ } from "../sdk/models/errors/httpclienterrors.js";
17
+ import { SDKError } from "../sdk/models/errors/sdkerror.js";
18
+ import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
19
+ import * as operations from "../sdk/models/operations/index.js";
20
+ import { Result } from "../sdk/types/fp.js";
21
+
22
+ /**
23
+ * List Elements
24
+ *
25
+ * @remarks
26
+ * Get a list of public Elements available for use with generations.
27
+ */
28
+ export async function elementsListElements(
29
+ client$: LeonardoCore,
30
+ options?: RequestOptions
31
+ ): Promise<
32
+ Result<
33
+ operations.ListElementsResponse,
34
+ | SDKError
35
+ | SDKValidationError
36
+ | UnexpectedClientError
37
+ | InvalidRequestError
38
+ | RequestAbortedError
39
+ | RequestTimeoutError
40
+ | ConnectionError
41
+ >
42
+ > {
43
+ const path$ = pathToFunc("/elements")();
44
+
45
+ const headers$ = new Headers({
46
+ Accept: "application/json",
47
+ });
48
+
49
+ const bearerAuth$ = await extractSecurity(client$.options$.bearerAuth);
50
+ const security$ = bearerAuth$ == null ? {} : { bearerAuth: bearerAuth$ };
51
+ const context = {
52
+ operationID: "listElements",
53
+ oAuth2Scopes: [],
54
+ securitySource: client$.options$.bearerAuth,
55
+ };
56
+ const securitySettings$ = resolveGlobalSecurity(security$);
57
+
58
+ const requestRes = client$.createRequest$(
59
+ context,
60
+ {
61
+ security: securitySettings$,
62
+ method: "GET",
63
+ path: path$,
64
+ headers: headers$,
65
+ timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1,
66
+ },
67
+ options
68
+ );
69
+ if (!requestRes.ok) {
70
+ return requestRes;
71
+ }
72
+ const request$ = requestRes.value;
73
+
74
+ const doResult = await client$.do$(request$, {
75
+ context,
76
+ errorCodes: [],
77
+ retryConfig: options?.retries || client$.options$.retryConfig,
78
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
79
+ });
80
+ if (!doResult.ok) {
81
+ return doResult;
82
+ }
83
+ const response = doResult.value;
84
+
85
+ const responseFields$ = {
86
+ ContentType: response.headers.get("content-type") ?? "application/octet-stream",
87
+ StatusCode: response.status,
88
+ RawResponse: response,
89
+ Headers: {},
90
+ };
91
+
92
+ const [result$] = await m$.match<
93
+ operations.ListElementsResponse,
94
+ | SDKError
95
+ | SDKValidationError
96
+ | UnexpectedClientError
97
+ | InvalidRequestError
98
+ | RequestAbortedError
99
+ | RequestTimeoutError
100
+ | ConnectionError
101
+ >(m$.json(200, operations.ListElementsResponse$inboundSchema, { key: "object" }))(response, {
102
+ extraFields: responseFields$,
103
+ });
104
+ if (!result$.ok) {
105
+ return result$;
106
+ }
107
+
108
+ return result$;
109
+ }
@@ -0,0 +1,128 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { LeonardoCore } from "../core.js";
6
+ import { encodeJSON as encodeJSON$ } from "../lib/encodings.js";
7
+ import * as m$ from "../lib/matchers.js";
8
+ import * as schemas$ from "../lib/schemas.js";
9
+ import { RequestOptions } from "../lib/sdks.js";
10
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
+ import { pathToFunc } from "../lib/url.js";
12
+ import {
13
+ ConnectionError,
14
+ InvalidRequestError,
15
+ RequestAbortedError,
16
+ RequestTimeoutError,
17
+ UnexpectedClientError,
18
+ } from "../sdk/models/errors/httpclienterrors.js";
19
+ import { SDKError } from "../sdk/models/errors/sdkerror.js";
20
+ import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
21
+ import * as operations from "../sdk/models/operations/index.js";
22
+ import { Result } from "../sdk/types/fp.js";
23
+
24
+ /**
25
+ * Create a Generation of Images
26
+ *
27
+ * @remarks
28
+ * This endpoint will generate images
29
+ */
30
+ export async function imageCreateGeneration(
31
+ client$: LeonardoCore,
32
+ request: operations.CreateGenerationRequestBody,
33
+ options?: RequestOptions
34
+ ): Promise<
35
+ Result<
36
+ operations.CreateGenerationResponse,
37
+ | SDKError
38
+ | SDKValidationError
39
+ | UnexpectedClientError
40
+ | InvalidRequestError
41
+ | RequestAbortedError
42
+ | RequestTimeoutError
43
+ | ConnectionError
44
+ >
45
+ > {
46
+ const input$ = request;
47
+
48
+ const parsed$ = schemas$.safeParse(
49
+ input$,
50
+ (value$) => operations.CreateGenerationRequestBody$outboundSchema.parse(value$),
51
+ "Input validation failed"
52
+ );
53
+ if (!parsed$.ok) {
54
+ return parsed$;
55
+ }
56
+ const payload$ = parsed$.value;
57
+ const body$ = encodeJSON$("body", payload$, { explode: true });
58
+
59
+ const path$ = pathToFunc("/generations")();
60
+
61
+ const headers$ = new Headers({
62
+ "Content-Type": "application/json",
63
+ Accept: "application/json",
64
+ });
65
+
66
+ const bearerAuth$ = await extractSecurity(client$.options$.bearerAuth);
67
+ const security$ = bearerAuth$ == null ? {} : { bearerAuth: bearerAuth$ };
68
+ const context = {
69
+ operationID: "createGeneration",
70
+ oAuth2Scopes: [],
71
+ securitySource: client$.options$.bearerAuth,
72
+ };
73
+ const securitySettings$ = resolveGlobalSecurity(security$);
74
+
75
+ const requestRes = client$.createRequest$(
76
+ context,
77
+ {
78
+ security: securitySettings$,
79
+ method: "POST",
80
+ path: path$,
81
+ headers: headers$,
82
+ body: body$,
83
+ timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1,
84
+ },
85
+ options
86
+ );
87
+ if (!requestRes.ok) {
88
+ return requestRes;
89
+ }
90
+ const request$ = requestRes.value;
91
+
92
+ const doResult = await client$.do$(request$, {
93
+ context,
94
+ errorCodes: [],
95
+ retryConfig: options?.retries || client$.options$.retryConfig,
96
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
97
+ });
98
+ if (!doResult.ok) {
99
+ return doResult;
100
+ }
101
+ const response = doResult.value;
102
+
103
+ const responseFields$ = {
104
+ ContentType: response.headers.get("content-type") ?? "application/octet-stream",
105
+ StatusCode: response.status,
106
+ RawResponse: response,
107
+ Headers: {},
108
+ };
109
+
110
+ const [result$] = await m$.match<
111
+ operations.CreateGenerationResponse,
112
+ | SDKError
113
+ | SDKValidationError
114
+ | UnexpectedClientError
115
+ | InvalidRequestError
116
+ | RequestAbortedError
117
+ | RequestTimeoutError
118
+ | ConnectionError
119
+ >(m$.json(200, operations.CreateGenerationResponse$inboundSchema, { key: "object" }))(
120
+ response,
121
+ { extraFields: responseFields$ }
122
+ );
123
+ if (!result$.ok) {
124
+ return result$;
125
+ }
126
+
127
+ return result$;
128
+ }
@@ -0,0 +1,133 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { LeonardoCore } from "../core.js";
6
+ import { encodeSimple as encodeSimple$ } from "../lib/encodings.js";
7
+ import * as m$ from "../lib/matchers.js";
8
+ import * as schemas$ from "../lib/schemas.js";
9
+ import { RequestOptions } from "../lib/sdks.js";
10
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
+ import { pathToFunc } from "../lib/url.js";
12
+ import {
13
+ ConnectionError,
14
+ InvalidRequestError,
15
+ RequestAbortedError,
16
+ RequestTimeoutError,
17
+ UnexpectedClientError,
18
+ } from "../sdk/models/errors/httpclienterrors.js";
19
+ import { SDKError } from "../sdk/models/errors/sdkerror.js";
20
+ import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
21
+ import * as operations from "../sdk/models/operations/index.js";
22
+ import { Result } from "../sdk/types/fp.js";
23
+
24
+ /**
25
+ * Delete a Single Generation
26
+ *
27
+ * @remarks
28
+ * This endpoint deletes a specific generation
29
+ */
30
+ export async function imageDeleteGenerationById(
31
+ client$: LeonardoCore,
32
+ id: string,
33
+ options?: RequestOptions
34
+ ): Promise<
35
+ Result<
36
+ operations.DeleteGenerationByIdResponse,
37
+ | SDKError
38
+ | SDKValidationError
39
+ | UnexpectedClientError
40
+ | InvalidRequestError
41
+ | RequestAbortedError
42
+ | RequestTimeoutError
43
+ | ConnectionError
44
+ >
45
+ > {
46
+ const input$: operations.DeleteGenerationByIdRequest = {
47
+ id: id,
48
+ };
49
+
50
+ const parsed$ = schemas$.safeParse(
51
+ input$,
52
+ (value$) => operations.DeleteGenerationByIdRequest$outboundSchema.parse(value$),
53
+ "Input validation failed"
54
+ );
55
+ if (!parsed$.ok) {
56
+ return parsed$;
57
+ }
58
+ const payload$ = parsed$.value;
59
+ const body$ = null;
60
+
61
+ const pathParams$ = {
62
+ id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }),
63
+ };
64
+
65
+ const path$ = pathToFunc("/generations/{id}")(pathParams$);
66
+
67
+ const headers$ = new Headers({
68
+ Accept: "application/json",
69
+ });
70
+
71
+ const bearerAuth$ = await extractSecurity(client$.options$.bearerAuth);
72
+ const security$ = bearerAuth$ == null ? {} : { bearerAuth: bearerAuth$ };
73
+ const context = {
74
+ operationID: "deleteGenerationById",
75
+ oAuth2Scopes: [],
76
+ securitySource: client$.options$.bearerAuth,
77
+ };
78
+ const securitySettings$ = resolveGlobalSecurity(security$);
79
+
80
+ const requestRes = client$.createRequest$(
81
+ context,
82
+ {
83
+ security: securitySettings$,
84
+ method: "DELETE",
85
+ path: path$,
86
+ headers: headers$,
87
+ body: body$,
88
+ timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1,
89
+ },
90
+ options
91
+ );
92
+ if (!requestRes.ok) {
93
+ return requestRes;
94
+ }
95
+ const request$ = requestRes.value;
96
+
97
+ const doResult = await client$.do$(request$, {
98
+ context,
99
+ errorCodes: [],
100
+ retryConfig: options?.retries || client$.options$.retryConfig,
101
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
102
+ });
103
+ if (!doResult.ok) {
104
+ return doResult;
105
+ }
106
+ const response = doResult.value;
107
+
108
+ const responseFields$ = {
109
+ ContentType: response.headers.get("content-type") ?? "application/octet-stream",
110
+ StatusCode: response.status,
111
+ RawResponse: response,
112
+ Headers: {},
113
+ };
114
+
115
+ const [result$] = await m$.match<
116
+ operations.DeleteGenerationByIdResponse,
117
+ | SDKError
118
+ | SDKValidationError
119
+ | UnexpectedClientError
120
+ | InvalidRequestError
121
+ | RequestAbortedError
122
+ | RequestTimeoutError
123
+ | ConnectionError
124
+ >(m$.json(200, operations.DeleteGenerationByIdResponse$inboundSchema, { key: "object" }))(
125
+ response,
126
+ { extraFields: responseFields$ }
127
+ );
128
+ if (!result$.ok) {
129
+ return result$;
130
+ }
131
+
132
+ return result$;
133
+ }
@@ -0,0 +1,133 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { LeonardoCore } from "../core.js";
6
+ import { encodeSimple as encodeSimple$ } from "../lib/encodings.js";
7
+ import * as m$ from "../lib/matchers.js";
8
+ import * as schemas$ from "../lib/schemas.js";
9
+ import { RequestOptions } from "../lib/sdks.js";
10
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
+ import { pathToFunc } from "../lib/url.js";
12
+ import {
13
+ ConnectionError,
14
+ InvalidRequestError,
15
+ RequestAbortedError,
16
+ RequestTimeoutError,
17
+ UnexpectedClientError,
18
+ } from "../sdk/models/errors/httpclienterrors.js";
19
+ import { SDKError } from "../sdk/models/errors/sdkerror.js";
20
+ import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
21
+ import * as operations from "../sdk/models/operations/index.js";
22
+ import { Result } from "../sdk/types/fp.js";
23
+
24
+ /**
25
+ * Get a Single Generation
26
+ *
27
+ * @remarks
28
+ * This endpoint will provide information about a specific generation
29
+ */
30
+ export async function imageGetGenerationById(
31
+ client$: LeonardoCore,
32
+ id: string,
33
+ options?: RequestOptions
34
+ ): Promise<
35
+ Result<
36
+ operations.GetGenerationByIdResponse,
37
+ | SDKError
38
+ | SDKValidationError
39
+ | UnexpectedClientError
40
+ | InvalidRequestError
41
+ | RequestAbortedError
42
+ | RequestTimeoutError
43
+ | ConnectionError
44
+ >
45
+ > {
46
+ const input$: operations.GetGenerationByIdRequest = {
47
+ id: id,
48
+ };
49
+
50
+ const parsed$ = schemas$.safeParse(
51
+ input$,
52
+ (value$) => operations.GetGenerationByIdRequest$outboundSchema.parse(value$),
53
+ "Input validation failed"
54
+ );
55
+ if (!parsed$.ok) {
56
+ return parsed$;
57
+ }
58
+ const payload$ = parsed$.value;
59
+ const body$ = null;
60
+
61
+ const pathParams$ = {
62
+ id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }),
63
+ };
64
+
65
+ const path$ = pathToFunc("/generations/{id}")(pathParams$);
66
+
67
+ const headers$ = new Headers({
68
+ Accept: "application/json",
69
+ });
70
+
71
+ const bearerAuth$ = await extractSecurity(client$.options$.bearerAuth);
72
+ const security$ = bearerAuth$ == null ? {} : { bearerAuth: bearerAuth$ };
73
+ const context = {
74
+ operationID: "getGenerationById",
75
+ oAuth2Scopes: [],
76
+ securitySource: client$.options$.bearerAuth,
77
+ };
78
+ const securitySettings$ = resolveGlobalSecurity(security$);
79
+
80
+ const requestRes = client$.createRequest$(
81
+ context,
82
+ {
83
+ security: securitySettings$,
84
+ method: "GET",
85
+ path: path$,
86
+ headers: headers$,
87
+ body: body$,
88
+ timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1,
89
+ },
90
+ options
91
+ );
92
+ if (!requestRes.ok) {
93
+ return requestRes;
94
+ }
95
+ const request$ = requestRes.value;
96
+
97
+ const doResult = await client$.do$(request$, {
98
+ context,
99
+ errorCodes: [],
100
+ retryConfig: options?.retries || client$.options$.retryConfig,
101
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
102
+ });
103
+ if (!doResult.ok) {
104
+ return doResult;
105
+ }
106
+ const response = doResult.value;
107
+
108
+ const responseFields$ = {
109
+ ContentType: response.headers.get("content-type") ?? "application/octet-stream",
110
+ StatusCode: response.status,
111
+ RawResponse: response,
112
+ Headers: {},
113
+ };
114
+
115
+ const [result$] = await m$.match<
116
+ operations.GetGenerationByIdResponse,
117
+ | SDKError
118
+ | SDKValidationError
119
+ | UnexpectedClientError
120
+ | InvalidRequestError
121
+ | RequestAbortedError
122
+ | RequestTimeoutError
123
+ | ConnectionError
124
+ >(m$.json(200, operations.GetGenerationByIdResponse$inboundSchema, { key: "object" }))(
125
+ response,
126
+ { extraFields: responseFields$ }
127
+ );
128
+ if (!result$.ok) {
129
+ return result$;
130
+ }
131
+
132
+ return result$;
133
+ }