@leonardo-ai/sdk 2.1.0 → 2.1.2
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 +47 -22
- package/dist/internal/utils/queryparams.js +3 -1
- package/dist/internal/utils/security.js +11 -3
- package/dist/sdk/dataset.js +35 -35
- package/dist/sdk/element.js +7 -7
- package/dist/sdk/generation.js +42 -42
- package/dist/sdk/initimage.js +21 -21
- package/dist/sdk/model.js +42 -42
- package/dist/sdk/sdk.js +4 -4
- package/dist/sdk/user.js +7 -7
- package/dist/sdk/variation.js +28 -28
- package/docs/{models → sdk/models}/operations/createdatasetrequestbody.md +0 -0
- 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/{models → sdk/models}/operations/createvariationnobgrequestbody.md +0 -0
- package/docs/sdk/models/operations/createvariationnobgresponse.md +11 -0
- package/docs/sdk/models/operations/createvariationnobgresponsebody.md +10 -0
- package/docs/{models → sdk/models}/operations/createvariationupscalerequestbody.md +0 -0
- package/docs/sdk/models/operations/createvariationupscaleresponse.md +11 -0
- package/docs/sdk/models/operations/createvariationupscaleresponsebody.md +10 -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/sdk/models/operations/deletedatasetbyidresponse.md +11 -0
- package/docs/sdk/models/operations/deletedatasetbyidresponsebody.md +10 -0
- package/docs/{models → sdk/models}/operations/deletegenerationbyidrequest.md +0 -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/{models → sdk/models}/operations/deletegenerationstextureidrequestbody.md +0 -0
- package/docs/sdk/models/operations/deletegenerationstextureidresponse.md +11 -0
- package/docs/sdk/models/operations/deletegenerationstextureidresponsebody.md +10 -0
- package/docs/{models → sdk/models}/operations/deleteinitimagebyidrequest.md +0 -0
- package/docs/sdk/models/operations/deleteinitimagebyidresponse.md +11 -0
- package/docs/sdk/models/operations/deleteinitimagebyidresponsebody.md +10 -0
- package/docs/{models → sdk/models}/operations/deletemodelbyidrequest.md +0 -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/{models → sdk/models}/operations/deletemodels3didrequestbody.md +0 -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/{models → sdk/models}/operations/generations.md +0 -0
- package/docs/sdk/models/operations/getdatasetbyiddatasets.md +15 -0
- package/docs/{models → sdk/models}/operations/getdatasetbyidrequest.md +0 -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/{models → sdk/models}/operations/getgenerationbyidrequest.md +0 -0
- 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/{models → sdk/models}/operations/getgenerationsbyuseridrequest.md +0 -0
- package/docs/sdk/models/operations/getgenerationsbyuseridresponse.md +11 -0
- package/docs/sdk/models/operations/getgenerationsbyuseridresponsebody.md +10 -0
- package/docs/{models → sdk/models}/operations/getinitimagebyidinitimages.md +0 -0
- package/docs/{models → sdk/models}/operations/getinitimagebyidrequest.md +0 -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/{models → sdk/models}/operations/getmodelbyidrequest.md +0 -0
- 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/{models → sdk/models}/operations/getplatformmodelsgeneratedimages.md +0 -0
- package/docs/{models → sdk/models}/operations/getplatformmodelsrequest.md +0 -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/{models → sdk/models}/operations/getvariationbyidrequest.md +0 -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/initimages.md +0 -0
- package/docs/{models → sdk/models}/operations/initimageuploadoutput.md +0 -0
- package/docs/{models → sdk/models}/operations/loras.md +1 -1
- 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/sdk/models/operations/postgenerationstextureresponse.md +11 -0
- package/docs/sdk/models/operations/postgenerationstextureresponsebody.md +10 -0
- package/docs/{models → sdk/models}/operations/postmodels3duploadrequestbody.md +0 -0
- package/docs/sdk/models/operations/postmodels3duploadresponse.md +11 -0
- package/docs/sdk/models/operations/postmodels3duploadresponsebody.md +10 -0
- package/docs/{models → sdk/models}/operations/postvariationsunzoomrequestbody.md +0 -0
- package/docs/sdk/models/operations/postvariationsunzoomresponse.md +11 -0
- package/docs/sdk/models/operations/postvariationsunzoomresponsebody.md +10 -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/sdk/models/operations/uploaddatasetimagefromgenrequest.md +9 -0
- package/docs/{models → sdk/models}/operations/uploaddatasetimagefromgenrequestbody.md +0 -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/{models → sdk/models}/operations/uploaddatasetimagerequestbody.md +0 -0
- package/docs/sdk/models/operations/uploaddatasetimageresponse.md +11 -0
- package/docs/sdk/models/operations/uploaddatasetimageresponsebody.md +10 -0
- package/docs/{models → sdk/models}/operations/uploadinitimagerequestbody.md +0 -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/{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/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/leonardo/README.md +0 -0
- 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/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, responseContentType, 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,26 +143,26 @@ 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
|
+
responseContentType = (_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 : "";
|
|
150
150
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
151
151
|
throw new Error("status code not found in response: ".concat(httpRes));
|
|
152
152
|
}
|
|
153
153
|
res = new operations.CreateGenerationResponse({
|
|
154
154
|
statusCode: httpRes.status,
|
|
155
|
-
contentType:
|
|
155
|
+
contentType: responseContentType,
|
|
156
156
|
rawResponse: httpRes,
|
|
157
157
|
});
|
|
158
158
|
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
159
159
|
switch (true) {
|
|
160
160
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
161
|
-
if (utils.matchContentType(
|
|
161
|
+
if (utils.matchContentType(responseContentType, "application/json")) {
|
|
162
162
|
res.object = utils.objectToClass(JSON.parse(decodedRes), operations.CreateGenerationResponseBody);
|
|
163
163
|
}
|
|
164
164
|
else {
|
|
165
|
-
throw new errors.SDKError("unknown content-type received: " +
|
|
165
|
+
throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
|
|
166
166
|
}
|
|
167
167
|
break;
|
|
168
168
|
}
|
|
@@ -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, responseContentType, 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,26 +204,26 @@ 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
|
+
responseContentType = (_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 : "";
|
|
211
211
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
212
212
|
throw new Error("status code not found in response: ".concat(httpRes));
|
|
213
213
|
}
|
|
214
214
|
res = new operations.DeleteGenerationByIdResponse({
|
|
215
215
|
statusCode: httpRes.status,
|
|
216
|
-
contentType:
|
|
216
|
+
contentType: responseContentType,
|
|
217
217
|
rawResponse: httpRes,
|
|
218
218
|
});
|
|
219
219
|
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
220
220
|
switch (true) {
|
|
221
221
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
222
|
-
if (utils.matchContentType(
|
|
222
|
+
if (utils.matchContentType(responseContentType, "application/json")) {
|
|
223
223
|
res.object = utils.objectToClass(JSON.parse(decodedRes), operations.DeleteGenerationByIdResponseBody);
|
|
224
224
|
}
|
|
225
225
|
else {
|
|
226
|
-
throw new errors.SDKError("unknown content-type received: " +
|
|
226
|
+
throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
|
|
227
227
|
}
|
|
228
228
|
break;
|
|
229
229
|
}
|
|
@@ -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, responseContentType, 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,26 +276,26 @@ 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
|
+
responseContentType = (_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 : "";
|
|
283
283
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
284
284
|
throw new Error("status code not found in response: ".concat(httpRes));
|
|
285
285
|
}
|
|
286
286
|
res = new operations.DeleteGenerationsTextureIdResponse({
|
|
287
287
|
statusCode: httpRes.status,
|
|
288
|
-
contentType:
|
|
288
|
+
contentType: responseContentType,
|
|
289
289
|
rawResponse: httpRes,
|
|
290
290
|
});
|
|
291
291
|
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
292
292
|
switch (true) {
|
|
293
293
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
294
|
-
if (utils.matchContentType(
|
|
294
|
+
if (utils.matchContentType(responseContentType, "application/json")) {
|
|
295
295
|
res.object = utils.objectToClass(JSON.parse(decodedRes), operations.DeleteGenerationsTextureIdResponseBody);
|
|
296
296
|
}
|
|
297
297
|
else {
|
|
298
|
-
throw new errors.SDKError("unknown content-type received: " +
|
|
298
|
+
throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
|
|
299
299
|
}
|
|
300
300
|
break;
|
|
301
301
|
}
|
|
@@ -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, responseContentType, 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,26 +337,26 @@ 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
|
+
responseContentType = (_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 : "";
|
|
344
344
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
345
345
|
throw new Error("status code not found in response: ".concat(httpRes));
|
|
346
346
|
}
|
|
347
347
|
res = new operations.GetGenerationByIdResponse({
|
|
348
348
|
statusCode: httpRes.status,
|
|
349
|
-
contentType:
|
|
349
|
+
contentType: responseContentType,
|
|
350
350
|
rawResponse: httpRes,
|
|
351
351
|
});
|
|
352
352
|
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
353
353
|
switch (true) {
|
|
354
354
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
355
|
-
if (utils.matchContentType(
|
|
355
|
+
if (utils.matchContentType(responseContentType, "application/json")) {
|
|
356
356
|
res.object = utils.objectToClass(JSON.parse(decodedRes), operations.GetGenerationByIdResponseBody);
|
|
357
357
|
}
|
|
358
358
|
else {
|
|
359
|
-
throw new errors.SDKError("unknown content-type received: " +
|
|
359
|
+
throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
|
|
360
360
|
}
|
|
361
361
|
break;
|
|
362
362
|
}
|
|
@@ -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, responseContentType, 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,26 +401,26 @@ 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
|
+
responseContentType = (_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 : "";
|
|
408
408
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
409
409
|
throw new Error("status code not found in response: ".concat(httpRes));
|
|
410
410
|
}
|
|
411
411
|
res = new operations.GetGenerationsByUserIdResponse({
|
|
412
412
|
statusCode: httpRes.status,
|
|
413
|
-
contentType:
|
|
413
|
+
contentType: responseContentType,
|
|
414
414
|
rawResponse: httpRes,
|
|
415
415
|
});
|
|
416
416
|
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
417
417
|
switch (true) {
|
|
418
418
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
419
|
-
if (utils.matchContentType(
|
|
419
|
+
if (utils.matchContentType(responseContentType, "application/json")) {
|
|
420
420
|
res.object = utils.objectToClass(JSON.parse(decodedRes), operations.GetGenerationsByUserIdResponseBody);
|
|
421
421
|
}
|
|
422
422
|
else {
|
|
423
|
-
throw new errors.SDKError("unknown content-type received: " +
|
|
423
|
+
throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
|
|
424
424
|
}
|
|
425
425
|
break;
|
|
426
426
|
}
|
|
@@ -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, responseContentType, 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,26 +472,26 @@ 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
|
+
responseContentType = (_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 : "";
|
|
479
479
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
480
480
|
throw new Error("status code not found in response: ".concat(httpRes));
|
|
481
481
|
}
|
|
482
482
|
res = new operations.PostGenerationsTextureResponse({
|
|
483
483
|
statusCode: httpRes.status,
|
|
484
|
-
contentType:
|
|
484
|
+
contentType: responseContentType,
|
|
485
485
|
rawResponse: httpRes,
|
|
486
486
|
});
|
|
487
487
|
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
488
488
|
switch (true) {
|
|
489
489
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
490
|
-
if (utils.matchContentType(
|
|
490
|
+
if (utils.matchContentType(responseContentType, "application/json")) {
|
|
491
491
|
res.object = utils.objectToClass(JSON.parse(decodedRes), operations.PostGenerationsTextureResponseBody);
|
|
492
492
|
}
|
|
493
493
|
else {
|
|
494
|
-
throw new errors.SDKError("unknown content-type received: " +
|
|
494
|
+
throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
|
|
495
495
|
}
|
|
496
496
|
break;
|
|
497
497
|
}
|
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, responseContentType, 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,26 +131,26 @@ 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
|
+
responseContentType = (_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 : "";
|
|
138
138
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
139
139
|
throw new Error("status code not found in response: ".concat(httpRes));
|
|
140
140
|
}
|
|
141
141
|
res = new operations.DeleteInitImageByIdResponse({
|
|
142
142
|
statusCode: httpRes.status,
|
|
143
|
-
contentType:
|
|
143
|
+
contentType: responseContentType,
|
|
144
144
|
rawResponse: httpRes,
|
|
145
145
|
});
|
|
146
146
|
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
147
147
|
switch (true) {
|
|
148
148
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
149
|
-
if (utils.matchContentType(
|
|
149
|
+
if (utils.matchContentType(responseContentType, "application/json")) {
|
|
150
150
|
res.object = utils.objectToClass(JSON.parse(decodedRes), operations.DeleteInitImageByIdResponseBody);
|
|
151
151
|
}
|
|
152
152
|
else {
|
|
153
|
-
throw new errors.SDKError("unknown content-type received: " +
|
|
153
|
+
throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
|
|
154
154
|
}
|
|
155
155
|
break;
|
|
156
156
|
}
|
|
@@ -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, responseContentType, 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,26 +192,26 @@ 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
|
+
responseContentType = (_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 : "";
|
|
199
199
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
200
200
|
throw new Error("status code not found in response: ".concat(httpRes));
|
|
201
201
|
}
|
|
202
202
|
res = new operations.GetInitImageByIdResponse({
|
|
203
203
|
statusCode: httpRes.status,
|
|
204
|
-
contentType:
|
|
204
|
+
contentType: responseContentType,
|
|
205
205
|
rawResponse: httpRes,
|
|
206
206
|
});
|
|
207
207
|
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
208
208
|
switch (true) {
|
|
209
209
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
210
|
-
if (utils.matchContentType(
|
|
210
|
+
if (utils.matchContentType(responseContentType, "application/json")) {
|
|
211
211
|
res.object = utils.objectToClass(JSON.parse(decodedRes), operations.GetInitImageByIdResponseBody);
|
|
212
212
|
}
|
|
213
213
|
else {
|
|
214
|
-
throw new errors.SDKError("unknown content-type received: " +
|
|
214
|
+
throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
|
|
215
215
|
}
|
|
216
216
|
break;
|
|
217
217
|
}
|
|
@@ -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, responseContentType, 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,26 +265,26 @@ 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
|
+
responseContentType = (_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 : "";
|
|
272
272
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
273
273
|
throw new Error("status code not found in response: ".concat(httpRes));
|
|
274
274
|
}
|
|
275
275
|
res = new operations.UploadInitImageResponse({
|
|
276
276
|
statusCode: httpRes.status,
|
|
277
|
-
contentType:
|
|
277
|
+
contentType: responseContentType,
|
|
278
278
|
rawResponse: httpRes,
|
|
279
279
|
});
|
|
280
280
|
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
281
281
|
switch (true) {
|
|
282
282
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
283
|
-
if (utils.matchContentType(
|
|
283
|
+
if (utils.matchContentType(responseContentType, "application/json")) {
|
|
284
284
|
res.object = utils.objectToClass(JSON.parse(decodedRes), operations.UploadInitImageResponseBody);
|
|
285
285
|
}
|
|
286
286
|
else {
|
|
287
|
-
throw new errors.SDKError("unknown content-type received: " +
|
|
287
|
+
throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
|
|
288
288
|
}
|
|
289
289
|
break;
|
|
290
290
|
}
|