@leonardo-ai/sdk 1.25.2 → 1.28.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,7 +16,7 @@ function serializeQueryParams(queryParams, globals) {
16
16
  ? queryParams["__props__"].map(function (prop) { return prop.key; })
17
17
  : Object.getOwnPropertyNames(queryParams);
18
18
  fieldNames.forEach(function (fname) {
19
- var _a, _b, _c, _d, _e;
19
+ var _a, _b, _c, _d, _e, _f, _g;
20
20
  var requestBodyAnn = Reflect.getMetadata(requestbody_1.requestMetadataKey, queryParams, fname);
21
21
  if (requestBodyAnn)
22
22
  return;
@@ -37,12 +37,20 @@ function serializeQueryParams(queryParams, globals) {
37
37
  return;
38
38
  case "form":
39
39
  if (!qpDecorator.Explode)
40
- queryStringParts.push(formSerializer((_c = {}, _c[qpDecorator.ParamName] = value, _c)));
40
+ queryStringParts.push(noExplodeSerializer((_c = {}, _c[qpDecorator.ParamName] = value, _c)));
41
41
  else
42
42
  queryStringParts.push(formSerializerExplode((_d = {}, _d[qpDecorator.ParamName] = value, _d)));
43
43
  return;
44
+ case "pipeDelimited":
45
+ if (!qpDecorator.Explode) {
46
+ queryStringParts.push(noExplodeSerializer((_e = {}, _e[qpDecorator.ParamName] = value, _e), "|"));
47
+ }
48
+ else {
49
+ queryStringParts.push(formSerializerExplode((_f = {}, _f[qpDecorator.ParamName] = value, _f)));
50
+ }
51
+ return;
44
52
  default:
45
- queryStringParts.push(formSerializerExplode((_e = {}, _e[qpDecorator.ParamName] = value, _e)));
53
+ queryStringParts.push(formSerializerExplode((_g = {}, _g[qpDecorator.ParamName] = value, _g)));
46
54
  }
47
55
  }
48
56
  });
@@ -59,7 +67,8 @@ function jsonSerializer(params) {
59
67
  return query.join("&");
60
68
  }
61
69
  // TODO: Add support for disabling percent encoding for reserved characters
62
- function formSerializer(params) {
70
+ function noExplodeSerializer(params, delimiter) {
71
+ if (delimiter === void 0) { delimiter = ","; }
63
72
  var query = [];
64
73
  Object.entries(Object.assign({}, params)).forEach(function (_a) {
65
74
  var key = _a[0], value = _a[1];
@@ -68,7 +77,7 @@ function formSerializer(params) {
68
77
  if (value !== Object(value))
69
78
  query.push("".concat(key, "=").concat(encodeURIComponent((0, utils_1.valToString)(value))));
70
79
  else if (Array.isArray(value)) {
71
- var values = value.map(function (aValue) { return aValue; }).join(",");
80
+ var values = value.map(function (aValue) { return aValue; }).join(delimiter);
72
81
  query.push("".concat(key, "=").concat(encodeURIComponent(values)));
73
82
  }
74
83
  else {
@@ -30,6 +30,8 @@ var serializeContentType = function (contentType, reqBody) {
30
30
  var _c = [{}, {}], requestHeaders = _c[0], requestBody = _c[1];
31
31
  switch (contentType) {
32
32
  case "multipart/form-data":
33
+ requestBody = encodeMultipartFormData(reqBody);
34
+ break;
33
35
  case "multipart/mixed":
34
36
  requestBody = encodeMultipartFormData(reqBody);
35
37
  requestHeaders = requestBody.getHeaders();
package/dist/sdk/sdk.js CHANGED
@@ -55,8 +55,8 @@ var Leonardo = /** @class */ (function () {
55
55
  function Leonardo(props) {
56
56
  var _a, _b;
57
57
  this._language = "typescript";
58
- this._sdkVersion = "1.25.2";
59
- this._genVersion = "2.23.2";
58
+ this._sdkVersion = "1.28.1";
59
+ this._genVersion = "2.26.1";
60
60
  this._serverURL = (_a = props === null || props === void 0 ? void 0 : props.serverURL) !== null && _a !== void 0 ? _a : exports.ServerList[0];
61
61
  this._defaultClient =
62
62
  (_b = props === null || props === void 0 ? void 0 : props.defaultClient) !== null && _b !== void 0 ? _b : axios_1.default.create({ baseURL: this._serverURL });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leonardo-ai/sdk",
3
- "version": "1.25.2",
3
+ "version": "1.28.1",
4
4
  "author": "leonardoai",
5
5
  "scripts": {
6
6
  "prepare": "tsc --build"