@leonardo-ai/sdk 1.3.5 → 1.7.4

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 (55) hide show
  1. package/README.md +8 -4
  2. package/dist/internal/utils/headers.js +4 -4
  3. package/dist/internal/utils/pathparams.d.ts +1 -8
  4. package/dist/internal/utils/pathparams.js +11 -18
  5. package/dist/internal/utils/queryparams.d.ts +1 -2
  6. package/dist/internal/utils/queryparams.js +100 -50
  7. package/dist/internal/utils/requestbody.js +90 -57
  8. package/dist/internal/utils/security.js +69 -57
  9. package/dist/internal/utils/utils.d.ts +11 -2
  10. package/dist/internal/utils/utils.js +51 -15
  11. package/dist/sdk/dataset.js +11 -10
  12. package/dist/sdk/generation.js +11 -11
  13. package/dist/sdk/initimage.js +7 -6
  14. package/dist/sdk/model.js +7 -6
  15. package/dist/sdk/models/operations/createdataset.d.ts +2 -0
  16. package/dist/sdk/models/operations/createdataset.js +14 -4
  17. package/dist/sdk/models/operations/creategeneration.d.ts +2 -0
  18. package/dist/sdk/models/operations/creategeneration.js +42 -18
  19. package/dist/sdk/models/operations/createmodel.d.ts +2 -0
  20. package/dist/sdk/models/operations/createmodel.js +28 -11
  21. package/dist/sdk/models/operations/createvariationupscale.d.ts +2 -0
  22. package/dist/sdk/models/operations/createvariationupscale.js +12 -3
  23. package/dist/sdk/models/operations/deletedatasetbyid.d.ts +2 -0
  24. package/dist/sdk/models/operations/deletedatasetbyid.js +10 -2
  25. package/dist/sdk/models/operations/deletegenerationbyid.d.ts +2 -0
  26. package/dist/sdk/models/operations/deletegenerationbyid.js +10 -2
  27. package/dist/sdk/models/operations/deleteinitimagebyid.d.ts +2 -0
  28. package/dist/sdk/models/operations/deleteinitimagebyid.js +10 -2
  29. package/dist/sdk/models/operations/deletemodelbyid.d.ts +2 -0
  30. package/dist/sdk/models/operations/deletemodelbyid.js +10 -2
  31. package/dist/sdk/models/operations/getdatasetbyid.d.ts +2 -0
  32. package/dist/sdk/models/operations/getdatasetbyid.js +27 -10
  33. package/dist/sdk/models/operations/getgenerationbyid.d.ts +2 -0
  34. package/dist/sdk/models/operations/getgenerationbyid.js +60 -26
  35. package/dist/sdk/models/operations/getgenerationsbyuserid.d.ts +2 -0
  36. package/dist/sdk/models/operations/getgenerationsbyuserid.js +60 -26
  37. package/dist/sdk/models/operations/getinitimagebyid.d.ts +2 -0
  38. package/dist/sdk/models/operations/getinitimagebyid.js +14 -4
  39. package/dist/sdk/models/operations/getmodelbyid.d.ts +2 -0
  40. package/dist/sdk/models/operations/getmodelbyid.js +32 -13
  41. package/dist/sdk/models/operations/getuserself.d.ts +2 -0
  42. package/dist/sdk/models/operations/getuserself.js +17 -5
  43. package/dist/sdk/models/operations/getvariationbyid.d.ts +2 -0
  44. package/dist/sdk/models/operations/getvariationbyid.js +18 -6
  45. package/dist/sdk/models/operations/uploaddatasetimage.d.ts +2 -0
  46. package/dist/sdk/models/operations/uploaddatasetimage.js +18 -6
  47. package/dist/sdk/models/operations/uploaddatasetimagefromgen.d.ts +2 -0
  48. package/dist/sdk/models/operations/uploaddatasetimagefromgen.js +12 -3
  49. package/dist/sdk/models/operations/uploadinitimage.d.ts +2 -0
  50. package/dist/sdk/models/operations/uploadinitimage.js +20 -7
  51. package/dist/sdk/sdk.d.ts +2 -2
  52. package/dist/sdk/sdk.js +5 -4
  53. package/dist/sdk/user.js +4 -2
  54. package/dist/sdk/variation.js +5 -4
  55. package/package.json +2 -3
@@ -50,6 +50,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
50
50
  exports.GetModelByIdResponse = exports.GetModelById200ApplicationJSON = exports.GetModelById200ApplicationJSONCustomModels = exports.GetModelByIdRequest = exports.GetModelByIdPathParams = void 0;
51
51
  var utils_1 = require("../../../internal/utils");
52
52
  var shared = __importStar(require("../shared"));
53
+ var class_transformer_1 = require("class-transformer");
53
54
  var GetModelByIdPathParams = /** @class */ (function (_super) {
54
55
  __extends(GetModelByIdPathParams, _super);
55
56
  function GetModelByIdPathParams() {
@@ -84,51 +85,63 @@ var GetModelById200ApplicationJSONCustomModels = /** @class */ (function (_super
84
85
  return _super !== null && _super.apply(this, arguments) || this;
85
86
  }
86
87
  __decorate([
87
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=createdAt" }),
88
+ (0, utils_1.SpeakeasyMetadata)(),
89
+ (0, class_transformer_1.Expose)({ name: "createdAt" }),
88
90
  __metadata("design:type", String)
89
91
  ], GetModelById200ApplicationJSONCustomModels.prototype, "createdAt", void 0);
90
92
  __decorate([
91
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=description" }),
93
+ (0, utils_1.SpeakeasyMetadata)(),
94
+ (0, class_transformer_1.Expose)({ name: "description" }),
92
95
  __metadata("design:type", String)
93
96
  ], GetModelById200ApplicationJSONCustomModels.prototype, "description", void 0);
94
97
  __decorate([
95
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=id" }),
98
+ (0, utils_1.SpeakeasyMetadata)(),
99
+ (0, class_transformer_1.Expose)({ name: "id" }),
96
100
  __metadata("design:type", String)
97
101
  ], GetModelById200ApplicationJSONCustomModels.prototype, "id", void 0);
98
102
  __decorate([
99
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=instancePrompt" }),
103
+ (0, utils_1.SpeakeasyMetadata)(),
104
+ (0, class_transformer_1.Expose)({ name: "instancePrompt" }),
100
105
  __metadata("design:type", String)
101
106
  ], GetModelById200ApplicationJSONCustomModels.prototype, "instancePrompt", void 0);
102
107
  __decorate([
103
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=modelHeight" }),
108
+ (0, utils_1.SpeakeasyMetadata)(),
109
+ (0, class_transformer_1.Expose)({ name: "modelHeight" }),
104
110
  __metadata("design:type", Number)
105
111
  ], GetModelById200ApplicationJSONCustomModels.prototype, "modelHeight", void 0);
106
112
  __decorate([
107
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=modelWidth" }),
113
+ (0, utils_1.SpeakeasyMetadata)(),
114
+ (0, class_transformer_1.Expose)({ name: "modelWidth" }),
108
115
  __metadata("design:type", Number)
109
116
  ], GetModelById200ApplicationJSONCustomModels.prototype, "modelWidth", void 0);
110
117
  __decorate([
111
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=name" }),
118
+ (0, utils_1.SpeakeasyMetadata)(),
119
+ (0, class_transformer_1.Expose)({ name: "name" }),
112
120
  __metadata("design:type", String)
113
121
  ], GetModelById200ApplicationJSONCustomModels.prototype, "name", void 0);
114
122
  __decorate([
115
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=public" }),
123
+ (0, utils_1.SpeakeasyMetadata)(),
124
+ (0, class_transformer_1.Expose)({ name: "public" }),
116
125
  __metadata("design:type", Boolean)
117
126
  ], GetModelById200ApplicationJSONCustomModels.prototype, "public", void 0);
118
127
  __decorate([
119
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=sdVersion" }),
128
+ (0, utils_1.SpeakeasyMetadata)(),
129
+ (0, class_transformer_1.Expose)({ name: "sdVersion" }),
120
130
  __metadata("design:type", String)
121
131
  ], GetModelById200ApplicationJSONCustomModels.prototype, "sdVersion", void 0);
122
132
  __decorate([
123
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=status" }),
133
+ (0, utils_1.SpeakeasyMetadata)(),
134
+ (0, class_transformer_1.Expose)({ name: "status" }),
124
135
  __metadata("design:type", String)
125
136
  ], GetModelById200ApplicationJSONCustomModels.prototype, "status", void 0);
126
137
  __decorate([
127
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=type" }),
138
+ (0, utils_1.SpeakeasyMetadata)(),
139
+ (0, class_transformer_1.Expose)({ name: "type" }),
128
140
  __metadata("design:type", String)
129
141
  ], GetModelById200ApplicationJSONCustomModels.prototype, "type", void 0);
130
142
  __decorate([
131
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=updatedAt" }),
143
+ (0, utils_1.SpeakeasyMetadata)(),
144
+ (0, class_transformer_1.Expose)({ name: "updatedAt" }),
132
145
  __metadata("design:type", String)
133
146
  ], GetModelById200ApplicationJSONCustomModels.prototype, "updatedAt", void 0);
134
147
  return GetModelById200ApplicationJSONCustomModels;
@@ -140,7 +153,9 @@ var GetModelById200ApplicationJSON = /** @class */ (function (_super) {
140
153
  return _super !== null && _super.apply(this, arguments) || this;
141
154
  }
142
155
  __decorate([
143
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=custom_models_by_pk" }),
156
+ (0, utils_1.SpeakeasyMetadata)(),
157
+ (0, class_transformer_1.Expose)({ name: "custom_models_by_pk" }),
158
+ (0, class_transformer_1.Type)(function () { return GetModelById200ApplicationJSONCustomModels; }),
144
159
  __metadata("design:type", GetModelById200ApplicationJSONCustomModels)
145
160
  ], GetModelById200ApplicationJSON.prototype, "customModelsByPk", void 0);
146
161
  return GetModelById200ApplicationJSON;
@@ -159,6 +174,10 @@ var GetModelByIdResponse = /** @class */ (function (_super) {
159
174
  (0, utils_1.SpeakeasyMetadata)(),
160
175
  __metadata("design:type", Number)
161
176
  ], GetModelByIdResponse.prototype, "statusCode", void 0);
177
+ __decorate([
178
+ (0, utils_1.SpeakeasyMetadata)(),
179
+ __metadata("design:type", Object)
180
+ ], GetModelByIdResponse.prototype, "rawResponse", void 0);
162
181
  __decorate([
163
182
  (0, utils_1.SpeakeasyMetadata)(),
164
183
  __metadata("design:type", GetModelById200ApplicationJSON)
@@ -1,4 +1,5 @@
1
1
  import { SpeakeasyBase } from "../../../internal/utils";
2
+ import { AxiosResponse } from "axios";
2
3
  /**
3
4
  * columns and relationships of "users"
4
5
  **/
@@ -19,5 +20,6 @@ export declare class GetUserSelf200ApplicationJSON extends SpeakeasyBase {
19
20
  export declare class GetUserSelfResponse extends SpeakeasyBase {
20
21
  contentType: string;
21
22
  statusCode: number;
23
+ rawResponse?: AxiosResponse;
22
24
  getUserSelf200ApplicationJSONObject?: GetUserSelf200ApplicationJSON;
23
25
  }
@@ -26,6 +26,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
26
26
  Object.defineProperty(exports, "__esModule", { value: true });
27
27
  exports.GetUserSelfResponse = exports.GetUserSelf200ApplicationJSON = exports.GetUserSelf200ApplicationJSONUserDetails = exports.GetUserSelf200ApplicationJSONUserDetailsUsers = void 0;
28
28
  var utils_1 = require("../../../internal/utils");
29
+ var class_transformer_1 = require("class-transformer");
29
30
  // GetUserSelf200ApplicationJSONUserDetailsUsers
30
31
  /**
31
32
  * columns and relationships of "users"
@@ -36,11 +37,13 @@ var GetUserSelf200ApplicationJSONUserDetailsUsers = /** @class */ (function (_su
36
37
  return _super !== null && _super.apply(this, arguments) || this;
37
38
  }
38
39
  __decorate([
39
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=id" }),
40
+ (0, utils_1.SpeakeasyMetadata)(),
41
+ (0, class_transformer_1.Expose)({ name: "id" }),
40
42
  __metadata("design:type", String)
41
43
  ], GetUserSelf200ApplicationJSONUserDetailsUsers.prototype, "id", void 0);
42
44
  __decorate([
43
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=username" }),
45
+ (0, utils_1.SpeakeasyMetadata)(),
46
+ (0, class_transformer_1.Expose)({ name: "username" }),
44
47
  __metadata("design:type", String)
45
48
  ], GetUserSelf200ApplicationJSONUserDetailsUsers.prototype, "username", void 0);
46
49
  return GetUserSelf200ApplicationJSONUserDetailsUsers;
@@ -56,11 +59,14 @@ var GetUserSelf200ApplicationJSONUserDetails = /** @class */ (function (_super)
56
59
  return _super !== null && _super.apply(this, arguments) || this;
57
60
  }
58
61
  __decorate([
59
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=showNsfw" }),
62
+ (0, utils_1.SpeakeasyMetadata)(),
63
+ (0, class_transformer_1.Expose)({ name: "showNsfw" }),
60
64
  __metadata("design:type", Boolean)
61
65
  ], GetUserSelf200ApplicationJSONUserDetails.prototype, "showNsfw", void 0);
62
66
  __decorate([
63
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=user" }),
67
+ (0, utils_1.SpeakeasyMetadata)(),
68
+ (0, class_transformer_1.Expose)({ name: "user" }),
69
+ (0, class_transformer_1.Type)(function () { return GetUserSelf200ApplicationJSONUserDetailsUsers; }),
64
70
  __metadata("design:type", GetUserSelf200ApplicationJSONUserDetailsUsers)
65
71
  ], GetUserSelf200ApplicationJSONUserDetails.prototype, "user", void 0);
66
72
  return GetUserSelf200ApplicationJSONUserDetails;
@@ -72,7 +78,9 @@ var GetUserSelf200ApplicationJSON = /** @class */ (function (_super) {
72
78
  return _super !== null && _super.apply(this, arguments) || this;
73
79
  }
74
80
  __decorate([
75
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=user_details", elemType: GetUserSelf200ApplicationJSONUserDetails }),
81
+ (0, utils_1.SpeakeasyMetadata)({ elemType: GetUserSelf200ApplicationJSONUserDetails }),
82
+ (0, class_transformer_1.Expose)({ name: "user_details" }),
83
+ (0, class_transformer_1.Type)(function () { return GetUserSelf200ApplicationJSONUserDetails; }),
76
84
  __metadata("design:type", Array)
77
85
  ], GetUserSelf200ApplicationJSON.prototype, "userDetails", void 0);
78
86
  return GetUserSelf200ApplicationJSON;
@@ -91,6 +99,10 @@ var GetUserSelfResponse = /** @class */ (function (_super) {
91
99
  (0, utils_1.SpeakeasyMetadata)(),
92
100
  __metadata("design:type", Number)
93
101
  ], GetUserSelfResponse.prototype, "statusCode", void 0);
102
+ __decorate([
103
+ (0, utils_1.SpeakeasyMetadata)(),
104
+ __metadata("design:type", Object)
105
+ ], GetUserSelfResponse.prototype, "rawResponse", void 0);
94
106
  __decorate([
95
107
  (0, utils_1.SpeakeasyMetadata)(),
96
108
  __metadata("design:type", GetUserSelf200ApplicationJSON)
@@ -1,5 +1,6 @@
1
1
  import { SpeakeasyBase } from "../../../internal/utils";
2
2
  import * as shared from "../shared";
3
+ import { AxiosResponse } from "axios";
3
4
  export declare class GetVariationByIdPathParams extends SpeakeasyBase {
4
5
  id: string;
5
6
  }
@@ -22,5 +23,6 @@ export declare class GetVariationById200ApplicationJSON extends SpeakeasyBase {
22
23
  export declare class GetVariationByIdResponse extends SpeakeasyBase {
23
24
  contentType: string;
24
25
  statusCode: number;
26
+ rawResponse?: AxiosResponse;
25
27
  getVariationById200ApplicationJSONObject?: GetVariationById200ApplicationJSON;
26
28
  }
@@ -50,6 +50,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
50
50
  exports.GetVariationByIdResponse = exports.GetVariationById200ApplicationJSON = exports.GetVariationById200ApplicationJSONGeneratedImageVariationGeneric = exports.GetVariationByIdRequest = exports.GetVariationByIdPathParams = void 0;
51
51
  var utils_1 = require("../../../internal/utils");
52
52
  var shared = __importStar(require("../shared"));
53
+ var class_transformer_1 = require("class-transformer");
53
54
  var GetVariationByIdPathParams = /** @class */ (function (_super) {
54
55
  __extends(GetVariationByIdPathParams, _super);
55
56
  function GetVariationByIdPathParams() {
@@ -84,23 +85,28 @@ var GetVariationById200ApplicationJSONGeneratedImageVariationGeneric = /** @clas
84
85
  return _super !== null && _super.apply(this, arguments) || this;
85
86
  }
86
87
  __decorate([
87
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=createdAt" }),
88
+ (0, utils_1.SpeakeasyMetadata)(),
89
+ (0, class_transformer_1.Expose)({ name: "createdAt" }),
88
90
  __metadata("design:type", String)
89
91
  ], GetVariationById200ApplicationJSONGeneratedImageVariationGeneric.prototype, "createdAt", void 0);
90
92
  __decorate([
91
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=id" }),
93
+ (0, utils_1.SpeakeasyMetadata)(),
94
+ (0, class_transformer_1.Expose)({ name: "id" }),
92
95
  __metadata("design:type", String)
93
96
  ], GetVariationById200ApplicationJSONGeneratedImageVariationGeneric.prototype, "id", void 0);
94
97
  __decorate([
95
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=status" }),
98
+ (0, utils_1.SpeakeasyMetadata)(),
99
+ (0, class_transformer_1.Expose)({ name: "status" }),
96
100
  __metadata("design:type", String)
97
101
  ], GetVariationById200ApplicationJSONGeneratedImageVariationGeneric.prototype, "status", void 0);
98
102
  __decorate([
99
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=transformType" }),
103
+ (0, utils_1.SpeakeasyMetadata)(),
104
+ (0, class_transformer_1.Expose)({ name: "transformType" }),
100
105
  __metadata("design:type", String)
101
106
  ], GetVariationById200ApplicationJSONGeneratedImageVariationGeneric.prototype, "transformType", void 0);
102
107
  __decorate([
103
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=url" }),
108
+ (0, utils_1.SpeakeasyMetadata)(),
109
+ (0, class_transformer_1.Expose)({ name: "url" }),
104
110
  __metadata("design:type", String)
105
111
  ], GetVariationById200ApplicationJSONGeneratedImageVariationGeneric.prototype, "url", void 0);
106
112
  return GetVariationById200ApplicationJSONGeneratedImageVariationGeneric;
@@ -112,7 +118,9 @@ var GetVariationById200ApplicationJSON = /** @class */ (function (_super) {
112
118
  return _super !== null && _super.apply(this, arguments) || this;
113
119
  }
114
120
  __decorate([
115
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=generated_image_variation_generic", elemType: GetVariationById200ApplicationJSONGeneratedImageVariationGeneric }),
121
+ (0, utils_1.SpeakeasyMetadata)({ elemType: GetVariationById200ApplicationJSONGeneratedImageVariationGeneric }),
122
+ (0, class_transformer_1.Expose)({ name: "generated_image_variation_generic" }),
123
+ (0, class_transformer_1.Type)(function () { return GetVariationById200ApplicationJSONGeneratedImageVariationGeneric; }),
116
124
  __metadata("design:type", Array)
117
125
  ], GetVariationById200ApplicationJSON.prototype, "generatedImageVariationGeneric", void 0);
118
126
  return GetVariationById200ApplicationJSON;
@@ -131,6 +139,10 @@ var GetVariationByIdResponse = /** @class */ (function (_super) {
131
139
  (0, utils_1.SpeakeasyMetadata)(),
132
140
  __metadata("design:type", Number)
133
141
  ], GetVariationByIdResponse.prototype, "statusCode", void 0);
142
+ __decorate([
143
+ (0, utils_1.SpeakeasyMetadata)(),
144
+ __metadata("design:type", Object)
145
+ ], GetVariationByIdResponse.prototype, "rawResponse", void 0);
134
146
  __decorate([
135
147
  (0, utils_1.SpeakeasyMetadata)(),
136
148
  __metadata("design:type", GetVariationById200ApplicationJSON)
@@ -1,4 +1,5 @@
1
1
  import { SpeakeasyBase } from "../../../internal/utils";
2
+ import { AxiosResponse } from "axios";
2
3
  export declare class UploadDatasetImagePathParams extends SpeakeasyBase {
3
4
  datasetId: string;
4
5
  }
@@ -21,5 +22,6 @@ export declare class UploadDatasetImage200ApplicationJSON extends SpeakeasyBase
21
22
  export declare class UploadDatasetImageResponse extends SpeakeasyBase {
22
23
  contentType: string;
23
24
  statusCode: number;
25
+ rawResponse?: AxiosResponse;
24
26
  uploadDatasetImage200ApplicationJSONObject?: UploadDatasetImage200ApplicationJSON;
25
27
  }
@@ -26,6 +26,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
26
26
  Object.defineProperty(exports, "__esModule", { value: true });
27
27
  exports.UploadDatasetImageResponse = exports.UploadDatasetImage200ApplicationJSON = exports.UploadDatasetImage200ApplicationJSONDatasetUploadOutput = exports.UploadDatasetImageRequest = exports.UploadDatasetImageRequestBody = exports.UploadDatasetImagePathParams = void 0;
28
28
  var utils_1 = require("../../../internal/utils");
29
+ var class_transformer_1 = require("class-transformer");
29
30
  var UploadDatasetImagePathParams = /** @class */ (function (_super) {
30
31
  __extends(UploadDatasetImagePathParams, _super);
31
32
  function UploadDatasetImagePathParams() {
@@ -44,7 +45,8 @@ var UploadDatasetImageRequestBody = /** @class */ (function (_super) {
44
45
  return _super !== null && _super.apply(this, arguments) || this;
45
46
  }
46
47
  __decorate([
47
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=extension" }),
48
+ (0, utils_1.SpeakeasyMetadata)(),
49
+ (0, class_transformer_1.Expose)({ name: "extension" }),
48
50
  __metadata("design:type", String)
49
51
  ], UploadDatasetImageRequestBody.prototype, "extension", void 0);
50
52
  return UploadDatasetImageRequestBody;
@@ -72,19 +74,23 @@ var UploadDatasetImage200ApplicationJSONDatasetUploadOutput = /** @class */ (fun
72
74
  return _super !== null && _super.apply(this, arguments) || this;
73
75
  }
74
76
  __decorate([
75
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=fields" }),
77
+ (0, utils_1.SpeakeasyMetadata)(),
78
+ (0, class_transformer_1.Expose)({ name: "fields" }),
76
79
  __metadata("design:type", String)
77
80
  ], UploadDatasetImage200ApplicationJSONDatasetUploadOutput.prototype, "fields", void 0);
78
81
  __decorate([
79
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=id" }),
82
+ (0, utils_1.SpeakeasyMetadata)(),
83
+ (0, class_transformer_1.Expose)({ name: "id" }),
80
84
  __metadata("design:type", String)
81
85
  ], UploadDatasetImage200ApplicationJSONDatasetUploadOutput.prototype, "id", void 0);
82
86
  __decorate([
83
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=key" }),
87
+ (0, utils_1.SpeakeasyMetadata)(),
88
+ (0, class_transformer_1.Expose)({ name: "key" }),
84
89
  __metadata("design:type", String)
85
90
  ], UploadDatasetImage200ApplicationJSONDatasetUploadOutput.prototype, "key", void 0);
86
91
  __decorate([
87
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=url" }),
92
+ (0, utils_1.SpeakeasyMetadata)(),
93
+ (0, class_transformer_1.Expose)({ name: "url" }),
88
94
  __metadata("design:type", String)
89
95
  ], UploadDatasetImage200ApplicationJSONDatasetUploadOutput.prototype, "url", void 0);
90
96
  return UploadDatasetImage200ApplicationJSONDatasetUploadOutput;
@@ -96,7 +102,9 @@ var UploadDatasetImage200ApplicationJSON = /** @class */ (function (_super) {
96
102
  return _super !== null && _super.apply(this, arguments) || this;
97
103
  }
98
104
  __decorate([
99
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=uploadDatasetImage" }),
105
+ (0, utils_1.SpeakeasyMetadata)(),
106
+ (0, class_transformer_1.Expose)({ name: "uploadDatasetImage" }),
107
+ (0, class_transformer_1.Type)(function () { return UploadDatasetImage200ApplicationJSONDatasetUploadOutput; }),
100
108
  __metadata("design:type", UploadDatasetImage200ApplicationJSONDatasetUploadOutput)
101
109
  ], UploadDatasetImage200ApplicationJSON.prototype, "uploadDatasetImage", void 0);
102
110
  return UploadDatasetImage200ApplicationJSON;
@@ -115,6 +123,10 @@ var UploadDatasetImageResponse = /** @class */ (function (_super) {
115
123
  (0, utils_1.SpeakeasyMetadata)(),
116
124
  __metadata("design:type", Number)
117
125
  ], UploadDatasetImageResponse.prototype, "statusCode", void 0);
126
+ __decorate([
127
+ (0, utils_1.SpeakeasyMetadata)(),
128
+ __metadata("design:type", Object)
129
+ ], UploadDatasetImageResponse.prototype, "rawResponse", void 0);
118
130
  __decorate([
119
131
  (0, utils_1.SpeakeasyMetadata)(),
120
132
  __metadata("design:type", UploadDatasetImage200ApplicationJSON)
@@ -1,4 +1,5 @@
1
1
  import { SpeakeasyBase } from "../../../internal/utils";
2
+ import { AxiosResponse } from "axios";
2
3
  export declare class UploadDatasetImageFromGenPathParams extends SpeakeasyBase {
3
4
  datasetId: string;
4
5
  }
@@ -18,5 +19,6 @@ export declare class UploadDatasetImageFromGen200ApplicationJSON extends Speakea
18
19
  export declare class UploadDatasetImageFromGenResponse extends SpeakeasyBase {
19
20
  contentType: string;
20
21
  statusCode: number;
22
+ rawResponse?: AxiosResponse;
21
23
  uploadDatasetImageFromGen200ApplicationJSONObject?: UploadDatasetImageFromGen200ApplicationJSON;
22
24
  }
@@ -26,6 +26,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
26
26
  Object.defineProperty(exports, "__esModule", { value: true });
27
27
  exports.UploadDatasetImageFromGenResponse = exports.UploadDatasetImageFromGen200ApplicationJSON = exports.UploadDatasetImageFromGen200ApplicationJSONDatasetGenUploadOutput = exports.UploadDatasetImageFromGenRequest = exports.UploadDatasetImageFromGenRequestBody = exports.UploadDatasetImageFromGenPathParams = void 0;
28
28
  var utils_1 = require("../../../internal/utils");
29
+ var class_transformer_1 = require("class-transformer");
29
30
  var UploadDatasetImageFromGenPathParams = /** @class */ (function (_super) {
30
31
  __extends(UploadDatasetImageFromGenPathParams, _super);
31
32
  function UploadDatasetImageFromGenPathParams() {
@@ -44,7 +45,8 @@ var UploadDatasetImageFromGenRequestBody = /** @class */ (function (_super) {
44
45
  return _super !== null && _super.apply(this, arguments) || this;
45
46
  }
46
47
  __decorate([
47
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=generatedImageId" }),
48
+ (0, utils_1.SpeakeasyMetadata)(),
49
+ (0, class_transformer_1.Expose)({ name: "generatedImageId" }),
48
50
  __metadata("design:type", String)
49
51
  ], UploadDatasetImageFromGenRequestBody.prototype, "generatedImageId", void 0);
50
52
  return UploadDatasetImageFromGenRequestBody;
@@ -72,7 +74,8 @@ var UploadDatasetImageFromGen200ApplicationJSONDatasetGenUploadOutput = /** @cla
72
74
  return _super !== null && _super.apply(this, arguments) || this;
73
75
  }
74
76
  __decorate([
75
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=id" }),
77
+ (0, utils_1.SpeakeasyMetadata)(),
78
+ (0, class_transformer_1.Expose)({ name: "id" }),
76
79
  __metadata("design:type", String)
77
80
  ], UploadDatasetImageFromGen200ApplicationJSONDatasetGenUploadOutput.prototype, "id", void 0);
78
81
  return UploadDatasetImageFromGen200ApplicationJSONDatasetGenUploadOutput;
@@ -84,7 +87,9 @@ var UploadDatasetImageFromGen200ApplicationJSON = /** @class */ (function (_supe
84
87
  return _super !== null && _super.apply(this, arguments) || this;
85
88
  }
86
89
  __decorate([
87
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=uploadDatasetImageFromGen" }),
90
+ (0, utils_1.SpeakeasyMetadata)(),
91
+ (0, class_transformer_1.Expose)({ name: "uploadDatasetImageFromGen" }),
92
+ (0, class_transformer_1.Type)(function () { return UploadDatasetImageFromGen200ApplicationJSONDatasetGenUploadOutput; }),
88
93
  __metadata("design:type", UploadDatasetImageFromGen200ApplicationJSONDatasetGenUploadOutput)
89
94
  ], UploadDatasetImageFromGen200ApplicationJSON.prototype, "uploadDatasetImageFromGen", void 0);
90
95
  return UploadDatasetImageFromGen200ApplicationJSON;
@@ -103,6 +108,10 @@ var UploadDatasetImageFromGenResponse = /** @class */ (function (_super) {
103
108
  (0, utils_1.SpeakeasyMetadata)(),
104
109
  __metadata("design:type", Number)
105
110
  ], UploadDatasetImageFromGenResponse.prototype, "statusCode", void 0);
111
+ __decorate([
112
+ (0, utils_1.SpeakeasyMetadata)(),
113
+ __metadata("design:type", Object)
114
+ ], UploadDatasetImageFromGenResponse.prototype, "rawResponse", void 0);
106
115
  __decorate([
107
116
  (0, utils_1.SpeakeasyMetadata)(),
108
117
  __metadata("design:type", UploadDatasetImageFromGen200ApplicationJSON)
@@ -1,4 +1,5 @@
1
1
  import { SpeakeasyBase } from "../../../internal/utils";
2
+ import { AxiosResponse } from "axios";
2
3
  export declare class UploadInitImageRequestBody extends SpeakeasyBase {
3
4
  extension: string;
4
5
  }
@@ -18,5 +19,6 @@ export declare class UploadInitImage200ApplicationJSON extends SpeakeasyBase {
18
19
  export declare class UploadInitImageResponse extends SpeakeasyBase {
19
20
  contentType: string;
20
21
  statusCode: number;
22
+ rawResponse?: AxiosResponse;
21
23
  uploadInitImage200ApplicationJSONObject?: UploadInitImage200ApplicationJSON;
22
24
  }
@@ -26,13 +26,15 @@ var __metadata = (this && this.__metadata) || function (k, v) {
26
26
  Object.defineProperty(exports, "__esModule", { value: true });
27
27
  exports.UploadInitImageResponse = exports.UploadInitImage200ApplicationJSON = exports.UploadInitImage200ApplicationJSONInitImageUploadOutput = exports.UploadInitImageRequest = exports.UploadInitImageRequestBody = void 0;
28
28
  var utils_1 = require("../../../internal/utils");
29
+ var class_transformer_1 = require("class-transformer");
29
30
  var UploadInitImageRequestBody = /** @class */ (function (_super) {
30
31
  __extends(UploadInitImageRequestBody, _super);
31
32
  function UploadInitImageRequestBody() {
32
33
  return _super !== null && _super.apply(this, arguments) || this;
33
34
  }
34
35
  __decorate([
35
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=extension" }),
36
+ (0, utils_1.SpeakeasyMetadata)(),
37
+ (0, class_transformer_1.Expose)({ name: "extension" }),
36
38
  __metadata("design:type", String)
37
39
  ], UploadInitImageRequestBody.prototype, "extension", void 0);
38
40
  return UploadInitImageRequestBody;
@@ -56,23 +58,28 @@ var UploadInitImage200ApplicationJSONInitImageUploadOutput = /** @class */ (func
56
58
  return _super !== null && _super.apply(this, arguments) || this;
57
59
  }
58
60
  __decorate([
59
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=__typename" }),
61
+ (0, utils_1.SpeakeasyMetadata)(),
62
+ (0, class_transformer_1.Expose)({ name: "__typename" }),
60
63
  __metadata("design:type", String)
61
64
  ], UploadInitImage200ApplicationJSONInitImageUploadOutput.prototype, "typename", void 0);
62
65
  __decorate([
63
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=fields" }),
66
+ (0, utils_1.SpeakeasyMetadata)(),
67
+ (0, class_transformer_1.Expose)({ name: "fields" }),
64
68
  __metadata("design:type", String)
65
69
  ], UploadInitImage200ApplicationJSONInitImageUploadOutput.prototype, "fields", void 0);
66
70
  __decorate([
67
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=id" }),
71
+ (0, utils_1.SpeakeasyMetadata)(),
72
+ (0, class_transformer_1.Expose)({ name: "id" }),
68
73
  __metadata("design:type", String)
69
74
  ], UploadInitImage200ApplicationJSONInitImageUploadOutput.prototype, "id", void 0);
70
75
  __decorate([
71
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=key" }),
76
+ (0, utils_1.SpeakeasyMetadata)(),
77
+ (0, class_transformer_1.Expose)({ name: "key" }),
72
78
  __metadata("design:type", String)
73
79
  ], UploadInitImage200ApplicationJSONInitImageUploadOutput.prototype, "key", void 0);
74
80
  __decorate([
75
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=url" }),
81
+ (0, utils_1.SpeakeasyMetadata)(),
82
+ (0, class_transformer_1.Expose)({ name: "url" }),
76
83
  __metadata("design:type", String)
77
84
  ], UploadInitImage200ApplicationJSONInitImageUploadOutput.prototype, "url", void 0);
78
85
  return UploadInitImage200ApplicationJSONInitImageUploadOutput;
@@ -84,7 +91,9 @@ var UploadInitImage200ApplicationJSON = /** @class */ (function (_super) {
84
91
  return _super !== null && _super.apply(this, arguments) || this;
85
92
  }
86
93
  __decorate([
87
- (0, utils_1.SpeakeasyMetadata)({ data: "json, name=uploadInitImage" }),
94
+ (0, utils_1.SpeakeasyMetadata)(),
95
+ (0, class_transformer_1.Expose)({ name: "uploadInitImage" }),
96
+ (0, class_transformer_1.Type)(function () { return UploadInitImage200ApplicationJSONInitImageUploadOutput; }),
88
97
  __metadata("design:type", UploadInitImage200ApplicationJSONInitImageUploadOutput)
89
98
  ], UploadInitImage200ApplicationJSON.prototype, "uploadInitImage", void 0);
90
99
  return UploadInitImage200ApplicationJSON;
@@ -103,6 +112,10 @@ var UploadInitImageResponse = /** @class */ (function (_super) {
103
112
  (0, utils_1.SpeakeasyMetadata)(),
104
113
  __metadata("design:type", Number)
105
114
  ], UploadInitImageResponse.prototype, "statusCode", void 0);
115
+ __decorate([
116
+ (0, utils_1.SpeakeasyMetadata)(),
117
+ __metadata("design:type", Object)
118
+ ], UploadInitImageResponse.prototype, "rawResponse", void 0);
106
119
  __decorate([
107
120
  (0, utils_1.SpeakeasyMetadata)(),
108
121
  __metadata("design:type", UploadInitImage200ApplicationJSON)
package/dist/sdk/sdk.d.ts CHANGED
@@ -2,14 +2,14 @@ import { Dataset } from "./dataset";
2
2
  import { Generation } from "./generation";
3
3
  import { InitImage } from "./initimage";
4
4
  import { Model } from "./model";
5
- import { Security } from "./models/shared";
5
+ import * as shared from "./models/shared";
6
6
  import { User } from "./user";
7
7
  import { Variation } from "./variation";
8
8
  import { AxiosInstance } from "axios";
9
9
  export declare const ServerList: readonly ["https://cloud.leonardo.ai/api/rest/v1"];
10
10
  export type SDKProps = {
11
11
  defaultClient?: AxiosInstance;
12
- security?: Security;
12
+ security?: shared.Security;
13
13
  serverUrl?: string;
14
14
  };
15
15
  export declare class Leonardo {
package/dist/sdk/sdk.js CHANGED
@@ -32,25 +32,26 @@ var dataset_1 = require("./dataset");
32
32
  var generation_1 = require("./generation");
33
33
  var initimage_1 = require("./initimage");
34
34
  var model_1 = require("./model");
35
- var shared_1 = require("./models/shared");
35
+ var shared = __importStar(require("./models/shared"));
36
36
  var user_1 = require("./user");
37
37
  var variation_1 = require("./variation");
38
38
  var axios_1 = __importDefault(require("axios"));
39
39
  exports.ServerList = [
40
40
  "https://cloud.leonardo.ai/api/rest/v1",
41
41
  ];
42
+ /* SDK Documentation: Leonardo.Ai API OpenAPI specification.*/
42
43
  var Leonardo = /** @class */ (function () {
43
44
  function Leonardo(props) {
44
45
  var _a, _b;
45
46
  this._language = "typescript";
46
- this._sdkVersion = "1.3.5";
47
- this._genVersion = "1.4.9";
47
+ this._sdkVersion = "1.7.4";
48
+ this._genVersion = "1.8.5";
48
49
  this._serverURL = (_a = props.serverUrl) !== null && _a !== void 0 ? _a : exports.ServerList[0];
49
50
  this._defaultClient = (_b = props.defaultClient) !== null && _b !== void 0 ? _b : axios_1.default.create({ baseURL: this._serverURL });
50
51
  if (props.security) {
51
52
  var security = props.security;
52
53
  if (!(props.security instanceof utils.SpeakeasyBase))
53
- security = new shared_1.Security(props.security);
54
+ security = new shared.Security(props.security);
54
55
  this._securityClient = utils.createSecurityClient(this._defaultClient, security);
55
56
  }
56
57
  else {
package/dist/sdk/user.js CHANGED
@@ -36,6 +36,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.User = void 0;
38
38
  var utils = __importStar(require("../internal/utils"));
39
+ var operations = __importStar(require("./models/operations"));
40
+ var class_transformer_1 = require("class-transformer");
39
41
  var User = /** @class */ (function () {
40
42
  function User(defaultClient, securityClient, serverURL, language, sdkVersion, genVersion) {
41
43
  this._defaultClient = defaultClient;
@@ -60,11 +62,11 @@ var User = /** @class */ (function () {
60
62
  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 : "";
61
63
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null)
62
64
  throw new Error("status code not found in response: ".concat(httpRes));
63
- var res = { statusCode: httpRes.status, contentType: contentType };
65
+ var res = { statusCode: httpRes.status, contentType: contentType, rawResponse: httpRes };
64
66
  switch (true) {
65
67
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
66
68
  if (utils.matchContentType(contentType, "application/json")) {
67
- res.getUserSelf200ApplicationJSONObject = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
69
+ res.getUserSelf200ApplicationJSONObject = (0, class_transformer_1.plainToInstance)(operations.GetUserSelf200ApplicationJSON, httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, { excludeExtraneousValues: true });
68
70
  }
69
71
  break;
70
72
  }
@@ -37,6 +37,7 @@ 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");
40
41
  var Variation = /** @class */ (function () {
41
42
  function Variation(defaultClient, securityClient, serverURL, language, sdkVersion, genVersion) {
42
43
  this._defaultClient = defaultClient;
@@ -75,11 +76,11 @@ var Variation = /** @class */ (function () {
75
76
  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 : "";
76
77
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null)
77
78
  throw new Error("status code not found in response: ".concat(httpRes));
78
- var res = { statusCode: httpRes.status, contentType: contentType };
79
+ var res = { statusCode: httpRes.status, contentType: contentType, rawResponse: httpRes };
79
80
  switch (true) {
80
81
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
81
82
  if (utils.matchContentType(contentType, "application/json")) {
82
- res.createVariationUpscale200ApplicationJSONObject = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
83
+ res.createVariationUpscale200ApplicationJSONObject = (0, class_transformer_1.plainToInstance)(operations.CreateVariationUpscale200ApplicationJSON, httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, { excludeExtraneousValues: true });
83
84
  }
84
85
  break;
85
86
  }
@@ -104,11 +105,11 @@ var Variation = /** @class */ (function () {
104
105
  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 : "";
105
106
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null)
106
107
  throw new Error("status code not found in response: ".concat(httpRes));
107
- var res = { statusCode: httpRes.status, contentType: contentType };
108
+ var res = { statusCode: httpRes.status, contentType: contentType, rawResponse: httpRes };
108
109
  switch (true) {
109
110
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
110
111
  if (utils.matchContentType(contentType, "application/json")) {
111
- res.getVariationById200ApplicationJSONObject = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
112
+ res.getVariationById200ApplicationJSONObject = (0, class_transformer_1.plainToInstance)(operations.GetVariationById200ApplicationJSON, httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, { excludeExtraneousValues: true });
112
113
  }
113
114
  break;
114
115
  }
package/package.json CHANGED
@@ -1,19 +1,18 @@
1
1
  {
2
2
  "name": "@leonardo-ai/sdk",
3
- "version": "1.3.5",
3
+ "version": "1.7.4",
4
4
  "author": "leonardoai",
5
5
  "scripts": {
6
6
  "prepare": "tsc --build"
7
7
  },
8
8
  "dependencies": {
9
9
  "axios": "^1.1.3",
10
+ "class-transformer": "^0.5.1",
10
11
  "form-data": "^4.0.0",
11
- "qs": "^6.11.0",
12
12
  "reflect-metadata": "^0.1.13"
13
13
  },
14
14
  "devDependencies": {
15
15
  "@types/node": "^18.11.5",
16
- "@types/qs": "^6.9.7",
17
16
  "typescript": "^4.8.4"
18
17
  },
19
18
  "main": "dist/index.js",