@codat/files
Advanced tools
Comparing version 0.33.1 to 0.34.0
export declare const requestMetadataKey = "request"; | ||
export declare function serializeRequestBody(request: any, requestFieldName: string, serializationMethod: string): [object, any]; | ||
export declare function serializeRequestBody(request: any, requestFieldName: string, serializationMethod: string): [Record<string, any>, any]; |
@@ -10,6 +10,6 @@ import { AxiosResponse } from "axios"; | ||
export declare class RetryConfig { | ||
strategy: string; | ||
strategy: "backoff" | "none"; | ||
backoff?: BackoffStrategy; | ||
retryConnectionErrors: boolean; | ||
constructor(strategy: string, backoff?: BackoffStrategy, retryConnectionErrors?: boolean); | ||
constructor(strategy: "backoff" | "none", backoff?: BackoffStrategy, retryConnectionErrors?: boolean); | ||
} | ||
@@ -16,0 +16,0 @@ export declare class Retries { |
@@ -1,2 +0,5 @@ | ||
import { AxiosInstance } from "axios"; | ||
export declare function createSecurityClient(client: AxiosInstance, security: any): AxiosInstance; | ||
export type SecurityProperties = { | ||
params: Record<string, string>; | ||
headers: Record<string, string>; | ||
}; | ||
export declare function parseSecurityProperties(security: any): SecurityProperties; |
@@ -22,8 +22,8 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createSecurityClient = void 0; | ||
exports.parseSecurityProperties = void 0; | ||
var securityMetadataKey = "security"; | ||
function createSecurityClient(client, security) { | ||
return parseSecurityClass(client, security); | ||
function parseSecurityProperties(security) { | ||
return parseSecurityClass(security); | ||
} | ||
exports.createSecurityClient = createSecurityClient; | ||
exports.parseSecurityProperties = parseSecurityProperties; | ||
function parseSecurityDecorator(securityAnn) { | ||
@@ -57,4 +57,8 @@ // scheme=true;type=apiKey;subtype=header" | ||
} | ||
function parseSecurityClass(client, security) { | ||
function parseSecurityClass(security) { | ||
var fieldNames = Object.getOwnPropertyNames(security); | ||
var properties = { | ||
params: {}, | ||
headers: {}, | ||
}; | ||
fieldNames.forEach(function (fname) { | ||
@@ -69,16 +73,16 @@ var securityAnn = Reflect.getMetadata(securityMetadataKey, security, fname); | ||
if (securityDecorator.Option) { | ||
return parseSecurityOption(client, value); | ||
return parseSecurityOption(properties, value); | ||
} | ||
else if (securityDecorator.Scheme) { | ||
if (securityDecorator.SubType === "basic" && value !== Object(value)) { | ||
return parseSecurityScheme(client, securityDecorator, security); | ||
return parseSecurityScheme(properties, securityDecorator, security); | ||
} | ||
else { | ||
client = parseSecurityScheme(client, securityDecorator, value); | ||
return parseSecurityScheme(properties, securityDecorator, value); | ||
} | ||
} | ||
}); | ||
return client; | ||
return properties; | ||
} | ||
function parseSecurityOption(client, optionType) { | ||
function parseSecurityOption(properties, optionType) { | ||
var fieldNames = Object.getOwnPropertyNames(optionType); | ||
@@ -92,11 +96,10 @@ fieldNames.forEach(function (fname) { | ||
return; | ||
return parseSecurityScheme(client, securityDecorator, optionType[fname]); | ||
return parseSecurityScheme(properties, securityDecorator, optionType[fname]); | ||
}); | ||
return client; | ||
} | ||
function parseSecurityScheme(client, schemeDecorator, scheme) { | ||
function parseSecurityScheme(properties, schemeDecorator, scheme) { | ||
if (scheme === Object(scheme)) { | ||
if (schemeDecorator.Type === "http" && | ||
schemeDecorator.SubType === "basic") { | ||
return parseBasicAuthScheme(client, scheme); | ||
return parseBasicAuthScheme(properties, scheme); | ||
} | ||
@@ -111,11 +114,10 @@ var fieldNames = Object.getOwnPropertyNames(scheme); | ||
return; | ||
client = parseSecuritySchemeValue(client, schemeDecorator, securityDecorator, scheme[fname]); | ||
return parseSecuritySchemeValue(properties, schemeDecorator, securityDecorator, scheme[fname]); | ||
}); | ||
} | ||
else { | ||
client = parseSecuritySchemeValue(client, schemeDecorator, schemeDecorator, scheme); | ||
return parseSecuritySchemeValue(properties, schemeDecorator, schemeDecorator, scheme); | ||
} | ||
return client; | ||
} | ||
function parseSecuritySchemeValue(client, schemeDecorator, securityDecorator, value) { | ||
function parseSecuritySchemeValue(properties, schemeDecorator, securityDecorator, value) { | ||
switch (schemeDecorator.Type) { | ||
@@ -125,6 +127,6 @@ case "apiKey": | ||
case "header": | ||
client.defaults.headers.common[securityDecorator.Name] = value; | ||
properties.headers[securityDecorator.Name] = value; | ||
break; | ||
case "query": | ||
client.defaults.params[securityDecorator.Name] = value; | ||
properties.params[securityDecorator.Name] = value; | ||
break; | ||
@@ -134,3 +136,3 @@ case "cookie": { | ||
var val = value; | ||
client.defaults.headers.common["Cookie"] = "".concat(securityDecoratorName, "=").concat(val); | ||
properties.headers["Cookie"] = "".concat(securityDecoratorName, "=").concat(val); | ||
break; | ||
@@ -143,6 +145,6 @@ } | ||
case "openIdConnect": | ||
client.defaults.headers.common[securityDecorator.Name] = value; | ||
properties.headers[securityDecorator.Name] = value; | ||
break; | ||
case "oauth2": | ||
client.defaults.headers.common[securityDecorator.Name] = value; | ||
properties.headers[securityDecorator.Name] = value; | ||
break; | ||
@@ -154,3 +156,3 @@ case "http": | ||
case "bearer": | ||
client.defaults.headers.common[securityDecorator.Name] = value.toLowerCase().startsWith("bearer ") ? value : "Bearer ".concat(value); | ||
properties.headers[securityDecorator.Name] = value.toLowerCase().startsWith("bearer ") ? value : "Bearer ".concat(value); | ||
break; | ||
@@ -164,5 +166,4 @@ default: | ||
} | ||
return client; | ||
} | ||
function parseBasicAuthScheme(client, scheme) { | ||
function parseBasicAuthScheme(properties, scheme) { | ||
var username, password = ""; | ||
@@ -186,4 +187,3 @@ var fieldNames = Object.getOwnPropertyNames(scheme); | ||
}); | ||
client.defaults.headers.common["Authorization"] = "Basic ".concat(Buffer.from("".concat(username, ":").concat(password)).toString("base64")); | ||
return client; | ||
properties.headers["Authorization"] = "Basic ".concat(Buffer.from("".concat(username, ":").concat(password)).toString('base64')); | ||
} | ||
@@ -190,0 +190,0 @@ var SecurityDecorator = /** @class */ (function () { |
@@ -8,2 +8,6 @@ import * as utils from "../internal/utils"; | ||
*/ | ||
export declare enum DownloadFilesAcceptEnum { | ||
applicationJson = "application/json", | ||
applicationOctetStream = "application/octet-stream" | ||
} | ||
export declare class Files { | ||
@@ -18,3 +22,3 @@ private sdkConfiguration; | ||
*/ | ||
downloadFiles(req: operations.DownloadFilesRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig): Promise<operations.DownloadFilesResponse>; | ||
downloadFiles(req: operations.DownloadFilesRequest, retries?: utils.RetryConfig, config?: AxiosRequestConfig, acceptHeaderOverride?: DownloadFilesAcceptEnum): Promise<operations.DownloadFilesResponse>; | ||
/** | ||
@@ -21,0 +25,0 @@ * List all files uploaded by a company |
@@ -92,4 +92,5 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Files = void 0; | ||
exports.Files = exports.DownloadFilesAcceptEnum = void 0; | ||
var utils = __importStar(require("../internal/utils")); | ||
var errors = __importStar(require("./models/errors")); | ||
var operations = __importStar(require("./models/operations")); | ||
@@ -100,2 +101,7 @@ var shared = __importStar(require("./models/shared")); | ||
*/ | ||
var DownloadFilesAcceptEnum; | ||
(function (DownloadFilesAcceptEnum) { | ||
DownloadFilesAcceptEnum["applicationJson"] = "application/json"; | ||
DownloadFilesAcceptEnum["applicationOctetStream"] = "application/octet-stream"; | ||
})(DownloadFilesAcceptEnum = exports.DownloadFilesAcceptEnum || (exports.DownloadFilesAcceptEnum = {})); | ||
var Files = /** @class */ (function () { | ||
@@ -111,6 +117,6 @@ function Files(sdkConfig) { | ||
*/ | ||
Files.prototype.downloadFiles = function (req, retries, config) { | ||
Files.prototype.downloadFiles = function (req, retries, config, acceptHeaderOverride) { | ||
var _a, _b; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var baseURL, url, client, headers, queryParams, retryConfig, httpRes, contentType, res, decodedRes; | ||
var baseURL, url, client, globalSecurity, properties, headers, queryParams, globalRetryConfig, retryConfig, httpRes, contentType, res, decodedRes; | ||
return __generator(this, function (_c) { | ||
@@ -124,11 +130,32 @@ switch (_c.label) { | ||
url = utils.generateURL(baseURL, "/companies/{companyId}/files/download", req); | ||
client = this.sdkConfiguration.securityClient || this.sdkConfiguration.defaultClient; | ||
headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers); | ||
client = this.sdkConfiguration.defaultClient; | ||
globalSecurity = this.sdkConfiguration.security; | ||
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2]; | ||
return [4 /*yield*/, globalSecurity()]; | ||
case 1: | ||
globalSecurity = _c.sent(); | ||
_c.label = 2; | ||
case 2: | ||
if (!(globalSecurity instanceof utils.SpeakeasyBase)) { | ||
globalSecurity = new shared.Security(globalSecurity); | ||
} | ||
properties = utils.parseSecurityProperties(globalSecurity); | ||
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers); | ||
queryParams = utils.serializeQueryParams(req); | ||
headers["Accept"] = | ||
"application/json;q=1, application/json;q=0.7, application/octet-stream;q=0"; | ||
if (acceptHeaderOverride !== undefined) { | ||
headers["Accept"] = acceptHeaderOverride.toString(); | ||
} | ||
else { | ||
headers["Accept"] = "application/json;q=1, application/octet-stream;q=0"; | ||
} | ||
headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion); | ||
globalRetryConfig = this.sdkConfiguration.retryConfig; | ||
retryConfig = retries; | ||
if (!retryConfig) { | ||
retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true); | ||
if (globalRetryConfig) { | ||
retryConfig = globalRetryConfig; | ||
} | ||
else { | ||
retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true); | ||
} | ||
} | ||
@@ -138,3 +165,3 @@ return [4 /*yield*/, utils.Retry(function () { | ||
}, new utils.Retries(retryConfig, ["408", "429", "5XX"]))]; | ||
case 1: | ||
case 3: | ||
httpRes = _c.sent(); | ||
@@ -156,2 +183,5 @@ 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 : ""; | ||
} | ||
else { | ||
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes); | ||
} | ||
break; | ||
@@ -162,7 +192,13 @@ case [400, 401, 429].includes(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status): | ||
} | ||
else { | ||
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes); | ||
} | ||
break; | ||
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404: | ||
if (utils.matchContentType(contentType, "application/json")) { | ||
res.downloadFiles404ApplicationJSONObject = utils.objectToClass(JSON.parse(decodedRes), operations.DownloadFiles404ApplicationJSON); | ||
res.errorMessage = utils.objectToClass(JSON.parse(decodedRes), operations.DownloadFilesErrorMessage); | ||
} | ||
else { | ||
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes); | ||
} | ||
break; | ||
@@ -184,3 +220,3 @@ } | ||
return __awaiter(this, void 0, void 0, function () { | ||
var baseURL, url, client, headers, retryConfig, httpRes, contentType, res, decodedRes, resFieldDepth; | ||
var baseURL, url, client, globalSecurity, properties, headers, globalRetryConfig, retryConfig, httpRes, contentType, res, decodedRes, resFieldDepth; | ||
return __generator(this, function (_c) { | ||
@@ -194,9 +230,26 @@ switch (_c.label) { | ||
url = utils.generateURL(baseURL, "/companies/{companyId}/files", req); | ||
client = this.sdkConfiguration.securityClient || this.sdkConfiguration.defaultClient; | ||
headers = __assign({}, config === null || config === void 0 ? void 0 : config.headers); | ||
headers["Accept"] = "application/json;q=1, application/json;q=0.7, application/json;q=0"; | ||
client = this.sdkConfiguration.defaultClient; | ||
globalSecurity = this.sdkConfiguration.security; | ||
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2]; | ||
return [4 /*yield*/, globalSecurity()]; | ||
case 1: | ||
globalSecurity = _c.sent(); | ||
_c.label = 2; | ||
case 2: | ||
if (!(globalSecurity instanceof utils.SpeakeasyBase)) { | ||
globalSecurity = new shared.Security(globalSecurity); | ||
} | ||
properties = utils.parseSecurityProperties(globalSecurity); | ||
headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers); | ||
headers["Accept"] = "application/json"; | ||
headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion); | ||
globalRetryConfig = this.sdkConfiguration.retryConfig; | ||
retryConfig = retries; | ||
if (!retryConfig) { | ||
retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true); | ||
if (globalRetryConfig) { | ||
retryConfig = globalRetryConfig; | ||
} | ||
else { | ||
retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true); | ||
} | ||
} | ||
@@ -206,3 +259,3 @@ return [4 /*yield*/, utils.Retry(function () { | ||
}, new utils.Retries(retryConfig, ["408", "429", "5XX"]))]; | ||
case 1: | ||
case 3: | ||
httpRes = _c.sent(); | ||
@@ -226,2 +279,5 @@ 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 : ""; | ||
} | ||
else { | ||
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes); | ||
} | ||
break; | ||
@@ -232,7 +288,13 @@ case [401, 429].includes(httpRes === null || httpRes === void 0 ? void 0 : httpRes.status): | ||
} | ||
else { | ||
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes); | ||
} | ||
break; | ||
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404: | ||
if (utils.matchContentType(contentType, "application/json")) { | ||
res.listFiles404ApplicationJSONObject = utils.objectToClass(JSON.parse(decodedRes), operations.ListFiles404ApplicationJSON); | ||
res.errorMessage = utils.objectToClass(JSON.parse(decodedRes), operations.ListFilesErrorMessage); | ||
} | ||
else { | ||
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes); | ||
} | ||
break; | ||
@@ -260,3 +322,3 @@ } | ||
return __awaiter(this, void 0, void 0, function () { | ||
var baseURL, url, _c, reqBodyHeaders, reqBody, client, headers, retryConfig, httpRes, contentType, res, decodedRes; | ||
var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, globalRetryConfig, retryConfig, httpRes, contentType, res, decodedRes; | ||
var _d; | ||
@@ -280,9 +342,26 @@ return __generator(this, function (_e) { | ||
} | ||
client = this.sdkConfiguration.securityClient || this.sdkConfiguration.defaultClient; | ||
headers = __assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers); | ||
headers["Accept"] = "application/json;q=1, application/json;q=0"; | ||
client = this.sdkConfiguration.defaultClient; | ||
globalSecurity = this.sdkConfiguration.security; | ||
if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2]; | ||
return [4 /*yield*/, globalSecurity()]; | ||
case 1: | ||
globalSecurity = _e.sent(); | ||
_e.label = 2; | ||
case 2: | ||
if (!(globalSecurity instanceof utils.SpeakeasyBase)) { | ||
globalSecurity = new shared.Security(globalSecurity); | ||
} | ||
properties = utils.parseSecurityProperties(globalSecurity); | ||
headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers); | ||
headers["Accept"] = "application/json"; | ||
headers["user-agent"] = "speakeasy-sdk/".concat(this.sdkConfiguration.language, " ").concat(this.sdkConfiguration.sdkVersion, " ").concat(this.sdkConfiguration.genVersion, " ").concat(this.sdkConfiguration.openapiDocVersion); | ||
globalRetryConfig = this.sdkConfiguration.retryConfig; | ||
retryConfig = retries; | ||
if (!retryConfig) { | ||
retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true); | ||
if (globalRetryConfig) { | ||
retryConfig = globalRetryConfig; | ||
} | ||
else { | ||
retryConfig = new utils.RetryConfig("backoff", new utils.BackoffStrategy(500, 60000, 1.5, 3600000), true); | ||
} | ||
} | ||
@@ -292,3 +371,3 @@ return [4 /*yield*/, utils.Retry(function () { | ||
}, new utils.Retries(retryConfig, ["408", "429", "5XX"]))]; | ||
case 1: | ||
case 3: | ||
httpRes = _e.sent(); | ||
@@ -312,7 +391,13 @@ 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 : ""; | ||
} | ||
else { | ||
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes); | ||
} | ||
break; | ||
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 404: | ||
if (utils.matchContentType(contentType, "application/json")) { | ||
res.uploadFiles404ApplicationJSONObject = utils.objectToClass(JSON.parse(decodedRes), operations.UploadFiles404ApplicationJSON); | ||
res.errorMessage = utils.objectToClass(JSON.parse(decodedRes), operations.UploadFilesErrorMessage); | ||
} | ||
else { | ||
throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes); | ||
} | ||
break; | ||
@@ -319,0 +404,0 @@ } |
@@ -17,3 +17,3 @@ import { SpeakeasyBase } from "../../../internal/utils"; | ||
*/ | ||
export declare class DownloadFiles404ApplicationJSON extends SpeakeasyBase { | ||
export declare class DownloadFilesErrorMessage extends SpeakeasyBase { | ||
canBeRetried?: string; | ||
@@ -32,4 +32,2 @@ correlationId?: string; | ||
data?: Uint8Array; | ||
statusCode: number; | ||
rawResponse?: AxiosResponse; | ||
/** | ||
@@ -41,3 +39,5 @@ * One or more of the resources you referenced could not be found. | ||
*/ | ||
downloadFiles404ApplicationJSONObject?: DownloadFiles404ApplicationJSON; | ||
errorMessage?: DownloadFilesErrorMessage; | ||
statusCode: number; | ||
rawResponse?: AxiosResponse; | ||
/** | ||
@@ -44,0 +44,0 @@ * The request made is not valid. |
@@ -53,3 +53,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DownloadFilesResponse = exports.DownloadFiles404ApplicationJSON = exports.DownloadFilesRequest = void 0; | ||
exports.DownloadFilesResponse = exports.DownloadFilesErrorMessage = exports.DownloadFilesRequest = void 0; | ||
var utils_1 = require("../../../internal/utils"); | ||
@@ -80,5 +80,5 @@ var shared = __importStar(require("../shared")); | ||
*/ | ||
var DownloadFiles404ApplicationJSON = /** @class */ (function (_super) { | ||
__extends(DownloadFiles404ApplicationJSON, _super); | ||
function DownloadFiles404ApplicationJSON() { | ||
var DownloadFilesErrorMessage = /** @class */ (function (_super) { | ||
__extends(DownloadFilesErrorMessage, _super); | ||
function DownloadFilesErrorMessage() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
@@ -90,3 +90,3 @@ } | ||
__metadata("design:type", String) | ||
], DownloadFiles404ApplicationJSON.prototype, "canBeRetried", void 0); | ||
], DownloadFilesErrorMessage.prototype, "canBeRetried", void 0); | ||
__decorate([ | ||
@@ -96,3 +96,3 @@ (0, utils_1.SpeakeasyMetadata)(), | ||
__metadata("design:type", String) | ||
], DownloadFiles404ApplicationJSON.prototype, "correlationId", void 0); | ||
], DownloadFilesErrorMessage.prototype, "correlationId", void 0); | ||
__decorate([ | ||
@@ -102,3 +102,3 @@ (0, utils_1.SpeakeasyMetadata)(), | ||
__metadata("design:type", Number) | ||
], DownloadFiles404ApplicationJSON.prototype, "detailedErrorCode", void 0); | ||
], DownloadFilesErrorMessage.prototype, "detailedErrorCode", void 0); | ||
__decorate([ | ||
@@ -108,3 +108,3 @@ (0, utils_1.SpeakeasyMetadata)(), | ||
__metadata("design:type", String) | ||
], DownloadFiles404ApplicationJSON.prototype, "error", void 0); | ||
], DownloadFilesErrorMessage.prototype, "error", void 0); | ||
__decorate([ | ||
@@ -114,3 +114,3 @@ (0, utils_1.SpeakeasyMetadata)(), | ||
__metadata("design:type", String) | ||
], DownloadFiles404ApplicationJSON.prototype, "service", void 0); | ||
], DownloadFilesErrorMessage.prototype, "service", void 0); | ||
__decorate([ | ||
@@ -120,6 +120,6 @@ (0, utils_1.SpeakeasyMetadata)(), | ||
__metadata("design:type", Number) | ||
], DownloadFiles404ApplicationJSON.prototype, "statusCode", void 0); | ||
return DownloadFiles404ApplicationJSON; | ||
], DownloadFilesErrorMessage.prototype, "statusCode", void 0); | ||
return DownloadFilesErrorMessage; | ||
}(utils_1.SpeakeasyBase)); | ||
exports.DownloadFiles404ApplicationJSON = DownloadFiles404ApplicationJSON; | ||
exports.DownloadFilesErrorMessage = DownloadFilesErrorMessage; | ||
var DownloadFilesResponse = /** @class */ (function (_super) { | ||
@@ -140,2 +140,6 @@ __extends(DownloadFilesResponse, _super); | ||
(0, utils_1.SpeakeasyMetadata)(), | ||
__metadata("design:type", DownloadFilesErrorMessage) | ||
], DownloadFilesResponse.prototype, "errorMessage", void 0); | ||
__decorate([ | ||
(0, utils_1.SpeakeasyMetadata)(), | ||
__metadata("design:type", Number) | ||
@@ -149,6 +153,2 @@ ], DownloadFilesResponse.prototype, "statusCode", void 0); | ||
(0, utils_1.SpeakeasyMetadata)(), | ||
__metadata("design:type", DownloadFiles404ApplicationJSON) | ||
], DownloadFilesResponse.prototype, "downloadFiles404ApplicationJSONObject", void 0); | ||
__decorate([ | ||
(0, utils_1.SpeakeasyMetadata)(), | ||
__metadata("design:type", shared.Schema) | ||
@@ -155,0 +155,0 @@ ], DownloadFilesResponse.prototype, "schema", void 0); |
@@ -13,3 +13,3 @@ import { SpeakeasyBase } from "../../../internal/utils"; | ||
*/ | ||
export declare class ListFiles404ApplicationJSON extends SpeakeasyBase { | ||
export declare class ListFilesErrorMessage extends SpeakeasyBase { | ||
canBeRetried?: string; | ||
@@ -25,2 +25,9 @@ correlationId?: string; | ||
/** | ||
* One or more of the resources you referenced could not be found. | ||
* | ||
* @remarks | ||
* This might be because your company or data connection id is wrong, or was already deleted. | ||
*/ | ||
errorMessage?: ListFilesErrorMessage; | ||
/** | ||
* Success | ||
@@ -32,9 +39,2 @@ */ | ||
/** | ||
* One or more of the resources you referenced could not be found. | ||
* | ||
* @remarks | ||
* This might be because your company or data connection id is wrong, or was already deleted. | ||
*/ | ||
listFiles404ApplicationJSONObject?: ListFiles404ApplicationJSON; | ||
/** | ||
* Your API request was not properly authorized. | ||
@@ -41,0 +41,0 @@ */ |
@@ -53,3 +53,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ListFilesResponse = exports.ListFiles404ApplicationJSON = exports.ListFilesRequest = void 0; | ||
exports.ListFilesResponse = exports.ListFilesErrorMessage = exports.ListFilesRequest = void 0; | ||
var utils_1 = require("../../../internal/utils"); | ||
@@ -76,5 +76,5 @@ var shared = __importStar(require("../shared")); | ||
*/ | ||
var ListFiles404ApplicationJSON = /** @class */ (function (_super) { | ||
__extends(ListFiles404ApplicationJSON, _super); | ||
function ListFiles404ApplicationJSON() { | ||
var ListFilesErrorMessage = /** @class */ (function (_super) { | ||
__extends(ListFilesErrorMessage, _super); | ||
function ListFilesErrorMessage() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
@@ -86,3 +86,3 @@ } | ||
__metadata("design:type", String) | ||
], ListFiles404ApplicationJSON.prototype, "canBeRetried", void 0); | ||
], ListFilesErrorMessage.prototype, "canBeRetried", void 0); | ||
__decorate([ | ||
@@ -92,3 +92,3 @@ (0, utils_1.SpeakeasyMetadata)(), | ||
__metadata("design:type", String) | ||
], ListFiles404ApplicationJSON.prototype, "correlationId", void 0); | ||
], ListFilesErrorMessage.prototype, "correlationId", void 0); | ||
__decorate([ | ||
@@ -98,3 +98,3 @@ (0, utils_1.SpeakeasyMetadata)(), | ||
__metadata("design:type", Number) | ||
], ListFiles404ApplicationJSON.prototype, "detailedErrorCode", void 0); | ||
], ListFilesErrorMessage.prototype, "detailedErrorCode", void 0); | ||
__decorate([ | ||
@@ -104,3 +104,3 @@ (0, utils_1.SpeakeasyMetadata)(), | ||
__metadata("design:type", String) | ||
], ListFiles404ApplicationJSON.prototype, "error", void 0); | ||
], ListFilesErrorMessage.prototype, "error", void 0); | ||
__decorate([ | ||
@@ -110,3 +110,3 @@ (0, utils_1.SpeakeasyMetadata)(), | ||
__metadata("design:type", String) | ||
], ListFiles404ApplicationJSON.prototype, "service", void 0); | ||
], ListFilesErrorMessage.prototype, "service", void 0); | ||
__decorate([ | ||
@@ -116,6 +116,6 @@ (0, utils_1.SpeakeasyMetadata)(), | ||
__metadata("design:type", Number) | ||
], ListFiles404ApplicationJSON.prototype, "statusCode", void 0); | ||
return ListFiles404ApplicationJSON; | ||
], ListFilesErrorMessage.prototype, "statusCode", void 0); | ||
return ListFilesErrorMessage; | ||
}(utils_1.SpeakeasyBase)); | ||
exports.ListFiles404ApplicationJSON = ListFiles404ApplicationJSON; | ||
exports.ListFilesErrorMessage = ListFilesErrorMessage; | ||
var ListFilesResponse = /** @class */ (function (_super) { | ||
@@ -131,2 +131,6 @@ __extends(ListFilesResponse, _super); | ||
__decorate([ | ||
(0, utils_1.SpeakeasyMetadata)(), | ||
__metadata("design:type", ListFilesErrorMessage) | ||
], ListFilesResponse.prototype, "errorMessage", void 0); | ||
__decorate([ | ||
(0, utils_1.SpeakeasyMetadata)({ elemType: shared.File }), | ||
@@ -145,6 +149,2 @@ __metadata("design:type", Array) | ||
(0, utils_1.SpeakeasyMetadata)(), | ||
__metadata("design:type", ListFiles404ApplicationJSON) | ||
], ListFilesResponse.prototype, "listFiles404ApplicationJSONObject", void 0); | ||
__decorate([ | ||
(0, utils_1.SpeakeasyMetadata)(), | ||
__metadata("design:type", shared.Schema) | ||
@@ -151,0 +151,0 @@ ], ListFilesResponse.prototype, "schema", void 0); |
@@ -19,3 +19,3 @@ import { SpeakeasyBase } from "../../../internal/utils"; | ||
*/ | ||
export declare class UploadFiles404ApplicationJSON extends SpeakeasyBase { | ||
export declare class UploadFilesErrorMessage extends SpeakeasyBase { | ||
canBeRetried?: string; | ||
@@ -30,2 +30,9 @@ correlationId?: string; | ||
contentType: string; | ||
/** | ||
* One or more of the resources you referenced could not be found. | ||
* | ||
* @remarks | ||
* This might be because your company or data connection id is wrong, or was already deleted. | ||
*/ | ||
errorMessage?: UploadFilesErrorMessage; | ||
statusCode: number; | ||
@@ -37,9 +44,2 @@ rawResponse?: AxiosResponse; | ||
schema?: shared.Schema; | ||
/** | ||
* One or more of the resources you referenced could not be found. | ||
* | ||
* @remarks | ||
* This might be because your company or data connection id is wrong, or was already deleted. | ||
*/ | ||
uploadFiles404ApplicationJSONObject?: UploadFiles404ApplicationJSON; | ||
} |
@@ -53,3 +53,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.UploadFilesResponse = exports.UploadFiles404ApplicationJSON = exports.UploadFilesRequest = exports.UploadFilesRequestBody = void 0; | ||
exports.UploadFilesResponse = exports.UploadFilesErrorMessage = exports.UploadFilesRequest = exports.UploadFilesRequestBody = void 0; | ||
var utils_1 = require("../../../internal/utils"); | ||
@@ -102,5 +102,5 @@ var shared = __importStar(require("../shared")); | ||
*/ | ||
var UploadFiles404ApplicationJSON = /** @class */ (function (_super) { | ||
__extends(UploadFiles404ApplicationJSON, _super); | ||
function UploadFiles404ApplicationJSON() { | ||
var UploadFilesErrorMessage = /** @class */ (function (_super) { | ||
__extends(UploadFilesErrorMessage, _super); | ||
function UploadFilesErrorMessage() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
@@ -112,3 +112,3 @@ } | ||
__metadata("design:type", String) | ||
], UploadFiles404ApplicationJSON.prototype, "canBeRetried", void 0); | ||
], UploadFilesErrorMessage.prototype, "canBeRetried", void 0); | ||
__decorate([ | ||
@@ -118,3 +118,3 @@ (0, utils_1.SpeakeasyMetadata)(), | ||
__metadata("design:type", String) | ||
], UploadFiles404ApplicationJSON.prototype, "correlationId", void 0); | ||
], UploadFilesErrorMessage.prototype, "correlationId", void 0); | ||
__decorate([ | ||
@@ -124,3 +124,3 @@ (0, utils_1.SpeakeasyMetadata)(), | ||
__metadata("design:type", Number) | ||
], UploadFiles404ApplicationJSON.prototype, "detailedErrorCode", void 0); | ||
], UploadFilesErrorMessage.prototype, "detailedErrorCode", void 0); | ||
__decorate([ | ||
@@ -130,3 +130,3 @@ (0, utils_1.SpeakeasyMetadata)(), | ||
__metadata("design:type", String) | ||
], UploadFiles404ApplicationJSON.prototype, "error", void 0); | ||
], UploadFilesErrorMessage.prototype, "error", void 0); | ||
__decorate([ | ||
@@ -136,3 +136,3 @@ (0, utils_1.SpeakeasyMetadata)(), | ||
__metadata("design:type", String) | ||
], UploadFiles404ApplicationJSON.prototype, "service", void 0); | ||
], UploadFilesErrorMessage.prototype, "service", void 0); | ||
__decorate([ | ||
@@ -142,6 +142,6 @@ (0, utils_1.SpeakeasyMetadata)(), | ||
__metadata("design:type", Number) | ||
], UploadFiles404ApplicationJSON.prototype, "statusCode", void 0); | ||
return UploadFiles404ApplicationJSON; | ||
], UploadFilesErrorMessage.prototype, "statusCode", void 0); | ||
return UploadFilesErrorMessage; | ||
}(utils_1.SpeakeasyBase)); | ||
exports.UploadFiles404ApplicationJSON = UploadFiles404ApplicationJSON; | ||
exports.UploadFilesErrorMessage = UploadFilesErrorMessage; | ||
var UploadFilesResponse = /** @class */ (function (_super) { | ||
@@ -158,2 +158,6 @@ __extends(UploadFilesResponse, _super); | ||
(0, utils_1.SpeakeasyMetadata)(), | ||
__metadata("design:type", UploadFilesErrorMessage) | ||
], UploadFilesResponse.prototype, "errorMessage", void 0); | ||
__decorate([ | ||
(0, utils_1.SpeakeasyMetadata)(), | ||
__metadata("design:type", Number) | ||
@@ -169,8 +173,4 @@ ], UploadFilesResponse.prototype, "statusCode", void 0); | ||
], UploadFilesResponse.prototype, "schema", void 0); | ||
__decorate([ | ||
(0, utils_1.SpeakeasyMetadata)(), | ||
__metadata("design:type", UploadFiles404ApplicationJSON) | ||
], UploadFilesResponse.prototype, "uploadFiles404ApplicationJSONObject", void 0); | ||
return UploadFilesResponse; | ||
}(utils_1.SpeakeasyBase)); | ||
exports.UploadFilesResponse = UploadFilesResponse; |
import { SpeakeasyBase } from "../../../internal/utils"; | ||
/** | ||
* The request made is not valid. | ||
*/ | ||
export declare class Schema extends SpeakeasyBase { | ||
@@ -6,0 +3,0 @@ canBeRetried?: string; |
@@ -33,5 +33,2 @@ "use strict"; | ||
var class_transformer_1 = require("class-transformer"); | ||
/** | ||
* The request made is not valid. | ||
*/ | ||
var Schema = /** @class */ (function (_super) { | ||
@@ -38,0 +35,0 @@ __extends(Schema, _super); |
@@ -0,1 +1,2 @@ | ||
import * as utils from "../internal/utils"; | ||
import { Files } from "./files"; | ||
@@ -15,3 +16,3 @@ import * as shared from "./models/shared"; | ||
*/ | ||
security?: shared.Security; | ||
security?: shared.Security | (() => Promise<shared.Security>); | ||
/** | ||
@@ -29,6 +30,10 @@ * Allows overriding the default axios client used by the SDK | ||
serverURL?: string; | ||
/** | ||
* Allows overriding the default retry config used by the SDK | ||
*/ | ||
retryConfig?: utils.RetryConfig; | ||
}; | ||
export declare class SDKConfiguration { | ||
defaultClient: AxiosInstance; | ||
securityClient: AxiosInstance; | ||
security?: shared.Security | (() => Promise<shared.Security>); | ||
serverURL: string; | ||
@@ -40,12 +45,13 @@ serverDefaults: any; | ||
genVersion: string; | ||
retryConfig?: utils.RetryConfig; | ||
constructor(init?: Partial<SDKConfiguration>); | ||
} | ||
/** | ||
* Files API: An API for uploading and downloading files from 'File Upload' Integrations. | ||
* Files API: A flexible API for pulling accounting data, normalized and aggregated from 20 accounting integrations. | ||
* | ||
* @remarks | ||
* | ||
* The Accounting file upload, Banking file upload, and Business documents file upload integrations provide simple file upload functionality. | ||
* Standardize how you connect to your customers’ accounting software. View, create, update, and delete data in the same way for all the leading accounting platforms. | ||
* | ||
* [Read more...](https://docs.codat.io/other/file-upload) | ||
* [Read more...](https://docs.codat.io/accounting-api/overview) | ||
* | ||
@@ -52,0 +58,0 @@ * [See our OpenAPI spec](https://github.com/codatio/oas) |
@@ -5,25 +5,2 @@ "use strict"; | ||
*/ | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -34,5 +11,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
exports.CodatFiles = exports.SDKConfiguration = exports.ServerList = void 0; | ||
var utils = __importStar(require("../internal/utils")); | ||
var files_1 = require("./files"); | ||
var shared = __importStar(require("./models/shared")); | ||
var axios_1 = __importDefault(require("axios")); | ||
@@ -51,5 +26,5 @@ /** | ||
this.language = "typescript"; | ||
this.openapiDocVersion = "2.1.0"; | ||
this.sdkVersion = "0.33.1"; | ||
this.genVersion = "2.58.0"; | ||
this.openapiDocVersion = "3.0.0"; | ||
this.sdkVersion = "0.34.0"; | ||
this.genVersion = "2.108.3"; | ||
Object.assign(this, init); | ||
@@ -61,9 +36,9 @@ } | ||
/** | ||
* Files API: An API for uploading and downloading files from 'File Upload' Integrations. | ||
* Files API: A flexible API for pulling accounting data, normalized and aggregated from 20 accounting integrations. | ||
* | ||
* @remarks | ||
* | ||
* The Accounting file upload, Banking file upload, and Business documents file upload integrations provide simple file upload functionality. | ||
* Standardize how you connect to your customers’ accounting software. View, create, update, and delete data in the same way for all the leading accounting platforms. | ||
* | ||
* [Read more...](https://docs.codat.io/other/file-upload) | ||
* [Read more...](https://docs.codat.io/accounting-api/overview) | ||
* | ||
@@ -81,14 +56,7 @@ * [See our OpenAPI spec](https://github.com/codatio/oas) | ||
var defaultClient = (_b = props === null || props === void 0 ? void 0 : props.defaultClient) !== null && _b !== void 0 ? _b : axios_1.default.create({ baseURL: serverURL }); | ||
var securityClient = defaultClient; | ||
if (props === null || props === void 0 ? void 0 : props.security) { | ||
var security = props.security; | ||
if (!(props.security instanceof utils.SpeakeasyBase)) { | ||
security = new shared.Security(props.security); | ||
} | ||
securityClient = utils.createSecurityClient(defaultClient, security); | ||
} | ||
this.sdkConfiguration = new SDKConfiguration({ | ||
defaultClient: defaultClient, | ||
securityClient: securityClient, | ||
security: props === null || props === void 0 ? void 0 : props.security, | ||
serverURL: serverURL, | ||
retryConfig: props === null || props === void 0 ? void 0 : props.retryConfig, | ||
}); | ||
@@ -95,0 +63,0 @@ this.files = new files_1.Files(this.sdkConfiguration); |
{ | ||
"name": "@codat/files", | ||
"version": "0.33.1", | ||
"author": "Speakeasy", | ||
"version": "0.34.0", | ||
"author": "Codat", | ||
"scripts": { | ||
@@ -26,2 +26,3 @@ "prepare": "tsc --build" | ||
"dist", | ||
"docs", | ||
"README.md" | ||
@@ -32,4 +33,4 @@ ], | ||
"url": "https://github.com/codatio/client-sdk-typescript.git", | ||
"directory": "files" | ||
"directory": "previous-versions/files" | ||
} | ||
} |
@@ -1,4 +0,5 @@ | ||
# @codat/files | ||
# Files | ||
Use Codat's Files API to upload your SMB customers' files. | ||
<!-- Start SDK Installation --> | ||
## SDK Installation | ||
@@ -16,7 +17,9 @@ | ||
yarn add @codat/files | ||
``` | ||
```<!-- Start SDK Installation --> | ||
<!-- End SDK Installation --> | ||
## SDK Example Usage | ||
<!-- Start SDK Example Usage --> | ||
## Example Usage | ||
```typescript | ||
@@ -40,6 +43,6 @@ import { CodatFiles } from "@codat/files"; | ||
}); | ||
``` | ||
```<!-- Start SDK Example Usage --> | ||
<!-- End SDK Example Usage --> | ||
<!-- Start SDK Available Operations --> | ||
## Available Resources and Operations | ||
@@ -52,5 +55,5 @@ | ||
* [listFiles](docs/sdks/files/README.md#listfiles) - List all files uploaded by a company | ||
* [uploadFiles](docs/sdks/files/README.md#uploadfiles) - Upload files for a company | ||
* [uploadFiles](docs/sdks/files/README.md#uploadfiles) - Upload files for a company<!-- Start SDK Available Operations --> | ||
<!-- End SDK Available Operations --> | ||
### SDK Generated by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks) | ||
### Library generated by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks) |
199736
68
3207
57