@devmehq/sdk-js
Version:
DEV.ME SDK for JavaScript & TypeScript for Server & Browser, Compatible with Node.js & React & Vue.js & Angular
1,017 lines (1,016 loc) • 82.5 kB
JavaScript
"use strict";
/**
* DEV.ME API Documentation
* DEV.ME API Documentation [Currency Conversion and Exchange Rates API](https://dev.me/products/currency) - [IP2Location, IP Country, IP Information API](https://dev.me/products/ip) - [Email Validation, Mailbox Verification](https://dev.me/products/email) - [Phone Number Validation](https://dev.me/products/phone). You can learn more at [dev.me](https://dev.me). For this example you can use api key `demo-key` to test the APIs
*
* The version of the OpenAPI document: 1.0.0
* Contact: support@dev.me
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.UtilsApi = exports.UtilsApiFactory = exports.UtilsApiFp = exports.UtilsApiAxiosParamCreator = exports.UrlScraperApi = exports.UrlScraperApiFactory = exports.UrlScraperApiFp = exports.UrlScraperApiAxiosParamCreator = exports.ShortUrlApi = exports.ShortUrlApiFactory = exports.ShortUrlApiFp = exports.ShortUrlApiAxiosParamCreator = exports.PhoneApi = exports.PhoneApiFactory = exports.PhoneApiFp = exports.PhoneApiAxiosParamCreator = exports.ImageApi = exports.ImageApiFactory = exports.ImageApiFp = exports.ImageApiAxiosParamCreator = exports.IPApi = exports.IPApiFactory = exports.IPApiFp = exports.IPApiAxiosParamCreator = exports.EmailApi = exports.EmailApiFactory = exports.EmailApiFp = exports.EmailApiAxiosParamCreator = exports.DomainApi = exports.DomainApiFactory = exports.DomainApiFp = exports.DomainApiAxiosParamCreator = exports.CurrencyApi = exports.CurrencyApiFactory = exports.CurrencyApiFp = exports.CurrencyApiAxiosParamCreator = exports.CountryApi = exports.CountryApiFactory = exports.CountryApiFp = exports.CountryApiAxiosParamCreator = exports.ListCurrenciesItemTypeEnum = void 0;
const axios_1 = __importDefault(require("axios"));
// Some imports not used depending on template conditions
const common_1 = require("./common");
const base_1 = require("./base");
exports.ListCurrenciesItemTypeEnum = {
Fiat: 'fiat',
Crypto: 'crypto',
};
/**
* CountryApi - axios parameter creator
* @export
*/
const CountryApiAxiosParamCreator = function (configuration) {
return {
/**
* Get country facts and information
* @param {string} code code - country code ISO 4217
* @param {Array<string>} [expand] expand - expand properties
* @param {Array<string>} [exclude] exclude - exclude properties
* @param {'en' | 'ar' | 'de' | 'es' | 'fr' | 'ja' | 'ko' | 'pt' | 'ru'} [language] language - localisation language
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1GetCountryDetails: async (code, expand, exclude, language, options = {}) => {
// verify required parameter 'code' is not null or undefined
(0, common_1.assertParamExists)('v1GetCountryDetails', 'code', code);
const localVarPath = `/v1-get-country-details`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication APIKeyHeader required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, 'x-api-key', configuration);
// authentication APIKeyQueryParam required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'x-api-key', configuration);
if (code !== undefined) {
localVarQueryParameter['code'] = code;
}
if (expand) {
localVarQueryParameter['expand'] = expand;
}
if (exclude) {
localVarQueryParameter['exclude'] = exclude;
}
if (language !== undefined) {
localVarQueryParameter['language'] = language;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Get list of all countries
* @param {Array<string>} [code] code - country code ISO 4217
* @param {Array<string>} [expand] expand - expand properties
* @param {Array<string>} [exclude] exclude - exclude properties
* @param {'en' | 'ar' | 'de' | 'es' | 'fr' | 'ja' | 'ko' | 'pt' | 'ru'} [language] language - localisation language
* @param {Array<string>} [sort] sort - sort properties
* @param {string} [page] page - page number
* @param {string} [pageSize] pageSize - page size
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1ListCountries: async (code, expand, exclude, language, sort, page, pageSize, options = {}) => {
const localVarPath = `/v1-list-countries`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication APIKeyHeader required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, 'x-api-key', configuration);
// authentication APIKeyQueryParam required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'x-api-key', configuration);
if (code) {
localVarQueryParameter['code'] = code;
}
if (expand) {
localVarQueryParameter['expand'] = expand;
}
if (exclude) {
localVarQueryParameter['exclude'] = exclude;
}
if (language !== undefined) {
localVarQueryParameter['language'] = language;
}
if (sort) {
localVarQueryParameter['sort'] = sort;
}
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (pageSize !== undefined) {
localVarQueryParameter['pageSize'] = pageSize;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};
exports.CountryApiAxiosParamCreator = CountryApiAxiosParamCreator;
/**
* CountryApi - functional programming interface
* @export
*/
const CountryApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.CountryApiAxiosParamCreator)(configuration);
return {
/**
* Get country facts and information
* @param {string} code code - country code ISO 4217
* @param {Array<string>} [expand] expand - expand properties
* @param {Array<string>} [exclude] exclude - exclude properties
* @param {'en' | 'ar' | 'de' | 'es' | 'fr' | 'ja' | 'ko' | 'pt' | 'ru'} [language] language - localisation language
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async v1GetCountryDetails(code, expand, exclude, language, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.v1GetCountryDetails(code, expand, exclude, language, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Get list of all countries
* @param {Array<string>} [code] code - country code ISO 4217
* @param {Array<string>} [expand] expand - expand properties
* @param {Array<string>} [exclude] exclude - exclude properties
* @param {'en' | 'ar' | 'de' | 'es' | 'fr' | 'ja' | 'ko' | 'pt' | 'ru'} [language] language - localisation language
* @param {Array<string>} [sort] sort - sort properties
* @param {string} [page] page - page number
* @param {string} [pageSize] pageSize - page size
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async v1ListCountries(code, expand, exclude, language, sort, page, pageSize, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.v1ListCountries(code, expand, exclude, language, sort, page, pageSize, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
};
};
exports.CountryApiFp = CountryApiFp;
/**
* CountryApi - factory interface
* @export
*/
const CountryApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.CountryApiFp)(configuration);
return {
/**
* Get country facts and information
* @param {string} code code - country code ISO 4217
* @param {Array<string>} [expand] expand - expand properties
* @param {Array<string>} [exclude] exclude - exclude properties
* @param {'en' | 'ar' | 'de' | 'es' | 'fr' | 'ja' | 'ko' | 'pt' | 'ru'} [language] language - localisation language
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1GetCountryDetails(code, expand, exclude, language, options) {
return localVarFp
.v1GetCountryDetails(code, expand, exclude, language, options)
.then((request) => request(axios, basePath));
},
/**
* Get list of all countries
* @param {Array<string>} [code] code - country code ISO 4217
* @param {Array<string>} [expand] expand - expand properties
* @param {Array<string>} [exclude] exclude - exclude properties
* @param {'en' | 'ar' | 'de' | 'es' | 'fr' | 'ja' | 'ko' | 'pt' | 'ru'} [language] language - localisation language
* @param {Array<string>} [sort] sort - sort properties
* @param {string} [page] page - page number
* @param {string} [pageSize] pageSize - page size
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1ListCountries(code, expand, exclude, language, sort, page, pageSize, options) {
return localVarFp
.v1ListCountries(code, expand, exclude, language, sort, page, pageSize, options)
.then((request) => request(axios, basePath));
},
};
};
exports.CountryApiFactory = CountryApiFactory;
/**
* CountryApi
* @export
* @class CountryApi
* @extends {BaseAPI}
*/
class CountryApi extends base_1.BaseAPI {
/**
* Get country facts and information
* @param {CountryApiV1GetCountryDetailsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CountryApi
*/
v1GetCountryDetails(requestParameters, options) {
return (0, exports.CountryApiFp)(this.configuration)
.v1GetCountryDetails(requestParameters.code, requestParameters.expand, requestParameters.exclude, requestParameters.language, options)
.then((request) => request(this.axios, this.basePath));
}
/**
* Get list of all countries
* @param {CountryApiV1ListCountriesRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CountryApi
*/
v1ListCountries(requestParameters = {}, options) {
return (0, exports.CountryApiFp)(this.configuration)
.v1ListCountries(requestParameters.code, requestParameters.expand, requestParameters.exclude, requestParameters.language, requestParameters.sort, requestParameters.page, requestParameters.pageSize, options)
.then((request) => request(this.axios, this.basePath));
}
}
exports.CountryApi = CountryApi;
/**
* CurrencyApi - axios parameter creator
* @export
*/
const CurrencyApiAxiosParamCreator = function (configuration) {
return {
/**
* Convert currency to another currency
* @param {string} from from - currency to convert from
* @param {string} to to - currency to convert to
* @param {number} [amount] amount - amount to convert
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1ConvertCurrency: async (from, to, amount, options = {}) => {
// verify required parameter 'from' is not null or undefined
(0, common_1.assertParamExists)('v1ConvertCurrency', 'from', from);
// verify required parameter 'to' is not null or undefined
(0, common_1.assertParamExists)('v1ConvertCurrency', 'to', to);
const localVarPath = `/v1-convert-currency`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication APIKeyHeader required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, 'x-api-key', configuration);
// authentication APIKeyQueryParam required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'x-api-key', configuration);
if (amount !== undefined) {
localVarQueryParameter['amount'] = amount;
}
if (from !== undefined) {
localVarQueryParameter['from'] = from;
}
if (to !== undefined) {
localVarQueryParameter['to'] = to;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Get currency facts and information
* @param {string} code code - currency code ISO 4217
* @param {Array<string>} [expand] expand - expand properties
* @param {Array<string>} [exclude] exclude - exclude properties
* @param {'en' | 'ar' | 'de' | 'es' | 'fr' | 'ja' | 'ko' | 'pt' | 'ru'} [language] language - localisation language
* @param {'fiat' | 'crypto'} [type] type - type of currency
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1GetCurrencyDetails: async (code, expand, exclude, language, type, options = {}) => {
// verify required parameter 'code' is not null or undefined
(0, common_1.assertParamExists)('v1GetCurrencyDetails', 'code', code);
const localVarPath = `/v1-get-currency-details`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication APIKeyHeader required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, 'x-api-key', configuration);
// authentication APIKeyQueryParam required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'x-api-key', configuration);
if (code !== undefined) {
localVarQueryParameter['code'] = code;
}
if (expand) {
localVarQueryParameter['expand'] = expand;
}
if (exclude) {
localVarQueryParameter['exclude'] = exclude;
}
if (language !== undefined) {
localVarQueryParameter['language'] = language;
}
if (type !== undefined) {
localVarQueryParameter['type'] = type;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Get exchange rate for a currency
* @param {string} from from - currency to get exchange rate from
* @param {string} to to - currency to get exchange rate to
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1GetCurrencyExchangeRate: async (from, to, options = {}) => {
// verify required parameter 'from' is not null or undefined
(0, common_1.assertParamExists)('v1GetCurrencyExchangeRate', 'from', from);
// verify required parameter 'to' is not null or undefined
(0, common_1.assertParamExists)('v1GetCurrencyExchangeRate', 'to', to);
const localVarPath = `/v1-get-currency-exchange-rate`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication APIKeyHeader required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, 'x-api-key', configuration);
// authentication APIKeyQueryParam required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'x-api-key', configuration);
if (from !== undefined) {
localVarQueryParameter['from'] = from;
}
if (to !== undefined) {
localVarQueryParameter['to'] = to;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Get list of all currencies
* @param {Array<string>} [code] code - currency code ISO 4217
* @param {Array<string>} [expand] expand - expand properties
* @param {Array<string>} [exclude] exclude - exclude properties
* @param {'en' | 'ar' | 'de' | 'es' | 'fr' | 'ja' | 'ko' | 'pt' | 'ru'} [language] language - localisation language
* @param {'fiat' | 'crypto'} [type] type - type of currency
* @param {Array<string>} [sort] sort - sort properties
* @param {string} [page] page - page number
* @param {string} [pageSize] pageSize - page size
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1ListCurrencies: async (code, expand, exclude, language, type, sort, page, pageSize, options = {}) => {
const localVarPath = `/v1-list-currencies`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication APIKeyHeader required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, 'x-api-key', configuration);
// authentication APIKeyQueryParam required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'x-api-key', configuration);
if (code) {
localVarQueryParameter['code'] = code;
}
if (expand) {
localVarQueryParameter['expand'] = expand;
}
if (exclude) {
localVarQueryParameter['exclude'] = exclude;
}
if (language !== undefined) {
localVarQueryParameter['language'] = language;
}
if (type !== undefined) {
localVarQueryParameter['type'] = type;
}
if (sort) {
localVarQueryParameter['sort'] = sort;
}
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (pageSize !== undefined) {
localVarQueryParameter['pageSize'] = pageSize;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};
exports.CurrencyApiAxiosParamCreator = CurrencyApiAxiosParamCreator;
/**
* CurrencyApi - functional programming interface
* @export
*/
const CurrencyApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.CurrencyApiAxiosParamCreator)(configuration);
return {
/**
* Convert currency to another currency
* @param {string} from from - currency to convert from
* @param {string} to to - currency to convert to
* @param {number} [amount] amount - amount to convert
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async v1ConvertCurrency(from, to, amount, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.v1ConvertCurrency(from, to, amount, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Get currency facts and information
* @param {string} code code - currency code ISO 4217
* @param {Array<string>} [expand] expand - expand properties
* @param {Array<string>} [exclude] exclude - exclude properties
* @param {'en' | 'ar' | 'de' | 'es' | 'fr' | 'ja' | 'ko' | 'pt' | 'ru'} [language] language - localisation language
* @param {'fiat' | 'crypto'} [type] type - type of currency
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async v1GetCurrencyDetails(code, expand, exclude, language, type, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.v1GetCurrencyDetails(code, expand, exclude, language, type, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Get exchange rate for a currency
* @param {string} from from - currency to get exchange rate from
* @param {string} to to - currency to get exchange rate to
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async v1GetCurrencyExchangeRate(from, to, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.v1GetCurrencyExchangeRate(from, to, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Get list of all currencies
* @param {Array<string>} [code] code - currency code ISO 4217
* @param {Array<string>} [expand] expand - expand properties
* @param {Array<string>} [exclude] exclude - exclude properties
* @param {'en' | 'ar' | 'de' | 'es' | 'fr' | 'ja' | 'ko' | 'pt' | 'ru'} [language] language - localisation language
* @param {'fiat' | 'crypto'} [type] type - type of currency
* @param {Array<string>} [sort] sort - sort properties
* @param {string} [page] page - page number
* @param {string} [pageSize] pageSize - page size
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async v1ListCurrencies(code, expand, exclude, language, type, sort, page, pageSize, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.v1ListCurrencies(code, expand, exclude, language, type, sort, page, pageSize, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
};
};
exports.CurrencyApiFp = CurrencyApiFp;
/**
* CurrencyApi - factory interface
* @export
*/
const CurrencyApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.CurrencyApiFp)(configuration);
return {
/**
* Convert currency to another currency
* @param {string} from from - currency to convert from
* @param {string} to to - currency to convert to
* @param {number} [amount] amount - amount to convert
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1ConvertCurrency(from, to, amount, options) {
return localVarFp.v1ConvertCurrency(from, to, amount, options).then((request) => request(axios, basePath));
},
/**
* Get currency facts and information
* @param {string} code code - currency code ISO 4217
* @param {Array<string>} [expand] expand - expand properties
* @param {Array<string>} [exclude] exclude - exclude properties
* @param {'en' | 'ar' | 'de' | 'es' | 'fr' | 'ja' | 'ko' | 'pt' | 'ru'} [language] language - localisation language
* @param {'fiat' | 'crypto'} [type] type - type of currency
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1GetCurrencyDetails(code, expand, exclude, language, type, options) {
return localVarFp
.v1GetCurrencyDetails(code, expand, exclude, language, type, options)
.then((request) => request(axios, basePath));
},
/**
* Get exchange rate for a currency
* @param {string} from from - currency to get exchange rate from
* @param {string} to to - currency to get exchange rate to
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1GetCurrencyExchangeRate(from, to, options) {
return localVarFp.v1GetCurrencyExchangeRate(from, to, options).then((request) => request(axios, basePath));
},
/**
* Get list of all currencies
* @param {Array<string>} [code] code - currency code ISO 4217
* @param {Array<string>} [expand] expand - expand properties
* @param {Array<string>} [exclude] exclude - exclude properties
* @param {'en' | 'ar' | 'de' | 'es' | 'fr' | 'ja' | 'ko' | 'pt' | 'ru'} [language] language - localisation language
* @param {'fiat' | 'crypto'} [type] type - type of currency
* @param {Array<string>} [sort] sort - sort properties
* @param {string} [page] page - page number
* @param {string} [pageSize] pageSize - page size
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1ListCurrencies(code, expand, exclude, language, type, sort, page, pageSize, options) {
return localVarFp
.v1ListCurrencies(code, expand, exclude, language, type, sort, page, pageSize, options)
.then((request) => request(axios, basePath));
},
};
};
exports.CurrencyApiFactory = CurrencyApiFactory;
/**
* CurrencyApi
* @export
* @class CurrencyApi
* @extends {BaseAPI}
*/
class CurrencyApi extends base_1.BaseAPI {
/**
* Convert currency to another currency
* @param {CurrencyApiV1ConvertCurrencyRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CurrencyApi
*/
v1ConvertCurrency(requestParameters, options) {
return (0, exports.CurrencyApiFp)(this.configuration)
.v1ConvertCurrency(requestParameters.from, requestParameters.to, requestParameters.amount, options)
.then((request) => request(this.axios, this.basePath));
}
/**
* Get currency facts and information
* @param {CurrencyApiV1GetCurrencyDetailsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CurrencyApi
*/
v1GetCurrencyDetails(requestParameters, options) {
return (0, exports.CurrencyApiFp)(this.configuration)
.v1GetCurrencyDetails(requestParameters.code, requestParameters.expand, requestParameters.exclude, requestParameters.language, requestParameters.type, options)
.then((request) => request(this.axios, this.basePath));
}
/**
* Get exchange rate for a currency
* @param {CurrencyApiV1GetCurrencyExchangeRateRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CurrencyApi
*/
v1GetCurrencyExchangeRate(requestParameters, options) {
return (0, exports.CurrencyApiFp)(this.configuration)
.v1GetCurrencyExchangeRate(requestParameters.from, requestParameters.to, options)
.then((request) => request(this.axios, this.basePath));
}
/**
* Get list of all currencies
* @param {CurrencyApiV1ListCurrenciesRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CurrencyApi
*/
v1ListCurrencies(requestParameters = {}, options) {
return (0, exports.CurrencyApiFp)(this.configuration)
.v1ListCurrencies(requestParameters.code, requestParameters.expand, requestParameters.exclude, requestParameters.language, requestParameters.type, requestParameters.sort, requestParameters.page, requestParameters.pageSize, options)
.then((request) => request(this.axios, this.basePath));
}
}
exports.CurrencyApi = CurrencyApi;
/**
* DomainApi - axios parameter creator
* @export
*/
const DomainApiAxiosParamCreator = function (configuration) {
return {
/**
* Get domain WHOIS details and registration information
* @param {string} [domain] domain - Domain name to get details for
* @param {string} [parseWhoisToJson] parseWhoisToJson - Parse WHOIS to JSON
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1GetDomainWhois: async (domain, parseWhoisToJson, options = {}) => {
const localVarPath = `/v1-get-domain-whois`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication APIKeyHeader required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, 'x-api-key', configuration);
// authentication APIKeyQueryParam required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'x-api-key', configuration);
if (domain !== undefined) {
localVarQueryParameter['domain'] = domain;
}
if (parseWhoisToJson !== undefined) {
localVarQueryParameter['parseWhoisToJson'] = parseWhoisToJson;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};
exports.DomainApiAxiosParamCreator = DomainApiAxiosParamCreator;
/**
* DomainApi - functional programming interface
* @export
*/
const DomainApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.DomainApiAxiosParamCreator)(configuration);
return {
/**
* Get domain WHOIS details and registration information
* @param {string} [domain] domain - Domain name to get details for
* @param {string} [parseWhoisToJson] parseWhoisToJson - Parse WHOIS to JSON
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async v1GetDomainWhois(domain, parseWhoisToJson, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.v1GetDomainWhois(domain, parseWhoisToJson, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
};
};
exports.DomainApiFp = DomainApiFp;
/**
* DomainApi - factory interface
* @export
*/
const DomainApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.DomainApiFp)(configuration);
return {
/**
* Get domain WHOIS details and registration information
* @param {string} [domain] domain - Domain name to get details for
* @param {string} [parseWhoisToJson] parseWhoisToJson - Parse WHOIS to JSON
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1GetDomainWhois(domain, parseWhoisToJson, options) {
return localVarFp.v1GetDomainWhois(domain, parseWhoisToJson, options).then((request) => request(axios, basePath));
},
};
};
exports.DomainApiFactory = DomainApiFactory;
/**
* DomainApi
* @export
* @class DomainApi
* @extends {BaseAPI}
*/
class DomainApi extends base_1.BaseAPI {
/**
* Get domain WHOIS details and registration information
* @param {DomainApiV1GetDomainWhoisRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof DomainApi
*/
v1GetDomainWhois(requestParameters = {}, options) {
return (0, exports.DomainApiFp)(this.configuration)
.v1GetDomainWhois(requestParameters.domain, requestParameters.parseWhoisToJson, options)
.then((request) => request(this.axios, this.basePath));
}
}
exports.DomainApi = DomainApi;
/**
* EmailApi - axios parameter creator
* @export
*/
const EmailApiAxiosParamCreator = function (configuration) {
return {
/**
* Get email validation details
* @param {string} email email - email address
* @param {boolean} [verifyMx] verifyMx - verify domain dns for MX record
* @param {boolean} [verifySmtp] verifySmtp - verify mailbox with SMTP Connect and Reply
* @param {string} [timeout] timeout - timeout in milliseconds max 10000 (10 seconds)
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1GetEmailDetails: async (email, verifyMx, verifySmtp, timeout, options = {}) => {
// verify required parameter 'email' is not null or undefined
(0, common_1.assertParamExists)('v1GetEmailDetails', 'email', email);
const localVarPath = `/v1-get-email-details`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication APIKeyHeader required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, 'x-api-key', configuration);
// authentication APIKeyQueryParam required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'x-api-key', configuration);
if (email !== undefined) {
localVarQueryParameter['email'] = email;
}
if (verifyMx !== undefined) {
localVarQueryParameter['verifyMx'] = verifyMx;
}
if (verifySmtp !== undefined) {
localVarQueryParameter['verifySmtp'] = verifySmtp;
}
if (timeout !== undefined) {
localVarQueryParameter['timeout'] = timeout;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};
exports.EmailApiAxiosParamCreator = EmailApiAxiosParamCreator;
/**
* EmailApi - functional programming interface
* @export
*/
const EmailApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.EmailApiAxiosParamCreator)(configuration);
return {
/**
* Get email validation details
* @param {string} email email - email address
* @param {boolean} [verifyMx] verifyMx - verify domain dns for MX record
* @param {boolean} [verifySmtp] verifySmtp - verify mailbox with SMTP Connect and Reply
* @param {string} [timeout] timeout - timeout in milliseconds max 10000 (10 seconds)
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async v1GetEmailDetails(email, verifyMx, verifySmtp, timeout, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.v1GetEmailDetails(email, verifyMx, verifySmtp, timeout, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
};
};
exports.EmailApiFp = EmailApiFp;
/**
* EmailApi - factory interface
* @export
*/
const EmailApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.EmailApiFp)(configuration);
return {
/**
* Get email validation details
* @param {string} email email - email address
* @param {boolean} [verifyMx] verifyMx - verify domain dns for MX record
* @param {boolean} [verifySmtp] verifySmtp - verify mailbox with SMTP Connect and Reply
* @param {string} [timeout] timeout - timeout in milliseconds max 10000 (10 seconds)
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1GetEmailDetails(email, verifyMx, verifySmtp, timeout, options) {
return localVarFp
.v1GetEmailDetails(email, verifyMx, verifySmtp, timeout, options)
.then((request) => request(axios, basePath));
},
};
};
exports.EmailApiFactory = EmailApiFactory;
/**
* EmailApi
* @export
* @class EmailApi
* @extends {BaseAPI}
*/
class EmailApi extends base_1.BaseAPI {
/**
* Get email validation details
* @param {EmailApiV1GetEmailDetailsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof EmailApi
*/
v1GetEmailDetails(requestParameters, options) {
return (0, exports.EmailApiFp)(this.configuration)
.v1GetEmailDetails(requestParameters.email, requestParameters.verifyMx, requestParameters.verifySmtp, requestParameters.timeout, options)
.then((request) => request(this.axios, this.basePath));
}
}
exports.EmailApi = EmailApi;
/**
* IPApi - axios parameter creator
* @export
*/
const IPApiAxiosParamCreator = function (configuration) {
return {
/**
* Get IP GEO Location and ISP details
* @param {string} [ip] ip - IP Address
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1GetIpDetails: async (ip, options = {}) => {
const localVarPath = `/v1-get-ip-details`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication APIKeyHeader required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, 'x-api-key', configuration);
// authentication APIKeyQueryParam required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'x-api-key', configuration);
if (ip !== undefined) {
localVarQueryParameter['ip'] = ip;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};
exports.IPApiAxiosParamCreator = IPApiAxiosParamCreator;
/**
* IPApi - functional programming interface
* @export
*/
const IPApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.IPApiAxiosParamCreator)(configuration);
return {
/**
* Get IP GEO Location and ISP details
* @param {string} [ip] ip - IP Address
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async v1GetIpDetails(ip, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.v1GetIpDetails(ip, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
};
};
exports.IPApiFp = IPApiFp;
/**
* IPApi - factory interface
* @export
*/
const IPApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.IPApiFp)(configuration);
return {
/**
* Get IP GEO Location and ISP details
* @param {string} [ip] ip - IP Address
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1GetIpDetails(ip, options) {
return localVarFp.v1GetIpDetails(ip, options).then((request) => request(axios, basePath));
},
};
};
exports.IPApiFactory = IPApiFactory;
/**
* IPApi
* @export
* @class IPApi
* @extends {BaseAPI}
*/
class IPApi extends base_1.BaseAPI {
/**
* Get IP GEO Location and ISP details
* @param {IPApiV1GetIpDetailsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof IPApi
*/
v1GetIpDetails(requestParameters = {}, options) {
return (0, exports.IPApiFp)(this.configuration)
.v1GetIpDetails(requestParameters.ip, options)
.then((request) => request(this.axios, this.basePath));
}
}
exports.IPApi = IPApi;
/**
* ImageApi - axios parameter creator
* @export
*/
const ImageApiAxiosParamCreator = function (configuration) {
return {
/**
* Get Text From Image with OCR
* @param {GetTextFromImageIn} getTextFromImageIn body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1GetTextFromImage: async (getTextFromImageIn, options = {}) => {
// verify required parameter 'getTextFromImageIn' is not null or undefined
(0, common_1.assertParamExists)('v1GetTextFromImage', 'getTextFromImageIn', getTextFromImageIn);
const localVarPath = `/v1-get-text-from-image`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication APIKeyHeader required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, 'x-api-key', configuration);
// authentication APIKeyQueryParam required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'x-api-key', configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(getTextFromImageIn, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};
exports.ImageApiAxiosParamCreator = ImageApiAxiosParamCreator;
/**
* ImageApi - functional programming interface
* @export
*/
const ImageApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.ImageApiAxiosParamCreator)(configuration);
return {
/**
* Get Text From Image with OCR
* @param {GetTextFromImageIn} getTextFromImageIn body