@codat/files
Advanced tools
Comparing version 0.15.3 to 0.19.0
@@ -75,3 +75,3 @@ "use strict"; | ||
var key = _a[0], value = _a[1]; | ||
if (!value) | ||
if (!(0, utils_1.shouldQueryParamSerialize)(value)) | ||
return; | ||
@@ -91,5 +91,5 @@ if (value !== Object(value)) | ||
return; | ||
return "".concat(paramKey, ",").concat((0, utils_1.valToString)(value[paramKey])); | ||
return "".concat(paramKey).concat(delimiter).concat((0, utils_1.valToString)(value[paramKey])); | ||
}) | ||
.join(","); | ||
.join(delimiter); | ||
query.push("".concat(key, "=").concat(encodeURIComponent(values))); | ||
@@ -105,3 +105,3 @@ } | ||
var key = _a[0], value = _a[1]; | ||
if (!value) | ||
if (!(0, utils_1.shouldQueryParamSerialize)(value)) | ||
return; | ||
@@ -133,3 +133,3 @@ if (value !== Object(value)) | ||
var key = _a[0], value = _a[1]; | ||
if (!value) | ||
if (!(0, utils_1.shouldQueryParamSerialize)(value)) | ||
return; | ||
@@ -136,0 +136,0 @@ if (value !== Object(value)) |
@@ -130,3 +130,3 @@ "use strict"; | ||
case "bearer": | ||
client.defaults.headers.common[securityDecorator.Name] = value; | ||
client.defaults.headers.common[securityDecorator.Name] = value.toLowerCase().startsWith("bearer ") ? value : "Bearer ".concat(value); | ||
break; | ||
@@ -133,0 +133,0 @@ default: |
@@ -37,1 +37,2 @@ import "reflect-metadata"; | ||
export declare function valToString(value: any): string; | ||
export declare function shouldQueryParamSerialize(value: any): boolean; |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
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; | ||
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; | ||
require("reflect-metadata"); | ||
@@ -22,3 +22,3 @@ var pathparams_1 = require("./pathparams"); | ||
var _a; | ||
return type && ((_a = Object.getPrototypeOf(type)) === null || _a === void 0 ? void 0 : _a.name) == "SpeakeasyBase"; | ||
return type && ((_a = Object.getPrototypeOf(type)) === null || _a === void 0 ? void 0 : _a.name) == SpeakeasyBase.name; | ||
} | ||
@@ -320,1 +320,5 @@ function handleArray(value, elemType, elemDepth) { | ||
exports.valToString = valToString; | ||
function shouldQueryParamSerialize(value) { | ||
return !(value === undefined || value === null || value === ""); | ||
} | ||
exports.shouldQueryParamSerialize = shouldQueryParamSerialize; |
@@ -101,3 +101,3 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var baseURL, url, client, queryParams, retryConfig, httpRes, contentType, res, resBody, out, i; | ||
var baseURL, url, client, headers, queryParams, retryConfig, httpRes, contentType, res, resBody, out, i; | ||
return __generator(this, function (_c) { | ||
@@ -112,3 +112,5 @@ switch (_c.label) { | ||
client = this._securityClient || this._defaultClient; | ||
headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers); | ||
queryParams = utils.serializeQueryParams(req); | ||
headers["user-agent"] = "speakeasy-sdk/".concat(this._language, " ").concat(this._sdkVersion, " ").concat(this._genVersion); | ||
retryConfig = retries; | ||
@@ -120,3 +122,3 @@ if (!retryConfig) { | ||
return [4 /*yield*/, utils.Retry(function () { | ||
return client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get" }, config)); | ||
return client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers }, config)); | ||
}, new utils.Retries(retryConfig, ["408", "429", "5XX"]))]; | ||
@@ -159,3 +161,3 @@ case 1: | ||
return __awaiter(this, void 0, void 0, function () { | ||
var baseURL, url, client, retryConfig, httpRes, contentType, res, resFieldDepth; | ||
var baseURL, url, client, headers, retryConfig, httpRes, contentType, res, resFieldDepth; | ||
return __generator(this, function (_c) { | ||
@@ -170,2 +172,4 @@ switch (_c.label) { | ||
client = this._securityClient || this._defaultClient; | ||
headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers); | ||
headers["user-agent"] = "speakeasy-sdk/".concat(this._language, " ").concat(this._sdkVersion, " ").concat(this._genVersion); | ||
retryConfig = retries; | ||
@@ -177,3 +181,3 @@ if (!retryConfig) { | ||
return [4 /*yield*/, utils.Retry(function () { | ||
return client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get" }, config)); | ||
return client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers }, config)); | ||
}, new utils.Retries(retryConfig, ["408", "429", "5XX"]))]; | ||
@@ -235,2 +239,3 @@ case 1: | ||
headers = __assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers); | ||
headers["user-agent"] = "speakeasy-sdk/".concat(this._language, " ").concat(this._sdkVersion, " ").concat(this._genVersion); | ||
retryConfig = retries; | ||
@@ -237,0 +242,0 @@ if (!retryConfig) { |
@@ -61,4 +61,4 @@ "use strict"; | ||
this._language = "typescript"; | ||
this._sdkVersion = "0.15.3"; | ||
this._genVersion = "2.26.3"; | ||
this._sdkVersion = "0.19.0"; | ||
this._genVersion = "2.30.0"; | ||
this._serverURL = (_a = props === null || props === void 0 ? void 0 : props.serverURL) !== null && _a !== void 0 ? _a : exports.ServerList[0]; | ||
@@ -65,0 +65,0 @@ this._defaultClient = |
{ | ||
"name": "@codat/files", | ||
"version": "0.15.3", | ||
"version": "0.19.0", | ||
"author": "Speakeasy", | ||
@@ -5,0 +5,0 @@ "scripts": { |
109295
2487