@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.
- package/README.md +104 -7
- package/core.d.ts +10 -0
- package/core.d.ts.map +1 -0
- package/core.js +17 -0
- package/core.js.map +1 -0
- package/docs/sdks/dataset/README.md +169 -7
- package/docs/sdks/elements/README.md +33 -1
- package/docs/sdks/image/README.md +132 -7
- package/docs/sdks/initimages/README.md +136 -6
- package/docs/sdks/leonardo/README.md +1 -5
- package/docs/sdks/models/README.md +135 -6
- package/docs/sdks/motion/README.md +34 -4
- package/docs/sdks/pricingcalculator/README.md +34 -2
- package/docs/sdks/prompt/README.md +67 -2
- package/docs/sdks/realtimecanvas/README.md +133 -21
- package/docs/sdks/texture/README.md +67 -4
- package/docs/sdks/threedmodelassets/README.md +67 -4
- package/docs/sdks/user/README.md +33 -1
- package/docs/sdks/variation/README.md +166 -10
- package/funcs/datasetCreateDataset.d.ts +15 -0
- package/funcs/datasetCreateDataset.d.ts.map +1 -0
- package/funcs/datasetCreateDataset.js +101 -0
- package/funcs/datasetCreateDataset.js.map +1 -0
- package/funcs/datasetDeleteDatasetById.d.ts +15 -0
- package/funcs/datasetDeleteDatasetById.d.ts.map +1 -0
- package/funcs/datasetDeleteDatasetById.js +103 -0
- package/funcs/datasetDeleteDatasetById.js.map +1 -0
- package/funcs/datasetGetDatasetById.d.ts +15 -0
- package/funcs/datasetGetDatasetById.d.ts.map +1 -0
- package/funcs/datasetGetDatasetById.js +105 -0
- package/funcs/datasetGetDatasetById.js.map +1 -0
- package/funcs/datasetUploadDatasetImage.d.ts +15 -0
- package/funcs/datasetUploadDatasetImage.d.ts.map +1 -0
- package/funcs/datasetUploadDatasetImage.js +108 -0
- package/funcs/datasetUploadDatasetImage.js.map +1 -0
- package/funcs/datasetUploadDatasetImageFromGen.d.ts +15 -0
- package/funcs/datasetUploadDatasetImageFromGen.d.ts.map +1 -0
- package/funcs/datasetUploadDatasetImageFromGen.js +108 -0
- package/funcs/datasetUploadDatasetImageFromGen.js.map +1 -0
- package/funcs/elementsListElements.d.ts +15 -0
- package/funcs/elementsListElements.d.ts.map +1 -0
- package/funcs/elementsListElements.js +90 -0
- package/funcs/elementsListElements.js.map +1 -0
- package/funcs/imageCreateGeneration.d.ts +15 -0
- package/funcs/imageCreateGeneration.d.ts.map +1 -0
- package/funcs/imageCreateGeneration.js +99 -0
- package/funcs/imageCreateGeneration.js.map +1 -0
- package/funcs/imageDeleteGenerationById.d.ts +15 -0
- package/funcs/imageDeleteGenerationById.d.ts.map +1 -0
- package/funcs/imageDeleteGenerationById.js +103 -0
- package/funcs/imageDeleteGenerationById.js.map +1 -0
- package/funcs/imageGetGenerationById.d.ts +15 -0
- package/funcs/imageGetGenerationById.d.ts.map +1 -0
- package/funcs/imageGetGenerationById.js +103 -0
- package/funcs/imageGetGenerationById.js.map +1 -0
- package/funcs/imageGetGenerationsByUserId.d.ts +15 -0
- package/funcs/imageGetGenerationsByUserId.d.ts.map +1 -0
- package/funcs/imageGetGenerationsByUserId.js +113 -0
- package/funcs/imageGetGenerationsByUserId.js.map +1 -0
- package/funcs/initImagesDeleteInitImageById.d.ts +15 -0
- package/funcs/initImagesDeleteInitImageById.d.ts.map +1 -0
- package/funcs/initImagesDeleteInitImageById.js +103 -0
- package/funcs/initImagesDeleteInitImageById.js.map +1 -0
- package/funcs/initImagesGetInitImageById.d.ts +15 -0
- package/funcs/initImagesGetInitImageById.d.ts.map +1 -0
- package/funcs/initImagesGetInitImageById.js +103 -0
- package/funcs/initImagesGetInitImageById.js.map +1 -0
- package/funcs/initImagesUploadCanvasInitImage.d.ts +15 -0
- package/funcs/initImagesUploadCanvasInitImage.d.ts.map +1 -0
- package/funcs/initImagesUploadCanvasInitImage.js +99 -0
- package/funcs/initImagesUploadCanvasInitImage.js.map +1 -0
- package/funcs/initImagesUploadInitImage.d.ts +15 -0
- package/funcs/initImagesUploadInitImage.d.ts.map +1 -0
- package/funcs/initImagesUploadInitImage.js +101 -0
- package/funcs/initImagesUploadInitImage.js.map +1 -0
- package/funcs/modelsCreateModel.d.ts +15 -0
- package/funcs/modelsCreateModel.d.ts.map +1 -0
- package/funcs/modelsCreateModel.js +101 -0
- package/funcs/modelsCreateModel.js.map +1 -0
- package/funcs/modelsDeleteModelById.d.ts +15 -0
- package/funcs/modelsDeleteModelById.d.ts.map +1 -0
- package/funcs/modelsDeleteModelById.js +105 -0
- package/funcs/modelsDeleteModelById.js.map +1 -0
- package/funcs/modelsGetModelById.d.ts +15 -0
- package/funcs/modelsGetModelById.d.ts.map +1 -0
- package/funcs/modelsGetModelById.js +105 -0
- package/funcs/modelsGetModelById.js.map +1 -0
- package/funcs/modelsListPlatformModels.d.ts +15 -0
- package/funcs/modelsListPlatformModels.d.ts.map +1 -0
- package/funcs/modelsListPlatformModels.js +88 -0
- package/funcs/modelsListPlatformModels.js.map +1 -0
- package/funcs/motionCreateSVDMotionGeneration.d.ts +15 -0
- package/funcs/motionCreateSVDMotionGeneration.d.ts.map +1 -0
- package/funcs/motionCreateSVDMotionGeneration.js +99 -0
- package/funcs/motionCreateSVDMotionGeneration.js.map +1 -0
- package/funcs/pricingCalculatorPricingCalculator.d.ts +15 -0
- package/funcs/pricingCalculatorPricingCalculator.d.ts.map +1 -0
- package/funcs/pricingCalculatorPricingCalculator.js +99 -0
- package/funcs/pricingCalculatorPricingCalculator.js.map +1 -0
- package/funcs/promptPromptImprove.d.ts +15 -0
- package/funcs/promptPromptImprove.d.ts.map +1 -0
- package/funcs/promptPromptImprove.js +101 -0
- package/funcs/promptPromptImprove.js.map +1 -0
- package/funcs/promptPromptRandom.d.ts +15 -0
- package/funcs/promptPromptRandom.d.ts.map +1 -0
- package/funcs/promptPromptRandom.js +90 -0
- package/funcs/promptPromptRandom.js.map +1 -0
- package/funcs/realtimeCanvasCreateLCMGeneration.d.ts +15 -0
- package/funcs/realtimeCanvasCreateLCMGeneration.d.ts.map +1 -0
- package/funcs/realtimeCanvasCreateLCMGeneration.js +99 -0
- package/funcs/realtimeCanvasCreateLCMGeneration.js.map +1 -0
- package/funcs/realtimeCanvasPerformAlchemyUpscaleLCM.d.ts +15 -0
- package/funcs/realtimeCanvasPerformAlchemyUpscaleLCM.d.ts.map +1 -0
- package/funcs/realtimeCanvasPerformAlchemyUpscaleLCM.js +99 -0
- package/funcs/realtimeCanvasPerformAlchemyUpscaleLCM.js.map +1 -0
- package/funcs/realtimeCanvasPerformInpaintingLCM.d.ts +15 -0
- package/funcs/realtimeCanvasPerformInpaintingLCM.d.ts.map +1 -0
- package/funcs/realtimeCanvasPerformInpaintingLCM.js +99 -0
- package/funcs/realtimeCanvasPerformInpaintingLCM.js.map +1 -0
- package/funcs/realtimeCanvasPerformInstantRefine.d.ts +15 -0
- package/funcs/realtimeCanvasPerformInstantRefine.d.ts.map +1 -0
- package/funcs/realtimeCanvasPerformInstantRefine.js +99 -0
- package/funcs/realtimeCanvasPerformInstantRefine.js.map +1 -0
- package/funcs/textureCreateTextureGeneration.d.ts +15 -0
- package/funcs/textureCreateTextureGeneration.d.ts.map +1 -0
- package/funcs/textureCreateTextureGeneration.js +99 -0
- package/funcs/textureCreateTextureGeneration.js.map +1 -0
- package/funcs/textureDeleteTextureGenerationById.d.ts +15 -0
- package/funcs/textureDeleteTextureGenerationById.d.ts.map +1 -0
- package/funcs/textureDeleteTextureGenerationById.js +107 -0
- package/funcs/textureDeleteTextureGenerationById.js.map +1 -0
- package/funcs/threeDModelAssetsDelete3DModelById.d.ts +15 -0
- package/funcs/threeDModelAssetsDelete3DModelById.d.ts.map +1 -0
- package/funcs/threeDModelAssetsDelete3DModelById.js +105 -0
- package/funcs/threeDModelAssetsDelete3DModelById.js.map +1 -0
- package/funcs/threeDModelAssetsUploadModelAsset.d.ts +15 -0
- package/funcs/threeDModelAssetsUploadModelAsset.d.ts.map +1 -0
- package/funcs/threeDModelAssetsUploadModelAsset.js +99 -0
- package/funcs/threeDModelAssetsUploadModelAsset.js.map +1 -0
- package/funcs/userGetUserSelf.d.ts +15 -0
- package/funcs/userGetUserSelf.d.ts.map +1 -0
- package/funcs/userGetUserSelf.js +90 -0
- package/funcs/userGetUserSelf.js.map +1 -0
- package/funcs/variationCreateUniversalUpscalerJob.d.ts +15 -0
- package/funcs/variationCreateUniversalUpscalerJob.d.ts.map +1 -0
- package/funcs/variationCreateUniversalUpscalerJob.js +99 -0
- package/funcs/variationCreateUniversalUpscalerJob.js.map +1 -0
- package/funcs/variationCreateVariationNoBG.d.ts +15 -0
- package/funcs/variationCreateVariationNoBG.d.ts.map +1 -0
- package/funcs/variationCreateVariationNoBG.js +99 -0
- package/funcs/variationCreateVariationNoBG.js.map +1 -0
- package/funcs/variationCreateVariationUnzoom.d.ts +15 -0
- package/funcs/variationCreateVariationUnzoom.d.ts.map +1 -0
- package/funcs/variationCreateVariationUnzoom.js +99 -0
- package/funcs/variationCreateVariationUnzoom.js.map +1 -0
- package/funcs/variationCreateVariationUpscale.d.ts +15 -0
- package/funcs/variationCreateVariationUpscale.d.ts.map +1 -0
- package/funcs/variationCreateVariationUpscale.js +99 -0
- package/funcs/variationCreateVariationUpscale.js.map +1 -0
- package/funcs/variationGetVariationById.d.ts +15 -0
- package/funcs/variationGetVariationById.d.ts.map +1 -0
- package/funcs/variationGetVariationById.js +103 -0
- package/funcs/variationGetVariationById.js.map +1 -0
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +14 -0
- package/index.js.map +1 -1
- package/lib/config.d.ts +5 -3
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +3 -3
- package/lib/config.js.map +1 -1
- package/lib/dlv.d.ts +14 -0
- package/lib/dlv.d.ts.map +1 -0
- package/lib/dlv.js +50 -0
- package/lib/dlv.js.map +1 -0
- package/lib/files.d.ts +12 -0
- package/lib/files.d.ts.map +1 -0
- package/lib/files.js +52 -0
- package/lib/files.js.map +1 -0
- package/lib/http.d.ts +11 -52
- package/lib/http.d.ts.map +1 -1
- package/lib/http.js +49 -173
- package/lib/http.js.map +1 -1
- package/lib/logger.d.ts +6 -0
- package/lib/logger.d.ts.map +1 -0
- package/lib/logger.js +6 -0
- package/lib/logger.js.map +1 -0
- package/lib/matchers.d.ts +64 -0
- package/lib/matchers.d.ts.map +1 -0
- package/lib/matchers.js +206 -0
- package/lib/matchers.js.map +1 -0
- package/lib/retries.d.ts.map +1 -1
- package/lib/retries.js +2 -28
- package/lib/retries.js.map +1 -1
- package/lib/schemas.d.ts +8 -0
- package/lib/schemas.d.ts.map +1 -1
- package/lib/schemas.js +16 -1
- package/lib/schemas.js.map +1 -1
- package/lib/sdks.d.ts +14 -16
- package/lib/sdks.d.ts.map +1 -1
- package/lib/sdks.js +144 -27
- package/lib/sdks.js.map +1 -1
- package/lib/security.d.ts +7 -1
- package/lib/security.d.ts.map +1 -1
- package/lib/security.js +13 -1
- package/lib/security.js.map +1 -1
- package/package.json +2 -1
- package/sdk/dataset.d.ts +0 -3
- package/sdk/dataset.d.ts.map +1 -1
- package/sdk/dataset.js +11 -332
- package/sdk/dataset.js.map +1 -1
- package/sdk/elements.d.ts +0 -3
- package/sdk/elements.d.ts.map +1 -1
- package/sdk/elements.js +3 -93
- package/sdk/elements.js.map +1 -1
- package/sdk/image.d.ts +0 -3
- package/sdk/image.d.ts.map +1 -1
- package/sdk/image.js +9 -273
- package/sdk/image.js.map +1 -1
- package/sdk/initimages.d.ts +0 -3
- package/sdk/initimages.d.ts.map +1 -1
- package/sdk/initimages.js +9 -261
- package/sdk/initimages.js.map +1 -1
- package/sdk/models/errors/httpclienterrors.d.ts +44 -0
- package/sdk/models/errors/httpclienterrors.d.ts.map +1 -0
- package/sdk/models/errors/httpclienterrors.js +78 -0
- package/sdk/models/errors/httpclienterrors.js.map +1 -0
- package/sdk/models/errors/index.d.ts +1 -0
- package/sdk/models/errors/index.d.ts.map +1 -1
- package/sdk/models/errors/index.js +1 -0
- package/sdk/models/errors/index.js.map +1 -1
- package/sdk/models/errors/sdkvalidationerror.d.ts +4 -1
- package/sdk/models/errors/sdkvalidationerror.d.ts.map +1 -1
- package/sdk/models/errors/sdkvalidationerror.js +3 -5
- package/sdk/models/errors/sdkvalidationerror.js.map +1 -1
- package/sdk/models/operations/pricingcalculator.d.ts +5 -0
- package/sdk/models/operations/pricingcalculator.d.ts.map +1 -1
- package/sdk/models/operations/pricingcalculator.js +2 -0
- package/sdk/models/operations/pricingcalculator.js.map +1 -1
- package/sdk/models.d.ts +0 -3
- package/sdk/models.d.ts.map +1 -1
- package/sdk/models.js +9 -256
- package/sdk/models.js.map +1 -1
- package/sdk/motion.d.ts +0 -3
- package/sdk/motion.d.ts.map +1 -1
- package/sdk/motion.js +3 -102
- package/sdk/motion.js.map +1 -1
- package/sdk/pricingcalculator.d.ts +0 -3
- package/sdk/pricingcalculator.d.ts.map +1 -1
- package/sdk/pricingcalculator.js +3 -100
- package/sdk/pricingcalculator.js.map +1 -1
- package/sdk/prompt.d.ts +0 -3
- package/sdk/prompt.d.ts.map +1 -1
- package/sdk/prompt.js +5 -146
- package/sdk/prompt.js.map +1 -1
- package/sdk/realtimecanvas.d.ts +0 -3
- package/sdk/realtimecanvas.d.ts.map +1 -1
- package/sdk/realtimecanvas.js +9 -253
- package/sdk/realtimecanvas.js.map +1 -1
- package/sdk/sdk.d.ts +0 -3
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +0 -23
- package/sdk/sdk.js.map +1 -1
- package/sdk/texture.d.ts +0 -3
- package/sdk/texture.d.ts.map +1 -1
- package/sdk/texture.js +5 -159
- package/sdk/texture.js.map +1 -1
- package/sdk/threedmodelassets.d.ts +0 -3
- package/sdk/threedmodelassets.d.ts.map +1 -1
- package/sdk/threedmodelassets.js +5 -157
- package/sdk/threedmodelassets.js.map +1 -1
- package/sdk/types/constdatetime.d.ts +3 -0
- package/sdk/types/constdatetime.d.ts.map +1 -0
- package/sdk/types/constdatetime.js +37 -0
- package/sdk/types/constdatetime.js.map +1 -0
- package/sdk/types/fp.d.ts +31 -0
- package/sdk/types/fp.d.ts.map +1 -0
- package/sdk/types/fp.js +38 -0
- package/sdk/types/fp.js.map +1 -0
- package/sdk/types/index.d.ts +1 -0
- package/sdk/types/index.d.ts.map +1 -1
- package/sdk/types/operations.d.ts +22 -8
- package/sdk/types/operations.d.ts.map +1 -1
- package/sdk/types/operations.js +64 -2
- package/sdk/types/operations.js.map +1 -1
- package/sdk/types/streams.d.ts +2 -0
- package/sdk/types/streams.d.ts.map +1 -0
- package/sdk/types/streams.js +19 -0
- package/sdk/types/streams.js.map +1 -0
- package/sdk/user.d.ts +0 -3
- package/sdk/user.d.ts.map +1 -1
- package/sdk/user.js +3 -93
- package/sdk/user.js.map +1 -1
- package/sdk/variation.d.ts +0 -3
- package/sdk/variation.d.ts.map +1 -1
- package/sdk/variation.js +11 -310
- package/sdk/variation.js.map +1 -1
- package/src/core.ts +13 -0
- package/src/funcs/datasetCreateDataset.ts +127 -0
- package/src/funcs/datasetDeleteDatasetById.ts +133 -0
- package/src/funcs/datasetGetDatasetById.ts +132 -0
- package/src/funcs/datasetUploadDatasetImage.ts +139 -0
- package/src/funcs/datasetUploadDatasetImageFromGen.ts +139 -0
- package/src/funcs/elementsListElements.ts +109 -0
- package/src/funcs/imageCreateGeneration.ts +128 -0
- package/src/funcs/imageDeleteGenerationById.ts +133 -0
- package/src/funcs/imageGetGenerationById.ts +133 -0
- package/src/funcs/imageGetGenerationsByUserId.ts +149 -0
- package/src/funcs/initImagesDeleteInitImageById.ts +133 -0
- package/src/funcs/initImagesGetInitImageById.ts +133 -0
- package/src/funcs/initImagesUploadCanvasInitImage.ts +128 -0
- package/src/funcs/initImagesUploadInitImage.ts +127 -0
- package/src/funcs/modelsCreateModel.ts +127 -0
- package/src/funcs/modelsDeleteModelById.ts +132 -0
- package/src/funcs/modelsGetModelById.ts +132 -0
- package/src/funcs/modelsListPlatformModels.ts +110 -0
- package/src/funcs/motionCreateSVDMotionGeneration.ts +129 -0
- package/src/funcs/pricingCalculatorPricingCalculator.ts +128 -0
- package/src/funcs/promptPromptImprove.ts +127 -0
- package/src/funcs/promptPromptRandom.ts +109 -0
- package/src/funcs/realtimeCanvasCreateLCMGeneration.ts +129 -0
- package/src/funcs/realtimeCanvasPerformAlchemyUpscaleLCM.ts +129 -0
- package/src/funcs/realtimeCanvasPerformInpaintingLCM.ts +129 -0
- package/src/funcs/realtimeCanvasPerformInstantRefine.ts +129 -0
- package/src/funcs/textureCreateTextureGeneration.ts +129 -0
- package/src/funcs/textureDeleteTextureGenerationById.ts +137 -0
- package/src/funcs/threeDModelAssetsDelete3DModelById.ts +136 -0
- package/src/funcs/threeDModelAssetsUploadModelAsset.ts +128 -0
- package/src/funcs/userGetUserSelf.ts +109 -0
- package/src/funcs/variationCreateUniversalUpscalerJob.ts +128 -0
- package/src/funcs/variationCreateVariationNoBG.ts +128 -0
- package/src/funcs/variationCreateVariationUnzoom.ts +129 -0
- package/src/funcs/variationCreateVariationUpscale.ts +129 -0
- package/src/funcs/variationGetVariationById.ts +133 -0
- package/src/index.ts +1 -0
- package/src/lib/config.ts +5 -3
- package/src/lib/dlv.ts +53 -0
- package/src/lib/files.ts +58 -0
- package/src/lib/http.ts +255 -438
- package/src/lib/logger.ts +9 -0
- package/src/lib/matchers.ts +305 -0
- package/src/lib/retries.ts +2 -41
- package/src/lib/schemas.ts +18 -0
- package/src/lib/sdks.ts +194 -35
- package/src/lib/security.ts +22 -1
- package/src/sdk/dataset.ts +11 -389
- package/src/sdk/elements.ts +3 -84
- package/src/sdk/image.ts +9 -319
- package/src/sdk/initimages.ts +9 -303
- package/src/sdk/models/errors/httpclienterrors.ts +62 -0
- package/src/sdk/models/errors/index.ts +1 -0
- package/src/sdk/models/errors/sdkvalidationerror.ts +8 -6
- package/src/sdk/models/operations/pricingcalculator.ts +7 -0
- package/src/sdk/models.ts +9 -292
- package/src/sdk/motion.ts +3 -103
- package/src/sdk/pricingcalculator.ts +3 -99
- package/src/sdk/prompt.ts +5 -152
- package/src/sdk/realtimecanvas.ts +9 -305
- package/src/sdk/sdk.ts +0 -29
- package/src/sdk/texture.ts +5 -175
- package/src/sdk/threedmodelassets.ts +5 -171
- package/src/sdk/types/constdatetime.ts +15 -0
- package/src/sdk/types/fp.ts +50 -0
- package/src/sdk/types/index.ts +1 -0
- package/src/sdk/types/operations.ts +81 -7
- package/src/sdk/types/streams.ts +21 -0
- package/src/sdk/user.ts +3 -84
- package/src/sdk/variation.ts +11 -374
|
@@ -0,0 +1,129 @@
|
|
|
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 upscale
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* This endpoint will create an upscale for the provided image ID
|
|
29
|
+
*/
|
|
30
|
+
export async function variationCreateVariationUpscale(
|
|
31
|
+
client$: LeonardoCore,
|
|
32
|
+
request?: operations.CreateVariationUpscaleRequestBody | undefined,
|
|
33
|
+
options?: RequestOptions
|
|
34
|
+
): Promise<
|
|
35
|
+
Result<
|
|
36
|
+
operations.CreateVariationUpscaleResponse,
|
|
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$) =>
|
|
51
|
+
operations.CreateVariationUpscaleRequestBody$outboundSchema.optional().parse(value$),
|
|
52
|
+
"Input validation failed"
|
|
53
|
+
);
|
|
54
|
+
if (!parsed$.ok) {
|
|
55
|
+
return parsed$;
|
|
56
|
+
}
|
|
57
|
+
const payload$ = parsed$.value;
|
|
58
|
+
const body$ = payload$ === undefined ? null : encodeJSON$("body", payload$, { explode: true });
|
|
59
|
+
|
|
60
|
+
const path$ = pathToFunc("/variations/upscale")();
|
|
61
|
+
|
|
62
|
+
const headers$ = new Headers({
|
|
63
|
+
"Content-Type": "application/json",
|
|
64
|
+
Accept: "application/json",
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const bearerAuth$ = await extractSecurity(client$.options$.bearerAuth);
|
|
68
|
+
const security$ = bearerAuth$ == null ? {} : { bearerAuth: bearerAuth$ };
|
|
69
|
+
const context = {
|
|
70
|
+
operationID: "createVariationUpscale",
|
|
71
|
+
oAuth2Scopes: [],
|
|
72
|
+
securitySource: client$.options$.bearerAuth,
|
|
73
|
+
};
|
|
74
|
+
const securitySettings$ = resolveGlobalSecurity(security$);
|
|
75
|
+
|
|
76
|
+
const requestRes = client$.createRequest$(
|
|
77
|
+
context,
|
|
78
|
+
{
|
|
79
|
+
security: securitySettings$,
|
|
80
|
+
method: "POST",
|
|
81
|
+
path: path$,
|
|
82
|
+
headers: headers$,
|
|
83
|
+
body: body$,
|
|
84
|
+
timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1,
|
|
85
|
+
},
|
|
86
|
+
options
|
|
87
|
+
);
|
|
88
|
+
if (!requestRes.ok) {
|
|
89
|
+
return requestRes;
|
|
90
|
+
}
|
|
91
|
+
const request$ = requestRes.value;
|
|
92
|
+
|
|
93
|
+
const doResult = await client$.do$(request$, {
|
|
94
|
+
context,
|
|
95
|
+
errorCodes: [],
|
|
96
|
+
retryConfig: options?.retries || client$.options$.retryConfig,
|
|
97
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
98
|
+
});
|
|
99
|
+
if (!doResult.ok) {
|
|
100
|
+
return doResult;
|
|
101
|
+
}
|
|
102
|
+
const response = doResult.value;
|
|
103
|
+
|
|
104
|
+
const responseFields$ = {
|
|
105
|
+
ContentType: response.headers.get("content-type") ?? "application/octet-stream",
|
|
106
|
+
StatusCode: response.status,
|
|
107
|
+
RawResponse: response,
|
|
108
|
+
Headers: {},
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const [result$] = await m$.match<
|
|
112
|
+
operations.CreateVariationUpscaleResponse,
|
|
113
|
+
| SDKError
|
|
114
|
+
| SDKValidationError
|
|
115
|
+
| UnexpectedClientError
|
|
116
|
+
| InvalidRequestError
|
|
117
|
+
| RequestAbortedError
|
|
118
|
+
| RequestTimeoutError
|
|
119
|
+
| ConnectionError
|
|
120
|
+
>(m$.json(200, operations.CreateVariationUpscaleResponse$inboundSchema, { key: "object" }))(
|
|
121
|
+
response,
|
|
122
|
+
{ extraFields: responseFields$ }
|
|
123
|
+
);
|
|
124
|
+
if (!result$.ok) {
|
|
125
|
+
return result$;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return result$;
|
|
129
|
+
}
|
|
@@ -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 variation by ID
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* This endpoint will get the variation by ID
|
|
29
|
+
*/
|
|
30
|
+
export async function variationGetVariationById(
|
|
31
|
+
client$: LeonardoCore,
|
|
32
|
+
id: string,
|
|
33
|
+
options?: RequestOptions
|
|
34
|
+
): Promise<
|
|
35
|
+
Result<
|
|
36
|
+
operations.GetVariationByIdResponse,
|
|
37
|
+
| SDKError
|
|
38
|
+
| SDKValidationError
|
|
39
|
+
| UnexpectedClientError
|
|
40
|
+
| InvalidRequestError
|
|
41
|
+
| RequestAbortedError
|
|
42
|
+
| RequestTimeoutError
|
|
43
|
+
| ConnectionError
|
|
44
|
+
>
|
|
45
|
+
> {
|
|
46
|
+
const input$: operations.GetVariationByIdRequest = {
|
|
47
|
+
id: id,
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const parsed$ = schemas$.safeParse(
|
|
51
|
+
input$,
|
|
52
|
+
(value$) => operations.GetVariationByIdRequest$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("/variations/{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: "getVariationById",
|
|
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.GetVariationByIdResponse,
|
|
117
|
+
| SDKError
|
|
118
|
+
| SDKValidationError
|
|
119
|
+
| UnexpectedClientError
|
|
120
|
+
| InvalidRequestError
|
|
121
|
+
| RequestAbortedError
|
|
122
|
+
| RequestTimeoutError
|
|
123
|
+
| ConnectionError
|
|
124
|
+
>(m$.json(200, operations.GetVariationByIdResponse$inboundSchema, { key: "object" }))(
|
|
125
|
+
response,
|
|
126
|
+
{ extraFields: responseFields$ }
|
|
127
|
+
);
|
|
128
|
+
if (!result$.ok) {
|
|
129
|
+
return result$;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return result$;
|
|
133
|
+
}
|
package/src/index.ts
CHANGED
package/src/lib/config.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { HTTPClient } from "./http.js";
|
|
6
|
+
import { Logger } from "./logger.js";
|
|
6
7
|
import { RetryConfig } from "./retries.js";
|
|
7
8
|
import { Params, pathToFunc } from "./url.js";
|
|
8
9
|
|
|
@@ -33,6 +34,7 @@ export type SDKOptions = {
|
|
|
33
34
|
*/
|
|
34
35
|
retryConfig?: RetryConfig;
|
|
35
36
|
timeoutMs?: number;
|
|
37
|
+
debugLogger?: Logger;
|
|
36
38
|
};
|
|
37
39
|
|
|
38
40
|
export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
@@ -55,7 +57,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
55
57
|
export const SDK_METADATA = {
|
|
56
58
|
language: "typescript",
|
|
57
59
|
openapiDocVersion: "v1.0.0",
|
|
58
|
-
sdkVersion: "4.
|
|
59
|
-
genVersion: "2.
|
|
60
|
-
userAgent: "speakeasy-sdk/typescript 4.
|
|
60
|
+
sdkVersion: "4.15.0",
|
|
61
|
+
genVersion: "2.409.0",
|
|
62
|
+
userAgent: "speakeasy-sdk/typescript 4.15.0 2.409.0 v1.0.0 @leonardo-ai/sdk",
|
|
61
63
|
} as const;
|
package/src/lib/dlv.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2024 Jason Miller <jason@developit.ca> (http://jasonformat.com)
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
11
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
12
|
+
the Software without restriction, including without limitation the rights to
|
|
13
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
14
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
15
|
+
subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
22
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
23
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
24
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
25
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @param obj The object to walk
|
|
30
|
+
* @param key The key path to walk the object with
|
|
31
|
+
* @param def A default value to return if the result is undefined
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* dlv(obj, "a.b.c.d")
|
|
35
|
+
* @example
|
|
36
|
+
* dlv(object, ["a", "b", "c", "d"])
|
|
37
|
+
* @example
|
|
38
|
+
* dlv(object, "foo.bar.baz", "Hello, default value!")
|
|
39
|
+
*/
|
|
40
|
+
export function dlv<T = any>(
|
|
41
|
+
obj: any,
|
|
42
|
+
key: string | string[],
|
|
43
|
+
def?: T,
|
|
44
|
+
p?: number,
|
|
45
|
+
undef?: never,
|
|
46
|
+
): T | undefined {
|
|
47
|
+
key = Array.isArray(key) ? key : key.split(".");
|
|
48
|
+
for (p = 0; p < key.length; p++) {
|
|
49
|
+
const k = key[p];
|
|
50
|
+
obj = k != null && obj ? obj[k] : undef;
|
|
51
|
+
}
|
|
52
|
+
return obj === undef ? def : obj;
|
|
53
|
+
}
|
package/src/lib/files.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { Readable } from "stream";
|
|
6
|
+
import { createReadStream } from "fs";
|
|
7
|
+
import { readFile } from "fs/promises";
|
|
8
|
+
|
|
9
|
+
export function toStream(filePath: string): ReadableStream<Uint8Array> {
|
|
10
|
+
return Readable.toWeb(
|
|
11
|
+
createReadStream(filePath),
|
|
12
|
+
) as ReadableStream<Uint8Array>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export async function toByteArray(filePath: string): Promise<Buffer> {
|
|
16
|
+
return readFile(filePath);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export async function toString(filePath: string): Promise<string> {
|
|
20
|
+
return readFile(filePath, "utf8");
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Consumes a stream and returns a concatenated array buffer. Useful in
|
|
25
|
+
* situations where we need to read the whole file because it forms part of a
|
|
26
|
+
* larger payload containing other fields, and we can't modify the underlying
|
|
27
|
+
* request structure.
|
|
28
|
+
*/
|
|
29
|
+
export async function readableStreamToArrayBuffer(
|
|
30
|
+
readable: ReadableStream<Uint8Array>,
|
|
31
|
+
): Promise<ArrayBuffer> {
|
|
32
|
+
const reader = readable.getReader();
|
|
33
|
+
const chunks: Uint8Array[] = [];
|
|
34
|
+
|
|
35
|
+
let totalLength = 0;
|
|
36
|
+
let done = false;
|
|
37
|
+
|
|
38
|
+
while (!done) {
|
|
39
|
+
const { value, done: doneReading } = await reader.read();
|
|
40
|
+
|
|
41
|
+
if (doneReading) {
|
|
42
|
+
done = true;
|
|
43
|
+
} else {
|
|
44
|
+
chunks.push(value);
|
|
45
|
+
totalLength += value.length;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const concatenatedChunks = new Uint8Array(totalLength);
|
|
50
|
+
let offset = 0;
|
|
51
|
+
|
|
52
|
+
for (const chunk of chunks) {
|
|
53
|
+
concatenatedChunks.set(chunk, offset);
|
|
54
|
+
offset += chunk.length;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return concatenatedChunks.buffer;
|
|
58
|
+
}
|