@codat/files
Advanced tools
Comparing version 0.25.2 to 0.27.1
@@ -5,2 +5,18 @@ "use strict"; | ||
*/ | ||
var __read = (this && this.__read) || function (o, n) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
if (!m) return o; | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); | ||
} | ||
catch (error) { e = { error: error }; } | ||
finally { | ||
try { | ||
if (r && !r.done && (m = i["return"])) m.call(i); | ||
} | ||
finally { if (e) throw e.error; } | ||
} | ||
return ar; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -65,3 +81,3 @@ exports.serializeQueryParams = exports.qpMetadataKey = void 0; | ||
Object.entries(Object.assign({}, params)).forEach(function (_a) { | ||
var key = _a[0], value = _a[1]; | ||
var _b = __read(_a, 2), key = _b[0], value = _b[1]; | ||
query.push("".concat(key, "=").concat(encodeURIComponent(JSON.stringify(value)))); | ||
@@ -76,3 +92,3 @@ }); | ||
Object.entries(Object.assign({}, params)).forEach(function (_a) { | ||
var key = _a[0], value = _a[1]; | ||
var _b = __read(_a, 2), key = _b[0], value = _b[1]; | ||
if (!(0, utils_1.shouldQueryParamSerialize)(value)) | ||
@@ -105,3 +121,3 @@ return; | ||
Object.entries(Object.assign({}, params)).forEach(function (_a) { | ||
var key = _a[0], value = _a[1]; | ||
var _b = __read(_a, 2), key = _b[0], value = _b[1]; | ||
if (!(0, utils_1.shouldQueryParamSerialize)(value)) | ||
@@ -133,3 +149,3 @@ return; | ||
Object.entries(Object.assign({}, params)).forEach(function (_a) { | ||
var key = _a[0], value = _a[1]; | ||
var _b = __read(_a, 2), key = _b[0], value = _b[1]; | ||
if (!(0, utils_1.shouldQueryParamSerialize)(value)) | ||
@@ -142,3 +158,3 @@ return; | ||
.map(function (_a) { | ||
var objKey = _a[0], objValue = _a[1]; | ||
var _b = __read(_a, 2), objKey = _b[0], objValue = _b[1]; | ||
return "".concat(key, "[").concat(objKey, "]=").concat(encodeURIComponent((0, utils_1.valToString)(objValue))); | ||
@@ -145,0 +161,0 @@ }) |
@@ -5,2 +5,18 @@ "use strict"; | ||
*/ | ||
var __read = (this && this.__read) || function (o, n) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
if (!m) return o; | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); | ||
} | ||
catch (error) { e = { error: error }; } | ||
finally { | ||
try { | ||
if (r && !r.done && (m = i["return"])) m.call(i); | ||
} | ||
finally { if (e) throw e.error; } | ||
} | ||
return ar; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -31,3 +47,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
var _a, _b; | ||
var _c = [{}, {}], requestHeaders = _c[0], requestBody = _c[1]; | ||
var _c = __read([{}, {}], 2), requestHeaders = _c[0], requestBody = _c[1]; | ||
switch (contentType) { | ||
@@ -42,13 +58,13 @@ case "multipart/form-data": | ||
case "application/x-www-form-urlencoded": | ||
_a = [ | ||
_a = __read([ | ||
{ "Content-Type": "".concat(contentType) }, | ||
encodeFormUrlEncodeData(reqBody), | ||
], requestHeaders = _a[0], requestBody = _a[1]; | ||
], 2), requestHeaders = _a[0], requestBody = _a[1]; | ||
break; | ||
case "application/json": | ||
case "text/json": | ||
_b = [ | ||
_b = __read([ | ||
{ "Content-Type": "".concat(contentType) }, | ||
reqBody, | ||
], requestHeaders = _b[0], requestBody = _b[1]; | ||
], 2), requestHeaders = _b[0], requestBody = _b[1]; | ||
break; | ||
@@ -174,3 +190,3 @@ default: { | ||
formAnn.split(";").forEach(function (formAnnPart) { | ||
var _a = formAnnPart.split("="), formKey = _a[0], formVal = _a[1]; | ||
var _a = __read(formAnnPart.split("="), 2), formKey = _a[0], formVal = _a[1]; | ||
switch (formKey) { | ||
@@ -260,3 +276,3 @@ case "name": | ||
mpFormAnn.split(";").forEach(function (mpFormAnnPart) { | ||
var _a = mpFormAnnPart.split("="), mpFormKey = _a[0], mpFormVal = _a[1]; | ||
var _a = __read(mpFormAnnPart.split("="), 2), mpFormKey = _a[0], mpFormVal = _a[1]; | ||
switch (mpFormKey) { | ||
@@ -291,3 +307,3 @@ case "file": | ||
var requestDecorator = new RequestDecorator("application/octet-stream"); | ||
var _a = requestAnn.split("="), mediaTypeKey = _a[0], mediaTypeVal = _a[1]; | ||
var _a = __read(requestAnn.split("="), 2), mediaTypeKey = _a[0], mediaTypeVal = _a[1]; | ||
if (mediaTypeKey === "media_type") | ||
@@ -294,0 +310,0 @@ requestDecorator.MediaType = mediaTypeVal; |
@@ -13,3 +13,3 @@ import { AxiosResponse } from "axios"; | ||
retryConnectionErrors: boolean; | ||
constructor(strategy: string, retryConnectionErrors?: boolean); | ||
constructor(strategy: string, backoff?: BackoffStrategy, retryConnectionErrors?: boolean); | ||
} | ||
@@ -16,0 +16,0 @@ export declare class Retries { |
@@ -56,2 +56,13 @@ "use strict"; | ||
}; | ||
var __values = (this && this.__values) || function(o) { | ||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; | ||
if (m) return m.call(o); | ||
if (o && typeof o.length === "number") return { | ||
next: function () { | ||
if (o && i >= o.length) o = void 0; | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
}; | ||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -71,5 +82,6 @@ exports.Retry = exports.Retries = exports.RetryConfig = exports.BackoffStrategy = void 0; | ||
var RetryConfig = /** @class */ (function () { | ||
function RetryConfig(strategy, retryConnectionErrors) { | ||
function RetryConfig(strategy, backoff, retryConnectionErrors) { | ||
if (retryConnectionErrors === void 0) { retryConnectionErrors = true; } | ||
this.strategy = strategy; | ||
this.backoff = backoff; | ||
this.retryConnectionErrors = retryConnectionErrors; | ||
@@ -93,2 +105,3 @@ } | ||
_this.inner = inner; | ||
Object.setPrototypeOf(_this, PermanentError.prototype); | ||
return _this; | ||
@@ -103,2 +116,3 @@ } | ||
_this.res = res; | ||
Object.setPrototypeOf(_this, TemporaryError.prototype); | ||
return _this; | ||
@@ -166,17 +180,27 @@ } | ||
function isRetryableResponse(res, statusCodes) { | ||
for (var _i = 0, statusCodes_1 = statusCodes; _i < statusCodes_1.length; _i++) { | ||
var code = statusCodes_1[_i]; | ||
if (code.toUpperCase().includes("X")) { | ||
var codeRange = parseInt(code[0]); | ||
if (isNaN(codeRange)) { | ||
throw new Error("Invalid status code range"); | ||
var e_1, _a; | ||
try { | ||
for (var statusCodes_1 = __values(statusCodes), statusCodes_1_1 = statusCodes_1.next(); !statusCodes_1_1.done; statusCodes_1_1 = statusCodes_1.next()) { | ||
var code = statusCodes_1_1.value; | ||
if (code.toUpperCase().includes("X")) { | ||
var codeRange = parseInt(code[0]); | ||
if (isNaN(codeRange)) { | ||
throw new Error("Invalid status code range"); | ||
} | ||
var s = res.status / 100; | ||
if (s >= codeRange && s < codeRange + 1) { | ||
return true; | ||
} | ||
} | ||
var s = res.status / 100; | ||
if (s >= codeRange && s < codeRange + 1) { | ||
else if (res.status == parseInt(code)) { | ||
return true; | ||
} | ||
} | ||
else if (res.status == parseInt(code)) { | ||
return true; | ||
} | ||
catch (e_1_1) { e_1 = { error: e_1_1 }; } | ||
finally { | ||
try { | ||
if (statusCodes_1_1 && !statusCodes_1_1.done && (_a = statusCodes_1.return)) _a.call(statusCodes_1); | ||
} | ||
finally { if (e_1) throw e_1.error; } | ||
} | ||
@@ -183,0 +207,0 @@ return false; |
@@ -5,2 +5,18 @@ "use strict"; | ||
*/ | ||
var __read = (this && this.__read) || function (o, n) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
if (!m) return o; | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); | ||
} | ||
catch (error) { e = { error: error }; } | ||
finally { | ||
try { | ||
if (r && !r.done && (m = i["return"])) m.call(i); | ||
} | ||
finally { if (e) throw e.error; } | ||
} | ||
return ar; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -21,3 +37,3 @@ exports.createSecurityClient = void 0; | ||
securityAnn.split(";").forEach(function (securityAnnPart) { | ||
var _a = securityAnnPart.split("="), sKey = _a[0], sVal = _a[1]; | ||
var _a = __read(securityAnnPart.split("="), 2), sKey = _a[0], sVal = _a[1]; | ||
switch (sKey) { | ||
@@ -24,0 +40,0 @@ case "name": |
@@ -5,2 +5,29 @@ "use strict"; | ||
*/ | ||
var __values = (this && this.__values) || function(o) { | ||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; | ||
if (m) return m.call(o); | ||
if (o && typeof o.length === "number") return { | ||
next: function () { | ||
if (o && i >= o.length) o = void 0; | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
}; | ||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); | ||
}; | ||
var __read = (this && this.__read) || function (o, n) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
if (!m) return o; | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); | ||
} | ||
catch (error) { e = { error: error }; } | ||
finally { | ||
try { | ||
if (r && !r.done && (m = i["return"])) m.call(i); | ||
} | ||
finally { if (e) throw e.error; } | ||
} | ||
return ar; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -73,23 +100,29 @@ 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; | ||
function SpeakeasyBase(payload) { | ||
var e_1, _a; | ||
var props = this["__props__"]; | ||
if (props) { | ||
for (var _i = 0, props_1 = props; _i < props_1.length; _i++) { | ||
var prop = props_1[_i]; | ||
if (payload && payload.hasOwnProperty(prop.key)) { | ||
var value = payload[prop.key]; | ||
if (isSpeakeasyBase(prop.type)) { | ||
this[prop.key] = new prop.type(value); | ||
} | ||
else if (prop.type.name == "Array" && | ||
isSpeakeasyBase(prop.elemType)) { | ||
this[prop.key] = handleArray(value, prop.elemType, prop.elemDepth); | ||
} | ||
else if (prop.type.name == "Object" && | ||
isSpeakeasyBase(prop.elemType)) { | ||
this[prop.key] = handleObject(value, prop.elemType, prop.elemDepth); | ||
} | ||
else if (prop.type.name == "RFCDate") { | ||
if (value instanceof Date) { | ||
this[prop.key] = new types_1.RFCDate(value); | ||
try { | ||
for (var props_1 = __values(props), props_1_1 = props_1.next(); !props_1_1.done; props_1_1 = props_1.next()) { | ||
var prop = props_1_1.value; | ||
if (payload && payload.hasOwnProperty(prop.key)) { | ||
var value = payload[prop.key]; | ||
if (isSpeakeasyBase(prop.type)) { | ||
this[prop.key] = new prop.type(value); | ||
} | ||
else if (prop.type.name == "Array" && | ||
isSpeakeasyBase(prop.elemType)) { | ||
this[prop.key] = handleArray(value, prop.elemType, prop.elemDepth); | ||
} | ||
else if (prop.type.name == "Object" && | ||
isSpeakeasyBase(prop.elemType)) { | ||
this[prop.key] = handleObject(value, prop.elemType, prop.elemDepth); | ||
} | ||
else if (prop.type.name == "RFCDate") { | ||
if (value instanceof Date) { | ||
this[prop.key] = new types_1.RFCDate(value); | ||
} | ||
else { | ||
this[prop.key] = value; | ||
} | ||
} | ||
else { | ||
@@ -99,7 +132,11 @@ this[prop.key] = value; | ||
} | ||
else { | ||
this[prop.key] = value; | ||
} | ||
} | ||
} | ||
catch (e_1_1) { e_1 = { error: e_1_1 }; } | ||
finally { | ||
try { | ||
if (props_1_1 && !props_1_1.done && (_a = props_1.return)) _a.call(props_1); | ||
} | ||
finally { if (e_1) throw e_1.error; } | ||
} | ||
} | ||
@@ -151,3 +188,3 @@ } | ||
Object.entries(params).forEach(function (_a) { | ||
var key = _a[0], value = _a[1]; | ||
var _b = __read(_a, 2), key = _b[0], value = _b[1]; | ||
var match = "{" + key + "}"; | ||
@@ -205,3 +242,3 @@ res = res.replaceAll(match, value); | ||
ann.split(";").forEach(function (annPart) { | ||
var _a = annPart.split("="), paramKey = _a[0], paramVal = _a[1]; | ||
var _a = __read(annPart.split("="), 2), paramKey = _a[0], paramVal = _a[1]; | ||
switch (paramKey) { | ||
@@ -287,13 +324,16 @@ case "style": | ||
function getResFieldDepth(res) { | ||
var e_2, _a; | ||
var props = res["__props__"]; | ||
var resFieldDepth = 1; | ||
if (props) { | ||
for (var _i = 0, props_2 = props; _i < props_2.length; _i++) { | ||
var prop = props_2[_i]; | ||
if (res && res.hasOwnProperty(prop.key)) { | ||
if ((prop.type.name == "Array" || prop.type.name == "Object") && | ||
isSpeakeasyBase(prop.elemType)) { | ||
if (prop.elemDepth > resFieldDepth) { | ||
resFieldDepth = prop.elemDepth; | ||
break; | ||
try { | ||
for (var props_2 = __values(props), props_2_1 = props_2.next(); !props_2_1.done; props_2_1 = props_2.next()) { | ||
var prop = props_2_1.value; | ||
if (res && res.hasOwnProperty(prop.key)) { | ||
if ((prop.type.name == "Array" || prop.type.name == "Object") && | ||
isSpeakeasyBase(prop.elemType)) { | ||
if (prop.elemDepth > resFieldDepth) { | ||
resFieldDepth = prop.elemDepth; | ||
break; | ||
} | ||
} | ||
@@ -303,2 +343,9 @@ } | ||
} | ||
catch (e_2_1) { e_2 = { error: e_2_1 }; } | ||
finally { | ||
try { | ||
if (props_2_1 && !props_2_1.done && (_a = props_2.return)) _a.call(props_2); | ||
} | ||
finally { if (e_2) throw e_2.error; } | ||
} | ||
} | ||
@@ -305,0 +352,0 @@ return resFieldDepth; |
@@ -75,2 +75,18 @@ "use strict"; | ||
}; | ||
var __read = (this && this.__read) || function (o, n) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
if (!m) return o; | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); | ||
} | ||
catch (error) { e = { error: error }; } | ||
finally { | ||
try { | ||
if (r && !r.done && (m = i["return"])) m.call(i); | ||
} | ||
finally { if (e) throw e.error; } | ||
} | ||
return ar; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -97,3 +113,3 @@ exports.Files = void 0; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var baseURL, url, client, headers, queryParams, retryConfig, httpRes, contentType, res, resBody, out, i; | ||
var baseURL, url, client, headers, queryParams, retryConfig, httpRes, contentType, res, decodedRes; | ||
return __generator(this, function (_c) { | ||
@@ -115,7 +131,6 @@ switch (_c.label) { | ||
if (!retryConfig) { | ||
retryConfig = new utils.RetryConfig("backoff", true); | ||
retryConfig.backoff = new utils.BackoffStrategy(500, 60000, 1.5, 3600000); | ||
retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true); | ||
} | ||
return [4 /*yield*/, utils.Retry(function () { | ||
return client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers }, config)); | ||
return client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config)); | ||
}, new utils.Retries(retryConfig, ["408", "429", "5XX"]))]; | ||
@@ -133,10 +148,7 @@ case 1: | ||
}); | ||
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data); | ||
switch (true) { | ||
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200: | ||
if (utils.matchContentType(contentType, "application/octet-stream")) { | ||
resBody = JSON.stringify(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, null, 0); | ||
out = new Uint8Array(resBody.length); | ||
for (i = 0; i < resBody.length; i++) | ||
out[i] = resBody.charCodeAt(i); | ||
res.data = out; | ||
res.data = httpRes === null || httpRes === void 0 ? void 0 : httpRes.data; | ||
} | ||
@@ -146,3 +158,3 @@ break; | ||
if (utils.matchContentType(contentType, "application/json")) { | ||
res.schema = utils.objectToClass(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, shared.Schema); | ||
res.schema = utils.objectToClass(JSON.parse(decodedRes), shared.Schema); | ||
} | ||
@@ -152,3 +164,3 @@ break; | ||
if (utils.matchContentType(contentType, "application/json")) { | ||
res.downloadFiles404ApplicationJSONObject = utils.objectToClass(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.DownloadFiles404ApplicationJSON); | ||
res.downloadFiles404ApplicationJSONObject = utils.objectToClass(JSON.parse(decodedRes), operations.DownloadFiles404ApplicationJSON); | ||
} | ||
@@ -171,3 +183,3 @@ break; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var baseURL, url, client, headers, retryConfig, httpRes, contentType, res, resFieldDepth; | ||
var baseURL, url, client, headers, retryConfig, httpRes, contentType, res, decodedRes, resFieldDepth; | ||
return __generator(this, function (_c) { | ||
@@ -187,7 +199,6 @@ switch (_c.label) { | ||
if (!retryConfig) { | ||
retryConfig = new utils.RetryConfig("backoff", true); | ||
retryConfig.backoff = new utils.BackoffStrategy(500, 60000, 1.5, 3600000); | ||
retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true); | ||
} | ||
return [4 /*yield*/, utils.Retry(function () { | ||
return client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers }, config)); | ||
return client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config)); | ||
}, new utils.Retries(retryConfig, ["408", "429", "5XX"]))]; | ||
@@ -205,2 +216,3 @@ case 1: | ||
}); | ||
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data); | ||
switch (true) { | ||
@@ -211,3 +223,3 @@ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200: | ||
resFieldDepth = utils.getResFieldDepth(res); | ||
res.files = utils.objectToClass(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, shared.File, resFieldDepth); | ||
res.files = utils.objectToClass(JSON.parse(decodedRes), shared.File, resFieldDepth); | ||
} | ||
@@ -217,3 +229,3 @@ break; | ||
if (utils.matchContentType(contentType, "application/json")) { | ||
res.schema = utils.objectToClass(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, shared.Schema); | ||
res.schema = utils.objectToClass(JSON.parse(decodedRes), shared.Schema); | ||
} | ||
@@ -223,3 +235,3 @@ break; | ||
if (utils.matchContentType(contentType, "application/json")) { | ||
res.listFiles404ApplicationJSONObject = utils.objectToClass(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.ListFiles404ApplicationJSON); | ||
res.listFiles404ApplicationJSONObject = utils.objectToClass(JSON.parse(decodedRes), operations.ListFiles404ApplicationJSON); | ||
} | ||
@@ -242,3 +254,3 @@ break; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var baseURL, url, _c, reqBodyHeaders, reqBody, client, headers, retryConfig, httpRes, contentType, res; | ||
var baseURL, url, _c, reqBodyHeaders, reqBody, client, headers, retryConfig, httpRes, contentType, res, decodedRes; | ||
var _d; | ||
@@ -253,5 +265,5 @@ return __generator(this, function (_e) { | ||
url = utils.generateURL(baseURL, "/companies/{companyId}/connections/{connectionId}/files", req); | ||
_c = [{}, {}], reqBodyHeaders = _c[0], reqBody = _c[1]; | ||
_c = __read([{}, {}], 2), reqBodyHeaders = _c[0], reqBody = _c[1]; | ||
try { | ||
_d = utils.serializeRequestBody(req, "requestBody", "multipart"), reqBodyHeaders = _d[0], reqBody = _d[1]; | ||
_d = __read(utils.serializeRequestBody(req, "requestBody", "multipart"), 2), reqBodyHeaders = _d[0], reqBody = _d[1]; | ||
} | ||
@@ -269,7 +281,6 @@ catch (e) { | ||
if (!retryConfig) { | ||
retryConfig = new utils.RetryConfig("backoff", true); | ||
retryConfig.backoff = new utils.BackoffStrategy(500, 60000, 1.5, 3600000); | ||
retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true); | ||
} | ||
return [4 /*yield*/, utils.Retry(function () { | ||
return client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, data: reqBody }, config)); | ||
return client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config)); | ||
}, new utils.Retries(retryConfig, ["408", "429", "5XX"]))]; | ||
@@ -287,2 +298,3 @@ case 1: | ||
}); | ||
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data); | ||
switch (true) { | ||
@@ -293,3 +305,3 @@ case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200: | ||
if (utils.matchContentType(contentType, "application/json")) { | ||
res.schema = utils.objectToClass(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, shared.Schema); | ||
res.schema = utils.objectToClass(JSON.parse(decodedRes), shared.Schema); | ||
} | ||
@@ -299,3 +311,3 @@ break; | ||
if (utils.matchContentType(contentType, "application/json")) { | ||
res.uploadFiles404ApplicationJSONObject = utils.objectToClass(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data, operations.UploadFiles404ApplicationJSON); | ||
res.uploadFiles404ApplicationJSONObject = utils.objectToClass(JSON.parse(decodedRes), operations.UploadFiles404ApplicationJSON); | ||
} | ||
@@ -302,0 +314,0 @@ break; |
@@ -50,4 +50,4 @@ "use strict"; | ||
this.openapiDocVersion = "2.1.0"; | ||
this.sdkVersion = "0.25.2"; | ||
this.genVersion = "2.39.2"; | ||
this.sdkVersion = "0.27.1"; | ||
this.genVersion = "2.41.1"; | ||
Object.assign(this, init); | ||
@@ -54,0 +54,0 @@ } |
@@ -5,2 +5,18 @@ "use strict"; | ||
*/ | ||
var __read = (this && this.__read) || function (o, n) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
if (!m) return o; | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); | ||
} | ||
catch (error) { e = { error: error }; } | ||
finally { | ||
try { | ||
if (r && !r.done && (m = i["return"])) m.call(i); | ||
} | ||
finally { if (e) throw e.error; } | ||
} | ||
return ar; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -29,3 +45,3 @@ exports.RFCDate = void 0; | ||
} | ||
var year = matches[1], month = matches[2], day = matches[3]; | ||
var _a = __read(matches, 4), year = _a[1], month = _a[2], day = _a[3]; | ||
return "".concat(year, "-").concat(month, "-").concat(day); | ||
@@ -32,0 +48,0 @@ }; |
{ | ||
"name": "@codat/files", | ||
"version": "0.25.2", | ||
"version": "0.27.1", | ||
"author": "Speakeasy", | ||
@@ -5,0 +5,0 @@ "scripts": { |
134506
3048