n8n-nodes-aivencerealtycrm 1.0.9 → 1.0.10

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.
@@ -40,6 +40,10 @@ class AivenceRealty {
40
40
  name: 'Property',
41
41
  value: 'property',
42
42
  },
43
+ {
44
+ name: 'Email',
45
+ value: 'email',
46
+ },
43
47
  {
44
48
  name: 'Maintenance Request',
45
49
  value: 'maintenanceRequest',
@@ -591,6 +595,88 @@ class AivenceRealty {
591
595
  description: 'Búsqueda en lenguaje natural (ej: "Busco un apartamento de 3 dormitorios en Palermo con balcón")',
592
596
  },
593
597
  // ============================================
598
+ // EMAIL OPERATIONS
599
+ // ============================================
600
+ {
601
+ displayName: 'Operación',
602
+ name: 'operation',
603
+ type: 'options',
604
+ noDataExpression: true,
605
+ displayOptions: {
606
+ show: {
607
+ resource: ['email'],
608
+ },
609
+ },
610
+ options: [
611
+ {
612
+ name: 'Ingest',
613
+ value: 'ingest',
614
+ description: 'Ingestar email clasificado desde N8N',
615
+ action: 'Ingestar email',
616
+ },
617
+ {
618
+ name: 'List',
619
+ value: 'list',
620
+ description: 'Listar emails con filtros',
621
+ action: 'Listar emails',
622
+ },
623
+ {
624
+ name: 'Get',
625
+ value: 'get',
626
+ description: 'Obtener email por ID',
627
+ action: 'Obtener email',
628
+ },
629
+ {
630
+ name: 'Reply',
631
+ value: 'reply',
632
+ description: 'Enviar respuesta a un email',
633
+ action: 'Responder email',
634
+ },
635
+ {
636
+ name: 'Regenerate AI',
637
+ value: 'regenerateAi',
638
+ description: 'Regenerar respuesta IA con Gemini',
639
+ action: 'Regenerar IA',
640
+ },
641
+ {
642
+ name: 'Mark as Read',
643
+ value: 'markAsRead',
644
+ description: 'Marcar email como leído',
645
+ action: 'Marcar como leído',
646
+ },
647
+ ],
648
+ default: 'ingest',
649
+ },
650
+ // Email ID para get, reply, regenerateAi, markAsRead
651
+ {
652
+ displayName: 'Email ID',
653
+ name: 'emailId',
654
+ type: 'string',
655
+ required: true,
656
+ displayOptions: {
657
+ show: {
658
+ resource: ['email'],
659
+ operation: ['get', 'reply', 'regenerateAi', 'markAsRead'],
660
+ },
661
+ },
662
+ default: '',
663
+ description: 'ID del email',
664
+ },
665
+ // Email Ingest: JSON from previous node
666
+ {
667
+ displayName: 'Usar datos del nodo anterior',
668
+ name: 'useJsonInput',
669
+ type: 'boolean',
670
+ displayOptions: {
671
+ show: {
672
+ resource: ['email'],
673
+ operation: ['ingest', 'reply'],
674
+ },
675
+ },
676
+ default: true,
677
+ description: 'Si está activado, usará el JSON completo del nodo anterior',
678
+ },
679
+ // ============================================
594
680
  // MAINTENANCE REQUEST OPERATIONS
595
681
  // ============================================
596
682
  {
@@ -1159,6 +1245,63 @@ class AivenceRealty {
1159
1245
  }
1160
1246
  }
1161
1247
  // ============================================
1248
+ // EMAIL RESOURCE
1249
+ // ============================================
1250
+ else if (resource === 'email') {
1251
+ if (operation === 'ingest') {
1252
+ const useJsonInput = this.getNodeParameter('useJsonInput', i, true);
1253
+ const body = useJsonInput ? items[i].json : {};
1254
+ responseData = await this.helpers.httpRequest({
1255
+ method: 'POST',
1256
+ url: `${baseUrl}/api/v1/emails/ingest`,
1257
+ body,
1258
+ json: true,
1259
+ });
1260
+ }
1261
+ else if (operation === 'list') {
1262
+ responseData = await this.helpers.httpRequest({
1263
+ method: 'GET',
1264
+ url: `${baseUrl}/api/v1/emails`,
1265
+ json: true,
1266
+ });
1267
+ }
1268
+ else if (operation === 'get') {
1269
+ const emailId = this.getNodeParameter('emailId', i);
1270
+ responseData = await this.helpers.httpRequest({
1271
+ method: 'GET',
1272
+ url: `${baseUrl}/api/v1/emails/${emailId}`,
1273
+ json: true,
1274
+ });
1275
+ }
1276
+ else if (operation === 'reply') {
1277
+ const emailId = this.getNodeParameter('emailId', i);
1278
+ const useJsonInput = this.getNodeParameter('useJsonInput', i, true);
1279
+ const body = useJsonInput ? items[i].json : {};
1280
+ responseData = await this.helpers.httpRequest({
1281
+ method: 'POST',
1282
+ url: `${baseUrl}/api/v1/emails/${emailId}/reply`,
1283
+ body,
1284
+ json: true,
1285
+ });
1286
+ }
1287
+ else if (operation === 'regenerateAi') {
1288
+ const emailId = this.getNodeParameter('emailId', i);
1289
+ responseData = await this.helpers.httpRequest({
1290
+ method: 'POST',
1291
+ url: `${baseUrl}/api/v1/emails/${emailId}/regenerate-ai`,
1292
+ json: true,
1293
+ });
1294
+ }
1295
+ else if (operation === 'markAsRead') {
1296
+ const emailId = this.getNodeParameter('emailId', i);
1297
+ responseData = await this.helpers.httpRequest({
1298
+ method: 'PATCH',
1299
+ url: `${baseUrl}/api/v1/emails/${emailId}/mark-read`,
1300
+ json: true,
1301
+ });
1302
+ }
1303
+ }
1304
+ // ============================================
1162
1305
  // MAINTENANCE REQUEST RESOURCE
1163
1306
  // ============================================
1164
1307
  else if (resource === 'maintenanceRequest') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-aivencerealtycrm",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "Nodo n8n para integrar el CRM inmobiliario AivenceRealty",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",