diff --git a/package.json b/package.json index c6386fec..732ba0cb 100644 --- a/package.json +++ b/package.json @@ -101,6 +101,7 @@ "@types/figlet": "^1.5.8", "@types/sshpk": "^1.17.4", "@types/js-beautify": "^1.14.3", + "@types/libmime": "^5.0.3", "@vicons/material": "^0.12.0", "@vicons/tabler": "^0.12.0", "@vueuse/core": "^10.11.1", @@ -226,6 +227,7 @@ "jsonlint-mod": "^1.7.6", "jwt-decode": "^3.1.2", "korean-unpacker": "^1.0.3", + "libmime": "^5.3.4", "libphonenumber-js": "^1.10.28", "lodash": "^4.17.21", "luxon": "^3.5.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f4e07c1a..6660bf1c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -101,6 +101,9 @@ dependencies: '@types/jsonpath': specifier: ^0.2.4 version: 0.2.4 + '@types/libmime': + specifier: ^5.0.3 + version: 5.0.3 '@types/lodash.defaultsdeep': specifier: ^4.6.9 version: 4.6.9 @@ -425,6 +428,9 @@ dependencies: korean-unpacker: specifier: ^1.0.3 version: 1.0.3 + libmime: + specifier: ^5.3.4 + version: 5.3.5 libphonenumber-js: specifier: ^1.10.28 version: 1.10.28 @@ -5651,6 +5657,12 @@ packages: resolution: {integrity: sha512-DD2Y3xMlTQvAnN6d8803xdgnOeYZ+HwMglb7/9YCf49J9RkJL53azf9qKa40MkEYhqVwxZ1GS2+VlShnz4Z1Bw==} dev: false + /@types/libmime@5.0.3: + resolution: {integrity: sha512-fJ4ISAOqnWpnojw5+Ya1Fu1lPWf3PTK9E8KwJoUnJvtTXYepuFwzE4EI4lMhbAshCVu8jLdQrWLjBZyEcFgADQ==} + dependencies: + '@types/node': 18.18.8 + dev: false + /@types/linkify-it@3.0.2: resolution: {integrity: sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA==} @@ -8861,6 +8873,11 @@ packages: resolution: {integrity: sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw==} dev: false + /encoding-japanese@2.1.0: + resolution: {integrity: sha512-58XySVxUgVlBikBTbQ8WdDxBDHIdXucB16LO5PBHR8t75D54wQrNo4cg+58+R1CtJfKnsVsvt9XlteRaR8xw1w==} + engines: {node: '>=8.10.0'} + dev: false + /end-of-stream@1.4.4: resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} dependencies: @@ -10067,7 +10084,6 @@ packages: /glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported dependencies: fs.realpath: 1.0.0 inflight: 1.0.6 @@ -11552,15 +11568,32 @@ packages: prelude-ls: 1.2.1 type-check: 0.4.0 + /libbase64@1.3.0: + resolution: {integrity: sha512-GgOXd0Eo6phYgh0DJtjQ2tO8dc0IVINtZJeARPeiIJqge+HdsWSuaDTe8ztQ7j/cONByDZ3zeB325AHiv5O0dg==} + dev: false + /libheif-js@1.18.2: resolution: {integrity: sha512-4Nk0dKhhRfVS4mECcX2jSDpNU6gcHQLneJjkGQq61N8COGtjSpSA3CI+1Q3kUYv5Vf+SwIqUtaDSdU6JO37c6w==} engines: {node: '>=8.0.0'} dev: false + /libmime@5.3.5: + resolution: {integrity: sha512-nSlR1yRZ43L3cZCiWEw7ali3jY29Hz9CQQ96Oy+sSspYnIP5N54ucOPHqooBsXzwrX1pwn13VUE05q4WmzfaLg==} + dependencies: + encoding-japanese: 2.1.0 + iconv-lite: 0.6.3 + libbase64: 1.3.0 + libqp: 2.1.0 + dev: false + /libphonenumber-js@1.10.28: resolution: {integrity: sha512-1eAgjLrZA0+2Wgw4hs+4Q/kEBycxQo8ZLYnmOvZ3AlM8ImAVAJgDPlZtISLEzD1vunc2q8s2Pn7XwB7I8U3Kzw==} dev: false + /libqp@2.1.0: + resolution: {integrity: sha512-O6O6/fsG5jiUVbvdgT7YX3xY3uIadR6wEZ7+vy9u7PKHAlSEB6blvC1o5pHBjgsi95Uo0aiBBdkyFecj6jtb7A==} + dev: false + /liftoff@5.0.0: resolution: {integrity: sha512-a5BQjbCHnB+cy+gsro8lXJ4kZluzOijzJ1UVVfyJYZC+IP2pLv1h4+aysQeKuTmyO8NAqfyQAk4HWaP/HjcKTg==} engines: {node: '>=10.13.0'} @@ -16694,6 +16727,7 @@ packages: /yamljs@0.3.0: resolution: {integrity: sha512-C/FsVVhht4iPQYXOInoxUM/1ELSf9EsgKH34FofQOp6hwCPrW4vG4w5++TED3xRUo8gD7l0P1J1dLlDYzODsTQ==} + hasBin: true dependencies: argparse: 1.0.10 glob: 7.2.3 diff --git a/src/tools/index.ts b/src/tools/index.ts index da86dab9..f69fd91a 100644 --- a/src/tools/index.ts +++ b/src/tools/index.ts @@ -73,6 +73,7 @@ import { tool as ocrImage } from './ocr-image'; import { tool as ansibleVaultCryptDecrypt } from './ansible-vault-crypt-decrypt'; import { tool as gzipConverter } from './gzip-converter'; import { tool as htpasswdGenerator } from './htpasswd-generator'; +import { tool as mimeConverter } from './mime-converter'; import { tool as safelinkDecoder } from './safelink-decoder'; import { tool as mongoObjectidConverter } from './mongo-objectid-converter'; import { tool as removeExif } from './remove-exif'; @@ -308,6 +309,7 @@ export const toolsByCategory: ToolCategory[] = [ jsonToXml, gzipConverter, htmlCleaner, + mimeConverter, ], }, { diff --git a/src/tools/mime-converter/index.ts b/src/tools/mime-converter/index.ts new file mode 100644 index 00000000..ea959b64 --- /dev/null +++ b/src/tools/mime-converter/index.ts @@ -0,0 +1,12 @@ +import { Mail } from '@vicons/tabler'; +import { defineTool } from '../tool'; + +export const tool = defineTool({ + name: 'MIME Encoding Converter', + path: '/mime-converter', + description: 'Convert from/to MIME Encoded-Word format (Mail Subject)', + keywords: ['mime', 'converter', 'subject', 'rfc2047', 'rfc1341', 'rfc2045'], + component: () => import('./mime-converter.vue'), + icon: Mail, + createdAt: new Date('2024-03-09'), +}); diff --git a/src/tools/mime-converter/mime-converter.vue b/src/tools/mime-converter/mime-converter.vue new file mode 100644 index 00000000..a959dac6 --- /dev/null +++ b/src/tools/mime-converter/mime-converter.vue @@ -0,0 +1,66 @@ + + + + + + + + + Quotted Printable encoded string + + + + + Base64 encoded string + + + + + + + + + Decoded string + + + + + diff --git a/vite.config.ts b/vite.config.ts index 9655d8b0..aafc7183 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -12,6 +12,7 @@ import Icons from 'unplugin-icons/vite'; import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'; import Components from 'unplugin-vue-components/vite'; import { defineConfig } from 'vite'; +import { nodePolyfills } from 'vite-plugin-node-polyfills'; import { VitePWA } from 'vite-plugin-pwa'; import markdown from 'vite-plugin-vue-markdown'; import svgLoader from 'vite-svg-loader';