n8n-nodes-jmap 0.2.2 → 0.2.3
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.
- package/dist/nodes/Jmap/Jmap.node.js +115 -0
- package/package.json +1 -1
|
@@ -464,6 +464,89 @@ class Jmap {
|
|
|
464
464
|
default: 50,
|
|
465
465
|
description: 'Max number of results to return',
|
|
466
466
|
},
|
|
467
|
+
// Options for getMany (search filters)
|
|
468
|
+
{
|
|
469
|
+
displayName: 'Options',
|
|
470
|
+
name: 'getManyOptions',
|
|
471
|
+
type: 'collection',
|
|
472
|
+
placeholder: 'Add Option',
|
|
473
|
+
default: {},
|
|
474
|
+
displayOptions: {
|
|
475
|
+
show: {
|
|
476
|
+
resource: ['email'],
|
|
477
|
+
operation: ['getMany'],
|
|
478
|
+
},
|
|
479
|
+
},
|
|
480
|
+
options: [
|
|
481
|
+
{
|
|
482
|
+
displayName: 'Flagged Only',
|
|
483
|
+
name: 'flaggedOnly',
|
|
484
|
+
type: 'boolean',
|
|
485
|
+
default: false,
|
|
486
|
+
description: 'Whether to return only flagged/starred emails',
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
displayName: 'From Contains',
|
|
490
|
+
name: 'from',
|
|
491
|
+
type: 'string',
|
|
492
|
+
default: '',
|
|
493
|
+
placeholder: 'sender@example.com',
|
|
494
|
+
description: 'Filter emails where the From address contains this text',
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
displayName: 'Full Text Search',
|
|
498
|
+
name: 'text',
|
|
499
|
+
type: 'string',
|
|
500
|
+
default: '',
|
|
501
|
+
placeholder: 'search terms',
|
|
502
|
+
description: 'Search in subject, body, and addresses',
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
displayName: 'Has Attachment',
|
|
506
|
+
name: 'hasAttachment',
|
|
507
|
+
type: 'boolean',
|
|
508
|
+
default: false,
|
|
509
|
+
description: 'Whether to return only emails with attachments',
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
displayName: 'Received After',
|
|
513
|
+
name: 'after',
|
|
514
|
+
type: 'dateTime',
|
|
515
|
+
default: '',
|
|
516
|
+
description: 'Filter emails received after this date',
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
displayName: 'Received Before',
|
|
520
|
+
name: 'before',
|
|
521
|
+
type: 'dateTime',
|
|
522
|
+
default: '',
|
|
523
|
+
description: 'Filter emails received before this date',
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
displayName: 'Subject Contains',
|
|
527
|
+
name: 'subject',
|
|
528
|
+
type: 'string',
|
|
529
|
+
default: '',
|
|
530
|
+
placeholder: 'Invoice',
|
|
531
|
+
description: 'Filter emails where the subject contains this text',
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
displayName: 'To Contains',
|
|
535
|
+
name: 'to',
|
|
536
|
+
type: 'string',
|
|
537
|
+
default: '',
|
|
538
|
+
placeholder: 'recipient@example.com',
|
|
539
|
+
description: 'Filter emails where the To address contains this text',
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
displayName: 'Unread Only',
|
|
543
|
+
name: 'unreadOnly',
|
|
544
|
+
type: 'boolean',
|
|
545
|
+
default: false,
|
|
546
|
+
description: 'Whether to return only unread emails',
|
|
547
|
+
},
|
|
548
|
+
],
|
|
549
|
+
},
|
|
467
550
|
// ==================== MAILBOX PARAMETERS ====================
|
|
468
551
|
{
|
|
469
552
|
displayName: 'Mailbox ID',
|
|
@@ -630,10 +713,42 @@ class Jmap {
|
|
|
630
713
|
if (operation === 'getMany') {
|
|
631
714
|
const mailbox = this.getNodeParameter('mailbox', i);
|
|
632
715
|
const limit = this.getNodeParameter('limit', i);
|
|
716
|
+
const options = this.getNodeParameter('getManyOptions', i);
|
|
633
717
|
const filter = {};
|
|
718
|
+
// Mailbox filter
|
|
634
719
|
if (mailbox) {
|
|
635
720
|
filter.inMailbox = mailbox;
|
|
636
721
|
}
|
|
722
|
+
// Date filters
|
|
723
|
+
if (options.after) {
|
|
724
|
+
filter.after = new Date(options.after).toISOString();
|
|
725
|
+
}
|
|
726
|
+
if (options.before) {
|
|
727
|
+
filter.before = new Date(options.before).toISOString();
|
|
728
|
+
}
|
|
729
|
+
// Content filters
|
|
730
|
+
if (options.from) {
|
|
731
|
+
filter.from = options.from;
|
|
732
|
+
}
|
|
733
|
+
if (options.to) {
|
|
734
|
+
filter.to = options.to;
|
|
735
|
+
}
|
|
736
|
+
if (options.subject) {
|
|
737
|
+
filter.subject = options.subject;
|
|
738
|
+
}
|
|
739
|
+
if (options.text) {
|
|
740
|
+
filter.text = options.text;
|
|
741
|
+
}
|
|
742
|
+
// Boolean filters
|
|
743
|
+
if (options.hasAttachment) {
|
|
744
|
+
filter.hasAttachment = true;
|
|
745
|
+
}
|
|
746
|
+
if (options.unreadOnly) {
|
|
747
|
+
filter.notKeyword = '$seen';
|
|
748
|
+
}
|
|
749
|
+
if (options.flaggedOnly) {
|
|
750
|
+
filter.hasKeyword = '$flagged';
|
|
751
|
+
}
|
|
637
752
|
const { ids } = await GenericFunctions_1.queryEmails.call(this, accountId, filter, [{ property: 'receivedAt', isAscending: false }], limit);
|
|
638
753
|
if (ids.length > 0) {
|
|
639
754
|
responseData = await GenericFunctions_1.getEmails.call(this, accountId, ids);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-jmap",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
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",
|