mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-20 21:23:08 +03:00
Merge branch 'feat/email-parser' into chore/all-my-stuffs
# Conflicts: # components.d.ts # package.json # pnpm-lock.yaml # src/components/TextareaCopyable.vue # src/tools/index.ts # vite.config.ts
This commit is contained in:
commit
2691579200
9 files changed
+422
-6
No files matched your search
@@ -42,6 +42,8 @@
|
||||
"@it-tools/bip39": "^0.0.4",
|
||||
"@it-tools/oggen": "^1.3.0",
|
||||
"@regexper/render": "^1.0.0",
|
||||
"@kenjiuno/decompressrtf": "^0.1.4",
|
||||
"@kenjiuno/msgreader": "^1.22.0",
|
||||
"@sindresorhus/slugify": "^2.2.1",
|
||||
"@tabler/icons-vue": "^3.20.0",
|
||||
"@tiptap/pm": "2.1.6",
|
||||
@@ -92,6 +94,8 @@
|
||||
"iso-639-1": "^3.1.3",
|
||||
"js-base64": "^3.7.7",
|
||||
"jsbarcode": "^3.11.6",
|
||||
"iconv-lite": "^0.6.3",
|
||||
"js-base64": "^3.7.6",
|
||||
"json5": "^2.2.3",
|
||||
"jwt-decode": "^3.1.2",
|
||||
"libphonenumber-js": "^1.10.28",
|
||||
@@ -116,6 +120,9 @@
|
||||
"randexp": "^0.5.3",
|
||||
"regex": "^4.3.3",
|
||||
"shiki": "^1.22.0",
|
||||
"postal-mime": "^2.2.7",
|
||||
"qrcode": "^1.5.1",
|
||||
"rtf-stream-parser": "^3.8.0",
|
||||
"sql-formatter": "^13.0.0",
|
||||
"sshpk": "^1.18.0",
|
||||
"ua-parser-js": "^1.0.35",
|
||||
@@ -175,6 +182,7 @@
|
||||
"unplugin-vue-components": "^0.25.0",
|
||||
"vite": "^4.4.9",
|
||||
"vite-plugin-node-polyfills": "^0.21.0",
|
||||
"vite-plugin-node-polyfills": "^0.22.0",
|
||||
"vite-plugin-pwa": "^0.16.0",
|
||||
"vite-plugin-top-level-await": "^1.4.2",
|
||||
"vite-plugin-vue-markdown": "^0.23.5",
|
||||
|
||||
Generated
+40
-6
@@ -20,6 +20,12 @@ dependencies:
|
||||
'@it-tools/oggen':
|
||||
specifier: ^1.3.0
|
||||
version: 1.3.0
|
||||
'@kenjiuno/decompressrtf':
|
||||
specifier: ^0.1.4
|
||||
version: 0.1.4
|
||||
'@kenjiuno/msgreader':
|
||||
specifier: ^1.22.0
|
||||
version: 1.22.0
|
||||
'@regexper/render':
|
||||
specifier: ^1.0.0
|
||||
version: 1.0.0
|
||||
@@ -161,11 +167,14 @@ dependencies:
|
||||
ibantools:
|
||||
specifier: ^4.3.3
|
||||
version: 4.3.3
|
||||
iconv-lite:
|
||||
specifier: ^0.6.3
|
||||
version: 0.6.3
|
||||
iso-639-1:
|
||||
specifier: ^3.1.3
|
||||
version: 3.1.3
|
||||
js-base64:
|
||||
specifier: ^3.7.7
|
||||
specifier: ^3.7.6
|
||||
version: 3.7.7
|
||||
jsbarcode:
|
||||
specifier: ^3.11.6
|
||||
@@ -227,6 +236,9 @@ dependencies:
|
||||
plausible-tracker:
|
||||
specifier: ^0.3.8
|
||||
version: 0.3.8
|
||||
postal-mime:
|
||||
specifier: ^2.2.7
|
||||
version: 2.3.2
|
||||
pretty-ms:
|
||||
specifier: ^9.1.0
|
||||
version: 9.1.0
|
||||
@@ -239,6 +251,9 @@ dependencies:
|
||||
regex:
|
||||
specifier: ^4.3.3
|
||||
version: 4.4.0
|
||||
rtf-stream-parser:
|
||||
specifier: ^3.8.0
|
||||
version: 3.8.0
|
||||
shiki:
|
||||
specifier: ^1.22.0
|
||||
version: 1.22.2
|
||||
@@ -413,8 +428,8 @@ devDependencies:
|
||||
specifier: ^4.4.9
|
||||
version: 4.4.9(@types/node@18.15.11)(less@4.1.3)
|
||||
vite-plugin-node-polyfills:
|
||||
specifier: ^0.21.0
|
||||
version: 0.21.0(rollup@2.79.1)(vite@4.4.9)
|
||||
specifier: ^0.22.0
|
||||
version: 0.22.0(rollup@2.79.1)(vite@4.4.9)
|
||||
vite-plugin-pwa:
|
||||
specifier: ^0.16.0
|
||||
version: 0.16.0(vite@4.4.9)(workbox-build@7.0.0)(workbox-window@7.0.0)
|
||||
@@ -2536,6 +2551,18 @@ packages:
|
||||
resolution: {integrity: sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==}
|
||||
dev: false
|
||||
|
||||
/@kenjiuno/decompressrtf@0.1.4:
|
||||
resolution: {integrity: sha512-v9c/iFz17jRWyd2cRnrvJg4VOg/4I/VCk+bG8JnoX2gJ9sAesPzo3uTqcmlVXdpasTI8hChpBVw00pghKe3qTQ==}
|
||||
dev: false
|
||||
|
||||
/@kenjiuno/msgreader@1.22.0:
|
||||
resolution: {integrity: sha512-uhImwxvKLSxER8+ikuKpI2mnX7viL+POSnKAgDCFx+sVuRTD9/KkHFH1Gaw7EegVbCtDNKBTnECIK+GWxkpZRA==}
|
||||
engines: {node: '>= 10'}
|
||||
dependencies:
|
||||
'@kenjiuno/decompressrtf': 0.1.4
|
||||
iconv-lite: 0.6.3
|
||||
dev: false
|
||||
|
||||
/@leichtgewicht/base64-codec@1.0.0:
|
||||
resolution: {integrity: sha512-0cgP4lRBzh3F4tlpTfs7F+PJyBN8j5yUC9KrQFWp/bREswgzZVHE8T1rNyRDWgvALwwpPtnJDQfqWUmxI33Epg==}
|
||||
dev: false
|
||||
@@ -7262,7 +7289,6 @@ packages:
|
||||
engines: {node: '>=0.10.0'}
|
||||
dependencies:
|
||||
safer-buffer: 2.1.2
|
||||
dev: true
|
||||
|
||||
/idb@7.1.1:
|
||||
resolution: {integrity: sha512-gchesWBzyvGHRO9W8tzUWFDycow5gwjvFKfyV9FF32Y7F50yZMp7mP+T2mJIWFx49zicqyC4uefHM17o6xKIVQ==}
|
||||
@@ -8919,6 +8945,10 @@ packages:
|
||||
engines: {node: '>=10.13.0'}
|
||||
dev: false
|
||||
|
||||
/postal-mime@2.3.2:
|
||||
resolution: {integrity: sha512-OZaLbLfLBEJa0ENZRuRwhAminaJevjqHtSICcegO4VOc4QgNHAzNTfVT3gN+KO9YyPFPZQOZ9vtJNmv0n2y8tQ==}
|
||||
dev: false
|
||||
|
||||
/postcss-selector-parser@6.0.13:
|
||||
resolution: {integrity: sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ==}
|
||||
engines: {node: '>=4'}
|
||||
@@ -9536,6 +9566,10 @@ packages:
|
||||
resolution: {integrity: sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==}
|
||||
dev: true
|
||||
|
||||
/rtf-stream-parser@3.8.0:
|
||||
resolution: {integrity: sha512-Hj+FWJ8IhywyxTy0/J1ZbPQLt1+2S8uagOwrU5u1WLBs2hSo0bOc4ZA06sWZHOypi22M60WAgkzUoTclWiqI2Q==}
|
||||
dev: false
|
||||
|
||||
/run-parallel@1.2.0:
|
||||
resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==}
|
||||
dependencies:
|
||||
@@ -10850,8 +10884,8 @@ packages:
|
||||
- terser
|
||||
dev: true
|
||||
|
||||
/vite-plugin-node-polyfills@0.21.0(rollup@2.79.1)(vite@4.4.9):
|
||||
resolution: {integrity: sha512-Sk4DiKnmxN8E0vhgEhzLudfJQfaT8k4/gJ25xvUPG54KjLJ6HAmDKbr4rzDD/QWEY+Lwg80KE85fGYBQihEPQA==}
|
||||
/vite-plugin-node-polyfills@0.22.0(rollup@2.79.1)(vite@4.4.9):
|
||||
resolution: {integrity: sha512-F+G3LjiGbG8QpbH9bZ//GSBr9i1InSTkaulfUHFa9jkLqVGORFBoqc2A/Yu5Mmh1kNAbiAeKeK+6aaQUf3x0JA==}
|
||||
peerDependencies:
|
||||
vite: ^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0
|
||||
dependencies:
|
||||
|
||||
@@ -25,11 +25,16 @@ const props = withDefaults(
|
||||
copyPlacement?: 'top-right' | 'bottom-right' | 'outside' | 'none'
|
||||
copyMessage?: string
|
||||
wordWrap?: boolean
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
downloadFileName?: string
|
||||
downloadButtonText?: string
|
||||
=======
|
||||
>>>>>>> feat/cert-key-parser
|
||||
=======
|
||||
downloadFileName?: string
|
||||
downloadButtonText?: string
|
||||
>>>>>>> feat/email-parser
|
||||
}>(),
|
||||
{
|
||||
followHeightOf: null,
|
||||
|
||||
@@ -0,0 +1,152 @@
|
||||
<script setup lang="ts">
|
||||
import PostalMime from 'postal-mime';
|
||||
|
||||
const inputType = ref<'file' | 'content'>('file');
|
||||
const emailContent = ref('');
|
||||
const fileInput = ref() as Ref<File | null>;
|
||||
const error = ref('');
|
||||
|
||||
const parsedEmail = computedAsync(async () => {
|
||||
const emailContentValue = emailContent.value;
|
||||
const file = fileInput.value;
|
||||
error.value = '';
|
||||
try {
|
||||
if (inputType.value === 'file' && file) {
|
||||
return await PostalMime.parse(await file.arrayBuffer());
|
||||
}
|
||||
else if (inputType.value === 'content' && emailContentValue) {
|
||||
return await PostalMime.parse(emailContentValue);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
catch (e: any) {
|
||||
error.value = e.toString();
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
function downloadFile(data: ArrayBuffer, fileName: string, fileType: string) {
|
||||
const blob = new Blob([data], { type: fileType || 'application/octet-stream' });
|
||||
const downloadUrl = URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.href = downloadUrl;
|
||||
a.download = fileName;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
URL.revokeObjectURL(downloadUrl);
|
||||
}
|
||||
|
||||
function onUpload(file: File) {
|
||||
if (file) {
|
||||
fileInput.value = file;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div style="max-width: 600px;">
|
||||
<c-card title="Input" mb-2>
|
||||
<n-radio-group v-model:value="inputType" name="radiogroup" mb-2 flex justify-center>
|
||||
<n-space>
|
||||
<n-radio
|
||||
value="file"
|
||||
label="File"
|
||||
/>
|
||||
<n-radio
|
||||
value="content"
|
||||
label="Content"
|
||||
/>
|
||||
</n-space>
|
||||
</n-radio-group>
|
||||
|
||||
<c-file-upload
|
||||
v-if="inputType === 'file'"
|
||||
title="Drag and drop EML file here, or click to select a file"
|
||||
@file-upload="onUpload"
|
||||
/>
|
||||
|
||||
<c-input-text
|
||||
v-if="inputType === 'content'"
|
||||
v-model:value="emailContent"
|
||||
label="Email Content"
|
||||
multiline
|
||||
placeholder="Put your eml/email content here..."
|
||||
rows="15"
|
||||
mb-2
|
||||
/>
|
||||
</c-card>
|
||||
|
||||
<c-alert v-if="error">
|
||||
{{ error }}
|
||||
</c-alert>
|
||||
|
||||
<c-card v-if="!error && parsedEmail" title="Output">
|
||||
<input-copyable v-if="fileInput?.name" label="File Name" :value="fileInput?.name" />
|
||||
<input-copyable v-if="parsedEmail.date" label="Date" :value="parsedEmail.date" />
|
||||
<input-copyable v-if="parsedEmail.from?.name" label="From (name)" :value="parsedEmail.from?.name" />
|
||||
<input-copyable v-if="parsedEmail.from" label="From (address)" :value="parsedEmail.from?.address || parsedEmail.from" />
|
||||
<input-copyable v-if="parsedEmail.to" label="To" :value="JSON.stringify(parsedEmail.to)" />
|
||||
<input-copyable v-if="parsedEmail.cc" label="Cc" :value="JSON.stringify(parsedEmail.cc)" />
|
||||
<input-copyable v-if="parsedEmail.bcc" label="Bcc" :value="JSON.stringify(parsedEmail.bcc)" />
|
||||
<input-copyable v-if="parsedEmail.replyTo" label="Reply-To" :value="JSON.stringify(parsedEmail.replyTo)" />
|
||||
<input-copyable v-if="parsedEmail.subject" label="Subject" :value="parsedEmail.subject" />
|
||||
<c-card v-if="parsedEmail.text" title="Plain Content" mb-2>
|
||||
<details>
|
||||
<summary>See content</summary>
|
||||
<textarea-copyable :value="parsedEmail.text" word-wrap />
|
||||
</details>
|
||||
</c-card>
|
||||
<c-card v-if="parsedEmail.html" title="Html Content" mb-2>
|
||||
<details>
|
||||
<summary>See content</summary>
|
||||
<textarea-copyable :value="parsedEmail.html" word-wrap />
|
||||
</details>
|
||||
</c-card>
|
||||
<c-card v-if="parsedEmail?.attachments?.length" title="Attachments" mb-2>
|
||||
<n-table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">
|
||||
Attachment
|
||||
</th><th scope="col" />
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr
|
||||
v-for="(h, index) in parsedEmail.attachments || []"
|
||||
:key="index"
|
||||
>
|
||||
<td>
|
||||
{{ `${h.filename || h.contentId || 'noname'} (${h.mimeType}) / ${h.disposition}` }}
|
||||
</td>
|
||||
<td>
|
||||
<c-button @click="downloadFile(h.content, h.filename || h.contentId || 'noname', h.mimeType)">
|
||||
Download
|
||||
</c-button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</n-table>
|
||||
</c-card>
|
||||
|
||||
<input-copyable v-if="parsedEmail.messageId" label="Message Id" :value="parsedEmail.messageId" />
|
||||
<input-copyable v-if="parsedEmail.inReplyTo" label="In Reply To" :value="parsedEmail.inReplyTo" />
|
||||
<input-copyable v-if="parsedEmail.references" label="References" :value="parsedEmail.references" />
|
||||
<input-copyable v-if="parsedEmail.deliveredTo" label="Delivered To" :value="parsedEmail.deliveredTo" />
|
||||
<input-copyable v-if="parsedEmail.returnPath" label="Return Path" :value="parsedEmail.returnPath" />
|
||||
<input-copyable v-if="parsedEmail.sender?.name" label="Sender (name)" :value="parsedEmail.sender?.name" />
|
||||
<input-copyable v-if="parsedEmail.sender" label="Sender (address)" :value="parsedEmail.sender?.address || parsedEmail.sender" />
|
||||
|
||||
<c-card title="All Headers" mt-2>
|
||||
<input-copyable
|
||||
v-for="(h, index) in parsedEmail.headers || []"
|
||||
:key="index"
|
||||
:label="h.key"
|
||||
:value="h.value"
|
||||
/>
|
||||
</c-card>
|
||||
</c-card>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,12 @@
|
||||
import { Mail } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Email Parser',
|
||||
path: '/email-parser',
|
||||
description: 'Parse and extract information from raw Email content',
|
||||
keywords: ['email', 'parser', 'header', 'rfc2822', 'rfc5322', 'rfc822'],
|
||||
component: () => import('./email-parser.vue'),
|
||||
icon: Mail,
|
||||
createdAt: new Date('2024-08-15'),
|
||||
});
|
||||
@@ -7,6 +7,8 @@ import { tool as bounceParser } from './bounce-parser';
|
||||
import { tool as codeHighlighter } from './code-highlighter';
|
||||
import { tool as colorWheel } from './color-wheel';
|
||||
import { tool as currencyConverter } from './currency-converter';
|
||||
import { tool as emailParser } from './email-parser';
|
||||
import { tool as outlookParser } from './outlook-parser';
|
||||
|
||||
import { tool as cssXpathConverter } from './css-xpath-converter';
|
||||
import { tool as cssSelectorsMemo } from './css-selectors-memo';
|
||||
@@ -226,6 +228,8 @@ export const toolsByCategory: ToolCategory[] = [
|
||||
macAddressGenerator,
|
||||
ipv6UlaGenerator,
|
||||
dnsQueries,
|
||||
emailParser,
|
||||
outlookParser,
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
import { Mail } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Outlook MSG Parser',
|
||||
path: '/outlook-parser',
|
||||
description: 'Parse Outlook MSG Files',
|
||||
keywords: ['outlook', 'email', 'msg', 'parser'],
|
||||
component: () => import('./outlook-parser.vue'),
|
||||
icon: Mail,
|
||||
createdAt: new Date('2024-08-15'),
|
||||
});
|
||||
@@ -0,0 +1,182 @@
|
||||
<script setup lang="ts">
|
||||
import { Buffer } from 'node:buffer';
|
||||
import MsgReader, { type FieldsData } from '@kenjiuno/msgreader';
|
||||
import { getProps } from '@kenjiuno/msgreader/lib/Defs.js';
|
||||
import { deEncapsulateSync } from 'rtf-stream-parser';
|
||||
import { decompressRTF } from '@kenjiuno/decompressrtf';
|
||||
import iconv from 'iconv-lite';
|
||||
|
||||
const fileInput = ref() as Ref<File | null>;
|
||||
const error = ref('');
|
||||
|
||||
function getPropertyName(tag: string | undefined) {
|
||||
if (!tag) {
|
||||
return '';
|
||||
}
|
||||
const tagLower = tag.toLocaleLowerCase();
|
||||
const prop = getProps().find(p => p.key?.toLocaleLowerCase() === tagLower);
|
||||
if (!prop) {
|
||||
return tag;
|
||||
}
|
||||
return `${prop.name} (${prop.area})`;
|
||||
}
|
||||
|
||||
const parsedEmailRaw = computedAsync(async () => {
|
||||
const file = fileInput.value;
|
||||
error.value = '';
|
||||
if (file == null) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
const msg = new MsgReader(await file.arrayBuffer());
|
||||
msg.parserConfig = {
|
||||
includeRawProps: true,
|
||||
};
|
||||
return msg;
|
||||
}
|
||||
catch (e: any) {
|
||||
error.value = e.toString();
|
||||
return null;
|
||||
}
|
||||
});
|
||||
const parsedEmail = computed(() => parsedEmailRaw.value?.getFileData());
|
||||
const parsedRtf = computed(() => {
|
||||
if (!parsedEmail.value?.compressedRtf) {
|
||||
return { rtf: '', html: '' };
|
||||
}
|
||||
try {
|
||||
const rtfBlob = decompressRTF(Array.from(parsedEmail.value?.compressedRtf));
|
||||
const rtfText = iconv.decode(
|
||||
Buffer.from(rtfBlob),
|
||||
'latin1',
|
||||
);
|
||||
try {
|
||||
return { rtf: rtfText, html: deEncapsulateSync(rtfText, { decode: iconv.decode })?.text };
|
||||
}
|
||||
catch (dex: any) {
|
||||
return { rtf: rtfText, html: dex.toString() };
|
||||
}
|
||||
}
|
||||
catch (ex: any) {
|
||||
return { rtf: ex.toString(), html: '' };
|
||||
}
|
||||
});
|
||||
|
||||
function downloadFile(attachment: FieldsData) {
|
||||
const attachmentData = parsedEmailRaw.value?.getAttachment(attachment);
|
||||
if (!attachmentData) {
|
||||
return;
|
||||
}
|
||||
const blob = new Blob([attachmentData.content], { type: 'application/octet-stream' });
|
||||
const downloadUrl = URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.href = downloadUrl;
|
||||
a.download = attachmentData.fileName;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
URL.revokeObjectURL(downloadUrl);
|
||||
}
|
||||
|
||||
function onUpload(file: File) {
|
||||
if (file) {
|
||||
fileInput.value = file;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div style="max-width: 600px;">
|
||||
<c-card title="Input" mb-2>
|
||||
<c-file-upload
|
||||
title="Drag and drop MSG file here, or click to select a file"
|
||||
@file-upload="onUpload"
|
||||
/>
|
||||
</c-card>
|
||||
|
||||
<c-alert v-if="error">
|
||||
{{ error }}
|
||||
</c-alert>
|
||||
|
||||
<c-card v-if="!error && parsedEmail" title="Output">
|
||||
<input-copyable v-if="fileInput?.name" label="File Name" :value="fileInput?.name" />
|
||||
<input-copyable v-if="parsedEmail.creationTime" label="Creation Date" :value="parsedEmail.creationTime" />
|
||||
<input-copyable v-if="parsedEmail.clientSubmitTime" label="Submit Date" :value="parsedEmail.clientSubmitTime" />
|
||||
<input-copyable v-if="parsedEmail.messageDeliveryTime" label="Delivery Date" :value="parsedEmail.messageDeliveryTime" />
|
||||
<input-copyable v-if="parsedEmail.lastModificationTime" label="Last Mod. Date" :value="parsedEmail.lastModificationTime" />
|
||||
<c-card title="Recipients" mt-2>
|
||||
<input-copyable
|
||||
v-for="(h, index) in parsedEmail.recipients || []"
|
||||
:key="index"
|
||||
:label="h.recipType || 'unk'"
|
||||
:value="`${h.name}/${h.email}`"
|
||||
/>
|
||||
</c-card>
|
||||
<input-copyable v-if="parsedEmail.subject" label="Subject" :value="parsedEmail.subject" />
|
||||
<c-card v-if="parsedEmail.body" title="Plain Content" mb-2>
|
||||
<details>
|
||||
<summary>See content</summary>
|
||||
<textarea-copyable :value="parsedEmail.body" />
|
||||
</details>
|
||||
</c-card>
|
||||
<c-card v-if="parsedEmail.bodyHtml" title="Html Content" mb-2>
|
||||
<details>
|
||||
<summary>See content</summary>
|
||||
<textarea-copyable :value="parsedEmail.bodyHtml" word-wrap />
|
||||
</details>
|
||||
</c-card>
|
||||
<c-card v-if="parsedRtf.rtf || parsedRtf.html" title="RTF Content" mb-2>
|
||||
<details>
|
||||
<summary>See Raw RTF</summary>
|
||||
<textarea-copyable :value="parsedRtf.rtf" word-wrap />
|
||||
</details>
|
||||
<details>
|
||||
<summary>See RTF converted HTML</summary>
|
||||
<textarea-copyable :value="parsedRtf.html" word-wrap />
|
||||
</details>
|
||||
</c-card>
|
||||
<c-card v-if="parsedEmail?.attachments?.length" title="Attachments" mb-2>
|
||||
<n-table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">
|
||||
Attachment
|
||||
</th><th scope="col" />
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr
|
||||
v-for="(h, index) in parsedEmail.attachments || []"
|
||||
:key="index"
|
||||
>
|
||||
<td>
|
||||
{{ `${h.fileName || h.fileNameShort || 'noname'}` }}
|
||||
</td>
|
||||
<td>
|
||||
<c-button @click="downloadFile(h)">
|
||||
Download
|
||||
</c-button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</n-table>
|
||||
</c-card>
|
||||
|
||||
<input-copyable v-if="parsedEmail.messageId" label="Message Id" :value="parsedEmail.messageId" />
|
||||
<input-copyable v-if="parsedEmail.senderName" label="Sender (name)" :value="parsedEmail.senderName" />
|
||||
<input-copyable v-if="parsedEmail.senderEmail" label="Sender (email)" :value="parsedEmail.senderEmail" />
|
||||
|
||||
<c-card v-if="parsedEmail.headers" title="All Headers" mt-2>
|
||||
<textarea-copyable :value="parsedEmail.headers" />
|
||||
</c-card>
|
||||
|
||||
<c-card title="All RawProps" mt-2>
|
||||
<input-copyable
|
||||
v-for="(h, index) in parsedEmail.rawProps || []"
|
||||
:key="index"
|
||||
:label="h.propertyName || getPropertyName(h.propertyTag)"
|
||||
:value="h.value"
|
||||
/>
|
||||
</c-card>
|
||||
</c-card>
|
||||
</div>
|
||||
</template>
|
||||
@@ -16,7 +16,11 @@ import { VitePWA } from 'vite-plugin-pwa';
|
||||
import markdown from 'vite-plugin-vue-markdown';
|
||||
import svgLoader from 'vite-svg-loader';
|
||||
import { configDefaults } from 'vitest/config';
|
||||
<<<<<<< HEAD
|
||||
import topLevelAwait from "vite-plugin-top-level-await";
|
||||
=======
|
||||
import { nodePolyfills } from 'vite-plugin-node-polyfills';
|
||||
>>>>>>> feat/email-parser
|
||||
|
||||
const baseUrl = process.env.BASE_URL ?? '/';
|
||||
|
||||
@@ -100,12 +104,15 @@ export default defineConfig({
|
||||
}),
|
||||
Unocss(),
|
||||
nodePolyfills(),
|
||||
<<<<<<< HEAD
|
||||
topLevelAwait({
|
||||
// The export name of top-level await promise for each chunk module
|
||||
promiseExportName: '__tla',
|
||||
// The function to generate import names of top-level await promise in each chunk module
|
||||
promiseImportName: i => `__tla_${i}`,
|
||||
}),
|
||||
=======
|
||||
>>>>>>> feat/email-parser
|
||||
],
|
||||
base: baseUrl,
|
||||
resolve: {
|
||||
|
||||
Reference in new issue
Block a user