@leonardo-ai/sdk 4.21.1 → 4.21.3
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 +9 -7
- package/funcs/blueprintsExecuteBlueprint.d.ts.map +1 -1
- package/funcs/blueprintsExecuteBlueprint.js +2 -1
- package/funcs/blueprintsExecuteBlueprint.js.map +1 -1
- package/funcs/blueprintsGetBlueprintById.d.ts.map +1 -1
- package/funcs/blueprintsGetBlueprintById.js +2 -1
- package/funcs/blueprintsGetBlueprintById.js.map +1 -1
- package/funcs/blueprintsGetBlueprintExecution.d.ts.map +1 -1
- package/funcs/blueprintsGetBlueprintExecution.js +2 -1
- package/funcs/blueprintsGetBlueprintExecution.js.map +1 -1
- package/funcs/blueprintsGetBlueprintExecutionGenerations.d.ts.map +1 -1
- package/funcs/blueprintsGetBlueprintExecutionGenerations.js +2 -1
- package/funcs/blueprintsGetBlueprintExecutionGenerations.js.map +1 -1
- package/funcs/blueprintsGetBlueprintVersionsByBlueprintId.d.ts.map +1 -1
- package/funcs/blueprintsGetBlueprintVersionsByBlueprintId.js +2 -1
- package/funcs/blueprintsGetBlueprintVersionsByBlueprintId.js.map +1 -1
- package/funcs/datasetCreateDataset.d.ts.map +1 -1
- package/funcs/datasetCreateDataset.js +2 -1
- package/funcs/datasetCreateDataset.js.map +1 -1
- package/funcs/datasetDeleteDatasetById.d.ts.map +1 -1
- package/funcs/datasetDeleteDatasetById.js +2 -1
- package/funcs/datasetDeleteDatasetById.js.map +1 -1
- package/funcs/datasetGetDatasetById.d.ts.map +1 -1
- package/funcs/datasetGetDatasetById.js +2 -1
- package/funcs/datasetGetDatasetById.js.map +1 -1
- package/funcs/datasetUploadDatasetImage.d.ts.map +1 -1
- package/funcs/datasetUploadDatasetImage.js +2 -1
- package/funcs/datasetUploadDatasetImage.js.map +1 -1
- package/funcs/datasetUploadDatasetImageFromGen.d.ts.map +1 -1
- package/funcs/datasetUploadDatasetImageFromGen.js +2 -1
- package/funcs/datasetUploadDatasetImageFromGen.js.map +1 -1
- package/funcs/elementsCreateElement.d.ts.map +1 -1
- package/funcs/elementsCreateElement.js +2 -1
- package/funcs/elementsCreateElement.js.map +1 -1
- package/funcs/elementsDeleteElementById.d.ts.map +1 -1
- package/funcs/elementsDeleteElementById.js +2 -1
- package/funcs/elementsDeleteElementById.js.map +1 -1
- package/funcs/elementsGetCustomElementsByUserId.d.ts.map +1 -1
- package/funcs/elementsGetCustomElementsByUserId.js +2 -1
- package/funcs/elementsGetCustomElementsByUserId.js.map +1 -1
- package/funcs/elementsGetElementById.d.ts.map +1 -1
- package/funcs/elementsGetElementById.js +2 -1
- package/funcs/elementsGetElementById.js.map +1 -1
- package/funcs/elementsListElements.d.ts.map +1 -1
- package/funcs/elementsListElements.js +2 -1
- package/funcs/elementsListElements.js.map +1 -1
- package/funcs/imageCreateGeneration.d.ts.map +1 -1
- package/funcs/imageCreateGeneration.js +2 -1
- package/funcs/imageCreateGeneration.js.map +1 -1
- package/funcs/imageDeleteGenerationById.d.ts.map +1 -1
- package/funcs/imageDeleteGenerationById.js +2 -1
- package/funcs/imageDeleteGenerationById.js.map +1 -1
- package/funcs/imageGetGenerationById.d.ts.map +1 -1
- package/funcs/imageGetGenerationById.js +2 -1
- package/funcs/imageGetGenerationById.js.map +1 -1
- package/funcs/imageGetGenerationsByUserId.d.ts.map +1 -1
- package/funcs/imageGetGenerationsByUserId.js +2 -1
- package/funcs/imageGetGenerationsByUserId.js.map +1 -1
- package/funcs/initImagesDeleteInitImageById.d.ts.map +1 -1
- package/funcs/initImagesDeleteInitImageById.js +2 -1
- package/funcs/initImagesDeleteInitImageById.js.map +1 -1
- package/funcs/initImagesGetInitImageById.d.ts.map +1 -1
- package/funcs/initImagesGetInitImageById.js +2 -1
- package/funcs/initImagesGetInitImageById.js.map +1 -1
- package/funcs/initImagesUploadCanvasInitImage.d.ts.map +1 -1
- package/funcs/initImagesUploadCanvasInitImage.js +2 -1
- package/funcs/initImagesUploadCanvasInitImage.js.map +1 -1
- package/funcs/initImagesUploadInitImage.d.ts.map +1 -1
- package/funcs/initImagesUploadInitImage.js +2 -1
- package/funcs/initImagesUploadInitImage.js.map +1 -1
- package/funcs/{textureCreateTextureGeneration.d.ts → mediaDeleteUploadedMediaById.d.ts} +4 -4
- package/funcs/mediaDeleteUploadedMediaById.d.ts.map +1 -0
- package/funcs/{textureDeleteTextureGenerationById.js → mediaDeleteUploadedMediaById.js} +14 -15
- package/funcs/mediaDeleteUploadedMediaById.js.map +1 -0
- package/funcs/{textureDeleteTextureGenerationById.d.ts → mediaGetUploadedMediaById.d.ts} +4 -4
- package/funcs/mediaGetUploadedMediaById.d.ts.map +1 -0
- package/funcs/mediaGetUploadedMediaById.js +132 -0
- package/funcs/mediaGetUploadedMediaById.js.map +1 -0
- package/funcs/mediaUploadMedia.d.ts +17 -0
- package/funcs/mediaUploadMedia.d.ts.map +1 -0
- package/funcs/{textureCreateTextureGeneration.js → mediaUploadMedia.js} +12 -14
- package/funcs/mediaUploadMedia.js.map +1 -0
- package/funcs/modelsCreateModel.d.ts.map +1 -1
- package/funcs/modelsCreateModel.js +2 -1
- package/funcs/modelsCreateModel.js.map +1 -1
- package/funcs/modelsDeleteModelById.d.ts.map +1 -1
- package/funcs/modelsDeleteModelById.js +2 -1
- package/funcs/modelsDeleteModelById.js.map +1 -1
- package/funcs/modelsGetCustomModelsByUserId.d.ts.map +1 -1
- package/funcs/modelsGetCustomModelsByUserId.js +2 -1
- package/funcs/modelsGetCustomModelsByUserId.js.map +1 -1
- package/funcs/modelsGetModelById.d.ts.map +1 -1
- package/funcs/modelsGetModelById.js +2 -1
- package/funcs/modelsGetModelById.js.map +1 -1
- package/funcs/modelsListPlatformModels.d.ts.map +1 -1
- package/funcs/modelsListPlatformModels.js +2 -1
- package/funcs/modelsListPlatformModels.js.map +1 -1
- package/funcs/motionCreateImageToVideoGeneration.d.ts.map +1 -1
- package/funcs/motionCreateImageToVideoGeneration.js +2 -1
- package/funcs/motionCreateImageToVideoGeneration.js.map +1 -1
- package/funcs/motionCreateSVDMotionGeneration.d.ts.map +1 -1
- package/funcs/motionCreateSVDMotionGeneration.js +2 -1
- package/funcs/motionCreateSVDMotionGeneration.js.map +1 -1
- package/funcs/motionCreateTextToVideoGeneration.d.ts.map +1 -1
- package/funcs/motionCreateTextToVideoGeneration.js +2 -1
- package/funcs/motionCreateTextToVideoGeneration.js.map +1 -1
- package/funcs/motionCreateVideoUpscale.d.ts.map +1 -1
- package/funcs/motionCreateVideoUpscale.js +2 -1
- package/funcs/motionCreateVideoUpscale.js.map +1 -1
- package/funcs/pricingCalculatorPricingCalculator.d.ts.map +1 -1
- package/funcs/pricingCalculatorPricingCalculator.js +2 -1
- package/funcs/pricingCalculatorPricingCalculator.js.map +1 -1
- package/funcs/promptPromptImprove.d.ts.map +1 -1
- package/funcs/promptPromptImprove.js +2 -1
- package/funcs/promptPromptImprove.js.map +1 -1
- package/funcs/promptPromptRandom.d.ts.map +1 -1
- package/funcs/promptPromptRandom.js +2 -1
- package/funcs/promptPromptRandom.js.map +1 -1
- package/funcs/realtimeCanvasCreateLCMGeneration.d.ts.map +1 -1
- package/funcs/realtimeCanvasCreateLCMGeneration.js +2 -1
- package/funcs/realtimeCanvasCreateLCMGeneration.js.map +1 -1
- package/funcs/realtimeCanvasPerformAlchemyUpscaleLCM.d.ts.map +1 -1
- package/funcs/realtimeCanvasPerformAlchemyUpscaleLCM.js +2 -1
- package/funcs/realtimeCanvasPerformAlchemyUpscaleLCM.js.map +1 -1
- package/funcs/realtimeCanvasPerformInpaintingLCM.d.ts.map +1 -1
- package/funcs/realtimeCanvasPerformInpaintingLCM.js +2 -1
- package/funcs/realtimeCanvasPerformInpaintingLCM.js.map +1 -1
- package/funcs/realtimeCanvasPerformInstantRefine.d.ts.map +1 -1
- package/funcs/realtimeCanvasPerformInstantRefine.js +2 -1
- package/funcs/realtimeCanvasPerformInstantRefine.js.map +1 -1
- package/funcs/threeDModelAssetsDelete3DModelById.d.ts.map +1 -1
- package/funcs/threeDModelAssetsDelete3DModelById.js +2 -1
- package/funcs/threeDModelAssetsDelete3DModelById.js.map +1 -1
- package/funcs/threeDModelAssetsUploadModelAsset.d.ts.map +1 -1
- package/funcs/threeDModelAssetsUploadModelAsset.js +2 -1
- package/funcs/threeDModelAssetsUploadModelAsset.js.map +1 -1
- package/funcs/userGetUserSelf.d.ts.map +1 -1
- package/funcs/userGetUserSelf.js +2 -1
- package/funcs/userGetUserSelf.js.map +1 -1
- package/funcs/variationCreateUniversalUpscalerJob.d.ts.map +1 -1
- package/funcs/variationCreateUniversalUpscalerJob.js +2 -1
- package/funcs/variationCreateUniversalUpscalerJob.js.map +1 -1
- package/funcs/variationCreateVariationNoBG.d.ts.map +1 -1
- package/funcs/variationCreateVariationNoBG.js +2 -1
- package/funcs/variationCreateVariationNoBG.js.map +1 -1
- package/funcs/variationCreateVariationUnzoom.d.ts.map +1 -1
- package/funcs/variationCreateVariationUnzoom.js +2 -1
- package/funcs/variationCreateVariationUnzoom.js.map +1 -1
- package/funcs/variationCreateVariationUpscale.d.ts.map +1 -1
- package/funcs/variationCreateVariationUpscale.js +2 -1
- package/funcs/variationCreateVariationUpscale.js.map +1 -1
- package/funcs/variationGetMotionVariationById.d.ts.map +1 -1
- package/funcs/variationGetMotionVariationById.js +2 -1
- package/funcs/variationGetMotionVariationById.js.map +1 -1
- package/funcs/variationGetVariationById.d.ts.map +1 -1
- package/funcs/variationGetVariationById.js +2 -1
- package/funcs/variationGetVariationById.js.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/encodings.d.ts +1 -0
- package/lib/encodings.d.ts.map +1 -1
- package/lib/encodings.js +27 -5
- package/lib/encodings.js.map +1 -1
- package/lib/files.d.ts +13 -0
- package/lib/files.d.ts.map +1 -1
- package/lib/files.js +19 -0
- package/lib/files.js.map +1 -1
- package/lib/matchers.d.ts.map +1 -1
- package/lib/matchers.js +0 -1
- package/lib/matchers.js.map +1 -1
- package/lib/sdks.d.ts +1 -1
- package/lib/sdks.d.ts.map +1 -1
- package/lib/sdks.js +10 -8
- package/lib/sdks.js.map +1 -1
- package/lib/security.d.ts +1 -1
- package/lib/security.d.ts.map +1 -1
- package/lib/security.js +20 -10
- package/lib/security.js.map +1 -1
- package/lib/url.d.ts.map +1 -1
- package/lib/url.js +4 -2
- package/lib/url.js.map +1 -1
- package/package.json +1 -1
- package/sdk/media.d.ts +26 -0
- package/sdk/media.d.ts.map +1 -0
- package/sdk/media.js +42 -0
- package/sdk/media.js.map +1 -0
- package/sdk/models/operations/deleteuploadedmediabyid.d.ts +53 -0
- package/sdk/models/operations/deleteuploadedmediabyid.d.ts.map +1 -0
- package/sdk/models/operations/deleteuploadedmediabyid.js +89 -0
- package/sdk/models/operations/deleteuploadedmediabyid.js.map +1 -0
- package/sdk/models/operations/getuploadedmediabyid.d.ts +63 -0
- package/sdk/models/operations/getuploadedmediabyid.d.ts.map +1 -0
- package/sdk/models/operations/getuploadedmediabyid.js +103 -0
- package/sdk/models/operations/getuploadedmediabyid.js.map +1 -0
- package/sdk/models/operations/index.d.ts +3 -2
- package/sdk/models/operations/index.d.ts.map +1 -1
- package/sdk/models/operations/index.js +3 -2
- package/sdk/models/operations/index.js.map +1 -1
- package/sdk/models/operations/uploadmedia.d.ts +58 -0
- package/sdk/models/operations/uploadmedia.d.ts.map +1 -0
- package/sdk/models/operations/uploadmedia.js +87 -0
- package/sdk/models/operations/uploadmedia.js.map +1 -0
- package/sdk/sdk.d.ts +3 -3
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +4 -4
- package/sdk/sdk.js.map +1 -1
- package/src/funcs/blueprintsExecuteBlueprint.ts +3 -1
- package/src/funcs/blueprintsGetBlueprintById.ts +3 -2
- package/src/funcs/blueprintsGetBlueprintExecution.ts +3 -2
- package/src/funcs/blueprintsGetBlueprintExecutionGenerations.ts +3 -2
- package/src/funcs/blueprintsGetBlueprintVersionsByBlueprintId.ts +3 -2
- package/src/funcs/datasetCreateDataset.ts +3 -1
- package/src/funcs/datasetDeleteDatasetById.ts +3 -2
- package/src/funcs/datasetGetDatasetById.ts +3 -2
- package/src/funcs/datasetUploadDatasetImage.ts +3 -2
- package/src/funcs/datasetUploadDatasetImageFromGen.ts +3 -2
- package/src/funcs/elementsCreateElement.ts +3 -1
- package/src/funcs/elementsDeleteElementById.ts +3 -2
- package/src/funcs/elementsGetCustomElementsByUserId.ts +3 -2
- package/src/funcs/elementsGetElementById.ts +3 -2
- package/src/funcs/elementsListElements.ts +3 -1
- package/src/funcs/imageCreateGeneration.ts +3 -1
- package/src/funcs/imageDeleteGenerationById.ts +3 -2
- package/src/funcs/imageGetGenerationById.ts +3 -2
- package/src/funcs/imageGetGenerationsByUserId.ts +3 -2
- package/src/funcs/initImagesDeleteInitImageById.ts +3 -2
- package/src/funcs/initImagesGetInitImageById.ts +3 -2
- package/src/funcs/initImagesUploadCanvasInitImage.ts +3 -1
- package/src/funcs/initImagesUploadInitImage.ts +3 -1
- package/src/funcs/{textureDeleteTextureGenerationById.ts → mediaDeleteUploadedMediaById.ts} +16 -20
- package/src/funcs/mediaGetUploadedMediaById.ts +180 -0
- package/src/funcs/{textureCreateTextureGeneration.ts → mediaUploadMedia.ts} +16 -18
- package/src/funcs/modelsCreateModel.ts +3 -1
- package/src/funcs/modelsDeleteModelById.ts +3 -2
- package/src/funcs/modelsGetCustomModelsByUserId.ts +3 -2
- package/src/funcs/modelsGetModelById.ts +3 -2
- package/src/funcs/modelsListPlatformModels.ts +3 -1
- package/src/funcs/motionCreateImageToVideoGeneration.ts +3 -1
- package/src/funcs/motionCreateSVDMotionGeneration.ts +3 -1
- package/src/funcs/motionCreateTextToVideoGeneration.ts +3 -1
- package/src/funcs/motionCreateVideoUpscale.ts +3 -1
- package/src/funcs/pricingCalculatorPricingCalculator.ts +3 -1
- package/src/funcs/promptPromptImprove.ts +3 -1
- package/src/funcs/promptPromptRandom.ts +3 -1
- package/src/funcs/realtimeCanvasCreateLCMGeneration.ts +3 -1
- package/src/funcs/realtimeCanvasPerformAlchemyUpscaleLCM.ts +3 -1
- package/src/funcs/realtimeCanvasPerformInpaintingLCM.ts +3 -1
- package/src/funcs/realtimeCanvasPerformInstantRefine.ts +3 -1
- package/src/funcs/threeDModelAssetsDelete3DModelById.ts +3 -2
- package/src/funcs/threeDModelAssetsUploadModelAsset.ts +3 -1
- package/src/funcs/userGetUserSelf.ts +3 -1
- package/src/funcs/variationCreateUniversalUpscalerJob.ts +3 -1
- package/src/funcs/variationCreateVariationNoBG.ts +3 -1
- package/src/funcs/variationCreateVariationUnzoom.ts +3 -1
- package/src/funcs/variationCreateVariationUpscale.ts +3 -1
- package/src/funcs/variationGetMotionVariationById.ts +3 -2
- package/src/funcs/variationGetVariationById.ts +3 -2
- package/src/lib/config.ts +3 -3
- package/src/lib/encodings.ts +32 -4
- package/src/lib/files.ts +22 -0
- package/src/lib/matchers.ts +3 -2
- package/src/lib/sdks.ts +10 -11
- package/src/lib/security.ts +15 -4
- package/src/lib/url.ts +16 -14
- package/src/sdk/media.ts +63 -0
- package/src/sdk/models/operations/deleteuploadedmediabyid.ts +144 -0
- package/src/sdk/models/operations/getuploadedmediabyid.ts +167 -0
- package/src/sdk/models/operations/index.ts +3 -2
- package/src/sdk/models/operations/uploadmedia.ts +142 -0
- package/src/sdk/sdk.ts +6 -6
- package/.devcontainer/devcontainer.json +0 -45
- package/_speakeasy/.github/action-inputs-config.json +0 -53
- package/_speakeasy/.github/action-security-config.json +0 -88
- package/examples/package-lock.json +0 -610
- package/examples/package.json +0 -18
- package/funcs/textureCreateTextureGeneration.d.ts.map +0 -1
- package/funcs/textureCreateTextureGeneration.js.map +0 -1
- package/funcs/textureDeleteTextureGenerationById.d.ts.map +0 -1
- package/funcs/textureDeleteTextureGenerationById.js.map +0 -1
- package/sdk/models/operations/createtexturegeneration.d.ts +0 -81
- package/sdk/models/operations/createtexturegeneration.d.ts.map +0 -1
- package/sdk/models/operations/createtexturegeneration.js +0 -102
- package/sdk/models/operations/createtexturegeneration.js.map +0 -1
- package/sdk/models/operations/deletetexturegenerationbyid.d.ts +0 -77
- package/sdk/models/operations/deletetexturegenerationbyid.d.ts.map +0 -1
- package/sdk/models/operations/deletetexturegenerationbyid.js +0 -102
- package/sdk/models/operations/deletetexturegenerationbyid.js.map +0 -1
- package/sdk/texture.d.ts +0 -19
- package/sdk/texture.d.ts.map +0 -1
- package/sdk/texture.js +0 -32
- package/sdk/texture.js.map +0 -1
- package/src/sdk/models/operations/createtexturegeneration.ts +0 -184
- package/src/sdk/models/operations/deletetexturegenerationbyid.ts +0 -204
- package/src/sdk/texture.ts +0 -47
- package/tsconfig.json +0 -40
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { LeonardoCore } from "../core.js";
|
|
6
6
|
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -99,7 +100,6 @@ async function $do(
|
|
|
99
100
|
charEncoding: "percent",
|
|
100
101
|
}),
|
|
101
102
|
};
|
|
102
|
-
|
|
103
103
|
const path = pathToFunc("/datasets/{datasetId}/upload")(pathParams);
|
|
104
104
|
|
|
105
105
|
const headers = new Headers(compactMap({
|
|
@@ -143,7 +143,8 @@ async function $do(
|
|
|
143
143
|
|
|
144
144
|
const doResult = await client._do(req, {
|
|
145
145
|
context,
|
|
146
|
-
|
|
146
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
147
|
+
matchStatusCode({ status: statusCode } as Response, []),
|
|
147
148
|
retryConfig: context.retryConfig,
|
|
148
149
|
retryCodes: context.retryCodes,
|
|
149
150
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { LeonardoCore } from "../core.js";
|
|
6
6
|
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -100,7 +101,6 @@ async function $do(
|
|
|
100
101
|
charEncoding: "percent",
|
|
101
102
|
}),
|
|
102
103
|
};
|
|
103
|
-
|
|
104
104
|
const path = pathToFunc("/datasets/{datasetId}/upload/gen")(pathParams);
|
|
105
105
|
|
|
106
106
|
const headers = new Headers(compactMap({
|
|
@@ -144,7 +144,8 @@ async function $do(
|
|
|
144
144
|
|
|
145
145
|
const doResult = await client._do(req, {
|
|
146
146
|
context,
|
|
147
|
-
|
|
147
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
148
|
+
matchStatusCode({ status: statusCode } as Response, []),
|
|
148
149
|
retryConfig: context.retryConfig,
|
|
149
150
|
retryCodes: context.retryCodes,
|
|
150
151
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { LeonardoCore } from "../core.js";
|
|
6
6
|
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -128,7 +129,8 @@ async function $do(
|
|
|
128
129
|
|
|
129
130
|
const doResult = await client._do(req, {
|
|
130
131
|
context,
|
|
131
|
-
|
|
132
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
133
|
+
matchStatusCode({ status: statusCode } as Response, []),
|
|
132
134
|
retryConfig: context.retryConfig,
|
|
133
135
|
retryCodes: context.retryCodes,
|
|
134
136
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { LeonardoCore } from "../core.js";
|
|
6
6
|
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -95,7 +96,6 @@ async function $do(
|
|
|
95
96
|
charEncoding: "percent",
|
|
96
97
|
}),
|
|
97
98
|
};
|
|
98
|
-
|
|
99
99
|
const path = pathToFunc("/elements/{id}")(pathParams);
|
|
100
100
|
|
|
101
101
|
const headers = new Headers(compactMap({
|
|
@@ -138,7 +138,8 @@ async function $do(
|
|
|
138
138
|
|
|
139
139
|
const doResult = await client._do(req, {
|
|
140
140
|
context,
|
|
141
|
-
|
|
141
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
142
|
+
matchStatusCode({ status: statusCode } as Response, []),
|
|
142
143
|
retryConfig: context.retryConfig,
|
|
143
144
|
retryCodes: context.retryCodes,
|
|
144
145
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { LeonardoCore } from "../core.js";
|
|
6
6
|
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -96,7 +97,6 @@ async function $do(
|
|
|
96
97
|
charEncoding: "percent",
|
|
97
98
|
}),
|
|
98
99
|
};
|
|
99
|
-
|
|
100
100
|
const path = pathToFunc("/elements/user/{userId}")(pathParams);
|
|
101
101
|
|
|
102
102
|
const headers = new Headers(compactMap({
|
|
@@ -139,7 +139,8 @@ async function $do(
|
|
|
139
139
|
|
|
140
140
|
const doResult = await client._do(req, {
|
|
141
141
|
context,
|
|
142
|
-
|
|
142
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
143
|
+
matchStatusCode({ status: statusCode } as Response, []),
|
|
143
144
|
retryConfig: context.retryConfig,
|
|
144
145
|
retryCodes: context.retryCodes,
|
|
145
146
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { LeonardoCore } from "../core.js";
|
|
6
6
|
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -95,7 +96,6 @@ async function $do(
|
|
|
95
96
|
charEncoding: "percent",
|
|
96
97
|
}),
|
|
97
98
|
};
|
|
98
|
-
|
|
99
99
|
const path = pathToFunc("/elements/{id}")(pathParams);
|
|
100
100
|
|
|
101
101
|
const headers = new Headers(compactMap({
|
|
@@ -138,7 +138,8 @@ async function $do(
|
|
|
138
138
|
|
|
139
139
|
const doResult = await client._do(req, {
|
|
140
140
|
context,
|
|
141
|
-
|
|
141
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
142
|
+
matchStatusCode({ status: statusCode } as Response, []),
|
|
142
143
|
retryConfig: context.retryConfig,
|
|
143
144
|
retryCodes: context.retryCodes,
|
|
144
145
|
});
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { LeonardoCore } from "../core.js";
|
|
6
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
6
7
|
import * as M from "../lib/matchers.js";
|
|
7
8
|
import { compactMap } from "../lib/primitives.js";
|
|
8
9
|
import { RequestOptions } from "../lib/sdks.js";
|
|
@@ -110,7 +111,8 @@ async function $do(
|
|
|
110
111
|
|
|
111
112
|
const doResult = await client._do(req, {
|
|
112
113
|
context,
|
|
113
|
-
|
|
114
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
115
|
+
matchStatusCode({ status: statusCode } as Response, []),
|
|
114
116
|
retryConfig: context.retryConfig,
|
|
115
117
|
retryCodes: context.retryCodes,
|
|
116
118
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { LeonardoCore } from "../core.js";
|
|
6
6
|
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -129,7 +130,8 @@ async function $do(
|
|
|
129
130
|
|
|
130
131
|
const doResult = await client._do(req, {
|
|
131
132
|
context,
|
|
132
|
-
|
|
133
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
134
|
+
matchStatusCode({ status: statusCode } as Response, []),
|
|
133
135
|
retryConfig: context.retryConfig,
|
|
134
136
|
retryCodes: context.retryCodes,
|
|
135
137
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { LeonardoCore } from "../core.js";
|
|
6
6
|
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -96,7 +97,6 @@ async function $do(
|
|
|
96
97
|
charEncoding: "percent",
|
|
97
98
|
}),
|
|
98
99
|
};
|
|
99
|
-
|
|
100
100
|
const path = pathToFunc("/generations/{id}")(pathParams);
|
|
101
101
|
|
|
102
102
|
const headers = new Headers(compactMap({
|
|
@@ -139,7 +139,8 @@ async function $do(
|
|
|
139
139
|
|
|
140
140
|
const doResult = await client._do(req, {
|
|
141
141
|
context,
|
|
142
|
-
|
|
142
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
143
|
+
matchStatusCode({ status: statusCode } as Response, []),
|
|
143
144
|
retryConfig: context.retryConfig,
|
|
144
145
|
retryCodes: context.retryCodes,
|
|
145
146
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { LeonardoCore } from "../core.js";
|
|
6
6
|
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -95,7 +96,6 @@ async function $do(
|
|
|
95
96
|
charEncoding: "percent",
|
|
96
97
|
}),
|
|
97
98
|
};
|
|
98
|
-
|
|
99
99
|
const path = pathToFunc("/generations/{id}")(pathParams);
|
|
100
100
|
|
|
101
101
|
const headers = new Headers(compactMap({
|
|
@@ -138,7 +138,8 @@ async function $do(
|
|
|
138
138
|
|
|
139
139
|
const doResult = await client._do(req, {
|
|
140
140
|
context,
|
|
141
|
-
|
|
141
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
142
|
+
matchStatusCode({ status: statusCode } as Response, []),
|
|
142
143
|
retryConfig: context.retryConfig,
|
|
143
144
|
retryCodes: context.retryCodes,
|
|
144
145
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { LeonardoCore } from "../core.js";
|
|
6
6
|
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -104,7 +105,6 @@ async function $do(
|
|
|
104
105
|
charEncoding: "percent",
|
|
105
106
|
}),
|
|
106
107
|
};
|
|
107
|
-
|
|
108
108
|
const path = pathToFunc("/generations/user/{userId}")(pathParams);
|
|
109
109
|
|
|
110
110
|
const query = encodeFormQuery({
|
|
@@ -153,7 +153,8 @@ async function $do(
|
|
|
153
153
|
|
|
154
154
|
const doResult = await client._do(req, {
|
|
155
155
|
context,
|
|
156
|
-
|
|
156
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
157
|
+
matchStatusCode({ status: statusCode } as Response, []),
|
|
157
158
|
retryConfig: context.retryConfig,
|
|
158
159
|
retryCodes: context.retryCodes,
|
|
159
160
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { LeonardoCore } from "../core.js";
|
|
6
6
|
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -96,7 +97,6 @@ async function $do(
|
|
|
96
97
|
charEncoding: "percent",
|
|
97
98
|
}),
|
|
98
99
|
};
|
|
99
|
-
|
|
100
100
|
const path = pathToFunc("/init-image/{id}")(pathParams);
|
|
101
101
|
|
|
102
102
|
const headers = new Headers(compactMap({
|
|
@@ -139,7 +139,8 @@ async function $do(
|
|
|
139
139
|
|
|
140
140
|
const doResult = await client._do(req, {
|
|
141
141
|
context,
|
|
142
|
-
|
|
142
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
143
|
+
matchStatusCode({ status: statusCode } as Response, []),
|
|
143
144
|
retryConfig: context.retryConfig,
|
|
144
145
|
retryCodes: context.retryCodes,
|
|
145
146
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { LeonardoCore } from "../core.js";
|
|
6
6
|
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -95,7 +96,6 @@ async function $do(
|
|
|
95
96
|
charEncoding: "percent",
|
|
96
97
|
}),
|
|
97
98
|
};
|
|
98
|
-
|
|
99
99
|
const path = pathToFunc("/init-image/{id}")(pathParams);
|
|
100
100
|
|
|
101
101
|
const headers = new Headers(compactMap({
|
|
@@ -138,7 +138,8 @@ async function $do(
|
|
|
138
138
|
|
|
139
139
|
const doResult = await client._do(req, {
|
|
140
140
|
context,
|
|
141
|
-
|
|
141
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
142
|
+
matchStatusCode({ status: statusCode } as Response, []),
|
|
142
143
|
retryConfig: context.retryConfig,
|
|
143
144
|
retryCodes: context.retryCodes,
|
|
144
145
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { LeonardoCore } from "../core.js";
|
|
6
6
|
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -129,7 +130,8 @@ async function $do(
|
|
|
129
130
|
|
|
130
131
|
const doResult = await client._do(req, {
|
|
131
132
|
context,
|
|
132
|
-
|
|
133
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
134
|
+
matchStatusCode({ status: statusCode } as Response, []),
|
|
133
135
|
retryConfig: context.retryConfig,
|
|
134
136
|
retryCodes: context.retryCodes,
|
|
135
137
|
});
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { LeonardoCore } from "../core.js";
|
|
6
6
|
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -129,7 +130,8 @@ async function $do(
|
|
|
129
130
|
|
|
130
131
|
const doResult = await client._do(req, {
|
|
131
132
|
context,
|
|
132
|
-
|
|
133
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
134
|
+
matchStatusCode({ status: statusCode } as Response, []),
|
|
133
135
|
retryConfig: context.retryConfig,
|
|
134
136
|
retryCodes: context.retryCodes,
|
|
135
137
|
});
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { LeonardoCore } from "../core.js";
|
|
6
|
-
import {
|
|
6
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
9
10
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -25,19 +26,18 @@ import { APICall, APIPromise } from "../sdk/types/async.js";
|
|
|
25
26
|
import { Result } from "../sdk/types/fp.js";
|
|
26
27
|
|
|
27
28
|
/**
|
|
28
|
-
* Delete
|
|
29
|
+
* Delete uploaded media
|
|
29
30
|
*
|
|
30
31
|
* @remarks
|
|
31
|
-
* This endpoint deletes the
|
|
32
|
+
* This endpoint deletes an uploaded media record and removes the associated file from S3
|
|
32
33
|
*/
|
|
33
|
-
export function
|
|
34
|
+
export function mediaDeleteUploadedMediaById(
|
|
34
35
|
client: LeonardoCore,
|
|
35
36
|
id: string,
|
|
36
|
-
requestBody?: operations.DeleteTextureGenerationByIdRequestBody | undefined,
|
|
37
37
|
options?: RequestOptions,
|
|
38
38
|
): APIPromise<
|
|
39
39
|
Result<
|
|
40
|
-
operations.
|
|
40
|
+
operations.DeleteUploadedMediaByIdResponse,
|
|
41
41
|
| LeonardoError
|
|
42
42
|
| ResponseValidationError
|
|
43
43
|
| ConnectionError
|
|
@@ -51,7 +51,6 @@ export function textureDeleteTextureGenerationById(
|
|
|
51
51
|
return new APIPromise($do(
|
|
52
52
|
client,
|
|
53
53
|
id,
|
|
54
|
-
requestBody,
|
|
55
54
|
options,
|
|
56
55
|
));
|
|
57
56
|
}
|
|
@@ -59,12 +58,11 @@ export function textureDeleteTextureGenerationById(
|
|
|
59
58
|
async function $do(
|
|
60
59
|
client: LeonardoCore,
|
|
61
60
|
id: string,
|
|
62
|
-
requestBody?: operations.DeleteTextureGenerationByIdRequestBody | undefined,
|
|
63
61
|
options?: RequestOptions,
|
|
64
62
|
): Promise<
|
|
65
63
|
[
|
|
66
64
|
Result<
|
|
67
|
-
operations.
|
|
65
|
+
operations.DeleteUploadedMediaByIdResponse,
|
|
68
66
|
| LeonardoError
|
|
69
67
|
| ResponseValidationError
|
|
70
68
|
| ConnectionError
|
|
@@ -77,22 +75,21 @@ async function $do(
|
|
|
77
75
|
APICall,
|
|
78
76
|
]
|
|
79
77
|
> {
|
|
80
|
-
const input: operations.
|
|
78
|
+
const input: operations.DeleteUploadedMediaByIdRequest = {
|
|
81
79
|
id: id,
|
|
82
|
-
requestBody: requestBody,
|
|
83
80
|
};
|
|
84
81
|
|
|
85
82
|
const parsed = safeParse(
|
|
86
83
|
input,
|
|
87
84
|
(value) =>
|
|
88
|
-
operations.
|
|
85
|
+
operations.DeleteUploadedMediaByIdRequest$outboundSchema.parse(value),
|
|
89
86
|
"Input validation failed",
|
|
90
87
|
);
|
|
91
88
|
if (!parsed.ok) {
|
|
92
89
|
return [parsed, { status: "invalid" }];
|
|
93
90
|
}
|
|
94
91
|
const payload = parsed.value;
|
|
95
|
-
const body =
|
|
92
|
+
const body = null;
|
|
96
93
|
|
|
97
94
|
const pathParams = {
|
|
98
95
|
id: encodeSimple("id", payload.id, {
|
|
@@ -100,11 +97,9 @@ async function $do(
|
|
|
100
97
|
charEncoding: "percent",
|
|
101
98
|
}),
|
|
102
99
|
};
|
|
103
|
-
|
|
104
|
-
const path = pathToFunc("/generations-texture/{id}")(pathParams);
|
|
100
|
+
const path = pathToFunc("/media/{id}")(pathParams);
|
|
105
101
|
|
|
106
102
|
const headers = new Headers(compactMap({
|
|
107
|
-
"Content-Type": "application/json",
|
|
108
103
|
Accept: "application/json",
|
|
109
104
|
}));
|
|
110
105
|
|
|
@@ -115,7 +110,7 @@ async function $do(
|
|
|
115
110
|
const context = {
|
|
116
111
|
options: client._options,
|
|
117
112
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
118
|
-
operationID: "
|
|
113
|
+
operationID: "deleteUploadedMediaById",
|
|
119
114
|
oAuth2Scopes: null,
|
|
120
115
|
|
|
121
116
|
resolvedSecurity: requestSecurity,
|
|
@@ -144,7 +139,8 @@ async function $do(
|
|
|
144
139
|
|
|
145
140
|
const doResult = await client._do(req, {
|
|
146
141
|
context,
|
|
147
|
-
|
|
142
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
143
|
+
matchStatusCode({ status: statusCode } as Response, []),
|
|
148
144
|
retryConfig: context.retryConfig,
|
|
149
145
|
retryCodes: context.retryCodes,
|
|
150
146
|
});
|
|
@@ -162,7 +158,7 @@ async function $do(
|
|
|
162
158
|
};
|
|
163
159
|
|
|
164
160
|
const [result] = await M.match<
|
|
165
|
-
operations.
|
|
161
|
+
operations.DeleteUploadedMediaByIdResponse,
|
|
166
162
|
| LeonardoError
|
|
167
163
|
| ResponseValidationError
|
|
168
164
|
| ConnectionError
|
|
@@ -172,7 +168,7 @@ async function $do(
|
|
|
172
168
|
| UnexpectedClientError
|
|
173
169
|
| SDKValidationError
|
|
174
170
|
>(
|
|
175
|
-
M.json(200, operations.
|
|
171
|
+
M.json(200, operations.DeleteUploadedMediaByIdResponse$inboundSchema, {
|
|
176
172
|
key: "object",
|
|
177
173
|
}),
|
|
178
174
|
)(response, req, { extraFields: responseFields });
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { LeonardoCore } from "../core.js";
|
|
6
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../sdk/models/errors/httpclienterrors.js";
|
|
21
|
+
import { LeonardoError } from "../sdk/models/errors/leonardoerror.js";
|
|
22
|
+
import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js";
|
|
23
|
+
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
|
|
24
|
+
import * as operations from "../sdk/models/operations/index.js";
|
|
25
|
+
import { APICall, APIPromise } from "../sdk/types/async.js";
|
|
26
|
+
import { Result } from "../sdk/types/fp.js";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Get uploaded media
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* This endpoint returns details of an uploaded media record
|
|
33
|
+
*/
|
|
34
|
+
export function mediaGetUploadedMediaById(
|
|
35
|
+
client: LeonardoCore,
|
|
36
|
+
id: string,
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): APIPromise<
|
|
39
|
+
Result<
|
|
40
|
+
operations.GetUploadedMediaByIdResponse,
|
|
41
|
+
| LeonardoError
|
|
42
|
+
| ResponseValidationError
|
|
43
|
+
| ConnectionError
|
|
44
|
+
| RequestAbortedError
|
|
45
|
+
| RequestTimeoutError
|
|
46
|
+
| InvalidRequestError
|
|
47
|
+
| UnexpectedClientError
|
|
48
|
+
| SDKValidationError
|
|
49
|
+
>
|
|
50
|
+
> {
|
|
51
|
+
return new APIPromise($do(
|
|
52
|
+
client,
|
|
53
|
+
id,
|
|
54
|
+
options,
|
|
55
|
+
));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async function $do(
|
|
59
|
+
client: LeonardoCore,
|
|
60
|
+
id: string,
|
|
61
|
+
options?: RequestOptions,
|
|
62
|
+
): Promise<
|
|
63
|
+
[
|
|
64
|
+
Result<
|
|
65
|
+
operations.GetUploadedMediaByIdResponse,
|
|
66
|
+
| LeonardoError
|
|
67
|
+
| ResponseValidationError
|
|
68
|
+
| ConnectionError
|
|
69
|
+
| RequestAbortedError
|
|
70
|
+
| RequestTimeoutError
|
|
71
|
+
| InvalidRequestError
|
|
72
|
+
| UnexpectedClientError
|
|
73
|
+
| SDKValidationError
|
|
74
|
+
>,
|
|
75
|
+
APICall,
|
|
76
|
+
]
|
|
77
|
+
> {
|
|
78
|
+
const input: operations.GetUploadedMediaByIdRequest = {
|
|
79
|
+
id: id,
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const parsed = safeParse(
|
|
83
|
+
input,
|
|
84
|
+
(value) =>
|
|
85
|
+
operations.GetUploadedMediaByIdRequest$outboundSchema.parse(value),
|
|
86
|
+
"Input validation failed",
|
|
87
|
+
);
|
|
88
|
+
if (!parsed.ok) {
|
|
89
|
+
return [parsed, { status: "invalid" }];
|
|
90
|
+
}
|
|
91
|
+
const payload = parsed.value;
|
|
92
|
+
const body = null;
|
|
93
|
+
|
|
94
|
+
const pathParams = {
|
|
95
|
+
id: encodeSimple("id", payload.id, {
|
|
96
|
+
explode: false,
|
|
97
|
+
charEncoding: "percent",
|
|
98
|
+
}),
|
|
99
|
+
};
|
|
100
|
+
const path = pathToFunc("/media/{id}")(pathParams);
|
|
101
|
+
|
|
102
|
+
const headers = new Headers(compactMap({
|
|
103
|
+
Accept: "application/json",
|
|
104
|
+
}));
|
|
105
|
+
|
|
106
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
107
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
108
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
109
|
+
|
|
110
|
+
const context = {
|
|
111
|
+
options: client._options,
|
|
112
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
113
|
+
operationID: "getUploadedMediaById",
|
|
114
|
+
oAuth2Scopes: null,
|
|
115
|
+
|
|
116
|
+
resolvedSecurity: requestSecurity,
|
|
117
|
+
|
|
118
|
+
securitySource: client._options.bearerAuth,
|
|
119
|
+
retryConfig: options?.retries
|
|
120
|
+
|| client._options.retryConfig
|
|
121
|
+
|| { strategy: "none" },
|
|
122
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
const requestRes = client._createRequest(context, {
|
|
126
|
+
security: requestSecurity,
|
|
127
|
+
method: "GET",
|
|
128
|
+
baseURL: options?.serverURL,
|
|
129
|
+
path: path,
|
|
130
|
+
headers: headers,
|
|
131
|
+
body: body,
|
|
132
|
+
userAgent: client._options.userAgent,
|
|
133
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
134
|
+
}, options);
|
|
135
|
+
if (!requestRes.ok) {
|
|
136
|
+
return [requestRes, { status: "invalid" }];
|
|
137
|
+
}
|
|
138
|
+
const req = requestRes.value;
|
|
139
|
+
|
|
140
|
+
const doResult = await client._do(req, {
|
|
141
|
+
context,
|
|
142
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
143
|
+
matchStatusCode({ status: statusCode } as Response, []),
|
|
144
|
+
retryConfig: context.retryConfig,
|
|
145
|
+
retryCodes: context.retryCodes,
|
|
146
|
+
});
|
|
147
|
+
if (!doResult.ok) {
|
|
148
|
+
return [doResult, { status: "request-error", request: req }];
|
|
149
|
+
}
|
|
150
|
+
const response = doResult.value;
|
|
151
|
+
|
|
152
|
+
const responseFields = {
|
|
153
|
+
ContentType: response.headers.get("content-type")
|
|
154
|
+
?? "application/octet-stream",
|
|
155
|
+
StatusCode: response.status,
|
|
156
|
+
RawResponse: response,
|
|
157
|
+
Headers: {},
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const [result] = await M.match<
|
|
161
|
+
operations.GetUploadedMediaByIdResponse,
|
|
162
|
+
| LeonardoError
|
|
163
|
+
| ResponseValidationError
|
|
164
|
+
| ConnectionError
|
|
165
|
+
| RequestAbortedError
|
|
166
|
+
| RequestTimeoutError
|
|
167
|
+
| InvalidRequestError
|
|
168
|
+
| UnexpectedClientError
|
|
169
|
+
| SDKValidationError
|
|
170
|
+
>(
|
|
171
|
+
M.json(200, operations.GetUploadedMediaByIdResponse$inboundSchema, {
|
|
172
|
+
key: "object",
|
|
173
|
+
}),
|
|
174
|
+
)(response, req, { extraFields: responseFields });
|
|
175
|
+
if (!result.ok) {
|
|
176
|
+
return [result, { status: "complete", request: req, response }];
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return [result, { status: "complete", request: req, response }];
|
|
180
|
+
}
|