Merge 7170450aba into b47d132839
				
					
				
			This commit is contained in:
		
						commit
						9137aec645
					
				
							
								
								
									
										7
									
								
								components.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								components.d.ts
									
									
									
									
										vendored
									
									
								
							| @ -20,6 +20,7 @@ declare module '@vue/runtime-core' { | |||||||
|     Bcrypt: typeof import('./src/tools/bcrypt/bcrypt.vue')['default'] |     Bcrypt: typeof import('./src/tools/bcrypt/bcrypt.vue')['default'] | ||||||
|     BenchmarkBuilder: typeof import('./src/tools/benchmark-builder/benchmark-builder.vue')['default'] |     BenchmarkBuilder: typeof import('./src/tools/benchmark-builder/benchmark-builder.vue')['default'] | ||||||
|     Bip39Generator: typeof import('./src/tools/bip39-generator/bip39-generator.vue')['default'] |     Bip39Generator: typeof import('./src/tools/bip39-generator/bip39-generator.vue')['default'] | ||||||
|  |     BounceParser: typeof import('./src/tools/bounce-parser/bounce-parser.vue')['default'] | ||||||
|     CAlert: typeof import('./src/ui/c-alert/c-alert.vue')['default'] |     CAlert: typeof import('./src/ui/c-alert/c-alert.vue')['default'] | ||||||
|     'CAlert.demo': typeof import('./src/ui/c-alert/c-alert.demo.vue')['default'] |     'CAlert.demo': typeof import('./src/ui/c-alert/c-alert.demo.vue')['default'] | ||||||
|     CameraRecorder: typeof import('./src/tools/camera-recorder/camera-recorder.vue')['default'] |     CameraRecorder: typeof import('./src/tools/camera-recorder/camera-recorder.vue')['default'] | ||||||
| @ -130,10 +131,9 @@ declare module '@vue/runtime-core' { | |||||||
|     MetaTagGenerator: typeof import('./src/tools/meta-tag-generator/meta-tag-generator.vue')['default'] |     MetaTagGenerator: typeof import('./src/tools/meta-tag-generator/meta-tag-generator.vue')['default'] | ||||||
|     MimeTypes: typeof import('./src/tools/mime-types/mime-types.vue')['default'] |     MimeTypes: typeof import('./src/tools/mime-types/mime-types.vue')['default'] | ||||||
|     NavbarButtons: typeof import('./src/components/NavbarButtons.vue')['default'] |     NavbarButtons: typeof import('./src/components/NavbarButtons.vue')['default'] | ||||||
|     NCheckbox: typeof import('naive-ui')['NCheckbox'] |     NCode: typeof import('naive-ui')['NCode'] | ||||||
|     NCollapseTransition: typeof import('naive-ui')['NCollapseTransition'] |     NCollapseTransition: typeof import('naive-ui')['NCollapseTransition'] | ||||||
|     NConfigProvider: typeof import('naive-ui')['NConfigProvider'] |     NConfigProvider: typeof import('naive-ui')['NConfigProvider'] | ||||||
|     NDivider: typeof import('naive-ui')['NDivider'] |  | ||||||
|     NEllipsis: typeof import('naive-ui')['NEllipsis'] |     NEllipsis: typeof import('naive-ui')['NEllipsis'] | ||||||
|     NH1: typeof import('naive-ui')['NH1'] |     NH1: typeof import('naive-ui')['NH1'] | ||||||
|     NH3: typeof import('naive-ui')['NH3'] |     NH3: typeof import('naive-ui')['NH3'] | ||||||
| @ -141,7 +141,8 @@ declare module '@vue/runtime-core' { | |||||||
|     NLayout: typeof import('naive-ui')['NLayout'] |     NLayout: typeof import('naive-ui')['NLayout'] | ||||||
|     NLayoutSider: typeof import('naive-ui')['NLayoutSider'] |     NLayoutSider: typeof import('naive-ui')['NLayoutSider'] | ||||||
|     NMenu: typeof import('naive-ui')['NMenu'] |     NMenu: typeof import('naive-ui')['NMenu'] | ||||||
|     NSpace: typeof import('naive-ui')['NSpace'] |     NP: typeof import('naive-ui')['NP'] | ||||||
|  |     NScrollbar: typeof import('naive-ui')['NScrollbar'] | ||||||
|     NTable: typeof import('naive-ui')['NTable'] |     NTable: typeof import('naive-ui')['NTable'] | ||||||
|     NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default'] |     NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default'] | ||||||
|     OtpCodeGeneratorAndValidator: typeof import('./src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue')['default'] |     OtpCodeGeneratorAndValidator: typeof import('./src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue')['default'] | ||||||
|  | |||||||
| @ -61,6 +61,7 @@ | |||||||
|     "crypto-js": "^4.1.1", |     "crypto-js": "^4.1.1", | ||||||
|     "date-fns": "^2.29.3", |     "date-fns": "^2.29.3", | ||||||
|     "dompurify": "^3.0.6", |     "dompurify": "^3.0.6", | ||||||
|  |     "email-bounce-parser-browser": "^1.1", | ||||||
|     "email-normalizer": "^1.0.0", |     "email-normalizer": "^1.0.0", | ||||||
|     "emojilib": "^3.0.10", |     "emojilib": "^3.0.10", | ||||||
|     "figlet": "^1.7.0", |     "figlet": "^1.7.0", | ||||||
|  | |||||||
							
								
								
									
										13
									
								
								pnpm-lock.yaml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										13
									
								
								pnpm-lock.yaml
									
									
									
										generated
									
									
									
								
							| @ -80,6 +80,9 @@ dependencies: | |||||||
|   dompurify: |   dompurify: | ||||||
|     specifier: ^3.0.6 |     specifier: ^3.0.6 | ||||||
|     version: 3.0.6 |     version: 3.0.6 | ||||||
|  |   email-bounce-parser-browser: | ||||||
|  |     specifier: ^1.1 | ||||||
|  |     version: 1.1.0 | ||||||
|   email-normalizer: |   email-normalizer: | ||||||
|     specifier: ^1.0.0 |     specifier: ^1.0.0 | ||||||
|     version: 1.0.0 |     version: 1.0.0 | ||||||
| @ -3412,7 +3415,7 @@ packages: | |||||||
|     dependencies: |     dependencies: | ||||||
|       '@unhead/dom': 0.5.1 |       '@unhead/dom': 0.5.1 | ||||||
|       '@unhead/schema': 0.5.1 |       '@unhead/schema': 0.5.1 | ||||||
|       '@vueuse/shared': 11.0.3(vue@3.3.4) |       '@vueuse/shared': 11.1.0(vue@3.3.4) | ||||||
|       unhead: 0.5.1 |       unhead: 0.5.1 | ||||||
|       vue: 3.3.4 |       vue: 3.3.4 | ||||||
|     transitivePeerDependencies: |     transitivePeerDependencies: | ||||||
| @ -4054,8 +4057,8 @@ packages: | |||||||
|       - vue |       - vue | ||||||
|     dev: false |     dev: false | ||||||
| 
 | 
 | ||||||
|   /@vueuse/shared@11.0.3(vue@3.3.4): |   /@vueuse/shared@11.1.0(vue@3.3.4): | ||||||
|     resolution: {integrity: sha512-0rY2m6HS5t27n/Vp5cTDsKTlNnimCqsbh/fmT2LgE+aaU42EMfXo8+bNX91W9I7DDmxfuACXMmrd7d79JxkqWA==} |     resolution: {integrity: sha512-YUtIpY122q7osj+zsNMFAfMTubGz0sn5QzE5gPzAIiCmtt2ha3uQUY1+JPyL4gRCTsLPX82Y9brNbo/aqlA91w==} | ||||||
|     dependencies: |     dependencies: | ||||||
|       vue-demi: 0.14.10(vue@3.3.4) |       vue-demi: 0.14.10(vue@3.3.4) | ||||||
|     transitivePeerDependencies: |     transitivePeerDependencies: | ||||||
| @ -5036,6 +5039,10 @@ packages: | |||||||
|   /electron-to-chromium@1.4.572: |   /electron-to-chromium@1.4.572: | ||||||
|     resolution: {integrity: sha512-RlFobl4D3ieetbnR+2EpxdzFl9h0RAJkPK3pfiwMug2nhBin2ZCsGIAJWdpNniLz43sgXam/CgipOmvTA+rUiA==} |     resolution: {integrity: sha512-RlFobl4D3ieetbnR+2EpxdzFl9h0RAJkPK3pfiwMug2nhBin2ZCsGIAJWdpNniLz43sgXam/CgipOmvTA+rUiA==} | ||||||
| 
 | 
 | ||||||
|  |   /email-bounce-parser-browser@1.1.0: | ||||||
|  |     resolution: {integrity: sha512-aPMJKpvAPTFTqDI3/bMxcEHK3Wk2yy/tNK/nVWHl5zqyoxJFFgO5a2jvVno4V3e+kyLjZx2M5KJNgNmYf0ZkuQ==} | ||||||
|  |     dev: false | ||||||
|  | 
 | ||||||
|   /email-normalizer@1.0.0: |   /email-normalizer@1.0.0: | ||||||
|     resolution: {integrity: sha512-wZYuuMtL4kUOmg/TPtCrf9hAZjbFq+FcjWA85Z5nr2lGllRnWJPxCJw3gy4Cx+adMoyVw4VJfGGvt/OHgIW+qg==} |     resolution: {integrity: sha512-wZYuuMtL4kUOmg/TPtCrf9hAZjbFq+FcjWA85Z5nr2lGllRnWJPxCJw3gy4Cx+adMoyVw4VJfGGvt/OHgIW+qg==} | ||||||
|     dependencies: |     dependencies: | ||||||
|  | |||||||
							
								
								
									
										
											BIN
										
									
								
								public/re2.wasm
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								public/re2.wasm
									
									
									
									
									
										Executable file
									
								
							
										
											Binary file not shown.
										
									
								
							| @ -7,8 +7,15 @@ import sqlHljs from 'highlight.js/lib/languages/sql'; | |||||||
| import xmlHljs from 'highlight.js/lib/languages/xml'; | import xmlHljs from 'highlight.js/lib/languages/xml'; | ||||||
| import yamlHljs from 'highlight.js/lib/languages/yaml'; | import yamlHljs from 'highlight.js/lib/languages/yaml'; | ||||||
| import iniHljs from 'highlight.js/lib/languages/ini'; | import iniHljs from 'highlight.js/lib/languages/ini'; | ||||||
|  | import bashHljs from 'highlight.js/lib/languages/bash'; | ||||||
| import markdownHljs from 'highlight.js/lib/languages/markdown'; | import markdownHljs from 'highlight.js/lib/languages/markdown'; | ||||||
|  | import jsHljs from 'highlight.js/lib/languages/javascript'; | ||||||
|  | import cssHljs from 'highlight.js/lib/languages/css'; | ||||||
|  | import goHljs from 'highlight.js/lib/languages/go'; | ||||||
|  | import csharpHljs from 'highlight.js/lib/languages/csharp'; | ||||||
|  | import { Base64 } from 'js-base64'; | ||||||
| import { useCopy } from '@/composable/copy'; | import { useCopy } from '@/composable/copy'; | ||||||
|  | import { useDownloadFileFromBase64 } from '@/composable/downloadBase64'; | ||||||
| 
 | 
 | ||||||
| const props = withDefaults( | const props = withDefaults( | ||||||
|   defineProps<{ |   defineProps<{ | ||||||
| @ -17,12 +24,17 @@ const props = withDefaults( | |||||||
|     language?: string |     language?: string | ||||||
|     copyPlacement?: 'top-right' | 'bottom-right' | 'outside' | 'none' |     copyPlacement?: 'top-right' | 'bottom-right' | 'outside' | 'none' | ||||||
|     copyMessage?: string |     copyMessage?: string | ||||||
|  |     wordWrap?: boolean | ||||||
|  |     downloadFileName?: string | ||||||
|  |     downloadButtonText?: string | ||||||
|   }>(), |   }>(), | ||||||
|   { |   { | ||||||
|     followHeightOf: null, |     followHeightOf: null, | ||||||
|     language: 'txt', |     language: 'txt', | ||||||
|     copyPlacement: 'top-right', |     copyPlacement: 'top-right', | ||||||
|     copyMessage: 'Copy to clipboard', |     copyMessage: 'Copy to clipboard', | ||||||
|  |     downloadFileName: '', | ||||||
|  |     downloadButtonText: 'Download', | ||||||
|   }, |   }, | ||||||
| ); | ); | ||||||
| hljs.registerLanguage('sql', sqlHljs); | hljs.registerLanguage('sql', sqlHljs); | ||||||
| @ -31,13 +43,25 @@ hljs.registerLanguage('html', xmlHljs); | |||||||
| hljs.registerLanguage('xml', xmlHljs); | hljs.registerLanguage('xml', xmlHljs); | ||||||
| hljs.registerLanguage('yaml', yamlHljs); | hljs.registerLanguage('yaml', yamlHljs); | ||||||
| hljs.registerLanguage('toml', iniHljs); | hljs.registerLanguage('toml', iniHljs); | ||||||
|  | hljs.registerLanguage('bash', bashHljs); | ||||||
| hljs.registerLanguage('markdown', markdownHljs); | hljs.registerLanguage('markdown', markdownHljs); | ||||||
|  | hljs.registerLanguage('css', cssHljs); | ||||||
|  | hljs.registerLanguage('javascript', jsHljs); | ||||||
|  | hljs.registerLanguage('go', goHljs); | ||||||
|  | hljs.registerLanguage('csharp', csharpHljs); | ||||||
| 
 | 
 | ||||||
| const { value, language, followHeightOf, copyPlacement, copyMessage } = toRefs(props); | const { value, language, followHeightOf, copyPlacement, copyMessage, downloadFileName, downloadButtonText } = toRefs(props); | ||||||
| const { height } = followHeightOf.value ? useElementSize(followHeightOf) : { height: ref(null) }; | const { height } = followHeightOf.value ? useElementSize(followHeightOf) : { height: ref(null) }; | ||||||
| 
 | 
 | ||||||
| const { copy, isJustCopied } = useCopy({ source: value, createToast: false }); | const { copy, isJustCopied } = useCopy({ source: value, createToast: false }); | ||||||
| const tooltipText = computed(() => isJustCopied.value ? 'Copied!' : copyMessage.value); | const tooltipText = computed(() => isJustCopied.value ? 'Copied!' : copyMessage.value); | ||||||
|  | 
 | ||||||
|  | const valueBase64 = computed(() => Base64.encode(value.value)); | ||||||
|  | const { download } = useDownloadFileFromBase64( | ||||||
|  |   { | ||||||
|  |     source: valueBase64, | ||||||
|  |     filename: downloadFileName, | ||||||
|  |   }); | ||||||
| </script> | </script> | ||||||
| 
 | 
 | ||||||
| <template> | <template> | ||||||
| @ -49,11 +73,16 @@ const tooltipText = computed(() => isJustCopied.value ? 'Copied!' : copyMessage. | |||||||
|         :style="height ? `min-height: ${height - 40 /* card padding */ + 10 /* negative margin compensation */}px` : ''" |         :style="height ? `min-height: ${height - 40 /* card padding */ + 10 /* negative margin compensation */}px` : ''" | ||||||
|       > |       > | ||||||
|         <n-config-provider :hljs="hljs"> |         <n-config-provider :hljs="hljs"> | ||||||
|           <n-code :code="value" :language="language" :trim="false" data-test-id="area-content" /> |           <n-code :code="value" :language="language" :word-wrap="wordWrap" :trim="false" data-test-id="area-content" /> | ||||||
|         </n-config-provider> |         </n-config-provider> | ||||||
|       </n-scrollbar> |       </n-scrollbar> | ||||||
|       <div absolute right-10px top-10px> |       <div | ||||||
|         <c-tooltip v-if="value" :tooltip="tooltipText" position="left"> |         v-if="value && copyPlacement !== 'none'" | ||||||
|  |         absolute right-10px | ||||||
|  |         :top-10px="copyPlacement === 'top-right' ? '' : 'no'" | ||||||
|  |         :bottom-10px="copyPlacement === 'bottom-right' ? '' : 'no'" | ||||||
|  |       > | ||||||
|  |         <c-tooltip v-if="value && copyPlacement !== 'outside'" :tooltip="tooltipText" position="left"> | ||||||
|           <c-button circle important:h-10 important:w-10 @click="copy()"> |           <c-button circle important:h-10 important:w-10 @click="copy()"> | ||||||
|             <n-icon size="22" :component="Copy" /> |             <n-icon size="22" :component="Copy" /> | ||||||
|           </c-button> |           </c-button> | ||||||
| @ -65,6 +94,11 @@ const tooltipText = computed(() => isJustCopied.value ? 'Copied!' : copyMessage. | |||||||
|         {{ tooltipText }} |         {{ tooltipText }} | ||||||
|       </c-button> |       </c-button> | ||||||
|     </div> |     </div> | ||||||
|  |     <div v-if="downloadFileName !== '' && value !== ''" mt-5 flex justify-center> | ||||||
|  |       <c-button secondary @click="download"> | ||||||
|  |         {{ downloadButtonText }} | ||||||
|  |       </c-button> | ||||||
|  |     </div> | ||||||
|   </div> |   </div> | ||||||
| </template> | </template> | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,6 +1,7 @@ | |||||||
| import { extension as getExtensionFromMimeType, extension as getMimeTypeFromExtension } from 'mime-types'; | import { extension as getExtensionFromMimeType, extension as getMimeTypeFromExtension } from 'mime-types'; | ||||||
| import type { Ref } from 'vue'; | import type { MaybeRef, Ref } from 'vue'; | ||||||
| import _ from 'lodash'; | import _ from 'lodash'; | ||||||
|  | import { get } from '@vueuse/core'; | ||||||
| 
 | 
 | ||||||
| export { | export { | ||||||
|   getMimeTypeFromBase64, |   getMimeTypeFromBase64, | ||||||
| @ -75,21 +76,11 @@ function downloadFromBase64({ sourceValue, filename, extension, fileMimeType }: | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function useDownloadFileFromBase64( | function useDownloadFileFromBase64( | ||||||
|   { source, filename, extension, fileMimeType }: |  | ||||||
|   { source: Ref<string>; filename?: string; extension?: string; fileMimeType?: string }) { |  | ||||||
|   return { |  | ||||||
|     download() { |  | ||||||
|       downloadFromBase64({ sourceValue: source.value, filename, extension, fileMimeType }); |  | ||||||
|     }, |  | ||||||
|   }; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| function useDownloadFileFromBase64Refs( |  | ||||||
|   { source, filename, extension }: |   { source, filename, extension }: | ||||||
|   { source: Ref<string>; filename?: Ref<string>; extension?: Ref<string> }) { |   { source: MaybeRef<string>; filename?: MaybeRef<string>; extension?: MaybeRef<string> }) { | ||||||
|   return { |   return { | ||||||
|     download() { |     download() { | ||||||
|       downloadFromBase64({ sourceValue: source.value, filename: filename?.value, extension: extension?.value }); |       downloadFromBase64({ sourceValue: get(source), filename: get(filename), extension: get(extension) }); | ||||||
|     }, |     }, | ||||||
|   }; |   }; | ||||||
| } | } | ||||||
| @ -116,3 +107,13 @@ function previewImageFromBase64(base64String: string): HTMLImageElement { | |||||||
| 
 | 
 | ||||||
|   return img; |   return img; | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | function useDownloadFileFromBase64Refs( | ||||||
|  |   { source, filename, extension }: | ||||||
|  |   { source: Ref<string>; filename?: Ref<string>; extension?: Ref<string> }) { | ||||||
|  |   return { | ||||||
|  |     download() { | ||||||
|  |       downloadFromBase64({ sourceValue: source.value, filename: filename?.value, extension: extension?.value }); | ||||||
|  |     }, | ||||||
|  |   }; | ||||||
|  | } | ||||||
|  | |||||||
							
								
								
									
										66
									
								
								src/tools/bounce-parser/bounce-parser.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										66
									
								
								src/tools/bounce-parser/bounce-parser.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,66 @@ | |||||||
|  | <script setup lang="ts"> | ||||||
|  | import EmailBounceParse from 'email-bounce-parser-browser'; | ||||||
|  | 
 | ||||||
|  | const emailContent = ref(''); | ||||||
|  | 
 | ||||||
|  | const parsedBounce = computed(() => { | ||||||
|  |   try { | ||||||
|  |     return { email: new EmailBounceParse().read(emailContent.value) }; | ||||||
|  |   } | ||||||
|  |   catch (e: any) { | ||||||
|  |     return { parsingError: e.toString() }; | ||||||
|  |   } | ||||||
|  | }); | ||||||
|  | </script> | ||||||
|  | 
 | ||||||
|  | <template> | ||||||
|  |   <div style="max-width: 600px;"> | ||||||
|  |     <c-card title="Input" mb-2> | ||||||
|  |       <c-input-text | ||||||
|  |         v-model:value="emailContent" | ||||||
|  |         label="Bounce Email Textual Content" | ||||||
|  |         multiline | ||||||
|  |         placeholder="Put your email text content here..." | ||||||
|  |         rows="15" | ||||||
|  |         mb-2 | ||||||
|  |       /> | ||||||
|  |     </c-card> | ||||||
|  | 
 | ||||||
|  |     <c-card v-if="parsedBounce && emailContent" title="Output" mb-2> | ||||||
|  |       <n-p v-if="parsedBounce.email?.email?.error" style="color: green" mb-2> | ||||||
|  |         This mail is a bounce email | ||||||
|  |       </n-p> | ||||||
|  |       <n-p v-if="!parsedBounce.email?.email?.error" style="color: red" mb-2> | ||||||
|  |         This mail is NOT a bounce email | ||||||
|  |       </n-p> | ||||||
|  |       <c-alert v-if="parsedBounce.parsingError" mb-2> | ||||||
|  |         {{ parsedBounce.parsingError }} | ||||||
|  |       </c-alert> | ||||||
|  |       <input-copyable v-if="parsedBounce.email?.data?.recipient" label="Recipient" :value="parsedBounce.email?.data?.recipient" mb-2 /> | ||||||
|  |       <div v-if="parsedBounce.email?.email?.error"> | ||||||
|  |         <c-card title="Error" mb-2> | ||||||
|  |           <input-copyable v-if="parsedBounce.email?.data?.command" label="Command" :value="parsedBounce.email?.data?.command" /> | ||||||
|  |           <input-copyable v-if="parsedBounce.email?.data?.error?.code?.basic || parsedBounce.email?.data?.error?.code?.enhanced" label="Code" :value="`${parsedBounce.email?.data?.error?.code?.basic}/${parsedBounce.email?.data?.error?.code?.enhanced}`" /> | ||||||
|  |           <input-copyable v-if="parsedBounce.email?.data?.error?.label" label="Label" :value="parsedBounce.email?.data?.error?.label" /> | ||||||
|  |           <input-copyable v-if="parsedBounce.email?.data?.error?.type" label="Type" :value="parsedBounce.email?.data?.error?.type" /> | ||||||
|  |           <input-copyable v-if="parsedBounce.email?.data?.error?.temporary" label="Temporary" :value="parsedBounce.email?.data?.error?.temporary" /> | ||||||
|  |           <input-copyable v-if="parsedBounce.email?.data?.error?.permanent" label="Permanent" :value="parsedBounce.email?.data?.error?.permanent" /> | ||||||
|  |           <input-copyable v-if="parsedBounce.email?.data?.error?.data?.type" label="Subtype" :value="parsedBounce.email?.data?.error?.data?.type" /> | ||||||
|  |           <input-copyable v-if="parsedBounce.email?.data?.error?.data?.blocked" label="Blocked" :value="parsedBounce.email?.data?.error?.data?.blocked" /> | ||||||
|  |           <input-copyable v-if="parsedBounce.email?.data?.error?.data?.spam" label="Spam" :value="parsedBounce.email?.data?.error?.data?.spam" /> | ||||||
|  |         </c-card> | ||||||
|  |         <c-card v-if="parsedBounce.email?.data?.server?.hostname || parsedBounce.email?.data?.server?.ip" title="Server" mb-2> | ||||||
|  |           <input-copyable v-if="parsedBounce.email?.data?.server?.hostname" label="Host" :value="parsedBounce.email?.data?.server?.hostname" /> | ||||||
|  |           <input-copyable v-if="parsedBounce.email?.data?.server?.ip" label="IP" :value="parsedBounce.email?.data?.server?.ip" /> | ||||||
|  |           <input-copyable v-if="parsedBounce.email?.data?.server?.port" label="Port" :value="parsedBounce.email?.data?.server?.port" /> | ||||||
|  |         </c-card> | ||||||
|  |         <c-card title="Details" mb-2> | ||||||
|  |           <textarea-copyable :value="JSON.stringify(parsedBounce.email?.data, null, 2)" /> | ||||||
|  |         </c-card> | ||||||
|  |         <c-card title="Raw Error" mb-2> | ||||||
|  |           <textarea-copyable :value="parsedBounce.email?.email?.error" word-wrap /> | ||||||
|  |         </c-card> | ||||||
|  |       </div> | ||||||
|  |     </c-card> | ||||||
|  |   </div> | ||||||
|  | </template> | ||||||
							
								
								
									
										36
									
								
								src/tools/bounce-parser/email-bounce-parser-browser.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								src/tools/bounce-parser/email-bounce-parser-browser.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,36 @@ | |||||||
|  | declare module "email-bounce-parser-browser" { | ||||||
|  |     export default class EmailBounceParse { | ||||||
|  |         read(emailContent: string): { | ||||||
|  |             bounce: boolean | ||||||
|  |             email?: { | ||||||
|  |                 body?: string | ||||||
|  |                 intro?: string | ||||||
|  |                 error?: string | ||||||
|  |             } | ||||||
|  |             data?: { | ||||||
|  |                 error?: { | ||||||
|  |                 code?: { | ||||||
|  |                     basic?: string | ||||||
|  |                     enhanced?:string | ||||||
|  |                 } | ||||||
|  |                 label?: string | ||||||
|  |                 type?: string | ||||||
|  |                 temporary?: boolean | ||||||
|  |                 permanent?: boolean | ||||||
|  |                 data?: { | ||||||
|  |                     type?: string | ||||||
|  |                     blocked?: boolean | ||||||
|  |                     spam?: boolean | ||||||
|  |                 } | ||||||
|  |                 } | ||||||
|  |                 recipient?:string | ||||||
|  |                 server?: { | ||||||
|  |                 hostname?: string | ||||||
|  |                 ip?: string | ||||||
|  |                 port?: string | ||||||
|  |                 } | ||||||
|  |                 command?: string | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |     }  | ||||||
|  | } | ||||||
							
								
								
									
										12
									
								
								src/tools/bounce-parser/index.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								src/tools/bounce-parser/index.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,12 @@ | |||||||
|  | import { Mailbox } from '@vicons/tabler'; | ||||||
|  | import { defineTool } from '../tool'; | ||||||
|  | 
 | ||||||
|  | export const tool = defineTool({ | ||||||
|  |   name: 'Bounce Email Parser', | ||||||
|  |   path: '/bounce-parser', | ||||||
|  |   description: 'Parse SMTP Bounce Emails', | ||||||
|  |   keywords: ['bounce', 'email', 'smtp', 'parser'], | ||||||
|  |   component: () => import('./bounce-parser.vue'), | ||||||
|  |   icon: Mailbox, | ||||||
|  |   createdAt: new Date('2024-08-15'), | ||||||
|  | }); | ||||||
| @ -2,6 +2,7 @@ import { tool as base64FileConverter } from './base64-file-converter'; | |||||||
| import { tool as base64StringConverter } from './base64-string-converter'; | import { tool as base64StringConverter } from './base64-string-converter'; | ||||||
| import { tool as basicAuthGenerator } from './basic-auth-generator'; | import { tool as basicAuthGenerator } from './basic-auth-generator'; | ||||||
| import { tool as emailNormalizer } from './email-normalizer'; | import { tool as emailNormalizer } from './email-normalizer'; | ||||||
|  | import { tool as bounceParser } from './bounce-parser'; | ||||||
| 
 | 
 | ||||||
| import { tool as asciiTextDrawer } from './ascii-text-drawer'; | import { tool as asciiTextDrawer } from './ascii-text-drawer'; | ||||||
| 
 | 
 | ||||||
| @ -137,6 +138,7 @@ export const toolsByCategory: ToolCategory[] = [ | |||||||
|       httpStatusCodes, |       httpStatusCodes, | ||||||
|       jsonDiff, |       jsonDiff, | ||||||
|       safelinkDecoder, |       safelinkDecoder, | ||||||
|  |       bounceParser, | ||||||
|     ], |     ], | ||||||
|   }, |   }, | ||||||
|   { |   { | ||||||
|  | |||||||
| @ -113,4 +113,7 @@ export default defineConfig({ | |||||||
|   build: { |   build: { | ||||||
|     target: 'esnext', |     target: 'esnext', | ||||||
|   }, |   }, | ||||||
|  |   optimizeDeps: { | ||||||
|  |     include: ['re2-wasm-embedded'], // optionally specify dependency name
 | ||||||
|  |   }, | ||||||
| }); | }); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user