@leonardo-ai/sdk 1.39.1 → 1.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,22 @@
2
2
  /*
3
3
  * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
4
4
  */
5
+ var __read = (this && this.__read) || function (o, n) {
6
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
7
+ if (!m) return o;
8
+ var i = m.call(o), r, ar = [], e;
9
+ try {
10
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
11
+ }
12
+ catch (error) { e = { error: error }; }
13
+ finally {
14
+ try {
15
+ if (r && !r.done && (m = i["return"])) m.call(i);
16
+ }
17
+ finally { if (e) throw e.error; }
18
+ }
19
+ return ar;
20
+ };
5
21
  Object.defineProperty(exports, "__esModule", { value: true });
6
22
  exports.serializeQueryParams = exports.qpMetadataKey = void 0;
7
23
  var utils_1 = require("./utils");
@@ -61,7 +77,7 @@ exports.serializeQueryParams = serializeQueryParams;
61
77
  function jsonSerializer(params) {
62
78
  var query = [];
63
79
  Object.entries(Object.assign({}, params)).forEach(function (_a) {
64
- var key = _a[0], value = _a[1];
80
+ var _b = __read(_a, 2), key = _b[0], value = _b[1];
65
81
  query.push("".concat(key, "=").concat(encodeURIComponent(JSON.stringify(value))));
66
82
  });
67
83
  return query.join("&");
@@ -71,7 +87,7 @@ function noExplodeSerializer(params, delimiter) {
71
87
  if (delimiter === void 0) { delimiter = ","; }
72
88
  var query = [];
73
89
  Object.entries(Object.assign({}, params)).forEach(function (_a) {
74
- var key = _a[0], value = _a[1];
90
+ var _b = __read(_a, 2), key = _b[0], value = _b[1];
75
91
  if (!(0, utils_1.shouldQueryParamSerialize)(value))
76
92
  return;
77
93
  if (value !== Object(value))
@@ -99,7 +115,7 @@ function noExplodeSerializer(params, delimiter) {
99
115
  function formSerializerExplode(params) {
100
116
  var query = [];
101
117
  Object.entries(Object.assign({}, params)).forEach(function (_a) {
102
- var key = _a[0], value = _a[1];
118
+ var _b = __read(_a, 2), key = _b[0], value = _b[1];
103
119
  if (!(0, utils_1.shouldQueryParamSerialize)(value))
104
120
  return;
105
121
  if (value !== Object(value))
@@ -126,7 +142,7 @@ function formSerializerExplode(params) {
126
142
  function deepObjectSerializer(params) {
127
143
  var query = [];
128
144
  Object.entries(Object.assign({}, params)).forEach(function (_a) {
129
- var key = _a[0], value = _a[1];
145
+ var _b = __read(_a, 2), key = _b[0], value = _b[1];
130
146
  if (!(0, utils_1.shouldQueryParamSerialize)(value))
131
147
  return;
132
148
  if (value !== Object(value))
@@ -134,7 +150,7 @@ function deepObjectSerializer(params) {
134
150
  else if (Array.isArray(value)) {
135
151
  query.push(value
136
152
  .map(function (_a) {
137
- var objKey = _a[0], objValue = _a[1];
153
+ var _b = __read(_a, 2), objKey = _b[0], objValue = _b[1];
138
154
  return "".concat(key, "[").concat(objKey, "]=").concat(encodeURIComponent((0, utils_1.valToString)(objValue)));
139
155
  })
140
156
  .join("&"));
@@ -2,6 +2,22 @@
2
2
  /*
3
3
  * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
4
4
  */
5
+ var __read = (this && this.__read) || function (o, n) {
6
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
7
+ if (!m) return o;
8
+ var i = m.call(o), r, ar = [], e;
9
+ try {
10
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
11
+ }
12
+ catch (error) { e = { error: error }; }
13
+ finally {
14
+ try {
15
+ if (r && !r.done && (m = i["return"])) m.call(i);
16
+ }
17
+ finally { if (e) throw e.error; }
18
+ }
19
+ return ar;
20
+ };
5
21
  var __importDefault = (this && this.__importDefault) || function (mod) {
6
22
  return (mod && mod.__esModule) ? mod : { "default": mod };
7
23
  };
@@ -27,7 +43,7 @@ function serializeRequestBody(request, requestFieldName, serializationMethod) {
27
43
  exports.serializeRequestBody = serializeRequestBody;
28
44
  var serializeContentType = function (contentType, reqBody) {
29
45
  var _a, _b;
30
- var _c = [{}, {}], requestHeaders = _c[0], requestBody = _c[1];
46
+ var _c = __read([{}, {}], 2), requestHeaders = _c[0], requestBody = _c[1];
31
47
  switch (contentType) {
32
48
  case "multipart/form-data":
33
49
  requestBody = encodeMultipartFormData(reqBody);
@@ -37,17 +53,17 @@ var serializeContentType = function (contentType, reqBody) {
37
53
  requestHeaders = requestBody.getHeaders();
38
54
  break;
39
55
  case "application/x-www-form-urlencoded":
40
- _a = [
56
+ _a = __read([
41
57
  { "Content-Type": "".concat(contentType) },
42
58
  encodeFormUrlEncodeData(reqBody),
43
- ], requestHeaders = _a[0], requestBody = _a[1];
59
+ ], 2), requestHeaders = _a[0], requestBody = _a[1];
44
60
  break;
45
61
  case "application/json":
46
62
  case "text/json":
47
- _b = [
63
+ _b = __read([
48
64
  { "Content-Type": "".concat(contentType) },
49
65
  reqBody,
50
- ], requestHeaders = _b[0], requestBody = _b[1];
66
+ ], 2), requestHeaders = _b[0], requestBody = _b[1];
51
67
  break;
52
68
  default: {
53
69
  requestBody = reqBody;
@@ -168,7 +184,7 @@ var formNotExplode = function (fname, data) {
168
184
  function parseFormDecorator(formAnn) {
169
185
  var formDecorator = new FormDecorator("", "form", false, false);
170
186
  formAnn.split(";").forEach(function (formAnnPart) {
171
- var _a = formAnnPart.split("="), formKey = _a[0], formVal = _a[1];
187
+ var _a = __read(formAnnPart.split("="), 2), formKey = _a[0], formVal = _a[1];
172
188
  switch (formKey) {
173
189
  case "name":
174
190
  formDecorator.Name = formVal;
@@ -253,7 +269,7 @@ function parseMultipartFormDecorator(mpFormAnn) {
253
269
  // example "name=file"
254
270
  var mpFormDecorator = new MultipartFormDecorator(false, false, false, "");
255
271
  mpFormAnn.split(";").forEach(function (mpFormAnnPart) {
256
- var _a = mpFormAnnPart.split("="), mpFormKey = _a[0], mpFormVal = _a[1];
272
+ var _a = __read(mpFormAnnPart.split("="), 2), mpFormKey = _a[0], mpFormVal = _a[1];
257
273
  switch (mpFormKey) {
258
274
  case "file":
259
275
  mpFormDecorator.File = mpFormVal == "true";
@@ -283,7 +299,7 @@ var MultipartFormDecorator = /** @class */ (function () {
283
299
  function parseRequestDecorator(requestAnn) {
284
300
  // example "media_type=multipart/form-data"
285
301
  var requestDecorator = new RequestDecorator("application/octet-stream");
286
- var _a = requestAnn.split("="), mediaTypeKey = _a[0], mediaTypeVal = _a[1];
302
+ var _a = __read(requestAnn.split("="), 2), mediaTypeKey = _a[0], mediaTypeVal = _a[1];
287
303
  if (mediaTypeKey === "media_type")
288
304
  requestDecorator.MediaType = mediaTypeVal;
289
305
  return requestDecorator;
@@ -10,7 +10,7 @@ export declare class RetryConfig {
10
10
  strategy: string;
11
11
  backoff?: BackoffStrategy;
12
12
  retryConnectionErrors: boolean;
13
- constructor(strategy: string, retryConnectionErrors?: boolean);
13
+ constructor(strategy: string, backoff?: BackoffStrategy, retryConnectionErrors?: boolean);
14
14
  }
15
15
  export declare class Retries {
16
16
  config: RetryConfig;
@@ -53,6 +53,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
53
53
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
54
54
  }
55
55
  };
56
+ var __values = (this && this.__values) || function(o) {
57
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
58
+ if (m) return m.call(o);
59
+ if (o && typeof o.length === "number") return {
60
+ next: function () {
61
+ if (o && i >= o.length) o = void 0;
62
+ return { value: o && o[i++], done: !o };
63
+ }
64
+ };
65
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
66
+ };
56
67
  Object.defineProperty(exports, "__esModule", { value: true });
57
68
  exports.Retry = exports.Retries = exports.RetryConfig = exports.BackoffStrategy = void 0;
58
69
  var axios_1 = require("axios");
@@ -67,9 +78,10 @@ var BackoffStrategy = /** @class */ (function () {
67
78
  }());
68
79
  exports.BackoffStrategy = BackoffStrategy;
69
80
  var RetryConfig = /** @class */ (function () {
70
- function RetryConfig(strategy, retryConnectionErrors) {
81
+ function RetryConfig(strategy, backoff, retryConnectionErrors) {
71
82
  if (retryConnectionErrors === void 0) { retryConnectionErrors = true; }
72
83
  this.strategy = strategy;
84
+ this.backoff = backoff;
73
85
  this.retryConnectionErrors = retryConnectionErrors;
74
86
  }
75
87
  return RetryConfig;
@@ -88,6 +100,7 @@ var PermanentError = /** @class */ (function (_super) {
88
100
  function PermanentError(inner) {
89
101
  var _this = _super.call(this, "Permanent error") || this;
90
102
  _this.inner = inner;
103
+ Object.setPrototypeOf(_this, PermanentError.prototype);
91
104
  return _this;
92
105
  }
93
106
  return PermanentError;
@@ -97,6 +110,7 @@ var TemporaryError = /** @class */ (function (_super) {
97
110
  function TemporaryError(res) {
98
111
  var _this = _super.call(this, "Temporary error") || this;
99
112
  _this.res = res;
113
+ Object.setPrototypeOf(_this, TemporaryError.prototype);
100
114
  return _this;
101
115
  }
102
116
  return TemporaryError;
@@ -159,21 +173,31 @@ function Retry(fn, retries) {
159
173
  }
160
174
  exports.Retry = Retry;
161
175
  function isRetryableResponse(res, statusCodes) {
162
- for (var _i = 0, statusCodes_1 = statusCodes; _i < statusCodes_1.length; _i++) {
163
- var code = statusCodes_1[_i];
164
- if (code.toUpperCase().includes("X")) {
165
- var codeRange = parseInt(code[0]);
166
- if (isNaN(codeRange)) {
167
- throw new Error("Invalid status code range");
176
+ var e_1, _a;
177
+ try {
178
+ for (var statusCodes_1 = __values(statusCodes), statusCodes_1_1 = statusCodes_1.next(); !statusCodes_1_1.done; statusCodes_1_1 = statusCodes_1.next()) {
179
+ var code = statusCodes_1_1.value;
180
+ if (code.toUpperCase().includes("X")) {
181
+ var codeRange = parseInt(code[0]);
182
+ if (isNaN(codeRange)) {
183
+ throw new Error("Invalid status code range");
184
+ }
185
+ var s = res.status / 100;
186
+ if (s >= codeRange && s < codeRange + 1) {
187
+ return true;
188
+ }
168
189
  }
169
- var s = res.status / 100;
170
- if (s >= codeRange && s < codeRange + 1) {
190
+ else if (res.status == parseInt(code)) {
171
191
  return true;
172
192
  }
173
193
  }
174
- else if (res.status == parseInt(code)) {
175
- return true;
194
+ }
195
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
196
+ finally {
197
+ try {
198
+ if (statusCodes_1_1 && !statusCodes_1_1.done && (_a = statusCodes_1.return)) _a.call(statusCodes_1);
176
199
  }
200
+ finally { if (e_1) throw e_1.error; }
177
201
  }
178
202
  return false;
179
203
  }
@@ -2,6 +2,22 @@
2
2
  /*
3
3
  * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
4
4
  */
5
+ var __read = (this && this.__read) || function (o, n) {
6
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
7
+ if (!m) return o;
8
+ var i = m.call(o), r, ar = [], e;
9
+ try {
10
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
11
+ }
12
+ catch (error) { e = { error: error }; }
13
+ finally {
14
+ try {
15
+ if (r && !r.done && (m = i["return"])) m.call(i);
16
+ }
17
+ finally { if (e) throw e.error; }
18
+ }
19
+ return ar;
20
+ };
5
21
  Object.defineProperty(exports, "__esModule", { value: true });
6
22
  exports.createSecurityClient = void 0;
7
23
  var securityMetadataKey = "security";
@@ -17,7 +33,7 @@ function parseSecurityDecorator(securityAnn) {
17
33
  var securityType = "";
18
34
  var securitySubType = "";
19
35
  securityAnn.split(";").forEach(function (securityAnnPart) {
20
- var _a = securityAnnPart.split("="), sKey = _a[0], sVal = _a[1];
36
+ var _a = __read(securityAnnPart.split("="), 2), sKey = _a[0], sVal = _a[1];
21
37
  switch (sKey) {
22
38
  case "name":
23
39
  name = sVal;
@@ -2,6 +2,33 @@
2
2
  /*
3
3
  * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
4
4
  */
5
+ var __values = (this && this.__values) || function(o) {
6
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
7
+ if (m) return m.call(o);
8
+ if (o && typeof o.length === "number") return {
9
+ next: function () {
10
+ if (o && i >= o.length) o = void 0;
11
+ return { value: o && o[i++], done: !o };
12
+ }
13
+ };
14
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
15
+ };
16
+ var __read = (this && this.__read) || function (o, n) {
17
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
18
+ if (!m) return o;
19
+ var i = m.call(o), r, ar = [], e;
20
+ try {
21
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
22
+ }
23
+ catch (error) { e = { error: error }; }
24
+ finally {
25
+ try {
26
+ if (r && !r.done && (m = i["return"])) m.call(i);
27
+ }
28
+ finally { if (e) throw e.error; }
29
+ }
30
+ return ar;
31
+ };
5
32
  Object.defineProperty(exports, "__esModule", { value: true });
6
33
  exports.shouldQueryParamSerialize = exports.valToString = exports.populateFromGlobals = exports.getResFieldDepth = exports.objectToClass = exports.isEmpty = exports.isBooleanRecord = exports.isNumberRecord = exports.isStringRecord = exports.parseParamDecorator = exports.generateURL = exports.templateUrl = exports.SpeakeasyMetadata = exports.ParamDecorator = exports.SpeakeasyBase = exports.SerializationMethodToContentType = void 0;
7
34
  require("reflect-metadata");
@@ -69,36 +96,46 @@ function handleObject(value, elemType, elemDepth) {
69
96
  }
70
97
  var SpeakeasyBase = /** @class */ (function () {
71
98
  function SpeakeasyBase(payload) {
99
+ var e_1, _a;
72
100
  var props = this["__props__"];
73
101
  if (props) {
74
- for (var _i = 0, props_1 = props; _i < props_1.length; _i++) {
75
- var prop = props_1[_i];
76
- if (payload && payload.hasOwnProperty(prop.key)) {
77
- var value = payload[prop.key];
78
- if (isSpeakeasyBase(prop.type)) {
79
- this[prop.key] = new prop.type(value);
80
- }
81
- else if (prop.type.name == "Array" &&
82
- isSpeakeasyBase(prop.elemType)) {
83
- this[prop.key] = handleArray(value, prop.elemType, prop.elemDepth);
84
- }
85
- else if (prop.type.name == "Object" &&
86
- isSpeakeasyBase(prop.elemType)) {
87
- this[prop.key] = handleObject(value, prop.elemType, prop.elemDepth);
88
- }
89
- else if (prop.type.name == "RFCDate") {
90
- if (value instanceof Date) {
91
- this[prop.key] = new types_1.RFCDate(value);
102
+ try {
103
+ for (var props_1 = __values(props), props_1_1 = props_1.next(); !props_1_1.done; props_1_1 = props_1.next()) {
104
+ var prop = props_1_1.value;
105
+ if (payload && payload.hasOwnProperty(prop.key)) {
106
+ var value = payload[prop.key];
107
+ if (isSpeakeasyBase(prop.type)) {
108
+ this[prop.key] = new prop.type(value);
109
+ }
110
+ else if (prop.type.name == "Array" &&
111
+ isSpeakeasyBase(prop.elemType)) {
112
+ this[prop.key] = handleArray(value, prop.elemType, prop.elemDepth);
113
+ }
114
+ else if (prop.type.name == "Object" &&
115
+ isSpeakeasyBase(prop.elemType)) {
116
+ this[prop.key] = handleObject(value, prop.elemType, prop.elemDepth);
117
+ }
118
+ else if (prop.type.name == "RFCDate") {
119
+ if (value instanceof Date) {
120
+ this[prop.key] = new types_1.RFCDate(value);
121
+ }
122
+ else {
123
+ this[prop.key] = value;
124
+ }
92
125
  }
93
126
  else {
94
127
  this[prop.key] = value;
95
128
  }
96
129
  }
97
- else {
98
- this[prop.key] = value;
99
- }
100
130
  }
101
131
  }
132
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
133
+ finally {
134
+ try {
135
+ if (props_1_1 && !props_1_1.done && (_a = props_1.return)) _a.call(props_1);
136
+ }
137
+ finally { if (e_1) throw e_1.error; }
138
+ }
102
139
  }
103
140
  }
104
141
  return SpeakeasyBase;
@@ -145,7 +182,7 @@ function templateUrl(stringWithParams, params) {
145
182
  var res = stringWithParams;
146
183
  if (params) {
147
184
  Object.entries(params).forEach(function (_a) {
148
- var key = _a[0], value = _a[1];
185
+ var _b = __read(_a, 2), key = _b[0], value = _b[1];
149
186
  var match = "{" + key + "}";
150
187
  res = res.replaceAll(match, value);
151
188
  });
@@ -198,7 +235,7 @@ function parseParamDecorator(ann, fName, defaultStyle, defaultExplode) {
198
235
  if (ann == null)
199
236
  return decorator;
200
237
  ann.split(";").forEach(function (annPart) {
201
- var _a = annPart.split("="), paramKey = _a[0], paramVal = _a[1];
238
+ var _a = __read(annPart.split("="), 2), paramKey = _a[0], paramVal = _a[1];
202
239
  switch (paramKey) {
203
240
  case "style":
204
241
  decorator.Style = paramVal;
@@ -279,21 +316,31 @@ function objectToClass(value, klass, elemDepth) {
279
316
  }
280
317
  exports.objectToClass = objectToClass;
281
318
  function getResFieldDepth(res) {
319
+ var e_2, _a;
282
320
  var props = res["__props__"];
283
321
  var resFieldDepth = 1;
284
322
  if (props) {
285
- for (var _i = 0, props_2 = props; _i < props_2.length; _i++) {
286
- var prop = props_2[_i];
287
- if (res && res.hasOwnProperty(prop.key)) {
288
- if ((prop.type.name == "Array" || prop.type.name == "Object") &&
289
- isSpeakeasyBase(prop.elemType)) {
290
- if (prop.elemDepth > resFieldDepth) {
291
- resFieldDepth = prop.elemDepth;
292
- break;
323
+ try {
324
+ for (var props_2 = __values(props), props_2_1 = props_2.next(); !props_2_1.done; props_2_1 = props_2.next()) {
325
+ var prop = props_2_1.value;
326
+ if (res && res.hasOwnProperty(prop.key)) {
327
+ if ((prop.type.name == "Array" || prop.type.name == "Object") &&
328
+ isSpeakeasyBase(prop.elemType)) {
329
+ if (prop.elemDepth > resFieldDepth) {
330
+ resFieldDepth = prop.elemDepth;
331
+ break;
332
+ }
293
333
  }
294
334
  }
295
335
  }
296
336
  }
337
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
338
+ finally {
339
+ try {
340
+ if (props_2_1 && !props_2_1.done && (_a = props_2.return)) _a.call(props_2);
341
+ }
342
+ finally { if (e_2) throw e_2.error; }
343
+ }
297
344
  }
298
345
  return resFieldDepth;
299
346
  }
@@ -72,6 +72,22 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
72
72
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
73
73
  }
74
74
  };
75
+ var __read = (this && this.__read) || function (o, n) {
76
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
77
+ if (!m) return o;
78
+ var i = m.call(o), r, ar = [], e;
79
+ try {
80
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
81
+ }
82
+ catch (error) { e = { error: error }; }
83
+ finally {
84
+ try {
85
+ if (r && !r.done && (m = i["return"])) m.call(i);
86
+ }
87
+ finally { if (e) throw e.error; }
88
+ }
89
+ return ar;
90
+ };
75
91
  Object.defineProperty(exports, "__esModule", { value: true });
76
92
  exports.Dataset = void 0;
77
93
  var utils = __importStar(require("../internal/utils"));
@@ -89,7 +105,7 @@ var Dataset = /** @class */ (function () {
89
105
  Dataset.prototype.createDataset = function (req, config) {
90
106
  var _a, _b;
91
107
  return __awaiter(this, void 0, void 0, function () {
92
- var baseURL, url, _c, reqBodyHeaders, reqBody, client, headers, httpRes, contentType, res;
108
+ var baseURL, url, _c, reqBodyHeaders, reqBody, client, headers, httpRes, contentType, res, decodedRes;
93
109
  var _d;
94
110
  return __generator(this, function (_e) {
95
111
  switch (_e.label) {
@@ -99,9 +115,9 @@ var Dataset = /** @class */ (function () {
99
115
  }
100
116
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
101
117
  url = baseURL.replace(/\/$/, "") + "/datasets";
102
- _c = [{}, {}], reqBodyHeaders = _c[0], reqBody = _c[1];
118
+ _c = __read([{}, {}], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
103
119
  try {
104
- _d = utils.serializeRequestBody(req, "request", "json"), reqBodyHeaders = _d[0], reqBody = _d[1];
120
+ _d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
105
121
  }
106
122
  catch (e) {
107
123
  if (e instanceof Error) {
@@ -114,7 +130,7 @@ var Dataset = /** @class */ (function () {
114
130
  throw new Error("request body is required");
115
131
  headers["Accept"] = "application/json";
116
132
  headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
117
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, data: reqBody }, config))];
133
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
118
134
  case 1:
119
135
  httpRes = _e.sent();
120
136
  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 : "";
@@ -126,10 +142,11 @@ var Dataset = /** @class */ (function () {
126
142
  contentType: contentType,
127
143
  rawResponse: httpRes,
128
144
  });
145
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
129
146
  switch (true) {
130
147
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
131
148
  if (utils.matchContentType(contentType, "application/json")) {
132
- res.createDataset200ApplicationJSONObject = utils.objectToClass(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.CreateDataset200ApplicationJSON);
149
+ res.createDataset200ApplicationJSONObject = utils.objectToClass(JSON.parse(decodedRes), operations.CreateDataset200ApplicationJSON);
133
150
  }
134
151
  break;
135
152
  }
@@ -147,7 +164,7 @@ var Dataset = /** @class */ (function () {
147
164
  Dataset.prototype.deleteDatasetById = function (id, config) {
148
165
  var _a, _b;
149
166
  return __awaiter(this, void 0, void 0, function () {
150
- var req, baseURL, url, client, headers, httpRes, contentType, res;
167
+ var req, baseURL, url, client, headers, httpRes, contentType, res, decodedRes;
151
168
  return __generator(this, function (_c) {
152
169
  switch (_c.label) {
153
170
  case 0:
@@ -160,7 +177,7 @@ var Dataset = /** @class */ (function () {
160
177
  headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers);
161
178
  headers["Accept"] = "application/json";
162
179
  headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
163
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "delete", headers: headers }, config))];
180
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "delete", headers: headers, responseType: "arraybuffer" }, config))];
164
181
  case 1:
165
182
  httpRes = _c.sent();
166
183
  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 : "";
@@ -172,10 +189,11 @@ var Dataset = /** @class */ (function () {
172
189
  contentType: contentType,
173
190
  rawResponse: httpRes,
174
191
  });
192
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
175
193
  switch (true) {
176
194
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
177
195
  if (utils.matchContentType(contentType, "application/json")) {
178
- res.deleteDatasetById200ApplicationJSONObject = utils.objectToClass(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.DeleteDatasetById200ApplicationJSON);
196
+ res.deleteDatasetById200ApplicationJSONObject = utils.objectToClass(JSON.parse(decodedRes), operations.DeleteDatasetById200ApplicationJSON);
179
197
  }
180
198
  break;
181
199
  }
@@ -193,7 +211,7 @@ var Dataset = /** @class */ (function () {
193
211
  Dataset.prototype.getDatasetById = function (id, config) {
194
212
  var _a, _b;
195
213
  return __awaiter(this, void 0, void 0, function () {
196
- var req, baseURL, url, client, headers, httpRes, contentType, res;
214
+ var req, baseURL, url, client, headers, httpRes, contentType, res, decodedRes;
197
215
  return __generator(this, function (_c) {
198
216
  switch (_c.label) {
199
217
  case 0:
@@ -206,7 +224,7 @@ var Dataset = /** @class */ (function () {
206
224
  headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers);
207
225
  headers["Accept"] = "application/json";
208
226
  headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
209
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers }, config))];
227
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
210
228
  case 1:
211
229
  httpRes = _c.sent();
212
230
  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 : "";
@@ -218,10 +236,11 @@ var Dataset = /** @class */ (function () {
218
236
  contentType: contentType,
219
237
  rawResponse: httpRes,
220
238
  });
239
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
221
240
  switch (true) {
222
241
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
223
242
  if (utils.matchContentType(contentType, "application/json")) {
224
- res.getDatasetById200ApplicationJSONObject = utils.objectToClass(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.GetDatasetById200ApplicationJSON);
243
+ res.getDatasetById200ApplicationJSONObject = utils.objectToClass(JSON.parse(decodedRes), operations.GetDatasetById200ApplicationJSON);
225
244
  }
226
245
  break;
227
246
  }
@@ -239,7 +258,7 @@ var Dataset = /** @class */ (function () {
239
258
  Dataset.prototype.uploadDatasetImage = function (requestBody, datasetId, config) {
240
259
  var _a, _b;
241
260
  return __awaiter(this, void 0, void 0, function () {
242
- var req, baseURL, url, _c, reqBodyHeaders, reqBody, client, headers, httpRes, contentType, res;
261
+ var req, baseURL, url, _c, reqBodyHeaders, reqBody, client, headers, httpRes, contentType, res, decodedRes;
243
262
  var _d;
244
263
  return __generator(this, function (_e) {
245
264
  switch (_e.label) {
@@ -250,9 +269,9 @@ var Dataset = /** @class */ (function () {
250
269
  });
251
270
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
252
271
  url = utils.generateURL(baseURL, "/datasets/{datasetId}/upload", req);
253
- _c = [{}, {}], reqBodyHeaders = _c[0], reqBody = _c[1];
272
+ _c = __read([{}, {}], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
254
273
  try {
255
- _d = utils.serializeRequestBody(req, "requestBody", "json"), reqBodyHeaders = _d[0], reqBody = _d[1];
274
+ _d = __read(utils.serializeRequestBody(req, "requestBody", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
256
275
  }
257
276
  catch (e) {
258
277
  if (e instanceof Error) {
@@ -265,7 +284,7 @@ var Dataset = /** @class */ (function () {
265
284
  throw new Error("request body is required");
266
285
  headers["Accept"] = "application/json";
267
286
  headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
268
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, data: reqBody }, config))];
287
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
269
288
  case 1:
270
289
  httpRes = _e.sent();
271
290
  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 : "";
@@ -277,10 +296,11 @@ var Dataset = /** @class */ (function () {
277
296
  contentType: contentType,
278
297
  rawResponse: httpRes,
279
298
  });
299
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
280
300
  switch (true) {
281
301
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
282
302
  if (utils.matchContentType(contentType, "application/json")) {
283
- res.uploadDatasetImage200ApplicationJSONObject = utils.objectToClass(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.UploadDatasetImage200ApplicationJSON);
303
+ res.uploadDatasetImage200ApplicationJSONObject = utils.objectToClass(JSON.parse(decodedRes), operations.UploadDatasetImage200ApplicationJSON);
284
304
  }
285
305
  break;
286
306
  }
@@ -298,7 +318,7 @@ var Dataset = /** @class */ (function () {
298
318
  Dataset.prototype.uploadDatasetImageFromGen = function (requestBody, datasetId, config) {
299
319
  var _a, _b;
300
320
  return __awaiter(this, void 0, void 0, function () {
301
- var req, baseURL, url, _c, reqBodyHeaders, reqBody, client, headers, httpRes, contentType, res;
321
+ var req, baseURL, url, _c, reqBodyHeaders, reqBody, client, headers, httpRes, contentType, res, decodedRes;
302
322
  var _d;
303
323
  return __generator(this, function (_e) {
304
324
  switch (_e.label) {
@@ -309,9 +329,9 @@ var Dataset = /** @class */ (function () {
309
329
  });
310
330
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
311
331
  url = utils.generateURL(baseURL, "/datasets/{datasetId}/upload/gen", req);
312
- _c = [{}, {}], reqBodyHeaders = _c[0], reqBody = _c[1];
332
+ _c = __read([{}, {}], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
313
333
  try {
314
- _d = utils.serializeRequestBody(req, "requestBody", "json"), reqBodyHeaders = _d[0], reqBody = _d[1];
334
+ _d = __read(utils.serializeRequestBody(req, "requestBody", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
315
335
  }
316
336
  catch (e) {
317
337
  if (e instanceof Error) {
@@ -324,7 +344,7 @@ var Dataset = /** @class */ (function () {
324
344
  throw new Error("request body is required");
325
345
  headers["Accept"] = "application/json";
326
346
  headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
327
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, data: reqBody }, config))];
347
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
328
348
  case 1:
329
349
  httpRes = _e.sent();
330
350
  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 : "";
@@ -336,10 +356,11 @@ var Dataset = /** @class */ (function () {
336
356
  contentType: contentType,
337
357
  rawResponse: httpRes,
338
358
  });
359
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
339
360
  switch (true) {
340
361
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
341
362
  if (utils.matchContentType(contentType, "application/json")) {
342
- res.uploadDatasetImageFromGen200ApplicationJSONObject = utils.objectToClass(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.UploadDatasetImageFromGen200ApplicationJSON);
363
+ res.uploadDatasetImageFromGen200ApplicationJSONObject = utils.objectToClass(JSON.parse(decodedRes), operations.UploadDatasetImageFromGen200ApplicationJSON);
343
364
  }
344
365
  break;
345
366
  }
@@ -72,6 +72,22 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
72
72
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
73
73
  }
74
74
  };
75
+ var __read = (this && this.__read) || function (o, n) {
76
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
77
+ if (!m) return o;
78
+ var i = m.call(o), r, ar = [], e;
79
+ try {
80
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
81
+ }
82
+ catch (error) { e = { error: error }; }
83
+ finally {
84
+ try {
85
+ if (r && !r.done && (m = i["return"])) m.call(i);
86
+ }
87
+ finally { if (e) throw e.error; }
88
+ }
89
+ return ar;
90
+ };
75
91
  Object.defineProperty(exports, "__esModule", { value: true });
76
92
  exports.Generation = void 0;
77
93
  var utils = __importStar(require("../internal/utils"));
@@ -89,7 +105,7 @@ var Generation = /** @class */ (function () {
89
105
  Generation.prototype.createGeneration = function (req, config) {
90
106
  var _a, _b;
91
107
  return __awaiter(this, void 0, void 0, function () {
92
- var baseURL, url, _c, reqBodyHeaders, reqBody, client, headers, httpRes, contentType, res;
108
+ var baseURL, url, _c, reqBodyHeaders, reqBody, client, headers, httpRes, contentType, res, decodedRes;
93
109
  var _d;
94
110
  return __generator(this, function (_e) {
95
111
  switch (_e.label) {
@@ -99,9 +115,9 @@ var Generation = /** @class */ (function () {
99
115
  }
100
116
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
101
117
  url = baseURL.replace(/\/$/, "") + "/generations";
102
- _c = [{}, {}], reqBodyHeaders = _c[0], reqBody = _c[1];
118
+ _c = __read([{}, {}], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
103
119
  try {
104
- _d = utils.serializeRequestBody(req, "request", "json"), reqBodyHeaders = _d[0], reqBody = _d[1];
120
+ _d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
105
121
  }
106
122
  catch (e) {
107
123
  if (e instanceof Error) {
@@ -114,7 +130,7 @@ var Generation = /** @class */ (function () {
114
130
  throw new Error("request body is required");
115
131
  headers["Accept"] = "application/json";
116
132
  headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
117
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, data: reqBody }, config))];
133
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
118
134
  case 1:
119
135
  httpRes = _e.sent();
120
136
  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 : "";
@@ -126,10 +142,11 @@ var Generation = /** @class */ (function () {
126
142
  contentType: contentType,
127
143
  rawResponse: httpRes,
128
144
  });
145
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
129
146
  switch (true) {
130
147
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
131
148
  if (utils.matchContentType(contentType, "application/json")) {
132
- res.createGeneration200ApplicationJSONObject = utils.objectToClass(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.CreateGeneration200ApplicationJSON);
149
+ res.createGeneration200ApplicationJSONObject = utils.objectToClass(JSON.parse(decodedRes), operations.CreateGeneration200ApplicationJSON);
133
150
  }
134
151
  break;
135
152
  }
@@ -147,7 +164,7 @@ var Generation = /** @class */ (function () {
147
164
  Generation.prototype.deleteGenerationById = function (id, config) {
148
165
  var _a, _b;
149
166
  return __awaiter(this, void 0, void 0, function () {
150
- var req, baseURL, url, client, headers, httpRes, contentType, res;
167
+ var req, baseURL, url, client, headers, httpRes, contentType, res, decodedRes;
151
168
  return __generator(this, function (_c) {
152
169
  switch (_c.label) {
153
170
  case 0:
@@ -160,7 +177,7 @@ var Generation = /** @class */ (function () {
160
177
  headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers);
161
178
  headers["Accept"] = "application/json";
162
179
  headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
163
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "delete", headers: headers }, config))];
180
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "delete", headers: headers, responseType: "arraybuffer" }, config))];
164
181
  case 1:
165
182
  httpRes = _c.sent();
166
183
  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 : "";
@@ -172,10 +189,11 @@ var Generation = /** @class */ (function () {
172
189
  contentType: contentType,
173
190
  rawResponse: httpRes,
174
191
  });
192
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
175
193
  switch (true) {
176
194
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
177
195
  if (utils.matchContentType(contentType, "application/json")) {
178
- res.deleteGenerationById200ApplicationJSONObject = utils.objectToClass(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.DeleteGenerationById200ApplicationJSON);
196
+ res.deleteGenerationById200ApplicationJSONObject = utils.objectToClass(JSON.parse(decodedRes), operations.DeleteGenerationById200ApplicationJSON);
179
197
  }
180
198
  break;
181
199
  }
@@ -193,7 +211,7 @@ var Generation = /** @class */ (function () {
193
211
  Generation.prototype.getGenerationById = function (id, config) {
194
212
  var _a, _b;
195
213
  return __awaiter(this, void 0, void 0, function () {
196
- var req, baseURL, url, client, headers, httpRes, contentType, res;
214
+ var req, baseURL, url, client, headers, httpRes, contentType, res, decodedRes;
197
215
  return __generator(this, function (_c) {
198
216
  switch (_c.label) {
199
217
  case 0:
@@ -206,7 +224,7 @@ var Generation = /** @class */ (function () {
206
224
  headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers);
207
225
  headers["Accept"] = "application/json";
208
226
  headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
209
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers }, config))];
227
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
210
228
  case 1:
211
229
  httpRes = _c.sent();
212
230
  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 : "";
@@ -218,10 +236,11 @@ var Generation = /** @class */ (function () {
218
236
  contentType: contentType,
219
237
  rawResponse: httpRes,
220
238
  });
239
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
221
240
  switch (true) {
222
241
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
223
242
  if (utils.matchContentType(contentType, "application/json")) {
224
- res.getGenerationById200ApplicationJSONObject = utils.objectToClass(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.GetGenerationById200ApplicationJSON);
243
+ res.getGenerationById200ApplicationJSONObject = utils.objectToClass(JSON.parse(decodedRes), operations.GetGenerationById200ApplicationJSON);
225
244
  }
226
245
  break;
227
246
  }
@@ -239,7 +258,7 @@ var Generation = /** @class */ (function () {
239
258
  Generation.prototype.getGenerationsByUserId = function (userId, limit, offset, config) {
240
259
  var _a, _b;
241
260
  return __awaiter(this, void 0, void 0, function () {
242
- var req, baseURL, url, client, headers, queryParams, httpRes, contentType, res;
261
+ var req, baseURL, url, client, headers, queryParams, httpRes, contentType, res, decodedRes;
243
262
  return __generator(this, function (_c) {
244
263
  switch (_c.label) {
245
264
  case 0:
@@ -255,7 +274,7 @@ var Generation = /** @class */ (function () {
255
274
  queryParams = utils.serializeQueryParams(req);
256
275
  headers["Accept"] = "application/json";
257
276
  headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
258
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers }, config))];
277
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
259
278
  case 1:
260
279
  httpRes = _c.sent();
261
280
  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 : "";
@@ -267,10 +286,11 @@ var Generation = /** @class */ (function () {
267
286
  contentType: contentType,
268
287
  rawResponse: httpRes,
269
288
  });
289
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
270
290
  switch (true) {
271
291
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
272
292
  if (utils.matchContentType(contentType, "application/json")) {
273
- res.getGenerationsByUserId200ApplicationJSONObject = utils.objectToClass(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.GetGenerationsByUserId200ApplicationJSON);
293
+ res.getGenerationsByUserId200ApplicationJSONObject = utils.objectToClass(JSON.parse(decodedRes), operations.GetGenerationsByUserId200ApplicationJSON);
274
294
  }
275
295
  break;
276
296
  }
@@ -72,6 +72,22 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
72
72
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
73
73
  }
74
74
  };
75
+ var __read = (this && this.__read) || function (o, n) {
76
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
77
+ if (!m) return o;
78
+ var i = m.call(o), r, ar = [], e;
79
+ try {
80
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
81
+ }
82
+ catch (error) { e = { error: error }; }
83
+ finally {
84
+ try {
85
+ if (r && !r.done && (m = i["return"])) m.call(i);
86
+ }
87
+ finally { if (e) throw e.error; }
88
+ }
89
+ return ar;
90
+ };
75
91
  Object.defineProperty(exports, "__esModule", { value: true });
76
92
  exports.InitImage = void 0;
77
93
  var utils = __importStar(require("../internal/utils"));
@@ -89,7 +105,7 @@ var InitImage = /** @class */ (function () {
89
105
  InitImage.prototype.deleteInitImageById = function (id, config) {
90
106
  var _a, _b;
91
107
  return __awaiter(this, void 0, void 0, function () {
92
- var req, baseURL, url, client, headers, httpRes, contentType, res;
108
+ var req, baseURL, url, client, headers, httpRes, contentType, res, decodedRes;
93
109
  return __generator(this, function (_c) {
94
110
  switch (_c.label) {
95
111
  case 0:
@@ -102,7 +118,7 @@ var InitImage = /** @class */ (function () {
102
118
  headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers);
103
119
  headers["Accept"] = "application/json";
104
120
  headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
105
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "delete", headers: headers }, config))];
121
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "delete", headers: headers, responseType: "arraybuffer" }, config))];
106
122
  case 1:
107
123
  httpRes = _c.sent();
108
124
  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 : "";
@@ -114,10 +130,11 @@ var InitImage = /** @class */ (function () {
114
130
  contentType: contentType,
115
131
  rawResponse: httpRes,
116
132
  });
133
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
117
134
  switch (true) {
118
135
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
119
136
  if (utils.matchContentType(contentType, "application/json")) {
120
- res.deleteInitImageById200ApplicationJSONObject = utils.objectToClass(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.DeleteInitImageById200ApplicationJSON);
137
+ res.deleteInitImageById200ApplicationJSONObject = utils.objectToClass(JSON.parse(decodedRes), operations.DeleteInitImageById200ApplicationJSON);
121
138
  }
122
139
  break;
123
140
  }
@@ -135,7 +152,7 @@ var InitImage = /** @class */ (function () {
135
152
  InitImage.prototype.getInitImageById = function (id, config) {
136
153
  var _a, _b;
137
154
  return __awaiter(this, void 0, void 0, function () {
138
- var req, baseURL, url, client, headers, httpRes, contentType, res;
155
+ var req, baseURL, url, client, headers, httpRes, contentType, res, decodedRes;
139
156
  return __generator(this, function (_c) {
140
157
  switch (_c.label) {
141
158
  case 0:
@@ -148,7 +165,7 @@ var InitImage = /** @class */ (function () {
148
165
  headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers);
149
166
  headers["Accept"] = "application/json";
150
167
  headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
151
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers }, config))];
168
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
152
169
  case 1:
153
170
  httpRes = _c.sent();
154
171
  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 : "";
@@ -160,10 +177,11 @@ var InitImage = /** @class */ (function () {
160
177
  contentType: contentType,
161
178
  rawResponse: httpRes,
162
179
  });
180
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
163
181
  switch (true) {
164
182
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
165
183
  if (utils.matchContentType(contentType, "application/json")) {
166
- res.getInitImageById200ApplicationJSONObject = utils.objectToClass(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.GetInitImageById200ApplicationJSON);
184
+ res.getInitImageById200ApplicationJSONObject = utils.objectToClass(JSON.parse(decodedRes), operations.GetInitImageById200ApplicationJSON);
167
185
  }
168
186
  break;
169
187
  }
@@ -181,7 +199,7 @@ var InitImage = /** @class */ (function () {
181
199
  InitImage.prototype.uploadInitImage = function (req, config) {
182
200
  var _a, _b;
183
201
  return __awaiter(this, void 0, void 0, function () {
184
- var baseURL, url, _c, reqBodyHeaders, reqBody, client, headers, httpRes, contentType, res;
202
+ var baseURL, url, _c, reqBodyHeaders, reqBody, client, headers, httpRes, contentType, res, decodedRes;
185
203
  var _d;
186
204
  return __generator(this, function (_e) {
187
205
  switch (_e.label) {
@@ -191,9 +209,9 @@ var InitImage = /** @class */ (function () {
191
209
  }
192
210
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
193
211
  url = baseURL.replace(/\/$/, "") + "/init-image";
194
- _c = [{}, {}], reqBodyHeaders = _c[0], reqBody = _c[1];
212
+ _c = __read([{}, {}], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
195
213
  try {
196
- _d = utils.serializeRequestBody(req, "request", "json"), reqBodyHeaders = _d[0], reqBody = _d[1];
214
+ _d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
197
215
  }
198
216
  catch (e) {
199
217
  if (e instanceof Error) {
@@ -206,7 +224,7 @@ var InitImage = /** @class */ (function () {
206
224
  throw new Error("request body is required");
207
225
  headers["Accept"] = "application/json";
208
226
  headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
209
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, data: reqBody }, config))];
227
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
210
228
  case 1:
211
229
  httpRes = _e.sent();
212
230
  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 : "";
@@ -218,10 +236,11 @@ var InitImage = /** @class */ (function () {
218
236
  contentType: contentType,
219
237
  rawResponse: httpRes,
220
238
  });
239
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
221
240
  switch (true) {
222
241
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
223
242
  if (utils.matchContentType(contentType, "application/json")) {
224
- res.uploadInitImage200ApplicationJSONObject = utils.objectToClass(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.UploadInitImage200ApplicationJSON);
243
+ res.uploadInitImage200ApplicationJSONObject = utils.objectToClass(JSON.parse(decodedRes), operations.UploadInitImage200ApplicationJSON);
225
244
  }
226
245
  break;
227
246
  }
package/dist/sdk/model.js CHANGED
@@ -72,6 +72,22 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
72
72
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
73
73
  }
74
74
  };
75
+ var __read = (this && this.__read) || function (o, n) {
76
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
77
+ if (!m) return o;
78
+ var i = m.call(o), r, ar = [], e;
79
+ try {
80
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
81
+ }
82
+ catch (error) { e = { error: error }; }
83
+ finally {
84
+ try {
85
+ if (r && !r.done && (m = i["return"])) m.call(i);
86
+ }
87
+ finally { if (e) throw e.error; }
88
+ }
89
+ return ar;
90
+ };
75
91
  Object.defineProperty(exports, "__esModule", { value: true });
76
92
  exports.Model = void 0;
77
93
  var utils = __importStar(require("../internal/utils"));
@@ -89,7 +105,7 @@ var Model = /** @class */ (function () {
89
105
  Model.prototype.createModel = function (req, config) {
90
106
  var _a, _b;
91
107
  return __awaiter(this, void 0, void 0, function () {
92
- var baseURL, url, _c, reqBodyHeaders, reqBody, client, headers, httpRes, contentType, res;
108
+ var baseURL, url, _c, reqBodyHeaders, reqBody, client, headers, httpRes, contentType, res, decodedRes;
93
109
  var _d;
94
110
  return __generator(this, function (_e) {
95
111
  switch (_e.label) {
@@ -99,9 +115,9 @@ var Model = /** @class */ (function () {
99
115
  }
100
116
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
101
117
  url = baseURL.replace(/\/$/, "") + "/models";
102
- _c = [{}, {}], reqBodyHeaders = _c[0], reqBody = _c[1];
118
+ _c = __read([{}, {}], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
103
119
  try {
104
- _d = utils.serializeRequestBody(req, "request", "json"), reqBodyHeaders = _d[0], reqBody = _d[1];
120
+ _d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
105
121
  }
106
122
  catch (e) {
107
123
  if (e instanceof Error) {
@@ -114,7 +130,7 @@ var Model = /** @class */ (function () {
114
130
  throw new Error("request body is required");
115
131
  headers["Accept"] = "application/json";
116
132
  headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
117
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, data: reqBody }, config))];
133
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
118
134
  case 1:
119
135
  httpRes = _e.sent();
120
136
  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 : "";
@@ -126,10 +142,11 @@ var Model = /** @class */ (function () {
126
142
  contentType: contentType,
127
143
  rawResponse: httpRes,
128
144
  });
145
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
129
146
  switch (true) {
130
147
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
131
148
  if (utils.matchContentType(contentType, "application/json")) {
132
- res.createModel200ApplicationJSONObject = utils.objectToClass(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.CreateModel200ApplicationJSON);
149
+ res.createModel200ApplicationJSONObject = utils.objectToClass(JSON.parse(decodedRes), operations.CreateModel200ApplicationJSON);
133
150
  }
134
151
  break;
135
152
  }
@@ -147,7 +164,7 @@ var Model = /** @class */ (function () {
147
164
  Model.prototype.deleteModelById = function (id, config) {
148
165
  var _a, _b;
149
166
  return __awaiter(this, void 0, void 0, function () {
150
- var req, baseURL, url, client, headers, httpRes, contentType, res;
167
+ var req, baseURL, url, client, headers, httpRes, contentType, res, decodedRes;
151
168
  return __generator(this, function (_c) {
152
169
  switch (_c.label) {
153
170
  case 0:
@@ -160,7 +177,7 @@ var Model = /** @class */ (function () {
160
177
  headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers);
161
178
  headers["Accept"] = "application/json";
162
179
  headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
163
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "delete", headers: headers }, config))];
180
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "delete", headers: headers, responseType: "arraybuffer" }, config))];
164
181
  case 1:
165
182
  httpRes = _c.sent();
166
183
  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 : "";
@@ -172,10 +189,11 @@ var Model = /** @class */ (function () {
172
189
  contentType: contentType,
173
190
  rawResponse: httpRes,
174
191
  });
192
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
175
193
  switch (true) {
176
194
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
177
195
  if (utils.matchContentType(contentType, "application/json")) {
178
- res.deleteModelById200ApplicationJSONObject = utils.objectToClass(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.DeleteModelById200ApplicationJSON);
196
+ res.deleteModelById200ApplicationJSONObject = utils.objectToClass(JSON.parse(decodedRes), operations.DeleteModelById200ApplicationJSON);
179
197
  }
180
198
  break;
181
199
  }
@@ -193,7 +211,7 @@ var Model = /** @class */ (function () {
193
211
  Model.prototype.getModelById = function (id, config) {
194
212
  var _a, _b;
195
213
  return __awaiter(this, void 0, void 0, function () {
196
- var req, baseURL, url, client, headers, httpRes, contentType, res;
214
+ var req, baseURL, url, client, headers, httpRes, contentType, res, decodedRes;
197
215
  return __generator(this, function (_c) {
198
216
  switch (_c.label) {
199
217
  case 0:
@@ -206,7 +224,7 @@ var Model = /** @class */ (function () {
206
224
  headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers);
207
225
  headers["Accept"] = "application/json";
208
226
  headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
209
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers }, config))];
227
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
210
228
  case 1:
211
229
  httpRes = _c.sent();
212
230
  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 : "";
@@ -218,10 +236,11 @@ var Model = /** @class */ (function () {
218
236
  contentType: contentType,
219
237
  rawResponse: httpRes,
220
238
  });
239
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
221
240
  switch (true) {
222
241
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
223
242
  if (utils.matchContentType(contentType, "application/json")) {
224
- res.getModelById200ApplicationJSONObject = utils.objectToClass(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.GetModelById200ApplicationJSON);
243
+ res.getModelById200ApplicationJSONObject = utils.objectToClass(JSON.parse(decodedRes), operations.GetModelById200ApplicationJSON);
225
244
  }
226
245
  break;
227
246
  }
package/dist/sdk/sdk.js CHANGED
@@ -52,8 +52,8 @@ var SDKConfiguration = /** @class */ (function () {
52
52
  function SDKConfiguration(init) {
53
53
  this.language = "typescript";
54
54
  this.openapiDocVersion = "v1.0.0";
55
- this.sdkVersion = "1.39.1";
56
- this.genVersion = "2.39.2";
55
+ this.sdkVersion = "1.41.0";
56
+ this.genVersion = "2.50.2";
57
57
  Object.assign(this, init);
58
58
  }
59
59
  return SDKConfiguration;
@@ -2,6 +2,22 @@
2
2
  /*
3
3
  * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
4
4
  */
5
+ var __read = (this && this.__read) || function (o, n) {
6
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
7
+ if (!m) return o;
8
+ var i = m.call(o), r, ar = [], e;
9
+ try {
10
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
11
+ }
12
+ catch (error) { e = { error: error }; }
13
+ finally {
14
+ try {
15
+ if (r && !r.done && (m = i["return"])) m.call(i);
16
+ }
17
+ finally { if (e) throw e.error; }
18
+ }
19
+ return ar;
20
+ };
5
21
  Object.defineProperty(exports, "__esModule", { value: true });
6
22
  exports.RFCDate = void 0;
7
23
  var RFCDate = /** @class */ (function () {
@@ -25,7 +41,7 @@ var RFCDate = /** @class */ (function () {
25
41
  if (matches == null) {
26
42
  throw new Error("Date format is not valid");
27
43
  }
28
- var year = matches[1], month = matches[2], day = matches[3];
44
+ var _a = __read(matches, 4), year = _a[1], month = _a[2], day = _a[3];
29
45
  return "".concat(year, "-").concat(month, "-").concat(day);
30
46
  };
31
47
  return RFCDate;
package/dist/sdk/user.js CHANGED
@@ -89,7 +89,7 @@ var User = /** @class */ (function () {
89
89
  User.prototype.getUserSelf = function (config) {
90
90
  var _a, _b;
91
91
  return __awaiter(this, void 0, void 0, function () {
92
- var baseURL, url, client, headers, httpRes, contentType, res;
92
+ var baseURL, url, client, headers, httpRes, contentType, res, decodedRes;
93
93
  return __generator(this, function (_c) {
94
94
  switch (_c.label) {
95
95
  case 0:
@@ -99,7 +99,7 @@ var User = /** @class */ (function () {
99
99
  headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers);
100
100
  headers["Accept"] = "application/json";
101
101
  headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
102
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers }, config))];
102
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
103
103
  case 1:
104
104
  httpRes = _c.sent();
105
105
  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 : "";
@@ -111,10 +111,11 @@ var User = /** @class */ (function () {
111
111
  contentType: contentType,
112
112
  rawResponse: httpRes,
113
113
  });
114
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
114
115
  switch (true) {
115
116
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
116
117
  if (utils.matchContentType(contentType, "application/json")) {
117
- res.getUserSelf200ApplicationJSONObject = utils.objectToClass(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.GetUserSelf200ApplicationJSON);
118
+ res.getUserSelf200ApplicationJSONObject = utils.objectToClass(JSON.parse(decodedRes), operations.GetUserSelf200ApplicationJSON);
118
119
  }
119
120
  break;
120
121
  }
@@ -72,6 +72,22 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
72
72
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
73
73
  }
74
74
  };
75
+ var __read = (this && this.__read) || function (o, n) {
76
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
77
+ if (!m) return o;
78
+ var i = m.call(o), r, ar = [], e;
79
+ try {
80
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
81
+ }
82
+ catch (error) { e = { error: error }; }
83
+ finally {
84
+ try {
85
+ if (r && !r.done && (m = i["return"])) m.call(i);
86
+ }
87
+ finally { if (e) throw e.error; }
88
+ }
89
+ return ar;
90
+ };
75
91
  Object.defineProperty(exports, "__esModule", { value: true });
76
92
  exports.Variation = void 0;
77
93
  var utils = __importStar(require("../internal/utils"));
@@ -89,7 +105,7 @@ var Variation = /** @class */ (function () {
89
105
  Variation.prototype.createVariationUpscale = function (req, config) {
90
106
  var _a, _b;
91
107
  return __awaiter(this, void 0, void 0, function () {
92
- var baseURL, url, _c, reqBodyHeaders, reqBody, client, headers, httpRes, contentType, res;
108
+ var baseURL, url, _c, reqBodyHeaders, reqBody, client, headers, httpRes, contentType, res, decodedRes;
93
109
  var _d;
94
110
  return __generator(this, function (_e) {
95
111
  switch (_e.label) {
@@ -99,9 +115,9 @@ var Variation = /** @class */ (function () {
99
115
  }
100
116
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
101
117
  url = baseURL.replace(/\/$/, "") + "/variations/upscale";
102
- _c = [{}, {}], reqBodyHeaders = _c[0], reqBody = _c[1];
118
+ _c = __read([{}, {}], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
103
119
  try {
104
- _d = utils.serializeRequestBody(req, "request", "json"), reqBodyHeaders = _d[0], reqBody = _d[1];
120
+ _d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
105
121
  }
106
122
  catch (e) {
107
123
  if (e instanceof Error) {
@@ -112,7 +128,7 @@ var Variation = /** @class */ (function () {
112
128
  headers = __assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers);
113
129
  headers["Accept"] = "application/json";
114
130
  headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
115
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, data: reqBody }, config))];
131
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
116
132
  case 1:
117
133
  httpRes = _e.sent();
118
134
  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 : "";
@@ -124,10 +140,11 @@ var Variation = /** @class */ (function () {
124
140
  contentType: contentType,
125
141
  rawResponse: httpRes,
126
142
  });
143
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
127
144
  switch (true) {
128
145
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
129
146
  if (utils.matchContentType(contentType, "application/json")) {
130
- res.createVariationUpscale200ApplicationJSONObject = utils.objectToClass(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.CreateVariationUpscale200ApplicationJSON);
147
+ res.createVariationUpscale200ApplicationJSONObject = utils.objectToClass(JSON.parse(decodedRes), operations.CreateVariationUpscale200ApplicationJSON);
131
148
  }
132
149
  break;
133
150
  }
@@ -145,7 +162,7 @@ var Variation = /** @class */ (function () {
145
162
  Variation.prototype.getVariationById = function (id, config) {
146
163
  var _a, _b;
147
164
  return __awaiter(this, void 0, void 0, function () {
148
- var req, baseURL, url, client, headers, httpRes, contentType, res;
165
+ var req, baseURL, url, client, headers, httpRes, contentType, res, decodedRes;
149
166
  return __generator(this, function (_c) {
150
167
  switch (_c.label) {
151
168
  case 0:
@@ -158,7 +175,7 @@ var Variation = /** @class */ (function () {
158
175
  headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers);
159
176
  headers["Accept"] = "application/json";
160
177
  headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion);
161
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers }, config))];
178
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
162
179
  case 1:
163
180
  httpRes = _c.sent();
164
181
  contentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
@@ -170,10 +187,11 @@ var Variation = /** @class */ (function () {
170
187
  contentType: contentType,
171
188
  rawResponse: httpRes,
172
189
  });
190
+ decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
173
191
  switch (true) {
174
192
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
175
193
  if (utils.matchContentType(contentType, "application/json")) {
176
- res.getVariationById200ApplicationJSONObject = utils.objectToClass(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.GetVariationById200ApplicationJSON);
194
+ res.getVariationById200ApplicationJSONObject = utils.objectToClass(JSON.parse(decodedRes), operations.GetVariationById200ApplicationJSON);
177
195
  }
178
196
  break;
179
197
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leonardo-ai/sdk",
3
- "version": "1.39.1",
3
+ "version": "1.41.0",
4
4
  "author": "leonardoai",
5
5
  "scripts": {
6
6
  "prepare": "tsc --build"