diff --git a/components.d.ts b/components.d.ts index 7f284a47..1a6d0ac9 100644 --- a/components.d.ts +++ b/components.d.ts @@ -138,6 +138,7 @@ declare module '@vue/runtime-core' { Ipv4RangeExpander: typeof import('./src/tools/ipv4-range-expander/ipv4-range-expander.vue')['default'] Ipv4SubnetCalculator: typeof import('./src/tools/ipv4-subnet-calculator/ipv4-subnet-calculator.vue')['default'] Ipv6UlaGenerator: typeof import('./src/tools/ipv6-ula-generator/ipv6-ula-generator.vue')['default'] + Iso3166Searcher: typeof import('./src/tools/iso-3166-searcher/iso-3166-searcher.vue')['default'] JsonDiff: typeof import('./src/tools/json-diff/json-diff.vue')['default'] JsonEditor: typeof import('./src/tools/json-editor/json-editor.vue')['default'] JsonMinify: typeof import('./src/tools/json-minify/json-minify.vue')['default'] diff --git a/package.json b/package.json index f2d806f5..8ff9d1e8 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,7 @@ "colord": "^2.9.3", "composerize": "^1.6.12", "composeverter": "^1.7.2", + "countries-db": "^1.2.0", "country-code-lookup": "^0.1.0", "cron-validator": "^1.3.1", "cronstrue": "^2.26.0", @@ -93,6 +94,7 @@ "ip-cidr": "^4.0.0", "is-cidr": "^5.0.3", "is-ip": "^5.0.1", + "iso-639-1": "^3.1.3", "jpeg-quality-estimator": "^1.0.1", "js-base64": "^3.7.7", "json-editor-vue": "^0.17.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5fa3ffc0..1665555c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -86,6 +86,9 @@ importers: composeverter: specifier: ^1.7.2 version: 1.7.2 + countries-db: + specifier: ^1.2.0 + version: 1.2.0 country-code-lookup: specifier: ^0.1.0 version: 0.1.0 @@ -179,6 +182,9 @@ importers: is-ip: specifier: ^5.0.1 version: 5.0.1 + iso-639-1: + specifier: ^3.1.3 + version: 3.1.3 jpeg-quality-estimator: specifier: ^1.0.1 version: 1.0.1 @@ -3218,6 +3224,9 @@ packages: core-util-is@1.0.3: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} + countries-db@1.2.0: + resolution: {integrity: sha512-eZQgxVsNSRQ4yv9xQbgyR1psJBHDBhnhhU4OMXXUdrfbWW9gaiglKgueTq3ZWGuvxoR78g2ljVFsJmEptfNPmw==} + country-code-lookup@0.1.0: resolution: {integrity: sha512-IOI66HEG+8bXfWPy+sTzuN7161vmDZOHg1wgIPFf3WfD73FeLajnn6C+fnxOIa9RL1WRBDMXQQWW/FOaOYaQ3w==} @@ -4539,6 +4548,10 @@ packages: isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + iso-639-1@3.1.3: + resolution: {integrity: sha512-1jz0Wh9hyLMRwqEPchb/KZCiTqfFWtc9R3nm7GHPygBAKS8wdKJ3FH4lvLsri6UtAE5Kz5SnowtXZa//6bqMyw==} + engines: {node: '>=6.0'} + isobject@3.0.1: resolution: {integrity: sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==} engines: {node: '>=0.10.0'} @@ -10275,6 +10288,8 @@ snapshots: core-util-is@1.0.3: {} + countries-db@1.2.0: {} + country-code-lookup@0.1.0: {} create-ecdh@4.0.4: @@ -11756,6 +11771,8 @@ snapshots: isexe@2.0.0: {} + iso-639-1@3.1.3: {} + isobject@3.0.1: {} isolated-vm@5.0.1: diff --git a/src/tools/index.ts b/src/tools/index.ts index 3ab13875..bc22e91d 100644 --- a/src/tools/index.ts +++ b/src/tools/index.ts @@ -36,6 +36,7 @@ import { tool as apiTester } from './api-tester'; import { tool as imageToCss } from './image-to-css'; import { tool as jsonToSchema } from './json-to-schema'; import { tool as curlConverter } from './curl-converter'; +import { tool as iso3166Searcher } from './iso-3166-searcher'; import { tool as pdfSignatureChecker } from './pdf-signature-checker'; import { tool as uuidConverter } from './uuid-converter'; import { tool as numeronymGenerator } from './numeronym-generator'; @@ -280,6 +281,7 @@ export const toolsByCategory: ToolCategory[] = [ numeronymGenerator, asciiTextDrawer, aiPromptSplitter, + iso3166Searcher, ], }, { diff --git a/src/tools/iso-3166-searcher/countries-db.d.ts b/src/tools/iso-3166-searcher/countries-db.d.ts new file mode 100644 index 00000000..87ec2a7c --- /dev/null +++ b/src/tools/iso-3166-searcher/countries-db.d.ts @@ -0,0 +1,35 @@ +declare module 'countries-db'{ + export interface CountryInfo { + id: string + name: string + officialName: string + emoji: string + emojiUnicode: string + iso2: string + iso3: string + isoNumeric: string + geonameId: number + continentId: string + population: number + elevation: number + areaSqKm: number + coordinates: { + latitude: number + longitude: number + }, + timezones: Array + domain: string + currencyCode: string + currencyName: string + postalCodeFormat: string + postalCodeRegex: string + phoneCode: string + neighborCountryIds: Array + languages: Array + locales: Array + } + + export function getAllCountries(): {[id:string]: CountryInfo}; + export function getCountry(id: string, property: string): string | Array | number; + export function getCountry(id: string): CountryInfo; +} \ No newline at end of file diff --git a/src/tools/iso-3166-searcher/index.ts b/src/tools/iso-3166-searcher/index.ts new file mode 100644 index 00000000..88fd3e33 --- /dev/null +++ b/src/tools/iso-3166-searcher/index.ts @@ -0,0 +1,12 @@ +import { Flag } from '@vicons/tabler'; +import { defineTool } from '../tool'; + +export const tool = defineTool({ + name: 'ISO 3166 Country Codes Searcher', + path: '/iso-3166-searcher', + description: 'Allow searching for Country Code (ISO 3166) and info', + keywords: ['iso', 'iso2', 'iso3', 'phone', 'currency', 'timezones', 'domain', 'lang', 'iso3166', 'country', 'ccltd', 'searcher'], + component: () => import('./iso-3166-searcher.vue'), + icon: Flag, + createdAt: new Date('2024-04-20'), +}); diff --git a/src/tools/iso-3166-searcher/iso-3166-searcher.vue b/src/tools/iso-3166-searcher/iso-3166-searcher.vue new file mode 100644 index 00000000..4f19d382 --- /dev/null +++ b/src/tools/iso-3166-searcher/iso-3166-searcher.vue @@ -0,0 +1,104 @@ + + +