@leonardo-ai/sdk 1.7.4 → 1.8.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 CHANGED
@@ -32,7 +32,7 @@ To get access to the API and fetch an API key, please sign up for [access](https
32
32
  ```typescript
33
33
  import {
34
34
  CreateDatasetRequest,
35
- CreateDatasetResponse
35
+ CreateDatasetResponse
36
36
  } from "@leonardo-ai/sdk/dist/sdk/models/operations";
37
37
 
38
38
  import { AxiosError } from "axios";
@@ -26,3 +26,5 @@ export declare function isBooleanRecord(obj: any): obj is Record<string, boolean
26
26
  export declare function isEmpty(value: any): boolean;
27
27
  export declare function convertIfDateObjectToISOString(value: any, dateTimeFormat?: string): any;
28
28
  export declare function encodeAndConvertPrimitiveVal(value: any, dateTimeFormat?: string): any;
29
+ export declare function deserializeJSONResponse<T>(value: T, klass?: any, elemDepth?: number): any;
30
+ export declare function getResFieldDepth(res: any): number;
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.encodeAndConvertPrimitiveVal = exports.convertIfDateObjectToISOString = exports.isEmpty = exports.isBooleanRecord = exports.isNumberRecord = exports.isStringRecord = exports.parseParamDecorator = exports.generateURL = exports.templateUrl = exports.SpeakeasyMetadata = exports.ParamDecorator = exports.SpeakeasyBase = void 0;
3
+ exports.getResFieldDepth = exports.deserializeJSONResponse = exports.encodeAndConvertPrimitiveVal = exports.convertIfDateObjectToISOString = exports.isEmpty = exports.isBooleanRecord = exports.isNumberRecord = exports.isStringRecord = exports.parseParamDecorator = exports.generateURL = exports.templateUrl = exports.SpeakeasyMetadata = exports.ParamDecorator = exports.SpeakeasyBase = void 0;
4
4
  require("reflect-metadata");
5
5
  var pathparams_1 = require("./pathparams");
6
+ var class_transformer_1 = require("class-transformer");
6
7
  function isSpeakeasyBase(type) {
7
8
  var _a;
8
9
  return type && ((_a = Object.getPrototypeOf(type)) === null || _a === void 0 ? void 0 : _a.name) == "SpeakeasyBase";
@@ -236,3 +237,44 @@ function encodeAndConvertPrimitiveVal(value, dateTimeFormat) {
236
237
  return encodeURIComponent(convertIfDateObjectToISOString(value, dateTimeFormat));
237
238
  }
238
239
  exports.encodeAndConvertPrimitiveVal = encodeAndConvertPrimitiveVal;
240
+ function deserializeJSONResponse(value, klass, elemDepth) {
241
+ if (elemDepth === void 0) { elemDepth = 0; }
242
+ if (value !== Object(value)) {
243
+ return value;
244
+ }
245
+ if (elemDepth === 0 && klass != null) {
246
+ return (0, class_transformer_1.plainToInstance)(klass, value, { excludeExtraneousValues: true });
247
+ }
248
+ if (Array.isArray(value)) {
249
+ return value.map(function (v) { return deserializeJSONResponse(v, klass, elemDepth - 1); });
250
+ }
251
+ if (typeof value === 'object' && value != null) {
252
+ var copiedRecord = {};
253
+ for (var key in value) {
254
+ copiedRecord[key] = deserializeJSONResponse(value[key], klass, elemDepth - 1);
255
+ }
256
+ return copiedRecord;
257
+ }
258
+ return (0, class_transformer_1.plainToInstance)(klass, value, { excludeExtraneousValues: true });
259
+ }
260
+ exports.deserializeJSONResponse = deserializeJSONResponse;
261
+ function getResFieldDepth(res) {
262
+ var props = res["__props__"];
263
+ var resFieldDepth = 1;
264
+ if (props) {
265
+ for (var _i = 0, props_2 = props; _i < props_2.length; _i++) {
266
+ var prop = props_2[_i];
267
+ if (res && res.hasOwnProperty(prop.key)) {
268
+ if ((prop.type.name == "Array" || prop.type.name == "Object") &&
269
+ isSpeakeasyBase(prop.elemType)) {
270
+ if (prop.elemDepth > resFieldDepth) {
271
+ resFieldDepth = prop.elemDepth;
272
+ break;
273
+ }
274
+ }
275
+ }
276
+ }
277
+ }
278
+ return resFieldDepth;
279
+ }
280
+ exports.getResFieldDepth = getResFieldDepth;
@@ -37,7 +37,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.Dataset = void 0;
38
38
  var utils = __importStar(require("../internal/utils"));
39
39
  var operations = __importStar(require("./models/operations"));
40
- var class_transformer_1 = require("class-transformer");
41
40
  var Dataset = /** @class */ (function () {
42
41
  function Dataset(defaultClient, securityClient, serverURL, language, sdkVersion, genVersion) {
43
42
  this._defaultClient = defaultClient;
@@ -78,11 +77,15 @@ var Dataset = /** @class */ (function () {
78
77
  var contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
79
78
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null)
80
79
  throw new Error("status code not found in response: ".concat(httpRes));
81
- var res = { statusCode: httpRes.status, contentType: contentType, rawResponse: httpRes };
80
+ var res = new operations.CreateDatasetResponse({
81
+ statusCode: httpRes.status,
82
+ contentType: contentType,
83
+ rawResponse: httpRes
84
+ });
82
85
  switch (true) {
83
86
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
84
87
  if (utils.matchContentType(contentType, "application/json")) {
85
- res.createDataset200ApplicationJSONObject = (0, class_transformer_1.plainToInstance)(operations.CreateDataset200ApplicationJSON, httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, { excludeExtraneousValues: true });
88
+ res.createDataset200ApplicationJSONObject = utils.deserializeJSONResponse(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.CreateDataset200ApplicationJSON);
86
89
  }
87
90
  break;
88
91
  }
@@ -107,11 +110,15 @@ var Dataset = /** @class */ (function () {
107
110
  var contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
108
111
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null)
109
112
  throw new Error("status code not found in response: ".concat(httpRes));
110
- var res = { statusCode: httpRes.status, contentType: contentType, rawResponse: httpRes };
113
+ var res = new operations.DeleteDatasetByIdResponse({
114
+ statusCode: httpRes.status,
115
+ contentType: contentType,
116
+ rawResponse: httpRes
117
+ });
111
118
  switch (true) {
112
119
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
113
120
  if (utils.matchContentType(contentType, "application/json")) {
114
- res.deleteDatasetById200ApplicationJSONObject = (0, class_transformer_1.plainToInstance)(operations.DeleteDatasetById200ApplicationJSON, httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, { excludeExtraneousValues: true });
121
+ res.deleteDatasetById200ApplicationJSONObject = utils.deserializeJSONResponse(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.DeleteDatasetById200ApplicationJSON);
115
122
  }
116
123
  break;
117
124
  }
@@ -136,11 +143,15 @@ var Dataset = /** @class */ (function () {
136
143
  var contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
137
144
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null)
138
145
  throw new Error("status code not found in response: ".concat(httpRes));
139
- var res = { statusCode: httpRes.status, contentType: contentType, rawResponse: httpRes };
146
+ var res = new operations.GetDatasetByIdResponse({
147
+ statusCode: httpRes.status,
148
+ contentType: contentType,
149
+ rawResponse: httpRes
150
+ });
140
151
  switch (true) {
141
152
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
142
153
  if (utils.matchContentType(contentType, "application/json")) {
143
- res.getDatasetById200ApplicationJSONObject = (0, class_transformer_1.plainToInstance)(operations.GetDatasetById200ApplicationJSON, httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, { excludeExtraneousValues: true });
154
+ res.getDatasetById200ApplicationJSONObject = utils.deserializeJSONResponse(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.GetDatasetById200ApplicationJSON);
144
155
  }
145
156
  break;
146
157
  }
@@ -178,11 +189,15 @@ var Dataset = /** @class */ (function () {
178
189
  var contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
179
190
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null)
180
191
  throw new Error("status code not found in response: ".concat(httpRes));
181
- var res = { statusCode: httpRes.status, contentType: contentType, rawResponse: httpRes };
192
+ var res = new operations.UploadDatasetImageResponse({
193
+ statusCode: httpRes.status,
194
+ contentType: contentType,
195
+ rawResponse: httpRes
196
+ });
182
197
  switch (true) {
183
198
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
184
199
  if (utils.matchContentType(contentType, "application/json")) {
185
- res.uploadDatasetImage200ApplicationJSONObject = (0, class_transformer_1.plainToInstance)(operations.UploadDatasetImage200ApplicationJSON, httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, { excludeExtraneousValues: true });
200
+ res.uploadDatasetImage200ApplicationJSONObject = utils.deserializeJSONResponse(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.UploadDatasetImage200ApplicationJSON);
186
201
  }
187
202
  break;
188
203
  }
@@ -220,11 +235,15 @@ var Dataset = /** @class */ (function () {
220
235
  var contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
221
236
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null)
222
237
  throw new Error("status code not found in response: ".concat(httpRes));
223
- var res = { statusCode: httpRes.status, contentType: contentType, rawResponse: httpRes };
238
+ var res = new operations.UploadDatasetImageFromGenResponse({
239
+ statusCode: httpRes.status,
240
+ contentType: contentType,
241
+ rawResponse: httpRes
242
+ });
224
243
  switch (true) {
225
244
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
226
245
  if (utils.matchContentType(contentType, "application/json")) {
227
- res.uploadDatasetImageFromGen200ApplicationJSONObject = (0, class_transformer_1.plainToInstance)(operations.UploadDatasetImageFromGen200ApplicationJSON, httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, { excludeExtraneousValues: true });
246
+ res.uploadDatasetImageFromGen200ApplicationJSONObject = utils.deserializeJSONResponse(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.UploadDatasetImageFromGen200ApplicationJSON);
228
247
  }
229
248
  break;
230
249
  }
@@ -37,7 +37,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.Generation = void 0;
38
38
  var utils = __importStar(require("../internal/utils"));
39
39
  var operations = __importStar(require("./models/operations"));
40
- var class_transformer_1 = require("class-transformer");
41
40
  var Generation = /** @class */ (function () {
42
41
  function Generation(defaultClient, securityClient, serverURL, language, sdkVersion, genVersion) {
43
42
  this._defaultClient = defaultClient;
@@ -78,11 +77,15 @@ var Generation = /** @class */ (function () {
78
77
  var contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
79
78
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null)
80
79
  throw new Error("status code not found in response: ".concat(httpRes));
81
- var res = { statusCode: httpRes.status, contentType: contentType, rawResponse: httpRes };
80
+ var res = new operations.CreateGenerationResponse({
81
+ statusCode: httpRes.status,
82
+ contentType: contentType,
83
+ rawResponse: httpRes
84
+ });
82
85
  switch (true) {
83
86
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
84
87
  if (utils.matchContentType(contentType, "application/json")) {
85
- res.createGeneration200ApplicationJSONObject = (0, class_transformer_1.plainToInstance)(operations.CreateGeneration200ApplicationJSON, httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, { excludeExtraneousValues: true });
88
+ res.createGeneration200ApplicationJSONObject = utils.deserializeJSONResponse(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.CreateGeneration200ApplicationJSON);
86
89
  }
87
90
  break;
88
91
  }
@@ -107,11 +110,15 @@ var Generation = /** @class */ (function () {
107
110
  var contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
108
111
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null)
109
112
  throw new Error("status code not found in response: ".concat(httpRes));
110
- var res = { statusCode: httpRes.status, contentType: contentType, rawResponse: httpRes };
113
+ var res = new operations.DeleteGenerationByIdResponse({
114
+ statusCode: httpRes.status,
115
+ contentType: contentType,
116
+ rawResponse: httpRes
117
+ });
111
118
  switch (true) {
112
119
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
113
120
  if (utils.matchContentType(contentType, "application/json")) {
114
- res.deleteGenerationById200ApplicationJSONObject = (0, class_transformer_1.plainToInstance)(operations.DeleteGenerationById200ApplicationJSON, httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, { excludeExtraneousValues: true });
121
+ res.deleteGenerationById200ApplicationJSONObject = utils.deserializeJSONResponse(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.DeleteGenerationById200ApplicationJSON);
115
122
  }
116
123
  break;
117
124
  }
@@ -136,11 +143,15 @@ var Generation = /** @class */ (function () {
136
143
  var contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
137
144
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null)
138
145
  throw new Error("status code not found in response: ".concat(httpRes));
139
- var res = { statusCode: httpRes.status, contentType: contentType, rawResponse: httpRes };
146
+ var res = new operations.GetGenerationByIdResponse({
147
+ statusCode: httpRes.status,
148
+ contentType: contentType,
149
+ rawResponse: httpRes
150
+ });
140
151
  switch (true) {
141
152
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
142
153
  if (utils.matchContentType(contentType, "application/json")) {
143
- res.getGenerationById200ApplicationJSONObject = (0, class_transformer_1.plainToInstance)(operations.GetGenerationById200ApplicationJSON, httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, { excludeExtraneousValues: true });
154
+ res.getGenerationById200ApplicationJSONObject = utils.deserializeJSONResponse(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.GetGenerationById200ApplicationJSON);
144
155
  }
145
156
  break;
146
157
  }
@@ -166,11 +177,15 @@ var Generation = /** @class */ (function () {
166
177
  var contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
167
178
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null)
168
179
  throw new Error("status code not found in response: ".concat(httpRes));
169
- var res = { statusCode: httpRes.status, contentType: contentType, rawResponse: httpRes };
180
+ var res = new operations.GetGenerationsByUserIdResponse({
181
+ statusCode: httpRes.status,
182
+ contentType: contentType,
183
+ rawResponse: httpRes
184
+ });
170
185
  switch (true) {
171
186
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
172
187
  if (utils.matchContentType(contentType, "application/json")) {
173
- res.getGenerationsByUserId200ApplicationJSONObject = (0, class_transformer_1.plainToInstance)(operations.GetGenerationsByUserId200ApplicationJSON, httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, { excludeExtraneousValues: true });
188
+ res.getGenerationsByUserId200ApplicationJSONObject = utils.deserializeJSONResponse(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.GetGenerationsByUserId200ApplicationJSON);
174
189
  }
175
190
  break;
176
191
  }
@@ -37,7 +37,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.InitImage = void 0;
38
38
  var utils = __importStar(require("../internal/utils"));
39
39
  var operations = __importStar(require("./models/operations"));
40
- var class_transformer_1 = require("class-transformer");
41
40
  var InitImage = /** @class */ (function () {
42
41
  function InitImage(defaultClient, securityClient, serverURL, language, sdkVersion, genVersion) {
43
42
  this._defaultClient = defaultClient;
@@ -65,11 +64,15 @@ var InitImage = /** @class */ (function () {
65
64
  var contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
66
65
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null)
67
66
  throw new Error("status code not found in response: ".concat(httpRes));
68
- var res = { statusCode: httpRes.status, contentType: contentType, rawResponse: httpRes };
67
+ var res = new operations.DeleteInitImageByIdResponse({
68
+ statusCode: httpRes.status,
69
+ contentType: contentType,
70
+ rawResponse: httpRes
71
+ });
69
72
  switch (true) {
70
73
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
71
74
  if (utils.matchContentType(contentType, "application/json")) {
72
- res.deleteInitImageById200ApplicationJSONObject = (0, class_transformer_1.plainToInstance)(operations.DeleteInitImageById200ApplicationJSON, httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, { excludeExtraneousValues: true });
75
+ res.deleteInitImageById200ApplicationJSONObject = utils.deserializeJSONResponse(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.DeleteInitImageById200ApplicationJSON);
73
76
  }
74
77
  break;
75
78
  }
@@ -94,11 +97,15 @@ var InitImage = /** @class */ (function () {
94
97
  var contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
95
98
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null)
96
99
  throw new Error("status code not found in response: ".concat(httpRes));
97
- var res = { statusCode: httpRes.status, contentType: contentType, rawResponse: httpRes };
100
+ var res = new operations.GetInitImageByIdResponse({
101
+ statusCode: httpRes.status,
102
+ contentType: contentType,
103
+ rawResponse: httpRes
104
+ });
98
105
  switch (true) {
99
106
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
100
107
  if (utils.matchContentType(contentType, "application/json")) {
101
- res.getInitImageById200ApplicationJSONObject = (0, class_transformer_1.plainToInstance)(operations.GetInitImageById200ApplicationJSON, httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, { excludeExtraneousValues: true });
108
+ res.getInitImageById200ApplicationJSONObject = utils.deserializeJSONResponse(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.GetInitImageById200ApplicationJSON);
102
109
  }
103
110
  break;
104
111
  }
@@ -136,11 +143,15 @@ var InitImage = /** @class */ (function () {
136
143
  var contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
137
144
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null)
138
145
  throw new Error("status code not found in response: ".concat(httpRes));
139
- var res = { statusCode: httpRes.status, contentType: contentType, rawResponse: httpRes };
146
+ var res = new operations.UploadInitImageResponse({
147
+ statusCode: httpRes.status,
148
+ contentType: contentType,
149
+ rawResponse: httpRes
150
+ });
140
151
  switch (true) {
141
152
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
142
153
  if (utils.matchContentType(contentType, "application/json")) {
143
- res.uploadInitImage200ApplicationJSONObject = (0, class_transformer_1.plainToInstance)(operations.UploadInitImage200ApplicationJSON, httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, { excludeExtraneousValues: true });
154
+ res.uploadInitImage200ApplicationJSONObject = utils.deserializeJSONResponse(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.UploadInitImage200ApplicationJSON);
144
155
  }
145
156
  break;
146
157
  }
package/dist/sdk/model.js CHANGED
@@ -37,7 +37,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.Model = void 0;
38
38
  var utils = __importStar(require("../internal/utils"));
39
39
  var operations = __importStar(require("./models/operations"));
40
- var class_transformer_1 = require("class-transformer");
41
40
  var Model = /** @class */ (function () {
42
41
  function Model(defaultClient, securityClient, serverURL, language, sdkVersion, genVersion) {
43
42
  this._defaultClient = defaultClient;
@@ -78,11 +77,15 @@ var Model = /** @class */ (function () {
78
77
  var contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
79
78
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null)
80
79
  throw new Error("status code not found in response: ".concat(httpRes));
81
- var res = { statusCode: httpRes.status, contentType: contentType, rawResponse: httpRes };
80
+ var res = new operations.CreateModelResponse({
81
+ statusCode: httpRes.status,
82
+ contentType: contentType,
83
+ rawResponse: httpRes
84
+ });
82
85
  switch (true) {
83
86
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
84
87
  if (utils.matchContentType(contentType, "application/json")) {
85
- res.createModel200ApplicationJSONObject = (0, class_transformer_1.plainToInstance)(operations.CreateModel200ApplicationJSON, httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, { excludeExtraneousValues: true });
88
+ res.createModel200ApplicationJSONObject = utils.deserializeJSONResponse(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.CreateModel200ApplicationJSON);
86
89
  }
87
90
  break;
88
91
  }
@@ -107,11 +110,15 @@ var Model = /** @class */ (function () {
107
110
  var contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
108
111
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null)
109
112
  throw new Error("status code not found in response: ".concat(httpRes));
110
- var res = { statusCode: httpRes.status, contentType: contentType, rawResponse: httpRes };
113
+ var res = new operations.DeleteModelByIdResponse({
114
+ statusCode: httpRes.status,
115
+ contentType: contentType,
116
+ rawResponse: httpRes
117
+ });
111
118
  switch (true) {
112
119
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
113
120
  if (utils.matchContentType(contentType, "application/json")) {
114
- res.deleteModelById200ApplicationJSONObject = (0, class_transformer_1.plainToInstance)(operations.DeleteModelById200ApplicationJSON, httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, { excludeExtraneousValues: true });
121
+ res.deleteModelById200ApplicationJSONObject = utils.deserializeJSONResponse(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.DeleteModelById200ApplicationJSON);
115
122
  }
116
123
  break;
117
124
  }
@@ -136,11 +143,15 @@ var Model = /** @class */ (function () {
136
143
  var contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
137
144
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null)
138
145
  throw new Error("status code not found in response: ".concat(httpRes));
139
- var res = { statusCode: httpRes.status, contentType: contentType, rawResponse: httpRes };
146
+ var res = new operations.GetModelByIdResponse({
147
+ statusCode: httpRes.status,
148
+ contentType: contentType,
149
+ rawResponse: httpRes
150
+ });
140
151
  switch (true) {
141
152
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
142
153
  if (utils.matchContentType(contentType, "application/json")) {
143
- res.getModelById200ApplicationJSONObject = (0, class_transformer_1.plainToInstance)(operations.GetModelById200ApplicationJSON, httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, { excludeExtraneousValues: true });
154
+ res.getModelById200ApplicationJSONObject = utils.deserializeJSONResponse(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.GetModelById200ApplicationJSON);
144
155
  }
145
156
  break;
146
157
  }
package/dist/sdk/sdk.d.ts CHANGED
@@ -25,5 +25,5 @@ export declare class Leonardo {
25
25
  private _language;
26
26
  private _sdkVersion;
27
27
  private _genVersion;
28
- constructor(props: SDKProps);
28
+ constructor(props?: SDKProps);
29
29
  }
package/dist/sdk/sdk.js CHANGED
@@ -44,11 +44,11 @@ var Leonardo = /** @class */ (function () {
44
44
  function Leonardo(props) {
45
45
  var _a, _b;
46
46
  this._language = "typescript";
47
- this._sdkVersion = "1.7.4";
48
- this._genVersion = "1.8.5";
49
- this._serverURL = (_a = props.serverUrl) !== null && _a !== void 0 ? _a : exports.ServerList[0];
50
- this._defaultClient = (_b = props.defaultClient) !== null && _b !== void 0 ? _b : axios_1.default.create({ baseURL: this._serverURL });
51
- if (props.security) {
47
+ this._sdkVersion = "1.8.3";
48
+ this._genVersion = "1.9.2";
49
+ this._serverURL = (_a = props === null || props === void 0 ? void 0 : props.serverUrl) !== null && _a !== void 0 ? _a : exports.ServerList[0];
50
+ this._defaultClient = (_b = props === null || props === void 0 ? void 0 : props.defaultClient) !== null && _b !== void 0 ? _b : axios_1.default.create({ baseURL: this._serverURL });
51
+ if (props === null || props === void 0 ? void 0 : props.security) {
52
52
  var security = props.security;
53
53
  if (!(props.security instanceof utils.SpeakeasyBase))
54
54
  security = new shared.Security(props.security);
package/dist/sdk/user.js CHANGED
@@ -37,7 +37,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.User = void 0;
38
38
  var utils = __importStar(require("../internal/utils"));
39
39
  var operations = __importStar(require("./models/operations"));
40
- var class_transformer_1 = require("class-transformer");
41
40
  var User = /** @class */ (function () {
42
41
  function User(defaultClient, securityClient, serverURL, language, sdkVersion, genVersion) {
43
42
  this._defaultClient = defaultClient;
@@ -62,11 +61,15 @@ var User = /** @class */ (function () {
62
61
  var contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
63
62
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null)
64
63
  throw new Error("status code not found in response: ".concat(httpRes));
65
- var res = { statusCode: httpRes.status, contentType: contentType, rawResponse: httpRes };
64
+ var res = new operations.GetUserSelfResponse({
65
+ statusCode: httpRes.status,
66
+ contentType: contentType,
67
+ rawResponse: httpRes
68
+ });
66
69
  switch (true) {
67
70
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
68
71
  if (utils.matchContentType(contentType, "application/json")) {
69
- res.getUserSelf200ApplicationJSONObject = (0, class_transformer_1.plainToInstance)(operations.GetUserSelf200ApplicationJSON, httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, { excludeExtraneousValues: true });
72
+ res.getUserSelf200ApplicationJSONObject = utils.deserializeJSONResponse(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.GetUserSelf200ApplicationJSON);
70
73
  }
71
74
  break;
72
75
  }
@@ -37,7 +37,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.Variation = void 0;
38
38
  var utils = __importStar(require("../internal/utils"));
39
39
  var operations = __importStar(require("./models/operations"));
40
- var class_transformer_1 = require("class-transformer");
41
40
  var Variation = /** @class */ (function () {
42
41
  function Variation(defaultClient, securityClient, serverURL, language, sdkVersion, genVersion) {
43
42
  this._defaultClient = defaultClient;
@@ -76,11 +75,15 @@ var Variation = /** @class */ (function () {
76
75
  var contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
77
76
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null)
78
77
  throw new Error("status code not found in response: ".concat(httpRes));
79
- var res = { statusCode: httpRes.status, contentType: contentType, rawResponse: httpRes };
78
+ var res = new operations.CreateVariationUpscaleResponse({
79
+ statusCode: httpRes.status,
80
+ contentType: contentType,
81
+ rawResponse: httpRes
82
+ });
80
83
  switch (true) {
81
84
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
82
85
  if (utils.matchContentType(contentType, "application/json")) {
83
- res.createVariationUpscale200ApplicationJSONObject = (0, class_transformer_1.plainToInstance)(operations.CreateVariationUpscale200ApplicationJSON, httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, { excludeExtraneousValues: true });
86
+ res.createVariationUpscale200ApplicationJSONObject = utils.deserializeJSONResponse(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.CreateVariationUpscale200ApplicationJSON);
84
87
  }
85
88
  break;
86
89
  }
@@ -105,11 +108,15 @@ var Variation = /** @class */ (function () {
105
108
  var contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
106
109
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null)
107
110
  throw new Error("status code not found in response: ".concat(httpRes));
108
- var res = { statusCode: httpRes.status, contentType: contentType, rawResponse: httpRes };
111
+ var res = new operations.GetVariationByIdResponse({
112
+ statusCode: httpRes.status,
113
+ contentType: contentType,
114
+ rawResponse: httpRes
115
+ });
109
116
  switch (true) {
110
117
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
111
118
  if (utils.matchContentType(contentType, "application/json")) {
112
- res.getVariationById200ApplicationJSONObject = (0, class_transformer_1.plainToInstance)(operations.GetVariationById200ApplicationJSON, httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, { excludeExtraneousValues: true });
119
+ res.getVariationById200ApplicationJSONObject = utils.deserializeJSONResponse(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.GetVariationById200ApplicationJSON);
113
120
  }
114
121
  break;
115
122
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leonardo-ai/sdk",
3
- "version": "1.7.4",
3
+ "version": "1.8.3",
4
4
  "author": "leonardoai",
5
5
  "scripts": {
6
6
  "prepare": "tsc --build"