@leonardo-ai/sdk 4.16.0 → 4.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. package/README.md +52 -42
  2. package/docs/sdks/dataset/README.md +25 -29
  3. package/docs/sdks/elements/README.md +5 -5
  4. package/docs/sdks/image/README.md +20 -23
  5. package/docs/sdks/initimages/README.md +20 -23
  6. package/docs/sdks/models/README.md +20 -23
  7. package/docs/sdks/motion/README.md +5 -5
  8. package/docs/sdks/pricingcalculator/README.md +5 -5
  9. package/docs/sdks/prompt/README.md +10 -11
  10. package/docs/sdks/realtimecanvas/README.md +20 -23
  11. package/docs/sdks/texture/README.md +10 -11
  12. package/docs/sdks/threedmodelassets/README.md +10 -11
  13. package/docs/sdks/user/README.md +5 -5
  14. package/docs/sdks/variation/README.md +25 -29
  15. package/funcs/datasetCreateDataset.d.ts +1 -1
  16. package/funcs/datasetCreateDataset.d.ts.map +1 -1
  17. package/funcs/datasetCreateDataset.js +29 -30
  18. package/funcs/datasetCreateDataset.js.map +1 -1
  19. package/funcs/datasetDeleteDatasetById.d.ts +1 -1
  20. package/funcs/datasetDeleteDatasetById.d.ts.map +1 -1
  21. package/funcs/datasetDeleteDatasetById.js +32 -32
  22. package/funcs/datasetDeleteDatasetById.js.map +1 -1
  23. package/funcs/datasetGetDatasetById.d.ts +1 -1
  24. package/funcs/datasetGetDatasetById.d.ts.map +1 -1
  25. package/funcs/datasetGetDatasetById.js +32 -32
  26. package/funcs/datasetGetDatasetById.js.map +1 -1
  27. package/funcs/datasetUploadDatasetImage.d.ts +1 -1
  28. package/funcs/datasetUploadDatasetImage.d.ts.map +1 -1
  29. package/funcs/datasetUploadDatasetImage.js +32 -32
  30. package/funcs/datasetUploadDatasetImage.js.map +1 -1
  31. package/funcs/datasetUploadDatasetImageFromGen.d.ts +1 -1
  32. package/funcs/datasetUploadDatasetImageFromGen.d.ts.map +1 -1
  33. package/funcs/datasetUploadDatasetImageFromGen.js +32 -32
  34. package/funcs/datasetUploadDatasetImageFromGen.js.map +1 -1
  35. package/funcs/elementsListElements.d.ts +1 -1
  36. package/funcs/elementsListElements.d.ts.map +1 -1
  37. package/funcs/elementsListElements.js +22 -22
  38. package/funcs/elementsListElements.js.map +1 -1
  39. package/funcs/imageCreateGeneration.d.ts +1 -1
  40. package/funcs/imageCreateGeneration.d.ts.map +1 -1
  41. package/funcs/imageCreateGeneration.js +29 -30
  42. package/funcs/imageCreateGeneration.js.map +1 -1
  43. package/funcs/imageDeleteGenerationById.d.ts +1 -1
  44. package/funcs/imageDeleteGenerationById.d.ts.map +1 -1
  45. package/funcs/imageDeleteGenerationById.js +32 -32
  46. package/funcs/imageDeleteGenerationById.js.map +1 -1
  47. package/funcs/imageGetGenerationById.d.ts +1 -1
  48. package/funcs/imageGetGenerationById.d.ts.map +1 -1
  49. package/funcs/imageGetGenerationById.js +32 -32
  50. package/funcs/imageGetGenerationById.js.map +1 -1
  51. package/funcs/imageGetGenerationsByUserId.d.ts +1 -1
  52. package/funcs/imageGetGenerationsByUserId.d.ts.map +1 -1
  53. package/funcs/imageGetGenerationsByUserId.js +37 -37
  54. package/funcs/imageGetGenerationsByUserId.js.map +1 -1
  55. package/funcs/initImagesDeleteInitImageById.d.ts +1 -1
  56. package/funcs/initImagesDeleteInitImageById.d.ts.map +1 -1
  57. package/funcs/initImagesDeleteInitImageById.js +32 -32
  58. package/funcs/initImagesDeleteInitImageById.js.map +1 -1
  59. package/funcs/initImagesGetInitImageById.d.ts +1 -1
  60. package/funcs/initImagesGetInitImageById.d.ts.map +1 -1
  61. package/funcs/initImagesGetInitImageById.js +32 -32
  62. package/funcs/initImagesGetInitImageById.js.map +1 -1
  63. package/funcs/initImagesUploadCanvasInitImage.d.ts +1 -1
  64. package/funcs/initImagesUploadCanvasInitImage.d.ts.map +1 -1
  65. package/funcs/initImagesUploadCanvasInitImage.js +29 -30
  66. package/funcs/initImagesUploadCanvasInitImage.js.map +1 -1
  67. package/funcs/initImagesUploadInitImage.d.ts +1 -1
  68. package/funcs/initImagesUploadInitImage.d.ts.map +1 -1
  69. package/funcs/initImagesUploadInitImage.js +29 -30
  70. package/funcs/initImagesUploadInitImage.js.map +1 -1
  71. package/funcs/modelsCreateModel.d.ts +1 -1
  72. package/funcs/modelsCreateModel.d.ts.map +1 -1
  73. package/funcs/modelsCreateModel.js +29 -30
  74. package/funcs/modelsCreateModel.js.map +1 -1
  75. package/funcs/modelsDeleteModelById.d.ts +1 -1
  76. package/funcs/modelsDeleteModelById.d.ts.map +1 -1
  77. package/funcs/modelsDeleteModelById.js +32 -32
  78. package/funcs/modelsDeleteModelById.js.map +1 -1
  79. package/funcs/modelsGetModelById.d.ts +1 -1
  80. package/funcs/modelsGetModelById.d.ts.map +1 -1
  81. package/funcs/modelsGetModelById.js +32 -32
  82. package/funcs/modelsGetModelById.js.map +1 -1
  83. package/funcs/modelsListPlatformModels.d.ts +1 -1
  84. package/funcs/modelsListPlatformModels.d.ts.map +1 -1
  85. package/funcs/modelsListPlatformModels.js +22 -22
  86. package/funcs/modelsListPlatformModels.js.map +1 -1
  87. package/funcs/motionCreateSVDMotionGeneration.d.ts +1 -1
  88. package/funcs/motionCreateSVDMotionGeneration.d.ts.map +1 -1
  89. package/funcs/motionCreateSVDMotionGeneration.js +31 -32
  90. package/funcs/motionCreateSVDMotionGeneration.js.map +1 -1
  91. package/funcs/pricingCalculatorPricingCalculator.d.ts +1 -1
  92. package/funcs/pricingCalculatorPricingCalculator.d.ts.map +1 -1
  93. package/funcs/pricingCalculatorPricingCalculator.js +30 -31
  94. package/funcs/pricingCalculatorPricingCalculator.js.map +1 -1
  95. package/funcs/promptPromptImprove.d.ts +1 -1
  96. package/funcs/promptPromptImprove.d.ts.map +1 -1
  97. package/funcs/promptPromptImprove.js +29 -30
  98. package/funcs/promptPromptImprove.js.map +1 -1
  99. package/funcs/promptPromptRandom.d.ts +1 -1
  100. package/funcs/promptPromptRandom.d.ts.map +1 -1
  101. package/funcs/promptPromptRandom.js +22 -22
  102. package/funcs/promptPromptRandom.js.map +1 -1
  103. package/funcs/realtimeCanvasCreateLCMGeneration.d.ts +1 -1
  104. package/funcs/realtimeCanvasCreateLCMGeneration.d.ts.map +1 -1
  105. package/funcs/realtimeCanvasCreateLCMGeneration.js +30 -31
  106. package/funcs/realtimeCanvasCreateLCMGeneration.js.map +1 -1
  107. package/funcs/realtimeCanvasPerformAlchemyUpscaleLCM.d.ts +1 -1
  108. package/funcs/realtimeCanvasPerformAlchemyUpscaleLCM.d.ts.map +1 -1
  109. package/funcs/realtimeCanvasPerformAlchemyUpscaleLCM.js +31 -32
  110. package/funcs/realtimeCanvasPerformAlchemyUpscaleLCM.js.map +1 -1
  111. package/funcs/realtimeCanvasPerformInpaintingLCM.d.ts +1 -1
  112. package/funcs/realtimeCanvasPerformInpaintingLCM.d.ts.map +1 -1
  113. package/funcs/realtimeCanvasPerformInpaintingLCM.js +31 -32
  114. package/funcs/realtimeCanvasPerformInpaintingLCM.js.map +1 -1
  115. package/funcs/realtimeCanvasPerformInstantRefine.d.ts +1 -1
  116. package/funcs/realtimeCanvasPerformInstantRefine.d.ts.map +1 -1
  117. package/funcs/realtimeCanvasPerformInstantRefine.js +31 -32
  118. package/funcs/realtimeCanvasPerformInstantRefine.js.map +1 -1
  119. package/funcs/textureCreateTextureGeneration.d.ts +1 -1
  120. package/funcs/textureCreateTextureGeneration.d.ts.map +1 -1
  121. package/funcs/textureCreateTextureGeneration.js +31 -32
  122. package/funcs/textureCreateTextureGeneration.js.map +1 -1
  123. package/funcs/textureDeleteTextureGenerationById.d.ts +1 -1
  124. package/funcs/textureDeleteTextureGenerationById.d.ts.map +1 -1
  125. package/funcs/textureDeleteTextureGenerationById.js +33 -33
  126. package/funcs/textureDeleteTextureGenerationById.js.map +1 -1
  127. package/funcs/threeDModelAssetsDelete3DModelById.d.ts +1 -1
  128. package/funcs/threeDModelAssetsDelete3DModelById.d.ts.map +1 -1
  129. package/funcs/threeDModelAssetsDelete3DModelById.js +33 -33
  130. package/funcs/threeDModelAssetsDelete3DModelById.js.map +1 -1
  131. package/funcs/threeDModelAssetsUploadModelAsset.d.ts +1 -1
  132. package/funcs/threeDModelAssetsUploadModelAsset.d.ts.map +1 -1
  133. package/funcs/threeDModelAssetsUploadModelAsset.js +30 -31
  134. package/funcs/threeDModelAssetsUploadModelAsset.js.map +1 -1
  135. package/funcs/userGetUserSelf.d.ts +1 -1
  136. package/funcs/userGetUserSelf.d.ts.map +1 -1
  137. package/funcs/userGetUserSelf.js +22 -22
  138. package/funcs/userGetUserSelf.js.map +1 -1
  139. package/funcs/variationCreateUniversalUpscalerJob.d.ts +1 -1
  140. package/funcs/variationCreateUniversalUpscalerJob.d.ts.map +1 -1
  141. package/funcs/variationCreateUniversalUpscalerJob.js +29 -30
  142. package/funcs/variationCreateUniversalUpscalerJob.js.map +1 -1
  143. package/funcs/variationCreateVariationNoBG.d.ts +1 -1
  144. package/funcs/variationCreateVariationNoBG.d.ts.map +1 -1
  145. package/funcs/variationCreateVariationNoBG.js +29 -30
  146. package/funcs/variationCreateVariationNoBG.js.map +1 -1
  147. package/funcs/variationCreateVariationUnzoom.d.ts +1 -1
  148. package/funcs/variationCreateVariationUnzoom.d.ts.map +1 -1
  149. package/funcs/variationCreateVariationUnzoom.js +31 -32
  150. package/funcs/variationCreateVariationUnzoom.js.map +1 -1
  151. package/funcs/variationCreateVariationUpscale.d.ts +1 -1
  152. package/funcs/variationCreateVariationUpscale.d.ts.map +1 -1
  153. package/funcs/variationCreateVariationUpscale.js +31 -32
  154. package/funcs/variationCreateVariationUpscale.js.map +1 -1
  155. package/funcs/variationGetVariationById.d.ts +1 -1
  156. package/funcs/variationGetVariationById.d.ts.map +1 -1
  157. package/funcs/variationGetVariationById.js +32 -32
  158. package/funcs/variationGetVariationById.js.map +1 -1
  159. package/lib/config.d.ts +3 -3
  160. package/lib/config.js +3 -3
  161. package/lib/sdks.d.ts +5 -8
  162. package/lib/sdks.d.ts.map +1 -1
  163. package/lib/sdks.js +34 -18
  164. package/lib/sdks.js.map +1 -1
  165. package/package.json +1 -1
  166. package/sdk/models/operations/creategeneration.d.ts +2 -2
  167. package/sdk/sdk.js +13 -13
  168. package/src/funcs/datasetCreateDataset.ts +33 -36
  169. package/src/funcs/datasetDeleteDatasetById.ts +36 -37
  170. package/src/funcs/datasetGetDatasetById.ts +36 -36
  171. package/src/funcs/datasetUploadDatasetImage.ts +36 -40
  172. package/src/funcs/datasetUploadDatasetImageFromGen.ts +37 -40
  173. package/src/funcs/elementsListElements.ts +23 -23
  174. package/src/funcs/imageCreateGeneration.ts +34 -36
  175. package/src/funcs/imageDeleteGenerationById.ts +37 -37
  176. package/src/funcs/imageGetGenerationById.ts +36 -37
  177. package/src/funcs/imageGetGenerationsByUserId.ts +42 -45
  178. package/src/funcs/initImagesDeleteInitImageById.ts +37 -37
  179. package/src/funcs/initImagesGetInitImageById.ts +36 -36
  180. package/src/funcs/initImagesUploadCanvasInitImage.ts +34 -36
  181. package/src/funcs/initImagesUploadInitImage.ts +34 -36
  182. package/src/funcs/modelsCreateModel.ts +33 -35
  183. package/src/funcs/modelsDeleteModelById.ts +36 -36
  184. package/src/funcs/modelsGetModelById.ts +36 -36
  185. package/src/funcs/modelsListPlatformModels.ts +23 -23
  186. package/src/funcs/motionCreateSVDMotionGeneration.ts +35 -37
  187. package/src/funcs/pricingCalculatorPricingCalculator.ts +35 -37
  188. package/src/funcs/promptPromptImprove.ts +33 -36
  189. package/src/funcs/promptPromptRandom.ts +23 -23
  190. package/src/funcs/realtimeCanvasCreateLCMGeneration.ts +35 -37
  191. package/src/funcs/realtimeCanvasPerformAlchemyUpscaleLCM.ts +35 -37
  192. package/src/funcs/realtimeCanvasPerformInpaintingLCM.ts +35 -37
  193. package/src/funcs/realtimeCanvasPerformInstantRefine.ts +35 -37
  194. package/src/funcs/textureCreateTextureGeneration.ts +35 -37
  195. package/src/funcs/textureDeleteTextureGenerationById.ts +38 -43
  196. package/src/funcs/threeDModelAssetsDelete3DModelById.ts +37 -41
  197. package/src/funcs/threeDModelAssetsUploadModelAsset.ts +35 -37
  198. package/src/funcs/userGetUserSelf.ts +23 -23
  199. package/src/funcs/variationCreateUniversalUpscalerJob.ts +34 -36
  200. package/src/funcs/variationCreateVariationNoBG.ts +34 -36
  201. package/src/funcs/variationCreateVariationUnzoom.ts +35 -37
  202. package/src/funcs/variationCreateVariationUpscale.ts +35 -37
  203. package/src/funcs/variationGetVariationById.ts +36 -36
  204. package/src/lib/config.ts +3 -3
  205. package/src/lib/sdks.ts +24 -24
  206. package/src/sdk/models/operations/creategeneration.ts +2 -2
  207. package/src/sdk/sdk.ts +13 -13
@@ -3,9 +3,9 @@
3
3
  */
4
4
 
5
5
  import { LeonardoCore } from "../core.js";
6
- import { encodeJSON as encodeJSON$ } from "../lib/encodings.js";
7
- import * as m$ from "../lib/matchers.js";
8
- import * as schemas$ from "../lib/schemas.js";
6
+ import { encodeJSON } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { safeParse } from "../lib/schemas.js";
9
9
  import { RequestOptions } from "../lib/sdks.js";
10
10
  import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
11
  import { pathToFunc } from "../lib/url.js";
@@ -28,7 +28,7 @@ import { Result } from "../sdk/types/fp.js";
28
28
  * This endpoint returns the cost used for generating images using a particular service type.
29
29
  */
30
30
  export async function pricingCalculatorPricingCalculator(
31
- client$: LeonardoCore,
31
+ client: LeonardoCore,
32
32
  request?: operations.PricingCalculatorRequestBody | undefined,
33
33
  options?: RequestOptions,
34
34
  ): Promise<
@@ -43,58 +43,56 @@ export async function pricingCalculatorPricingCalculator(
43
43
  | ConnectionError
44
44
  >
45
45
  > {
46
- const input$ = request;
47
-
48
- const parsed$ = schemas$.safeParse(
49
- input$,
50
- (value$) =>
46
+ const parsed = safeParse(
47
+ request,
48
+ (value) =>
51
49
  operations.PricingCalculatorRequestBody$outboundSchema.optional().parse(
52
- value$,
50
+ value,
53
51
  ),
54
52
  "Input validation failed",
55
53
  );
56
- if (!parsed$.ok) {
57
- return parsed$;
54
+ if (!parsed.ok) {
55
+ return parsed;
58
56
  }
59
- const payload$ = parsed$.value;
60
- const body$ = payload$ === undefined
57
+ const payload = parsed.value;
58
+ const body = payload === undefined
61
59
  ? null
62
- : encodeJSON$("body", payload$, { explode: true });
60
+ : encodeJSON("body", payload, { explode: true });
63
61
 
64
- const path$ = pathToFunc("/pricing-calculator")();
62
+ const path = pathToFunc("/pricing-calculator")();
65
63
 
66
- const headers$ = new Headers({
64
+ const headers = new Headers({
67
65
  "Content-Type": "application/json",
68
66
  Accept: "application/json",
69
67
  });
70
68
 
71
- const bearerAuth$ = await extractSecurity(client$.options$.bearerAuth);
72
- const security$ = bearerAuth$ == null ? {} : { bearerAuth: bearerAuth$ };
69
+ const secConfig = await extractSecurity(client._options.bearerAuth);
70
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
73
71
  const context = {
74
72
  operationID: "pricingCalculator",
75
73
  oAuth2Scopes: [],
76
- securitySource: client$.options$.bearerAuth,
74
+ securitySource: client._options.bearerAuth,
77
75
  };
78
- const securitySettings$ = resolveGlobalSecurity(security$);
76
+ const requestSecurity = resolveGlobalSecurity(securityInput);
79
77
 
80
- const requestRes = client$.createRequest$(context, {
81
- security: securitySettings$,
78
+ const requestRes = client._createRequest(context, {
79
+ security: requestSecurity,
82
80
  method: "POST",
83
- path: path$,
84
- headers: headers$,
85
- body: body$,
86
- timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1,
81
+ path: path,
82
+ headers: headers,
83
+ body: body,
84
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
87
85
  }, options);
88
86
  if (!requestRes.ok) {
89
87
  return requestRes;
90
88
  }
91
- const request$ = requestRes.value;
89
+ const req = requestRes.value;
92
90
 
93
- const doResult = await client$.do$(request$, {
91
+ const doResult = await client._do(req, {
94
92
  context,
95
93
  errorCodes: [],
96
94
  retryConfig: options?.retries
97
- || client$.options$.retryConfig,
95
+ || client._options.retryConfig,
98
96
  retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
99
97
  });
100
98
  if (!doResult.ok) {
@@ -102,7 +100,7 @@ export async function pricingCalculatorPricingCalculator(
102
100
  }
103
101
  const response = doResult.value;
104
102
 
105
- const responseFields$ = {
103
+ const responseFields = {
106
104
  ContentType: response.headers.get("content-type")
107
105
  ?? "application/octet-stream",
108
106
  StatusCode: response.status,
@@ -110,7 +108,7 @@ export async function pricingCalculatorPricingCalculator(
110
108
  Headers: {},
111
109
  };
112
110
 
113
- const [result$] = await m$.match<
111
+ const [result] = await M.match<
114
112
  operations.PricingCalculatorResponse,
115
113
  | SDKError
116
114
  | SDKValidationError
@@ -120,13 +118,13 @@ export async function pricingCalculatorPricingCalculator(
120
118
  | RequestTimeoutError
121
119
  | ConnectionError
122
120
  >(
123
- m$.json(200, operations.PricingCalculatorResponse$inboundSchema, {
121
+ M.json(200, operations.PricingCalculatorResponse$inboundSchema, {
124
122
  key: "object",
125
123
  }),
126
- )(response, { extraFields: responseFields$ });
127
- if (!result$.ok) {
128
- return result$;
124
+ )(response, { extraFields: responseFields });
125
+ if (!result.ok) {
126
+ return result;
129
127
  }
130
128
 
131
- return result$;
129
+ return result;
132
130
  }
@@ -3,9 +3,9 @@
3
3
  */
4
4
 
5
5
  import { LeonardoCore } from "../core.js";
6
- import { encodeJSON as encodeJSON$ } from "../lib/encodings.js";
7
- import * as m$ from "../lib/matchers.js";
8
- import * as schemas$ from "../lib/schemas.js";
6
+ import { encodeJSON } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { safeParse } from "../lib/schemas.js";
9
9
  import { RequestOptions } from "../lib/sdks.js";
10
10
  import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
11
  import { pathToFunc } from "../lib/url.js";
@@ -28,7 +28,7 @@ import { Result } from "../sdk/types/fp.js";
28
28
  * This endpoint returns a improved prompt
29
29
  */
30
30
  export async function promptPromptImprove(
31
- client$: LeonardoCore,
31
+ client: LeonardoCore,
32
32
  request: operations.PromptImproveRequestBody,
33
33
  options?: RequestOptions,
34
34
  ): Promise<
@@ -43,54 +43,51 @@ export async function promptPromptImprove(
43
43
  | ConnectionError
44
44
  >
45
45
  > {
46
- const input$ = request;
47
-
48
- const parsed$ = schemas$.safeParse(
49
- input$,
50
- (value$) =>
51
- operations.PromptImproveRequestBody$outboundSchema.parse(value$),
46
+ const parsed = safeParse(
47
+ request,
48
+ (value) => operations.PromptImproveRequestBody$outboundSchema.parse(value),
52
49
  "Input validation failed",
53
50
  );
54
- if (!parsed$.ok) {
55
- return parsed$;
51
+ if (!parsed.ok) {
52
+ return parsed;
56
53
  }
57
- const payload$ = parsed$.value;
58
- const body$ = encodeJSON$("body", payload$, { explode: true });
54
+ const payload = parsed.value;
55
+ const body = encodeJSON("body", payload, { explode: true });
59
56
 
60
- const path$ = pathToFunc("/prompt/improve")();
57
+ const path = pathToFunc("/prompt/improve")();
61
58
 
62
- const headers$ = new Headers({
59
+ const headers = new Headers({
63
60
  "Content-Type": "application/json",
64
61
  Accept: "application/json",
65
62
  });
66
63
 
67
- const bearerAuth$ = await extractSecurity(client$.options$.bearerAuth);
68
- const security$ = bearerAuth$ == null ? {} : { bearerAuth: bearerAuth$ };
64
+ const secConfig = await extractSecurity(client._options.bearerAuth);
65
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
69
66
  const context = {
70
67
  operationID: "promptImprove",
71
68
  oAuth2Scopes: [],
72
- securitySource: client$.options$.bearerAuth,
69
+ securitySource: client._options.bearerAuth,
73
70
  };
74
- const securitySettings$ = resolveGlobalSecurity(security$);
71
+ const requestSecurity = resolveGlobalSecurity(securityInput);
75
72
 
76
- const requestRes = client$.createRequest$(context, {
77
- security: securitySettings$,
73
+ const requestRes = client._createRequest(context, {
74
+ security: requestSecurity,
78
75
  method: "POST",
79
- path: path$,
80
- headers: headers$,
81
- body: body$,
82
- timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1,
76
+ path: path,
77
+ headers: headers,
78
+ body: body,
79
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
83
80
  }, options);
84
81
  if (!requestRes.ok) {
85
82
  return requestRes;
86
83
  }
87
- const request$ = requestRes.value;
84
+ const req = requestRes.value;
88
85
 
89
- const doResult = await client$.do$(request$, {
86
+ const doResult = await client._do(req, {
90
87
  context,
91
88
  errorCodes: [],
92
89
  retryConfig: options?.retries
93
- || client$.options$.retryConfig,
90
+ || client._options.retryConfig,
94
91
  retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
95
92
  });
96
93
  if (!doResult.ok) {
@@ -98,7 +95,7 @@ export async function promptPromptImprove(
98
95
  }
99
96
  const response = doResult.value;
100
97
 
101
- const responseFields$ = {
98
+ const responseFields = {
102
99
  ContentType: response.headers.get("content-type")
103
100
  ?? "application/octet-stream",
104
101
  StatusCode: response.status,
@@ -106,7 +103,7 @@ export async function promptPromptImprove(
106
103
  Headers: {},
107
104
  };
108
105
 
109
- const [result$] = await m$.match<
106
+ const [result] = await M.match<
110
107
  operations.PromptImproveResponse,
111
108
  | SDKError
112
109
  | SDKValidationError
@@ -116,13 +113,13 @@ export async function promptPromptImprove(
116
113
  | RequestTimeoutError
117
114
  | ConnectionError
118
115
  >(
119
- m$.json(200, operations.PromptImproveResponse$inboundSchema, {
116
+ M.json(200, operations.PromptImproveResponse$inboundSchema, {
120
117
  key: "object",
121
118
  }),
122
- )(response, { extraFields: responseFields$ });
123
- if (!result$.ok) {
124
- return result$;
119
+ )(response, { extraFields: responseFields });
120
+ if (!result.ok) {
121
+ return result;
125
122
  }
126
123
 
127
- return result$;
124
+ return result;
128
125
  }
@@ -3,7 +3,7 @@
3
3
  */
4
4
 
5
5
  import { LeonardoCore } from "../core.js";
6
- import * as m$ from "../lib/matchers.js";
6
+ import * as M from "../lib/matchers.js";
7
7
  import { RequestOptions } from "../lib/sdks.js";
8
8
  import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
9
9
  import { pathToFunc } from "../lib/url.js";
@@ -26,7 +26,7 @@ import { Result } from "../sdk/types/fp.js";
26
26
  * This endpoint returns a random prompt
27
27
  */
28
28
  export async function promptPromptRandom(
29
- client$: LeonardoCore,
29
+ client: LeonardoCore,
30
30
  options?: RequestOptions,
31
31
  ): Promise<
32
32
  Result<
@@ -40,38 +40,38 @@ export async function promptPromptRandom(
40
40
  | ConnectionError
41
41
  >
42
42
  > {
43
- const path$ = pathToFunc("/prompt/random")();
43
+ const path = pathToFunc("/prompt/random")();
44
44
 
45
- const headers$ = new Headers({
45
+ const headers = new Headers({
46
46
  Accept: "application/json",
47
47
  });
48
48
 
49
- const bearerAuth$ = await extractSecurity(client$.options$.bearerAuth);
50
- const security$ = bearerAuth$ == null ? {} : { bearerAuth: bearerAuth$ };
49
+ const secConfig = await extractSecurity(client._options.bearerAuth);
50
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
51
51
  const context = {
52
52
  operationID: "promptRandom",
53
53
  oAuth2Scopes: [],
54
- securitySource: client$.options$.bearerAuth,
54
+ securitySource: client._options.bearerAuth,
55
55
  };
56
- const securitySettings$ = resolveGlobalSecurity(security$);
56
+ const requestSecurity = resolveGlobalSecurity(securityInput);
57
57
 
58
- const requestRes = client$.createRequest$(context, {
59
- security: securitySettings$,
58
+ const requestRes = client._createRequest(context, {
59
+ security: requestSecurity,
60
60
  method: "POST",
61
- path: path$,
62
- headers: headers$,
63
- timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1,
61
+ path: path,
62
+ headers: headers,
63
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
64
64
  }, options);
65
65
  if (!requestRes.ok) {
66
66
  return requestRes;
67
67
  }
68
- const request$ = requestRes.value;
68
+ const req = requestRes.value;
69
69
 
70
- const doResult = await client$.do$(request$, {
70
+ const doResult = await client._do(req, {
71
71
  context,
72
72
  errorCodes: [],
73
73
  retryConfig: options?.retries
74
- || client$.options$.retryConfig,
74
+ || client._options.retryConfig,
75
75
  retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
76
76
  });
77
77
  if (!doResult.ok) {
@@ -79,7 +79,7 @@ export async function promptPromptRandom(
79
79
  }
80
80
  const response = doResult.value;
81
81
 
82
- const responseFields$ = {
82
+ const responseFields = {
83
83
  ContentType: response.headers.get("content-type")
84
84
  ?? "application/octet-stream",
85
85
  StatusCode: response.status,
@@ -87,7 +87,7 @@ export async function promptPromptRandom(
87
87
  Headers: {},
88
88
  };
89
89
 
90
- const [result$] = await m$.match<
90
+ const [result] = await M.match<
91
91
  operations.PromptRandomResponse,
92
92
  | SDKError
93
93
  | SDKValidationError
@@ -97,13 +97,13 @@ export async function promptPromptRandom(
97
97
  | RequestTimeoutError
98
98
  | ConnectionError
99
99
  >(
100
- m$.json(200, operations.PromptRandomResponse$inboundSchema, {
100
+ M.json(200, operations.PromptRandomResponse$inboundSchema, {
101
101
  key: "object",
102
102
  }),
103
- )(response, { extraFields: responseFields$ });
104
- if (!result$.ok) {
105
- return result$;
103
+ )(response, { extraFields: responseFields });
104
+ if (!result.ok) {
105
+ return result;
106
106
  }
107
107
 
108
- return result$;
108
+ return result;
109
109
  }
@@ -3,9 +3,9 @@
3
3
  */
4
4
 
5
5
  import { LeonardoCore } from "../core.js";
6
- import { encodeJSON as encodeJSON$ } from "../lib/encodings.js";
7
- import * as m$ from "../lib/matchers.js";
8
- import * as schemas$ from "../lib/schemas.js";
6
+ import { encodeJSON } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { safeParse } from "../lib/schemas.js";
9
9
  import { RequestOptions } from "../lib/sdks.js";
10
10
  import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
11
  import { pathToFunc } from "../lib/url.js";
@@ -28,7 +28,7 @@ import { Result } from "../sdk/types/fp.js";
28
28
  * This endpoint will generate a LCM image generation.
29
29
  */
30
30
  export async function realtimeCanvasCreateLCMGeneration(
31
- client$: LeonardoCore,
31
+ client: LeonardoCore,
32
32
  request?: operations.CreateLCMGenerationRequestBody | undefined,
33
33
  options?: RequestOptions,
34
34
  ): Promise<
@@ -43,58 +43,56 @@ export async function realtimeCanvasCreateLCMGeneration(
43
43
  | ConnectionError
44
44
  >
45
45
  > {
46
- const input$ = request;
47
-
48
- const parsed$ = schemas$.safeParse(
49
- input$,
50
- (value$) =>
46
+ const parsed = safeParse(
47
+ request,
48
+ (value) =>
51
49
  operations.CreateLCMGenerationRequestBody$outboundSchema.optional().parse(
52
- value$,
50
+ value,
53
51
  ),
54
52
  "Input validation failed",
55
53
  );
56
- if (!parsed$.ok) {
57
- return parsed$;
54
+ if (!parsed.ok) {
55
+ return parsed;
58
56
  }
59
- const payload$ = parsed$.value;
60
- const body$ = payload$ === undefined
57
+ const payload = parsed.value;
58
+ const body = payload === undefined
61
59
  ? null
62
- : encodeJSON$("body", payload$, { explode: true });
60
+ : encodeJSON("body", payload, { explode: true });
63
61
 
64
- const path$ = pathToFunc("/generations-lcm")();
62
+ const path = pathToFunc("/generations-lcm")();
65
63
 
66
- const headers$ = new Headers({
64
+ const headers = new Headers({
67
65
  "Content-Type": "application/json",
68
66
  Accept: "application/json",
69
67
  });
70
68
 
71
- const bearerAuth$ = await extractSecurity(client$.options$.bearerAuth);
72
- const security$ = bearerAuth$ == null ? {} : { bearerAuth: bearerAuth$ };
69
+ const secConfig = await extractSecurity(client._options.bearerAuth);
70
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
73
71
  const context = {
74
72
  operationID: "createLCMGeneration",
75
73
  oAuth2Scopes: [],
76
- securitySource: client$.options$.bearerAuth,
74
+ securitySource: client._options.bearerAuth,
77
75
  };
78
- const securitySettings$ = resolveGlobalSecurity(security$);
76
+ const requestSecurity = resolveGlobalSecurity(securityInput);
79
77
 
80
- const requestRes = client$.createRequest$(context, {
81
- security: securitySettings$,
78
+ const requestRes = client._createRequest(context, {
79
+ security: requestSecurity,
82
80
  method: "POST",
83
- path: path$,
84
- headers: headers$,
85
- body: body$,
86
- timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1,
81
+ path: path,
82
+ headers: headers,
83
+ body: body,
84
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
87
85
  }, options);
88
86
  if (!requestRes.ok) {
89
87
  return requestRes;
90
88
  }
91
- const request$ = requestRes.value;
89
+ const req = requestRes.value;
92
90
 
93
- const doResult = await client$.do$(request$, {
91
+ const doResult = await client._do(req, {
94
92
  context,
95
93
  errorCodes: [],
96
94
  retryConfig: options?.retries
97
- || client$.options$.retryConfig,
95
+ || client._options.retryConfig,
98
96
  retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
99
97
  });
100
98
  if (!doResult.ok) {
@@ -102,7 +100,7 @@ export async function realtimeCanvasCreateLCMGeneration(
102
100
  }
103
101
  const response = doResult.value;
104
102
 
105
- const responseFields$ = {
103
+ const responseFields = {
106
104
  ContentType: response.headers.get("content-type")
107
105
  ?? "application/octet-stream",
108
106
  StatusCode: response.status,
@@ -110,7 +108,7 @@ export async function realtimeCanvasCreateLCMGeneration(
110
108
  Headers: {},
111
109
  };
112
110
 
113
- const [result$] = await m$.match<
111
+ const [result] = await M.match<
114
112
  operations.CreateLCMGenerationResponse,
115
113
  | SDKError
116
114
  | SDKValidationError
@@ -120,13 +118,13 @@ export async function realtimeCanvasCreateLCMGeneration(
120
118
  | RequestTimeoutError
121
119
  | ConnectionError
122
120
  >(
123
- m$.json(200, operations.CreateLCMGenerationResponse$inboundSchema, {
121
+ M.json(200, operations.CreateLCMGenerationResponse$inboundSchema, {
124
122
  key: "object",
125
123
  }),
126
- )(response, { extraFields: responseFields$ });
127
- if (!result$.ok) {
128
- return result$;
124
+ )(response, { extraFields: responseFields });
125
+ if (!result.ok) {
126
+ return result;
129
127
  }
130
128
 
131
- return result$;
129
+ return result;
132
130
  }
@@ -3,9 +3,9 @@
3
3
  */
4
4
 
5
5
  import { LeonardoCore } from "../core.js";
6
- import { encodeJSON as encodeJSON$ } from "../lib/encodings.js";
7
- import * as m$ from "../lib/matchers.js";
8
- import * as schemas$ from "../lib/schemas.js";
6
+ import { encodeJSON } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { safeParse } from "../lib/schemas.js";
9
9
  import { RequestOptions } from "../lib/sdks.js";
10
10
  import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
11
  import { pathToFunc } from "../lib/url.js";
@@ -28,7 +28,7 @@ import { Result } from "../sdk/types/fp.js";
28
28
  * This endpoint will perform Alchemy Upscale on a LCM image
29
29
  */
30
30
  export async function realtimeCanvasPerformAlchemyUpscaleLCM(
31
- client$: LeonardoCore,
31
+ client: LeonardoCore,
32
32
  request?: operations.PerformAlchemyUpscaleLCMRequestBody | undefined,
33
33
  options?: RequestOptions,
34
34
  ): Promise<
@@ -43,57 +43,55 @@ export async function realtimeCanvasPerformAlchemyUpscaleLCM(
43
43
  | ConnectionError
44
44
  >
45
45
  > {
46
- const input$ = request;
47
-
48
- const parsed$ = schemas$.safeParse(
49
- input$,
50
- (value$) =>
46
+ const parsed = safeParse(
47
+ request,
48
+ (value) =>
51
49
  operations.PerformAlchemyUpscaleLCMRequestBody$outboundSchema.optional()
52
- .parse(value$),
50
+ .parse(value),
53
51
  "Input validation failed",
54
52
  );
55
- if (!parsed$.ok) {
56
- return parsed$;
53
+ if (!parsed.ok) {
54
+ return parsed;
57
55
  }
58
- const payload$ = parsed$.value;
59
- const body$ = payload$ === undefined
56
+ const payload = parsed.value;
57
+ const body = payload === undefined
60
58
  ? null
61
- : encodeJSON$("body", payload$, { explode: true });
59
+ : encodeJSON("body", payload, { explode: true });
62
60
 
63
- const path$ = pathToFunc("/lcm-upscale")();
61
+ const path = pathToFunc("/lcm-upscale")();
64
62
 
65
- const headers$ = new Headers({
63
+ const headers = new Headers({
66
64
  "Content-Type": "application/json",
67
65
  Accept: "application/json",
68
66
  });
69
67
 
70
- const bearerAuth$ = await extractSecurity(client$.options$.bearerAuth);
71
- const security$ = bearerAuth$ == null ? {} : { bearerAuth: bearerAuth$ };
68
+ const secConfig = await extractSecurity(client._options.bearerAuth);
69
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
72
70
  const context = {
73
71
  operationID: "performAlchemyUpscaleLCM",
74
72
  oAuth2Scopes: [],
75
- securitySource: client$.options$.bearerAuth,
73
+ securitySource: client._options.bearerAuth,
76
74
  };
77
- const securitySettings$ = resolveGlobalSecurity(security$);
75
+ const requestSecurity = resolveGlobalSecurity(securityInput);
78
76
 
79
- const requestRes = client$.createRequest$(context, {
80
- security: securitySettings$,
77
+ const requestRes = client._createRequest(context, {
78
+ security: requestSecurity,
81
79
  method: "POST",
82
- path: path$,
83
- headers: headers$,
84
- body: body$,
85
- timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1,
80
+ path: path,
81
+ headers: headers,
82
+ body: body,
83
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
86
84
  }, options);
87
85
  if (!requestRes.ok) {
88
86
  return requestRes;
89
87
  }
90
- const request$ = requestRes.value;
88
+ const req = requestRes.value;
91
89
 
92
- const doResult = await client$.do$(request$, {
90
+ const doResult = await client._do(req, {
93
91
  context,
94
92
  errorCodes: [],
95
93
  retryConfig: options?.retries
96
- || client$.options$.retryConfig,
94
+ || client._options.retryConfig,
97
95
  retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
98
96
  });
99
97
  if (!doResult.ok) {
@@ -101,7 +99,7 @@ export async function realtimeCanvasPerformAlchemyUpscaleLCM(
101
99
  }
102
100
  const response = doResult.value;
103
101
 
104
- const responseFields$ = {
102
+ const responseFields = {
105
103
  ContentType: response.headers.get("content-type")
106
104
  ?? "application/octet-stream",
107
105
  StatusCode: response.status,
@@ -109,7 +107,7 @@ export async function realtimeCanvasPerformAlchemyUpscaleLCM(
109
107
  Headers: {},
110
108
  };
111
109
 
112
- const [result$] = await m$.match<
110
+ const [result] = await M.match<
113
111
  operations.PerformAlchemyUpscaleLCMResponse,
114
112
  | SDKError
115
113
  | SDKValidationError
@@ -119,13 +117,13 @@ export async function realtimeCanvasPerformAlchemyUpscaleLCM(
119
117
  | RequestTimeoutError
120
118
  | ConnectionError
121
119
  >(
122
- m$.json(200, operations.PerformAlchemyUpscaleLCMResponse$inboundSchema, {
120
+ M.json(200, operations.PerformAlchemyUpscaleLCMResponse$inboundSchema, {
123
121
  key: "object",
124
122
  }),
125
- )(response, { extraFields: responseFields$ });
126
- if (!result$.ok) {
127
- return result$;
123
+ )(response, { extraFields: responseFields });
124
+ if (!result.ok) {
125
+ return result;
128
126
  }
129
127
 
130
- return result$;
128
+ return result;
131
129
  }