UNPKG

@kloutit/kloutit-sdk

Version:
116 lines (115 loc) 3.87 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * API Reference * The Kloutit API is organized around [REST](https://en.wikipedia.org/wiki/REST), it accepts and returns [JSON-encoded](https://www.json.org) bodies, returning standard [HTTP response codes](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes). You can interact with the API directly using your preferred HTTP/REST library. * * The version of the OpenAPI document: 2.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 __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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); 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.operationServerMap = exports.RequiredError = exports.BaseAPI = exports.KloutitEnvironment = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0; var axios_1 = require("axios"); exports.BASE_PATH = "http://localhost".replace(/\/+$/, ""); /** * * @export */ exports.COLLECTION_FORMATS = { csv: ",", ssv: " ", tsv: "\t", pipes: "|", }; /** * * @export */ var KloutitEnvironment; (function (KloutitEnvironment) { KloutitEnvironment["development"] = "development"; KloutitEnvironment["production"] = "production"; })(KloutitEnvironment = exports.KloutitEnvironment || (exports.KloutitEnvironment = {})); /** * * @export * @class BaseAPI */ var BaseAPI = /** @class */ (function () { function BaseAPI(configuration, axios) { this.axios = axios; if (configuration) { this.configuration = configuration; this.axios = axios_1.default; this.axios.defaults.headers.common['x-api-key'] = this.configuration.apiKey; if (configuration === null || configuration === void 0 ? void 0 : configuration.basePath) { this.basePath = configuration.basePath; } else { this.basePath = this.getBasePath(KloutitEnvironment.production); } this.axios.defaults.baseURL = this.basePath; } else { this.axios = axios; } } /** * Get the base path based on the environment. * @param environment The environment ('development' or 'production'). * @returns The base path for the API. */ BaseAPI.prototype.getBasePath = function (environment) { var basePaths = { development: 'https://dev.clients-api.kloutit.com', production: 'https://clients-api.kloutit.com' }; return basePaths[environment]; }; 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; /** * * @export */ exports.operationServerMap = {};