UNPKG

@devmehq/sdk-js

Version:

DEV.ME SDK for JavaScript & TypeScript for Server & Browser, Compatible with Node.js & React & Vue.js & Angular

875 lines 206 kB
"use strict"; /** * DEV.ME API Documentation * **DEV.ME API Platform** - 19 powerful services across 7 categories **Validation & Verification:** [Email Validation API](https://dev.me/products/email) • [Phone Validation API](https://dev.me/products/phone) • [IP Geolocation API](https://dev.me/products/ip) **Financial & Currency:** [Currency Exchange API](https://dev.me/products/currency) • [Currency List API](https://dev.me/products/currency-list) **Domain & Security:** [Domain WHOIS API](https://dev.me/products/domain-whois) • [DNS Lookup API](https://dev.me/products/dns-lookup) • [Domain Tools API](https://dev.me/products/domain-tools) **Content & Media:** [QR Code Generator API](https://dev.me/products/qr-code-generator) • [Image Placeholders API](https://dev.me/products/image-placeholder) • [Image Optimization API](https://dev.me/products/image-optimizer) **URL & Web:** [URL Shortening API](https://dev.me/products/short-url) • [Web Scraping API](https://dev.me/products/url-scrapper) • [URL Metadata API](https://dev.me/products/url-metadata) • [One-Time URL API](https://dev.me/products/onetime-url) **Global Data:** [Country Data API](https://dev.me/products/country) • [City Data API](https://dev.me/products/city) **Management:** [API Key Management](https://dev.me/dashboard) • [API Usage Analytics](https://dev.me/dashboard) **Quick Start:** Use API key `demo-key` for testing • Visit [dev.me](https://dev.me) for complete documentation **Authentication:** Header `x-api-key: YOUR_API_KEY` or Query Parameter `?x-api-key=YOUR_API_KEY` **[Rate Limits](https://dev.me/pricing):** Free (500/mo) • Essential (15K/mo) • Standard (60K/mo) • Professional (1M/mo) • Enterprise (Unlimited) **Support:** support@dev.me • [Documentation](https://dev.me/documentation) * * 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.ShortURLApiAxiosParamCreator = exports.V1ListQrCodesSortEnum = exports.V1ListQrCodesTypeEnum = exports.QRCodeApi = exports.QRCodeApiFactory = exports.QRCodeApiFp = exports.QRCodeApiAxiosParamCreator = exports.PhoneApi = exports.PhoneApiFactory = exports.PhoneApiFp = exports.PhoneApiAxiosParamCreator = exports.V1GetOnetimeUrlDetailsDomainEnum = exports.OneTimeURLApi = exports.OneTimeURLApiFactory = exports.OneTimeURLApiFp = exports.OneTimeURLApiAxiosParamCreator = exports.IPApi = exports.IPApiFactory = exports.IPApiFp = exports.IPApiAxiosParamCreator = exports.EmailApi = exports.EmailApiFactory = exports.EmailApiFp = exports.EmailApiAxiosParamCreator = exports.V1GetLookupDomainDnsTypeEnum = exports.DomainToolsApi = exports.DomainToolsApiFactory = exports.DomainToolsApiFp = exports.DomainToolsApiAxiosParamCreator = exports.CurrencyApi = exports.CurrencyApiFactory = exports.CurrencyApiFp = exports.CurrencyApiAxiosParamCreator = exports.CountryApi = exports.CountryApiFactory = exports.CountryApiFp = exports.CountryApiAxiosParamCreator = exports.APIUsageApi = exports.APIUsageApiFactory = exports.APIUsageApiFp = exports.APIUsageApiAxiosParamCreator = exports.APIKeyApi = exports.APIKeyApiFactory = exports.APIKeyApiFp = exports.APIKeyApiAxiosParamCreator = exports.UpdateQrCodeInTypeEnum = exports.QrCodeGenerationSettingsErrorCorrectionLevelEnum = exports.QrCodeBaseTypeEnum = exports.PreviewQrCodeInFormatEnum = exports.PreviewQrCodeInTypeEnum = void 0; exports.URLMetadataApi = exports.URLMetadataApiFactory = exports.URLMetadataApiFp = exports.URLMetadataApiAxiosParamCreator = exports.V1GetShortUrlDetailsDomainEnum = exports.ShortURLApi = exports.ShortURLApiFactory = exports.ShortURLApiFp = void 0; const axios_1 = __importDefault(require("axios")); const base_1 = require("./base"); // Some imports not used depending on template conditions const common_1 = require("./common"); exports.PreviewQrCodeInTypeEnum = { Url: 'url', Text: 'text', Email: 'email', Phone: 'phone', Sms: 'sms', Wifi: 'wifi', Vcard: 'vcard', }; exports.PreviewQrCodeInFormatEnum = { Base64: 'base64', }; exports.QrCodeBaseTypeEnum = { Url: 'url', Text: 'text', Email: 'email', Phone: 'phone', Sms: 'sms', Wifi: 'wifi', Vcard: 'vcard', }; exports.QrCodeGenerationSettingsErrorCorrectionLevelEnum = { L: 'L', M: 'M', Q: 'Q', H: 'H', }; exports.UpdateQrCodeInTypeEnum = { Url: 'url', Text: 'text', Email: 'email', Phone: 'phone', Sms: 'sms', Wifi: 'wifi', Vcard: 'vcard', }; /** * APIKeyApi - axios parameter creator */ const APIKeyApiAxiosParamCreator = (configuration) => ({ /** * Create API Key - Generate a new API key * @param {CreateApiKeyIn} createApiKeyIn API key configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ v1CreateApiKey: async (createApiKeyIn, options = {}) => { // verify required parameter 'createApiKeyIn' is not null or undefined (0, common_1.assertParamExists)('v1CreateApiKey', 'createApiKeyIn', createApiKeyIn); const localVarPath = `/v1-create-api-key`; // 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 APIKeyQueryParam required await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'x-api-key', configuration); // authentication APIKeyHeader required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, 'x-api-key', configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); const headersFromBaseOptions = (baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createApiKeyIn, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Delete API Key - Remove an API key permanently * @param {DeleteApiKeyIn} deleteApiKeyIn API key to delete * @param {*} [options] Override http request option. * @throws {RequiredError} */ v1DeleteApiKey: async (deleteApiKeyIn, options = {}) => { // verify required parameter 'deleteApiKeyIn' is not null or undefined (0, common_1.assertParamExists)('v1DeleteApiKey', 'deleteApiKeyIn', deleteApiKeyIn); const localVarPath = `/v1-delete-api-key`; // 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 APIKeyQueryParam required await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'x-api-key', configuration); // authentication APIKeyHeader required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, 'x-api-key', configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); const headersFromBaseOptions = (baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(deleteApiKeyIn, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get API Key Details - Retrieve details of a specific API key * @param {GetApiKeyDetailsIn} getApiKeyDetailsIn Request body with API key ID * @param {*} [options] Override http request option. * @throws {RequiredError} */ v1GetApiKeyDetails: async (getApiKeyDetailsIn, options = {}) => { // verify required parameter 'getApiKeyDetailsIn' is not null or undefined (0, common_1.assertParamExists)('v1GetApiKeyDetails', 'getApiKeyDetailsIn', getApiKeyDetailsIn); const localVarPath = `/v1-get-api-key-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: 'POST', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication APIKeyQueryParam required await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'x-api-key', configuration); // authentication APIKeyHeader required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, 'x-api-key', configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); const headersFromBaseOptions = (baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(getApiKeyDetailsIn, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Who Am I - Get current user information * @param {*} [options] Override http request option. * @throws {RequiredError} */ v1GetWhoAmI: async (options = {}) => { const localVarPath = `/v1-who-am-i`; // 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 APIKeyQueryParam required await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'x-api-key', configuration); // authentication APIKeyHeader required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, 'x-api-key', configuration); (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); const headersFromBaseOptions = (baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * List API Keys - Retrieve user\'s API keys * @param {ListApiKeysIn} listApiKeysIn Request body * @param {*} [options] Override http request option. * @throws {RequiredError} */ v1ListApiKeys: async (listApiKeysIn, options = {}) => { // verify required parameter 'listApiKeysIn' is not null or undefined (0, common_1.assertParamExists)('v1ListApiKeys', 'listApiKeysIn', listApiKeysIn); const localVarPath = `/v1-list-api-keys`; // 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 APIKeyQueryParam required await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'x-api-key', configuration); // authentication APIKeyHeader required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, 'x-api-key', configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); const headersFromBaseOptions = (baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(listApiKeysIn, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Update API Key - Modify an existing API key * @param {UpdateApiKeyIn} updateApiKeyIn Updated API key configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ v1UpdateApiKey: async (updateApiKeyIn, options = {}) => { // verify required parameter 'updateApiKeyIn' is not null or undefined (0, common_1.assertParamExists)('v1UpdateApiKey', 'updateApiKeyIn', updateApiKeyIn); const localVarPath = `/v1-update-api-key`; // 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 APIKeyQueryParam required await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'x-api-key', configuration); // authentication APIKeyHeader required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, 'x-api-key', configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); const headersFromBaseOptions = (baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(updateApiKeyIn, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, }); exports.APIKeyApiAxiosParamCreator = APIKeyApiAxiosParamCreator; /** * APIKeyApi - functional programming interface */ const APIKeyApiFp = (configuration) => { const localVarAxiosParamCreator = (0, exports.APIKeyApiAxiosParamCreator)(configuration); return { /** * Create API Key - Generate a new API key * @param {CreateApiKeyIn} createApiKeyIn API key configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ async v1CreateApiKey(createApiKeyIn, options) { var _a, _b, _c; const localVarAxiosArgs = await localVarAxiosParamCreator.v1CreateApiKey(createApiKeyIn, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['APIKeyApi.v1CreateApiKey']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Delete API Key - Remove an API key permanently * @param {DeleteApiKeyIn} deleteApiKeyIn API key to delete * @param {*} [options] Override http request option. * @throws {RequiredError} */ async v1DeleteApiKey(deleteApiKeyIn, options) { var _a, _b, _c; const localVarAxiosArgs = await localVarAxiosParamCreator.v1DeleteApiKey(deleteApiKeyIn, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['APIKeyApi.v1DeleteApiKey']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Get API Key Details - Retrieve details of a specific API key * @param {GetApiKeyDetailsIn} getApiKeyDetailsIn Request body with API key ID * @param {*} [options] Override http request option. * @throws {RequiredError} */ async v1GetApiKeyDetails(getApiKeyDetailsIn, options) { var _a, _b, _c; const localVarAxiosArgs = await localVarAxiosParamCreator.v1GetApiKeyDetails(getApiKeyDetailsIn, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['APIKeyApi.v1GetApiKeyDetails']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Who Am I - Get current user information * @param {*} [options] Override http request option. * @throws {RequiredError} */ async v1GetWhoAmI(options) { var _a, _b, _c; const localVarAxiosArgs = await localVarAxiosParamCreator.v1GetWhoAmI(options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['APIKeyApi.v1GetWhoAmI']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * List API Keys - Retrieve user\'s API keys * @param {ListApiKeysIn} listApiKeysIn Request body * @param {*} [options] Override http request option. * @throws {RequiredError} */ async v1ListApiKeys(listApiKeysIn, options) { var _a, _b, _c; const localVarAxiosArgs = await localVarAxiosParamCreator.v1ListApiKeys(listApiKeysIn, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['APIKeyApi.v1ListApiKeys']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Update API Key - Modify an existing API key * @param {UpdateApiKeyIn} updateApiKeyIn Updated API key configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ async v1UpdateApiKey(updateApiKeyIn, options) { var _a, _b, _c; const localVarAxiosArgs = await localVarAxiosParamCreator.v1UpdateApiKey(updateApiKeyIn, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['APIKeyApi.v1UpdateApiKey']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, }; }; exports.APIKeyApiFp = APIKeyApiFp; /** * APIKeyApi - factory interface */ const APIKeyApiFactory = (configuration, basePath, axios) => { const localVarFp = (0, exports.APIKeyApiFp)(configuration); return { /** * Create API Key - Generate a new API key * @param {APIKeyApiV1CreateApiKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ v1CreateApiKey(requestParameters, options) { return localVarFp .v1CreateApiKey(requestParameters.createApiKeyIn, options) .then((request) => request(axios, basePath)); }, /** * Delete API Key - Remove an API key permanently * @param {APIKeyApiV1DeleteApiKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ v1DeleteApiKey(requestParameters, options) { return localVarFp .v1DeleteApiKey(requestParameters.deleteApiKeyIn, options) .then((request) => request(axios, basePath)); }, /** * Get API Key Details - Retrieve details of a specific API key * @param {APIKeyApiV1GetApiKeyDetailsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ v1GetApiKeyDetails(requestParameters, options) { return localVarFp .v1GetApiKeyDetails(requestParameters.getApiKeyDetailsIn, options) .then((request) => request(axios, basePath)); }, /** * Who Am I - Get current user information * @param {*} [options] Override http request option. * @throws {RequiredError} */ v1GetWhoAmI(options) { return localVarFp.v1GetWhoAmI(options).then((request) => request(axios, basePath)); }, /** * List API Keys - Retrieve user\'s API keys * @param {APIKeyApiV1ListApiKeysRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ v1ListApiKeys(requestParameters, options) { return localVarFp .v1ListApiKeys(requestParameters.listApiKeysIn, options) .then((request) => request(axios, basePath)); }, /** * Update API Key - Modify an existing API key * @param {APIKeyApiV1UpdateApiKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ v1UpdateApiKey(requestParameters, options) { return localVarFp .v1UpdateApiKey(requestParameters.updateApiKeyIn, options) .then((request) => request(axios, basePath)); }, }; }; exports.APIKeyApiFactory = APIKeyApiFactory; /** * APIKeyApi - object-oriented interface */ class APIKeyApi extends base_1.BaseAPI { /** * Create API Key - Generate a new API key * @param {APIKeyApiV1CreateApiKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ v1CreateApiKey(requestParameters, options) { return (0, exports.APIKeyApiFp)(this.configuration) .v1CreateApiKey(requestParameters.createApiKeyIn, options) .then((request) => request(this.axios, this.basePath)); } /** * Delete API Key - Remove an API key permanently * @param {APIKeyApiV1DeleteApiKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ v1DeleteApiKey(requestParameters, options) { return (0, exports.APIKeyApiFp)(this.configuration) .v1DeleteApiKey(requestParameters.deleteApiKeyIn, options) .then((request) => request(this.axios, this.basePath)); } /** * Get API Key Details - Retrieve details of a specific API key * @param {APIKeyApiV1GetApiKeyDetailsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ v1GetApiKeyDetails(requestParameters, options) { return (0, exports.APIKeyApiFp)(this.configuration) .v1GetApiKeyDetails(requestParameters.getApiKeyDetailsIn, options) .then((request) => request(this.axios, this.basePath)); } /** * Who Am I - Get current user information * @param {*} [options] Override http request option. * @throws {RequiredError} */ v1GetWhoAmI(options) { return (0, exports.APIKeyApiFp)(this.configuration) .v1GetWhoAmI(options) .then((request) => request(this.axios, this.basePath)); } /** * List API Keys - Retrieve user\'s API keys * @param {APIKeyApiV1ListApiKeysRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ v1ListApiKeys(requestParameters, options) { return (0, exports.APIKeyApiFp)(this.configuration) .v1ListApiKeys(requestParameters.listApiKeysIn, options) .then((request) => request(this.axios, this.basePath)); } /** * Update API Key - Modify an existing API key * @param {APIKeyApiV1UpdateApiKeyRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ v1UpdateApiKey(requestParameters, options) { return (0, exports.APIKeyApiFp)(this.configuration) .v1UpdateApiKey(requestParameters.updateApiKeyIn, options) .then((request) => request(this.axios, this.basePath)); } } exports.APIKeyApi = APIKeyApi; /** * APIUsageApi - axios parameter creator */ const APIUsageApiAxiosParamCreator = (configuration) => ({ /** * Get API Usage - Retrieve API usage statistics * @param {string} [from] Start date for usage period (ISO 8601 format) - eg: 2024-01-01 * @param {string} [to] End date for usage period (ISO 8601 format) - eg: 2024-01-31 * @param {string} [service] Filter by specific service name - eg: currency, country, ip * @param {*} [options] Override http request option. * @throws {RequiredError} */ v1GetApiUsage: async (from, to, service, options = {}) => { const localVarPath = `/v1-get-api-usage`; // 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 APIKeyQueryParam required await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'x-api-key', configuration); // authentication APIKeyHeader required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, 'x-api-key', configuration); if (from !== undefined) { localVarQueryParameter.from = from; } if (to !== undefined) { localVarQueryParameter.to = to; } if (service !== undefined) { localVarQueryParameter.service = service; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); const headersFromBaseOptions = (baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Download API Usage - Export API usage data as CSV * @param {string} [from] Start date for usage period (ISO 8601 format) - eg: 2024-01-01 * @param {string} [to] End date for usage period (ISO 8601 format) - eg: 2024-01-31 * @param {string} [service] Filter by specific service name - eg: currency, country, ip * @param {string} [format] Export format csv,json, default: csv * @param {*} [options] Override http request option. * @throws {RequiredError} */ v1GetDownloadApiUsage: async (from, to, service, format, options = {}) => { const localVarPath = `/v1-download-api-usage`; // 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 APIKeyQueryParam required await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'x-api-key', configuration); // authentication APIKeyHeader required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, 'x-api-key', configuration); if (from !== undefined) { localVarQueryParameter.from = from; } if (to !== undefined) { localVarQueryParameter.to = to; } if (service !== undefined) { localVarQueryParameter.service = service; } if (format !== undefined) { localVarQueryParameter.format = format; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); const headersFromBaseOptions = (baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, }); exports.APIUsageApiAxiosParamCreator = APIUsageApiAxiosParamCreator; /** * APIUsageApi - functional programming interface */ const APIUsageApiFp = (configuration) => { const localVarAxiosParamCreator = (0, exports.APIUsageApiAxiosParamCreator)(configuration); return { /** * Get API Usage - Retrieve API usage statistics * @param {string} [from] Start date for usage period (ISO 8601 format) - eg: 2024-01-01 * @param {string} [to] End date for usage period (ISO 8601 format) - eg: 2024-01-31 * @param {string} [service] Filter by specific service name - eg: currency, country, ip * @param {*} [options] Override http request option. * @throws {RequiredError} */ async v1GetApiUsage(from, to, service, options) { var _a, _b, _c; const localVarAxiosArgs = await localVarAxiosParamCreator.v1GetApiUsage(from, to, service, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['APIUsageApi.v1GetApiUsage']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Download API Usage - Export API usage data as CSV * @param {string} [from] Start date for usage period (ISO 8601 format) - eg: 2024-01-01 * @param {string} [to] End date for usage period (ISO 8601 format) - eg: 2024-01-31 * @param {string} [service] Filter by specific service name - eg: currency, country, ip * @param {string} [format] Export format csv,json, default: csv * @param {*} [options] Override http request option. * @throws {RequiredError} */ async v1GetDownloadApiUsage(from, to, service, format, options) { var _a, _b, _c; const localVarAxiosArgs = await localVarAxiosParamCreator.v1GetDownloadApiUsage(from, to, service, format, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['APIUsageApi.v1GetDownloadApiUsage']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, }; }; exports.APIUsageApiFp = APIUsageApiFp; /** * APIUsageApi - factory interface */ const APIUsageApiFactory = (configuration, basePath, axios) => { const localVarFp = (0, exports.APIUsageApiFp)(configuration); return { /** * Get API Usage - Retrieve API usage statistics * @param {APIUsageApiV1GetApiUsageRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ v1GetApiUsage(requestParameters = {}, options) { return localVarFp .v1GetApiUsage(requestParameters.from, requestParameters.to, requestParameters.service, options) .then((request) => request(axios, basePath)); }, /** * Download API Usage - Export API usage data as CSV * @param {APIUsageApiV1GetDownloadApiUsageRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ v1GetDownloadApiUsage(requestParameters = {}, options) { return localVarFp .v1GetDownloadApiUsage(requestParameters.from, requestParameters.to, requestParameters.service, requestParameters.format, options) .then((request) => request(axios, basePath)); }, }; }; exports.APIUsageApiFactory = APIUsageApiFactory; /** * APIUsageApi - object-oriented interface */ class APIUsageApi extends base_1.BaseAPI { /** * Get API Usage - Retrieve API usage statistics * @param {APIUsageApiV1GetApiUsageRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ v1GetApiUsage(requestParameters = {}, options) { return (0, exports.APIUsageApiFp)(this.configuration) .v1GetApiUsage(requestParameters.from, requestParameters.to, requestParameters.service, options) .then((request) => request(this.axios, this.basePath)); } /** * Download API Usage - Export API usage data as CSV * @param {APIUsageApiV1GetDownloadApiUsageRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ v1GetDownloadApiUsage(requestParameters = {}, options) { return (0, exports.APIUsageApiFp)(this.configuration) .v1GetDownloadApiUsage(requestParameters.from, requestParameters.to, requestParameters.service, requestParameters.format, options) .then((request) => request(this.axios, this.basePath)); } } exports.APIUsageApi = APIUsageApi; /** * CountryApi - axios parameter creator */ const CountryApiAxiosParamCreator = (configuration) => ({ /** * Get City Details - Retrieve detailed information about a specific city * @param {number} [id] City ID * @param {string} [name] City name (must be exact match) * @param {string} [countryCode] Country code (2 letter ISO code) - eg: US, GB * @param {string} [stateCode] State/Province code - eg: CA, NY * @param {Array<string>} [expand] Fields to include in response - eg: [\&quot;name\&quot;, \&quot;countryName\&quot;, \&quot;stateName\&quot;] * @param {Array<string>} [exclude] Fields to exclude from response - eg: [\&quot;countryId\&quot;, \&quot;stateId\&quot;] * @param {*} [options] Override http request option. * @throws {RequiredError} */ v1GetCityDetails: async (id, name, countryCode, stateCode, expand, exclude, options = {}) => { const localVarPath = `/v1-get-city-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 APIKeyQueryParam required await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'x-api-key', configuration); // authentication APIKeyHeader required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, 'x-api-key', configuration); if (id !== undefined) { localVarQueryParameter.id = id; } if (name !== undefined) { localVarQueryParameter.name = name; } if (countryCode !== undefined) { localVarQueryParameter.countryCode = countryCode; } if (stateCode !== undefined) { localVarQueryParameter.stateCode = stateCode; } if (expand) { localVarQueryParameter.expand = expand; } if (exclude) { localVarQueryParameter.exclude = exclude; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); const headersFromBaseOptions = (baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get Country Details - Retrieve detailed information about a specific country * @param {string} code Country code (2 or 3 letter ISO code) - eg: US, USA * @param {Array<string>} [expand] Fields to include in response - eg: [\&quot;name\&quot;, \&quot;capital\&quot;, \&quot;currencies\&quot;, \&quot;languages\&quot;] * @param {Array<string>} [exclude] Fields to exclude from response - eg: [\&quot;translations\&quot;, \&quot;demonyms\&quot;] * @param {*} [options] Override http request option. * @throws {RequiredError} */ v1GetCountryDetails: async (code, expand, exclude, 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 APIKeyQueryParam required await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'x-api-key', configuration); // authentication APIKeyHeader required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, 'x-api-key', configuration); if (code !== undefined) { localVarQueryParameter.code = code; } if (expand) { localVarQueryParameter.expand = expand; } if (exclude) { localVarQueryParameter.exclude = exclude; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); const headersFromBaseOptions = (baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get Factbook Details - Retrieve detailed CIA World Factbook information for a country * @param {string} code Country code (2 or 3 letter ISO code) - eg: US, USA * @param {*} [options] Override http request option. * @throws {RequiredError} */ v1GetFactbookDetails: async (code, options = {}) => { // verify required parameter 'code' is not null or undefined (0, common_1.assertParamExists)('v1GetFactbookDetails', 'code', code); const localVarPath = `/v1-get-factbook-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 APIKeyQueryParam required await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'x-api-key', configuration); // authentication APIKeyHeader required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, 'x-api-key', configuration); if (code !== undefined) { localVarQueryParameter.code = code; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); const headersFromBaseOptions = (baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * List Cities - Search and retrieve cities by name and country * @param {string} [name] City name to search for (partial match supported) * @param {Array<string>} [country] Filter by country codes (2 letter ISO codes) - eg: [\&quot;US\&quot;, \&quot;GB\&quot;, \&quot;CA\&quot;] * @param {Array<string>} [sort] Sort fields (prefix with - for descending) - eg: [\&quot;name\&quot;, \&quot;-population\&quot;] * @param {number} [page] Page number for pagination - Default: 1 * @param {number} [pageSize] Number of items per page - Default: 20 * @param {*} [options] Override http request option. * @throws {RequiredError} */ v1ListCities: async (name, country, sort, page, pageSize, options = {}) => { const localVarPath = `/v1-list-cities`; // 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 APIKeyQueryParam required await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'x-api-key', configuration); // authentication APIKeyHeader required await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, 'x-api-key', configuration); if (name !== undefined) { localVarQueryParameter.name = name; } if (country) { localVarQueryParameter.country = country; } if (sort) { localVarQueryParameter.sort = sort; } if (page !== undefined) { localVarQueryParameter.page = page; } if (pageSize !== undefined) { localVarQueryParameter.pageSize = pageSize; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); const headersFromBaseOptions = (baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * List Countries - Retrieve a searchable list of countries with filtering options * @param {Array<string>} [code] Filter by country codes (2 or 3 letter ISO codes) - eg: [\&quot;US\&quot;, \&quot;GB\&quot;, \&quot;FR\&quot;] * @param {Array<string>} [expand] Fields to include in response - eg: [\&quot;name\&quot;, \&quot;capital\&quot;, \&quot;currencies\&quot;] * @param {Array<string>} [exclude] Fields to exclude from response - eg: [\&quot;translations\&quot;, \&quot;demonyms\&quot;] * @param {Array<string>} [sort] Sort fields (prefix with - for descending) - eg: [\&quot;name\&quot;, \&quot;-population\&quot;] * @param {number} [page] Page number for pagination - Default: 1 * @param {number} [pageSize] Number of items per page - Default: 20 * @param {*} [options] Override http request option. * @throws {RequiredError} */ v1ListCountries: async (code, expand, exclude, 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 APIKeyQueryParam required await (0, common_1.setApiKeyToObject)(localVarQueryPar