sarga-cardano-wallet-js-dist/base.js
2023-08-08 01:20:23 +02:00

67 lines
2.0 KiB
JavaScript

"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
// Some imports not used depending on template conditions
// @ts-ignore
var axios_1 = require("axios");
exports.BASE_PATH = 'https://localhost:8090/v2/'.replace(/\/+$/, '');
/**
*
* @export
*/
exports.COLLECTION_FORMATS = {
csv: ',',
ssv: ' ',
tsv: '\t',
pipes: '|'
};
/**
*
* @export
* @class BaseAPI
*/
var BaseAPI = /** @class */ (function () {
function BaseAPI(configuration, basePath, axios) {
if (basePath === void 0) { basePath = exports.BASE_PATH; }
if (axios === void 0) { axios = axios_1.default; }
this.basePath = basePath;
this.axios = axios;
if (configuration) {
this.configuration = configuration;
this.basePath = configuration.basePath || this.basePath;
}
}
return BaseAPI;
}());
exports.BaseAPI = BaseAPI;
/**
*
* @export
* @class RequiredError
* @extends {Error}
*/
var RequiredError = /** @class */ (function (_super) {
__extends(RequiredError, _super);
function RequiredError(field, msg) {
var _this = _super.call(this, msg) || this;
_this.field = field;
_this.name = 'RequiredError';
return _this;
}
return RequiredError;
}(Error));
exports.RequiredError = RequiredError;
//# sourceMappingURL=base.js.map