@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.
- package/README.md +28 -27
- package/dist/sdk/{creatingdatasets.d.ts → dataset.d.ts} +13 -13
- package/dist/sdk/{creatingdatasets.js → dataset.js} +46 -46
- package/dist/sdk/{generatingimages.d.ts → generation.d.ts} +12 -12
- package/dist/sdk/{generatingimages.js → generation.js} +45 -45
- package/dist/sdk/{initimages.d.ts → initimage.d.ts} +5 -5
- package/dist/sdk/{initimages.js → initimage.js} +15 -15
- package/dist/sdk/{trainingmodels.d.ts → model.d.ts} +9 -9
- package/dist/sdk/{trainingmodels.js → model.js} +38 -38
- package/dist/sdk/models/operations/createdataset.d.ts +22 -0
- package/dist/sdk/models/operations/createdataset.js +104 -0
- package/dist/sdk/models/operations/creategeneration.d.ts +33 -0
- package/dist/sdk/models/operations/{postgenerations.js → creategeneration.js} +62 -38
- package/dist/sdk/models/operations/createmodel.d.ts +26 -0
- package/dist/sdk/models/operations/{postmodels.js → createmodel.js} +55 -31
- package/dist/sdk/models/operations/createvariationupscale.d.ts +18 -0
- package/dist/sdk/models/operations/createvariationupscale.js +96 -0
- package/dist/sdk/models/operations/deletedatasetsid.d.ts +10 -1
- package/dist/sdk/models/operations/deletedatasetsid.js +31 -3
- package/dist/sdk/models/operations/deletegenerationsid.d.ts +10 -1
- package/dist/sdk/models/operations/deletegenerationsid.js +31 -3
- package/dist/sdk/models/operations/deleteinitimageid.d.ts +10 -1
- package/dist/sdk/models/operations/deleteinitimageid.js +31 -3
- package/dist/sdk/models/operations/deletemodelsid.d.ts +10 -1
- package/dist/sdk/models/operations/deletemodelsid.js +31 -3
- package/dist/sdk/models/operations/getdatasetbyid.d.ts +34 -0
- package/dist/sdk/models/operations/getdatasetbyid.js +144 -0
- package/dist/sdk/models/operations/getgenerationbyid.d.ts +55 -0
- package/dist/sdk/models/operations/getgenerationbyid.js +220 -0
- package/dist/sdk/models/operations/getgenerationsbyuserid.d.ts +60 -0
- package/dist/sdk/models/operations/getgenerationsbyuserid.js +240 -0
- package/dist/sdk/models/operations/getinitimagebyid.d.ts +23 -0
- package/dist/sdk/models/operations/getinitimagebyid.js +108 -0
- package/dist/sdk/models/operations/getmodelbyid.d.ts +32 -0
- package/dist/sdk/models/operations/getmodelbyid.js +144 -0
- package/dist/sdk/models/operations/getuserself.d.ts +23 -0
- package/dist/sdk/models/operations/getuserself.js +100 -0
- package/dist/sdk/models/operations/getvariationbyid.d.ts +25 -0
- package/dist/sdk/models/operations/getvariationbyid.js +116 -0
- package/dist/sdk/models/operations/index.d.ts +14 -14
- package/dist/sdk/models/operations/index.js +14 -14
- package/dist/sdk/models/operations/uploaddatasetimage.d.ts +25 -0
- package/dist/sdk/models/operations/uploaddatasetimage.js +124 -0
- package/dist/sdk/models/operations/uploaddatasetimagefromgen.d.ts +22 -0
- package/dist/sdk/models/operations/uploaddatasetimagefromgen.js +112 -0
- package/dist/sdk/models/operations/uploadinitimage.d.ts +22 -0
- package/dist/sdk/models/operations/uploadinitimage.js +112 -0
- package/dist/sdk/sdk.d.ts +12 -12
- package/dist/sdk/sdk.js +13 -13
- package/dist/sdk/{userinformation.d.ts → user.d.ts} +3 -3
- package/dist/sdk/{userinformation.js → user.js} +8 -8
- package/dist/sdk/{imagevariations.d.ts → variation.d.ts} +7 -7
- package/dist/sdk/{imagevariations.js → variation.js} +30 -30
- package/package.json +2 -19
- package/dist/sdk/models/operations/getdatasetsid.d.ts +0 -12
- package/dist/sdk/models/operations/getdatasetsid.js +0 -72
- package/dist/sdk/models/operations/getgenerationsid.d.ts +0 -12
- package/dist/sdk/models/operations/getgenerationsid.js +0 -72
- package/dist/sdk/models/operations/getgenerationsuseruserid.d.ts +0 -17
- package/dist/sdk/models/operations/getgenerationsuseruserid.js +0 -92
- package/dist/sdk/models/operations/getinitimageid.d.ts +0 -12
- package/dist/sdk/models/operations/getinitimageid.js +0 -72
- package/dist/sdk/models/operations/getme.d.ts +0 -6
- package/dist/sdk/models/operations/getme.js +0 -48
- package/dist/sdk/models/operations/getmodelsid.d.ts +0 -12
- package/dist/sdk/models/operations/getmodelsid.js +0 -72
- package/dist/sdk/models/operations/getvariationsid.d.ts +0 -12
- package/dist/sdk/models/operations/getvariationsid.js +0 -72
- package/dist/sdk/models/operations/postdatasets.d.ts +0 -13
- package/dist/sdk/models/operations/postdatasets.js +0 -76
- package/dist/sdk/models/operations/postdatasetsdatasetidupload.d.ts +0 -16
- package/dist/sdk/models/operations/postdatasetsdatasetidupload.js +0 -88
- package/dist/sdk/models/operations/postdatasetsdatasetiduploadgen.d.ts +0 -16
- package/dist/sdk/models/operations/postdatasetsdatasetiduploadgen.js +0 -88
- package/dist/sdk/models/operations/postgenerations.d.ts +0 -27
- package/dist/sdk/models/operations/postinitimage.d.ts +0 -12
- package/dist/sdk/models/operations/postinitimage.js +0 -72
- package/dist/sdk/models/operations/postmodels.d.ts +0 -20
- package/dist/sdk/models/operations/postvariationsupscale.d.ts +0 -12
- package/dist/sdk/models/operations/postvariationsupscale.js +0 -72
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ To get access to the API and fetch an API key, please sign up for [access](https
|
|
|
31
31
|
<!-- Start SDK Example Usage -->
|
|
32
32
|
```typescript
|
|
33
33
|
import { Leonardo, withSecurity} from "@leonardo-ai/sdk";
|
|
34
|
-
import {
|
|
34
|
+
import { CreateDatasetRequest, CreateDatasetResponse } from "@leonardo-ai/sdk/src/sdk/models/operations";
|
|
35
35
|
import { AxiosError } from "axios";
|
|
36
36
|
|
|
37
37
|
const sdk = new Leonardo(withSecurity(
|
|
@@ -42,13 +42,14 @@ const sdk = new Leonardo(withSecurity(
|
|
|
42
42
|
}
|
|
43
43
|
));
|
|
44
44
|
|
|
45
|
-
const req:
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
const req: CreateDatasetRequest = {
|
|
46
|
+
request: {
|
|
47
|
+
description: "unde",
|
|
48
|
+
name: "deserunt",
|
|
48
49
|
},
|
|
49
50
|
};
|
|
50
51
|
|
|
51
|
-
sdk.
|
|
52
|
+
sdk.dataset.createDataset(req).then((res: CreateDatasetResponse | AxiosError) => {
|
|
52
53
|
// handle response
|
|
53
54
|
});
|
|
54
55
|
```
|
|
@@ -58,41 +59,41 @@ sdk.creatingDatasets.deleteDatasetsId(req).then((res: DeleteDatasetsIdResponse |
|
|
|
58
59
|
## SDK Available Operations
|
|
59
60
|
|
|
60
61
|
|
|
61
|
-
###
|
|
62
|
+
### dataset
|
|
62
63
|
|
|
64
|
+
* `createDataset` - Create a Dataset
|
|
63
65
|
* `deleteDatasetsId` - Delete a Single Dataset by ID
|
|
64
|
-
* `
|
|
65
|
-
* `
|
|
66
|
-
* `
|
|
67
|
-
* `postDatasetsDatasetIdUploadGen` - Upload a Single Generated Image to a Dataset
|
|
66
|
+
* `getDatasetById` - Get a Single Dataset by ID
|
|
67
|
+
* `uploadDatasetImage` - Upload dataset image
|
|
68
|
+
* `uploadDatasetImageFromGen` - Upload a Single Generated Image to a Dataset
|
|
68
69
|
|
|
69
|
-
###
|
|
70
|
+
### generation
|
|
70
71
|
|
|
72
|
+
* `createGeneration` - Create a Generation of Images
|
|
71
73
|
* `deleteGenerationsId` - Delete a Single Generation
|
|
72
|
-
* `
|
|
73
|
-
* `
|
|
74
|
-
* `postGenerations` - Create a Generation of Images
|
|
74
|
+
* `getGenerationById` - Get a Single Generation
|
|
75
|
+
* `getGenerationsByUserId` - Get generations by user ID
|
|
75
76
|
|
|
76
|
-
###
|
|
77
|
-
|
|
78
|
-
* `getVariationsId` - Get variation by ID
|
|
79
|
-
* `postVariationsUpscale` - Create upscale
|
|
80
|
-
|
|
81
|
-
### initImages
|
|
77
|
+
### initImage
|
|
82
78
|
|
|
83
79
|
* `deleteInitImageId` - Delete init image
|
|
84
|
-
* `
|
|
85
|
-
* `
|
|
80
|
+
* `getInitImageById` - Get single init image
|
|
81
|
+
* `uploadInitImage` - Upload init image
|
|
86
82
|
|
|
87
|
-
###
|
|
83
|
+
### model
|
|
88
84
|
|
|
85
|
+
* `createModel` - Train a Custom Model
|
|
89
86
|
* `deleteModelsId` - Delete a Single Custom Model by ID
|
|
90
|
-
* `
|
|
91
|
-
|
|
87
|
+
* `getModelById` - Get a Single Custom Model by ID
|
|
88
|
+
|
|
89
|
+
### user
|
|
90
|
+
|
|
91
|
+
* `getUserSelf` - Get user information
|
|
92
92
|
|
|
93
|
-
###
|
|
93
|
+
### variation
|
|
94
94
|
|
|
95
|
-
* `
|
|
95
|
+
* `createVariationUpscale` - Create upscale
|
|
96
|
+
* `getVariationById` - Get variation by ID
|
|
96
97
|
<!-- End SDK Available Operations -->
|
|
97
98
|
|
|
98
99
|
### SDK Generated by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as operations from "./models/operations";
|
|
2
2
|
import { AxiosInstance, AxiosRequestConfig } from "axios";
|
|
3
|
-
export declare class
|
|
3
|
+
export declare class Dataset {
|
|
4
4
|
_defaultClient: AxiosInstance;
|
|
5
5
|
_securityClient: AxiosInstance;
|
|
6
6
|
_serverURL: string;
|
|
@@ -8,6 +8,12 @@ export declare class CreatingDatasets {
|
|
|
8
8
|
_sdkVersion: string;
|
|
9
9
|
_genVersion: string;
|
|
10
10
|
constructor(defaultClient: AxiosInstance, securityClient: AxiosInstance, serverURL: string, language: string, sdkVersion: string, genVersion: string);
|
|
11
|
+
/**
|
|
12
|
+
* createDataset - Create a Dataset
|
|
13
|
+
*
|
|
14
|
+
* This endpoint creates a new dataset
|
|
15
|
+
**/
|
|
16
|
+
createDataset(req: operations.CreateDatasetRequest, config?: AxiosRequestConfig): Promise<operations.CreateDatasetResponse>;
|
|
11
17
|
/**
|
|
12
18
|
* deleteDatasetsId - Delete a Single Dataset by ID
|
|
13
19
|
*
|
|
@@ -15,27 +21,21 @@ export declare class CreatingDatasets {
|
|
|
15
21
|
**/
|
|
16
22
|
deleteDatasetsId(req: operations.DeleteDatasetsIdRequest, config?: AxiosRequestConfig): Promise<operations.DeleteDatasetsIdResponse>;
|
|
17
23
|
/**
|
|
18
|
-
*
|
|
24
|
+
* getDatasetById - Get a Single Dataset by ID
|
|
19
25
|
*
|
|
20
26
|
* This endpoint gets the specific dataset
|
|
21
27
|
**/
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* postDatasets - Create a Dataset
|
|
25
|
-
*
|
|
26
|
-
* This endpoint creates a new dataset
|
|
27
|
-
**/
|
|
28
|
-
postDatasets(req: operations.PostDatasetsRequest, config?: AxiosRequestConfig): Promise<operations.PostDatasetsResponse>;
|
|
28
|
+
getDatasetById(req: operations.GetDatasetByIdRequest, config?: AxiosRequestConfig): Promise<operations.GetDatasetByIdResponse>;
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* uploadDatasetImage - Upload dataset image
|
|
31
31
|
*
|
|
32
32
|
* This endpoint returns presigned details to upload a dataset image to S3
|
|
33
33
|
**/
|
|
34
|
-
|
|
34
|
+
uploadDatasetImage(req: operations.UploadDatasetImageRequest, config?: AxiosRequestConfig): Promise<operations.UploadDatasetImageResponse>;
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* uploadDatasetImageFromGen - Upload a Single Generated Image to a Dataset
|
|
37
37
|
*
|
|
38
38
|
* This endpoint will upload a previously generated image to the dataset
|
|
39
39
|
**/
|
|
40
|
-
|
|
40
|
+
uploadDatasetImageFromGen(req: operations.UploadDatasetImageFromGenRequest, config?: AxiosRequestConfig): Promise<operations.UploadDatasetImageFromGenResponse>;
|
|
41
41
|
}
|
|
@@ -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.
|
|
37
|
+
exports.Dataset = void 0;
|
|
38
38
|
var utils = __importStar(require("../internal/utils"));
|
|
39
39
|
var operations = __importStar(require("./models/operations"));
|
|
40
|
-
var
|
|
41
|
-
function
|
|
40
|
+
var Dataset = /** @class */ (function () {
|
|
41
|
+
function Dataset(defaultClient, securityClient, serverURL, language, sdkVersion, genVersion) {
|
|
42
42
|
this._defaultClient = defaultClient;
|
|
43
43
|
this._securityClient = securityClient;
|
|
44
44
|
this._serverURL = serverURL;
|
|
@@ -47,18 +47,31 @@ var CreatingDatasets = /** @class */ (function () {
|
|
|
47
47
|
this._genVersion = genVersion;
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
|
-
*
|
|
50
|
+
* createDataset - Create a Dataset
|
|
51
51
|
*
|
|
52
|
-
* This endpoint
|
|
52
|
+
* This endpoint creates a new dataset
|
|
53
53
|
**/
|
|
54
|
-
|
|
54
|
+
Dataset.prototype.createDataset = function (req, config) {
|
|
55
|
+
var _a;
|
|
55
56
|
if (!(req instanceof utils.SpeakeasyBase)) {
|
|
56
|
-
req = new operations.
|
|
57
|
+
req = new operations.CreateDatasetRequest(req);
|
|
57
58
|
}
|
|
58
59
|
var baseURL = this._serverURL;
|
|
59
|
-
var url =
|
|
60
|
+
var url = baseURL.replace(/\/$/, "") + "/datasets";
|
|
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
|
|
71
|
+
var headers = __assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers);
|
|
72
|
+
if (reqBody == null || Object.keys(reqBody).length === 0)
|
|
73
|
+
throw new Error("request body is required");
|
|
74
|
+
var r = client.request(__assign({ url: url, method: "post", headers: headers, data: reqBody }, config));
|
|
62
75
|
return r.then(function (httpRes) {
|
|
63
76
|
var _a, _b;
|
|
64
77
|
var contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
@@ -68,7 +81,7 @@ var CreatingDatasets = /** @class */ (function () {
|
|
|
68
81
|
switch (true) {
|
|
69
82
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
70
83
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
71
|
-
res.
|
|
84
|
+
res.createDataset200ApplicationJSONObject = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
|
|
72
85
|
}
|
|
73
86
|
break;
|
|
74
87
|
}
|
|
@@ -76,18 +89,18 @@ var CreatingDatasets = /** @class */ (function () {
|
|
|
76
89
|
});
|
|
77
90
|
};
|
|
78
91
|
/**
|
|
79
|
-
*
|
|
92
|
+
* deleteDatasetsId - Delete a Single Dataset by ID
|
|
80
93
|
*
|
|
81
|
-
* This endpoint
|
|
94
|
+
* This endpoint deletes the specific dataset
|
|
82
95
|
**/
|
|
83
|
-
|
|
96
|
+
Dataset.prototype.deleteDatasetsId = function (req, config) {
|
|
84
97
|
if (!(req instanceof utils.SpeakeasyBase)) {
|
|
85
|
-
req = new operations.
|
|
98
|
+
req = new operations.DeleteDatasetsIdRequest(req);
|
|
86
99
|
}
|
|
87
100
|
var baseURL = this._serverURL;
|
|
88
101
|
var url = utils.generateURL(baseURL, "/datasets/{id}", req.pathParams);
|
|
89
102
|
var client = this._securityClient;
|
|
90
|
-
var r = client.request(__assign({ url: url, method: "
|
|
103
|
+
var r = client.request(__assign({ url: url, method: "delete" }, config));
|
|
91
104
|
return r.then(function (httpRes) {
|
|
92
105
|
var _a, _b;
|
|
93
106
|
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 : "";
|
|
@@ -97,7 +110,7 @@ var CreatingDatasets = /** @class */ (function () {
|
|
|
97
110
|
switch (true) {
|
|
98
111
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
99
112
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
100
|
-
res.
|
|
113
|
+
res.deleteDatasetsId200ApplicationJSONObject = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
|
|
101
114
|
}
|
|
102
115
|
break;
|
|
103
116
|
}
|
|
@@ -105,31 +118,18 @@ var CreatingDatasets = /** @class */ (function () {
|
|
|
105
118
|
});
|
|
106
119
|
};
|
|
107
120
|
/**
|
|
108
|
-
*
|
|
121
|
+
* getDatasetById - Get a Single Dataset by ID
|
|
109
122
|
*
|
|
110
|
-
* This endpoint
|
|
123
|
+
* This endpoint gets the specific dataset
|
|
111
124
|
**/
|
|
112
|
-
|
|
113
|
-
var _a;
|
|
125
|
+
Dataset.prototype.getDatasetById = function (req, config) {
|
|
114
126
|
if (!(req instanceof utils.SpeakeasyBase)) {
|
|
115
|
-
req = new operations.
|
|
127
|
+
req = new operations.GetDatasetByIdRequest(req);
|
|
116
128
|
}
|
|
117
129
|
var baseURL = this._serverURL;
|
|
118
|
-
var url =
|
|
119
|
-
var _b = [{}, {}], reqBodyHeaders = _b[0], reqBody = _b[1];
|
|
120
|
-
try {
|
|
121
|
-
_a = utils.serializeRequestBody(req), reqBodyHeaders = _a[0], reqBody = _a[1];
|
|
122
|
-
}
|
|
123
|
-
catch (e) {
|
|
124
|
-
if (e instanceof Error) {
|
|
125
|
-
throw new Error("Error serializing request body, cause: ".concat(e.message));
|
|
126
|
-
}
|
|
127
|
-
}
|
|
130
|
+
var url = utils.generateURL(baseURL, "/datasets/{id}", req.pathParams);
|
|
128
131
|
var client = this._securityClient;
|
|
129
|
-
var
|
|
130
|
-
if (reqBody == null || Object.keys(reqBody).length === 0)
|
|
131
|
-
throw new Error("request body is required");
|
|
132
|
-
var r = client.request(__assign({ url: url, method: "post", headers: headers, data: reqBody }, config));
|
|
132
|
+
var r = client.request(__assign({ url: url, method: "get" }, config));
|
|
133
133
|
return r.then(function (httpRes) {
|
|
134
134
|
var _a, _b;
|
|
135
135
|
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 : "";
|
|
@@ -139,7 +139,7 @@ var CreatingDatasets = /** @class */ (function () {
|
|
|
139
139
|
switch (true) {
|
|
140
140
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
141
141
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
142
|
-
res.
|
|
142
|
+
res.getDatasetById200ApplicationJSONObject = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
|
|
143
143
|
}
|
|
144
144
|
break;
|
|
145
145
|
}
|
|
@@ -147,14 +147,14 @@ var CreatingDatasets = /** @class */ (function () {
|
|
|
147
147
|
});
|
|
148
148
|
};
|
|
149
149
|
/**
|
|
150
|
-
*
|
|
150
|
+
* uploadDatasetImage - Upload dataset image
|
|
151
151
|
*
|
|
152
152
|
* This endpoint returns presigned details to upload a dataset image to S3
|
|
153
153
|
**/
|
|
154
|
-
|
|
154
|
+
Dataset.prototype.uploadDatasetImage = function (req, config) {
|
|
155
155
|
var _a;
|
|
156
156
|
if (!(req instanceof utils.SpeakeasyBase)) {
|
|
157
|
-
req = new operations.
|
|
157
|
+
req = new operations.UploadDatasetImageRequest(req);
|
|
158
158
|
}
|
|
159
159
|
var baseURL = this._serverURL;
|
|
160
160
|
var url = utils.generateURL(baseURL, "/datasets/{datasetId}/upload", req.pathParams);
|
|
@@ -181,7 +181,7 @@ var CreatingDatasets = /** @class */ (function () {
|
|
|
181
181
|
switch (true) {
|
|
182
182
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
183
183
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
184
|
-
res.
|
|
184
|
+
res.uploadDatasetImage200ApplicationJSONObject = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
|
|
185
185
|
}
|
|
186
186
|
break;
|
|
187
187
|
}
|
|
@@ -189,14 +189,14 @@ var CreatingDatasets = /** @class */ (function () {
|
|
|
189
189
|
});
|
|
190
190
|
};
|
|
191
191
|
/**
|
|
192
|
-
*
|
|
192
|
+
* uploadDatasetImageFromGen - Upload a Single Generated Image to a Dataset
|
|
193
193
|
*
|
|
194
194
|
* This endpoint will upload a previously generated image to the dataset
|
|
195
195
|
**/
|
|
196
|
-
|
|
196
|
+
Dataset.prototype.uploadDatasetImageFromGen = function (req, config) {
|
|
197
197
|
var _a;
|
|
198
198
|
if (!(req instanceof utils.SpeakeasyBase)) {
|
|
199
|
-
req = new operations.
|
|
199
|
+
req = new operations.UploadDatasetImageFromGenRequest(req);
|
|
200
200
|
}
|
|
201
201
|
var baseURL = this._serverURL;
|
|
202
202
|
var url = utils.generateURL(baseURL, "/datasets/{datasetId}/upload/gen", req.pathParams);
|
|
@@ -223,13 +223,13 @@ var CreatingDatasets = /** @class */ (function () {
|
|
|
223
223
|
switch (true) {
|
|
224
224
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
225
225
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
226
|
-
res.
|
|
226
|
+
res.uploadDatasetImageFromGen200ApplicationJSONObject = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
|
|
227
227
|
}
|
|
228
228
|
break;
|
|
229
229
|
}
|
|
230
230
|
return res;
|
|
231
231
|
});
|
|
232
232
|
};
|
|
233
|
-
return
|
|
233
|
+
return Dataset;
|
|
234
234
|
}());
|
|
235
|
-
exports.
|
|
235
|
+
exports.Dataset = Dataset;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as operations from "./models/operations";
|
|
2
2
|
import { AxiosInstance, AxiosRequestConfig } from "axios";
|
|
3
|
-
export declare class
|
|
3
|
+
export declare class Generation {
|
|
4
4
|
_defaultClient: AxiosInstance;
|
|
5
5
|
_securityClient: AxiosInstance;
|
|
6
6
|
_serverURL: string;
|
|
@@ -9,27 +9,27 @@ export declare class GeneratingImages {
|
|
|
9
9
|
_genVersion: string;
|
|
10
10
|
constructor(defaultClient: AxiosInstance, securityClient: AxiosInstance, serverURL: string, language: string, sdkVersion: string, genVersion: string);
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* createGeneration - Create a Generation of Images
|
|
13
13
|
*
|
|
14
|
-
* This endpoint
|
|
14
|
+
* This endpoint will generate images
|
|
15
15
|
**/
|
|
16
|
-
|
|
16
|
+
createGeneration(req: operations.CreateGenerationRequest, config?: AxiosRequestConfig): Promise<operations.CreateGenerationResponse>;
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* deleteGenerationsId - Delete a Single Generation
|
|
19
19
|
*
|
|
20
|
-
* This endpoint
|
|
20
|
+
* This endpoint deletes a specific generation
|
|
21
21
|
**/
|
|
22
|
-
|
|
22
|
+
deleteGenerationsId(req: operations.DeleteGenerationsIdRequest, config?: AxiosRequestConfig): Promise<operations.DeleteGenerationsIdResponse>;
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* getGenerationById - Get a Single Generation
|
|
25
25
|
*
|
|
26
26
|
* This endpoint will provide information about a specific generation
|
|
27
27
|
**/
|
|
28
|
-
|
|
28
|
+
getGenerationById(req: operations.GetGenerationByIdRequest, config?: AxiosRequestConfig): Promise<operations.GetGenerationByIdResponse>;
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* getGenerationsByUserId - Get generations by user ID
|
|
31
31
|
*
|
|
32
|
-
* This endpoint
|
|
32
|
+
* This endpoint returns all generations by a specific user
|
|
33
33
|
**/
|
|
34
|
-
|
|
34
|
+
getGenerationsByUserId(req: operations.GetGenerationsByUserIdRequest, config?: AxiosRequestConfig): Promise<operations.GetGenerationsByUserIdResponse>;
|
|
35
35
|
}
|
|
@@ -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.
|
|
37
|
+
exports.Generation = void 0;
|
|
38
38
|
var utils = __importStar(require("../internal/utils"));
|
|
39
39
|
var operations = __importStar(require("./models/operations"));
|
|
40
|
-
var
|
|
41
|
-
function
|
|
40
|
+
var Generation = /** @class */ (function () {
|
|
41
|
+
function Generation(defaultClient, securityClient, serverURL, language, sdkVersion, genVersion) {
|
|
42
42
|
this._defaultClient = defaultClient;
|
|
43
43
|
this._securityClient = securityClient;
|
|
44
44
|
this._serverURL = serverURL;
|
|
@@ -47,18 +47,31 @@ var GeneratingImages = /** @class */ (function () {
|
|
|
47
47
|
this._genVersion = genVersion;
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
|
-
*
|
|
50
|
+
* createGeneration - Create a Generation of Images
|
|
51
51
|
*
|
|
52
|
-
* This endpoint
|
|
52
|
+
* This endpoint will generate images
|
|
53
53
|
**/
|
|
54
|
-
|
|
54
|
+
Generation.prototype.createGeneration = function (req, config) {
|
|
55
|
+
var _a;
|
|
55
56
|
if (!(req instanceof utils.SpeakeasyBase)) {
|
|
56
|
-
req = new operations.
|
|
57
|
+
req = new operations.CreateGenerationRequest(req);
|
|
57
58
|
}
|
|
58
59
|
var baseURL = this._serverURL;
|
|
59
|
-
var url =
|
|
60
|
+
var url = baseURL.replace(/\/$/, "") + "/generations";
|
|
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
|
|
71
|
+
var headers = __assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers);
|
|
72
|
+
if (reqBody == null || Object.keys(reqBody).length === 0)
|
|
73
|
+
throw new Error("request body is required");
|
|
74
|
+
var r = client.request(__assign({ url: url, method: "post", headers: headers, data: reqBody }, config));
|
|
62
75
|
return r.then(function (httpRes) {
|
|
63
76
|
var _a, _b;
|
|
64
77
|
var contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
@@ -68,7 +81,7 @@ var GeneratingImages = /** @class */ (function () {
|
|
|
68
81
|
switch (true) {
|
|
69
82
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
70
83
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
71
|
-
res.
|
|
84
|
+
res.createGeneration200ApplicationJSONObject = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
|
|
72
85
|
}
|
|
73
86
|
break;
|
|
74
87
|
}
|
|
@@ -76,20 +89,18 @@ var GeneratingImages = /** @class */ (function () {
|
|
|
76
89
|
});
|
|
77
90
|
};
|
|
78
91
|
/**
|
|
79
|
-
*
|
|
92
|
+
* deleteGenerationsId - Delete a Single Generation
|
|
80
93
|
*
|
|
81
|
-
* This endpoint
|
|
94
|
+
* This endpoint deletes a specific generation
|
|
82
95
|
**/
|
|
83
|
-
|
|
96
|
+
Generation.prototype.deleteGenerationsId = function (req, config) {
|
|
84
97
|
if (!(req instanceof utils.SpeakeasyBase)) {
|
|
85
|
-
req = new operations.
|
|
98
|
+
req = new operations.DeleteGenerationsIdRequest(req);
|
|
86
99
|
}
|
|
87
100
|
var baseURL = this._serverURL;
|
|
88
|
-
var url = utils.generateURL(baseURL, "/generations/
|
|
101
|
+
var url = utils.generateURL(baseURL, "/generations/{id}", req.pathParams);
|
|
89
102
|
var client = this._securityClient;
|
|
90
|
-
var
|
|
91
|
-
var requestConfig = __assign(__assign({}, config), { params: req.queryParams, paramsSerializer: qpSerializer });
|
|
92
|
-
var r = client.request(__assign({ url: url, method: "get" }, requestConfig));
|
|
103
|
+
var r = client.request(__assign({ url: url, method: "delete" }, config));
|
|
93
104
|
return r.then(function (httpRes) {
|
|
94
105
|
var _a, _b;
|
|
95
106
|
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 : "";
|
|
@@ -99,7 +110,7 @@ var GeneratingImages = /** @class */ (function () {
|
|
|
99
110
|
switch (true) {
|
|
100
111
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
101
112
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
102
|
-
res.
|
|
113
|
+
res.deleteGenerationsId200ApplicationJSONObject = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
|
|
103
114
|
}
|
|
104
115
|
break;
|
|
105
116
|
}
|
|
@@ -107,13 +118,13 @@ var GeneratingImages = /** @class */ (function () {
|
|
|
107
118
|
});
|
|
108
119
|
};
|
|
109
120
|
/**
|
|
110
|
-
*
|
|
121
|
+
* getGenerationById - Get a Single Generation
|
|
111
122
|
*
|
|
112
123
|
* This endpoint will provide information about a specific generation
|
|
113
124
|
**/
|
|
114
|
-
|
|
125
|
+
Generation.prototype.getGenerationById = function (req, config) {
|
|
115
126
|
if (!(req instanceof utils.SpeakeasyBase)) {
|
|
116
|
-
req = new operations.
|
|
127
|
+
req = new operations.GetGenerationByIdRequest(req);
|
|
117
128
|
}
|
|
118
129
|
var baseURL = this._serverURL;
|
|
119
130
|
var url = utils.generateURL(baseURL, "/generations/{id}", req.pathParams);
|
|
@@ -128,7 +139,7 @@ var GeneratingImages = /** @class */ (function () {
|
|
|
128
139
|
switch (true) {
|
|
129
140
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
130
141
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
131
|
-
res.
|
|
142
|
+
res.getGenerationById200ApplicationJSONObject = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
|
|
132
143
|
}
|
|
133
144
|
break;
|
|
134
145
|
}
|
|
@@ -136,31 +147,20 @@ var GeneratingImages = /** @class */ (function () {
|
|
|
136
147
|
});
|
|
137
148
|
};
|
|
138
149
|
/**
|
|
139
|
-
*
|
|
150
|
+
* getGenerationsByUserId - Get generations by user ID
|
|
140
151
|
*
|
|
141
|
-
* This endpoint
|
|
152
|
+
* This endpoint returns all generations by a specific user
|
|
142
153
|
**/
|
|
143
|
-
|
|
144
|
-
var _a;
|
|
154
|
+
Generation.prototype.getGenerationsByUserId = function (req, config) {
|
|
145
155
|
if (!(req instanceof utils.SpeakeasyBase)) {
|
|
146
|
-
req = new operations.
|
|
156
|
+
req = new operations.GetGenerationsByUserIdRequest(req);
|
|
147
157
|
}
|
|
148
158
|
var baseURL = this._serverURL;
|
|
149
|
-
var url =
|
|
150
|
-
var _b = [{}, {}], reqBodyHeaders = _b[0], reqBody = _b[1];
|
|
151
|
-
try {
|
|
152
|
-
_a = utils.serializeRequestBody(req), reqBodyHeaders = _a[0], reqBody = _a[1];
|
|
153
|
-
}
|
|
154
|
-
catch (e) {
|
|
155
|
-
if (e instanceof Error) {
|
|
156
|
-
throw new Error("Error serializing request body, cause: ".concat(e.message));
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
+
var url = utils.generateURL(baseURL, "/generations/user/{userId}", req.pathParams);
|
|
159
160
|
var client = this._securityClient;
|
|
160
|
-
var
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
var r = client.request(__assign({ url: url, method: "post", headers: headers, data: reqBody }, config));
|
|
161
|
+
var qpSerializer = utils.getQueryParamSerializer(req.queryParams);
|
|
162
|
+
var requestConfig = __assign(__assign({}, config), { params: req.queryParams, paramsSerializer: qpSerializer });
|
|
163
|
+
var r = client.request(__assign({ url: url, method: "get" }, requestConfig));
|
|
164
164
|
return r.then(function (httpRes) {
|
|
165
165
|
var _a, _b;
|
|
166
166
|
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 : "";
|
|
@@ -170,13 +170,13 @@ var GeneratingImages = /** @class */ (function () {
|
|
|
170
170
|
switch (true) {
|
|
171
171
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
172
172
|
if (utils.matchContentType(contentType, "application/json")) {
|
|
173
|
-
res.
|
|
173
|
+
res.getGenerationsByUserId200ApplicationJSONObject = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data;
|
|
174
174
|
}
|
|
175
175
|
break;
|
|
176
176
|
}
|
|
177
177
|
return res;
|
|
178
178
|
});
|
|
179
179
|
};
|
|
180
|
-
return
|
|
180
|
+
return Generation;
|
|
181
181
|
}());
|
|
182
|
-
exports.
|
|
182
|
+
exports.Generation = Generation;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as operations from "./models/operations";
|
|
2
2
|
import { AxiosInstance, AxiosRequestConfig } from "axios";
|
|
3
|
-
export declare class
|
|
3
|
+
export declare class InitImage {
|
|
4
4
|
_defaultClient: AxiosInstance;
|
|
5
5
|
_securityClient: AxiosInstance;
|
|
6
6
|
_serverURL: string;
|
|
@@ -15,15 +15,15 @@ export declare class InitImages {
|
|
|
15
15
|
**/
|
|
16
16
|
deleteInitImageId(req: operations.DeleteInitImageIdRequest, config?: AxiosRequestConfig): Promise<operations.DeleteInitImageIdResponse>;
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* getInitImageById - Get single init image
|
|
19
19
|
*
|
|
20
20
|
* This endpoint will return a single init image
|
|
21
21
|
**/
|
|
22
|
-
|
|
22
|
+
getInitImageById(req: operations.GetInitImageByIdRequest, config?: AxiosRequestConfig): Promise<operations.GetInitImageByIdResponse>;
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* uploadInitImage - Upload init image
|
|
25
25
|
*
|
|
26
26
|
* This endpoint returns presigned details to upload an init image to S3
|
|
27
27
|
**/
|
|
28
|
-
|
|
28
|
+
uploadInitImage(req: operations.UploadInitImageRequest, config?: AxiosRequestConfig): Promise<operations.UploadInitImageResponse>;
|
|
29
29
|
}
|