@leonardo-ai/sdk 2.1.0 → 2.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.
- package/README.md +38 -10
- package/dist/internal/utils/queryparams.js +3 -1
- package/dist/internal/utils/security.js +11 -3
- package/dist/sdk/dataset.js +15 -15
- package/dist/sdk/element.js +3 -3
- package/dist/sdk/generation.js +18 -18
- package/dist/sdk/initimage.js +9 -9
- package/dist/sdk/model.js +18 -18
- package/dist/sdk/sdk.js +4 -4
- package/dist/sdk/user.js +3 -3
- package/dist/sdk/variation.js +12 -12
- package/docs/sdk/models/operations/createdatasetresponse.md +11 -0
- package/docs/sdk/models/operations/createdatasetresponsebody.md +10 -0
- package/docs/{models → sdk/models}/operations/creategenerationrequestbody.md +5 -5
- package/docs/sdk/models/operations/creategenerationresponse.md +11 -0
- package/docs/sdk/models/operations/creategenerationresponsebody.md +10 -0
- package/docs/{models → sdk/models}/operations/createmodelrequestbody.md +3 -3
- package/docs/sdk/models/operations/createmodelresponse.md +11 -0
- package/docs/sdk/models/operations/createmodelresponsebody.md +10 -0
- package/docs/sdk/models/operations/createvariationnobgresponse.md +11 -0
- package/docs/sdk/models/operations/createvariationnobgresponsebody.md +10 -0
- package/docs/sdk/models/operations/createvariationupscaleresponse.md +11 -0
- package/docs/sdk/models/operations/createvariationupscaleresponsebody.md +10 -0
- package/docs/sdk/models/operations/deletedatasetbyidresponse.md +11 -0
- package/docs/sdk/models/operations/deletedatasetbyidresponsebody.md +10 -0
- package/docs/sdk/models/operations/deletegenerationbyidresponse.md +11 -0
- package/docs/sdk/models/operations/deletegenerationbyidresponsebody.md +10 -0
- package/docs/sdk/models/operations/deletegenerationstextureidrequest.md +9 -0
- package/docs/sdk/models/operations/deletegenerationstextureidresponse.md +11 -0
- package/docs/sdk/models/operations/deletegenerationstextureidresponsebody.md +10 -0
- package/docs/sdk/models/operations/deleteinitimagebyidresponse.md +11 -0
- package/docs/sdk/models/operations/deleteinitimagebyidresponsebody.md +10 -0
- package/docs/sdk/models/operations/deletemodelbyidresponse.md +11 -0
- package/docs/sdk/models/operations/deletemodelbyidresponsebody.md +10 -0
- package/docs/sdk/models/operations/deletemodels3didrequest.md +9 -0
- package/docs/sdk/models/operations/deletemodels3didresponse.md +11 -0
- package/docs/sdk/models/operations/deletemodels3didresponsebody.md +10 -0
- package/docs/{models → sdk/models}/operations/elements.md +1 -1
- package/docs/{models → sdk/models}/operations/generatedimages.md +7 -7
- package/docs/sdk/models/operations/generatedimagevariationgeneric.md +14 -0
- package/docs/sdk/models/operations/generationelements.md +12 -0
- package/docs/sdk/models/operations/getdatasetbyiddatasets.md +15 -0
- package/docs/sdk/models/operations/getdatasetbyidresponse.md +11 -0
- package/docs/sdk/models/operations/getdatasetbyidresponsebody.md +10 -0
- package/docs/sdk/models/operations/getelementsresponse.md +11 -0
- package/docs/sdk/models/operations/getelementsresponsebody.md +10 -0
- package/docs/sdk/models/operations/getgenerationbyidgeneratedimagevariationgeneric.md +13 -0
- package/docs/{models → sdk/models}/operations/getgenerationbyidgenerations.md +6 -6
- package/docs/{models → sdk/models}/operations/getgenerationbyidloras.md +1 -1
- package/docs/sdk/models/operations/getgenerationbyidresponse.md +11 -0
- package/docs/sdk/models/operations/getgenerationbyidresponsebody.md +10 -0
- package/docs/{models → sdk/models}/operations/getgenerationsbyuseridgeneratedimages.md +7 -7
- package/docs/sdk/models/operations/getgenerationsbyuseridgeneratedimagevariationgeneric.md +13 -0
- package/docs/sdk/models/operations/getgenerationsbyuseridgenerationelements.md +12 -0
- package/docs/{models → sdk/models}/operations/getgenerationsbyuseridgenerations.md +6 -6
- package/docs/sdk/models/operations/getgenerationsbyuseridresponse.md +11 -0
- package/docs/sdk/models/operations/getgenerationsbyuseridresponsebody.md +10 -0
- package/docs/sdk/models/operations/getinitimagebyidresponse.md +11 -0
- package/docs/sdk/models/operations/getinitimagebyidresponsebody.md +10 -0
- package/docs/{models → sdk/models}/operations/getmodelbyidcustommodels.md +3 -3
- package/docs/sdk/models/operations/getmodelbyidresponse.md +11 -0
- package/docs/sdk/models/operations/getmodelbyidresponsebody.md +10 -0
- package/docs/sdk/models/operations/getplatformmodelscustommodels.md +15 -0
- package/docs/sdk/models/operations/getplatformmodelsresponse.md +11 -0
- package/docs/sdk/models/operations/getplatformmodelsresponsebody.md +10 -0
- package/docs/sdk/models/operations/getuserselfresponse.md +11 -0
- package/docs/sdk/models/operations/getuserselfresponsebody.md +10 -0
- package/docs/sdk/models/operations/getvariationbyidresponse.md +11 -0
- package/docs/sdk/models/operations/getvariationbyidresponsebody.md +10 -0
- package/docs/{models → sdk/models}/operations/loras.md +1 -1
- package/docs/sdk/models/operations/postgenerationstextureresponse.md +11 -0
- package/docs/sdk/models/operations/postgenerationstextureresponsebody.md +10 -0
- package/docs/sdk/models/operations/postmodels3duploadresponse.md +11 -0
- package/docs/sdk/models/operations/postmodels3duploadresponsebody.md +10 -0
- package/docs/sdk/models/operations/postvariationsunzoomresponse.md +11 -0
- package/docs/sdk/models/operations/postvariationsunzoomresponsebody.md +10 -0
- package/docs/sdk/models/operations/uploaddatasetimagefromgenrequest.md +9 -0
- package/docs/sdk/models/operations/uploaddatasetimagefromgenresponse.md +11 -0
- package/docs/sdk/models/operations/uploaddatasetimagefromgenresponsebody.md +10 -0
- package/docs/sdk/models/operations/uploaddatasetimagerequest.md +9 -0
- package/docs/sdk/models/operations/uploaddatasetimageresponse.md +11 -0
- package/docs/sdk/models/operations/uploaddatasetimageresponsebody.md +10 -0
- package/docs/sdk/models/operations/uploadinitimageresponse.md +11 -0
- package/docs/sdk/models/operations/uploadinitimageresponsebody.md +10 -0
- package/docs/sdk/models/operations/userdetails.md +15 -0
- package/docs/sdks/dataset/README.md +40 -25
- package/docs/sdks/element/README.md +6 -3
- package/docs/sdks/generation/README.md +44 -26
- package/docs/sdks/initimage/README.md +20 -11
- package/docs/sdks/model/README.md +44 -26
- package/docs/sdks/user/README.md +6 -3
- package/docs/sdks/variation/README.md +33 -21
- package/package.json +1 -1
- package/docs/models/operations/createdatasetresponse.md +0 -11
- package/docs/models/operations/createdatasetresponsebody.md +0 -10
- package/docs/models/operations/creategenerationresponse.md +0 -11
- package/docs/models/operations/creategenerationresponsebody.md +0 -10
- package/docs/models/operations/createmodelresponse.md +0 -11
- package/docs/models/operations/createmodelresponsebody.md +0 -10
- package/docs/models/operations/createvariationnobgresponse.md +0 -11
- package/docs/models/operations/createvariationnobgresponsebody.md +0 -10
- package/docs/models/operations/createvariationupscaleresponse.md +0 -11
- package/docs/models/operations/createvariationupscaleresponsebody.md +0 -10
- package/docs/models/operations/deletedatasetbyidresponse.md +0 -11
- package/docs/models/operations/deletedatasetbyidresponsebody.md +0 -10
- package/docs/models/operations/deletegenerationbyidresponse.md +0 -11
- package/docs/models/operations/deletegenerationbyidresponsebody.md +0 -10
- package/docs/models/operations/deletegenerationstextureidrequest.md +0 -9
- package/docs/models/operations/deletegenerationstextureidresponse.md +0 -11
- package/docs/models/operations/deletegenerationstextureidresponsebody.md +0 -10
- package/docs/models/operations/deleteinitimagebyidresponse.md +0 -11
- package/docs/models/operations/deleteinitimagebyidresponsebody.md +0 -10
- package/docs/models/operations/deletemodelbyidresponse.md +0 -11
- package/docs/models/operations/deletemodelbyidresponsebody.md +0 -10
- package/docs/models/operations/deletemodels3didrequest.md +0 -9
- package/docs/models/operations/deletemodels3didresponse.md +0 -11
- package/docs/models/operations/deletemodels3didresponsebody.md +0 -10
- package/docs/models/operations/generatedimagevariationgeneric.md +0 -14
- package/docs/models/operations/generationelements.md +0 -12
- package/docs/models/operations/getdatasetbyiddatasets.md +0 -15
- package/docs/models/operations/getdatasetbyidresponse.md +0 -11
- package/docs/models/operations/getdatasetbyidresponsebody.md +0 -10
- package/docs/models/operations/getelementsresponse.md +0 -11
- package/docs/models/operations/getelementsresponsebody.md +0 -10
- package/docs/models/operations/getgenerationbyidgeneratedimagevariationgeneric.md +0 -13
- package/docs/models/operations/getgenerationbyidresponse.md +0 -11
- package/docs/models/operations/getgenerationbyidresponsebody.md +0 -10
- package/docs/models/operations/getgenerationsbyuseridgeneratedimagevariationgeneric.md +0 -13
- package/docs/models/operations/getgenerationsbyuseridgenerationelements.md +0 -12
- package/docs/models/operations/getgenerationsbyuseridresponse.md +0 -11
- package/docs/models/operations/getgenerationsbyuseridresponsebody.md +0 -10
- package/docs/models/operations/getinitimagebyidresponse.md +0 -11
- package/docs/models/operations/getinitimagebyidresponsebody.md +0 -10
- package/docs/models/operations/getmodelbyidresponse.md +0 -11
- package/docs/models/operations/getmodelbyidresponsebody.md +0 -10
- package/docs/models/operations/getplatformmodelscustommodels.md +0 -15
- package/docs/models/operations/getplatformmodelsresponse.md +0 -11
- package/docs/models/operations/getplatformmodelsresponsebody.md +0 -10
- package/docs/models/operations/getuserselfresponse.md +0 -11
- package/docs/models/operations/getuserselfresponsebody.md +0 -10
- package/docs/models/operations/getvariationbyidresponse.md +0 -11
- package/docs/models/operations/getvariationbyidresponsebody.md +0 -10
- package/docs/models/operations/postgenerationstextureresponse.md +0 -11
- package/docs/models/operations/postgenerationstextureresponsebody.md +0 -10
- package/docs/models/operations/postmodels3duploadresponse.md +0 -11
- package/docs/models/operations/postmodels3duploadresponsebody.md +0 -10
- package/docs/models/operations/postvariationsunzoomresponse.md +0 -11
- package/docs/models/operations/postvariationsunzoomresponsebody.md +0 -10
- package/docs/models/operations/uploaddatasetimagefromgenrequest.md +0 -9
- package/docs/models/operations/uploaddatasetimagefromgenresponse.md +0 -11
- package/docs/models/operations/uploaddatasetimagefromgenresponsebody.md +0 -10
- package/docs/models/operations/uploaddatasetimagerequest.md +0 -9
- package/docs/models/operations/uploaddatasetimageresponse.md +0 -11
- package/docs/models/operations/uploaddatasetimageresponsebody.md +0 -10
- package/docs/models/operations/uploadinitimageresponse.md +0 -11
- package/docs/models/operations/uploadinitimageresponsebody.md +0 -10
- package/docs/models/operations/userdetails.md +0 -15
- /package/docs/{models → sdk/models}/operations/createdatasetrequestbody.md +0 -0
- /package/docs/{models → sdk/models}/operations/createvariationnobgrequestbody.md +0 -0
- /package/docs/{models → sdk/models}/operations/createvariationupscalerequestbody.md +0 -0
- /package/docs/{models → sdk/models}/operations/createvariationupscalesdupscalejoboutput.md +0 -0
- /package/docs/{models → sdk/models}/operations/custommodels.md +0 -0
- /package/docs/{models → sdk/models}/operations/datasetgenuploadoutput.md +0 -0
- /package/docs/{models → sdk/models}/operations/datasetimages.md +0 -0
- /package/docs/{models → sdk/models}/operations/datasets.md +0 -0
- /package/docs/{models → sdk/models}/operations/datasetuploadoutput.md +0 -0
- /package/docs/{models → sdk/models}/operations/deletedatasetbyiddatasets.md +0 -0
- /package/docs/{models → sdk/models}/operations/deletedatasetbyidrequest.md +0 -0
- /package/docs/{models → sdk/models}/operations/deletegenerationbyidrequest.md +0 -0
- /package/docs/{models → sdk/models}/operations/deletegenerationstextureidrequestbody.md +0 -0
- /package/docs/{models → sdk/models}/operations/deleteinitimagebyidrequest.md +0 -0
- /package/docs/{models → sdk/models}/operations/deletemodelbyidrequest.md +0 -0
- /package/docs/{models → sdk/models}/operations/deletemodels3didrequestbody.md +0 -0
- /package/docs/{models → sdk/models}/operations/generations.md +0 -0
- /package/docs/{models → sdk/models}/operations/getdatasetbyidrequest.md +0 -0
- /package/docs/{models → sdk/models}/operations/getgenerationbyidrequest.md +0 -0
- /package/docs/{models → sdk/models}/operations/getgenerationsbyuseridrequest.md +0 -0
- /package/docs/{models → sdk/models}/operations/getinitimagebyidinitimages.md +0 -0
- /package/docs/{models → sdk/models}/operations/getinitimagebyidrequest.md +0 -0
- /package/docs/{models → sdk/models}/operations/getmodelbyidrequest.md +0 -0
- /package/docs/{models → sdk/models}/operations/getplatformmodelsgeneratedimages.md +0 -0
- /package/docs/{models → sdk/models}/operations/getplatformmodelsrequest.md +0 -0
- /package/docs/{models → sdk/models}/operations/getvariationbyidrequest.md +0 -0
- /package/docs/{models → sdk/models}/operations/initimages.md +0 -0
- /package/docs/{models → sdk/models}/operations/initimageuploadoutput.md +0 -0
- /package/docs/{models → sdk/models}/operations/modelassets.md +0 -0
- /package/docs/{models → sdk/models}/operations/modelassettexturegenerations.md +0 -0
- /package/docs/{models → sdk/models}/operations/modelassetuploadoutput.md +0 -0
- /package/docs/{models → sdk/models}/operations/postgenerationstexturerequestbody.md +0 -0
- /package/docs/{models → sdk/models}/operations/postmodels3duploadrequestbody.md +0 -0
- /package/docs/{models → sdk/models}/operations/postvariationsunzoomrequestbody.md +0 -0
- /package/docs/{models → sdk/models}/operations/sdgenerationoutput.md +0 -0
- /package/docs/{models → sdk/models}/operations/sdtrainingoutput.md +0 -0
- /package/docs/{models → sdk/models}/operations/sdunzoomoutput.md +0 -0
- /package/docs/{models → sdk/models}/operations/sdupscalejoboutput.md +0 -0
- /package/docs/{models → sdk/models}/operations/texturegenerationjoboutput.md +0 -0
- /package/docs/{models → sdk/models}/operations/uploaddatasetimagefromgenrequestbody.md +0 -0
- /package/docs/{models → sdk/models}/operations/uploaddatasetimagerequestbody.md +0 -0
- /package/docs/{models → sdk/models}/operations/uploadinitimagerequestbody.md +0 -0
- /package/docs/{models → sdk/models}/operations/users.md +0 -0
- /package/docs/{models → sdk/models}/shared/controlnettype.md +0 -0
- /package/docs/{models → sdk/models}/shared/custommodeltype.md +0 -0
- /package/docs/{models → sdk/models}/shared/elementinput.md +0 -0
- /package/docs/{models → sdk/models}/shared/jobstatus.md +0 -0
- /package/docs/{models → sdk/models}/shared/sdgenerationschedulers.md +0 -0
- /package/docs/{models → sdk/models}/shared/sdgenerationstyle.md +0 -0
- /package/docs/{models → sdk/models}/shared/sdversions.md +0 -0
- /package/docs/{models → sdk/models}/shared/security.md +0 -0
- /package/docs/{models → sdk/models}/shared/strength.md +0 -0
- /package/docs/{models → sdk/models}/shared/variationtype.md +0 -0
package/README.md
CHANGED
|
@@ -54,7 +54,7 @@ import { Leonardo } from "@leonardo-ai/sdk";
|
|
|
54
54
|
## Available Resources and Operations
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
### [
|
|
57
|
+
### [dataset](docs/sdks/dataset/README.md)
|
|
58
58
|
|
|
59
59
|
* [createDataset](docs/sdks/dataset/README.md#createdataset) - Create a Dataset
|
|
60
60
|
* [deleteDatasetById](docs/sdks/dataset/README.md#deletedatasetbyid) - Delete a Single Dataset by ID
|
|
@@ -62,11 +62,11 @@ import { Leonardo } from "@leonardo-ai/sdk";
|
|
|
62
62
|
* [uploadDatasetImage](docs/sdks/dataset/README.md#uploaddatasetimage) - Upload dataset image
|
|
63
63
|
* [uploadDatasetImageFromGen](docs/sdks/dataset/README.md#uploaddatasetimagefromgen) - Upload a Single Generated Image to a Dataset
|
|
64
64
|
|
|
65
|
-
### [
|
|
65
|
+
### [element](docs/sdks/element/README.md)
|
|
66
66
|
|
|
67
67
|
* [getElements](docs/sdks/element/README.md#getelements) - List Elements
|
|
68
68
|
|
|
69
|
-
### [
|
|
69
|
+
### [generation](docs/sdks/generation/README.md)
|
|
70
70
|
|
|
71
71
|
* [createGeneration](docs/sdks/generation/README.md#creategeneration) - Create a Generation of Images
|
|
72
72
|
* [deleteGenerationById](docs/sdks/generation/README.md#deletegenerationbyid) - Delete a Single Generation
|
|
@@ -75,17 +75,17 @@ import { Leonardo } from "@leonardo-ai/sdk";
|
|
|
75
75
|
* [getGenerationsByUserId](docs/sdks/generation/README.md#getgenerationsbyuserid) - Get generations by user ID
|
|
76
76
|
* [postGenerationsTexture](docs/sdks/generation/README.md#postgenerationstexture) - Create Texture Generation
|
|
77
77
|
|
|
78
|
-
### [
|
|
78
|
+
### [initImage](docs/sdks/initimage/README.md)
|
|
79
79
|
|
|
80
80
|
* [deleteInitImageById](docs/sdks/initimage/README.md#deleteinitimagebyid) - Delete init image
|
|
81
81
|
* [getInitImageById](docs/sdks/initimage/README.md#getinitimagebyid) - Get single init image
|
|
82
82
|
* [uploadInitImage](docs/sdks/initimage/README.md#uploadinitimage) - Upload init image
|
|
83
83
|
|
|
84
|
-
### [
|
|
84
|
+
### [user](docs/sdks/user/README.md)
|
|
85
85
|
|
|
86
86
|
* [getUserSelf](docs/sdks/user/README.md#getuserself) - Get user information
|
|
87
87
|
|
|
88
|
-
### [
|
|
88
|
+
### [model](docs/sdks/model/README.md)
|
|
89
89
|
|
|
90
90
|
* [createModel](docs/sdks/model/README.md#createmodel) - Train a Custom Model
|
|
91
91
|
* [deleteModelById](docs/sdks/model/README.md#deletemodelbyid) - Delete a Single Custom Model by ID
|
|
@@ -94,7 +94,7 @@ import { Leonardo } from "@leonardo-ai/sdk";
|
|
|
94
94
|
* [getPlatformModels](docs/sdks/model/README.md#getplatformmodels) - List Platform Models
|
|
95
95
|
* [postModels3dUpload](docs/sdks/model/README.md#postmodels3dupload) - Upload 3D Model
|
|
96
96
|
|
|
97
|
-
### [
|
|
97
|
+
### [variation](docs/sdks/variation/README.md)
|
|
98
98
|
|
|
99
99
|
* [createVariationNoBG](docs/sdks/variation/README.md#createvariationnobg) - Create no background
|
|
100
100
|
* [createVariationUpscale](docs/sdks/variation/README.md#createvariationupscale) - Create upscale
|
|
@@ -133,7 +133,36 @@ Here's an example of one such pagination call:
|
|
|
133
133
|
<!-- Start Error Handling -->
|
|
134
134
|
# Error Handling
|
|
135
135
|
|
|
136
|
-
Handling errors in
|
|
136
|
+
Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an error. If Error objects are specified in your OpenAPI Spec, the SDK will throw the appropriate Error type.
|
|
137
|
+
|
|
138
|
+
| Error Object | Status Code | Content Type |
|
|
139
|
+
| --------------- | --------------- | --------------- |
|
|
140
|
+
| errors.SDKError | 400-600 | */* |
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
## Example
|
|
144
|
+
|
|
145
|
+
```typescript
|
|
146
|
+
import { Leonardo } from "@leonardo-ai/sdk";
|
|
147
|
+
|
|
148
|
+
(async () => {
|
|
149
|
+
const sdk = new Leonardo({
|
|
150
|
+
bearerAuth: "",
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
let res;
|
|
154
|
+
try {
|
|
155
|
+
res = await sdk.dataset.createDataset({
|
|
156
|
+
name: "string",
|
|
157
|
+
});
|
|
158
|
+
} catch (e) {}
|
|
159
|
+
|
|
160
|
+
if (res.statusCode == 200) {
|
|
161
|
+
// handle response
|
|
162
|
+
}
|
|
163
|
+
})();
|
|
164
|
+
|
|
165
|
+
```
|
|
137
166
|
<!-- End Error Handling -->
|
|
138
167
|
|
|
139
168
|
|
|
@@ -223,12 +252,11 @@ import { Leonardo } from "@leonardo-ai/sdk";
|
|
|
223
252
|
|
|
224
253
|
|
|
225
254
|
<!-- Start Authentication -->
|
|
226
|
-
|
|
227
255
|
# Authentication
|
|
228
256
|
|
|
229
257
|
## Per-Client Security Schemes
|
|
230
258
|
|
|
231
|
-
|
|
259
|
+
This SDK supports the following security scheme globally:
|
|
232
260
|
|
|
233
261
|
| Name | Type | Scheme |
|
|
234
262
|
| ------------ | ------------ | ------------ |
|
|
@@ -24,7 +24,9 @@ var utils_1 = require("./utils");
|
|
|
24
24
|
var requestbody_1 = require("./requestbody");
|
|
25
25
|
exports.qpMetadataKey = "queryParam";
|
|
26
26
|
var queryStringPrefix = "?";
|
|
27
|
-
var filterAndJoin = function (strings) {
|
|
27
|
+
var filterAndJoin = function (strings) {
|
|
28
|
+
return strings.filter(function (s) { return !!s; }).join("&");
|
|
29
|
+
};
|
|
28
30
|
function serializeQueryParams(queryParams, globals) {
|
|
29
31
|
var queryStringParts = [];
|
|
30
32
|
if (!queryParams)
|
|
@@ -138,14 +138,22 @@ function parseSecuritySchemeValue(properties, schemeDecorator, securityDecorator
|
|
|
138
138
|
properties.headers[securityDecorator.Name] = value;
|
|
139
139
|
break;
|
|
140
140
|
case "oauth2":
|
|
141
|
-
properties.headers[securityDecorator.Name] = value
|
|
141
|
+
properties.headers[securityDecorator.Name] = value
|
|
142
|
+
.toLowerCase()
|
|
143
|
+
.startsWith("bearer ")
|
|
144
|
+
? value
|
|
145
|
+
: "Bearer ".concat(value);
|
|
142
146
|
break;
|
|
143
147
|
case "http":
|
|
144
148
|
switch (schemeDecorator.SubType) {
|
|
145
149
|
case "basic":
|
|
146
150
|
break;
|
|
147
151
|
case "bearer":
|
|
148
|
-
properties.headers[securityDecorator.Name] = value
|
|
152
|
+
properties.headers[securityDecorator.Name] = value
|
|
153
|
+
.toLowerCase()
|
|
154
|
+
.startsWith("bearer ")
|
|
155
|
+
? value
|
|
156
|
+
: "Bearer ".concat(value);
|
|
149
157
|
break;
|
|
150
158
|
default:
|
|
151
159
|
throw new Error("not supported");
|
|
@@ -174,7 +182,7 @@ function parseBasicAuthScheme(properties, scheme) {
|
|
|
174
182
|
break;
|
|
175
183
|
}
|
|
176
184
|
});
|
|
177
|
-
properties.headers["Authorization"] = "Basic ".concat(Buffer.from("".concat(username, ":").concat(password)).toString(
|
|
185
|
+
properties.headers["Authorization"] = "Basic ".concat(Buffer.from("".concat(username, ":").concat(password)).toString("base64"));
|
|
178
186
|
}
|
|
179
187
|
var SecurityDecorator = /** @class */ (function () {
|
|
180
188
|
function SecurityDecorator(Name, Type, Option, Scheme, SubType) {
|
package/dist/sdk/dataset.js
CHANGED
|
@@ -107,7 +107,7 @@ var Dataset = /** @class */ (function () {
|
|
|
107
107
|
Dataset.prototype.createDataset = function (req, config) {
|
|
108
108
|
var _a, _b;
|
|
109
109
|
return __awaiter(this, void 0, void 0, function () {
|
|
110
|
-
var baseURL,
|
|
110
|
+
var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
|
|
111
111
|
var _d;
|
|
112
112
|
return __generator(this, function (_e) {
|
|
113
113
|
switch (_e.label) {
|
|
@@ -116,7 +116,7 @@ var Dataset = /** @class */ (function () {
|
|
|
116
116
|
req = new operations.CreateDatasetRequestBody(req);
|
|
117
117
|
}
|
|
118
118
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
119
|
-
|
|
119
|
+
operationUrl = baseURL.replace(/\/$/, "") + "/datasets";
|
|
120
120
|
_c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
|
|
121
121
|
try {
|
|
122
122
|
_d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
|
|
@@ -143,7 +143,7 @@ var Dataset = /** @class */ (function () {
|
|
|
143
143
|
throw new Error("request body is required");
|
|
144
144
|
headers["Accept"] = "application/json";
|
|
145
145
|
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
146
|
-
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url:
|
|
146
|
+
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
|
|
147
147
|
case 3:
|
|
148
148
|
httpRes = _e.sent();
|
|
149
149
|
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 : "";
|
|
@@ -180,7 +180,7 @@ var Dataset = /** @class */ (function () {
|
|
|
180
180
|
Dataset.prototype.deleteDatasetById = function (id, config) {
|
|
181
181
|
var _a, _b;
|
|
182
182
|
return __awaiter(this, void 0, void 0, function () {
|
|
183
|
-
var req, baseURL,
|
|
183
|
+
var req, baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
|
|
184
184
|
return __generator(this, function (_c) {
|
|
185
185
|
switch (_c.label) {
|
|
186
186
|
case 0:
|
|
@@ -188,7 +188,7 @@ var Dataset = /** @class */ (function () {
|
|
|
188
188
|
id: id,
|
|
189
189
|
});
|
|
190
190
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
191
|
-
|
|
191
|
+
operationUrl = utils.generateURL(baseURL, "/datasets/{id}", req);
|
|
192
192
|
client = this.sdkConfiguration.defaultClient;
|
|
193
193
|
globalSecurity = this.sdkConfiguration.security;
|
|
194
194
|
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
@@ -204,7 +204,7 @@ var Dataset = /** @class */ (function () {
|
|
|
204
204
|
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
205
205
|
headers["Accept"] = "application/json";
|
|
206
206
|
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
207
|
-
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url:
|
|
207
|
+
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "delete", headers: headers, responseType: "arraybuffer" }, config))];
|
|
208
208
|
case 3:
|
|
209
209
|
httpRes = _c.sent();
|
|
210
210
|
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 : "";
|
|
@@ -241,7 +241,7 @@ var Dataset = /** @class */ (function () {
|
|
|
241
241
|
Dataset.prototype.getDatasetById = function (id, config) {
|
|
242
242
|
var _a, _b;
|
|
243
243
|
return __awaiter(this, void 0, void 0, function () {
|
|
244
|
-
var req, baseURL,
|
|
244
|
+
var req, baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
|
|
245
245
|
return __generator(this, function (_c) {
|
|
246
246
|
switch (_c.label) {
|
|
247
247
|
case 0:
|
|
@@ -249,7 +249,7 @@ var Dataset = /** @class */ (function () {
|
|
|
249
249
|
id: id,
|
|
250
250
|
});
|
|
251
251
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
252
|
-
|
|
252
|
+
operationUrl = utils.generateURL(baseURL, "/datasets/{id}", req);
|
|
253
253
|
client = this.sdkConfiguration.defaultClient;
|
|
254
254
|
globalSecurity = this.sdkConfiguration.security;
|
|
255
255
|
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
@@ -265,7 +265,7 @@ var Dataset = /** @class */ (function () {
|
|
|
265
265
|
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
266
266
|
headers["Accept"] = "application/json";
|
|
267
267
|
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
268
|
-
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url:
|
|
268
|
+
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
|
|
269
269
|
case 3:
|
|
270
270
|
httpRes = _c.sent();
|
|
271
271
|
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 : "";
|
|
@@ -302,7 +302,7 @@ var Dataset = /** @class */ (function () {
|
|
|
302
302
|
Dataset.prototype.uploadDatasetImage = function (requestBody, datasetId, config) {
|
|
303
303
|
var _a, _b;
|
|
304
304
|
return __awaiter(this, void 0, void 0, function () {
|
|
305
|
-
var req, baseURL,
|
|
305
|
+
var req, baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
|
|
306
306
|
var _d;
|
|
307
307
|
return __generator(this, function (_e) {
|
|
308
308
|
switch (_e.label) {
|
|
@@ -312,7 +312,7 @@ var Dataset = /** @class */ (function () {
|
|
|
312
312
|
datasetId: datasetId,
|
|
313
313
|
});
|
|
314
314
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
315
|
-
|
|
315
|
+
operationUrl = utils.generateURL(baseURL, "/datasets/{datasetId}/upload", req);
|
|
316
316
|
_c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
|
|
317
317
|
try {
|
|
318
318
|
_d = __read(utils.serializeRequestBody(req, "requestBody", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
|
|
@@ -339,7 +339,7 @@ var Dataset = /** @class */ (function () {
|
|
|
339
339
|
throw new Error("request body is required");
|
|
340
340
|
headers["Accept"] = "application/json";
|
|
341
341
|
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
342
|
-
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url:
|
|
342
|
+
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
|
|
343
343
|
case 3:
|
|
344
344
|
httpRes = _e.sent();
|
|
345
345
|
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 : "";
|
|
@@ -376,7 +376,7 @@ var Dataset = /** @class */ (function () {
|
|
|
376
376
|
Dataset.prototype.uploadDatasetImageFromGen = function (requestBody, datasetId, config) {
|
|
377
377
|
var _a, _b;
|
|
378
378
|
return __awaiter(this, void 0, void 0, function () {
|
|
379
|
-
var req, baseURL,
|
|
379
|
+
var req, baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
|
|
380
380
|
var _d;
|
|
381
381
|
return __generator(this, function (_e) {
|
|
382
382
|
switch (_e.label) {
|
|
@@ -386,7 +386,7 @@ var Dataset = /** @class */ (function () {
|
|
|
386
386
|
datasetId: datasetId,
|
|
387
387
|
});
|
|
388
388
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
389
|
-
|
|
389
|
+
operationUrl = utils.generateURL(baseURL, "/datasets/{datasetId}/upload/gen", req);
|
|
390
390
|
_c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
|
|
391
391
|
try {
|
|
392
392
|
_d = __read(utils.serializeRequestBody(req, "requestBody", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
|
|
@@ -413,7 +413,7 @@ var Dataset = /** @class */ (function () {
|
|
|
413
413
|
throw new Error("request body is required");
|
|
414
414
|
headers["Accept"] = "application/json";
|
|
415
415
|
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
416
|
-
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url:
|
|
416
|
+
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
|
|
417
417
|
case 3:
|
|
418
418
|
httpRes = _e.sent();
|
|
419
419
|
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 : "";
|
package/dist/sdk/element.js
CHANGED
|
@@ -91,12 +91,12 @@ var Element = /** @class */ (function () {
|
|
|
91
91
|
Element.prototype.getElements = function (config) {
|
|
92
92
|
var _a, _b;
|
|
93
93
|
return __awaiter(this, void 0, void 0, function () {
|
|
94
|
-
var baseURL,
|
|
94
|
+
var baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
|
|
95
95
|
return __generator(this, function (_c) {
|
|
96
96
|
switch (_c.label) {
|
|
97
97
|
case 0:
|
|
98
98
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
99
|
-
|
|
99
|
+
operationUrl = baseURL.replace(/\/$/, "") + "/elements";
|
|
100
100
|
client = this.sdkConfiguration.defaultClient;
|
|
101
101
|
globalSecurity = this.sdkConfiguration.security;
|
|
102
102
|
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
@@ -112,7 +112,7 @@ var Element = /** @class */ (function () {
|
|
|
112
112
|
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
113
113
|
headers["Accept"] = "application/json";
|
|
114
114
|
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
115
|
-
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url:
|
|
115
|
+
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
|
|
116
116
|
case 3:
|
|
117
117
|
httpRes = _c.sent();
|
|
118
118
|
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 : "";
|
package/dist/sdk/generation.js
CHANGED
|
@@ -107,7 +107,7 @@ var Generation = /** @class */ (function () {
|
|
|
107
107
|
Generation.prototype.createGeneration = function (req, config) {
|
|
108
108
|
var _a, _b;
|
|
109
109
|
return __awaiter(this, void 0, void 0, function () {
|
|
110
|
-
var baseURL,
|
|
110
|
+
var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
|
|
111
111
|
var _d;
|
|
112
112
|
return __generator(this, function (_e) {
|
|
113
113
|
switch (_e.label) {
|
|
@@ -116,7 +116,7 @@ var Generation = /** @class */ (function () {
|
|
|
116
116
|
req = new operations.CreateGenerationRequestBody(req);
|
|
117
117
|
}
|
|
118
118
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
119
|
-
|
|
119
|
+
operationUrl = baseURL.replace(/\/$/, "") + "/generations";
|
|
120
120
|
_c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
|
|
121
121
|
try {
|
|
122
122
|
_d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
|
|
@@ -143,7 +143,7 @@ var Generation = /** @class */ (function () {
|
|
|
143
143
|
throw new Error("request body is required");
|
|
144
144
|
headers["Accept"] = "application/json";
|
|
145
145
|
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
146
|
-
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url:
|
|
146
|
+
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
|
|
147
147
|
case 3:
|
|
148
148
|
httpRes = _e.sent();
|
|
149
149
|
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 : "";
|
|
@@ -180,7 +180,7 @@ var Generation = /** @class */ (function () {
|
|
|
180
180
|
Generation.prototype.deleteGenerationById = function (id, config) {
|
|
181
181
|
var _a, _b;
|
|
182
182
|
return __awaiter(this, void 0, void 0, function () {
|
|
183
|
-
var req, baseURL,
|
|
183
|
+
var req, baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
|
|
184
184
|
return __generator(this, function (_c) {
|
|
185
185
|
switch (_c.label) {
|
|
186
186
|
case 0:
|
|
@@ -188,7 +188,7 @@ var Generation = /** @class */ (function () {
|
|
|
188
188
|
id: id,
|
|
189
189
|
});
|
|
190
190
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
191
|
-
|
|
191
|
+
operationUrl = utils.generateURL(baseURL, "/generations/{id}", req);
|
|
192
192
|
client = this.sdkConfiguration.defaultClient;
|
|
193
193
|
globalSecurity = this.sdkConfiguration.security;
|
|
194
194
|
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
@@ -204,7 +204,7 @@ var Generation = /** @class */ (function () {
|
|
|
204
204
|
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
205
205
|
headers["Accept"] = "application/json";
|
|
206
206
|
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
207
|
-
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url:
|
|
207
|
+
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "delete", headers: headers, responseType: "arraybuffer" }, config))];
|
|
208
208
|
case 3:
|
|
209
209
|
httpRes = _c.sent();
|
|
210
210
|
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 : "";
|
|
@@ -241,7 +241,7 @@ var Generation = /** @class */ (function () {
|
|
|
241
241
|
Generation.prototype.deleteGenerationsTextureId = function (id, requestBody, config) {
|
|
242
242
|
var _a, _b;
|
|
243
243
|
return __awaiter(this, void 0, void 0, function () {
|
|
244
|
-
var req, baseURL,
|
|
244
|
+
var req, baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
|
|
245
245
|
var _d;
|
|
246
246
|
return __generator(this, function (_e) {
|
|
247
247
|
switch (_e.label) {
|
|
@@ -251,7 +251,7 @@ var Generation = /** @class */ (function () {
|
|
|
251
251
|
requestBody: requestBody,
|
|
252
252
|
});
|
|
253
253
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
254
|
-
|
|
254
|
+
operationUrl = utils.generateURL(baseURL, "/generations-texture/{id}", req);
|
|
255
255
|
_c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
|
|
256
256
|
try {
|
|
257
257
|
_d = __read(utils.serializeRequestBody(req, "requestBody", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
|
|
@@ -276,7 +276,7 @@ var Generation = /** @class */ (function () {
|
|
|
276
276
|
headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
277
277
|
headers["Accept"] = "application/json";
|
|
278
278
|
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
279
|
-
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url:
|
|
279
|
+
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "delete", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
|
|
280
280
|
case 3:
|
|
281
281
|
httpRes = _e.sent();
|
|
282
282
|
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 : "";
|
|
@@ -313,7 +313,7 @@ var Generation = /** @class */ (function () {
|
|
|
313
313
|
Generation.prototype.getGenerationById = function (id, config) {
|
|
314
314
|
var _a, _b;
|
|
315
315
|
return __awaiter(this, void 0, void 0, function () {
|
|
316
|
-
var req, baseURL,
|
|
316
|
+
var req, baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
|
|
317
317
|
return __generator(this, function (_c) {
|
|
318
318
|
switch (_c.label) {
|
|
319
319
|
case 0:
|
|
@@ -321,7 +321,7 @@ var Generation = /** @class */ (function () {
|
|
|
321
321
|
id: id,
|
|
322
322
|
});
|
|
323
323
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
324
|
-
|
|
324
|
+
operationUrl = utils.generateURL(baseURL, "/generations/{id}", req);
|
|
325
325
|
client = this.sdkConfiguration.defaultClient;
|
|
326
326
|
globalSecurity = this.sdkConfiguration.security;
|
|
327
327
|
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
@@ -337,7 +337,7 @@ var Generation = /** @class */ (function () {
|
|
|
337
337
|
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
338
338
|
headers["Accept"] = "application/json";
|
|
339
339
|
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
340
|
-
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url:
|
|
340
|
+
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
|
|
341
341
|
case 3:
|
|
342
342
|
httpRes = _c.sent();
|
|
343
343
|
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 : "";
|
|
@@ -374,7 +374,7 @@ var Generation = /** @class */ (function () {
|
|
|
374
374
|
Generation.prototype.getGenerationsByUserId = function (userId, limit, offset, config) {
|
|
375
375
|
var _a, _b;
|
|
376
376
|
return __awaiter(this, void 0, void 0, function () {
|
|
377
|
-
var req, baseURL,
|
|
377
|
+
var req, baseURL, operationUrl, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes;
|
|
378
378
|
return __generator(this, function (_c) {
|
|
379
379
|
switch (_c.label) {
|
|
380
380
|
case 0:
|
|
@@ -384,7 +384,7 @@ var Generation = /** @class */ (function () {
|
|
|
384
384
|
offset: offset,
|
|
385
385
|
});
|
|
386
386
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
387
|
-
|
|
387
|
+
operationUrl = utils.generateURL(baseURL, "/generations/user/{userId}", req);
|
|
388
388
|
client = this.sdkConfiguration.defaultClient;
|
|
389
389
|
globalSecurity = this.sdkConfiguration.security;
|
|
390
390
|
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
@@ -401,7 +401,7 @@ var Generation = /** @class */ (function () {
|
|
|
401
401
|
queryParams = utils.serializeQueryParams(req);
|
|
402
402
|
headers["Accept"] = "application/json";
|
|
403
403
|
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
404
|
-
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url:
|
|
404
|
+
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
|
|
405
405
|
case 3:
|
|
406
406
|
httpRes = _c.sent();
|
|
407
407
|
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 : "";
|
|
@@ -438,7 +438,7 @@ var Generation = /** @class */ (function () {
|
|
|
438
438
|
Generation.prototype.postGenerationsTexture = function (req, config) {
|
|
439
439
|
var _a, _b;
|
|
440
440
|
return __awaiter(this, void 0, void 0, function () {
|
|
441
|
-
var baseURL,
|
|
441
|
+
var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
|
|
442
442
|
var _d;
|
|
443
443
|
return __generator(this, function (_e) {
|
|
444
444
|
switch (_e.label) {
|
|
@@ -447,7 +447,7 @@ var Generation = /** @class */ (function () {
|
|
|
447
447
|
req = new operations.PostGenerationsTextureRequestBody(req);
|
|
448
448
|
}
|
|
449
449
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
450
|
-
|
|
450
|
+
operationUrl = baseURL.replace(/\/$/, "") + "/generations-texture";
|
|
451
451
|
_c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
|
|
452
452
|
try {
|
|
453
453
|
_d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
|
|
@@ -472,7 +472,7 @@ var Generation = /** @class */ (function () {
|
|
|
472
472
|
headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
473
473
|
headers["Accept"] = "application/json";
|
|
474
474
|
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
475
|
-
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url:
|
|
475
|
+
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
|
|
476
476
|
case 3:
|
|
477
477
|
httpRes = _e.sent();
|
|
478
478
|
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 : "";
|
package/dist/sdk/initimage.js
CHANGED
|
@@ -107,7 +107,7 @@ var InitImage = /** @class */ (function () {
|
|
|
107
107
|
InitImage.prototype.deleteInitImageById = function (id, config) {
|
|
108
108
|
var _a, _b;
|
|
109
109
|
return __awaiter(this, void 0, void 0, function () {
|
|
110
|
-
var req, baseURL,
|
|
110
|
+
var req, baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
|
|
111
111
|
return __generator(this, function (_c) {
|
|
112
112
|
switch (_c.label) {
|
|
113
113
|
case 0:
|
|
@@ -115,7 +115,7 @@ var InitImage = /** @class */ (function () {
|
|
|
115
115
|
id: id,
|
|
116
116
|
});
|
|
117
117
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
118
|
-
|
|
118
|
+
operationUrl = utils.generateURL(baseURL, "/init-image/{id}", req);
|
|
119
119
|
client = this.sdkConfiguration.defaultClient;
|
|
120
120
|
globalSecurity = this.sdkConfiguration.security;
|
|
121
121
|
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
@@ -131,7 +131,7 @@ var InitImage = /** @class */ (function () {
|
|
|
131
131
|
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
132
132
|
headers["Accept"] = "application/json";
|
|
133
133
|
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
134
|
-
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url:
|
|
134
|
+
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "delete", headers: headers, responseType: "arraybuffer" }, config))];
|
|
135
135
|
case 3:
|
|
136
136
|
httpRes = _c.sent();
|
|
137
137
|
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 : "";
|
|
@@ -168,7 +168,7 @@ var InitImage = /** @class */ (function () {
|
|
|
168
168
|
InitImage.prototype.getInitImageById = function (id, config) {
|
|
169
169
|
var _a, _b;
|
|
170
170
|
return __awaiter(this, void 0, void 0, function () {
|
|
171
|
-
var req, baseURL,
|
|
171
|
+
var req, baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
|
|
172
172
|
return __generator(this, function (_c) {
|
|
173
173
|
switch (_c.label) {
|
|
174
174
|
case 0:
|
|
@@ -176,7 +176,7 @@ var InitImage = /** @class */ (function () {
|
|
|
176
176
|
id: id,
|
|
177
177
|
});
|
|
178
178
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
179
|
-
|
|
179
|
+
operationUrl = utils.generateURL(baseURL, "/init-image/{id}", req);
|
|
180
180
|
client = this.sdkConfiguration.defaultClient;
|
|
181
181
|
globalSecurity = this.sdkConfiguration.security;
|
|
182
182
|
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
|
|
@@ -192,7 +192,7 @@ var InitImage = /** @class */ (function () {
|
|
|
192
192
|
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
|
|
193
193
|
headers["Accept"] = "application/json";
|
|
194
194
|
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
195
|
-
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url:
|
|
195
|
+
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
|
|
196
196
|
case 3:
|
|
197
197
|
httpRes = _c.sent();
|
|
198
198
|
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 : "";
|
|
@@ -229,7 +229,7 @@ var InitImage = /** @class */ (function () {
|
|
|
229
229
|
InitImage.prototype.uploadInitImage = function (req, config) {
|
|
230
230
|
var _a, _b;
|
|
231
231
|
return __awaiter(this, void 0, void 0, function () {
|
|
232
|
-
var baseURL,
|
|
232
|
+
var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
|
|
233
233
|
var _d;
|
|
234
234
|
return __generator(this, function (_e) {
|
|
235
235
|
switch (_e.label) {
|
|
@@ -238,7 +238,7 @@ var InitImage = /** @class */ (function () {
|
|
|
238
238
|
req = new operations.UploadInitImageRequestBody(req);
|
|
239
239
|
}
|
|
240
240
|
baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
|
|
241
|
-
|
|
241
|
+
operationUrl = baseURL.replace(/\/$/, "") + "/init-image";
|
|
242
242
|
_c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
|
|
243
243
|
try {
|
|
244
244
|
_d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
|
|
@@ -265,7 +265,7 @@ var InitImage = /** @class */ (function () {
|
|
|
265
265
|
throw new Error("request body is required");
|
|
266
266
|
headers["Accept"] = "application/json";
|
|
267
267
|
headers["user-agent"] = this.sdkConfiguration.userAgent;
|
|
268
|
-
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url:
|
|
268
|
+
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
|
|
269
269
|
case 3:
|
|
270
270
|
httpRes = _e.sent();
|
|
271
271
|
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 : "";
|