n8n-nodes-imobzi 0.3.43 → 0.3.45

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.
@@ -11,65 +11,12 @@ const resourceEndpoint = {
11
11
  locacao: 'rentals',
12
12
  documento: 'documents',
13
13
  tarefa: 'tasks',
14
- agenda: 'events',
14
+ agenda: 'agendas',
15
+ evento: 'events',
15
16
  integracao: 'integrations',
16
17
  usuario: 'users',
17
18
  account: 'account',
18
19
  };
19
- const createFiltersProperty = () => ({
20
- displayName: 'Filtros',
21
- name: 'filters',
22
- type: 'fixedCollection',
23
- typeOptions: { multipleValues: true },
24
- placeholder: 'Adicionar filtro',
25
- default: {},
26
- displayOptions: {
27
- show: {
28
- operation: ['getAll', 'delete'],
29
- },
30
- },
31
- options: [
32
- {
33
- name: 'filter',
34
- displayName: 'Condição',
35
- values: [
36
- {
37
- displayName: 'Campo',
38
- name: 'field',
39
- type: 'string',
40
- default: '',
41
- description: 'Campo para filtrar',
42
- },
43
- {
44
- displayName: 'Operador',
45
- name: 'operator',
46
- type: 'options',
47
- options: [
48
- { name: 'Começa Com', value: 'starts_with' },
49
- { name: 'Contém', value: 'contains' },
50
- { name: 'Diferente', value: 'neq' },
51
- { name: 'Igual', value: 'eq' },
52
- { name: 'Maior Ou Igual', value: 'gte' },
53
- { name: 'Maior Que', value: 'gt' },
54
- { name: 'Menor Ou Igual', value: 'lte' },
55
- { name: 'Menor Que', value: 'lt' },
56
- { name: 'Não Contém', value: 'not_contains' },
57
- { name: 'Termina Com', value: 'ends_with' },
58
- ],
59
- default: 'eq',
60
- description: 'Operador de comparação',
61
- },
62
- {
63
- displayName: 'Valor',
64
- name: 'value',
65
- type: 'string',
66
- default: '',
67
- description: 'Valor para comparar',
68
- },
69
- ],
70
- },
71
- ],
72
- });
73
20
  const createCreateFieldsProperty = (resourceName) => ({
74
21
  displayName: 'Create Fields',
75
22
  name: 'createFields',
@@ -204,22 +151,185 @@ class Imobzi {
204
151
  constructor() {
205
152
  this.methods = {
206
153
  loadOptions: {
207
- async getAllResources() {
208
- const resource = this.getNodeParameter('resource', 0);
209
- const endpoint = resourceEndpoint[resource];
210
- if (!endpoint) {
211
- return [];
212
- }
213
- try {
214
- const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: `/${endpoint}` });
215
- return (response.data || []).map((item) => ({
216
- name: item.name || item.title || item.titulo || `ID ${item.id}`,
217
- value: item.id,
218
- }));
219
- }
220
- catch (error) {
221
- return [];
222
- }
154
+ async getLeads() {
155
+ const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/leads' });
156
+ return (response.data || []).map((item) => ({
157
+ name: item.name || `ID ${item.id}`,
158
+ value: item.id,
159
+ }));
160
+ },
161
+ async getLeadFields() {
162
+ const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/leads', qs: { limit: 1 } });
163
+ const item = (response.data || [])[0] || {};
164
+ return Object.keys(item).map(key => ({
165
+ name: key,
166
+ value: key,
167
+ }));
168
+ },
169
+ async getProperties() {
170
+ const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/properties' });
171
+ return (response.data || []).map((item) => ({
172
+ name: item.title || item.titulo || `ID ${item.id}`,
173
+ value: item.id,
174
+ }));
175
+ },
176
+ async getPropertyFields() {
177
+ const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/properties', qs: { limit: 1 } });
178
+ const item = (response.data || [])[0] || {};
179
+ return Object.keys(item).map(key => ({
180
+ name: key,
181
+ value: key,
182
+ }));
183
+ },
184
+ async getContacts() {
185
+ const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/contacts' });
186
+ return (response.data || []).map((item) => ({
187
+ name: item.name || `ID ${item.id}`,
188
+ value: item.id,
189
+ }));
190
+ },
191
+ async getContactFields() {
192
+ const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/contacts', qs: { limit: 1 } });
193
+ const item = (response.data || [])[0] || {};
194
+ return Object.keys(item).map(key => ({
195
+ name: key,
196
+ value: key,
197
+ }));
198
+ },
199
+ async getContracts() {
200
+ const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/contracts' });
201
+ return (response.data || []).map((item) => ({
202
+ name: item.client || item.cliente || `ID ${item.id}`,
203
+ value: item.id,
204
+ }));
205
+ },
206
+ async getContractFields() {
207
+ const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/contracts', qs: { limit: 1 } });
208
+ const item = (response.data || [])[0] || {};
209
+ return Object.keys(item).map(key => ({
210
+ name: key,
211
+ value: key,
212
+ }));
213
+ },
214
+ async getFinancialAccounts() {
215
+ const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/financial/accounts' });
216
+ return (response.data || []).map((item) => ({
217
+ name: item.description || item.descricao || `ID ${item.id}`,
218
+ value: item.id,
219
+ }));
220
+ },
221
+ async getFinancialAccountFields() {
222
+ const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/financial/accounts', qs: { limit: 1 } });
223
+ const item = (response.data || [])[0] || {};
224
+ return Object.keys(item).map(key => ({
225
+ name: key,
226
+ value: key,
227
+ }));
228
+ },
229
+ async getRentals() {
230
+ const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/rentals' });
231
+ return (response.data || []).map((item) => ({
232
+ name: item.tenant || item.inquilino || `ID ${item.id}`,
233
+ value: item.id,
234
+ }));
235
+ },
236
+ async getRentalFields() {
237
+ const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/rentals', qs: { limit: 1 } });
238
+ const item = (response.data || [])[0] || {};
239
+ return Object.keys(item).map(key => ({
240
+ name: key,
241
+ value: key,
242
+ }));
243
+ },
244
+ async getDocuments() {
245
+ const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/documents' });
246
+ return (response.data || []).map((item) => ({
247
+ name: item.filename || item.nomeArquivo || `ID ${item.id}`,
248
+ value: item.id,
249
+ }));
250
+ },
251
+ async getDocumentFields() {
252
+ const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/documents', qs: { limit: 1 } });
253
+ const item = (response.data || [])[0] || {};
254
+ return Object.keys(item).map(key => ({
255
+ name: key,
256
+ value: key,
257
+ }));
258
+ },
259
+ async getTasks() {
260
+ const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/tasks' });
261
+ return (response.data || []).map((item) => ({
262
+ name: item.title || item.titulo || `ID ${item.id}`,
263
+ value: item.id,
264
+ }));
265
+ },
266
+ async getTaskFields() {
267
+ const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/tasks', qs: { limit: 1 } });
268
+ const item = (response.data || [])[0] || {};
269
+ return Object.keys(item).map(key => ({
270
+ name: key,
271
+ value: key,
272
+ }));
273
+ },
274
+ async getAgendas() {
275
+ const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/agendas' });
276
+ return (response.data || []).map((item) => ({
277
+ name: item.title || item.titulo || `ID ${item.id}`,
278
+ value: item.id,
279
+ }));
280
+ },
281
+ async getAgendaFields() {
282
+ const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/agendas', qs: { limit: 1 } });
283
+ const item = (response.data || [])[0] || {};
284
+ return Object.keys(item).map(key => ({
285
+ name: key,
286
+ value: key,
287
+ }));
288
+ },
289
+ async getEvents() {
290
+ const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/events' });
291
+ return (response.data || []).map((item) => ({
292
+ name: item.title || item.titulo || `ID ${item.id}`,
293
+ value: item.id,
294
+ }));
295
+ },
296
+ async getEventFields() {
297
+ const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/events', qs: { limit: 1 } });
298
+ const item = (response.data || [])[0] || {};
299
+ return Object.keys(item).map(key => ({
300
+ name: key,
301
+ value: key,
302
+ }));
303
+ },
304
+ async getIntegrations() {
305
+ const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/integrations' });
306
+ return (response.data || []).map((item) => ({
307
+ name: item.name || item.nome || `ID ${item.id}`,
308
+ value: item.id,
309
+ }));
310
+ },
311
+ async getIntegrationFields() {
312
+ const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/integrations', qs: { limit: 1 } });
313
+ const item = (response.data || [])[0] || {};
314
+ return Object.keys(item).map(key => ({
315
+ name: key,
316
+ value: key,
317
+ }));
318
+ },
319
+ async getUsers() {
320
+ const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/users' });
321
+ return (response.data || []).map((item) => ({
322
+ name: item.name || item.nome || `ID ${item.id}`,
323
+ value: item.id,
324
+ }));
325
+ },
326
+ async getUserFields() {
327
+ const response = await this.helpers.requestWithAuthentication.call(this, 'imobziApi', { method: 'GET', url: '/users', qs: { limit: 1 } });
328
+ const item = (response.data || [])[0] || {};
329
+ return Object.keys(item).map(key => ({
330
+ name: key,
331
+ value: key,
332
+ }));
223
333
  },
224
334
  },
225
335
  };
@@ -253,6 +363,7 @@ class Imobzi {
253
363
  { name: 'Contact', value: 'contact' },
254
364
  { name: 'Contrato', value: 'contrato' },
255
365
  { name: 'Documento', value: 'documento' },
366
+ { name: 'Evento', value: 'evento' },
256
367
  { name: 'Financeiro', value: 'financeiro' },
257
368
  { name: 'Imovel', value: 'property' },
258
369
  { name: 'Integracao', value: 'integracao' },
@@ -278,11 +389,147 @@ class Imobzi {
278
389
  default: 'create',
279
390
  },
280
391
  {
281
- displayName: 'ID Name or ID',
392
+ displayName: 'Lead Name or ID',
393
+ name: 'id',
394
+ type: 'options',
395
+ typeOptions: {
396
+ loadOptionsMethod: 'getLeads',
397
+ },
398
+ required: true,
399
+ default: '',
400
+ description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
401
+ displayOptions: {
402
+ show: {
403
+ operation: ['get', 'update', 'delete'],
404
+ resource: ['lead'],
405
+ },
406
+ },
407
+ },
408
+ {
409
+ displayName: 'Property Name or ID',
410
+ name: 'id',
411
+ type: 'options',
412
+ typeOptions: {
413
+ loadOptionsMethod: 'getProperties',
414
+ },
415
+ required: true,
416
+ default: '',
417
+ description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
418
+ displayOptions: {
419
+ show: {
420
+ operation: ['get', 'update', 'delete'],
421
+ resource: ['property'],
422
+ },
423
+ },
424
+ },
425
+ {
426
+ displayName: 'Contact Name or ID',
427
+ name: 'id',
428
+ type: 'options',
429
+ typeOptions: {
430
+ loadOptionsMethod: 'getContacts',
431
+ },
432
+ required: true,
433
+ default: '',
434
+ description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
435
+ displayOptions: {
436
+ show: {
437
+ operation: ['get', 'update', 'delete'],
438
+ resource: ['contact'],
439
+ },
440
+ },
441
+ },
442
+ {
443
+ displayName: 'Contract Name or ID',
444
+ name: 'id',
445
+ type: 'options',
446
+ typeOptions: {
447
+ loadOptionsMethod: 'getContracts',
448
+ },
449
+ required: true,
450
+ default: '',
451
+ description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
452
+ displayOptions: {
453
+ show: {
454
+ operation: ['get', 'update', 'delete'],
455
+ resource: ['contrato'],
456
+ },
457
+ },
458
+ },
459
+ {
460
+ displayName: 'Financial Account Name or ID',
461
+ name: 'id',
462
+ type: 'options',
463
+ typeOptions: {
464
+ loadOptionsMethod: 'getFinancialAccounts',
465
+ },
466
+ required: true,
467
+ default: '',
468
+ description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
469
+ displayOptions: {
470
+ show: {
471
+ operation: ['get', 'update', 'delete'],
472
+ resource: ['financeiro'],
473
+ },
474
+ },
475
+ },
476
+ {
477
+ displayName: 'Rental Name or ID',
478
+ name: 'id',
479
+ type: 'options',
480
+ typeOptions: {
481
+ loadOptionsMethod: 'getRentals',
482
+ },
483
+ required: true,
484
+ default: '',
485
+ description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
486
+ displayOptions: {
487
+ show: {
488
+ operation: ['get', 'update', 'delete'],
489
+ resource: ['locacao'],
490
+ },
491
+ },
492
+ },
493
+ {
494
+ displayName: 'Document Name or ID',
495
+ name: 'id',
496
+ type: 'options',
497
+ typeOptions: {
498
+ loadOptionsMethod: 'getDocuments',
499
+ },
500
+ required: true,
501
+ default: '',
502
+ description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
503
+ displayOptions: {
504
+ show: {
505
+ operation: ['get', 'update', 'delete'],
506
+ resource: ['documento'],
507
+ },
508
+ },
509
+ },
510
+ {
511
+ displayName: 'Task Name or ID',
512
+ name: 'id',
513
+ type: 'options',
514
+ typeOptions: {
515
+ loadOptionsMethod: 'getTasks',
516
+ },
517
+ required: true,
518
+ default: '',
519
+ description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
520
+ displayOptions: {
521
+ show: {
522
+ operation: ['get', 'update', 'delete'],
523
+ resource: ['tarefa'],
524
+ },
525
+ },
526
+ },
527
+ {
528
+ displayName: 'Agenda Name or ID',
282
529
  name: 'id',
283
530
  type: 'options',
284
531
  typeOptions: {
285
- loadOptionsMethod: 'getAllResources',
532
+ loadOptionsMethod: 'getAgendas',
286
533
  },
287
534
  required: true,
288
535
  default: '',
@@ -290,11 +537,733 @@ class Imobzi {
290
537
  displayOptions: {
291
538
  show: {
292
539
  operation: ['get', 'update', 'delete'],
293
- resource: ['lead', 'property', 'contact', 'contrato', 'financeiro', 'locacao', 'documento', 'tarefa', 'agenda', 'integracao', 'usuario'],
540
+ resource: ['agenda'],
294
541
  },
295
542
  },
296
543
  },
297
- createFiltersProperty(),
544
+ {
545
+ displayName: 'Event Name or ID',
546
+ name: 'id',
547
+ type: 'options',
548
+ typeOptions: {
549
+ loadOptionsMethod: 'getEvents',
550
+ },
551
+ required: true,
552
+ default: '',
553
+ description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
554
+ displayOptions: {
555
+ show: {
556
+ operation: ['get', 'update', 'delete'],
557
+ resource: ['evento'],
558
+ },
559
+ },
560
+ },
561
+ {
562
+ displayName: 'Integration Name or ID',
563
+ name: 'id',
564
+ type: 'options',
565
+ typeOptions: {
566
+ loadOptionsMethod: 'getIntegrations',
567
+ },
568
+ required: true,
569
+ default: '',
570
+ description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
571
+ displayOptions: {
572
+ show: {
573
+ operation: ['get', 'update', 'delete'],
574
+ resource: ['integracao'],
575
+ },
576
+ },
577
+ },
578
+ {
579
+ displayName: 'User Name or ID',
580
+ name: 'id',
581
+ type: 'options',
582
+ typeOptions: {
583
+ loadOptionsMethod: 'getUsers',
584
+ },
585
+ required: true,
586
+ default: '',
587
+ description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
588
+ displayOptions: {
589
+ show: {
590
+ operation: ['get', 'update', 'delete'],
591
+ resource: ['usuario'],
592
+ },
593
+ },
594
+ },
595
+ {
596
+ displayName: 'Filtros',
597
+ name: 'filters',
598
+ type: 'fixedCollection',
599
+ typeOptions: { multipleValues: true },
600
+ placeholder: 'Adicionar filtro',
601
+ default: {},
602
+ displayOptions: {
603
+ show: {
604
+ resource: ['lead'],
605
+ operation: ['getAll'],
606
+ },
607
+ },
608
+ options: [
609
+ {
610
+ name: 'filter',
611
+ displayName: 'Condição',
612
+ values: [
613
+ {
614
+ displayName: 'Campo Name or ID',
615
+ name: 'field',
616
+ type: 'options',
617
+ typeOptions: { loadOptionsMethod: 'getLeadFields' },
618
+ default: '',
619
+ description: 'Campo para filtrar. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
620
+ },
621
+ {
622
+ displayName: 'Operador',
623
+ name: 'operator',
624
+ type: 'options',
625
+ options: [
626
+ { name: 'Começa Com', value: 'starts_with' },
627
+ { name: 'Contém', value: 'contains' },
628
+ { name: 'Diferente', value: 'neq' },
629
+ { name: 'Igual', value: 'eq' },
630
+ { name: 'Maior Ou Igual', value: 'gte' },
631
+ { name: 'Maior Que', value: 'gt' },
632
+ { name: 'Menor Ou Igual', value: 'lte' },
633
+ { name: 'Menor Que', value: 'lt' },
634
+ { name: 'Não Contém', value: 'not_contains' },
635
+ { name: 'Termina Com', value: 'ends_with' },
636
+ ],
637
+ default: 'eq',
638
+ description: 'Operador de comparação',
639
+ },
640
+ {
641
+ displayName: 'Valor',
642
+ name: 'value',
643
+ type: 'string',
644
+ default: '',
645
+ description: 'Valor para comparar',
646
+ },
647
+ ],
648
+ },
649
+ ],
650
+ },
651
+ {
652
+ displayName: 'Filtros',
653
+ name: 'filters',
654
+ type: 'fixedCollection',
655
+ typeOptions: { multipleValues: true },
656
+ placeholder: 'Adicionar filtro',
657
+ default: {},
658
+ displayOptions: {
659
+ show: {
660
+ resource: ['property'],
661
+ operation: ['getAll'],
662
+ },
663
+ },
664
+ options: [
665
+ {
666
+ name: 'filter',
667
+ displayName: 'Condição',
668
+ values: [
669
+ {
670
+ displayName: 'Campo Name or ID',
671
+ name: 'field',
672
+ type: 'options',
673
+ typeOptions: { loadOptionsMethod: 'getPropertyFields' },
674
+ default: '',
675
+ description: 'Campo para filtrar. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
676
+ },
677
+ {
678
+ displayName: 'Operador',
679
+ name: 'operator',
680
+ type: 'options',
681
+ options: [
682
+ { name: 'Começa Com', value: 'starts_with' },
683
+ { name: 'Contém', value: 'contains' },
684
+ { name: 'Diferente', value: 'neq' },
685
+ { name: 'Igual', value: 'eq' },
686
+ { name: 'Maior Ou Igual', value: 'gte' },
687
+ { name: 'Maior Que', value: 'gt' },
688
+ { name: 'Menor Ou Igual', value: 'lte' },
689
+ { name: 'Menor Que', value: 'lt' },
690
+ { name: 'Não Contém', value: 'not_contains' },
691
+ { name: 'Termina Com', value: 'ends_with' },
692
+ ],
693
+ default: 'eq',
694
+ description: 'Operador de comparação',
695
+ },
696
+ {
697
+ displayName: 'Valor',
698
+ name: 'value',
699
+ type: 'string',
700
+ default: '',
701
+ description: 'Valor para comparar',
702
+ },
703
+ ],
704
+ },
705
+ ],
706
+ },
707
+ {
708
+ displayName: 'Filtros',
709
+ name: 'filters',
710
+ type: 'fixedCollection',
711
+ typeOptions: { multipleValues: true },
712
+ placeholder: 'Adicionar filtro',
713
+ default: {},
714
+ displayOptions: {
715
+ show: {
716
+ resource: ['contact'],
717
+ operation: ['getAll'],
718
+ },
719
+ },
720
+ options: [
721
+ {
722
+ name: 'filter',
723
+ displayName: 'Condição',
724
+ values: [
725
+ {
726
+ displayName: 'Campo Name or ID',
727
+ name: 'field',
728
+ type: 'options',
729
+ typeOptions: { loadOptionsMethod: 'getContactFields' },
730
+ default: '',
731
+ description: 'Campo para filtrar. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
732
+ },
733
+ {
734
+ displayName: 'Operador',
735
+ name: 'operator',
736
+ type: 'options',
737
+ options: [
738
+ { name: 'Começa Com', value: 'starts_with' },
739
+ { name: 'Contém', value: 'contains' },
740
+ { name: 'Diferente', value: 'neq' },
741
+ { name: 'Igual', value: 'eq' },
742
+ { name: 'Maior Ou Igual', value: 'gte' },
743
+ { name: 'Maior Que', value: 'gt' },
744
+ { name: 'Menor Ou Igual', value: 'lte' },
745
+ { name: 'Menor Que', value: 'lt' },
746
+ { name: 'Não Contém', value: 'not_contains' },
747
+ { name: 'Termina Com', value: 'ends_with' },
748
+ ],
749
+ default: 'eq',
750
+ description: 'Operador de comparação',
751
+ },
752
+ {
753
+ displayName: 'Valor',
754
+ name: 'value',
755
+ type: 'string',
756
+ default: '',
757
+ description: 'Valor para comparar',
758
+ },
759
+ ],
760
+ },
761
+ ],
762
+ },
763
+ {
764
+ displayName: 'Filtros',
765
+ name: 'filters',
766
+ type: 'fixedCollection',
767
+ typeOptions: { multipleValues: true },
768
+ placeholder: 'Adicionar filtro',
769
+ default: {},
770
+ displayOptions: {
771
+ show: {
772
+ resource: ['contrato'],
773
+ operation: ['getAll'],
774
+ },
775
+ },
776
+ options: [
777
+ {
778
+ name: 'filter',
779
+ displayName: 'Condição',
780
+ values: [
781
+ {
782
+ displayName: 'Campo Name or ID',
783
+ name: 'field',
784
+ type: 'options',
785
+ typeOptions: { loadOptionsMethod: 'getContractFields' },
786
+ default: '',
787
+ description: 'Campo para filtrar. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
788
+ },
789
+ {
790
+ displayName: 'Operador',
791
+ name: 'operator',
792
+ type: 'options',
793
+ options: [
794
+ { name: 'Começa Com', value: 'starts_with' },
795
+ { name: 'Contém', value: 'contains' },
796
+ { name: 'Diferente', value: 'neq' },
797
+ { name: 'Igual', value: 'eq' },
798
+ { name: 'Maior Ou Igual', value: 'gte' },
799
+ { name: 'Maior Que', value: 'gt' },
800
+ { name: 'Menor Ou Igual', value: 'lte' },
801
+ { name: 'Menor Que', value: 'lt' },
802
+ { name: 'Não Contém', value: 'not_contains' },
803
+ { name: 'Termina Com', value: 'ends_with' },
804
+ ],
805
+ default: 'eq',
806
+ description: 'Operador de comparação',
807
+ },
808
+ {
809
+ displayName: 'Valor',
810
+ name: 'value',
811
+ type: 'string',
812
+ default: '',
813
+ description: 'Valor para comparar',
814
+ },
815
+ ],
816
+ },
817
+ ],
818
+ },
819
+ {
820
+ displayName: 'Filtros',
821
+ name: 'filters',
822
+ type: 'fixedCollection',
823
+ typeOptions: { multipleValues: true },
824
+ placeholder: 'Adicionar filtro',
825
+ default: {},
826
+ displayOptions: {
827
+ show: {
828
+ resource: ['financeiro'],
829
+ operation: ['getAll'],
830
+ },
831
+ },
832
+ options: [
833
+ {
834
+ name: 'filter',
835
+ displayName: 'Condição',
836
+ values: [
837
+ {
838
+ displayName: 'Campo Name or ID',
839
+ name: 'field',
840
+ type: 'options',
841
+ typeOptions: { loadOptionsMethod: 'getFinancialAccountFields' },
842
+ default: '',
843
+ description: 'Campo para filtrar. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
844
+ },
845
+ {
846
+ displayName: 'Operador',
847
+ name: 'operator',
848
+ type: 'options',
849
+ options: [
850
+ { name: 'Começa Com', value: 'starts_with' },
851
+ { name: 'Contém', value: 'contains' },
852
+ { name: 'Diferente', value: 'neq' },
853
+ { name: 'Igual', value: 'eq' },
854
+ { name: 'Maior Ou Igual', value: 'gte' },
855
+ { name: 'Maior Que', value: 'gt' },
856
+ { name: 'Menor Ou Igual', value: 'lte' },
857
+ { name: 'Menor Que', value: 'lt' },
858
+ { name: 'Não Contém', value: 'not_contains' },
859
+ { name: 'Termina Com', value: 'ends_with' },
860
+ ],
861
+ default: 'eq',
862
+ description: 'Operador de comparação',
863
+ },
864
+ {
865
+ displayName: 'Valor',
866
+ name: 'value',
867
+ type: 'string',
868
+ default: '',
869
+ description: 'Valor para comparar',
870
+ },
871
+ ],
872
+ },
873
+ ],
874
+ },
875
+ {
876
+ displayName: 'Filtros',
877
+ name: 'filters',
878
+ type: 'fixedCollection',
879
+ typeOptions: { multipleValues: true },
880
+ placeholder: 'Adicionar filtro',
881
+ default: {},
882
+ displayOptions: {
883
+ show: {
884
+ resource: ['locacao'],
885
+ operation: ['getAll'],
886
+ },
887
+ },
888
+ options: [
889
+ {
890
+ name: 'filter',
891
+ displayName: 'Condição',
892
+ values: [
893
+ {
894
+ displayName: 'Campo Name or ID',
895
+ name: 'field',
896
+ type: 'options',
897
+ typeOptions: { loadOptionsMethod: 'getRentalFields' },
898
+ default: '',
899
+ description: 'Campo para filtrar. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
900
+ },
901
+ {
902
+ displayName: 'Operador',
903
+ name: 'operator',
904
+ type: 'options',
905
+ options: [
906
+ { name: 'Começa Com', value: 'starts_with' },
907
+ { name: 'Contém', value: 'contains' },
908
+ { name: 'Diferente', value: 'neq' },
909
+ { name: 'Igual', value: 'eq' },
910
+ { name: 'Maior Ou Igual', value: 'gte' },
911
+ { name: 'Maior Que', value: 'gt' },
912
+ { name: 'Menor Ou Igual', value: 'lte' },
913
+ { name: 'Menor Que', value: 'lt' },
914
+ { name: 'Não Contém', value: 'not_contains' },
915
+ { name: 'Termina Com', value: 'ends_with' },
916
+ ],
917
+ default: 'eq',
918
+ description: 'Operador de comparação',
919
+ },
920
+ {
921
+ displayName: 'Valor',
922
+ name: 'value',
923
+ type: 'string',
924
+ default: '',
925
+ description: 'Valor para comparar',
926
+ },
927
+ ],
928
+ },
929
+ ],
930
+ },
931
+ {
932
+ displayName: 'Filtros',
933
+ name: 'filters',
934
+ type: 'fixedCollection',
935
+ typeOptions: { multipleValues: true },
936
+ placeholder: 'Adicionar filtro',
937
+ default: {},
938
+ displayOptions: {
939
+ show: {
940
+ resource: ['documento'],
941
+ operation: ['getAll'],
942
+ },
943
+ },
944
+ options: [
945
+ {
946
+ name: 'filter',
947
+ displayName: 'Condição',
948
+ values: [
949
+ {
950
+ displayName: 'Campo Name or ID',
951
+ name: 'field',
952
+ type: 'options',
953
+ typeOptions: { loadOptionsMethod: 'getDocumentFields' },
954
+ default: '',
955
+ description: 'Campo para filtrar. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
956
+ },
957
+ {
958
+ displayName: 'Operador',
959
+ name: 'operator',
960
+ type: 'options',
961
+ options: [
962
+ { name: 'Começa Com', value: 'starts_with' },
963
+ { name: 'Contém', value: 'contains' },
964
+ { name: 'Diferente', value: 'neq' },
965
+ { name: 'Igual', value: 'eq' },
966
+ { name: 'Maior Ou Igual', value: 'gte' },
967
+ { name: 'Maior Que', value: 'gt' },
968
+ { name: 'Menor Ou Igual', value: 'lte' },
969
+ { name: 'Menor Que', value: 'lt' },
970
+ { name: 'Não Contém', value: 'not_contains' },
971
+ { name: 'Termina Com', value: 'ends_with' },
972
+ ],
973
+ default: 'eq',
974
+ description: 'Operador de comparação',
975
+ },
976
+ {
977
+ displayName: 'Valor',
978
+ name: 'value',
979
+ type: 'string',
980
+ default: '',
981
+ description: 'Valor para comparar',
982
+ },
983
+ ],
984
+ },
985
+ ],
986
+ },
987
+ {
988
+ displayName: 'Filtros',
989
+ name: 'filters',
990
+ type: 'fixedCollection',
991
+ typeOptions: { multipleValues: true },
992
+ placeholder: 'Adicionar filtro',
993
+ default: {},
994
+ displayOptions: {
995
+ show: {
996
+ resource: ['tarefa'],
997
+ operation: ['getAll'],
998
+ },
999
+ },
1000
+ options: [
1001
+ {
1002
+ name: 'filter',
1003
+ displayName: 'Condição',
1004
+ values: [
1005
+ {
1006
+ displayName: 'Campo Name or ID',
1007
+ name: 'field',
1008
+ type: 'options',
1009
+ typeOptions: { loadOptionsMethod: 'getTaskFields' },
1010
+ default: '',
1011
+ description: 'Campo para filtrar. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
1012
+ },
1013
+ {
1014
+ displayName: 'Operador',
1015
+ name: 'operator',
1016
+ type: 'options',
1017
+ options: [
1018
+ { name: 'Começa Com', value: 'starts_with' },
1019
+ { name: 'Contém', value: 'contains' },
1020
+ { name: 'Diferente', value: 'neq' },
1021
+ { name: 'Igual', value: 'eq' },
1022
+ { name: 'Maior Ou Igual', value: 'gte' },
1023
+ { name: 'Maior Que', value: 'gt' },
1024
+ { name: 'Menor Ou Igual', value: 'lte' },
1025
+ { name: 'Menor Que', value: 'lt' },
1026
+ { name: 'Não Contém', value: 'not_contains' },
1027
+ { name: 'Termina Com', value: 'ends_with' },
1028
+ ],
1029
+ default: 'eq',
1030
+ description: 'Operador de comparação',
1031
+ },
1032
+ {
1033
+ displayName: 'Valor',
1034
+ name: 'value',
1035
+ type: 'string',
1036
+ default: '',
1037
+ description: 'Valor para comparar',
1038
+ },
1039
+ ],
1040
+ },
1041
+ ],
1042
+ },
1043
+ {
1044
+ displayName: 'Filtros',
1045
+ name: 'filters',
1046
+ type: 'fixedCollection',
1047
+ typeOptions: { multipleValues: true },
1048
+ placeholder: 'Adicionar filtro',
1049
+ default: {},
1050
+ displayOptions: {
1051
+ show: {
1052
+ resource: ['agenda'],
1053
+ operation: ['getAll'],
1054
+ },
1055
+ },
1056
+ options: [
1057
+ {
1058
+ name: 'filter',
1059
+ displayName: 'Condição',
1060
+ values: [
1061
+ {
1062
+ displayName: 'Campo Name or ID',
1063
+ name: 'field',
1064
+ type: 'options',
1065
+ typeOptions: { loadOptionsMethod: 'getAgendaFields' },
1066
+ default: '',
1067
+ description: 'Campo para filtrar. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
1068
+ },
1069
+ {
1070
+ displayName: 'Operador',
1071
+ name: 'operator',
1072
+ type: 'options',
1073
+ options: [
1074
+ { name: 'Começa Com', value: 'starts_with' },
1075
+ { name: 'Contém', value: 'contains' },
1076
+ { name: 'Diferente', value: 'neq' },
1077
+ { name: 'Igual', value: 'eq' },
1078
+ { name: 'Maior Ou Igual', value: 'gte' },
1079
+ { name: 'Maior Que', value: 'gt' },
1080
+ { name: 'Menor Ou Igual', value: 'lte' },
1081
+ { name: 'Menor Que', value: 'lt' },
1082
+ { name: 'Não Contém', value: 'not_contains' },
1083
+ { name: 'Termina Com', value: 'ends_with' },
1084
+ ],
1085
+ default: 'eq',
1086
+ description: 'Operador de comparação',
1087
+ },
1088
+ {
1089
+ displayName: 'Valor',
1090
+ name: 'value',
1091
+ type: 'string',
1092
+ default: '',
1093
+ description: 'Valor para comparar',
1094
+ },
1095
+ ],
1096
+ },
1097
+ ],
1098
+ },
1099
+ {
1100
+ displayName: 'Filtros',
1101
+ name: 'filters',
1102
+ type: 'fixedCollection',
1103
+ typeOptions: { multipleValues: true },
1104
+ placeholder: 'Adicionar filtro',
1105
+ default: {},
1106
+ displayOptions: {
1107
+ show: {
1108
+ resource: ['evento'],
1109
+ operation: ['getAll'],
1110
+ },
1111
+ },
1112
+ options: [
1113
+ {
1114
+ name: 'filter',
1115
+ displayName: 'Condição',
1116
+ values: [
1117
+ {
1118
+ displayName: 'Campo Name or ID',
1119
+ name: 'field',
1120
+ type: 'options',
1121
+ typeOptions: { loadOptionsMethod: 'getEventFields' },
1122
+ default: '',
1123
+ description: 'Campo para filtrar. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
1124
+ },
1125
+ {
1126
+ displayName: 'Operador',
1127
+ name: 'operator',
1128
+ type: 'options',
1129
+ options: [
1130
+ { name: 'Começa Com', value: 'starts_with' },
1131
+ { name: 'Contém', value: 'contains' },
1132
+ { name: 'Diferente', value: 'neq' },
1133
+ { name: 'Igual', value: 'eq' },
1134
+ { name: 'Maior Ou Igual', value: 'gte' },
1135
+ { name: 'Maior Que', value: 'gt' },
1136
+ { name: 'Menor Ou Igual', value: 'lte' },
1137
+ { name: 'Menor Que', value: 'lt' },
1138
+ { name: 'Não Contém', value: 'not_contains' },
1139
+ { name: 'Termina Com', value: 'ends_with' },
1140
+ ],
1141
+ default: 'eq',
1142
+ description: 'Operador de comparação',
1143
+ },
1144
+ {
1145
+ displayName: 'Valor',
1146
+ name: 'value',
1147
+ type: 'string',
1148
+ default: '',
1149
+ description: 'Valor para comparar',
1150
+ },
1151
+ ],
1152
+ },
1153
+ ],
1154
+ },
1155
+ {
1156
+ displayName: 'Filtros',
1157
+ name: 'filters',
1158
+ type: 'fixedCollection',
1159
+ typeOptions: { multipleValues: true },
1160
+ placeholder: 'Adicionar filtro',
1161
+ default: {},
1162
+ displayOptions: {
1163
+ show: {
1164
+ resource: ['integracao'],
1165
+ operation: ['getAll'],
1166
+ },
1167
+ },
1168
+ options: [
1169
+ {
1170
+ name: 'filter',
1171
+ displayName: 'Condição',
1172
+ values: [
1173
+ {
1174
+ displayName: 'Campo Name or ID',
1175
+ name: 'field',
1176
+ type: 'options',
1177
+ typeOptions: { loadOptionsMethod: 'getIntegrationFields' },
1178
+ default: '',
1179
+ description: 'Campo para filtrar. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
1180
+ },
1181
+ {
1182
+ displayName: 'Operador',
1183
+ name: 'operator',
1184
+ type: 'options',
1185
+ options: [
1186
+ { name: 'Começa Com', value: 'starts_with' },
1187
+ { name: 'Contém', value: 'contains' },
1188
+ { name: 'Diferente', value: 'neq' },
1189
+ { name: 'Igual', value: 'eq' },
1190
+ { name: 'Maior Ou Igual', value: 'gte' },
1191
+ { name: 'Maior Que', value: 'gt' },
1192
+ { name: 'Menor Ou Igual', value: 'lte' },
1193
+ { name: 'Menor Que', value: 'lt' },
1194
+ { name: 'Não Contém', value: 'not_contains' },
1195
+ { name: 'Termina Com', value: 'ends_with' },
1196
+ ],
1197
+ default: 'eq',
1198
+ description: 'Operador de comparação',
1199
+ },
1200
+ {
1201
+ displayName: 'Valor',
1202
+ name: 'value',
1203
+ type: 'string',
1204
+ default: '',
1205
+ description: 'Valor para comparar',
1206
+ },
1207
+ ],
1208
+ },
1209
+ ],
1210
+ },
1211
+ {
1212
+ displayName: 'Filtros',
1213
+ name: 'filters',
1214
+ type: 'fixedCollection',
1215
+ typeOptions: { multipleValues: true },
1216
+ placeholder: 'Adicionar filtro',
1217
+ default: {},
1218
+ displayOptions: {
1219
+ show: {
1220
+ resource: ['usuario'],
1221
+ operation: ['getAll'],
1222
+ },
1223
+ },
1224
+ options: [
1225
+ {
1226
+ name: 'filter',
1227
+ displayName: 'Condição',
1228
+ values: [
1229
+ {
1230
+ displayName: 'Campo Name or ID',
1231
+ name: 'field',
1232
+ type: 'options',
1233
+ typeOptions: { loadOptionsMethod: 'getUserFields' },
1234
+ default: '',
1235
+ description: 'Campo para filtrar. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
1236
+ },
1237
+ {
1238
+ displayName: 'Operador',
1239
+ name: 'operator',
1240
+ type: 'options',
1241
+ options: [
1242
+ { name: 'Começa Com', value: 'starts_with' },
1243
+ { name: 'Contém', value: 'contains' },
1244
+ { name: 'Diferente', value: 'neq' },
1245
+ { name: 'Igual', value: 'eq' },
1246
+ { name: 'Maior Ou Igual', value: 'gte' },
1247
+ { name: 'Maior Que', value: 'gt' },
1248
+ { name: 'Menor Ou Igual', value: 'lte' },
1249
+ { name: 'Menor Que', value: 'lt' },
1250
+ { name: 'Não Contém', value: 'not_contains' },
1251
+ { name: 'Termina Com', value: 'ends_with' },
1252
+ ],
1253
+ default: 'eq',
1254
+ description: 'Operador de comparação',
1255
+ },
1256
+ {
1257
+ displayName: 'Valor',
1258
+ name: 'value',
1259
+ type: 'string',
1260
+ default: '',
1261
+ description: 'Valor para comparar',
1262
+ },
1263
+ ],
1264
+ },
1265
+ ],
1266
+ },
298
1267
  createCreateFieldsProperty('lead'),
299
1268
  createCreateFieldsProperty('property'),
300
1269
  createCreateFieldsProperty('contact'),
@@ -304,6 +1273,7 @@ class Imobzi {
304
1273
  createCreateFieldsProperty('documento'),
305
1274
  createCreateFieldsProperty('tarefa'),
306
1275
  createCreateFieldsProperty('agenda'),
1276
+ createCreateFieldsProperty('evento'),
307
1277
  createCreateFieldsProperty('integracao'),
308
1278
  createCreateFieldsProperty('usuario'),
309
1279
  createUpdateFieldsProperty('lead'),
@@ -315,6 +1285,7 @@ class Imobzi {
315
1285
  createUpdateFieldsProperty('documento'),
316
1286
  createUpdateFieldsProperty('tarefa'),
317
1287
  createUpdateFieldsProperty('agenda'),
1288
+ createUpdateFieldsProperty('evento'),
318
1289
  createUpdateFieldsProperty('integracao'),
319
1290
  createUpdateFieldsProperty('usuario'),
320
1291
  {
@@ -368,7 +1339,7 @@ class Imobzi {
368
1339
  if (filters && filters.filter && Array.isArray(filters.filter)) {
369
1340
  filters.filter.forEach((filter) => {
370
1341
  if (filter.field && filter.operator && filter.value !== undefined) {
371
- const filterKey = `${filter.field}_${filter.operator}`;
1342
+ const filterKey = `${filter.field}__${filter.operator}`;
372
1343
  query[filterKey] = filter.value;
373
1344
  }
374
1345
  });