@cardscan.ai/cardscan-client
Version:
Typescript client for the CardScan API
92 lines (91 loc) • 2.16 kB
JavaScript
;
/* tslint:disable */
/* eslint-disable */
/**
* CardScan API
* The official documentation for the CardScan API Clients.
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.operationServerMap = exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
const axios_1 = __importDefault(require("axios"));
exports.BASE_PATH = "https://sandbox.cardscan.ai/v1".replace(/\/+$/, "");
/**
*
* @export
*/
exports.COLLECTION_FORMATS = {
csv: ",",
ssv: " ",
tsv: "\t",
pipes: "|",
};
class Logging {
constructor(config) {
this.configuration = config;
}
log(msg, level) {
if (this.configuration) {
this.configuration.log(msg, level);
}
}
info(msg) {
this.log(msg, "info");
}
error(msg) {
this.log(msg, "error");
}
debug(msg) {
this.log(msg, "debug");
}
warn(msg) {
this.log(msg, "warn");
}
}
/**
*
* @export
* @class BaseAPI
*/
class BaseAPI extends Logging {
constructor(configuration, basePath = exports.BASE_PATH, axios = axios_1.default) {
var _a;
super(configuration);
this.basePath = basePath;
this.axios = axios;
if (configuration) {
this.configuration = configuration;
this.basePath = (_a = configuration.basePath) !== null && _a !== void 0 ? _a : basePath;
}
}
}
exports.BaseAPI = BaseAPI;
;
/**
*
* @export
* @class RequiredError
* @extends {Error}
*/
class RequiredError extends Error {
constructor(field, msg) {
super(msg);
this.field = field;
this.name = "RequiredError";
}
}
exports.RequiredError = RequiredError;
/**
*
* @export
*/
exports.operationServerMap = {};