@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
package/sdk/image.js
CHANGED
|
@@ -2,59 +2,15 @@
|
|
|
2
2
|
/*
|
|
3
3
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
4
|
*/
|
|
5
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(o, k2, desc);
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
-
}) : function(o, v) {
|
|
19
|
-
o["default"] = v;
|
|
20
|
-
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
-
if (mod && mod.__esModule) return mod;
|
|
23
|
-
var result = {};
|
|
24
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
-
__setModuleDefault(result, mod);
|
|
26
|
-
return result;
|
|
27
|
-
};
|
|
28
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
6
|
exports.Image = void 0;
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const schemas$ = __importStar(require("../lib/schemas.js"));
|
|
7
|
+
const imageCreateGeneration_js_1 = require("../funcs/imageCreateGeneration.js");
|
|
8
|
+
const imageDeleteGenerationById_js_1 = require("../funcs/imageDeleteGenerationById.js");
|
|
9
|
+
const imageGetGenerationById_js_1 = require("../funcs/imageGetGenerationById.js");
|
|
10
|
+
const imageGetGenerationsByUserId_js_1 = require("../funcs/imageGetGenerationsByUserId.js");
|
|
35
11
|
const sdks_js_1 = require("../lib/sdks.js");
|
|
36
|
-
const
|
|
12
|
+
const fp_js_1 = require("./types/fp.js");
|
|
37
13
|
class Image extends sdks_js_1.ClientSDK {
|
|
38
|
-
constructor(options = {}) {
|
|
39
|
-
const opt = options;
|
|
40
|
-
let hooks;
|
|
41
|
-
if (typeof opt === "object" &&
|
|
42
|
-
opt != null &&
|
|
43
|
-
"hooks" in opt &&
|
|
44
|
-
opt.hooks instanceof hooks_js_1.SDKHooks) {
|
|
45
|
-
hooks = opt.hooks;
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
hooks = new hooks_js_1.SDKHooks();
|
|
49
|
-
}
|
|
50
|
-
super({
|
|
51
|
-
client: options.httpClient || new http_js_1.HTTPClient(),
|
|
52
|
-
baseURL: (0, config_js_1.serverURLFromOptions)(options),
|
|
53
|
-
hooks,
|
|
54
|
-
});
|
|
55
|
-
this.options$ = { ...options, hooks };
|
|
56
|
-
void this.options$;
|
|
57
|
-
}
|
|
58
14
|
/**
|
|
59
15
|
* Create a Generation of Images
|
|
60
16
|
*
|
|
@@ -62,57 +18,7 @@ class Image extends sdks_js_1.ClientSDK {
|
|
|
62
18
|
* This endpoint will generate images
|
|
63
19
|
*/
|
|
64
20
|
async createGeneration(request, options) {
|
|
65
|
-
|
|
66
|
-
const input$ = request;
|
|
67
|
-
const payload$ = schemas$.parse(input$, (value$) => operations.CreateGenerationRequestBody$outboundSchema.parse(value$), "Input validation failed");
|
|
68
|
-
const body$ = (0, encodings_js_1.encodeJSON)("body", payload$, { explode: true });
|
|
69
|
-
const path$ = this.templateURLComponent("/generations")();
|
|
70
|
-
const query$ = "";
|
|
71
|
-
const headers$ = new Headers({
|
|
72
|
-
"Content-Type": "application/json",
|
|
73
|
-
Accept: "application/json",
|
|
74
|
-
});
|
|
75
|
-
let security$;
|
|
76
|
-
if (typeof this.options$.bearerAuth === "function") {
|
|
77
|
-
security$ = { bearerAuth: await this.options$.bearerAuth() };
|
|
78
|
-
}
|
|
79
|
-
else if (this.options$.bearerAuth) {
|
|
80
|
-
security$ = { bearerAuth: this.options$.bearerAuth };
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
security$ = {};
|
|
84
|
-
}
|
|
85
|
-
const context = {
|
|
86
|
-
operationID: "createGeneration",
|
|
87
|
-
oAuth2Scopes: [],
|
|
88
|
-
securitySource: this.options$.bearerAuth,
|
|
89
|
-
};
|
|
90
|
-
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
91
|
-
const request$ = this.createRequest$(context, {
|
|
92
|
-
security: securitySettings$,
|
|
93
|
-
method: "POST",
|
|
94
|
-
path: path$,
|
|
95
|
-
headers: headers$,
|
|
96
|
-
query: query$,
|
|
97
|
-
body: body$,
|
|
98
|
-
timeoutMs: (options === null || options === void 0 ? void 0 : options.timeoutMs) || this.options$.timeoutMs || -1,
|
|
99
|
-
}, options);
|
|
100
|
-
const response = await this.do$(request$, {
|
|
101
|
-
context,
|
|
102
|
-
errorCodes: [],
|
|
103
|
-
retryConfig: (options === null || options === void 0 ? void 0 : options.retries) || this.options$.retryConfig,
|
|
104
|
-
retryCodes: (options === null || options === void 0 ? void 0 : options.retryCodes) || ["429", "500", "502", "503", "504"],
|
|
105
|
-
});
|
|
106
|
-
const responseFields$ = {
|
|
107
|
-
ContentType: (_a = response.headers.get("content-type")) !== null && _a !== void 0 ? _a : "application/octet-stream",
|
|
108
|
-
StatusCode: response.status,
|
|
109
|
-
RawResponse: response,
|
|
110
|
-
Headers: {},
|
|
111
|
-
};
|
|
112
|
-
const [result$] = await this.matcher()
|
|
113
|
-
.json(200, operations.CreateGenerationResponse$inboundSchema, { key: "object" })
|
|
114
|
-
.match(response, { extraFields: responseFields$ });
|
|
115
|
-
return result$;
|
|
21
|
+
return (0, fp_js_1.unwrapAsync)((0, imageCreateGeneration_js_1.imageCreateGeneration)(this, request, options));
|
|
116
22
|
}
|
|
117
23
|
/**
|
|
118
24
|
* Delete a Single Generation
|
|
@@ -121,61 +27,7 @@ class Image extends sdks_js_1.ClientSDK {
|
|
|
121
27
|
* This endpoint deletes a specific generation
|
|
122
28
|
*/
|
|
123
29
|
async deleteGenerationById(id, options) {
|
|
124
|
-
|
|
125
|
-
const input$ = {
|
|
126
|
-
id: id,
|
|
127
|
-
};
|
|
128
|
-
const payload$ = schemas$.parse(input$, (value$) => operations.DeleteGenerationByIdRequest$outboundSchema.parse(value$), "Input validation failed");
|
|
129
|
-
const body$ = null;
|
|
130
|
-
const pathParams$ = {
|
|
131
|
-
id: (0, encodings_js_1.encodeSimple)("id", payload$.id, { explode: false, charEncoding: "percent" }),
|
|
132
|
-
};
|
|
133
|
-
const path$ = this.templateURLComponent("/generations/{id}")(pathParams$);
|
|
134
|
-
const query$ = "";
|
|
135
|
-
const headers$ = new Headers({
|
|
136
|
-
Accept: "application/json",
|
|
137
|
-
});
|
|
138
|
-
let security$;
|
|
139
|
-
if (typeof this.options$.bearerAuth === "function") {
|
|
140
|
-
security$ = { bearerAuth: await this.options$.bearerAuth() };
|
|
141
|
-
}
|
|
142
|
-
else if (this.options$.bearerAuth) {
|
|
143
|
-
security$ = { bearerAuth: this.options$.bearerAuth };
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
security$ = {};
|
|
147
|
-
}
|
|
148
|
-
const context = {
|
|
149
|
-
operationID: "deleteGenerationById",
|
|
150
|
-
oAuth2Scopes: [],
|
|
151
|
-
securitySource: this.options$.bearerAuth,
|
|
152
|
-
};
|
|
153
|
-
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
154
|
-
const request$ = this.createRequest$(context, {
|
|
155
|
-
security: securitySettings$,
|
|
156
|
-
method: "DELETE",
|
|
157
|
-
path: path$,
|
|
158
|
-
headers: headers$,
|
|
159
|
-
query: query$,
|
|
160
|
-
body: body$,
|
|
161
|
-
timeoutMs: (options === null || options === void 0 ? void 0 : options.timeoutMs) || this.options$.timeoutMs || -1,
|
|
162
|
-
}, options);
|
|
163
|
-
const response = await this.do$(request$, {
|
|
164
|
-
context,
|
|
165
|
-
errorCodes: [],
|
|
166
|
-
retryConfig: (options === null || options === void 0 ? void 0 : options.retries) || this.options$.retryConfig,
|
|
167
|
-
retryCodes: (options === null || options === void 0 ? void 0 : options.retryCodes) || ["429", "500", "502", "503", "504"],
|
|
168
|
-
});
|
|
169
|
-
const responseFields$ = {
|
|
170
|
-
ContentType: (_a = response.headers.get("content-type")) !== null && _a !== void 0 ? _a : "application/octet-stream",
|
|
171
|
-
StatusCode: response.status,
|
|
172
|
-
RawResponse: response,
|
|
173
|
-
Headers: {},
|
|
174
|
-
};
|
|
175
|
-
const [result$] = await this.matcher()
|
|
176
|
-
.json(200, operations.DeleteGenerationByIdResponse$inboundSchema, { key: "object" })
|
|
177
|
-
.match(response, { extraFields: responseFields$ });
|
|
178
|
-
return result$;
|
|
30
|
+
return (0, fp_js_1.unwrapAsync)((0, imageDeleteGenerationById_js_1.imageDeleteGenerationById)(this, id, options));
|
|
179
31
|
}
|
|
180
32
|
/**
|
|
181
33
|
* Get a Single Generation
|
|
@@ -184,61 +36,7 @@ class Image extends sdks_js_1.ClientSDK {
|
|
|
184
36
|
* This endpoint will provide information about a specific generation
|
|
185
37
|
*/
|
|
186
38
|
async getGenerationById(id, options) {
|
|
187
|
-
|
|
188
|
-
const input$ = {
|
|
189
|
-
id: id,
|
|
190
|
-
};
|
|
191
|
-
const payload$ = schemas$.parse(input$, (value$) => operations.GetGenerationByIdRequest$outboundSchema.parse(value$), "Input validation failed");
|
|
192
|
-
const body$ = null;
|
|
193
|
-
const pathParams$ = {
|
|
194
|
-
id: (0, encodings_js_1.encodeSimple)("id", payload$.id, { explode: false, charEncoding: "percent" }),
|
|
195
|
-
};
|
|
196
|
-
const path$ = this.templateURLComponent("/generations/{id}")(pathParams$);
|
|
197
|
-
const query$ = "";
|
|
198
|
-
const headers$ = new Headers({
|
|
199
|
-
Accept: "application/json",
|
|
200
|
-
});
|
|
201
|
-
let security$;
|
|
202
|
-
if (typeof this.options$.bearerAuth === "function") {
|
|
203
|
-
security$ = { bearerAuth: await this.options$.bearerAuth() };
|
|
204
|
-
}
|
|
205
|
-
else if (this.options$.bearerAuth) {
|
|
206
|
-
security$ = { bearerAuth: this.options$.bearerAuth };
|
|
207
|
-
}
|
|
208
|
-
else {
|
|
209
|
-
security$ = {};
|
|
210
|
-
}
|
|
211
|
-
const context = {
|
|
212
|
-
operationID: "getGenerationById",
|
|
213
|
-
oAuth2Scopes: [],
|
|
214
|
-
securitySource: this.options$.bearerAuth,
|
|
215
|
-
};
|
|
216
|
-
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
217
|
-
const request$ = this.createRequest$(context, {
|
|
218
|
-
security: securitySettings$,
|
|
219
|
-
method: "GET",
|
|
220
|
-
path: path$,
|
|
221
|
-
headers: headers$,
|
|
222
|
-
query: query$,
|
|
223
|
-
body: body$,
|
|
224
|
-
timeoutMs: (options === null || options === void 0 ? void 0 : options.timeoutMs) || this.options$.timeoutMs || -1,
|
|
225
|
-
}, options);
|
|
226
|
-
const response = await this.do$(request$, {
|
|
227
|
-
context,
|
|
228
|
-
errorCodes: [],
|
|
229
|
-
retryConfig: (options === null || options === void 0 ? void 0 : options.retries) || this.options$.retryConfig,
|
|
230
|
-
retryCodes: (options === null || options === void 0 ? void 0 : options.retryCodes) || ["429", "500", "502", "503", "504"],
|
|
231
|
-
});
|
|
232
|
-
const responseFields$ = {
|
|
233
|
-
ContentType: (_a = response.headers.get("content-type")) !== null && _a !== void 0 ? _a : "application/octet-stream",
|
|
234
|
-
StatusCode: response.status,
|
|
235
|
-
RawResponse: response,
|
|
236
|
-
Headers: {},
|
|
237
|
-
};
|
|
238
|
-
const [result$] = await this.matcher()
|
|
239
|
-
.json(200, operations.GetGenerationByIdResponse$inboundSchema, { key: "object" })
|
|
240
|
-
.match(response, { extraFields: responseFields$ });
|
|
241
|
-
return result$;
|
|
39
|
+
return (0, fp_js_1.unwrapAsync)((0, imageGetGenerationById_js_1.imageGetGenerationById)(this, id, options));
|
|
242
40
|
}
|
|
243
41
|
/**
|
|
244
42
|
* Get generations by user ID
|
|
@@ -247,69 +45,7 @@ class Image extends sdks_js_1.ClientSDK {
|
|
|
247
45
|
* This endpoint returns all generations by a specific user
|
|
248
46
|
*/
|
|
249
47
|
async getGenerationsByUserId(userId, limit, offset, options) {
|
|
250
|
-
|
|
251
|
-
const input$ = {
|
|
252
|
-
limit: limit,
|
|
253
|
-
offset: offset,
|
|
254
|
-
userId: userId,
|
|
255
|
-
};
|
|
256
|
-
const payload$ = schemas$.parse(input$, (value$) => operations.GetGenerationsByUserIdRequest$outboundSchema.parse(value$), "Input validation failed");
|
|
257
|
-
const body$ = null;
|
|
258
|
-
const pathParams$ = {
|
|
259
|
-
userId: (0, encodings_js_1.encodeSimple)("userId", payload$.userId, {
|
|
260
|
-
explode: false,
|
|
261
|
-
charEncoding: "percent",
|
|
262
|
-
}),
|
|
263
|
-
};
|
|
264
|
-
const path$ = this.templateURLComponent("/generations/user/{userId}")(pathParams$);
|
|
265
|
-
const query$ = (0, encodings_js_1.encodeFormQuery)({
|
|
266
|
-
limit: payload$.limit,
|
|
267
|
-
offset: payload$.offset,
|
|
268
|
-
});
|
|
269
|
-
const headers$ = new Headers({
|
|
270
|
-
Accept: "application/json",
|
|
271
|
-
});
|
|
272
|
-
let security$;
|
|
273
|
-
if (typeof this.options$.bearerAuth === "function") {
|
|
274
|
-
security$ = { bearerAuth: await this.options$.bearerAuth() };
|
|
275
|
-
}
|
|
276
|
-
else if (this.options$.bearerAuth) {
|
|
277
|
-
security$ = { bearerAuth: this.options$.bearerAuth };
|
|
278
|
-
}
|
|
279
|
-
else {
|
|
280
|
-
security$ = {};
|
|
281
|
-
}
|
|
282
|
-
const context = {
|
|
283
|
-
operationID: "getGenerationsByUserId",
|
|
284
|
-
oAuth2Scopes: [],
|
|
285
|
-
securitySource: this.options$.bearerAuth,
|
|
286
|
-
};
|
|
287
|
-
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
288
|
-
const request$ = this.createRequest$(context, {
|
|
289
|
-
security: securitySettings$,
|
|
290
|
-
method: "GET",
|
|
291
|
-
path: path$,
|
|
292
|
-
headers: headers$,
|
|
293
|
-
query: query$,
|
|
294
|
-
body: body$,
|
|
295
|
-
timeoutMs: (options === null || options === void 0 ? void 0 : options.timeoutMs) || this.options$.timeoutMs || -1,
|
|
296
|
-
}, options);
|
|
297
|
-
const response = await this.do$(request$, {
|
|
298
|
-
context,
|
|
299
|
-
errorCodes: [],
|
|
300
|
-
retryConfig: (options === null || options === void 0 ? void 0 : options.retries) || this.options$.retryConfig,
|
|
301
|
-
retryCodes: (options === null || options === void 0 ? void 0 : options.retryCodes) || ["429", "500", "502", "503", "504"],
|
|
302
|
-
});
|
|
303
|
-
const responseFields$ = {
|
|
304
|
-
ContentType: (_a = response.headers.get("content-type")) !== null && _a !== void 0 ? _a : "application/octet-stream",
|
|
305
|
-
StatusCode: response.status,
|
|
306
|
-
RawResponse: response,
|
|
307
|
-
Headers: {},
|
|
308
|
-
};
|
|
309
|
-
const [result$] = await this.matcher()
|
|
310
|
-
.json(200, operations.GetGenerationsByUserIdResponse$inboundSchema, { key: "object" })
|
|
311
|
-
.match(response, { extraFields: responseFields$ });
|
|
312
|
-
return result$;
|
|
48
|
+
return (0, fp_js_1.unwrapAsync)((0, imageGetGenerationsByUserId_js_1.imageGetGenerationsByUserId)(this, userId, limit, offset, options));
|
|
313
49
|
}
|
|
314
50
|
}
|
|
315
51
|
exports.Image = Image;
|
package/sdk/image.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.js","sourceRoot":"","sources":["../src/sdk/image.ts"],"names":[],"mappings":";AAAA;;GAEG
|
|
1
|
+
{"version":3,"file":"image.js","sourceRoot":"","sources":["../src/sdk/image.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,gFAA0E;AAC1E,wFAAkF;AAClF,kFAA4E;AAC5E,4FAAsF;AACtF,4CAA2D;AAE3D,yCAA4C;AAE5C,MAAa,KAAM,SAAQ,mBAAS;IAChC;;;;;OAKG;IACH,KAAK,CAAC,gBAAgB,CAClB,OAA+C,EAC/C,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,gDAAqB,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IACtE,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,oBAAoB,CACtB,EAAU,EACV,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,wDAAyB,EAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;IACrE,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,iBAAiB,CACnB,EAAU,EACV,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,kDAAsB,EAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;IAClE,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,sBAAsB,CACxB,MAAc,EACd,KAA0B,EAC1B,MAA2B,EAC3B,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,4DAA2B,EAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC1F,CAAC;CACJ;AAtDD,sBAsDC"}
|
package/sdk/initimages.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { SDKOptions } from "../lib/config.js";
|
|
2
1
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
3
2
|
import * as operations from "./models/operations/index.js";
|
|
4
3
|
export declare class InitImages extends ClientSDK {
|
|
5
|
-
private readonly options$;
|
|
6
|
-
constructor(options?: SDKOptions);
|
|
7
4
|
/**
|
|
8
5
|
* Delete init image
|
|
9
6
|
*
|
package/sdk/initimages.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initimages.d.ts","sourceRoot":"","sources":["../src/sdk/initimages.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"initimages.d.ts","sourceRoot":"","sources":["../src/sdk/initimages.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAG3D,qBAAa,UAAW,SAAQ,SAAS;IACrC;;;;;OAKG;IACG,mBAAmB,CACrB,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,UAAU,CAAC,2BAA2B,CAAC;IAIlD;;;;;OAKG;IACG,gBAAgB,CAClB,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,UAAU,CAAC,wBAAwB,CAAC;IAI/C;;;;;OAKG;IACG,qBAAqB,CACvB,OAAO,EAAE,UAAU,CAAC,gCAAgC,EACpD,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,UAAU,CAAC,6BAA6B,CAAC;IAIpD;;;;;OAKG;IACG,eAAe,CACjB,OAAO,EAAE,UAAU,CAAC,0BAA0B,EAC9C,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,UAAU,CAAC,uBAAuB,CAAC;CAGjD"}
|
package/sdk/initimages.js
CHANGED
|
@@ -2,59 +2,15 @@
|
|
|
2
2
|
/*
|
|
3
3
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
4
|
*/
|
|
5
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(o, k2, desc);
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
-
}) : function(o, v) {
|
|
19
|
-
o["default"] = v;
|
|
20
|
-
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
-
if (mod && mod.__esModule) return mod;
|
|
23
|
-
var result = {};
|
|
24
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
-
__setModuleDefault(result, mod);
|
|
26
|
-
return result;
|
|
27
|
-
};
|
|
28
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
6
|
exports.InitImages = void 0;
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const schemas$ = __importStar(require("../lib/schemas.js"));
|
|
7
|
+
const initImagesDeleteInitImageById_js_1 = require("../funcs/initImagesDeleteInitImageById.js");
|
|
8
|
+
const initImagesGetInitImageById_js_1 = require("../funcs/initImagesGetInitImageById.js");
|
|
9
|
+
const initImagesUploadCanvasInitImage_js_1 = require("../funcs/initImagesUploadCanvasInitImage.js");
|
|
10
|
+
const initImagesUploadInitImage_js_1 = require("../funcs/initImagesUploadInitImage.js");
|
|
35
11
|
const sdks_js_1 = require("../lib/sdks.js");
|
|
36
|
-
const
|
|
12
|
+
const fp_js_1 = require("./types/fp.js");
|
|
37
13
|
class InitImages extends sdks_js_1.ClientSDK {
|
|
38
|
-
constructor(options = {}) {
|
|
39
|
-
const opt = options;
|
|
40
|
-
let hooks;
|
|
41
|
-
if (typeof opt === "object" &&
|
|
42
|
-
opt != null &&
|
|
43
|
-
"hooks" in opt &&
|
|
44
|
-
opt.hooks instanceof hooks_js_1.SDKHooks) {
|
|
45
|
-
hooks = opt.hooks;
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
hooks = new hooks_js_1.SDKHooks();
|
|
49
|
-
}
|
|
50
|
-
super({
|
|
51
|
-
client: options.httpClient || new http_js_1.HTTPClient(),
|
|
52
|
-
baseURL: (0, config_js_1.serverURLFromOptions)(options),
|
|
53
|
-
hooks,
|
|
54
|
-
});
|
|
55
|
-
this.options$ = { ...options, hooks };
|
|
56
|
-
void this.options$;
|
|
57
|
-
}
|
|
58
14
|
/**
|
|
59
15
|
* Delete init image
|
|
60
16
|
*
|
|
@@ -62,61 +18,7 @@ class InitImages extends sdks_js_1.ClientSDK {
|
|
|
62
18
|
* This endpoint deletes an init image
|
|
63
19
|
*/
|
|
64
20
|
async deleteInitImageById(id, options) {
|
|
65
|
-
|
|
66
|
-
const input$ = {
|
|
67
|
-
id: id,
|
|
68
|
-
};
|
|
69
|
-
const payload$ = schemas$.parse(input$, (value$) => operations.DeleteInitImageByIdRequest$outboundSchema.parse(value$), "Input validation failed");
|
|
70
|
-
const body$ = null;
|
|
71
|
-
const pathParams$ = {
|
|
72
|
-
id: (0, encodings_js_1.encodeSimple)("id", payload$.id, { explode: false, charEncoding: "percent" }),
|
|
73
|
-
};
|
|
74
|
-
const path$ = this.templateURLComponent("/init-image/{id}")(pathParams$);
|
|
75
|
-
const query$ = "";
|
|
76
|
-
const headers$ = new Headers({
|
|
77
|
-
Accept: "application/json",
|
|
78
|
-
});
|
|
79
|
-
let security$;
|
|
80
|
-
if (typeof this.options$.bearerAuth === "function") {
|
|
81
|
-
security$ = { bearerAuth: await this.options$.bearerAuth() };
|
|
82
|
-
}
|
|
83
|
-
else if (this.options$.bearerAuth) {
|
|
84
|
-
security$ = { bearerAuth: this.options$.bearerAuth };
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
security$ = {};
|
|
88
|
-
}
|
|
89
|
-
const context = {
|
|
90
|
-
operationID: "deleteInitImageById",
|
|
91
|
-
oAuth2Scopes: [],
|
|
92
|
-
securitySource: this.options$.bearerAuth,
|
|
93
|
-
};
|
|
94
|
-
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
95
|
-
const request$ = this.createRequest$(context, {
|
|
96
|
-
security: securitySettings$,
|
|
97
|
-
method: "DELETE",
|
|
98
|
-
path: path$,
|
|
99
|
-
headers: headers$,
|
|
100
|
-
query: query$,
|
|
101
|
-
body: body$,
|
|
102
|
-
timeoutMs: (options === null || options === void 0 ? void 0 : options.timeoutMs) || this.options$.timeoutMs || -1,
|
|
103
|
-
}, options);
|
|
104
|
-
const response = await this.do$(request$, {
|
|
105
|
-
context,
|
|
106
|
-
errorCodes: [],
|
|
107
|
-
retryConfig: (options === null || options === void 0 ? void 0 : options.retries) || this.options$.retryConfig,
|
|
108
|
-
retryCodes: (options === null || options === void 0 ? void 0 : options.retryCodes) || ["429", "500", "502", "503", "504"],
|
|
109
|
-
});
|
|
110
|
-
const responseFields$ = {
|
|
111
|
-
ContentType: (_a = response.headers.get("content-type")) !== null && _a !== void 0 ? _a : "application/octet-stream",
|
|
112
|
-
StatusCode: response.status,
|
|
113
|
-
RawResponse: response,
|
|
114
|
-
Headers: {},
|
|
115
|
-
};
|
|
116
|
-
const [result$] = await this.matcher()
|
|
117
|
-
.json(200, operations.DeleteInitImageByIdResponse$inboundSchema, { key: "object" })
|
|
118
|
-
.match(response, { extraFields: responseFields$ });
|
|
119
|
-
return result$;
|
|
21
|
+
return (0, fp_js_1.unwrapAsync)((0, initImagesDeleteInitImageById_js_1.initImagesDeleteInitImageById)(this, id, options));
|
|
120
22
|
}
|
|
121
23
|
/**
|
|
122
24
|
* Get single init image
|
|
@@ -125,61 +27,7 @@ class InitImages extends sdks_js_1.ClientSDK {
|
|
|
125
27
|
* This endpoint will return a single init image
|
|
126
28
|
*/
|
|
127
29
|
async getInitImageById(id, options) {
|
|
128
|
-
|
|
129
|
-
const input$ = {
|
|
130
|
-
id: id,
|
|
131
|
-
};
|
|
132
|
-
const payload$ = schemas$.parse(input$, (value$) => operations.GetInitImageByIdRequest$outboundSchema.parse(value$), "Input validation failed");
|
|
133
|
-
const body$ = null;
|
|
134
|
-
const pathParams$ = {
|
|
135
|
-
id: (0, encodings_js_1.encodeSimple)("id", payload$.id, { explode: false, charEncoding: "percent" }),
|
|
136
|
-
};
|
|
137
|
-
const path$ = this.templateURLComponent("/init-image/{id}")(pathParams$);
|
|
138
|
-
const query$ = "";
|
|
139
|
-
const headers$ = new Headers({
|
|
140
|
-
Accept: "application/json",
|
|
141
|
-
});
|
|
142
|
-
let security$;
|
|
143
|
-
if (typeof this.options$.bearerAuth === "function") {
|
|
144
|
-
security$ = { bearerAuth: await this.options$.bearerAuth() };
|
|
145
|
-
}
|
|
146
|
-
else if (this.options$.bearerAuth) {
|
|
147
|
-
security$ = { bearerAuth: this.options$.bearerAuth };
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
security$ = {};
|
|
151
|
-
}
|
|
152
|
-
const context = {
|
|
153
|
-
operationID: "getInitImageById",
|
|
154
|
-
oAuth2Scopes: [],
|
|
155
|
-
securitySource: this.options$.bearerAuth,
|
|
156
|
-
};
|
|
157
|
-
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
158
|
-
const request$ = this.createRequest$(context, {
|
|
159
|
-
security: securitySettings$,
|
|
160
|
-
method: "GET",
|
|
161
|
-
path: path$,
|
|
162
|
-
headers: headers$,
|
|
163
|
-
query: query$,
|
|
164
|
-
body: body$,
|
|
165
|
-
timeoutMs: (options === null || options === void 0 ? void 0 : options.timeoutMs) || this.options$.timeoutMs || -1,
|
|
166
|
-
}, options);
|
|
167
|
-
const response = await this.do$(request$, {
|
|
168
|
-
context,
|
|
169
|
-
errorCodes: [],
|
|
170
|
-
retryConfig: (options === null || options === void 0 ? void 0 : options.retries) || this.options$.retryConfig,
|
|
171
|
-
retryCodes: (options === null || options === void 0 ? void 0 : options.retryCodes) || ["429", "500", "502", "503", "504"],
|
|
172
|
-
});
|
|
173
|
-
const responseFields$ = {
|
|
174
|
-
ContentType: (_a = response.headers.get("content-type")) !== null && _a !== void 0 ? _a : "application/octet-stream",
|
|
175
|
-
StatusCode: response.status,
|
|
176
|
-
RawResponse: response,
|
|
177
|
-
Headers: {},
|
|
178
|
-
};
|
|
179
|
-
const [result$] = await this.matcher()
|
|
180
|
-
.json(200, operations.GetInitImageByIdResponse$inboundSchema, { key: "object" })
|
|
181
|
-
.match(response, { extraFields: responseFields$ });
|
|
182
|
-
return result$;
|
|
30
|
+
return (0, fp_js_1.unwrapAsync)((0, initImagesGetInitImageById_js_1.initImagesGetInitImageById)(this, id, options));
|
|
183
31
|
}
|
|
184
32
|
/**
|
|
185
33
|
* Upload Canvas Editor init and mask image
|
|
@@ -188,57 +36,7 @@ class InitImages extends sdks_js_1.ClientSDK {
|
|
|
188
36
|
* This endpoint returns presigned details to upload an init image and a mask image to S3
|
|
189
37
|
*/
|
|
190
38
|
async uploadCanvasInitImage(request, options) {
|
|
191
|
-
|
|
192
|
-
const input$ = request;
|
|
193
|
-
const payload$ = schemas$.parse(input$, (value$) => operations.UploadCanvasInitImageRequestBody$outboundSchema.parse(value$), "Input validation failed");
|
|
194
|
-
const body$ = (0, encodings_js_1.encodeJSON)("body", payload$, { explode: true });
|
|
195
|
-
const path$ = this.templateURLComponent("/canvas-init-image")();
|
|
196
|
-
const query$ = "";
|
|
197
|
-
const headers$ = new Headers({
|
|
198
|
-
"Content-Type": "application/json",
|
|
199
|
-
Accept: "application/json",
|
|
200
|
-
});
|
|
201
|
-
let security$;
|
|
202
|
-
if (typeof this.options$.bearerAuth === "function") {
|
|
203
|
-
security$ = { bearerAuth: await this.options$.bearerAuth() };
|
|
204
|
-
}
|
|
205
|
-
else if (this.options$.bearerAuth) {
|
|
206
|
-
security$ = { bearerAuth: this.options$.bearerAuth };
|
|
207
|
-
}
|
|
208
|
-
else {
|
|
209
|
-
security$ = {};
|
|
210
|
-
}
|
|
211
|
-
const context = {
|
|
212
|
-
operationID: "uploadCanvasInitImage",
|
|
213
|
-
oAuth2Scopes: [],
|
|
214
|
-
securitySource: this.options$.bearerAuth,
|
|
215
|
-
};
|
|
216
|
-
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
217
|
-
const request$ = this.createRequest$(context, {
|
|
218
|
-
security: securitySettings$,
|
|
219
|
-
method: "POST",
|
|
220
|
-
path: path$,
|
|
221
|
-
headers: headers$,
|
|
222
|
-
query: query$,
|
|
223
|
-
body: body$,
|
|
224
|
-
timeoutMs: (options === null || options === void 0 ? void 0 : options.timeoutMs) || this.options$.timeoutMs || -1,
|
|
225
|
-
}, options);
|
|
226
|
-
const response = await this.do$(request$, {
|
|
227
|
-
context,
|
|
228
|
-
errorCodes: [],
|
|
229
|
-
retryConfig: (options === null || options === void 0 ? void 0 : options.retries) || this.options$.retryConfig,
|
|
230
|
-
retryCodes: (options === null || options === void 0 ? void 0 : options.retryCodes) || ["429", "500", "502", "503", "504"],
|
|
231
|
-
});
|
|
232
|
-
const responseFields$ = {
|
|
233
|
-
ContentType: (_a = response.headers.get("content-type")) !== null && _a !== void 0 ? _a : "application/octet-stream",
|
|
234
|
-
StatusCode: response.status,
|
|
235
|
-
RawResponse: response,
|
|
236
|
-
Headers: {},
|
|
237
|
-
};
|
|
238
|
-
const [result$] = await this.matcher()
|
|
239
|
-
.json(200, operations.UploadCanvasInitImageResponse$inboundSchema, { key: "object" })
|
|
240
|
-
.match(response, { extraFields: responseFields$ });
|
|
241
|
-
return result$;
|
|
39
|
+
return (0, fp_js_1.unwrapAsync)((0, initImagesUploadCanvasInitImage_js_1.initImagesUploadCanvasInitImage)(this, request, options));
|
|
242
40
|
}
|
|
243
41
|
/**
|
|
244
42
|
* Upload init image
|
|
@@ -247,57 +45,7 @@ class InitImages extends sdks_js_1.ClientSDK {
|
|
|
247
45
|
* This endpoint returns presigned details to upload an init image to S3
|
|
248
46
|
*/
|
|
249
47
|
async uploadInitImage(request, options) {
|
|
250
|
-
|
|
251
|
-
const input$ = request;
|
|
252
|
-
const payload$ = schemas$.parse(input$, (value$) => operations.UploadInitImageRequestBody$outboundSchema.parse(value$), "Input validation failed");
|
|
253
|
-
const body$ = (0, encodings_js_1.encodeJSON)("body", payload$, { explode: true });
|
|
254
|
-
const path$ = this.templateURLComponent("/init-image")();
|
|
255
|
-
const query$ = "";
|
|
256
|
-
const headers$ = new Headers({
|
|
257
|
-
"Content-Type": "application/json",
|
|
258
|
-
Accept: "application/json",
|
|
259
|
-
});
|
|
260
|
-
let security$;
|
|
261
|
-
if (typeof this.options$.bearerAuth === "function") {
|
|
262
|
-
security$ = { bearerAuth: await this.options$.bearerAuth() };
|
|
263
|
-
}
|
|
264
|
-
else if (this.options$.bearerAuth) {
|
|
265
|
-
security$ = { bearerAuth: this.options$.bearerAuth };
|
|
266
|
-
}
|
|
267
|
-
else {
|
|
268
|
-
security$ = {};
|
|
269
|
-
}
|
|
270
|
-
const context = {
|
|
271
|
-
operationID: "uploadInitImage",
|
|
272
|
-
oAuth2Scopes: [],
|
|
273
|
-
securitySource: this.options$.bearerAuth,
|
|
274
|
-
};
|
|
275
|
-
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
276
|
-
const request$ = this.createRequest$(context, {
|
|
277
|
-
security: securitySettings$,
|
|
278
|
-
method: "POST",
|
|
279
|
-
path: path$,
|
|
280
|
-
headers: headers$,
|
|
281
|
-
query: query$,
|
|
282
|
-
body: body$,
|
|
283
|
-
timeoutMs: (options === null || options === void 0 ? void 0 : options.timeoutMs) || this.options$.timeoutMs || -1,
|
|
284
|
-
}, options);
|
|
285
|
-
const response = await this.do$(request$, {
|
|
286
|
-
context,
|
|
287
|
-
errorCodes: [],
|
|
288
|
-
retryConfig: (options === null || options === void 0 ? void 0 : options.retries) || this.options$.retryConfig,
|
|
289
|
-
retryCodes: (options === null || options === void 0 ? void 0 : options.retryCodes) || ["429", "500", "502", "503", "504"],
|
|
290
|
-
});
|
|
291
|
-
const responseFields$ = {
|
|
292
|
-
ContentType: (_a = response.headers.get("content-type")) !== null && _a !== void 0 ? _a : "application/octet-stream",
|
|
293
|
-
StatusCode: response.status,
|
|
294
|
-
RawResponse: response,
|
|
295
|
-
Headers: {},
|
|
296
|
-
};
|
|
297
|
-
const [result$] = await this.matcher()
|
|
298
|
-
.json(200, operations.UploadInitImageResponse$inboundSchema, { key: "object" })
|
|
299
|
-
.match(response, { extraFields: responseFields$ });
|
|
300
|
-
return result$;
|
|
48
|
+
return (0, fp_js_1.unwrapAsync)((0, initImagesUploadInitImage_js_1.initImagesUploadInitImage)(this, request, options));
|
|
301
49
|
}
|
|
302
50
|
}
|
|
303
51
|
exports.InitImages = InitImages;
|