@leonardo-ai/sdk 1.1.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/README.md +28 -27
  2. package/dist/sdk/{creatingdatasets.d.ts → dataset.d.ts} +13 -13
  3. package/dist/sdk/{creatingdatasets.js → dataset.js} +46 -46
  4. package/dist/sdk/{generatingimages.d.ts → generation.d.ts} +12 -12
  5. package/dist/sdk/{generatingimages.js → generation.js} +45 -45
  6. package/dist/sdk/{initimages.d.ts → initimage.d.ts} +5 -5
  7. package/dist/sdk/{initimages.js → initimage.js} +15 -15
  8. package/dist/sdk/{trainingmodels.d.ts → model.d.ts} +9 -9
  9. package/dist/sdk/{trainingmodels.js → model.js} +38 -38
  10. package/dist/sdk/models/operations/createdataset.d.ts +22 -0
  11. package/dist/sdk/models/operations/createdataset.js +104 -0
  12. package/dist/sdk/models/operations/creategeneration.d.ts +33 -0
  13. package/dist/sdk/models/operations/{postgenerations.js → creategeneration.js} +62 -38
  14. package/dist/sdk/models/operations/createmodel.d.ts +26 -0
  15. package/dist/sdk/models/operations/{postmodels.js → createmodel.js} +55 -31
  16. package/dist/sdk/models/operations/createvariationupscale.d.ts +18 -0
  17. package/dist/sdk/models/operations/createvariationupscale.js +96 -0
  18. package/dist/sdk/models/operations/deletedatasetsid.d.ts +10 -1
  19. package/dist/sdk/models/operations/deletedatasetsid.js +31 -3
  20. package/dist/sdk/models/operations/deletegenerationsid.d.ts +10 -1
  21. package/dist/sdk/models/operations/deletegenerationsid.js +31 -3
  22. package/dist/sdk/models/operations/deleteinitimageid.d.ts +10 -1
  23. package/dist/sdk/models/operations/deleteinitimageid.js +31 -3
  24. package/dist/sdk/models/operations/deletemodelsid.d.ts +10 -1
  25. package/dist/sdk/models/operations/deletemodelsid.js +31 -3
  26. package/dist/sdk/models/operations/getdatasetbyid.d.ts +34 -0
  27. package/dist/sdk/models/operations/getdatasetbyid.js +144 -0
  28. package/dist/sdk/models/operations/getgenerationbyid.d.ts +55 -0
  29. package/dist/sdk/models/operations/getgenerationbyid.js +220 -0
  30. package/dist/sdk/models/operations/getgenerationsbyuserid.d.ts +60 -0
  31. package/dist/sdk/models/operations/getgenerationsbyuserid.js +240 -0
  32. package/dist/sdk/models/operations/getinitimagebyid.d.ts +23 -0
  33. package/dist/sdk/models/operations/getinitimagebyid.js +108 -0
  34. package/dist/sdk/models/operations/getmodelbyid.d.ts +32 -0
  35. package/dist/sdk/models/operations/getmodelbyid.js +144 -0
  36. package/dist/sdk/models/operations/getuserself.d.ts +23 -0
  37. package/dist/sdk/models/operations/getuserself.js +100 -0
  38. package/dist/sdk/models/operations/getvariationbyid.d.ts +25 -0
  39. package/dist/sdk/models/operations/getvariationbyid.js +116 -0
  40. package/dist/sdk/models/operations/index.d.ts +14 -14
  41. package/dist/sdk/models/operations/index.js +14 -14
  42. package/dist/sdk/models/operations/uploaddatasetimage.d.ts +25 -0
  43. package/dist/sdk/models/operations/uploaddatasetimage.js +124 -0
  44. package/dist/sdk/models/operations/uploaddatasetimagefromgen.d.ts +22 -0
  45. package/dist/sdk/models/operations/uploaddatasetimagefromgen.js +112 -0
  46. package/dist/sdk/models/operations/uploadinitimage.d.ts +22 -0
  47. package/dist/sdk/models/operations/uploadinitimage.js +112 -0
  48. package/dist/sdk/sdk.d.ts +12 -12
  49. package/dist/sdk/sdk.js +13 -13
  50. package/dist/sdk/{userinformation.d.ts → user.d.ts} +3 -3
  51. package/dist/sdk/{userinformation.js → user.js} +8 -8
  52. package/dist/sdk/{imagevariations.d.ts → variation.d.ts} +7 -7
  53. package/dist/sdk/{imagevariations.js → variation.js} +30 -30
  54. package/package.json +2 -19
  55. package/dist/sdk/models/operations/getdatasetsid.d.ts +0 -12
  56. package/dist/sdk/models/operations/getdatasetsid.js +0 -72
  57. package/dist/sdk/models/operations/getgenerationsid.d.ts +0 -12
  58. package/dist/sdk/models/operations/getgenerationsid.js +0 -72
  59. package/dist/sdk/models/operations/getgenerationsuseruserid.d.ts +0 -17
  60. package/dist/sdk/models/operations/getgenerationsuseruserid.js +0 -92
  61. package/dist/sdk/models/operations/getinitimageid.d.ts +0 -12
  62. package/dist/sdk/models/operations/getinitimageid.js +0 -72
  63. package/dist/sdk/models/operations/getme.d.ts +0 -6
  64. package/dist/sdk/models/operations/getme.js +0 -48
  65. package/dist/sdk/models/operations/getmodelsid.d.ts +0 -12
  66. package/dist/sdk/models/operations/getmodelsid.js +0 -72
  67. package/dist/sdk/models/operations/getvariationsid.d.ts +0 -12
  68. package/dist/sdk/models/operations/getvariationsid.js +0 -72
  69. package/dist/sdk/models/operations/postdatasets.d.ts +0 -13
  70. package/dist/sdk/models/operations/postdatasets.js +0 -76
  71. package/dist/sdk/models/operations/postdatasetsdatasetidupload.d.ts +0 -16
  72. package/dist/sdk/models/operations/postdatasetsdatasetidupload.js +0 -88
  73. package/dist/sdk/models/operations/postdatasetsdatasetiduploadgen.d.ts +0 -16
  74. package/dist/sdk/models/operations/postdatasetsdatasetiduploadgen.js +0 -88
  75. package/dist/sdk/models/operations/postgenerations.d.ts +0 -27
  76. package/dist/sdk/models/operations/postinitimage.d.ts +0 -12
  77. package/dist/sdk/models/operations/postinitimage.js +0 -72
  78. package/dist/sdk/models/operations/postmodels.d.ts +0 -20
  79. package/dist/sdk/models/operations/postvariationsupscale.d.ts +0 -12
  80. package/dist/sdk/models/operations/postvariationsupscale.js +0 -72
@@ -0,0 +1,112 @@
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.UploadInitImageResponse = exports.UploadInitImage200ApplicationJSON = exports.UploadInitImage200ApplicationJSONInitImageUploadOutput = exports.UploadInitImageRequest = exports.UploadInitImageRequestBody = void 0;
28
+ var utils_1 = require("../../../internal/utils");
29
+ var UploadInitImageRequestBody = /** @class */ (function (_super) {
30
+ __extends(UploadInitImageRequestBody, _super);
31
+ function UploadInitImageRequestBody() {
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
+ ], UploadInitImageRequestBody.prototype, "extension", void 0);
38
+ return UploadInitImageRequestBody;
39
+ }(utils_1.SpeakeasyBase));
40
+ exports.UploadInitImageRequestBody = UploadInitImageRequestBody;
41
+ var UploadInitImageRequest = /** @class */ (function (_super) {
42
+ __extends(UploadInitImageRequest, _super);
43
+ function UploadInitImageRequest() {
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", UploadInitImageRequestBody)
49
+ ], UploadInitImageRequest.prototype, "request", void 0);
50
+ return UploadInitImageRequest;
51
+ }(utils_1.SpeakeasyBase));
52
+ exports.UploadInitImageRequest = UploadInitImageRequest;
53
+ var UploadInitImage200ApplicationJSONInitImageUploadOutput = /** @class */ (function (_super) {
54
+ __extends(UploadInitImage200ApplicationJSONInitImageUploadOutput, _super);
55
+ function UploadInitImage200ApplicationJSONInitImageUploadOutput() {
56
+ return _super !== null && _super.apply(this, arguments) || this;
57
+ }
58
+ __decorate([
59
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=__typename" }),
60
+ __metadata("design:type", String)
61
+ ], UploadInitImage200ApplicationJSONInitImageUploadOutput.prototype, "typename", void 0);
62
+ __decorate([
63
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=fields" }),
64
+ __metadata("design:type", String)
65
+ ], UploadInitImage200ApplicationJSONInitImageUploadOutput.prototype, "fields", void 0);
66
+ __decorate([
67
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=id" }),
68
+ __metadata("design:type", String)
69
+ ], UploadInitImage200ApplicationJSONInitImageUploadOutput.prototype, "id", void 0);
70
+ __decorate([
71
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=key" }),
72
+ __metadata("design:type", String)
73
+ ], UploadInitImage200ApplicationJSONInitImageUploadOutput.prototype, "key", void 0);
74
+ __decorate([
75
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=url" }),
76
+ __metadata("design:type", String)
77
+ ], UploadInitImage200ApplicationJSONInitImageUploadOutput.prototype, "url", void 0);
78
+ return UploadInitImage200ApplicationJSONInitImageUploadOutput;
79
+ }(utils_1.SpeakeasyBase));
80
+ exports.UploadInitImage200ApplicationJSONInitImageUploadOutput = UploadInitImage200ApplicationJSONInitImageUploadOutput;
81
+ var UploadInitImage200ApplicationJSON = /** @class */ (function (_super) {
82
+ __extends(UploadInitImage200ApplicationJSON, _super);
83
+ function UploadInitImage200ApplicationJSON() {
84
+ return _super !== null && _super.apply(this, arguments) || this;
85
+ }
86
+ __decorate([
87
+ (0, utils_1.SpeakeasyMetadata)({ data: "json, name=uploadInitImage" }),
88
+ __metadata("design:type", UploadInitImage200ApplicationJSONInitImageUploadOutput)
89
+ ], UploadInitImage200ApplicationJSON.prototype, "uploadInitImage", void 0);
90
+ return UploadInitImage200ApplicationJSON;
91
+ }(utils_1.SpeakeasyBase));
92
+ exports.UploadInitImage200ApplicationJSON = UploadInitImage200ApplicationJSON;
93
+ var UploadInitImageResponse = /** @class */ (function (_super) {
94
+ __extends(UploadInitImageResponse, _super);
95
+ function UploadInitImageResponse() {
96
+ return _super !== null && _super.apply(this, arguments) || this;
97
+ }
98
+ __decorate([
99
+ (0, utils_1.SpeakeasyMetadata)(),
100
+ __metadata("design:type", String)
101
+ ], UploadInitImageResponse.prototype, "contentType", void 0);
102
+ __decorate([
103
+ (0, utils_1.SpeakeasyMetadata)(),
104
+ __metadata("design:type", Number)
105
+ ], UploadInitImageResponse.prototype, "statusCode", void 0);
106
+ __decorate([
107
+ (0, utils_1.SpeakeasyMetadata)(),
108
+ __metadata("design:type", UploadInitImage200ApplicationJSON)
109
+ ], UploadInitImageResponse.prototype, "uploadInitImage200ApplicationJSONObject", void 0);
110
+ return UploadInitImageResponse;
111
+ }(utils_1.SpeakeasyBase));
112
+ exports.UploadInitImageResponse = UploadInitImageResponse;
package/dist/sdk/sdk.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { CreatingDatasets } from "./creatingdatasets";
2
- import { GeneratingImages } from "./generatingimages";
3
- import { ImageVariations } from "./imagevariations";
4
- import { InitImages } from "./initimages";
1
+ import { Dataset } from "./dataset";
2
+ import { Generation } from "./generation";
3
+ import { InitImage } from "./initimage";
4
+ import { Model } from "./model";
5
5
  import { Security } from "./models/shared";
6
- import { TrainingModels } from "./trainingmodels";
7
- import { UserInformation } from "./userinformation";
6
+ import { User } from "./user";
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 = {
@@ -13,12 +13,12 @@ export type SDKProps = {
13
13
  serverUrl?: string;
14
14
  };
15
15
  export declare class Leonardo {
16
- creatingDatasets: CreatingDatasets;
17
- generatingImages: GeneratingImages;
18
- imageVariations: ImageVariations;
19
- initImages: InitImages;
20
- trainingModels: TrainingModels;
21
- userInformation: UserInformation;
16
+ dataset: Dataset;
17
+ generation: Generation;
18
+ initImage: InitImage;
19
+ model: Model;
20
+ user: User;
21
+ variation: Variation;
22
22
  _defaultClient: AxiosInstance;
23
23
  _securityClient: AxiosInstance;
24
24
  _serverURL: string;
package/dist/sdk/sdk.js CHANGED
@@ -28,13 +28,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.Leonardo = exports.ServerList = void 0;
30
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");
31
+ var dataset_1 = require("./dataset");
32
+ var generation_1 = require("./generation");
33
+ var initimage_1 = require("./initimage");
34
+ var model_1 = require("./model");
35
35
  var shared_1 = require("./models/shared");
36
- var trainingmodels_1 = require("./trainingmodels");
37
- var userinformation_1 = require("./userinformation");
36
+ var user_1 = require("./user");
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",
@@ -43,7 +43,7 @@ var Leonardo = /** @class */ (function () {
43
43
  function Leonardo(props) {
44
44
  var _a, _b;
45
45
  this._language = "typescript";
46
- this._sdkVersion = "1.1.1";
46
+ this._sdkVersion = "1.2.0";
47
47
  this._genVersion = "1.3.1";
48
48
  this._serverURL = (_a = props.serverUrl) !== null && _a !== void 0 ? _a : exports.ServerList[0];
49
49
  this._defaultClient = (_b = props.defaultClient) !== null && _b !== void 0 ? _b : axios_1.default.create({ baseURL: this._serverURL });
@@ -56,12 +56,12 @@ var Leonardo = /** @class */ (function () {
56
56
  else {
57
57
  this._securityClient = this._defaultClient;
58
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);
59
+ this.dataset = new dataset_1.Dataset(this._defaultClient, this._securityClient, this._serverURL, this._language, this._sdkVersion, this._genVersion);
60
+ this.generation = new generation_1.Generation(this._defaultClient, this._securityClient, this._serverURL, this._language, this._sdkVersion, this._genVersion);
61
+ this.initImage = new initimage_1.InitImage(this._defaultClient, this._securityClient, this._serverURL, this._language, this._sdkVersion, this._genVersion);
62
+ this.model = new model_1.Model(this._defaultClient, this._securityClient, this._serverURL, this._language, this._sdkVersion, this._genVersion);
63
+ this.user = new user_1.User(this._defaultClient, this._securityClient, this._serverURL, this._language, this._sdkVersion, this._genVersion);
64
+ this.variation = new variation_1.Variation(this._defaultClient, this._securityClient, this._serverURL, this._language, this._sdkVersion, this._genVersion);
65
65
  }
66
66
  return Leonardo;
67
67
  }());
@@ -1,6 +1,6 @@
1
1
  import * as operations from "./models/operations";
2
2
  import { AxiosInstance, AxiosRequestConfig } from "axios";
3
- export declare class UserInformation {
3
+ export declare class User {
4
4
  _defaultClient: AxiosInstance;
5
5
  _securityClient: AxiosInstance;
6
6
  _serverURL: string;
@@ -9,9 +9,9 @@ export declare class UserInformation {
9
9
  _genVersion: string;
10
10
  constructor(defaultClient: AxiosInstance, securityClient: AxiosInstance, serverURL: string, language: string, sdkVersion: string, genVersion: string);
11
11
  /**
12
- * getMe - Get user information
12
+ * getUserSelf - Get user information
13
13
  *
14
14
  * This endpoint will return your user information, including your user ID.
15
15
  **/
16
- getMe(config?: AxiosRequestConfig): Promise<operations.GetMeResponse>;
16
+ getUserSelf(config?: AxiosRequestConfig): Promise<operations.GetUserSelfResponse>;
17
17
  }
@@ -34,10 +34,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
34
34
  return result;
35
35
  };
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.UserInformation = void 0;
37
+ exports.User = void 0;
38
38
  var utils = __importStar(require("../internal/utils"));
39
- var UserInformation = /** @class */ (function () {
40
- function UserInformation(defaultClient, securityClient, serverURL, language, sdkVersion, genVersion) {
39
+ var User = /** @class */ (function () {
40
+ function User(defaultClient, securityClient, serverURL, language, sdkVersion, genVersion) {
41
41
  this._defaultClient = defaultClient;
42
42
  this._securityClient = securityClient;
43
43
  this._serverURL = serverURL;
@@ -46,11 +46,11 @@ var UserInformation = /** @class */ (function () {
46
46
  this._genVersion = genVersion;
47
47
  }
48
48
  /**
49
- * getMe - Get user information
49
+ * getUserSelf - Get user information
50
50
  *
51
51
  * This endpoint will return your user information, including your user ID.
52
52
  **/
53
- UserInformation.prototype.getMe = function (config) {
53
+ User.prototype.getUserSelf = function (config) {
54
54
  var baseURL = this._serverURL;
55
55
  var url = baseURL.replace(/\/$/, "") + "/me";
56
56
  var client = this._securityClient;
@@ -64,13 +64,13 @@ var UserInformation = /** @class */ (function () {
64
64
  switch (true) {
65
65
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
66
66
  if (utils.matchContentType(contentType, "application/json")) {
67
- res.getMe200ApplicationJSONAny = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
67
+ res.getUserSelf200ApplicationJSONObject = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
68
68
  }
69
69
  break;
70
70
  }
71
71
  return res;
72
72
  });
73
73
  };
74
- return UserInformation;
74
+ return User;
75
75
  }());
76
- exports.UserInformation = UserInformation;
76
+ exports.User = User;
@@ -1,6 +1,6 @@
1
1
  import * as operations from "./models/operations";
2
2
  import { AxiosInstance, AxiosRequestConfig } from "axios";
3
- export declare class ImageVariations {
3
+ export declare class Variation {
4
4
  _defaultClient: AxiosInstance;
5
5
  _securityClient: AxiosInstance;
6
6
  _serverURL: string;
@@ -9,15 +9,15 @@ export declare class ImageVariations {
9
9
  _genVersion: string;
10
10
  constructor(defaultClient: AxiosInstance, securityClient: AxiosInstance, serverURL: string, language: string, sdkVersion: string, genVersion: string);
11
11
  /**
12
- * getVariationsId - Get variation by ID
12
+ * createVariationUpscale - Create upscale
13
13
  *
14
- * This endpoint will get the variation by ID
14
+ * This endpoint will create an upscale for the provided image ID
15
15
  **/
16
- getVariationsId(req: operations.GetVariationsIdRequest, config?: AxiosRequestConfig): Promise<operations.GetVariationsIdResponse>;
16
+ createVariationUpscale(req: operations.CreateVariationUpscaleRequest, config?: AxiosRequestConfig): Promise<operations.CreateVariationUpscaleResponse>;
17
17
  /**
18
- * postVariationsUpscale - Create upscale
18
+ * getVariationById - Get variation by ID
19
19
  *
20
- * This endpoint will create an upscale for the provided image ID
20
+ * This endpoint will get the variation by ID
21
21
  **/
22
- postVariationsUpscale(req: operations.PostVariationsUpscaleRequest, config?: AxiosRequestConfig): Promise<operations.PostVariationsUpscaleResponse>;
22
+ getVariationById(req: operations.GetVariationByIdRequest, config?: AxiosRequestConfig): Promise<operations.GetVariationByIdResponse>;
23
23
  }
@@ -34,11 +34,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
34
34
  return result;
35
35
  };
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.ImageVariations = void 0;
37
+ exports.Variation = void 0;
38
38
  var utils = __importStar(require("../internal/utils"));
39
39
  var operations = __importStar(require("./models/operations"));
40
- var ImageVariations = /** @class */ (function () {
41
- function ImageVariations(defaultClient, securityClient, serverURL, language, sdkVersion, genVersion) {
40
+ var Variation = /** @class */ (function () {
41
+ function Variation(defaultClient, securityClient, serverURL, language, sdkVersion, genVersion) {
42
42
  this._defaultClient = defaultClient;
43
43
  this._securityClient = securityClient;
44
44
  this._serverURL = serverURL;
@@ -47,18 +47,29 @@ var ImageVariations = /** @class */ (function () {
47
47
  this._genVersion = genVersion;
48
48
  }
49
49
  /**
50
- * getVariationsId - Get variation by ID
50
+ * createVariationUpscale - Create upscale
51
51
  *
52
- * This endpoint will get the variation by ID
52
+ * This endpoint will create an upscale for the provided image ID
53
53
  **/
54
- ImageVariations.prototype.getVariationsId = function (req, config) {
54
+ Variation.prototype.createVariationUpscale = function (req, config) {
55
+ var _a;
55
56
  if (!(req instanceof utils.SpeakeasyBase)) {
56
- req = new operations.GetVariationsIdRequest(req);
57
+ req = new operations.CreateVariationUpscaleRequest(req);
57
58
  }
58
59
  var baseURL = this._serverURL;
59
- var url = utils.generateURL(baseURL, "/variations/{id}", req.pathParams);
60
+ var url = baseURL.replace(/\/$/, "") + "/variations/upscale";
61
+ var _b = [{}, {}], reqBodyHeaders = _b[0], reqBody = _b[1];
62
+ try {
63
+ _a = utils.serializeRequestBody(req), reqBodyHeaders = _a[0], reqBody = _a[1];
64
+ }
65
+ catch (e) {
66
+ if (e instanceof Error) {
67
+ throw new Error("Error serializing request body, cause: ".concat(e.message));
68
+ }
69
+ }
60
70
  var client = this._securityClient;
61
- var r = client.request(__assign({ url: url, method: "get" }, config));
71
+ var headers = __assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers);
72
+ var r = client.request(__assign({ url: url, method: "post", headers: headers, data: reqBody }, config));
62
73
  return r.then(function (httpRes) {
63
74
  var _a, _b;
64
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 : "";
@@ -68,7 +79,7 @@ var ImageVariations = /** @class */ (function () {
68
79
  switch (true) {
69
80
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
70
81
  if (utils.matchContentType(contentType, "application/json")) {
71
- res.getVariationsId200ApplicationJSONAny = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
82
+ res.createVariationUpscale200ApplicationJSONObject = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
72
83
  }
73
84
  break;
74
85
  }
@@ -76,29 +87,18 @@ var ImageVariations = /** @class */ (function () {
76
87
  });
77
88
  };
78
89
  /**
79
- * postVariationsUpscale - Create upscale
90
+ * getVariationById - Get variation by ID
80
91
  *
81
- * This endpoint will create an upscale for the provided image ID
92
+ * This endpoint will get the variation by ID
82
93
  **/
83
- ImageVariations.prototype.postVariationsUpscale = function (req, config) {
84
- var _a;
94
+ Variation.prototype.getVariationById = function (req, config) {
85
95
  if (!(req instanceof utils.SpeakeasyBase)) {
86
- req = new operations.PostVariationsUpscaleRequest(req);
96
+ req = new operations.GetVariationByIdRequest(req);
87
97
  }
88
98
  var baseURL = this._serverURL;
89
- var url = baseURL.replace(/\/$/, "") + "/variations/upscale";
90
- var _b = [{}, {}], reqBodyHeaders = _b[0], reqBody = _b[1];
91
- try {
92
- _a = utils.serializeRequestBody(req), reqBodyHeaders = _a[0], reqBody = _a[1];
93
- }
94
- catch (e) {
95
- if (e instanceof Error) {
96
- throw new Error("Error serializing request body, cause: ".concat(e.message));
97
- }
98
- }
99
+ var url = utils.generateURL(baseURL, "/variations/{id}", req.pathParams);
99
100
  var client = this._securityClient;
100
- var headers = __assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers);
101
- var r = client.request(__assign({ url: url, method: "post", headers: headers, data: reqBody }, config));
101
+ var r = client.request(__assign({ url: url, method: "get" }, config));
102
102
  return r.then(function (httpRes) {
103
103
  var _a, _b;
104
104
  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,13 +108,13 @@ var ImageVariations = /** @class */ (function () {
108
108
  switch (true) {
109
109
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
110
110
  if (utils.matchContentType(contentType, "application/json")) {
111
- res.postVariationsUpscale200ApplicationJSONAny = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
111
+ res.getVariationById200ApplicationJSONObject = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
112
112
  }
113
113
  break;
114
114
  }
115
115
  return res;
116
116
  });
117
117
  };
118
- return ImageVariations;
118
+ return Variation;
119
119
  }());
120
- exports.ImageVariations = ImageVariations;
120
+ exports.Variation = Variation;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leonardo-ai/sdk",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "author": "leonardoai",
5
5
  "scripts": {
6
6
  "prepare": "tsc --build"
@@ -20,22 +20,5 @@
20
20
  "files": [
21
21
  "dist",
22
22
  "README.md"
23
- ],
24
- "description": "<div align=\"center\"> <p>The API for creating stunning game assets with AI.</p> <a href=\"https://github.com/Leonardo-Interactive/leonardo-ts-sdk/actions\"><img src=\"https://img.shields.io/github/actions/workflow/status/Leonardo-Interactive/leonardo-ts-sdk/speakeasy_sdk_generate.yml?style=for-the-badge\" /></a> <a href=\"https://docs.leonardo.ai/\"><img src=\"https://img.shields.io/static/v1?label=Docs&message=API Ref&color=000&style=for-the-badge\" /></a> <a href=\"https://discord.gg/leonardo-ai\"><img src=\"https://img.shields.io/static/v1?label=Discord&message=Join&color=7289da&style=for-the-badge\" /></a> </div>",
25
- "repository": {
26
- "type": "git",
27
- "url": "git+https://github.com/Leonardo-Interactive/leonardo-ts-sdk.git"
28
- },
29
- "keywords": [
30
- "image-generation",
31
- "ts",
32
- "sdk",
33
- "api"
34
- ],
35
- "license": "ISC",
36
- "bugs": {
37
- "url": "https://github.com/Leonardo-Interactive/leonardo-ts-sdk/issues"
38
- },
39
- "homepage": "https://github.com/Leonardo-Interactive/leonardo-ts-sdk#readme",
40
- "types": "./dist/index.d.ts"
23
+ ]
41
24
  }
@@ -1,12 +0,0 @@
1
- import { SpeakeasyBase } from "../../../internal/utils";
2
- export declare class GetDatasetsIdPathParams extends SpeakeasyBase {
3
- id: string;
4
- }
5
- export declare class GetDatasetsIdRequest extends SpeakeasyBase {
6
- pathParams: GetDatasetsIdPathParams;
7
- }
8
- export declare class GetDatasetsIdResponse extends SpeakeasyBase {
9
- contentType: string;
10
- statusCode: number;
11
- getDatasetsId200ApplicationJSONAny?: any;
12
- }
@@ -1,72 +0,0 @@
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.GetDatasetsIdResponse = exports.GetDatasetsIdRequest = exports.GetDatasetsIdPathParams = void 0;
28
- var utils_1 = require("../../../internal/utils");
29
- var GetDatasetsIdPathParams = /** @class */ (function (_super) {
30
- __extends(GetDatasetsIdPathParams, _super);
31
- function GetDatasetsIdPathParams() {
32
- return _super !== null && _super.apply(this, arguments) || this;
33
- }
34
- __decorate([
35
- (0, utils_1.SpeakeasyMetadata)({ data: "pathParam, style=simple;explode=false;name=id" }),
36
- __metadata("design:type", String)
37
- ], GetDatasetsIdPathParams.prototype, "id", void 0);
38
- return GetDatasetsIdPathParams;
39
- }(utils_1.SpeakeasyBase));
40
- exports.GetDatasetsIdPathParams = GetDatasetsIdPathParams;
41
- var GetDatasetsIdRequest = /** @class */ (function (_super) {
42
- __extends(GetDatasetsIdRequest, _super);
43
- function GetDatasetsIdRequest() {
44
- return _super !== null && _super.apply(this, arguments) || this;
45
- }
46
- __decorate([
47
- (0, utils_1.SpeakeasyMetadata)(),
48
- __metadata("design:type", GetDatasetsIdPathParams)
49
- ], GetDatasetsIdRequest.prototype, "pathParams", void 0);
50
- return GetDatasetsIdRequest;
51
- }(utils_1.SpeakeasyBase));
52
- exports.GetDatasetsIdRequest = GetDatasetsIdRequest;
53
- var GetDatasetsIdResponse = /** @class */ (function (_super) {
54
- __extends(GetDatasetsIdResponse, _super);
55
- function GetDatasetsIdResponse() {
56
- return _super !== null && _super.apply(this, arguments) || this;
57
- }
58
- __decorate([
59
- (0, utils_1.SpeakeasyMetadata)(),
60
- __metadata("design:type", String)
61
- ], GetDatasetsIdResponse.prototype, "contentType", void 0);
62
- __decorate([
63
- (0, utils_1.SpeakeasyMetadata)(),
64
- __metadata("design:type", Number)
65
- ], GetDatasetsIdResponse.prototype, "statusCode", void 0);
66
- __decorate([
67
- (0, utils_1.SpeakeasyMetadata)(),
68
- __metadata("design:type", Object)
69
- ], GetDatasetsIdResponse.prototype, "getDatasetsId200ApplicationJSONAny", void 0);
70
- return GetDatasetsIdResponse;
71
- }(utils_1.SpeakeasyBase));
72
- exports.GetDatasetsIdResponse = GetDatasetsIdResponse;
@@ -1,12 +0,0 @@
1
- import { SpeakeasyBase } from "../../../internal/utils";
2
- export declare class GetGenerationsIdPathParams extends SpeakeasyBase {
3
- id: string;
4
- }
5
- export declare class GetGenerationsIdRequest extends SpeakeasyBase {
6
- pathParams: GetGenerationsIdPathParams;
7
- }
8
- export declare class GetGenerationsIdResponse extends SpeakeasyBase {
9
- contentType: string;
10
- statusCode: number;
11
- getGenerationsId200ApplicationJSONAny?: any;
12
- }
@@ -1,72 +0,0 @@
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.GetGenerationsIdResponse = exports.GetGenerationsIdRequest = exports.GetGenerationsIdPathParams = void 0;
28
- var utils_1 = require("../../../internal/utils");
29
- var GetGenerationsIdPathParams = /** @class */ (function (_super) {
30
- __extends(GetGenerationsIdPathParams, _super);
31
- function GetGenerationsIdPathParams() {
32
- return _super !== null && _super.apply(this, arguments) || this;
33
- }
34
- __decorate([
35
- (0, utils_1.SpeakeasyMetadata)({ data: "pathParam, style=simple;explode=false;name=id" }),
36
- __metadata("design:type", String)
37
- ], GetGenerationsIdPathParams.prototype, "id", void 0);
38
- return GetGenerationsIdPathParams;
39
- }(utils_1.SpeakeasyBase));
40
- exports.GetGenerationsIdPathParams = GetGenerationsIdPathParams;
41
- var GetGenerationsIdRequest = /** @class */ (function (_super) {
42
- __extends(GetGenerationsIdRequest, _super);
43
- function GetGenerationsIdRequest() {
44
- return _super !== null && _super.apply(this, arguments) || this;
45
- }
46
- __decorate([
47
- (0, utils_1.SpeakeasyMetadata)(),
48
- __metadata("design:type", GetGenerationsIdPathParams)
49
- ], GetGenerationsIdRequest.prototype, "pathParams", void 0);
50
- return GetGenerationsIdRequest;
51
- }(utils_1.SpeakeasyBase));
52
- exports.GetGenerationsIdRequest = GetGenerationsIdRequest;
53
- var GetGenerationsIdResponse = /** @class */ (function (_super) {
54
- __extends(GetGenerationsIdResponse, _super);
55
- function GetGenerationsIdResponse() {
56
- return _super !== null && _super.apply(this, arguments) || this;
57
- }
58
- __decorate([
59
- (0, utils_1.SpeakeasyMetadata)(),
60
- __metadata("design:type", String)
61
- ], GetGenerationsIdResponse.prototype, "contentType", void 0);
62
- __decorate([
63
- (0, utils_1.SpeakeasyMetadata)(),
64
- __metadata("design:type", Number)
65
- ], GetGenerationsIdResponse.prototype, "statusCode", void 0);
66
- __decorate([
67
- (0, utils_1.SpeakeasyMetadata)(),
68
- __metadata("design:type", Object)
69
- ], GetGenerationsIdResponse.prototype, "getGenerationsId200ApplicationJSONAny", void 0);
70
- return GetGenerationsIdResponse;
71
- }(utils_1.SpeakeasyBase));
72
- exports.GetGenerationsIdResponse = GetGenerationsIdResponse;
@@ -1,17 +0,0 @@
1
- import { SpeakeasyBase } from "../../../internal/utils";
2
- export declare class GetGenerationsUserUserIdPathParams extends SpeakeasyBase {
3
- userId: string;
4
- }
5
- export declare class GetGenerationsUserUserIdQueryParams extends SpeakeasyBase {
6
- limit?: number;
7
- offset?: number;
8
- }
9
- export declare class GetGenerationsUserUserIdRequest extends SpeakeasyBase {
10
- pathParams: GetGenerationsUserUserIdPathParams;
11
- queryParams: GetGenerationsUserUserIdQueryParams;
12
- }
13
- export declare class GetGenerationsUserUserIdResponse extends SpeakeasyBase {
14
- contentType: string;
15
- statusCode: number;
16
- getGenerationsUserUserId200ApplicationJSONAny?: any;
17
- }