@leonardo-ai/sdk 1.1.1

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 (81) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +98 -0
  3. package/dist/index.d.ts +1 -0
  4. package/dist/index.js +17 -0
  5. package/dist/internal/utils/contenttype.d.ts +1 -0
  6. package/dist/internal/utils/contenttype.js +30 -0
  7. package/dist/internal/utils/headers.d.ts +4 -0
  8. package/dist/internal/utils/headers.js +85 -0
  9. package/dist/internal/utils/index.d.ts +8 -0
  10. package/dist/internal/utils/index.js +24 -0
  11. package/dist/internal/utils/pathparams.d.ts +9 -0
  12. package/dist/internal/utils/pathparams.js +58 -0
  13. package/dist/internal/utils/queryparams.d.ts +3 -0
  14. package/dist/internal/utils/queryparams.js +104 -0
  15. package/dist/internal/utils/requestbody.d.ts +1 -0
  16. package/dist/internal/utils/requestbody.js +266 -0
  17. package/dist/internal/utils/retries.d.ts +20 -0
  18. package/dist/internal/utils/retries.js +223 -0
  19. package/dist/internal/utils/security.d.ts +2 -0
  20. package/dist/internal/utils/security.js +156 -0
  21. package/dist/internal/utils/utils.d.ts +19 -0
  22. package/dist/internal/utils/utils.js +202 -0
  23. package/dist/sdk/creatingdatasets.d.ts +41 -0
  24. package/dist/sdk/creatingdatasets.js +235 -0
  25. package/dist/sdk/generatingimages.d.ts +35 -0
  26. package/dist/sdk/generatingimages.js +182 -0
  27. package/dist/sdk/imagevariations.d.ts +23 -0
  28. package/dist/sdk/imagevariations.js +120 -0
  29. package/dist/sdk/index.d.ts +1 -0
  30. package/dist/sdk/index.js +17 -0
  31. package/dist/sdk/initimages.d.ts +29 -0
  32. package/dist/sdk/initimages.js +151 -0
  33. package/dist/sdk/models/operations/deletedatasetsid.d.ts +12 -0
  34. package/dist/sdk/models/operations/deletedatasetsid.js +72 -0
  35. package/dist/sdk/models/operations/deletegenerationsid.d.ts +12 -0
  36. package/dist/sdk/models/operations/deletegenerationsid.js +72 -0
  37. package/dist/sdk/models/operations/deleteinitimageid.d.ts +12 -0
  38. package/dist/sdk/models/operations/deleteinitimageid.js +72 -0
  39. package/dist/sdk/models/operations/deletemodelsid.d.ts +12 -0
  40. package/dist/sdk/models/operations/deletemodelsid.js +72 -0
  41. package/dist/sdk/models/operations/getdatasetsid.d.ts +12 -0
  42. package/dist/sdk/models/operations/getdatasetsid.js +72 -0
  43. package/dist/sdk/models/operations/getgenerationsid.d.ts +12 -0
  44. package/dist/sdk/models/operations/getgenerationsid.js +72 -0
  45. package/dist/sdk/models/operations/getgenerationsuseruserid.d.ts +17 -0
  46. package/dist/sdk/models/operations/getgenerationsuseruserid.js +92 -0
  47. package/dist/sdk/models/operations/getinitimageid.d.ts +12 -0
  48. package/dist/sdk/models/operations/getinitimageid.js +72 -0
  49. package/dist/sdk/models/operations/getme.d.ts +6 -0
  50. package/dist/sdk/models/operations/getme.js +48 -0
  51. package/dist/sdk/models/operations/getmodelsid.d.ts +12 -0
  52. package/dist/sdk/models/operations/getmodelsid.js +72 -0
  53. package/dist/sdk/models/operations/getvariationsid.d.ts +12 -0
  54. package/dist/sdk/models/operations/getvariationsid.js +72 -0
  55. package/dist/sdk/models/operations/index.d.ts +18 -0
  56. package/dist/sdk/models/operations/index.js +34 -0
  57. package/dist/sdk/models/operations/postdatasets.d.ts +13 -0
  58. package/dist/sdk/models/operations/postdatasets.js +76 -0
  59. package/dist/sdk/models/operations/postdatasetsdatasetidupload.d.ts +16 -0
  60. package/dist/sdk/models/operations/postdatasetsdatasetidupload.js +88 -0
  61. package/dist/sdk/models/operations/postdatasetsdatasetiduploadgen.d.ts +16 -0
  62. package/dist/sdk/models/operations/postdatasetsdatasetiduploadgen.js +88 -0
  63. package/dist/sdk/models/operations/postgenerations.d.ts +27 -0
  64. package/dist/sdk/models/operations/postgenerations.js +132 -0
  65. package/dist/sdk/models/operations/postinitimage.d.ts +12 -0
  66. package/dist/sdk/models/operations/postinitimage.js +72 -0
  67. package/dist/sdk/models/operations/postmodels.d.ts +20 -0
  68. package/dist/sdk/models/operations/postmodels.js +104 -0
  69. package/dist/sdk/models/operations/postvariationsupscale.d.ts +12 -0
  70. package/dist/sdk/models/operations/postvariationsupscale.js +72 -0
  71. package/dist/sdk/models/shared/index.d.ts +1 -0
  72. package/dist/sdk/models/shared/index.js +17 -0
  73. package/dist/sdk/models/shared/security.d.ts +7 -0
  74. package/dist/sdk/models/shared/security.js +52 -0
  75. package/dist/sdk/sdk.d.ts +29 -0
  76. package/dist/sdk/sdk.js +68 -0
  77. package/dist/sdk/trainingmodels.d.ts +29 -0
  78. package/dist/sdk/trainingmodels.js +151 -0
  79. package/dist/sdk/userinformation.d.ts +17 -0
  80. package/dist/sdk/userinformation.js +76 -0
  81. package/package.json +41 -0
@@ -0,0 +1,132 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.PostGenerationsResponse = exports.PostGenerationsRequest = exports.PostGenerationsRequestBody = void 0;
28
+ var utils_1 = require("../../../internal/utils");
29
+ var PostGenerationsRequestBody = /** @class */ (function (_super) {
30
+ __extends(PostGenerationsRequestBody, _super);
31
+ function PostGenerationsRequestBody() {
32
+ return _super !== null && _super.apply(this, arguments) || this;
33
+ }
34
+ __decorate([
35
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=guidance_scale" }),
36
+ __metadata("design:type", Number)
37
+ ], PostGenerationsRequestBody.prototype, "guidanceScale", void 0);
38
+ __decorate([
39
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=height" }),
40
+ __metadata("design:type", Number)
41
+ ], PostGenerationsRequestBody.prototype, "height", void 0);
42
+ __decorate([
43
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=init_generation_image_id" }),
44
+ __metadata("design:type", String)
45
+ ], PostGenerationsRequestBody.prototype, "initGenerationImageId", void 0);
46
+ __decorate([
47
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=init_image_id" }),
48
+ __metadata("design:type", String)
49
+ ], PostGenerationsRequestBody.prototype, "initImageId", void 0);
50
+ __decorate([
51
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=init_strength" }),
52
+ __metadata("design:type", Number)
53
+ ], PostGenerationsRequestBody.prototype, "initStrength", void 0);
54
+ __decorate([
55
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=modelId" }),
56
+ __metadata("design:type", String)
57
+ ], PostGenerationsRequestBody.prototype, "modelId", void 0);
58
+ __decorate([
59
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=negative_prompt" }),
60
+ __metadata("design:type", String)
61
+ ], PostGenerationsRequestBody.prototype, "negativePrompt", void 0);
62
+ __decorate([
63
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=num_images" }),
64
+ __metadata("design:type", Number)
65
+ ], PostGenerationsRequestBody.prototype, "numImages", void 0);
66
+ __decorate([
67
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=num_inference_steps" }),
68
+ __metadata("design:type", Number)
69
+ ], PostGenerationsRequestBody.prototype, "numInferenceSteps", void 0);
70
+ __decorate([
71
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=presetStyle" }),
72
+ __metadata("design:type", Object)
73
+ ], PostGenerationsRequestBody.prototype, "presetStyle", void 0);
74
+ __decorate([
75
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=prompt" }),
76
+ __metadata("design:type", String)
77
+ ], PostGenerationsRequestBody.prototype, "prompt", void 0);
78
+ __decorate([
79
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=public" }),
80
+ __metadata("design:type", Boolean)
81
+ ], PostGenerationsRequestBody.prototype, "public", void 0);
82
+ __decorate([
83
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=scheduler" }),
84
+ __metadata("design:type", Object)
85
+ ], PostGenerationsRequestBody.prototype, "scheduler", void 0);
86
+ __decorate([
87
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=sd_version" }),
88
+ __metadata("design:type", Object)
89
+ ], PostGenerationsRequestBody.prototype, "sdVersion", void 0);
90
+ __decorate([
91
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=tiling" }),
92
+ __metadata("design:type", Boolean)
93
+ ], PostGenerationsRequestBody.prototype, "tiling", void 0);
94
+ __decorate([
95
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=width" }),
96
+ __metadata("design:type", Number)
97
+ ], PostGenerationsRequestBody.prototype, "width", void 0);
98
+ return PostGenerationsRequestBody;
99
+ }(utils_1.SpeakeasyBase));
100
+ exports.PostGenerationsRequestBody = PostGenerationsRequestBody;
101
+ var PostGenerationsRequest = /** @class */ (function (_super) {
102
+ __extends(PostGenerationsRequest, _super);
103
+ function PostGenerationsRequest() {
104
+ return _super !== null && _super.apply(this, arguments) || this;
105
+ }
106
+ __decorate([
107
+ (0, utils_1.SpeakeasyMetadata)({ data: "request, media_type=application/json" }),
108
+ __metadata("design:type", PostGenerationsRequestBody)
109
+ ], PostGenerationsRequest.prototype, "request", void 0);
110
+ return PostGenerationsRequest;
111
+ }(utils_1.SpeakeasyBase));
112
+ exports.PostGenerationsRequest = PostGenerationsRequest;
113
+ var PostGenerationsResponse = /** @class */ (function (_super) {
114
+ __extends(PostGenerationsResponse, _super);
115
+ function PostGenerationsResponse() {
116
+ return _super !== null && _super.apply(this, arguments) || this;
117
+ }
118
+ __decorate([
119
+ (0, utils_1.SpeakeasyMetadata)(),
120
+ __metadata("design:type", String)
121
+ ], PostGenerationsResponse.prototype, "contentType", void 0);
122
+ __decorate([
123
+ (0, utils_1.SpeakeasyMetadata)(),
124
+ __metadata("design:type", Number)
125
+ ], PostGenerationsResponse.prototype, "statusCode", void 0);
126
+ __decorate([
127
+ (0, utils_1.SpeakeasyMetadata)(),
128
+ __metadata("design:type", Object)
129
+ ], PostGenerationsResponse.prototype, "postGenerations200ApplicationJSONAny", void 0);
130
+ return PostGenerationsResponse;
131
+ }(utils_1.SpeakeasyBase));
132
+ exports.PostGenerationsResponse = PostGenerationsResponse;
@@ -0,0 +1,12 @@
1
+ import { SpeakeasyBase } from "../../../internal/utils";
2
+ export declare class PostInitImageRequestBody extends SpeakeasyBase {
3
+ extension: string;
4
+ }
5
+ export declare class PostInitImageRequest extends SpeakeasyBase {
6
+ request: PostInitImageRequestBody;
7
+ }
8
+ export declare class PostInitImageResponse extends SpeakeasyBase {
9
+ contentType: string;
10
+ statusCode: number;
11
+ postInitImage200ApplicationJSONAny?: any;
12
+ }
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.PostInitImageResponse = exports.PostInitImageRequest = exports.PostInitImageRequestBody = void 0;
28
+ var utils_1 = require("../../../internal/utils");
29
+ var PostInitImageRequestBody = /** @class */ (function (_super) {
30
+ __extends(PostInitImageRequestBody, _super);
31
+ function PostInitImageRequestBody() {
32
+ return _super !== null && _super.apply(this, arguments) || this;
33
+ }
34
+ __decorate([
35
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=extension" }),
36
+ __metadata("design:type", String)
37
+ ], PostInitImageRequestBody.prototype, "extension", void 0);
38
+ return PostInitImageRequestBody;
39
+ }(utils_1.SpeakeasyBase));
40
+ exports.PostInitImageRequestBody = PostInitImageRequestBody;
41
+ var PostInitImageRequest = /** @class */ (function (_super) {
42
+ __extends(PostInitImageRequest, _super);
43
+ function PostInitImageRequest() {
44
+ return _super !== null && _super.apply(this, arguments) || this;
45
+ }
46
+ __decorate([
47
+ (0, utils_1.SpeakeasyMetadata)({ data: "request, media_type=application/json" }),
48
+ __metadata("design:type", PostInitImageRequestBody)
49
+ ], PostInitImageRequest.prototype, "request", void 0);
50
+ return PostInitImageRequest;
51
+ }(utils_1.SpeakeasyBase));
52
+ exports.PostInitImageRequest = PostInitImageRequest;
53
+ var PostInitImageResponse = /** @class */ (function (_super) {
54
+ __extends(PostInitImageResponse, _super);
55
+ function PostInitImageResponse() {
56
+ return _super !== null && _super.apply(this, arguments) || this;
57
+ }
58
+ __decorate([
59
+ (0, utils_1.SpeakeasyMetadata)(),
60
+ __metadata("design:type", String)
61
+ ], PostInitImageResponse.prototype, "contentType", void 0);
62
+ __decorate([
63
+ (0, utils_1.SpeakeasyMetadata)(),
64
+ __metadata("design:type", Number)
65
+ ], PostInitImageResponse.prototype, "statusCode", void 0);
66
+ __decorate([
67
+ (0, utils_1.SpeakeasyMetadata)(),
68
+ __metadata("design:type", Object)
69
+ ], PostInitImageResponse.prototype, "postInitImage200ApplicationJSONAny", void 0);
70
+ return PostInitImageResponse;
71
+ }(utils_1.SpeakeasyBase));
72
+ exports.PostInitImageResponse = PostInitImageResponse;
@@ -0,0 +1,20 @@
1
+ import { SpeakeasyBase } from "../../../internal/utils";
2
+ export declare class PostModelsRequestBody extends SpeakeasyBase {
3
+ datasetId: string;
4
+ description?: string;
5
+ instancePrompt: string;
6
+ modelType?: any;
7
+ name: string;
8
+ nsfw?: boolean;
9
+ resolution?: number;
10
+ sdVersion?: any;
11
+ strength?: any;
12
+ }
13
+ export declare class PostModelsRequest extends SpeakeasyBase {
14
+ request: PostModelsRequestBody;
15
+ }
16
+ export declare class PostModelsResponse extends SpeakeasyBase {
17
+ contentType: string;
18
+ statusCode: number;
19
+ postModels200ApplicationJSONAny?: any;
20
+ }
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.PostModelsResponse = exports.PostModelsRequest = exports.PostModelsRequestBody = void 0;
28
+ var utils_1 = require("../../../internal/utils");
29
+ var PostModelsRequestBody = /** @class */ (function (_super) {
30
+ __extends(PostModelsRequestBody, _super);
31
+ function PostModelsRequestBody() {
32
+ return _super !== null && _super.apply(this, arguments) || this;
33
+ }
34
+ __decorate([
35
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=datasetId" }),
36
+ __metadata("design:type", String)
37
+ ], PostModelsRequestBody.prototype, "datasetId", void 0);
38
+ __decorate([
39
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=description" }),
40
+ __metadata("design:type", String)
41
+ ], PostModelsRequestBody.prototype, "description", void 0);
42
+ __decorate([
43
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=instance_prompt" }),
44
+ __metadata("design:type", String)
45
+ ], PostModelsRequestBody.prototype, "instancePrompt", void 0);
46
+ __decorate([
47
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=modelType" }),
48
+ __metadata("design:type", Object)
49
+ ], PostModelsRequestBody.prototype, "modelType", void 0);
50
+ __decorate([
51
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=name" }),
52
+ __metadata("design:type", String)
53
+ ], PostModelsRequestBody.prototype, "name", void 0);
54
+ __decorate([
55
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=nsfw" }),
56
+ __metadata("design:type", Boolean)
57
+ ], PostModelsRequestBody.prototype, "nsfw", void 0);
58
+ __decorate([
59
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=resolution" }),
60
+ __metadata("design:type", Number)
61
+ ], PostModelsRequestBody.prototype, "resolution", void 0);
62
+ __decorate([
63
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=sd_Version" }),
64
+ __metadata("design:type", Object)
65
+ ], PostModelsRequestBody.prototype, "sdVersion", void 0);
66
+ __decorate([
67
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=strength" }),
68
+ __metadata("design:type", Object)
69
+ ], PostModelsRequestBody.prototype, "strength", void 0);
70
+ return PostModelsRequestBody;
71
+ }(utils_1.SpeakeasyBase));
72
+ exports.PostModelsRequestBody = PostModelsRequestBody;
73
+ var PostModelsRequest = /** @class */ (function (_super) {
74
+ __extends(PostModelsRequest, _super);
75
+ function PostModelsRequest() {
76
+ return _super !== null && _super.apply(this, arguments) || this;
77
+ }
78
+ __decorate([
79
+ (0, utils_1.SpeakeasyMetadata)({ data: "request, media_type=application/json" }),
80
+ __metadata("design:type", PostModelsRequestBody)
81
+ ], PostModelsRequest.prototype, "request", void 0);
82
+ return PostModelsRequest;
83
+ }(utils_1.SpeakeasyBase));
84
+ exports.PostModelsRequest = PostModelsRequest;
85
+ var PostModelsResponse = /** @class */ (function (_super) {
86
+ __extends(PostModelsResponse, _super);
87
+ function PostModelsResponse() {
88
+ return _super !== null && _super.apply(this, arguments) || this;
89
+ }
90
+ __decorate([
91
+ (0, utils_1.SpeakeasyMetadata)(),
92
+ __metadata("design:type", String)
93
+ ], PostModelsResponse.prototype, "contentType", void 0);
94
+ __decorate([
95
+ (0, utils_1.SpeakeasyMetadata)(),
96
+ __metadata("design:type", Number)
97
+ ], PostModelsResponse.prototype, "statusCode", void 0);
98
+ __decorate([
99
+ (0, utils_1.SpeakeasyMetadata)(),
100
+ __metadata("design:type", Object)
101
+ ], PostModelsResponse.prototype, "postModels200ApplicationJSONAny", void 0);
102
+ return PostModelsResponse;
103
+ }(utils_1.SpeakeasyBase));
104
+ exports.PostModelsResponse = PostModelsResponse;
@@ -0,0 +1,12 @@
1
+ import { SpeakeasyBase } from "../../../internal/utils";
2
+ export declare class PostVariationsUpscaleRequestBody extends SpeakeasyBase {
3
+ id: string;
4
+ }
5
+ export declare class PostVariationsUpscaleRequest extends SpeakeasyBase {
6
+ request?: PostVariationsUpscaleRequestBody;
7
+ }
8
+ export declare class PostVariationsUpscaleResponse extends SpeakeasyBase {
9
+ contentType: string;
10
+ statusCode: number;
11
+ postVariationsUpscale200ApplicationJSONAny?: any;
12
+ }
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.PostVariationsUpscaleResponse = exports.PostVariationsUpscaleRequest = exports.PostVariationsUpscaleRequestBody = void 0;
28
+ var utils_1 = require("../../../internal/utils");
29
+ var PostVariationsUpscaleRequestBody = /** @class */ (function (_super) {
30
+ __extends(PostVariationsUpscaleRequestBody, _super);
31
+ function PostVariationsUpscaleRequestBody() {
32
+ return _super !== null && _super.apply(this, arguments) || this;
33
+ }
34
+ __decorate([
35
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=id" }),
36
+ __metadata("design:type", String)
37
+ ], PostVariationsUpscaleRequestBody.prototype, "id", void 0);
38
+ return PostVariationsUpscaleRequestBody;
39
+ }(utils_1.SpeakeasyBase));
40
+ exports.PostVariationsUpscaleRequestBody = PostVariationsUpscaleRequestBody;
41
+ var PostVariationsUpscaleRequest = /** @class */ (function (_super) {
42
+ __extends(PostVariationsUpscaleRequest, _super);
43
+ function PostVariationsUpscaleRequest() {
44
+ return _super !== null && _super.apply(this, arguments) || this;
45
+ }
46
+ __decorate([
47
+ (0, utils_1.SpeakeasyMetadata)({ data: "request, media_type=application/json" }),
48
+ __metadata("design:type", PostVariationsUpscaleRequestBody)
49
+ ], PostVariationsUpscaleRequest.prototype, "request", void 0);
50
+ return PostVariationsUpscaleRequest;
51
+ }(utils_1.SpeakeasyBase));
52
+ exports.PostVariationsUpscaleRequest = PostVariationsUpscaleRequest;
53
+ var PostVariationsUpscaleResponse = /** @class */ (function (_super) {
54
+ __extends(PostVariationsUpscaleResponse, _super);
55
+ function PostVariationsUpscaleResponse() {
56
+ return _super !== null && _super.apply(this, arguments) || this;
57
+ }
58
+ __decorate([
59
+ (0, utils_1.SpeakeasyMetadata)(),
60
+ __metadata("design:type", String)
61
+ ], PostVariationsUpscaleResponse.prototype, "contentType", void 0);
62
+ __decorate([
63
+ (0, utils_1.SpeakeasyMetadata)(),
64
+ __metadata("design:type", Number)
65
+ ], PostVariationsUpscaleResponse.prototype, "statusCode", void 0);
66
+ __decorate([
67
+ (0, utils_1.SpeakeasyMetadata)(),
68
+ __metadata("design:type", Object)
69
+ ], PostVariationsUpscaleResponse.prototype, "postVariationsUpscale200ApplicationJSONAny", void 0);
70
+ return PostVariationsUpscaleResponse;
71
+ }(utils_1.SpeakeasyBase));
72
+ exports.PostVariationsUpscaleResponse = PostVariationsUpscaleResponse;
@@ -0,0 +1 @@
1
+ export * from "./security";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./security"), exports);
@@ -0,0 +1,7 @@
1
+ import { SpeakeasyBase } from "../../../internal/utils";
2
+ export declare class SchemeBearerAuth extends SpeakeasyBase {
3
+ authorization: string;
4
+ }
5
+ export declare class Security extends SpeakeasyBase {
6
+ bearerAuth: SchemeBearerAuth;
7
+ }
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.Security = exports.SchemeBearerAuth = void 0;
28
+ var utils_1 = require("../../../internal/utils");
29
+ var SchemeBearerAuth = /** @class */ (function (_super) {
30
+ __extends(SchemeBearerAuth, _super);
31
+ function SchemeBearerAuth() {
32
+ return _super !== null && _super.apply(this, arguments) || this;
33
+ }
34
+ __decorate([
35
+ (0, utils_1.SpeakeasyMetadata)({ data: "security, name=Authorization" }),
36
+ __metadata("design:type", String)
37
+ ], SchemeBearerAuth.prototype, "authorization", void 0);
38
+ return SchemeBearerAuth;
39
+ }(utils_1.SpeakeasyBase));
40
+ exports.SchemeBearerAuth = SchemeBearerAuth;
41
+ var Security = /** @class */ (function (_super) {
42
+ __extends(Security, _super);
43
+ function Security() {
44
+ return _super !== null && _super.apply(this, arguments) || this;
45
+ }
46
+ __decorate([
47
+ (0, utils_1.SpeakeasyMetadata)({ data: "security, scheme=true;type=http;subtype=bearer" }),
48
+ __metadata("design:type", SchemeBearerAuth)
49
+ ], Security.prototype, "bearerAuth", void 0);
50
+ return Security;
51
+ }(utils_1.SpeakeasyBase));
52
+ exports.Security = Security;
@@ -0,0 +1,29 @@
1
+ import { CreatingDatasets } from "./creatingdatasets";
2
+ import { GeneratingImages } from "./generatingimages";
3
+ import { ImageVariations } from "./imagevariations";
4
+ import { InitImages } from "./initimages";
5
+ import { Security } from "./models/shared";
6
+ import { TrainingModels } from "./trainingmodels";
7
+ import { UserInformation } from "./userinformation";
8
+ import { AxiosInstance } from "axios";
9
+ export declare const ServerList: readonly ["https://cloud.leonardo.ai/api/rest/v1"];
10
+ export type SDKProps = {
11
+ defaultClient?: AxiosInstance;
12
+ security?: Security;
13
+ serverUrl?: string;
14
+ };
15
+ export declare class Leonardo {
16
+ creatingDatasets: CreatingDatasets;
17
+ generatingImages: GeneratingImages;
18
+ imageVariations: ImageVariations;
19
+ initImages: InitImages;
20
+ trainingModels: TrainingModels;
21
+ userInformation: UserInformation;
22
+ _defaultClient: AxiosInstance;
23
+ _securityClient: AxiosInstance;
24
+ _serverURL: string;
25
+ private _language;
26
+ private _sdkVersion;
27
+ private _genVersion;
28
+ constructor(props: SDKProps);
29
+ }
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.Leonardo = exports.ServerList = void 0;
30
+ var utils = __importStar(require("../internal/utils"));
31
+ var creatingdatasets_1 = require("./creatingdatasets");
32
+ var generatingimages_1 = require("./generatingimages");
33
+ var imagevariations_1 = require("./imagevariations");
34
+ var initimages_1 = require("./initimages");
35
+ var shared_1 = require("./models/shared");
36
+ var trainingmodels_1 = require("./trainingmodels");
37
+ var userinformation_1 = require("./userinformation");
38
+ var axios_1 = __importDefault(require("axios"));
39
+ exports.ServerList = [
40
+ "https://cloud.leonardo.ai/api/rest/v1",
41
+ ];
42
+ var Leonardo = /** @class */ (function () {
43
+ function Leonardo(props) {
44
+ var _a, _b;
45
+ this._language = "typescript";
46
+ this._sdkVersion = "1.1.1";
47
+ this._genVersion = "1.3.1";
48
+ this._serverURL = (_a = props.serverUrl) !== null && _a !== void 0 ? _a : exports.ServerList[0];
49
+ this._defaultClient = (_b = props.defaultClient) !== null && _b !== void 0 ? _b : axios_1.default.create({ baseURL: this._serverURL });
50
+ if (props.security) {
51
+ var security = props.security;
52
+ if (!(props.security instanceof utils.SpeakeasyBase))
53
+ security = new shared_1.Security(props.security);
54
+ this._securityClient = utils.createSecurityClient(this._defaultClient, security);
55
+ }
56
+ else {
57
+ this._securityClient = this._defaultClient;
58
+ }
59
+ this.creatingDatasets = new creatingdatasets_1.CreatingDatasets(this._defaultClient, this._securityClient, this._serverURL, this._language, this._sdkVersion, this._genVersion);
60
+ this.generatingImages = new generatingimages_1.GeneratingImages(this._defaultClient, this._securityClient, this._serverURL, this._language, this._sdkVersion, this._genVersion);
61
+ this.imageVariations = new imagevariations_1.ImageVariations(this._defaultClient, this._securityClient, this._serverURL, this._language, this._sdkVersion, this._genVersion);
62
+ this.initImages = new initimages_1.InitImages(this._defaultClient, this._securityClient, this._serverURL, this._language, this._sdkVersion, this._genVersion);
63
+ this.trainingModels = new trainingmodels_1.TrainingModels(this._defaultClient, this._securityClient, this._serverURL, this._language, this._sdkVersion, this._genVersion);
64
+ this.userInformation = new userinformation_1.UserInformation(this._defaultClient, this._securityClient, this._serverURL, this._language, this._sdkVersion, this._genVersion);
65
+ }
66
+ return Leonardo;
67
+ }());
68
+ exports.Leonardo = Leonardo;
@@ -0,0 +1,29 @@
1
+ import * as operations from "./models/operations";
2
+ import { AxiosInstance, AxiosRequestConfig } from "axios";
3
+ export declare class TrainingModels {
4
+ _defaultClient: AxiosInstance;
5
+ _securityClient: AxiosInstance;
6
+ _serverURL: string;
7
+ _language: string;
8
+ _sdkVersion: string;
9
+ _genVersion: string;
10
+ constructor(defaultClient: AxiosInstance, securityClient: AxiosInstance, serverURL: string, language: string, sdkVersion: string, genVersion: string);
11
+ /**
12
+ * deleteModelsId - Delete a Single Custom Model by ID
13
+ *
14
+ * This endpoint will delete a specific custom model
15
+ **/
16
+ deleteModelsId(req: operations.DeleteModelsIdRequest, config?: AxiosRequestConfig): Promise<operations.DeleteModelsIdResponse>;
17
+ /**
18
+ * getModelsId - Get a Single Custom Model by ID
19
+ *
20
+ * This endpoint gets the specific custom model
21
+ **/
22
+ getModelsId(req: operations.GetModelsIdRequest, config?: AxiosRequestConfig): Promise<operations.GetModelsIdResponse>;
23
+ /**
24
+ * postModels - Train a Custom Model
25
+ *
26
+ * This endpoint will train a new custom model
27
+ **/
28
+ postModels(req: operations.PostModelsRequest, config?: AxiosRequestConfig): Promise<operations.PostModelsResponse>;
29
+ }