n8n-nodes-jmap 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,40 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
3
|
exports.JMAP_CAPABILITIES = void 0;
|
|
40
4
|
exports.getJmapSession = getJmapSession;
|
|
@@ -58,8 +22,6 @@ exports.getThreads = getThreads;
|
|
|
58
22
|
exports.downloadBlob = downloadBlob;
|
|
59
23
|
exports.getAttachments = getAttachments;
|
|
60
24
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
61
|
-
const adm_zip_1 = __importDefault(require("adm-zip"));
|
|
62
|
-
const tar = __importStar(require("tar"));
|
|
63
25
|
// Standard JMAP capabilities
|
|
64
26
|
exports.JMAP_CAPABILITIES = {
|
|
65
27
|
CORE: 'urn:ietf:params:jmap:core',
|
|
@@ -540,112 +502,25 @@ function isTarGzFilename(filename) {
|
|
|
540
502
|
const lower = filename.toLowerCase();
|
|
541
503
|
return lower.endsWith('.tar.gz') || lower.endsWith('.tgz');
|
|
542
504
|
}
|
|
543
|
-
/**
|
|
544
|
-
* Get file extension from filename
|
|
545
|
-
*/
|
|
546
|
-
function getFileExtension(filename) {
|
|
547
|
-
const parts = filename.split('.');
|
|
548
|
-
if (parts.length > 1) {
|
|
549
|
-
return parts[parts.length - 1].toLowerCase();
|
|
550
|
-
}
|
|
551
|
-
return '';
|
|
552
|
-
}
|
|
553
|
-
/**
|
|
554
|
-
* Guess MIME type from filename extension
|
|
555
|
-
*/
|
|
556
|
-
function guessMimeType(filename) {
|
|
557
|
-
const ext = getFileExtension(filename).toLowerCase();
|
|
558
|
-
const mimeTypes = {
|
|
559
|
-
pdf: 'application/pdf',
|
|
560
|
-
doc: 'application/msword',
|
|
561
|
-
docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
562
|
-
xls: 'application/vnd.ms-excel',
|
|
563
|
-
xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
564
|
-
ppt: 'application/vnd.ms-powerpoint',
|
|
565
|
-
pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
|
566
|
-
txt: 'text/plain',
|
|
567
|
-
csv: 'text/csv',
|
|
568
|
-
json: 'application/json',
|
|
569
|
-
xml: 'application/xml',
|
|
570
|
-
html: 'text/html',
|
|
571
|
-
htm: 'text/html',
|
|
572
|
-
jpg: 'image/jpeg',
|
|
573
|
-
jpeg: 'image/jpeg',
|
|
574
|
-
png: 'image/png',
|
|
575
|
-
gif: 'image/gif',
|
|
576
|
-
svg: 'image/svg+xml',
|
|
577
|
-
webp: 'image/webp',
|
|
578
|
-
mp3: 'audio/mpeg',
|
|
579
|
-
wav: 'audio/wav',
|
|
580
|
-
mp4: 'video/mp4',
|
|
581
|
-
avi: 'video/x-msvideo',
|
|
582
|
-
zip: 'application/zip',
|
|
583
|
-
tar: 'application/x-tar',
|
|
584
|
-
gz: 'application/gzip',
|
|
585
|
-
};
|
|
586
|
-
return mimeTypes[ext] || 'application/octet-stream';
|
|
587
|
-
}
|
|
588
505
|
/**
|
|
589
506
|
* Extract files from a ZIP archive
|
|
507
|
+
* Note: Archive extraction is not yet available (planned for future release with self-hosted support)
|
|
508
|
+
* Returns empty array, causing the archive to be returned as-is
|
|
590
509
|
*/
|
|
591
|
-
function extractZip(
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
for (const entry of entries) {
|
|
596
|
-
if (!entry.isDirectory) {
|
|
597
|
-
const data = entry.getData();
|
|
598
|
-
const name = entry.entryName.split('/').pop() || entry.entryName;
|
|
599
|
-
files.push({
|
|
600
|
-
name,
|
|
601
|
-
data,
|
|
602
|
-
mimeType: guessMimeType(name),
|
|
603
|
-
});
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
return files;
|
|
510
|
+
function extractZip(_buffer) {
|
|
511
|
+
// Archive extraction not yet implemented
|
|
512
|
+
// Will be available in a future release for self-hosted n8n
|
|
513
|
+
return [];
|
|
607
514
|
}
|
|
608
515
|
/**
|
|
609
516
|
* Extract files from a tar.gz archive
|
|
517
|
+
* Note: Archive extraction is not yet available (planned for future release with self-hosted support)
|
|
518
|
+
* Returns empty array, causing the archive to be returned as-is
|
|
610
519
|
*/
|
|
611
|
-
async function extractTarGz(
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
const parser = new tar.Parser();
|
|
616
|
-
parser.on('entry', (entry) => {
|
|
617
|
-
if (entry.type === 'File') {
|
|
618
|
-
const entryChunks = [];
|
|
619
|
-
entry.on('data', (chunk) => {
|
|
620
|
-
entryChunks.push(chunk);
|
|
621
|
-
});
|
|
622
|
-
entry.on('end', () => {
|
|
623
|
-
const name = entry.path.split('/').pop() || entry.path;
|
|
624
|
-
chunks.set(name, entryChunks);
|
|
625
|
-
});
|
|
626
|
-
}
|
|
627
|
-
else {
|
|
628
|
-
entry.resume();
|
|
629
|
-
}
|
|
630
|
-
});
|
|
631
|
-
parser.on('end', () => {
|
|
632
|
-
for (const [name, entryChunks] of chunks) {
|
|
633
|
-
const data = Buffer.concat(entryChunks);
|
|
634
|
-
files.push({
|
|
635
|
-
name,
|
|
636
|
-
data,
|
|
637
|
-
mimeType: guessMimeType(name),
|
|
638
|
-
});
|
|
639
|
-
}
|
|
640
|
-
resolve(files);
|
|
641
|
-
});
|
|
642
|
-
parser.on('error', reject);
|
|
643
|
-
const { Gunzip } = require('zlib');
|
|
644
|
-
const gunzip = new Gunzip();
|
|
645
|
-
gunzip.pipe(parser);
|
|
646
|
-
gunzip.write(buffer);
|
|
647
|
-
gunzip.end();
|
|
648
|
-
});
|
|
520
|
+
async function extractTarGz(_buffer) {
|
|
521
|
+
// Archive extraction not yet implemented
|
|
522
|
+
// Will be available in a future release for self-hosted n8n
|
|
523
|
+
return [];
|
|
649
524
|
}
|
|
650
525
|
/**
|
|
651
526
|
* Get attachments from an email and return them as binary data
|
|
@@ -430,11 +430,11 @@ class Jmap {
|
|
|
430
430
|
},
|
|
431
431
|
options: [
|
|
432
432
|
{
|
|
433
|
-
displayName: 'Extract Archives',
|
|
433
|
+
displayName: 'Extract Archives (Coming Soon)',
|
|
434
434
|
name: 'extractArchives',
|
|
435
435
|
type: 'boolean',
|
|
436
436
|
default: false,
|
|
437
|
-
description: '
|
|
437
|
+
description: 'Extract ZIP and tar.gz archives. Note: This feature is planned for a future release and currently returns archives as-is.',
|
|
438
438
|
},
|
|
439
439
|
{
|
|
440
440
|
displayName: 'Include Inline Images',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-jmap",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "n8n community node for JMAP email protocol (RFC 8620/8621) - Works with Apache James, Twake Mail, Fastmail, and other JMAP-compatible servers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"n8n-community-node-package",
|
|
@@ -46,9 +46,7 @@
|
|
|
46
46
|
]
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@types/adm-zip": "^0.5.7",
|
|
50
49
|
"@types/node": "^20.0.0",
|
|
51
|
-
"@types/tar": "^6.1.13",
|
|
52
50
|
"@typescript-eslint/eslint-plugin": "^7.0.0",
|
|
53
51
|
"@typescript-eslint/parser": "^7.0.0",
|
|
54
52
|
"eslint": "^8.56.0",
|
|
@@ -59,9 +57,5 @@
|
|
|
59
57
|
},
|
|
60
58
|
"peerDependencies": {
|
|
61
59
|
"n8n-workflow": "*"
|
|
62
|
-
},
|
|
63
|
-
"dependencies": {
|
|
64
|
-
"adm-zip": "^0.5.16",
|
|
65
|
-
"tar": "^7.5.2"
|
|
66
60
|
}
|
|
67
61
|
}
|