@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/types/operations.js
CHANGED
|
@@ -3,17 +3,79 @@
|
|
|
3
3
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.createPageIterator = void 0;
|
|
7
|
-
function createPageIterator(page) {
|
|
6
|
+
exports.unwrapResultIterator = exports.haltIterator = exports.createPageIterator = void 0;
|
|
7
|
+
function createPageIterator(page, halt) {
|
|
8
8
|
return {
|
|
9
9
|
[Symbol.asyncIterator]: async function* paginator() {
|
|
10
10
|
yield page;
|
|
11
|
+
if (halt(page)) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
11
14
|
let p = page;
|
|
12
15
|
for (p = await p.next(); p != null; p = await p.next()) {
|
|
13
16
|
yield p;
|
|
17
|
+
if (halt(p)) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
14
20
|
}
|
|
15
21
|
},
|
|
16
22
|
};
|
|
17
23
|
}
|
|
18
24
|
exports.createPageIterator = createPageIterator;
|
|
25
|
+
/**
|
|
26
|
+
* This utility create a special iterator that yields a single value and
|
|
27
|
+
* terminates. It is useful in paginated SDK functions that have early return
|
|
28
|
+
* paths when things go wrong.
|
|
29
|
+
*/
|
|
30
|
+
function haltIterator(v) {
|
|
31
|
+
return {
|
|
32
|
+
...v,
|
|
33
|
+
next: () => null,
|
|
34
|
+
[Symbol.asyncIterator]: async function* paginator() {
|
|
35
|
+
yield v;
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
exports.haltIterator = haltIterator;
|
|
40
|
+
/**
|
|
41
|
+
* Converts an async iterator of `Result<V, E>` into an async iterator of `V`.
|
|
42
|
+
* When error results occur, the underlying error value is thrown.
|
|
43
|
+
*/
|
|
44
|
+
async function unwrapResultIterator(iteratorPromise) {
|
|
45
|
+
const resultIter = await iteratorPromise;
|
|
46
|
+
if (!resultIter.ok) {
|
|
47
|
+
throw resultIter.error;
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
...resultIter.value,
|
|
51
|
+
next: unwrapPaginator(resultIter.next),
|
|
52
|
+
[Symbol.asyncIterator]: async function* paginator() {
|
|
53
|
+
for await (const page of resultIter) {
|
|
54
|
+
if (!page.ok) {
|
|
55
|
+
throw page.error;
|
|
56
|
+
}
|
|
57
|
+
yield page.value;
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
exports.unwrapResultIterator = unwrapResultIterator;
|
|
63
|
+
function unwrapPaginator(paginator) {
|
|
64
|
+
return () => {
|
|
65
|
+
const nextResult = paginator();
|
|
66
|
+
if (nextResult == null) {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
return nextResult.then((res) => {
|
|
70
|
+
if (!res.ok) {
|
|
71
|
+
throw res.error;
|
|
72
|
+
}
|
|
73
|
+
const out = {
|
|
74
|
+
...res.value,
|
|
75
|
+
next: unwrapPaginator(res.next),
|
|
76
|
+
};
|
|
77
|
+
return out;
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
}
|
|
19
81
|
//# sourceMappingURL=operations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../src/sdk/types/operations.ts"],"names":[],"mappings":";AAAA;;GAEG;;;
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../src/sdk/types/operations.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAWH,SAAgB,kBAAkB,CAChC,IAAgC,EAChC,IAAuB;IAIvB,OAAO;QACL,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,SAAS;YAC/C,MAAM,IAAI,CAAC;YACX,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBACf,OAAO;YACT,CAAC;YAED,IAAI,CAAC,GAAuB,IAAI,CAAC;YACjC,KAAK,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;gBACvD,MAAM,CAAC,CAAC;gBACR,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;oBACZ,OAAO;gBACT,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC;AAtBD,gDAsBC;AAED;;;;GAIG;AACH,SAAgB,YAAY,CAAmB,CAAI;IACjD,OAAO;QACL,GAAG,CAAC;QACJ,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI;QAChB,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,SAAS;YAC/C,MAAM,CAAC,CAAC;QACV,CAAC;KACF,CAAC;AACJ,CAAC;AARD,oCAQC;AAED;;;GAGG;AACI,KAAK,UAAU,oBAAoB,CACxC,eAA0D;IAE1D,MAAM,UAAU,GAAG,MAAM,eAAe,CAAC;IAEzC,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;QACnB,MAAM,UAAU,CAAC,KAAK,CAAC;IACzB,CAAC;IAED,OAAO;QACL,GAAG,UAAU,CAAC,KAAK;QACnB,IAAI,EAAE,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC;QACtC,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,SAAS;YAC/C,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,UAAU,EAAE,CAAC;gBACpC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;oBACb,MAAM,IAAI,CAAC,KAAK,CAAC;gBACnB,CAAC;gBACD,MAAM,IAAI,CAAC,KAAK,CAAC;YACnB,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC;AArBD,oDAqBC;AAED,SAAS,eAAe,CACtB,SAAwC;IAExC,OAAO,GAAG,EAAE;QACV,MAAM,UAAU,GAAG,SAAS,EAAE,CAAC;QAC/B,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;YACvB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;YAC7B,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;gBACZ,MAAM,GAAG,CAAC,KAAK,CAAC;YAClB,CAAC;YACD,MAAM,GAAG,GAAG;gBACV,GAAG,GAAG,CAAC,KAAK;gBACZ,IAAI,EAAE,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC;aAChC,CAAC;YACF,OAAO,GAAG,CAAC;QACb,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streams.d.ts","sourceRoot":"","sources":["../../src/sdk/types/streams.ts"],"names":[],"mappings":"AAIA,wBAAgB,gBAAgB,CAAC,CAAC,GAAG,UAAU,EAC7C,GAAG,EAAE,OAAO,GACX,GAAG,IAAI,cAAc,CAAC,CAAC,CAAC,CAc1B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.isReadableStream = void 0;
|
|
7
|
+
function isReadableStream(val) {
|
|
8
|
+
if (typeof val !== "object" || val === null) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
// Check for the presence of methods specific to ReadableStream
|
|
12
|
+
const stream = val;
|
|
13
|
+
// ReadableStream has methods like getReader, cancel, and tee
|
|
14
|
+
return (typeof stream.getReader === "function" &&
|
|
15
|
+
typeof stream.cancel === "function" &&
|
|
16
|
+
typeof stream.tee === "function");
|
|
17
|
+
}
|
|
18
|
+
exports.isReadableStream = isReadableStream;
|
|
19
|
+
//# sourceMappingURL=streams.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streams.js","sourceRoot":"","sources":["../../src/sdk/types/streams.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,SAAgB,gBAAgB,CAC9B,GAAY;IAEZ,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QAC5C,OAAO,KAAK,CAAC;IACf,CAAC;IAED,+DAA+D;IAC/D,MAAM,MAAM,GAAG,GAAiC,CAAC;IAEjD,6DAA6D;IAC7D,OAAO,CACL,OAAO,MAAM,CAAC,SAAS,KAAK,UAAU;QACtC,OAAO,MAAM,CAAC,MAAM,KAAK,UAAU;QACnC,OAAO,MAAM,CAAC,GAAG,KAAK,UAAU,CACjC,CAAC;AACJ,CAAC;AAhBD,4CAgBC"}
|
package/sdk/user.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 User extends ClientSDK {
|
|
5
|
-
private readonly options$;
|
|
6
|
-
constructor(options?: SDKOptions);
|
|
7
4
|
/**
|
|
8
5
|
* Get user information
|
|
9
6
|
*
|
package/sdk/user.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../src/sdk/user.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../src/sdk/user.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAG3D,qBAAa,IAAK,SAAQ,SAAS;IAC/B;;;;;OAKG;IACG,WAAW,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,mBAAmB,CAAC;CAGvF"}
|
package/sdk/user.js
CHANGED
|
@@ -2,57 +2,12 @@
|
|
|
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.User = void 0;
|
|
30
|
-
const
|
|
31
|
-
const config_js_1 = require("../lib/config.js");
|
|
32
|
-
const http_js_1 = require("../lib/http.js");
|
|
7
|
+
const userGetUserSelf_js_1 = require("../funcs/userGetUserSelf.js");
|
|
33
8
|
const sdks_js_1 = require("../lib/sdks.js");
|
|
34
|
-
const
|
|
9
|
+
const fp_js_1 = require("./types/fp.js");
|
|
35
10
|
class User extends sdks_js_1.ClientSDK {
|
|
36
|
-
constructor(options = {}) {
|
|
37
|
-
const opt = options;
|
|
38
|
-
let hooks;
|
|
39
|
-
if (typeof opt === "object" &&
|
|
40
|
-
opt != null &&
|
|
41
|
-
"hooks" in opt &&
|
|
42
|
-
opt.hooks instanceof hooks_js_1.SDKHooks) {
|
|
43
|
-
hooks = opt.hooks;
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
hooks = new hooks_js_1.SDKHooks();
|
|
47
|
-
}
|
|
48
|
-
super({
|
|
49
|
-
client: options.httpClient || new http_js_1.HTTPClient(),
|
|
50
|
-
baseURL: (0, config_js_1.serverURLFromOptions)(options),
|
|
51
|
-
hooks,
|
|
52
|
-
});
|
|
53
|
-
this.options$ = { ...options, hooks };
|
|
54
|
-
void this.options$;
|
|
55
|
-
}
|
|
56
11
|
/**
|
|
57
12
|
* Get user information
|
|
58
13
|
*
|
|
@@ -60,52 +15,7 @@ class User extends sdks_js_1.ClientSDK {
|
|
|
60
15
|
* This endpoint will return your user information such as your user id, username, token renewal date and current amounts of the following: subscription tokens, gpt (prompt generation) tokens, and model training tokens
|
|
61
16
|
*/
|
|
62
17
|
async getUserSelf(options) {
|
|
63
|
-
|
|
64
|
-
const path$ = this.templateURLComponent("/me")();
|
|
65
|
-
const query$ = "";
|
|
66
|
-
const headers$ = new Headers({
|
|
67
|
-
Accept: "application/json",
|
|
68
|
-
});
|
|
69
|
-
let security$;
|
|
70
|
-
if (typeof this.options$.bearerAuth === "function") {
|
|
71
|
-
security$ = { bearerAuth: await this.options$.bearerAuth() };
|
|
72
|
-
}
|
|
73
|
-
else if (this.options$.bearerAuth) {
|
|
74
|
-
security$ = { bearerAuth: this.options$.bearerAuth };
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
security$ = {};
|
|
78
|
-
}
|
|
79
|
-
const context = {
|
|
80
|
-
operationID: "getUserSelf",
|
|
81
|
-
oAuth2Scopes: [],
|
|
82
|
-
securitySource: this.options$.bearerAuth,
|
|
83
|
-
};
|
|
84
|
-
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
85
|
-
const request$ = this.createRequest$(context, {
|
|
86
|
-
security: securitySettings$,
|
|
87
|
-
method: "GET",
|
|
88
|
-
path: path$,
|
|
89
|
-
headers: headers$,
|
|
90
|
-
query: query$,
|
|
91
|
-
timeoutMs: (options === null || options === void 0 ? void 0 : options.timeoutMs) || this.options$.timeoutMs || -1,
|
|
92
|
-
}, options);
|
|
93
|
-
const response = await this.do$(request$, {
|
|
94
|
-
context,
|
|
95
|
-
errorCodes: [],
|
|
96
|
-
retryConfig: (options === null || options === void 0 ? void 0 : options.retries) || this.options$.retryConfig,
|
|
97
|
-
retryCodes: (options === null || options === void 0 ? void 0 : options.retryCodes) || ["429", "500", "502", "503", "504"],
|
|
98
|
-
});
|
|
99
|
-
const responseFields$ = {
|
|
100
|
-
ContentType: (_a = response.headers.get("content-type")) !== null && _a !== void 0 ? _a : "application/octet-stream",
|
|
101
|
-
StatusCode: response.status,
|
|
102
|
-
RawResponse: response,
|
|
103
|
-
Headers: {},
|
|
104
|
-
};
|
|
105
|
-
const [result$] = await this.matcher()
|
|
106
|
-
.json(200, operations.GetUserSelfResponse$inboundSchema, { key: "object" })
|
|
107
|
-
.match(response, { extraFields: responseFields$ });
|
|
108
|
-
return result$;
|
|
18
|
+
return (0, fp_js_1.unwrapAsync)((0, userGetUserSelf_js_1.userGetUserSelf)(this, options));
|
|
109
19
|
}
|
|
110
20
|
}
|
|
111
21
|
exports.User = User;
|
package/sdk/user.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","sourceRoot":"","sources":["../src/sdk/user.ts"],"names":[],"mappings":";AAAA;;GAEG
|
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../src/sdk/user.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,oEAA8D;AAC9D,4CAA2D;AAE3D,yCAA4C;AAE5C,MAAa,IAAK,SAAQ,mBAAS;IAC/B;;;;;OAKG;IACH,KAAK,CAAC,WAAW,CAAC,OAAwB;QACtC,OAAO,IAAA,mBAAW,EAAC,IAAA,oCAAe,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IACvD,CAAC;CACJ;AAVD,oBAUC"}
|
package/sdk/variation.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 Variation extends ClientSDK {
|
|
5
|
-
private readonly options$;
|
|
6
|
-
constructor(options?: SDKOptions);
|
|
7
4
|
/**
|
|
8
5
|
* Create using Universal Upscaler
|
|
9
6
|
*
|
package/sdk/variation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variation.d.ts","sourceRoot":"","sources":["../src/sdk/variation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"variation.d.ts","sourceRoot":"","sources":["../src/sdk/variation.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAG3D,qBAAa,SAAU,SAAQ,SAAS;IACpC;;;;;OAKG;IACG,0BAA0B,CAC5B,OAAO,EAAE,UAAU,CAAC,qCAAqC,EACzD,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,UAAU,CAAC,kCAAkC,CAAC;IAIzD;;;;;OAKG;IACG,mBAAmB,CACrB,OAAO,EAAE,UAAU,CAAC,8BAA8B,EAClD,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,UAAU,CAAC,2BAA2B,CAAC;IAIlD;;;;;OAKG;IACG,qBAAqB,CACvB,OAAO,CAAC,EAAE,UAAU,CAAC,gCAAgC,GAAG,SAAS,EACjE,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,UAAU,CAAC,6BAA6B,CAAC;IAIpD;;;;;OAKG;IACG,sBAAsB,CACxB,OAAO,CAAC,EAAE,UAAU,CAAC,iCAAiC,GAAG,SAAS,EAClE,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,UAAU,CAAC,8BAA8B,CAAC;IAIrD;;;;;OAKG;IACG,gBAAgB,CAClB,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,UAAU,CAAC,wBAAwB,CAAC;CAGlD"}
|
package/sdk/variation.js
CHANGED
|
@@ -2,59 +2,16 @@
|
|
|
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.Variation = void 0;
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const
|
|
7
|
+
const variationCreateUniversalUpscalerJob_js_1 = require("../funcs/variationCreateUniversalUpscalerJob.js");
|
|
8
|
+
const variationCreateVariationNoBG_js_1 = require("../funcs/variationCreateVariationNoBG.js");
|
|
9
|
+
const variationCreateVariationUnzoom_js_1 = require("../funcs/variationCreateVariationUnzoom.js");
|
|
10
|
+
const variationCreateVariationUpscale_js_1 = require("../funcs/variationCreateVariationUpscale.js");
|
|
11
|
+
const variationGetVariationById_js_1 = require("../funcs/variationGetVariationById.js");
|
|
35
12
|
const sdks_js_1 = require("../lib/sdks.js");
|
|
36
|
-
const
|
|
13
|
+
const fp_js_1 = require("./types/fp.js");
|
|
37
14
|
class Variation 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
15
|
/**
|
|
59
16
|
* Create using Universal Upscaler
|
|
60
17
|
*
|
|
@@ -62,59 +19,7 @@ class Variation extends sdks_js_1.ClientSDK {
|
|
|
62
19
|
* This endpoint will create a high resolution image using Universal Upscaler
|
|
63
20
|
*/
|
|
64
21
|
async createUniversalUpscalerJob(request, options) {
|
|
65
|
-
|
|
66
|
-
const input$ = request;
|
|
67
|
-
const payload$ = schemas$.parse(input$, (value$) => operations.CreateUniversalUpscalerJobRequestBody$outboundSchema.parse(value$), "Input validation failed");
|
|
68
|
-
const body$ = (0, encodings_js_1.encodeJSON)("body", payload$, { explode: true });
|
|
69
|
-
const path$ = this.templateURLComponent("/variations/universal-upscaler")();
|
|
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: "CreateUniversalUpscalerJob",
|
|
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.CreateUniversalUpscalerJobResponse$inboundSchema, {
|
|
114
|
-
key: "object",
|
|
115
|
-
})
|
|
116
|
-
.match(response, { extraFields: responseFields$ });
|
|
117
|
-
return result$;
|
|
22
|
+
return (0, fp_js_1.unwrapAsync)((0, variationCreateUniversalUpscalerJob_js_1.variationCreateUniversalUpscalerJob)(this, request, options));
|
|
118
23
|
}
|
|
119
24
|
/**
|
|
120
25
|
* Create no background
|
|
@@ -123,57 +28,7 @@ class Variation extends sdks_js_1.ClientSDK {
|
|
|
123
28
|
* This endpoint will create a no background variation of the provided image ID
|
|
124
29
|
*/
|
|
125
30
|
async createVariationNoBG(request, options) {
|
|
126
|
-
|
|
127
|
-
const input$ = request;
|
|
128
|
-
const payload$ = schemas$.parse(input$, (value$) => operations.CreateVariationNoBGRequestBody$outboundSchema.parse(value$), "Input validation failed");
|
|
129
|
-
const body$ = (0, encodings_js_1.encodeJSON)("body", payload$, { explode: true });
|
|
130
|
-
const path$ = this.templateURLComponent("/variations/nobg")();
|
|
131
|
-
const query$ = "";
|
|
132
|
-
const headers$ = new Headers({
|
|
133
|
-
"Content-Type": "application/json",
|
|
134
|
-
Accept: "application/json",
|
|
135
|
-
});
|
|
136
|
-
let security$;
|
|
137
|
-
if (typeof this.options$.bearerAuth === "function") {
|
|
138
|
-
security$ = { bearerAuth: await this.options$.bearerAuth() };
|
|
139
|
-
}
|
|
140
|
-
else if (this.options$.bearerAuth) {
|
|
141
|
-
security$ = { bearerAuth: this.options$.bearerAuth };
|
|
142
|
-
}
|
|
143
|
-
else {
|
|
144
|
-
security$ = {};
|
|
145
|
-
}
|
|
146
|
-
const context = {
|
|
147
|
-
operationID: "createVariationNoBG",
|
|
148
|
-
oAuth2Scopes: [],
|
|
149
|
-
securitySource: this.options$.bearerAuth,
|
|
150
|
-
};
|
|
151
|
-
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
152
|
-
const request$ = this.createRequest$(context, {
|
|
153
|
-
security: securitySettings$,
|
|
154
|
-
method: "POST",
|
|
155
|
-
path: path$,
|
|
156
|
-
headers: headers$,
|
|
157
|
-
query: query$,
|
|
158
|
-
body: body$,
|
|
159
|
-
timeoutMs: (options === null || options === void 0 ? void 0 : options.timeoutMs) || this.options$.timeoutMs || -1,
|
|
160
|
-
}, options);
|
|
161
|
-
const response = await this.do$(request$, {
|
|
162
|
-
context,
|
|
163
|
-
errorCodes: [],
|
|
164
|
-
retryConfig: (options === null || options === void 0 ? void 0 : options.retries) || this.options$.retryConfig,
|
|
165
|
-
retryCodes: (options === null || options === void 0 ? void 0 : options.retryCodes) || ["429", "500", "502", "503", "504"],
|
|
166
|
-
});
|
|
167
|
-
const responseFields$ = {
|
|
168
|
-
ContentType: (_a = response.headers.get("content-type")) !== null && _a !== void 0 ? _a : "application/octet-stream",
|
|
169
|
-
StatusCode: response.status,
|
|
170
|
-
RawResponse: response,
|
|
171
|
-
Headers: {},
|
|
172
|
-
};
|
|
173
|
-
const [result$] = await this.matcher()
|
|
174
|
-
.json(200, operations.CreateVariationNoBGResponse$inboundSchema, { key: "object" })
|
|
175
|
-
.match(response, { extraFields: responseFields$ });
|
|
176
|
-
return result$;
|
|
31
|
+
return (0, fp_js_1.unwrapAsync)((0, variationCreateVariationNoBG_js_1.variationCreateVariationNoBG)(this, request, options));
|
|
177
32
|
}
|
|
178
33
|
/**
|
|
179
34
|
* Create unzoom
|
|
@@ -182,57 +37,7 @@ class Variation extends sdks_js_1.ClientSDK {
|
|
|
182
37
|
* This endpoint will create an unzoom variation for the provided image ID
|
|
183
38
|
*/
|
|
184
39
|
async createVariationUnzoom(request, options) {
|
|
185
|
-
|
|
186
|
-
const input$ = request;
|
|
187
|
-
const payload$ = schemas$.parse(input$, (value$) => operations.CreateVariationUnzoomRequestBody$outboundSchema.optional().parse(value$), "Input validation failed");
|
|
188
|
-
const body$ = payload$ === undefined ? null : (0, encodings_js_1.encodeJSON)("body", payload$, { explode: true });
|
|
189
|
-
const path$ = this.templateURLComponent("/variations/unzoom")();
|
|
190
|
-
const query$ = "";
|
|
191
|
-
const headers$ = new Headers({
|
|
192
|
-
"Content-Type": "application/json",
|
|
193
|
-
Accept: "application/json",
|
|
194
|
-
});
|
|
195
|
-
let security$;
|
|
196
|
-
if (typeof this.options$.bearerAuth === "function") {
|
|
197
|
-
security$ = { bearerAuth: await this.options$.bearerAuth() };
|
|
198
|
-
}
|
|
199
|
-
else if (this.options$.bearerAuth) {
|
|
200
|
-
security$ = { bearerAuth: this.options$.bearerAuth };
|
|
201
|
-
}
|
|
202
|
-
else {
|
|
203
|
-
security$ = {};
|
|
204
|
-
}
|
|
205
|
-
const context = {
|
|
206
|
-
operationID: "createVariationUnzoom",
|
|
207
|
-
oAuth2Scopes: [],
|
|
208
|
-
securitySource: this.options$.bearerAuth,
|
|
209
|
-
};
|
|
210
|
-
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
211
|
-
const request$ = this.createRequest$(context, {
|
|
212
|
-
security: securitySettings$,
|
|
213
|
-
method: "POST",
|
|
214
|
-
path: path$,
|
|
215
|
-
headers: headers$,
|
|
216
|
-
query: query$,
|
|
217
|
-
body: body$,
|
|
218
|
-
timeoutMs: (options === null || options === void 0 ? void 0 : options.timeoutMs) || this.options$.timeoutMs || -1,
|
|
219
|
-
}, options);
|
|
220
|
-
const response = await this.do$(request$, {
|
|
221
|
-
context,
|
|
222
|
-
errorCodes: [],
|
|
223
|
-
retryConfig: (options === null || options === void 0 ? void 0 : options.retries) || this.options$.retryConfig,
|
|
224
|
-
retryCodes: (options === null || options === void 0 ? void 0 : options.retryCodes) || ["429", "500", "502", "503", "504"],
|
|
225
|
-
});
|
|
226
|
-
const responseFields$ = {
|
|
227
|
-
ContentType: (_a = response.headers.get("content-type")) !== null && _a !== void 0 ? _a : "application/octet-stream",
|
|
228
|
-
StatusCode: response.status,
|
|
229
|
-
RawResponse: response,
|
|
230
|
-
Headers: {},
|
|
231
|
-
};
|
|
232
|
-
const [result$] = await this.matcher()
|
|
233
|
-
.json(200, operations.CreateVariationUnzoomResponse$inboundSchema, { key: "object" })
|
|
234
|
-
.match(response, { extraFields: responseFields$ });
|
|
235
|
-
return result$;
|
|
40
|
+
return (0, fp_js_1.unwrapAsync)((0, variationCreateVariationUnzoom_js_1.variationCreateVariationUnzoom)(this, request, options));
|
|
236
41
|
}
|
|
237
42
|
/**
|
|
238
43
|
* Create upscale
|
|
@@ -241,57 +46,7 @@ class Variation extends sdks_js_1.ClientSDK {
|
|
|
241
46
|
* This endpoint will create an upscale for the provided image ID
|
|
242
47
|
*/
|
|
243
48
|
async createVariationUpscale(request, options) {
|
|
244
|
-
|
|
245
|
-
const input$ = request;
|
|
246
|
-
const payload$ = schemas$.parse(input$, (value$) => operations.CreateVariationUpscaleRequestBody$outboundSchema.optional().parse(value$), "Input validation failed");
|
|
247
|
-
const body$ = payload$ === undefined ? null : (0, encodings_js_1.encodeJSON)("body", payload$, { explode: true });
|
|
248
|
-
const path$ = this.templateURLComponent("/variations/upscale")();
|
|
249
|
-
const query$ = "";
|
|
250
|
-
const headers$ = new Headers({
|
|
251
|
-
"Content-Type": "application/json",
|
|
252
|
-
Accept: "application/json",
|
|
253
|
-
});
|
|
254
|
-
let security$;
|
|
255
|
-
if (typeof this.options$.bearerAuth === "function") {
|
|
256
|
-
security$ = { bearerAuth: await this.options$.bearerAuth() };
|
|
257
|
-
}
|
|
258
|
-
else if (this.options$.bearerAuth) {
|
|
259
|
-
security$ = { bearerAuth: this.options$.bearerAuth };
|
|
260
|
-
}
|
|
261
|
-
else {
|
|
262
|
-
security$ = {};
|
|
263
|
-
}
|
|
264
|
-
const context = {
|
|
265
|
-
operationID: "createVariationUpscale",
|
|
266
|
-
oAuth2Scopes: [],
|
|
267
|
-
securitySource: this.options$.bearerAuth,
|
|
268
|
-
};
|
|
269
|
-
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
270
|
-
const request$ = this.createRequest$(context, {
|
|
271
|
-
security: securitySettings$,
|
|
272
|
-
method: "POST",
|
|
273
|
-
path: path$,
|
|
274
|
-
headers: headers$,
|
|
275
|
-
query: query$,
|
|
276
|
-
body: body$,
|
|
277
|
-
timeoutMs: (options === null || options === void 0 ? void 0 : options.timeoutMs) || this.options$.timeoutMs || -1,
|
|
278
|
-
}, options);
|
|
279
|
-
const response = await this.do$(request$, {
|
|
280
|
-
context,
|
|
281
|
-
errorCodes: [],
|
|
282
|
-
retryConfig: (options === null || options === void 0 ? void 0 : options.retries) || this.options$.retryConfig,
|
|
283
|
-
retryCodes: (options === null || options === void 0 ? void 0 : options.retryCodes) || ["429", "500", "502", "503", "504"],
|
|
284
|
-
});
|
|
285
|
-
const responseFields$ = {
|
|
286
|
-
ContentType: (_a = response.headers.get("content-type")) !== null && _a !== void 0 ? _a : "application/octet-stream",
|
|
287
|
-
StatusCode: response.status,
|
|
288
|
-
RawResponse: response,
|
|
289
|
-
Headers: {},
|
|
290
|
-
};
|
|
291
|
-
const [result$] = await this.matcher()
|
|
292
|
-
.json(200, operations.CreateVariationUpscaleResponse$inboundSchema, { key: "object" })
|
|
293
|
-
.match(response, { extraFields: responseFields$ });
|
|
294
|
-
return result$;
|
|
49
|
+
return (0, fp_js_1.unwrapAsync)((0, variationCreateVariationUpscale_js_1.variationCreateVariationUpscale)(this, request, options));
|
|
295
50
|
}
|
|
296
51
|
/**
|
|
297
52
|
* Get variation by ID
|
|
@@ -300,61 +55,7 @@ class Variation extends sdks_js_1.ClientSDK {
|
|
|
300
55
|
* This endpoint will get the variation by ID
|
|
301
56
|
*/
|
|
302
57
|
async getVariationById(id, options) {
|
|
303
|
-
|
|
304
|
-
const input$ = {
|
|
305
|
-
id: id,
|
|
306
|
-
};
|
|
307
|
-
const payload$ = schemas$.parse(input$, (value$) => operations.GetVariationByIdRequest$outboundSchema.parse(value$), "Input validation failed");
|
|
308
|
-
const body$ = null;
|
|
309
|
-
const pathParams$ = {
|
|
310
|
-
id: (0, encodings_js_1.encodeSimple)("id", payload$.id, { explode: false, charEncoding: "percent" }),
|
|
311
|
-
};
|
|
312
|
-
const path$ = this.templateURLComponent("/variations/{id}")(pathParams$);
|
|
313
|
-
const query$ = "";
|
|
314
|
-
const headers$ = new Headers({
|
|
315
|
-
Accept: "application/json",
|
|
316
|
-
});
|
|
317
|
-
let security$;
|
|
318
|
-
if (typeof this.options$.bearerAuth === "function") {
|
|
319
|
-
security$ = { bearerAuth: await this.options$.bearerAuth() };
|
|
320
|
-
}
|
|
321
|
-
else if (this.options$.bearerAuth) {
|
|
322
|
-
security$ = { bearerAuth: this.options$.bearerAuth };
|
|
323
|
-
}
|
|
324
|
-
else {
|
|
325
|
-
security$ = {};
|
|
326
|
-
}
|
|
327
|
-
const context = {
|
|
328
|
-
operationID: "getVariationById",
|
|
329
|
-
oAuth2Scopes: [],
|
|
330
|
-
securitySource: this.options$.bearerAuth,
|
|
331
|
-
};
|
|
332
|
-
const securitySettings$ = this.resolveGlobalSecurity(security$);
|
|
333
|
-
const request$ = this.createRequest$(context, {
|
|
334
|
-
security: securitySettings$,
|
|
335
|
-
method: "GET",
|
|
336
|
-
path: path$,
|
|
337
|
-
headers: headers$,
|
|
338
|
-
query: query$,
|
|
339
|
-
body: body$,
|
|
340
|
-
timeoutMs: (options === null || options === void 0 ? void 0 : options.timeoutMs) || this.options$.timeoutMs || -1,
|
|
341
|
-
}, options);
|
|
342
|
-
const response = await this.do$(request$, {
|
|
343
|
-
context,
|
|
344
|
-
errorCodes: [],
|
|
345
|
-
retryConfig: (options === null || options === void 0 ? void 0 : options.retries) || this.options$.retryConfig,
|
|
346
|
-
retryCodes: (options === null || options === void 0 ? void 0 : options.retryCodes) || ["429", "500", "502", "503", "504"],
|
|
347
|
-
});
|
|
348
|
-
const responseFields$ = {
|
|
349
|
-
ContentType: (_a = response.headers.get("content-type")) !== null && _a !== void 0 ? _a : "application/octet-stream",
|
|
350
|
-
StatusCode: response.status,
|
|
351
|
-
RawResponse: response,
|
|
352
|
-
Headers: {},
|
|
353
|
-
};
|
|
354
|
-
const [result$] = await this.matcher()
|
|
355
|
-
.json(200, operations.GetVariationByIdResponse$inboundSchema, { key: "object" })
|
|
356
|
-
.match(response, { extraFields: responseFields$ });
|
|
357
|
-
return result$;
|
|
58
|
+
return (0, fp_js_1.unwrapAsync)((0, variationGetVariationById_js_1.variationGetVariationById)(this, id, options));
|
|
358
59
|
}
|
|
359
60
|
}
|
|
360
61
|
exports.Variation = Variation;
|