diff --git a/.dockerignore b/.dockerignore
deleted file mode 100644
index b39a78e..0000000
--- a/.dockerignore
+++ /dev/null
@@ -1,32 +0,0 @@
-tmp
-out-tsc
-dist-server
-prerender.js
-npm-debug.log
-Dockerfile*
-docker-compose*
-.dockerignore
-.git
-.gitignore
-README.md
-.vscode
-.idea
-#.scripts
-.mock
-.docker
-server.build.js
-docs
-/*.log
-.github
-.dependabot
-
-node_modules/.bin
-node_modules/@types
-node_modules/.cache
-node_modules/webpack*
-node_modules/rollup*
-node_modules/enzyme*
-node_modules/*jest*
-node_modules/prettier
-node_modules/*lint*
-!node_modules/.bin
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 5d07ff7..d2b5b7c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -8,53 +8,118 @@ on:
- '__tests__/**'
- 'package.json'
- 'yarn.lock'
- - 'release.config.js'
- - '.github/workflows/ci.yml'
branches:
- '*'
- '**'
- '!master'
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CI: true
jobs:
- CI:
+ test:
+ name: Test
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
- packages: write
contents: write
+ issues: write
+ pull-requests: write
+ id-token: write
+ packages: write
steps:
- - run: echo "๐ The job was automatically triggered by a ${{ github.event_name }} event."
- - uses: styfle/cancel-workflow-action@0.12.1
+ - name: Checkout
+ uses: actions/checkout@v5
with:
- workflow_id: ci.yml
- access_token: ${{ github.token }}
+ fetch-depth: 0
+ persist-credentials: false
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- with:
- fetch-depth: 30
-
- - uses: FranzDiebold/github-env-vars-action@v2
- name: Setup Node.js
uses: actions/setup-node@v5
with:
- node-version: 19
+ node-version: 24
+ cache: 'yarn'
- - name: Yarn
+ - name: Install dependencies
run: yarn install --frozen-lockfile
+ - name: Verify dependency integrity
+ run: yarn audit || true
+
+ - name: Lint
+ run: yarn lint
+
- name: Test
+ run: yarn test
+
+ - name: Build
+ run: yarn build
+
+ - name: Pre-release (develop branch only)
+ id: semantic_release
+ if: github.ref == 'refs/heads/develop' && github.event_name == 'push'
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
+ GIT_AUTHOR_NAME: DEV.ME Team
+ GIT_AUTHOR_EMAIL: support@dev.me
+ GIT_COMMITTER_NAME: DEV.ME Team
+ GIT_COMMITTER_EMAIL: support@dev.me
run: |
- yarn test
+ # Install semantic-release and required plugins
+ npm i -g semantic-release @semantic-release/git @semantic-release/github @semantic-release/changelog @semantic-release/npm @semantic-release/commit-analyzer
+
+ # Run semantic-release
+ npx semantic-release --debug 2>&1 | tee release-output.txt
- - name: Release
- if: github.ref == 'refs/heads/develop'
+ # Extract version and tag info from release output
+ if grep -q "Published release" release-output.txt; then
+ echo "release_published=true" >> $GITHUB_OUTPUT
+ VERSION=$(grep -oP 'Published release \K[0-9]+\.[0-9]+\.[0-9]+(-.+)?' release-output.txt | head -1)
+ echo "version=$VERSION" >> $GITHUB_OUTPUT
+ echo "tag=v$VERSION" >> $GITHUB_OUTPUT
+ else
+ echo "release_published=false" >> $GITHUB_OUTPUT
+ fi
+
+ - name: Add Release Summary
+ if: always()
run: |
- npm i -g semantic-release @semantic-release/git @semantic-release/github conventional-changelog-conventionalcommits
- npx semantic-release --no-ci --debug
+ echo "## ๐ฆ Release Summary" >> $GITHUB_STEP_SUMMARY
+ echo "" >> $GITHUB_STEP_SUMMARY
+
+ if [[ "${{ steps.semantic_release.outputs.release_published }}" == "true" ]]; then
+ echo "### โ
Release Published Successfully!" >> $GITHUB_STEP_SUMMARY
+ echo "" >> $GITHUB_STEP_SUMMARY
+ echo "- **Version:** \`${{ steps.semantic_release.outputs.version }}\`" >> $GITHUB_STEP_SUMMARY
+ echo "- **Tag:** \`${{ steps.semantic_release.outputs.tag }}\`" >> $GITHUB_STEP_SUMMARY
+ echo "- **Branch:** \`${{ github.ref_name }}\`" >> $GITHUB_STEP_SUMMARY
+ echo "- **Commit:** \`${{ github.sha }}\`" >> $GITHUB_STEP_SUMMARY
+ echo "" >> $GITHUB_STEP_SUMMARY
+ echo "### ๐ Links" >> $GITHUB_STEP_SUMMARY
+ echo "- [NPM Package](https://www.npmjs.com/package/@devmehq/sdk-js/v/${{ steps.semantic_release.outputs.version }})" >> $GITHUB_STEP_SUMMARY
+ echo "- [GitHub Release](https://github.com/${{ github.repository }}/releases/tag/${{ steps.semantic_release.outputs.tag }})" >> $GITHUB_STEP_SUMMARY
+ else
+ echo "### โน๏ธ No Release Published" >> $GITHUB_STEP_SUMMARY
+ echo "" >> $GITHUB_STEP_SUMMARY
+ echo "No release was created. This could be because:" >> $GITHUB_STEP_SUMMARY
+ echo "- No relevant commits found for release" >> $GITHUB_STEP_SUMMARY
+ echo "- Commits don't follow conventional commit format" >> $GITHUB_STEP_SUMMARY
+ echo "- Release conditions not met" >> $GITHUB_STEP_SUMMARY
+ fi
+
+ echo "" >> $GITHUB_STEP_SUMMARY
+ echo "### ๐ Build Information" >> $GITHUB_STEP_SUMMARY
+ echo "- **Workflow:** \`${{ github.workflow }}\`" >> $GITHUB_STEP_SUMMARY
+ echo "- **Run ID:** \`${{ github.run_id }}\`" >> $GITHUB_STEP_SUMMARY
+ echo "- **Run Number:** \`${{ github.run_number }}\`" >> $GITHUB_STEP_SUMMARY
+ echo "- **Actor:** \`${{ github.actor }}\`" >> $GITHUB_STEP_SUMMARY
+ echo "- **Event:** \`${{ github.event_name }}\`" >> $GITHUB_STEP_SUMMARY
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 2559ead..8a4160b 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -9,45 +9,112 @@ on:
branches:
- 'master'
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CI: true
jobs:
- Release:
+ release:
+ name: Release
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
- packages: write
contents: write
+ issues: write
+ pull-requests: write
+ id-token: write
+ packages: write
steps:
- - run: echo "๐ The job was automatically triggered by a ${{ github.event_name }} event."
- - uses: styfle/cancel-workflow-action@0.12.1
- with:
- workflow_id: release.yml
- access_token: ${{ github.token }}
-
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
+ - name: Checkout
+ uses: actions/checkout@v5
with:
- fetch-depth: 30
+ fetch-depth: 0
+ persist-credentials: false
- - uses: FranzDiebold/github-env-vars-action@v2
- name: Setup Node.js
uses: actions/setup-node@v5
with:
- node-version: 19
+ node-version: 24
+ cache: 'yarn'
- - name: Yarn
+ - name: Install dependencies
run: yarn install --frozen-lockfile
+ - name: Verify dependency integrity
+ run: yarn audit || true
+
+ - name: Lint
+ run: yarn lint
+
- name: Test
- run: |
- yarn test
+ run: yarn test
+
+ - name: Build
+ run: yarn build
- name: Release
+ id: semantic_release
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
+ GIT_AUTHOR_NAME: DEV.ME Team
+ GIT_AUTHOR_EMAIL: support@dev.me
+ GIT_COMMITTER_NAME: DEV.ME Team
+ GIT_COMMITTER_EMAIL: support@dev.me
run: |
- npm i -g semantic-release @semantic-release/git @semantic-release/github conventional-changelog-conventionalcommits
- npx semantic-release --no-ci --debug
+ # Install semantic-release and required plugins
+ npm i -g semantic-release @semantic-release/git @semantic-release/github @semantic-release/changelog @semantic-release/npm @semantic-release/commit-analyzer
+
+ # Run semantic-release
+ npx semantic-release --debug 2>&1 | tee release-output.txt
+
+ # Extract version and tag info from release output
+ if grep -q "Published release" release-output.txt; then
+ echo "release_published=true" >> $GITHUB_OUTPUT
+ VERSION=$(grep -oP 'Published release \K[0-9]+\.[0-9]+\.[0-9]+' release-output.txt | head -1)
+ echo "version=$VERSION" >> $GITHUB_OUTPUT
+ echo "tag=v$VERSION" >> $GITHUB_OUTPUT
+ else
+ echo "release_published=false" >> $GITHUB_OUTPUT
+ fi
+
+ - name: Add Release Summary
+ if: always()
+ run: |
+ echo "## ๐ฆ Release Summary" >> $GITHUB_STEP_SUMMARY
+ echo "" >> $GITHUB_STEP_SUMMARY
+
+ if [[ "${{ steps.semantic_release.outputs.release_published }}" == "true" ]]; then
+ echo "### โ
Release Published Successfully!" >> $GITHUB_STEP_SUMMARY
+ echo "" >> $GITHUB_STEP_SUMMARY
+ echo "- **Version:** \`${{ steps.semantic_release.outputs.version }}\`" >> $GITHUB_STEP_SUMMARY
+ echo "- **Tag:** \`${{ steps.semantic_release.outputs.tag }}\`" >> $GITHUB_STEP_SUMMARY
+ echo "- **Branch:** \`${{ github.ref_name }}\`" >> $GITHUB_STEP_SUMMARY
+ echo "- **Commit:** \`${{ github.sha }}\`" >> $GITHUB_STEP_SUMMARY
+ echo "" >> $GITHUB_STEP_SUMMARY
+ echo "### ๐ Links" >> $GITHUB_STEP_SUMMARY
+ echo "- [NPM Package](https://www.npmjs.com/package/@devmehq/sdk-js/v/${{ steps.semantic_release.outputs.version }})" >> $GITHUB_STEP_SUMMARY
+ echo "- [GitHub Release](https://github.com/${{ github.repository }}/releases/tag/${{ steps.semantic_release.outputs.tag }})" >> $GITHUB_STEP_SUMMARY
+ else
+ echo "### โน๏ธ No Release Published" >> $GITHUB_STEP_SUMMARY
+ echo "" >> $GITHUB_STEP_SUMMARY
+ echo "No release was created. This could be because:" >> $GITHUB_STEP_SUMMARY
+ echo "- No relevant commits found for release" >> $GITHUB_STEP_SUMMARY
+ echo "- Commits don't follow conventional commit format" >> $GITHUB_STEP_SUMMARY
+ echo "- Release conditions not met" >> $GITHUB_STEP_SUMMARY
+ fi
+
+ echo "" >> $GITHUB_STEP_SUMMARY
+ echo "### ๐ Build Information" >> $GITHUB_STEP_SUMMARY
+ echo "- **Workflow:** \`${{ github.workflow }}\`" >> $GITHUB_STEP_SUMMARY
+ echo "- **Run ID:** \`${{ github.run_id }}\`" >> $GITHUB_STEP_SUMMARY
+ echo "- **Run Number:** \`${{ github.run_number }}\`" >> $GITHUB_STEP_SUMMARY
+ echo "- **Actor:** \`${{ github.actor }}\`" >> $GITHUB_STEP_SUMMARY
+ echo "- **Event:** \`${{ github.event_name }}\`" >> $GITHUB_STEP_SUMMARY
diff --git a/.lintstagedrc b/.lintstagedrc
deleted file mode 100644
index 7f92e86..0000000
--- a/.lintstagedrc
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "src/**/*.ts?(x)": ["npx tslint --fix -c tslint.json","git add"],
- "swagger/swagger.json": ["npm run lint:swagger", "git add"],
- "package.json": ["prettier --write", "git add"],
- "*.md": ["prettier --write", "git add"],
- "*.y?(a)ml": ["prettier --write", "git add"]
-}
diff --git a/.mocharc.js b/.mocharc.js
deleted file mode 100644
index b21c8cb..0000000
--- a/.mocharc.js
+++ /dev/null
@@ -1,29 +0,0 @@
-'use strict';
-
-// This is a JavaScript-based config file containing every Mocha option plus others.
-// If you need conditional logic, you might want to use this type of config,
-// e.g. set options via environment variables 'process.env'.
-// Otherwise, JSON or YAML is recommended.
-
-module.exports = {
- 'allow-uncaught': false,
- 'async-only': true,
- bail: true,
- 'check-leaks': false,
- color: true,
- delay: false,
- diff: true,
- exit: true,
- extension: ['js', 'cjs', 'mjs', 'ts'],
- 'inline-diffs': false,
- jobs: 2,
- 'node-option': ['unhandled-rejections=strict'],
- package: './package.json',
- parallel: false,
- recursive: false,
- reporter: 'spec',
- require: ['ts-node/register', 'should'],
- spec: ['./__tests__/*-test.ts'],
- timeout: '8s',
- 'trace-warnings': true,
-};
diff --git a/.npmrc b/.npmrc
deleted file mode 100644
index 8410740..0000000
--- a/.npmrc
+++ /dev/null
@@ -1,6 +0,0 @@
-progress=false
-strict-ssl=true
-save-exact=true
-interactive=false
-ignore-engines=true
-no-progress=true
diff --git a/.releaserc.json b/.releaserc.json
new file mode 100644
index 0000000..87d0981
--- /dev/null
+++ b/.releaserc.json
@@ -0,0 +1,56 @@
+{
+ "branches": [
+ "+([0-9])?(.{+([0-9]),x}).x",
+ "master",
+ "main",
+ "next",
+ "next-major",
+ {
+ "name": "beta",
+ "prerelease": true
+ },
+ {
+ "name": "develop",
+ "prerelease": "beta"
+ },
+ {
+ "name": "alpha",
+ "prerelease": true
+ }
+ ],
+ "plugins": [
+ [
+ "@semantic-release/commit-analyzer",
+ {
+ "preset": "angular",
+ "releaseRules": [
+ {
+ "type": "breaking",
+ "release": "major"
+ },
+ {
+ "type": "feat",
+ "release": "minor"
+ },
+ {
+ "type": "fix",
+ "release": "patch"
+ },
+ {
+ "type": "perf",
+ "release": "patch"
+ },
+ {
+ "subject": "*",
+ "release": "patch"
+ }
+ ]
+ }
+ ],
+ "@semantic-release/release-notes-generator",
+ "@semantic-release/npm",
+ "@semantic-release/github"
+ ],
+ "dryRun": false,
+ "ci": true
+}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5125fd4..6015867 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,11 +1,26 @@
# Change Log
+## [Unreleased]
+
+### Added
+
+- Enhanced package.json exports field for better module resolution
+- Support for subpath exports allowing cleaner imports (e.g., `@devmehq/sdk-js/api`)
+- Proper TypeScript types exports for all subpaths
+- Files field in package.json to optimize npm package size
+
+### Fixed
+
+- Corrected main and types paths to point to dist directory
+
## v1.1.2
+
- Remove node-fetch dependency
- Add axios client for request
- Enhance typing
## v1.1.0
+
- Initial stable release
- Adding tests
- Adding documentation
diff --git a/README.md b/README.md
index 89ebbef..7cd5837 100644
--- a/README.md
+++ b/README.md
@@ -1,87 +1,633 @@
# DEV.ME SDK for JavaScript & TypeScript
+
+
+
[](https://github.com/devmehq/devme-sdk-js/actions/workflows/ci.yml)
[](https://www.npmjs.com/package/@devmehq/sdk-js)
[](https://www.npmjs.com/package/@devmehq/sdk-js)
+[](https://opensource.org/licenses/MIT)
+[](https://www.typescriptlang.org/)
+
+**The official JavaScript/TypeScript SDK for DEV.ME API Platform**
+
+[Documentation](https://dev.me/docs) โข [Get API Key](https://dev.me/signup) โข [Support](mailto:support@dev.me)
-DEV.ME SDK for JavaScript & TypeScript
+
-> Works with Node.js and in The Browser, Compatible with Node.js & React.js & Vue.js & Angular.js
+## ๐ Features
-## Get Your Free API Key
-[Signup Here](https://dev.me/signup) and Get Your Free API Key
+- **19 Powerful APIs** across 7 categories
+- **TypeScript Support** with full type definitions
+- **Universal Compatibility** - Works in Node.js, Browser, React, Vue, Angular
+- **Promise-based** with async/await support
+- **Comprehensive Error Handling**
+- **Auto-retry Logic** for network failures
+- **Lightweight** with minimal dependencies
+
+## ๐ฆ Installation
+
+### Using npm
+
+```bash
+npm install @devmehq/sdk-js
+```
-## Installation and usage instructions
+### Using yarn
-## Installation
-Install the module through YARN:
-```yarn
+```bash
yarn add @devmehq/sdk-js
```
-Or NPM
-```npm
-npm insgall @devmehq/sdk-js
+
+### Using pnpm
+
+```bash
+pnpm add @devmehq/sdk-js
+```
+
+## ๐ Authentication
+
+Get your free API key from [dev.me/signup](https://dev.me/signup)
+
+```typescript
+import { Configuration } from '@devmehq/sdk-js';
+
+// Use demo key for testing (limited rate)
+const config = new Configuration({ apiKey: 'demo-key' });
+
+// Use your API key for production
+const config = new Configuration({ apiKey: 'YOUR_API_KEY' });
+```
+
+## ๐ Available APIs
+
+### 1๏ธโฃ Validation & Verification APIs
+
+#### Email Validation API
+
+Validate email addresses with SMTP verification, domain checks, and name detection.
+
+```typescript
+import { EmailApi, Configuration } from '@devmehq/sdk-js';
+
+const config = new Configuration({ apiKey: 'demo-key' });
+const emailApi = new EmailApi(config);
+
+const { data } = await emailApi.v1GetEmailDetails({
+ email: 'test@example.com',
+ verifyMx: true,
+ verifySmtp: true,
+ suggestDomain: true,
+});
+
+console.log(data);
+// {
+// email: 'test@example.com',
+// valid: true,
+// format: true,
+// domain: 'example.com',
+// disposable: false,
+// dns: true,
+// mxRecords: true,
+// smtpCheck: true,
+// catchAll: false,
+// role: false,
+// free: false
+// }
+```
+
+#### Phone Validation API
+
+Validate and get detailed information about phone numbers worldwide.
+
+```typescript
+import { PhoneApi, Configuration } from '@devmehq/sdk-js';
+
+const config = new Configuration({ apiKey: 'demo-key' });
+const phoneApi = new PhoneApi(config);
+
+const { data } = await phoneApi.v1GetPhoneDetails({
+ phone: '+14155552671',
+});
+
+console.log(data);
+// {
+// valid: true,
+// number: '14155552671',
+// localFormat: '(415) 555-2671',
+// internationalFormat: '+1 415-555-2671',
+// countryPrefix: '+1',
+// countryCode: 'US',
+// countryName: 'United States',
+// location: 'California',
+// carrier: 'AT&T',
+// lineType: 'mobile'
+// }
```
-## Examples
+#### IP Geolocation API
+
+Get comprehensive IP address information including location, ISP, and security data.
+
+```typescript
+import { IPApi, Configuration } from '@devmehq/sdk-js';
+
+const config = new Configuration({ apiKey: 'demo-key' });
+const ipApi = new IPApi(config);
+
+const { data } = await ipApi.v1GetIpDetails({
+ ip: '8.8.8.8',
+});
+
+console.log(data);
+// {
+// ip: '8.8.8.8',
+// type: 'IPv4',
+// continent: 'North America',
+// continentCode: 'NA',
+// country: 'United States',
+// countryCode: 'US',
+// region: 'California',
+// city: {
+// name: 'Mountain View',
+// latitude: 37.4056,
+// longitude: -122.0775,
+// timeZone: 'America/Los_Angeles'
+// },
+// asn: 15169,
+// aso: 'Google LLC',
+// isp: 'Google',
+// proxy: false,
+// hosting: true
+// }
+```
+
+### 2๏ธโฃ Financial & Currency APIs
+
+#### Currency Exchange API
+
+Real-time currency conversion with live exchange rates.
-### Currency API Conversion
```typescript
import { CurrencyApi, Configuration } from '@devmehq/sdk-js';
+
const config = new Configuration({ apiKey: 'demo-key' });
const currencyApi = new CurrencyApi(config);
+// Convert currency
const { data } = await currencyApi.v1ConvertCurrency({
- amount: 10,
+ amount: 100,
from: 'USD',
to: 'EUR',
});
+
+console.log(data);
// {
-// convertedAmount: 8.819,
-// convertedText: '10 USD equal to 8.819 EUR',
-// exchangeRate: 0.8819,
+// originalAmount: 100,
+// convertedAmount: 85.23,
// from: 'USD',
-// originalAmount: 10,
-// rateTime: '2022-01-20T14:49:28.046Z',
-// to: 'EUR'
+// to: 'EUR',
+// exchangeRate: 0.8523,
+// convertedText: '100 USD equals 85.23 EUR',
+// rateTime: '2024-01-20T10:30:00.000Z'
+// }
+
+// List available currencies
+const currencies = await currencyApi.v1ListCurrencies({
+ code: ['USD', 'EUR', 'GBP', 'JPY'],
+});
+
+console.log(currencies.data);
+// {
+// list: [
+// { code: 'USD', name: 'US Dollar', symbol: '$' },
+// { code: 'EUR', name: 'Euro', symbol: 'โฌ' },
+// { code: 'GBP', name: 'British Pound', symbol: 'ยฃ' },
+// { code: 'JPY', name: 'Japanese Yen', symbol: 'ยฅ' }
+// ]
// }
```
-### IP API Geolocation, IP2Location, IP Data
+### 3๏ธโฃ Domain & Security APIs
+
+#### Domain Tools API
+
+WHOIS lookup, DNS resolution, and domain availability checking.
+
```typescript
-import { IPApi, Configuration } from '@devmehq/sdk-js';
+import { DomainToolsApi, Configuration } from '@devmehq/sdk-js';
+
const config = new Configuration({ apiKey: 'demo-key' });
-const ipApi = new IPApi(config);
+const domainApi = new DomainToolsApi(config);
+
+// WHOIS lookup
+const { data } = await domainApi.v1GetWhois({
+ domain: 'example.com',
+});
+
+// DNS lookup
+const dnsData = await domainApi.v1GetDnsRecords({
+ domain: 'example.com',
+ type: 'A',
+});
+
+// Check domain availability
+const availability = await domainApi.v1CheckAvailability({
+ domain: 'myawesomesite.com',
+});
+```
-const { data } = await ipApi.v1GetIpDetails({ ip: '52.45.23.11' });
+### 4๏ธโฃ Content & Media APIs
+#### QR Code Generator API
+
+Generate customizable QR codes for various content types.
+
+```typescript
+import { QRCodeApi, Configuration } from '@devmehq/sdk-js';
+
+const config = new Configuration({ apiKey: 'demo-key' });
+const qrApi = new QRCodeApi(config);
+
+// Generate QR code
+const { data } = await qrApi.v1CreateQRCode({
+ data: 'https://dev.me',
+ size: 300,
+ format: 'png',
+ errorCorrection: 'M',
+ margin: 4,
+ darkColor: '#000000',
+ lightColor: '#FFFFFF',
+});
+
+// Returns base64 encoded image or download URL
+console.log(data.qrCode);
+```
+
+### 5๏ธโฃ URL & Web APIs
+
+#### URL Shortener API
+
+Create and manage short URLs with analytics.
+
+```typescript
+import { ShortURLApi, Configuration } from '@devmehq/sdk-js';
+
+const config = new Configuration({ apiKey: 'demo-key' });
+const shortUrlApi = new ShortURLApi(config);
+
+// Create short URL
+const { data } = await shortUrlApi.v1CreateShortUrl({
+ url: 'https://example.com/very-long-url-path',
+ domain: 'short.link',
+ customSuffix: 'mylink',
+});
+
+console.log(data);
// {
-// asn: 14618,
-// aso: 'AMAZON-AES',
-// city: {
-// accuracyRadius: 1000,
-// latitude: 39.0469,
-// longitude: -77.4903,
-// metroCode: 511,
-// name: 'Ashburn',
-// timeZone: 'America/New_York',
-// },
-// countryCode: 'US',
-// ip: '52.45.23.11',
-// registeredCountryCode: 'US',
+// shortUrl: 'https://short.link/mylink',
+// originalUrl: 'https://example.com/very-long-url-path',
+// qrCode: 'base64-qr-code-image',
+// createdAt: '2024-01-20T10:30:00.000Z'
// }
+// Bulk create short URLs
+const bulkUrls = await shortUrlApi.v1CreateBulkShortUrls({
+ urls: [{ url: 'https://example1.com' }, { url: 'https://example2.com' }, { url: 'https://example3.com' }],
+});
```
-## Testing
-```shell
+#### URL Metadata API
+
+Extract metadata, Open Graph tags, and content from any URL.
+
+```typescript
+import { URLMetadataApi, Configuration } from '@devmehq/sdk-js';
+
+const config = new Configuration({ apiKey: 'demo-key' });
+const metadataApi = new URLMetadataApi(config);
+
+const { data } = await metadataApi.v1GetMetadata({
+ url: 'https://example.com',
+});
+
+console.log(data);
+// {
+// title: 'Example Domain',
+// description: 'Example Domain for Documentation',
+// image: 'https://example.com/image.png',
+// favicon: 'https://example.com/favicon.ico',
+// author: 'John Doe',
+// keywords: ['example', 'documentation'],
+// openGraph: { ... },
+// twitter: { ... }
+// }
+```
+
+#### One-Time URL API
+
+Create secure, self-destructing URLs for sensitive content.
+
+```typescript
+import { OneTimeURLApi, Configuration } from '@devmehq/sdk-js';
+
+const config = new Configuration({ apiKey: 'demo-key' });
+const oneTimeApi = new OneTimeURLApi(config);
+
+const { data } = await oneTimeApi.v1CreateOneTimeUrl({
+ content: 'This is sensitive information',
+ expiresIn: 3600, // 1 hour
+ maxViews: 1,
+});
+
+console.log(data);
+// {
+// url: 'https://dev.me/ot/abc123xyz',
+// expiresAt: '2024-01-20T11:30:00.000Z',
+// maxViews: 1
+// }
+```
+
+### 6๏ธโฃ Global Data APIs
+
+#### Country Data API
+
+Get comprehensive information about countries worldwide.
+
+```typescript
+import { CountryApi, Configuration } from '@devmehq/sdk-js';
+
+const config = new Configuration({ apiKey: 'demo-key' });
+const countryApi = new CountryApi(config);
+
+// Get country by code
+const { data } = await countryApi.v1GetCountryByCode({
+ code: 'US',
+});
+
+// List all countries
+const countries = await countryApi.v1ListCountries({
+ limit: 10,
+ page: 1,
+});
+
+console.log(data);
+// {
+// name: 'United States',
+// code: 'US',
+// code3: 'USA',
+// capital: 'Washington, D.C.',
+// region: 'Americas',
+// subregion: 'North America',
+// population: 331002651,
+// area: 9833517,
+// languages: ['English'],
+// currencies: [{ code: 'USD', name: 'US Dollar', symbol: '$' }],
+// timezones: ['UTC-12:00', 'UTC-11:00', ...],
+// flag: 'https://flags.dev.me/us.svg'
+// }
+```
+
+### 7๏ธโฃ Management APIs
+
+#### API Key Management
+
+Manage your API keys programmatically.
+
+```typescript
+import { APIKeyApi, Configuration } from '@devmehq/sdk-js';
+
+const config = new Configuration({ apiKey: 'YOUR_MASTER_KEY' });
+const apiKeyApi = new APIKeyApi(config);
+
+// Create new API key
+const { data } = await apiKeyApi.v1CreateApiKey({
+ name: 'Production Key',
+ permissions: ['read', 'write'],
+ rateLimit: 10000,
+});
+
+// List API keys
+const keys = await apiKeyApi.v1ListApiKeys();
+
+// Revoke API key
+await apiKeyApi.v1RevokeApiKey({ keyId: 'key-id' });
+```
+
+#### API Usage Analytics
+
+Track and analyze your API usage.
+
+```typescript
+import { APIUsageApi, Configuration } from '@devmehq/sdk-js';
+
+const config = new Configuration({ apiKey: 'YOUR_API_KEY' });
+const usageApi = new APIUsageApi(config);
+
+// Get usage statistics
+const { data } = await usageApi.v1GetUsageStats({
+ startDate: '2024-01-01',
+ endDate: '2024-01-31',
+ service: 'email',
+});
+
+console.log(data);
+// {
+// totalRequests: 5432,
+// successfulRequests: 5300,
+// failedRequests: 132,
+// usage: [
+// { date: '2024-01-01', count: 234, service: 'email' },
+// { date: '2024-01-02', count: 189, service: 'email' },
+// ...
+// ]
+// }
+```
+
+## ๐ ๏ธ Advanced Configuration
+
+### Custom Timeout
+
+```typescript
+const config = new Configuration({
+ apiKey: 'YOUR_API_KEY',
+ basePath: 'https://api.dev.me',
+ timeout: 10000, // 10 seconds
+});
+```
+
+### Custom Headers
+
+```typescript
+const config = new Configuration({
+ apiKey: 'YOUR_API_KEY',
+ baseOptions: {
+ headers: {
+ 'X-Custom-Header': 'value',
+ },
+ },
+});
+```
+
+### Proxy Configuration
+
+```typescript
+const config = new Configuration({
+ apiKey: 'YOUR_API_KEY',
+ baseOptions: {
+ proxy: {
+ host: 'proxy.example.com',
+ port: 8080,
+ auth: {
+ username: 'user',
+ password: 'pass',
+ },
+ },
+ },
+});
+```
+
+## ๐งช Testing
+
+```bash
+# Run all tests
yarn test
+
+# Run tests with coverage
+yarn test:coverage
+
+# Run tests in watch mode
+yarn test:watch
+```
+
+## ๐ Rate Limits
+
+| Plan | Monthly Requests | Rate Limit |
+| ------------ | ---------------- | ----------- |
+| Free | 500 | 10/minute |
+| Essential | 15,000 | 100/minute |
+| Standard | 60,000 | 500/minute |
+| Professional | 1,000,000 | 2000/minute |
+| Enterprise | Unlimited | Custom |
+
+View pricing details at [dev.me/pricing](https://dev.me/pricing)
+
+## ๐ง Error Handling
+
+```typescript
+import { EmailApi, Configuration } from '@devmehq/sdk-js';
+
+const config = new Configuration({ apiKey: 'YOUR_API_KEY' });
+const emailApi = new EmailApi(config);
+
+try {
+ const { data } = await emailApi.v1GetEmailDetails({
+ email: 'invalid-email',
+ });
+} catch (error) {
+ if (error.response) {
+ // API error response
+ console.error('API Error:', error.response.data);
+ console.error('Status Code:', error.response.status);
+ } else if (error.request) {
+ // Network error
+ console.error('Network Error:', error.message);
+ } else {
+ // Other errors
+ console.error('Error:', error.message);
+ }
+}
+```
+
+## ๐ Browser Usage
+
+### Using CDN
+
+```html
+
+
```
-## Need Help?
-If you need help please drop us a message, we would be glad to help @ [Contact us](http://dev.me/contact-us)
+### Using ES Modules
+
+```javascript
+import { CurrencyApi, Configuration } from '@devmehq/sdk-js';
+
+const config = new Configuration({ apiKey: 'demo-key' });
+const currencyApi = new CurrencyApi(config);
+
+// Use in your React/Vue/Angular components
+```
+
+## ๐ TypeScript Support
+
+Full TypeScript support with type definitions included:
+
+```typescript
+import { CurrencyApi, Configuration, V1ConvertCurrencyRequest, V1ConvertCurrencyResponse } from '@devmehq/sdk-js';
+
+const config: Configuration = new Configuration({ apiKey: 'demo-key' });
+const currencyApi: CurrencyApi = new CurrencyApi(config);
+
+const request: V1ConvertCurrencyRequest = {
+ amount: 100,
+ from: 'USD',
+ to: 'EUR',
+};
+
+const response: V1ConvertCurrencyResponse = await currencyApi.v1ConvertCurrency(request);
+```
+
+## ๐ค Contributing
+
+We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
+
+1. Fork the repository
+2. Create your feature branch (`git checkout -b feature/amazing-feature`)
+3. Commit your changes (`git commit -m 'Add amazing feature'`)
+4. Push to the branch (`git push origin feature/amazing-feature`)
+5. Open a Pull Request
+
+## ๐ Bug Reports
+
+Found a bug? Please [open an issue](https://github.com/devmehq/devme-sdk-js/issues) with:
+
+- SDK version
+- Node.js/Browser version
+- Code snippet to reproduce
+- Error messages/stack traces
+
+## ๐ License
+
+This project is licensed under the MIT License - see the [LICENSE](LICENSE.md) file for details.
+
+## ๐ Support
+
+- ๐ง Email: [support@dev.me](mailto:support@dev.me)
+- ๐ Documentation: [dev.me/docs](https://dev.me/docs)
+- ๐ฆ Twitter: [@devmedotme](https://twitter.com/devmedotme)
+
+## ๐ Links
+- [API Documentation](https://dev.me/docs)
+- [Pricing](https://dev.me/pricing)
+- [Blog](https://dev.me/blog)
+- [Changelog](CHANGELOG.md)
-## Contributing
-Please feel free to open an issue or create a pull request and fix bugs or add features, All contributions are welcome. Thank you!
+---
-## LICENSE [MIT](LICENSE.md)
+
+Made with โค๏ธ by
DEV.ME Team
+
diff --git a/__tests__/currency-test.ts b/__tests__/currency-test.ts
index f2564e9..76ad46d 100644
--- a/__tests__/currency-test.ts
+++ b/__tests__/currency-test.ts
@@ -1,29 +1,29 @@
import { currencyApi } from './helper';
-import { expect } from 'chai';
-describe('currency', async function () {
- it('should convert currency USD - EUR', async function () {
+describe('currency', () => {
+ it('should convert currency USD - EUR', async () => {
const { data } = await currencyApi.v1ConvertCurrency({
amount: 10,
from: 'USD',
to: 'EUR',
});
- expect(data.from).to.be.eql('USD');
- expect(data.to).to.be.eql('EUR');
+ expect(data.from).toBe('USD');
+ expect(data.to).toBe('EUR');
- expect(data.convertedAmount).to.be.greaterThanOrEqual(9);
- expect(data.convertedAmount).to.be.greaterThan(8);
+ expect(data.convertedAmount).toBeGreaterThanOrEqual(7);
+ expect(data.convertedAmount).toBeGreaterThan(5);
- expect(data.exchangeRate).to.be.greaterThanOrEqual(0.9);
- expect(data.exchangeRate).to.be.greaterThan(0.8);
+ expect(data.exchangeRate).toBeGreaterThanOrEqual(0.7);
+ expect(data.exchangeRate).toBeGreaterThan(0.5);
- expect(data.originalAmount).to.be.eql(10);
+ expect(data.originalAmount).toBe(10);
- expect(data.convertedText.startsWith('10 USD equal to')).to.be.eql(true);
- expect(data.rateTime.startsWith('2023-')).to.be.eql(true);
+ expect(data.convertedText.startsWith('10 USD equal to')).toBe(true);
+ expect(typeof data.rateTime).toBe('string');
+ expect(data.rateTime.length).toBeGreaterThan(0);
- // expect(result).to.be.eql({
+ // expect(result).toEqual({
// convertedAmount: 8.819,
// convertedText: '10 USD equal to 8.819 EUR',
// exchangeRate: 0.8819,
@@ -33,9 +33,10 @@ describe('currency', async function () {
// to: 'EUR',
// });
});
- it('should list currencies', async function () {
+
+ it('should list currencies', async () => {
const { data } = await currencyApi.v1ListCurrencies({ code: ['EUR', 'USD'] });
- expect(data.list.length).to.be.eql(2);
- expect(data.list[1].code).to.be.eql('USD');
+ expect(data.list.length).toBe(2);
+ expect(data.list[1].code).toBe('USD');
});
});
diff --git a/__tests__/email-test.ts b/__tests__/email-test.ts
new file mode 100644
index 0000000..833a3cf
--- /dev/null
+++ b/__tests__/email-test.ts
@@ -0,0 +1,92 @@
+import { emailApi } from './helper';
+
+describe('email', () => {
+ it('should validate a valid email address', async () => {
+ const { data } = await emailApi.v1GetEmailDetails({
+ email: 'test@gmail.com',
+ verifyMx: 'true',
+ verifySmtp: 'false',
+ detectName: 'true',
+ });
+
+ expect(data.email).toBe('test@gmail.com');
+ expect(data.validMx).toBeDefined();
+ expect(data.validSmtp).toBeDefined();
+ expect(data.isDisposable).toBeDefined();
+ expect(data.isFree).toBeDefined();
+ });
+
+ it('should detect disposable email', async () => {
+ const { data } = await emailApi.v1GetEmailDetails({
+ email: 'test@mailinator.com',
+ verifyMx: 'false',
+ verifySmtp: 'false',
+ });
+
+ expect(data.email).toBe('test@mailinator.com');
+ expect(data.isDisposable).toBe(true);
+ });
+
+ it('should validate email with domain check', async () => {
+ const { data } = await emailApi.v1GetEmailDetails({
+ email: 'test@example.com',
+ verifyMx: 'true',
+ verifySmtp: 'false',
+ });
+
+ expect(data.email).toBe('test@example.com');
+ expect(data.validFormat).toBeDefined();
+ expect(typeof data.validFormat).toBe('boolean');
+ expect(data.validMx).toBeDefined();
+ });
+
+ it('should check free email provider', async () => {
+ const { data } = await emailApi.v1GetEmailDetails({
+ email: 'user@gmail.com',
+ verifyMx: 'false',
+ verifySmtp: 'false',
+ });
+
+ expect(data.email).toBe('user@gmail.com');
+ expect(data.isFree).toBe(true);
+ expect(data.isDisposable).toBe(false);
+ });
+
+ it('should provide comprehensive email validation', async () => {
+ const { data } = await emailApi.v1GetEmailDetails({
+ email: 'john.doe@gmail.com',
+ verifyMx: 'true',
+ verifySmtp: 'false',
+ detectName: 'true',
+ });
+
+ expect(data.email).toBe('john.doe@gmail.com');
+ expect(data.validFormat).toBeDefined();
+ expect(typeof data.validFormat).toBe('boolean');
+
+ // Check basic validation fields
+ expect(data.isDisposable).toBeDefined();
+ expect(data.isFree).toBeDefined();
+ expect(data.validMx).toBeDefined();
+
+ // Check for scoring if available
+ if (data.score) {
+ expect(typeof data.score).toBe('number');
+ expect(data.score).toBeGreaterThanOrEqual(0);
+ expect(data.score).toBeLessThanOrEqual(100);
+ }
+ });
+
+ it('should validate business email', async () => {
+ const { data } = await emailApi.v1GetEmailDetails({
+ email: 'contact@microsoft.com',
+ verifyMx: 'true',
+ verifySmtp: 'false',
+ });
+
+ expect(data.email).toBe('contact@microsoft.com');
+ expect(data.isFree).toBe(false);
+ expect(data.validFormat).toBe(true);
+ expect(data.validMx).toBeDefined();
+ });
+});
diff --git a/__tests__/helper.ts b/__tests__/helper.ts
index be011c3..4a97e5d 100644
--- a/__tests__/helper.ts
+++ b/__tests__/helper.ts
@@ -1,5 +1,7 @@
-import { Configuration, CurrencyApi, IPApi } from '../src';
+import { Configuration, CurrencyApi, EmailApi, IPApi, PhoneApi } from '../src';
const config = new Configuration({ apiKey: 'demo-key' });
export const currencyApi = new CurrencyApi(config);
export const ipApi = new IPApi(config);
+export const emailApi = new EmailApi(config);
+export const phoneApi = new PhoneApi(config);
diff --git a/__tests__/ip-test.ts b/__tests__/ip-test.ts
index 6109df2..7ef57c3 100644
--- a/__tests__/ip-test.ts
+++ b/__tests__/ip-test.ts
@@ -1,24 +1,19 @@
import { ipApi } from './helper';
-import { expect } from 'chai';
-describe('ip', async function () {
- it('should get the correct data', async function () {
+describe('ip', () => {
+ it('should get the correct data', async () => {
const { data } = await ipApi.v1GetIpDetails({ ip: '52.45.23.11' });
- expect(data).to.be.contain({
+
+ expect(data).toMatchObject({
asn: 14618,
aso: 'AMAZON-AES',
countryCode: 'US',
ip: '52.45.23.11',
registeredCountryCode: 'US',
});
- expect(data?.city).to.be.contain({
- name: 'Ashburn',
- region: 'Virginia',
- latitude: 39.0469,
- longitude: -77.4903,
- accuracyRadius: 1000,
- timeZone: 'America/New_York',
- areaCode: '0',
- });
+
+ expect(data?.city?.name).toBe('Ashburn');
+ expect(data?.city?.latitude).toBe(39.0469);
+ expect(data?.city?.longitude).toBe(-77.4903);
});
});
diff --git a/__tests__/phone-test.ts b/__tests__/phone-test.ts
new file mode 100644
index 0000000..4933b2a
--- /dev/null
+++ b/__tests__/phone-test.ts
@@ -0,0 +1,68 @@
+import { phoneApi } from './helper';
+
+describe('phone', () => {
+ it('should validate a valid US phone number', async () => {
+ const { data } = await phoneApi.v1GetPhoneDetails({
+ phone: '+14155552671',
+ });
+
+ expect(data).toBeDefined();
+ expect(data.valid).toBe(true);
+ expect(data.number).toBeDefined();
+ expect(typeof data.number).toBe('string');
+ });
+
+ it('should validate a valid UK phone number', async () => {
+ const { data } = await phoneApi.v1GetPhoneDetails({
+ phone: '+442071234567',
+ });
+
+ expect(data).toBeDefined();
+ expect(data.valid).toBe(true);
+ expect(data.number).toBeDefined();
+ });
+
+ it('should validate a valid German phone number', async () => {
+ const { data } = await phoneApi.v1GetPhoneDetails({
+ phone: '+491701234567',
+ });
+
+ expect(data).toBeDefined();
+ expect(data.valid).toBe(true);
+ expect(data.number).toBeDefined();
+ });
+
+ it('should handle phone number with international format', async () => {
+ const { data } = await phoneApi.v1GetPhoneDetails({
+ phone: '+33123456789', // French number
+ });
+
+ expect(data).toBeDefined();
+ expect(data.number).toBeDefined();
+ expect(typeof data.valid).toBe('boolean');
+ });
+
+ it('should provide basic phone information', async () => {
+ const { data } = await phoneApi.v1GetPhoneDetails({
+ phone: '+12125551234',
+ });
+
+ expect(data).toBeDefined();
+ expect(data.valid).toBe(true);
+ expect(data.number).toBeDefined();
+
+ // Optional fields that may or may not be present
+ if (data.countryCode) {
+ expect(typeof data.countryCode).toBe('string');
+ }
+ if (data.countryName) {
+ expect(typeof data.countryName).toBe('string');
+ }
+ if (data.carrier) {
+ expect(typeof data.carrier).toBe('string');
+ }
+ if (data.lineType) {
+ expect(typeof data.lineType).toBe('string');
+ }
+ });
+});
diff --git a/jest.config.js b/jest.config.js
new file mode 100644
index 0000000..c1abde6
--- /dev/null
+++ b/jest.config.js
@@ -0,0 +1,25 @@
+/** @type {import('jest').Config} */
+module.exports = {
+ preset: 'ts-jest',
+ testEnvironment: 'node',
+ roots: ['/__tests__'],
+ testMatch: ['**/*-test.ts'],
+ collectCoverageFrom: ['src/**/*.{ts,tsx}', '!src/**/*.d.ts', '!src/**/index.ts'],
+ coverageDirectory: 'coverage',
+ coverageReporters: ['text', 'lcov', 'html'],
+ testTimeout: 10000,
+ bail: true,
+ verbose: true,
+ maxWorkers: 1,
+ moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
+ transform: {
+ '^.+\\.ts$': [
+ 'ts-jest',
+ {
+ tsconfig: {
+ module: 'commonjs',
+ },
+ },
+ ],
+ },
+};
diff --git a/package.json b/package.json
index a37b77d..e85297d 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,6 @@
{
"name": "@devmehq/sdk-js",
- "version": "1.1.2",
- "private": false,
+ "version": "1.1.4",
"description": "DEV.ME SDK for JavaScript & TypeScript for Server & Browser, Compatible with Node.js & React & Vue.js & Angular",
"keywords": [
"Email SMTP Verification",
@@ -29,16 +28,62 @@
},
"license": "MIT",
"author": "DEV.ME (https://dev.me)",
- "main": "./index.js",
- "typings": "./index.d.ts",
+ "main": "./dist/index.js",
+ "types": "./dist/index.d.ts",
+ "typings": "./dist/index.d.ts",
+ "exports": {
+ ".": {
+ "types": "./dist/index.d.ts",
+ "require": "./dist/index.js",
+ "import": "./dist/index.js",
+ "default": "./dist/index.js"
+ },
+ "./api": {
+ "types": "./dist/api.d.ts",
+ "require": "./dist/api.js",
+ "import": "./dist/api.js",
+ "default": "./dist/api.js"
+ },
+ "./configuration": {
+ "types": "./dist/configuration.d.ts",
+ "require": "./dist/configuration.js",
+ "import": "./dist/configuration.js",
+ "default": "./dist/configuration.js"
+ },
+ "./base": {
+ "types": "./dist/base.d.ts",
+ "require": "./dist/base.js",
+ "import": "./dist/base.js",
+ "default": "./dist/base.js"
+ },
+ "./common": {
+ "types": "./dist/common.d.ts",
+ "require": "./dist/common.js",
+ "import": "./dist/common.js",
+ "default": "./dist/common.js"
+ },
+ "./package.json": "./package.json"
+ },
+ "files": [
+ "dist",
+ "README.md",
+ "CHANGELOG.md",
+ "LICENSE",
+ "package.json"
+ ],
"scripts": {
"build": "rm -rf dist && tsc -p .",
"lint": "eslint src __tests__",
"lint-fix": "yarn lint -- --fix",
- "prepare": "yarn husky install",
+ "prepare": "husky",
"prettier": "prettier --write \"src/**/*.{ts,json}\" \"__tests__/**/*.{ts,json}\"",
- "test": "TS_NODE_TRANSPILE_ONLY=1 TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' mocha",
- "test-ci": "TS_NODE_TRANSPILE_ONLY=1 TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' mocha"
+ "test": "jest",
+ "test-ci": "jest --ci",
+ "test:watch": "jest --watch",
+ "test:coverage": "jest --coverage",
+ "prepublishOnly": "yarn build",
+ "release": "semantic-release",
+ "release:dry": "semantic-release --dry-run"
},
"lint-staged": {
"src/**/*.{ts,json}": "prettier --write",
@@ -48,16 +93,16 @@
"axios": "1.11.0"
},
"devDependencies": {
- "@types/chai": "5.2.2",
- "@types/mocha": "10.0.10",
- "chai": "6.0.1",
+ "@types/jest": "^30.0.0",
"husky": "9.1.7",
+ "jest": "^30.1.3",
"lint-staged": "16.1.6",
- "mocha": "11.7.2",
+ "ms": "^2.1.3",
"prettier": "3.6.2",
"pretty-quick": "4.2.2",
- "should": "13.2.3",
+ "ts-jest": "^29.4.1",
"ts-node": "10.9.2",
"typescript": "5.9.2"
- }
+ },
+ "packageManager": "yarn@1.22.22"
}
diff --git a/release.config.js b/release.config.js
deleted file mode 100644
index 0fc00e0..0000000
--- a/release.config.js
+++ /dev/null
@@ -1,75 +0,0 @@
-// https://semantic-release.gitbook.io/semantic-release/usage/configuration
-const pkg = require('./package.json');
-const branch = process.env.BRANCH || process.env.CI_REF_NAME || '';
-const branchSlug = branch.replace(/\//g, '-');
-const branchPrefix = branch.split('/')[0];
-
-const isMaster = branch === 'master' || branch === 'main';
-// semantic-release configuration
-module.exports = {
- branches: [
- {
- name: 'master',
- prerelease: false,
- },
- {
- name: 'main',
- prerelease: false,
- },
- {
- name: 'next',
- prerelease: 'next',
- },
- {
- name: 'develop',
- prerelease: 'beta',
- },
- { name: branchSlug, prerelease: 'alpha' },
- { name: `${branchPrefix}/**`, prerelease: 'alpha' },
- ],
- plugins: [
- [
- '@semantic-release/commit-analyzer',
- {
- preset: 'angular',
- releaseRules: [
- { type: 'breaking', release: 'major' },
- { type: 'feat', release: 'minor' },
- { type: 'fix', release: 'patch' },
- { type: 'revert', release: 'patch' },
- { type: 'docs', release: 'patch' },
- { type: 'refactor', release: 'patch' },
- { type: 'style', release: 'patch' },
- { type: 'test', release: 'patch' },
- { type: 'chore', release: 'patch' },
- { type: 'ci', release: 'patch' },
- { type: 'perf', release: 'patch' },
- { type: 'build', release: 'patch' },
- ],
- },
- ],
- ['@semantic-release/release-notes-generator'],
- // https://github.com/semantic-release/npm
- ['@semantic-release/npm'],
- // https://github.com/semantic-release/github
- [
- '@semantic-release/github',
- {
- successComment: false,
- failComment: false,
- },
- ],
- // https://github.com/semantic-release/git
- isMaster && [
- '@semantic-release/git',
- {
- assets: ['package.json', 'package-lock.json', 'yarn.lock', 'npm-shrinkwrap.json', 'CHANGELOG.md'],
- message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}',
- GIT_AUTHOR_NAME: pkg.author.name,
- GIT_AUTHOR_EMAIL: pkg.author.email,
- GIT_COMMITTER_NAME: pkg.author.name,
- GIT_COMMITTER_EMAIL: pkg.author.email,
- },
- ],
- ].filter(Boolean),
-};
diff --git a/release.sh b/release.sh
deleted file mode 100644
index 98e85af..0000000
--- a/release.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env bash
-set -e
-my_dir="$(dirname "$0")"
-version=${1:-patch}
-yarn test
-yarn build
-git add .
-git commit -am "chose: update release" || true
-npm version $version --message "chose: update release" || true
-git push || true
-git push --tags || true
-cp package.json README.md LICENSE.md CHANGELOG.md yarn.lock ./dist/
-grep -v '"prepare":' ./dist/package.json > ./dist/temp-package.json && mv -f ./dist/temp-package.json ./dist/package.json
-npm publish ./dist --ignore-scripts --access public
diff --git a/src/api.ts b/src/api.ts
index fdd5cd7..9371b26 100644
--- a/src/api.ts
+++ b/src/api.ts
@@ -1,913 +1,4734 @@
/**
* 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
+ * **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
+
*/
-import { Configuration } from './configuration';
-import globalAxios, { AxiosInstance, AxiosPromise, AxiosRequestConfig } from 'axios';
+import type { Configuration } from './configuration';
+import type { AxiosInstance, AxiosPromise, RawAxiosRequestConfig } from 'axios';
+import globalAxios from 'axios';
// Some imports not used depending on template conditions
+// @ts-ignore
import {
assertParamExists,
createRequestFunction,
DUMMY_BASE_URL,
serializeDataIfNeeded,
setApiKeyToObject,
+ setBasicAuthToObject,
+ setBearerAuthToObject,
+ setOAuthToObject,
setSearchParams,
toPathString,
} from './common';
-import { BASE_PATH, BaseAPI, RequestArgs, RequiredError } from './base';
+import type { RequestArgs } from './base';
+// @ts-ignore
+import { BASE_PATH, BaseAPI, COLLECTION_FORMATS, operationServerMap, RequiredError } from './base';
/**
*
- * @export
- * @interface CaptureUrlScreenshotIn
*/
-export interface CaptureUrlScreenshotIn {
+export interface ApiUsageItem {
/**
- * URL to capture
- * @type {string}
- * @memberof CaptureUrlScreenshotIn
+ * Date of usage
*/
- url?: string;
+ date?: string;
+ /**
+ * Service name
+ */
+ service?: string;
/**
- * Include HTML in the response
- * @type {boolean}
- * @memberof CaptureUrlScreenshotIn
+ * Number of requests
*/
- includeHtml?: boolean;
+ count?: number;
+ /**
+ * User ID
+ */
+ userId?: string;
}
/**
*
- * @export
- * @interface CaptureUrlScreenshotOut
*/
-export interface CaptureUrlScreenshotOut {
+export interface BulkShortUrlItem {
/**
- * URL to capture
- * @type {string}
- * @memberof CaptureUrlScreenshotOut
+ * Original URL to shorten
*/
url?: string;
/**
- * Base64 encoded screenshot
- * @type {string}
- * @memberof CaptureUrlScreenshotOut
+ * Domain to use for short URL
*/
- screenshot?: string;
+ domain?: string;
/**
- * HTML of the page
- * @type {string}
- * @memberof CaptureUrlScreenshotOut
+ * Custom suffix for the short URL (optional)
*/
- html?: string;
+ suffix?: string;
}
/**
*
- * @export
- * @interface ConvertCurrencyOut
*/
-export interface ConvertCurrencyOut {
+export interface BulkShortUrlResult {
/**
- * currency to convert from
- * @type {string}
- * @memberof ConvertCurrencyOut
+ * Whether the URL was created successfully
*/
- from?: string;
+ success?: boolean;
/**
- * currency to convert to
- * @type {string}
- * @memberof ConvertCurrencyOut
+ * Original URL
*/
- to?: string;
+ url?: string;
/**
- * exchange rate
- * @type {number}
- * @memberof ConvertCurrencyOut
+ * Generated short URL (if successful)
*/
- exchangeRate?: number;
+ shortUrl?: string;
/**
- * time of the exchange rate
- * @type {string}
- * @memberof ConvertCurrencyOut
+ * Domain used
*/
- rateTime?: string;
+ domain?: string;
/**
- * original amount input
- * @type {number}
- * @memberof ConvertCurrencyOut
+ * Short ID (if successful)
*/
- originalAmount?: number;
+ sid?: string;
/**
- * converted amount
- * @type {number}
- * @memberof ConvertCurrencyOut
+ * Error message (if failed)
*/
- convertedAmount?: number;
+ error?: string;
+}
+
+/**
+ *
+ */
+export interface CapitalInfo {
/**
- * converted amount in text
- * @type {string}
- * @memberof ConvertCurrencyOut
+ * Latitude and longitude of capital
*/
- convertedText?: string;
+ latlng?: Array;
}
/**
*
- * @export
- * @interface CreateShortUrlIn
*/
-export interface CreateShortUrlIn {
+export interface CarInfo {
/**
- * long url
- * @type {string}
- * @memberof CreateShortUrlIn
+ * Car signs
*/
- url?: string;
+ signs?: Array;
+ /**
+ * Driving side (left/right)
+ */
+ side?: string;
}
/**
- *
- * @export
- * @interface CreateShortUrlOut
+ * Currency conversion response
*/
-export interface CreateShortUrlOut {
+export interface ConvertCurrencyOut {
/**
- * original url
- * @type {string}
- * @memberof CreateShortUrlOut
+ * Source currency code
*/
- url?: string;
+ from: string;
/**
- * short url
- * @type {string}
- * @memberof CreateShortUrlOut
+ * Target currency code
*/
- shortUrl?: string;
+ to: string;
/**
- * short url id
- * @type {string}
- * @memberof CreateShortUrlOut
+ * Exchange rate used
*/
- sid?: string;
+ exchangeRate: number;
/**
- * created at timestamp
- * @type {string}
- * @memberof CreateShortUrlOut
+ * Timestamp of the rate
*/
- createdAt?: string;
+ rateTime: string;
+ /**
+ * Original amount
+ */
+ originalAmount: number;
+ /**
+ * Converted amount
+ */
+ convertedAmount: number;
+ /**
+ * Human-readable conversion text
+ */
+ convertedText: string;
+ /**
+ * Data provider used (if available)
+ */
+ provider?: string;
+ /**
+ * Whether the rate was cached
+ */
+ cached?: boolean;
+ /**
+ * Performance metrics (only when getPerformanceData=1)
+ */
+ performance?: object;
}
/**
*
- * @export
- * @interface DeleteShortUrlIn
*/
-export interface DeleteShortUrlIn {
+export interface CountryName {
/**
- * short url sid
- * @type {string}
- * @memberof DeleteShortUrlIn
+ * Common country name
*/
- sid?: string;
+ common?: string;
+ /**
+ * Official country name
+ */
+ official?: string;
+ /**
+ * Native names by language code
+ */
+ nativeName?: object;
}
/**
*
- * @export
- * @interface DeleteShortUrlOut
*/
-export interface DeleteShortUrlOut {
+export interface CreateApiKeyIn {
/**
- * delete success
- * @type {boolean}
- * @memberof DeleteShortUrlOut
+ * Name/description for the API key
*/
- success?: boolean;
+ name?: string;
+ /**
+ * List of services this key can access
+ */
+ services?: Array;
+ /**
+ * Whether to enable the API key immediately
+ */
+ isEnabled?: boolean;
}
/**
*
- * @export
- * @interface GetCountryDetailsOut
*/
-export interface GetCountryDetailsOut {
+export interface CreateBulkShortUrlsRequest {
/**
- * country code ISO 4217
- * @type {string}
- * @memberof GetCountryDetailsOut
+ * Array of URLs to shorten (max 100)
*/
- code?: string;
+ items?: Array;
/**
- * country name
- * @type {string}
- * @memberof GetCountryDetailsOut
+ * Custom batch ID for this bulk operation (optional)
*/
- name?: string;
+ batchId?: string;
}
/**
*
- * @export
- * @interface GetCurrencyDetailsOut
*/
-export interface GetCurrencyDetailsOut {
+export interface CreateBulkShortUrlsResponse {
/**
- * currency code ISO 4217
- * @type {string}
- * @memberof GetCurrencyDetailsOut
+ * Number of successfully created short URLs
*/
- code?: string;
+ created?: number;
+ /**
+ * Number of failed creations
+ */
+ failed?: number;
+ /**
+ * Unique identifier for this bulk operation
+ */
+ batchId?: string;
/**
- * currency name object
- * @type {object}
- * @memberof GetCurrencyDetailsOut
+ * Detailed results for each item
*/
- name?: object;
+ results?: Array;
}
/**
*
- * @export
- * @interface GetCurrencyExchangeRateOut
*/
-export interface GetCurrencyExchangeRateOut {
+export interface CreateOnetimeUrlIn {
/**
- * currency to get exchange rate from
- * @type {string}
- * @memberof GetCurrencyExchangeRateOut
+ * The secret text/content to share
*/
- from?: string;
+ text: string;
/**
- * currency to get exchange rate to
- * @type {string}
- * @memberof GetCurrencyExchangeRateOut
+ * Optional password protection (leave empty for no password)
*/
- to?: string;
+ passphrase?: string;
/**
- * exchange rate
- * @type {number}
- * @memberof GetCurrencyExchangeRateOut
+ * Domain to use for the URL
*/
- exchangeRate?: number;
+ domain?: string;
/**
- * time of the exchange rate
- * @type {string}
- * @memberof GetCurrencyExchangeRateOut
+ * Custom suffix for the URL
*/
- rateTime?: string;
+ suffix?: string;
+ /**
+ * Lifetime in seconds (default: 7 days)
+ */
+ lifetime?: number;
+ /**
+ * Maximum number of times the URL can be viewed (default: 1)
+ */
+ maxViews?: number;
}
/**
*
- * @export
- * @interface GetDomainWhoisOut
*/
-export interface GetDomainWhoisOut {
+export interface CreateOnetimeUrlOut {
/**
- * Domain name
- * @type {string}
- * @memberof GetDomainWhoisOut
+ * The complete one-time URL
*/
- domain?: string;
+ onetimeUrl: string;
/**
- * WHOIS text
- * @type {string}
- * @memberof GetDomainWhoisOut
+ * Domain used for the URL
*/
- whoisText?: string;
+ domain: string;
/**
- * WHOIS JSON
- * @type {object}
- * @memberof GetDomainWhoisOut
+ * Short ID of the one-time URL
*/
- whoisJson?: object;
+ sid: string;
+ /**
+ * ISO timestamp of creation
+ */
+ createdAt: string;
}
/**
*
- * @export
- * @interface GetEmailDetailsOut
*/
-export interface GetEmailDetailsOut {
+export interface CreateQrCodeIn {
/**
- * email address
- * @type {string}
- * @memberof GetEmailDetailsOut
+ * Data to encode in QR code
*/
- email?: string;
+ data?: string;
/**
- * is the domain is valid with dns MX record
- * @type {boolean}
- * @memberof GetEmailDetailsOut
+ * QR code type
*/
- validMx?: boolean;
+ type?: string;
/**
- * is email address valid with SMTP Connect and Reply
- * @type {boolean}
- * @memberof GetEmailDetailsOut
+ * Mixed JSON object with all QR code settings
*/
- validSmtp?: boolean;
+ settings?: object;
+}
+
+/**
+ *
+ */
+export interface CreateQrCodeOut {
/**
- * is email valid format
- * @type {boolean}
- * @memberof GetEmailDetailsOut
+ * Database ID of the QR code
*/
- validFormat?: boolean;
+ _id?: string;
/**
- * is disposable email
- * @type {boolean}
- * @memberof GetEmailDetailsOut
+ * Short ID for the QR code
*/
- isDisposable?: boolean;
+ sid?: string;
/**
- * is free email
- * @type {boolean}
- * @memberof GetEmailDetailsOut
+ * Encoded data in the QR code
*/
- isFree?: boolean;
+ data?: string;
/**
- * domain age
- * @type {number}
- * @memberof GetEmailDetailsOut
+ * Type of QR code
*/
- domainAge?: number;
+ type?: string;
/**
- * quality score
- * @type {number}
- * @memberof GetEmailDetailsOut
+ * Base64 encoded QR code image
*/
- score?: number;
+ qrCodeImage?: string;
+ settings?: QrCodeGenerationSettings;
+ /**
+ * ISO timestamp when QR code expires
+ */
+ expiresAt?: string;
+ /**
+ * ISO timestamp of creation
+ */
+ createdAt?: string;
}
/**
*
- * @export
- * @interface GetIpDetailsCityOut
*/
-export interface GetIpDetailsCityOut {
+export interface CreateQrCodeSettings {
/**
- * Accuracy Radius
- * @type {number}
- * @memberof GetIpDetailsCityOut
+ * Mixed JSON object with all QR code settings from frontend
*/
- accuracyRadius?: number;
- /**
- * Latitude
- * @type {number}
- * @memberof GetIpDetailsCityOut
- */
- latitude?: number;
+ settings?: object;
+}
+
+/**
+ *
+ */
+export interface CreateShortUrlIn {
/**
- * Longitude
- * @type {string}
- * @memberof GetIpDetailsCityOut
+ * URL to shorten
*/
- longitude?: string;
+ url: string;
/**
- * Time Zone
- * @type {string}
- * @memberof GetIpDetailsCityOut
+ * Domain to use for short URL
*/
- timeZone?: string;
+ domain?: string;
/**
- * City Name
- * @type {string}
- * @memberof GetIpDetailsCityOut
+ * Custom suffix for the short URL
*/
- name?: string;
+ suffix?: string;
}
/**
*
- * @export
- * @interface GetIpDetailsOut
*/
-export interface GetIpDetailsOut {
- /**
- * IP Address
- * @type {string}
- * @memberof GetIpDetailsOut
- */
- ip?: string;
+export interface CreateShortUrlOut {
/**
- * Country Code ISO 3166-1 Alpha-2
- * @type {string}
- * @memberof GetIpDetailsOut
+ * The original URL
*/
- countryCode?: string;
+ url: string;
/**
- * Registered Country Code ISO 3166-1 Alpha-2
- * @type {string}
- * @memberof GetIpDetailsOut
+ * The complete shortened URL
*/
- registeredCountryCode?: string;
+ shortUrl: string;
/**
- * autonomous system number
- * @type {string}
- * @memberof GetIpDetailsOut
+ * Domain used for the short URL
*/
- asn?: string;
+ domain: string;
/**
- * autonomous system organization
- * @type {string}
- * @memberof GetIpDetailsOut
+ * Short ID of the URL
*/
- aso?: string;
+ sid: string;
/**
- *
- * @type {GetIpDetailsCityOut}
- * @memberof GetIpDetailsOut
+ * ISO timestamp of creation
*/
- city?: GetIpDetailsCityOut;
+ createdAt: string;
}
/**
*
- * @export
- * @interface GetPhoneDetailsOut
*/
-export interface GetPhoneDetailsOut {
- /**
- * phone number
- * @type {string}
- * @memberof GetPhoneDetailsOut
- */
- number?: string;
- /**
- * is phone number valid
- * @type {boolean}
- * @memberof GetPhoneDetailsOut
- */
- valid?: boolean;
+export interface CurrencyDenominations {
/**
- * country code associated with phone number ISO 3166-1 alpha-2
- * @type {string}
- * @memberof GetPhoneDetailsOut
+ * Frequently used denominations
*/
- country?: string;
+ frequent?: Array;
/**
- * country calling code associated with phone number
- * @type {string}
- * @memberof GetPhoneDetailsOut
+ * Rarely used denominations
*/
- callingCode?: string;
+ rare?: Array;
+}
+
+/**
+ *
+ */
+export interface CurrencyISO {
/**
- * national number associated with phone number
- * @type {string}
- * @memberof GetPhoneDetailsOut
+ * ISO currency code
*/
- nationalNumber?: string;
+ code?: string;
/**
- * phone number type
- * @type {string}
- * @memberof GetPhoneDetailsOut
+ * ISO numeric code
*/
- type?: string;
+ number?: string;
}
/**
*
- * @export
- * @interface GetShortUrlDetailsOut
*/
-export interface GetShortUrlDetailsOut {
+export interface CurrencyMajorUnit {
/**
- * original url
- * @type {string}
- * @memberof GetShortUrlDetailsOut
+ * Major unit name
*/
- url?: string;
+ name?: string;
/**
- * short url
- * @type {string}
- * @memberof GetShortUrlDetailsOut
+ * Major unit symbol
*/
- shortUrl?: string;
+ symbol?: string;
+}
+
+/**
+ *
+ */
+export interface CurrencyMinorUnit {
/**
- * short url sid
- * @type {string}
- * @memberof GetShortUrlDetailsOut
+ * Minor unit name
*/
- sid?: string;
+ name?: string;
/**
- * created at timestamp
- * @type {string}
- * @memberof GetShortUrlDetailsOut
+ * Minor unit symbol
*/
- createdAt?: string;
+ symbol?: string;
/**
- * updated at timestamp
- * @type {string}
- * @memberof GetShortUrlDetailsOut
+ * Value relative to major unit
*/
- updatedAt?: string;
+ majorValue?: number;
+}
+
+/**
+ *
+ */
+export interface CurrencyUnits {
+ major?: CurrencyMajorUnit;
+ minor?: CurrencyMinorUnit;
}
/**
*
- * @export
- * @interface GetTextFromImageIn
*/
-export interface GetTextFromImageIn {
+export interface DeleteApiKeyIn {
/**
- * image
- * @type {object}
- * @memberof GetTextFromImageIn
+ * Database ID of the API key to delete
*/
- image?: object;
+ _id?: string;
+}
+
+/**
+ *
+ */
+export interface DeleteApiKeyOut {
/**
- * url
- * @type {string}
- * @memberof GetTextFromImageIn
+ * Whether the deletion was successful
*/
- url?: string;
+ success?: boolean;
+}
+
+/**
+ *
+ */
+export interface DeleteOnetimeUrlIn {
/**
- * language
- * @type {string}
- * @memberof GetTextFromImageIn
+ * Short ID of the one-time URL
*/
- lang?: string;
+ sid: string;
/**
- * page
- * @type {string}
- * @memberof GetTextFromImageIn
+ * Domain of the URL
*/
- psm?: string;
+ domain?: string;
/**
- * outputFormat
- * @type {string}
- * @memberof GetTextFromImageIn
+ * Passphrase if set during creation
*/
- outputFormat?: string;
+ passphrase?: string;
}
/**
*
- * @export
- * @interface GetTextFromImageOut
*/
-export interface GetTextFromImageOut {
+export interface DeleteOnetimeUrlOut {
/**
- * parsed text from image
- * @type {string}
- * @memberof GetTextFromImageOut
+ * Whether deletion was successful
*/
- text?: string;
+ success: boolean;
}
/**
*
- * @export
- * @interface HttpErrorOut
*/
-export interface HttpErrorOut {
+export interface DeleteQrCodeIn {
/**
- * http status code
- * @type {number}
- * @memberof HttpErrorOut
+ * Database ID of the QR code
*/
- status?: number;
+ _id?: string;
/**
- * error name
- * @type {string}
- * @memberof HttpErrorOut
+ * Short ID of the QR code (alternative to _id)
*/
- name?: string;
+ sid?: string;
/**
- * error message
- * @type {string}
- * @memberof HttpErrorOut
+ * Also delete related logs and short URLs (default: true)
*/
- message?: string;
+ deleteRelated?: boolean;
+}
+
+/**
+ *
+ */
+export interface DeleteQrCodeOut {
/**
- * array of errors
- * @type {Array}
- * @memberof HttpErrorOut
+ * Whether deletion was successful
*/
- errors?: Array;
+ success?: boolean;
+ deletedCount?: DeletedCountInfo;
}
/**
*
- * @export
- * @interface ListCountriesItem
*/
-export interface ListCountriesItem {
+export interface DeleteShortUrlIn {
/**
- * country code ISO 4217
- * @type {string}
- * @memberof ListCountriesItem
+ * Short ID of the URL
*/
- code?: string;
+ sid: string;
/**
- * name
- * @type {object}
- * @memberof ListCountriesItem
+ * Domain of the short URL
*/
- name?: object;
+ domain?: string;
}
/**
*
- * @export
- * @interface ListCountriesOut
*/
-export interface ListCountriesOut {
+export interface DeleteShortUrlOut {
/**
- * page number
- * @type {number}
- * @memberof ListCountriesOut
+ * Whether deletion was successful
*/
- page?: number;
+ success: boolean;
+}
+
+/**
+ *
+ */
+export interface DeletedCountInfo {
/**
- * total number of countries
- * @type {number}
- * @memberof ListCountriesOut
+ * Number of QR codes deleted
*/
- total?: number;
+ qrCode?: number;
/**
- * list of countries
- * @type {Array}
- * @memberof ListCountriesOut
+ * Number of logs deleted
*/
- list?: Array;
+ logs?: number;
}
/**
*
- * @export
- * @interface ListCurrenciesItem
*/
-export interface ListCurrenciesItem {
+export interface DetectedName {
/**
- * currency code ISO 4217
- * @type {string}
- * @memberof ListCurrenciesItem
+ * First name detected from email
*/
- code?: string;
- /**
- * banknotes
- * @type {object}
- * @memberof ListCurrenciesItem
- */
- banknotes?: object;
+ firstName?: string;
/**
- * coins
- * @type {object}
- * @memberof ListCurrenciesItem
+ * Last name detected from email
*/
- coins?: object;
+ lastName?: string;
/**
- * iso
- * @type {object}
- * @memberof ListCurrenciesItem
+ * Confidence score for name detection (0-1)
*/
- iso?: object;
+ confidence?: number;
+}
+
+/**
+ *
+ */
+export interface DomainAgeInfo {
/**
- * name
- * @type {object}
- * @memberof ListCurrenciesItem
+ * Age of the domain in days
*/
- name?: object;
+ ageInDays?: number;
/**
- * type of currency
- * @type {string}
- * @memberof ListCurrenciesItem
+ * Domain creation date
*/
- type?: ListCurrenciesItemTypeEnum;
+ createdDate?: string;
/**
- * units
- * @type {object}
- * @memberof ListCurrenciesItem
+ * Whether the age information is valid
*/
- units?: object;
+ isValid?: boolean;
}
-export const ListCurrenciesItemTypeEnum = {
- Fiat: 'fiat',
- Crypto: 'crypto',
-} as const;
-
-export type ListCurrenciesItemTypeEnum = typeof ListCurrenciesItemTypeEnum[keyof typeof ListCurrenciesItemTypeEnum];
-
/**
*
- * @export
- * @interface ListCurrenciesOut
*/
-export interface ListCurrenciesOut {
+export interface DomainRegistrationInfo {
/**
- * page number
- * @type {number}
- * @memberof ListCurrenciesOut
+ * Domain creation date
*/
- page?: number;
+ created?: string;
/**
- * total number of currencies
- * @type {number}
- * @memberof ListCurrenciesOut
+ * Domain last update date
*/
- total?: number;
+ updated?: string;
/**
- * list of currencies
- * @type {Array}
- * @memberof ListCurrenciesOut
+ * Domain expiration date
*/
- list?: Array;
-}
-
-/**
- *
- * @export
- * @interface ModelError
- */
-export interface ModelError {
+ expires?: string;
/**
- * error value
- * @type {string | number}
- * @memberof ModelError
+ * Domain registrar name
*/
- value?: string | number;
+ registrar?: string;
/**
- * error message
- * @type {string}
- * @memberof ModelError
+ * Registrant organization
*/
- msg?: string;
+ registrantOrganization?: string;
/**
- * error parameters
- * @type {string}
- * @memberof ModelError
+ * Registrant country
*/
- param?: string;
+ registrantCountry?: string;
/**
- * location of the error
- * @type {string}
- * @memberof ModelError
+ * Domain status
*/
- location?: string;
+ status?: string;
}
/**
*
- * @export
- * @interface ScrapeUrlDataIn
*/
-export interface ScrapeUrlDataIn {
+export interface DomainSuggestion {
/**
- * URL to scrape
- * @type {string}
- * @memberof ScrapeUrlDataIn
+ * Original domain with typo
*/
- url?: string;
+ original?: string;
+ /**
+ * Suggested corrected domain
+ */
+ suggested?: string;
+ /**
+ * Confidence score for suggestion (0-1)
+ */
+ confidence?: number;
}
/**
*
- * @export
- * @interface ScrapeUrlDataOut
*/
-export interface ScrapeUrlDataOut {
+export interface DownloadApiUsageOut {
/**
- * URL to scrape
- * @type {string}
- * @memberof ScrapeUrlDataOut
+ * Download URL for the exported file
*/
url?: string;
/**
- * Scraped data
- * @type {object}
- * @memberof ScrapeUrlDataOut
+ * Suggested filename for the download
*/
- metadata?: object;
+ filename?: string;
/**
- * OpenGraph data
- * @type {object}
- * @memberof ScrapeUrlDataOut
+ * MIME type of the file
*/
- openGraph?: object;
+ contentType?: string;
}
+/**
+ * error value
+ */
+export interface ErrorValue {}
+
/**
*
- * @export
- * @interface UpdateShortUrlIn
*/
-export interface UpdateShortUrlIn {
+export interface GetApiKeyDetailsIn {
/**
- * short url id
- * @type {string}
- * @memberof UpdateShortUrlIn
+ * Database ID of the API key
*/
_id?: string;
- /**
- * short url sid
- * @type {string}
- * @memberof UpdateShortUrlIn
- */
- sid?: string;
}
/**
*
- * @export
- * @interface UpdateShortUrlOut
*/
-export interface UpdateShortUrlOut {
+export interface GetApiKeyDetailsOut {
/**
- * original url
- * @type {string}
- * @memberof UpdateShortUrlOut
+ * Database document ID
*/
- originalUrl?: string;
+ _id?: string;
/**
- * short url
- * @type {string}
- * @memberof UpdateShortUrlOut
+ * Name/description of the API key
*/
- shortUrl?: string;
+ name?: string;
/**
- * short url sid
- * @type {string}
- * @memberof UpdateShortUrlOut
+ * The actual API key value
*/
- sid?: string;
+ apiKey?: string;
+ /**
+ * List of services this key can access
+ */
+ services?: Array;
+ /**
+ * Whether the API key is active
+ */
+ isEnabled?: boolean;
+ /**
+ * User ID who owns this API key
+ */
+ userId?: string;
+ /**
+ * Additional metadata
+ */
+ meta?: object;
+ /**
+ * ISO timestamp of creation
+ */
+ createdAt?: string;
+ /**
+ * ISO timestamp of last update
+ */
+ updatedAt?: string;
+}
+
+/**
+ *
+ */
+export interface GetApiUsageOut {
+ /**
+ * Array of daily usage records
+ */
+ usage?: Array;
+ /**
+ * Total number of requests in the period
+ */
+ totalRequests?: number;
+}
+
+/**
+ *
+ */
+export interface GetCityDetailsOut {
+ /**
+ * City ID
+ */
+ id?: number;
+ /**
+ * City name
+ */
+ name?: string;
+ /**
+ * Country code
+ */
+ countryCode?: string;
+ /**
+ * Country name
+ */
+ countryName?: string;
+ /**
+ * State/Province code
+ */
+ stateCode?: string;
+ /**
+ * State/Province name
+ */
+ stateName?: string;
+ /**
+ * Latitude coordinate
+ */
+ latitude?: number;
+ /**
+ * Longitude coordinate
+ */
+ longitude?: number;
+}
+
+/**
+ *
+ */
+export interface GetCountryDetailsOut {
+ /**
+ * Country code (ISO 3166-1 alpha-2)
+ */
+ code?: string;
+ /**
+ * ISO 3166-1 alpha-2 code
+ */
+ cca2?: string;
+ /**
+ * ISO 3166-1 alpha-3 code
+ */
+ cca3?: string;
+ /**
+ * ISO 3166-1 numeric code
+ */
+ ccn3?: string;
+ /**
+ * International Olympic Committee code
+ */
+ cioc?: string;
+ /**
+ * FIFA code
+ */
+ fifa?: string;
+ name?: CountryName;
+ /**
+ * Capital city/cities
+ */
+ capital?: Array;
+ capitalInfo?: CapitalInfo;
+ /**
+ * Alternative country name spellings
+ */
+ altSpellings?: Array;
+ /**
+ * Geographic region
+ */
+ region?: string;
+ /**
+ * Geographic subregion
+ */
+ subregion?: string;
+ /**
+ * Continents the country belongs to
+ */
+ continents?: Array;
+ /**
+ * Official languages (key-value pairs)
+ */
+ languages?: object;
+ /**
+ * Currency information (key-value pairs)
+ */
+ currencies?: object;
+ /**
+ * Flag emoji
+ */
+ flag?: string;
+ flags?: ImageLinks;
+ coatOfArms?: ImageLinks;
+ /**
+ * Total area in kmยฒ
+ */
+ area?: number;
+ /**
+ * Population count
+ */
+ population?: number;
+ /**
+ * Latitude and longitude coordinates
+ */
+ latlng?: Array;
+ /**
+ * Whether the country is landlocked
+ */
+ landlocked?: boolean;
+ /**
+ * Border country codes
+ */
+ borders?: Array;
+ /**
+ * Timezones
+ */
+ timezones?: Array;
+ /**
+ * Top-level domains
+ */
+ tld?: Array;
+ /**
+ * Independence status
+ */
+ independent?: boolean;
+ /**
+ * UN membership status
+ */
+ unMember?: boolean;
+ /**
+ * Country status
+ */
+ status?: string;
+ /**
+ * First day of the week
+ */
+ startOfWeek?: string;
+ car?: CarInfo;
+ idd?: IddInfo;
+ postalCode?: PostalCodeInfo;
+ /**
+ * Demonym information by language
+ */
+ demonyms?: object;
+ /**
+ * Gini coefficient by year
+ */
+ gini?: object;
+ maps?: MapsInfo;
+ /**
+ * Country name translations
+ */
+ translations?: object;
+}
+
+/**
+ *
+ */
+export interface GetCurrencyDetailsOut {
+ /**
+ * Currency code (ISO 4217)
+ */
+ code?: string;
+ /**
+ * Currency name
+ */
+ name?: string;
+ /**
+ * Native currency name
+ */
+ nameNative?: string;
+ /**
+ * Plural form of currency name
+ */
+ namePlural?: string;
+ /**
+ * Native plural form of currency name
+ */
+ namePluralNative?: string;
+ /**
+ * Currency symbol code
+ */
+ symbol?: string;
+ /**
+ * Native currency symbol (e.g., $, โฌ)
+ */
+ symbolNative?: string;
+ /**
+ * Number of decimal places
+ */
+ decimalDigits?: number;
+ /**
+ * Rounding precision
+ */
+ rounding?: number;
+ /**
+ * Flag code for primary country
+ */
+ flagCode?: string;
+ iso?: CurrencyISO;
+ units?: CurrencyUnits;
+ banknotes?: CurrencyDenominations;
+ coins?: CurrencyDenominations;
+ /**
+ * Country codes using this currency
+ */
+ countries?: Array;
+}
+
+/**
+ *
+ */
+export interface GetCurrencyExchangeRateOut {
+ /**
+ * Source currency code
+ */
+ from?: string;
+ /**
+ * Target currency code
+ */
+ to?: string;
+ /**
+ * Exchange rate from source to target currency
+ */
+ exchangeRate?: number;
+ /**
+ * Timestamp of the exchange rate (ISO 8601 format)
+ */
+ rateTime?: string;
+ /**
+ * Data provider used for this rate
+ */
+ provider?: string;
+ /**
+ * Whether the rate was served from cache
+ */
+ cached?: boolean;
+ /**
+ * Inverse exchange rate (to -> from)
+ */
+ inverseRate?: number;
+ /**
+ * Rate disclaimer or terms of use
+ */
+ disclaimer?: string;
+}
+
+/**
+ *
+ */
+export interface GetDomainWhoisOut {
+ /**
+ *
+ */
+ domain?: string;
+ /**
+ *
+ */
+ whoisText?: string;
+ /**
+ *
+ */
+ whoisJson?: object;
+}
+
+/**
+ *
+ */
+export interface GetEmailDetailsOut {
+ /**
+ * The email address that was validated
+ */
+ email?: string;
+ /**
+ * Whether MX records exist for the domain
+ */
+ validMx?: boolean;
+ /**
+ * Whether SMTP connection was successful
+ */
+ validSmtp?: boolean;
+ /**
+ * Whether email format is valid
+ */
+ validFormat?: boolean;
+ /**
+ * Whether email is from a disposable domain
+ */
+ isDisposable?: boolean;
+ /**
+ * Whether email is from a free email provider
+ */
+ isFree?: boolean;
+ detectedName?: DetectedName;
+ domainSuggestion?: DomainSuggestion;
+ domainAge?: DomainAgeInfo;
+ domainRegistration?: DomainRegistrationInfo;
+ /**
+ * Overall email quality score (0-100)
+ */
+ score?: number;
+ /**
+ * Performance metrics (only when getPerformanceData=true)
+ */
+ performance?: object;
+}
+
+/**
+ * City geolocation information
+ */
+export interface GetIpDetailsCityOut {
+ /**
+ * Accuracy radius in kilometers
+ */
+ accuracyRadius: number;
+ /**
+ * Geographic latitude
+ */
+ latitude: number;
+ /**
+ * Geographic longitude
+ */
+ longitude: number;
+ /**
+ * IANA time zone
+ */
+ timeZone?: string;
+ /**
+ * City name
+ */
+ name?: string;
+ /**
+ * Region or state name
+ */
+ region?: string;
+ /**
+ * Area code if available
+ */
+ areaCode?: string;
+}
+
+/**
+ * IP geolocation response
+ */
+export interface GetIpDetailsOut {
+ /**
+ * The IP address that was looked up
+ */
+ ip: string;
+ /**
+ * PTR record (reverse DNS) if available
+ */
+ ptr?: string;
+ /**
+ * ISO 3166-1 alpha-2 country code
+ */
+ countryCode?: string;
+ /**
+ * ISO 3166-1 alpha-3 country code
+ */
+ countryCode3?: string;
+ /**
+ * Full country name
+ */
+ countryName?: string;
+ /**
+ * Continent code
+ */
+ continentCode?: string;
+ /**
+ * Country code where IP is registered
+ */
+ registeredCountryCode?: string;
+ /**
+ * Autonomous System Number
+ */
+ asn?: number;
+ /**
+ * Autonomous System Organization name
+ */
+ aso?: string;
+ /**
+ * Organization name
+ */
+ organization?: string;
+ city?: GetIpDetailsCityOut;
+ /**
+ * Performance metrics (only when getPerformanceData=1)
+ */
+ performance?: object;
+}
+
+/**
+ *
+ */
+export interface GetOnetimeUrlDetailsOut {
+ /**
+ * Whether a passphrase is required to access the content
+ */
+ requirePassphrase?: boolean;
+ /**
+ * Complete one-time URL
+ */
+ onetimeUrl?: string;
+ /**
+ * Short ID identifier for the one-time URL
+ */
+ sid?: string;
+ /**
+ * Domain used for the one-time URL
+ */
+ domain?: string;
+ /**
+ * The secret text content (only shown once)
+ */
+ text?: string;
+ /**
+ * Number of times the URL has been viewed
+ */
+ viewCount?: number;
+ /**
+ * Maximum number of views allowed
+ */
+ maxViews?: number;
+ /**
+ * ISO timestamp when the URL expires
+ */
+ expireAt?: string;
+ /**
+ * ISO timestamp of creation
+ */
+ createdAt?: string;
+}
+
+/**
+ *
+ */
+export interface GetPhoneDetailsOut {
+ /**
+ * Whether the phone number is valid
+ */
+ valid?: boolean;
+ /**
+ * Normalized phone number with country code
+ */
+ number?: string;
+ /**
+ * Phone number in local format
+ */
+ localFormat?: string;
+ /**
+ * Phone number in international format
+ */
+ internationalFormat?: string;
+ /**
+ * Country calling code
+ */
+ countryPrefix?: string;
+ /**
+ * ISO country code
+ */
+ countryCode?: string;
+ /**
+ * Country name
+ */
+ countryName?: string;
+ /**
+ * Geographic location or region
+ */
+ location?: string;
+ /**
+ * Phone carrier/operator name
+ */
+ carrier?: string;
+ /**
+ * Array of all possible carriers when multiple matches exist
+ */
+ matchedCarriers?: Array;
+ /**
+ * Type of phone line (mobile, landline, voip)
+ */
+ lineType?: string;
+}
+
+/**
+ *
+ */
+export interface GetQrCodeAnalyticsOut {
+ /**
+ * Database ID of the QR code
+ */
+ qrCodeId?: string;
+ /**
+ * Short ID of the QR code
+ */
+ sid?: string;
+ /**
+ * QR code data
+ */
+ data?: string;
+ /**
+ * QR code type
+ */
+ type?: string;
+ /**
+ * Total number of scans
+ */
+ totalScans?: number;
+ /**
+ * Number of unique scans
+ */
+ uniqueScans?: number;
+ /**
+ * Last scan timestamp
+ */
+ lastScannedAt?: string;
+ /**
+ * Breakdown by device type
+ */
+ deviceTypes?: object;
+ /**
+ * Breakdown by country
+ */
+ countries?: object;
+ /**
+ * Breakdown by browser
+ */
+ browsers?: object;
+ /**
+ * Timeline of scans
+ */
+ scanTimeline?: Array