n8n-nodes-linq 0.1.8 → 0.1.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.
- package/dist/nodes/Linq/Linq.node.js +86 -27
- package/package.json +1 -1
|
@@ -215,10 +215,18 @@ class Linq {
|
|
|
215
215
|
displayName: 'Phone Number',
|
|
216
216
|
name: 'phoneNumber',
|
|
217
217
|
type: 'string',
|
|
218
|
-
displayOptions: { show: { resource: ['chat'], operation: ['getAll'
|
|
218
|
+
displayOptions: { show: { resource: ['chat'], operation: ['getAll'] } },
|
|
219
219
|
default: '',
|
|
220
220
|
description: 'Filter chats by phone number',
|
|
221
221
|
},
|
|
222
|
+
{
|
|
223
|
+
displayName: 'Phone Numbers',
|
|
224
|
+
name: 'phoneNumbers',
|
|
225
|
+
type: 'string',
|
|
226
|
+
displayOptions: { show: { resource: ['chat'], operation: ['find'] } },
|
|
227
|
+
default: '',
|
|
228
|
+
description: 'Comma-separated list of phone numbers to find chat between them',
|
|
229
|
+
},
|
|
222
230
|
{
|
|
223
231
|
displayName: 'Page',
|
|
224
232
|
name: 'page',
|
|
@@ -443,7 +451,10 @@ class Linq {
|
|
|
443
451
|
method: 'GET',
|
|
444
452
|
url: 'https://api.linqapp.com/api/partner/v2/chats',
|
|
445
453
|
qs,
|
|
446
|
-
headers: {
|
|
454
|
+
headers: {
|
|
455
|
+
'X-LINQ-INTEGRATION-TOKEN': credentials.integrationToken,
|
|
456
|
+
'Accept': 'application/json'
|
|
457
|
+
},
|
|
447
458
|
json: true,
|
|
448
459
|
});
|
|
449
460
|
}
|
|
@@ -452,20 +463,28 @@ class Linq {
|
|
|
452
463
|
responseData = await this.helpers.request({
|
|
453
464
|
method: 'GET',
|
|
454
465
|
url: `https://api.linqapp.com/api/partner/v2/chats/${chatId}`,
|
|
455
|
-
headers: {
|
|
466
|
+
headers: {
|
|
467
|
+
'X-LINQ-INTEGRATION-TOKEN': credentials.integrationToken,
|
|
468
|
+
'Accept': 'application/json'
|
|
469
|
+
},
|
|
456
470
|
json: true,
|
|
457
471
|
});
|
|
458
472
|
}
|
|
459
473
|
if (operation === 'find') {
|
|
460
|
-
const
|
|
474
|
+
const phoneNumbers = this.getNodeParameter('phoneNumbers', i, '');
|
|
461
475
|
const qs = {};
|
|
462
|
-
if (
|
|
463
|
-
|
|
476
|
+
if (phoneNumbers) {
|
|
477
|
+
// Convert comma-separated string to array for phone_numbers[] parameter
|
|
478
|
+
qs['phone_numbers[]'] = phoneNumbers.split(',').map(p => p.trim());
|
|
479
|
+
}
|
|
464
480
|
responseData = await this.helpers.request({
|
|
465
481
|
method: 'GET',
|
|
466
482
|
url: 'https://api.linqapp.com/api/partner/v2/chats/find',
|
|
467
483
|
qs,
|
|
468
|
-
headers: {
|
|
484
|
+
headers: {
|
|
485
|
+
'X-LINQ-INTEGRATION-TOKEN': credentials.integrationToken,
|
|
486
|
+
'Accept': 'application/json'
|
|
487
|
+
},
|
|
469
488
|
json: true,
|
|
470
489
|
});
|
|
471
490
|
}
|
|
@@ -493,7 +512,8 @@ class Linq {
|
|
|
493
512
|
url: 'https://api.linqapp.com/api/partner/v2/chats',
|
|
494
513
|
headers: {
|
|
495
514
|
'X-LINQ-INTEGRATION-TOKEN': credentials.integrationToken,
|
|
496
|
-
'Content-Type': 'application/json'
|
|
515
|
+
'Content-Type': 'application/json',
|
|
516
|
+
'Accept': 'application/pdf'
|
|
497
517
|
},
|
|
498
518
|
body: body,
|
|
499
519
|
json: true,
|
|
@@ -505,7 +525,8 @@ class Linq {
|
|
|
505
525
|
url: 'https://api.linqapp.com/api/partner/v2/chats/share-contact',
|
|
506
526
|
headers: {
|
|
507
527
|
'X-LINQ-INTEGRATION-TOKEN': credentials.integrationToken,
|
|
508
|
-
'Content-Type': 'application/json'
|
|
528
|
+
'Content-Type': 'application/json',
|
|
529
|
+
'Accept': 'application/pdf'
|
|
509
530
|
},
|
|
510
531
|
json: true,
|
|
511
532
|
});
|
|
@@ -519,7 +540,10 @@ class Linq {
|
|
|
519
540
|
method: 'GET',
|
|
520
541
|
url: `https://api.linqapp.com/api/partner/v2/chat_messages`,
|
|
521
542
|
qs: { chat_id: chatId },
|
|
522
|
-
headers: {
|
|
543
|
+
headers: {
|
|
544
|
+
'X-LINQ-INTEGRATION-TOKEN': credentials.integrationToken,
|
|
545
|
+
'Accept': 'application/json'
|
|
546
|
+
},
|
|
523
547
|
json: true,
|
|
524
548
|
});
|
|
525
549
|
}
|
|
@@ -528,7 +552,10 @@ class Linq {
|
|
|
528
552
|
responseData = await this.helpers.request({
|
|
529
553
|
method: 'GET',
|
|
530
554
|
url: `https://api.linqapp.com/api/partner/v2/chat_messages/${chatMessageId}`,
|
|
531
|
-
headers: {
|
|
555
|
+
headers: {
|
|
556
|
+
'X-LINQ-INTEGRATION-TOKEN': credentials.integrationToken,
|
|
557
|
+
'Accept': 'application/json'
|
|
558
|
+
},
|
|
532
559
|
json: true,
|
|
533
560
|
});
|
|
534
561
|
}
|
|
@@ -544,7 +571,8 @@ class Linq {
|
|
|
544
571
|
url: 'https://api.linqapp.com/api/partner/v2/chat_messages',
|
|
545
572
|
headers: {
|
|
546
573
|
'X-LINQ-INTEGRATION-TOKEN': credentials.integrationToken,
|
|
547
|
-
'Content-Type': 'application/json'
|
|
574
|
+
'Content-Type': 'application/json',
|
|
575
|
+
'Accept': 'application/pdf'
|
|
548
576
|
},
|
|
549
577
|
body: body,
|
|
550
578
|
json: true,
|
|
@@ -555,7 +583,10 @@ class Linq {
|
|
|
555
583
|
responseData = await this.helpers.request({
|
|
556
584
|
method: 'DELETE',
|
|
557
585
|
url: `https://api.linqapp.com/api/partner/v2/chat_messages/${chatMessageId}`,
|
|
558
|
-
headers: {
|
|
586
|
+
headers: {
|
|
587
|
+
'X-LINQ-INTEGRATION-TOKEN': credentials.integrationToken,
|
|
588
|
+
'Accept': 'application/json'
|
|
589
|
+
},
|
|
559
590
|
json: true,
|
|
560
591
|
});
|
|
561
592
|
}
|
|
@@ -570,7 +601,8 @@ class Linq {
|
|
|
570
601
|
url: `https://api.linqapp.com/api/partner/v2/chat_messages/${chatMessageId}/edit`,
|
|
571
602
|
headers: {
|
|
572
603
|
'X-LINQ-INTEGRATION-TOKEN': credentials.integrationToken,
|
|
573
|
-
'Content-Type': 'application/json'
|
|
604
|
+
'Content-Type': 'application/json',
|
|
605
|
+
'Accept': 'application/pdf'
|
|
574
606
|
},
|
|
575
607
|
body: body,
|
|
576
608
|
json: true,
|
|
@@ -587,7 +619,8 @@ class Linq {
|
|
|
587
619
|
url: `https://api.linqapp.com/api/partner/v2/chat_messages/${chatMessageId}/react`,
|
|
588
620
|
headers: {
|
|
589
621
|
'X-LINQ-INTEGRATION-TOKEN': credentials.integrationToken,
|
|
590
|
-
'Content-Type': 'application/json'
|
|
622
|
+
'Content-Type': 'application/json',
|
|
623
|
+
'Accept': 'application/pdf'
|
|
591
624
|
},
|
|
592
625
|
body: body,
|
|
593
626
|
json: true,
|
|
@@ -598,7 +631,10 @@ class Linq {
|
|
|
598
631
|
responseData = await this.helpers.request({
|
|
599
632
|
method: 'GET',
|
|
600
633
|
url: `https://api.linqapp.com/api/partner/v2/chat_messages/${chatMessageId}/reaction`,
|
|
601
|
-
headers: {
|
|
634
|
+
headers: {
|
|
635
|
+
'X-LINQ-INTEGRATION-TOKEN': credentials.integrationToken,
|
|
636
|
+
'Accept': 'application/json'
|
|
637
|
+
},
|
|
602
638
|
json: true,
|
|
603
639
|
});
|
|
604
640
|
}
|
|
@@ -609,7 +645,10 @@ class Linq {
|
|
|
609
645
|
responseData = await this.helpers.request({
|
|
610
646
|
method: 'GET',
|
|
611
647
|
url: 'https://api.linqapp.com/api/partner/v2/phone_numbers',
|
|
612
|
-
headers: {
|
|
648
|
+
headers: {
|
|
649
|
+
'X-LINQ-INTEGRATION-TOKEN': credentials.integrationToken,
|
|
650
|
+
'Accept': 'application/json'
|
|
651
|
+
},
|
|
613
652
|
json: true,
|
|
614
653
|
});
|
|
615
654
|
}
|
|
@@ -623,7 +662,8 @@ class Linq {
|
|
|
623
662
|
url: 'https://api.linqapp.com/api/partner/v2/i_message_availability/check',
|
|
624
663
|
headers: {
|
|
625
664
|
'X-LINQ-INTEGRATION-TOKEN': credentials.integrationToken,
|
|
626
|
-
'Content-Type': 'application/json'
|
|
665
|
+
'Content-Type': 'application/json',
|
|
666
|
+
'Accept': 'application/pdf'
|
|
627
667
|
},
|
|
628
668
|
body: body,
|
|
629
669
|
json: true,
|
|
@@ -636,7 +676,10 @@ class Linq {
|
|
|
636
676
|
responseData = await this.helpers.request({
|
|
637
677
|
method: 'GET',
|
|
638
678
|
url: 'https://api.linqapp.com/api/partner/v2/webhook_subscriptions',
|
|
639
|
-
headers: {
|
|
679
|
+
headers: {
|
|
680
|
+
'X-LINQ-INTEGRATION-TOKEN': credentials.integrationToken,
|
|
681
|
+
'Accept': 'application/json'
|
|
682
|
+
},
|
|
640
683
|
json: true,
|
|
641
684
|
});
|
|
642
685
|
}
|
|
@@ -645,7 +688,10 @@ class Linq {
|
|
|
645
688
|
responseData = await this.helpers.request({
|
|
646
689
|
method: 'GET',
|
|
647
690
|
url: `https://api.linqapp.com/api/partner/v2/webhook_subscriptions/${webhookSubscriptionId}`,
|
|
648
|
-
headers: {
|
|
691
|
+
headers: {
|
|
692
|
+
'X-LINQ-INTEGRATION-TOKEN': credentials.integrationToken,
|
|
693
|
+
'Accept': 'application/json'
|
|
694
|
+
},
|
|
649
695
|
json: true,
|
|
650
696
|
});
|
|
651
697
|
}
|
|
@@ -667,7 +713,8 @@ class Linq {
|
|
|
667
713
|
url: 'https://api.linqapp.com/api/partner/v2/webhook_subscriptions',
|
|
668
714
|
headers: {
|
|
669
715
|
'X-LINQ-INTEGRATION-TOKEN': credentials.integrationToken,
|
|
670
|
-
'Content-Type': 'application/json'
|
|
716
|
+
'Content-Type': 'application/json',
|
|
717
|
+
'Accept': 'application/pdf'
|
|
671
718
|
},
|
|
672
719
|
body: body,
|
|
673
720
|
json: true,
|
|
@@ -694,7 +741,8 @@ class Linq {
|
|
|
694
741
|
url: `https://api.linqapp.com/api/partner/v2/webhook_subscriptions/${webhookSubscriptionId}`,
|
|
695
742
|
headers: {
|
|
696
743
|
'X-LINQ-INTEGRATION-TOKEN': credentials.integrationToken,
|
|
697
|
-
'Content-Type': 'application/json'
|
|
744
|
+
'Content-Type': 'application/json',
|
|
745
|
+
'Accept': 'application/pdf'
|
|
698
746
|
},
|
|
699
747
|
body: body,
|
|
700
748
|
json: true,
|
|
@@ -705,7 +753,10 @@ class Linq {
|
|
|
705
753
|
responseData = await this.helpers.request({
|
|
706
754
|
method: 'DELETE',
|
|
707
755
|
url: `https://api.linqapp.com/api/partner/v2/webhook_subscriptions/${webhookSubscriptionId}`,
|
|
708
|
-
headers: {
|
|
756
|
+
headers: {
|
|
757
|
+
'X-LINQ-INTEGRATION-TOKEN': credentials.integrationToken,
|
|
758
|
+
'Accept': 'application/json'
|
|
759
|
+
},
|
|
709
760
|
json: true,
|
|
710
761
|
});
|
|
711
762
|
}
|
|
@@ -742,7 +793,8 @@ class Linq {
|
|
|
742
793
|
url: 'https://api.linqapp.com/api/partner/v2/contacts',
|
|
743
794
|
headers: {
|
|
744
795
|
'X-LINQ-INTEGRATION-TOKEN': credentials.integrationToken,
|
|
745
|
-
'Content-Type': 'application/json'
|
|
796
|
+
'Content-Type': 'application/json',
|
|
797
|
+
'Accept': 'application/pdf'
|
|
746
798
|
},
|
|
747
799
|
body: body,
|
|
748
800
|
json: true,
|
|
@@ -753,7 +805,10 @@ class Linq {
|
|
|
753
805
|
responseData = await this.helpers.request({
|
|
754
806
|
method: 'GET',
|
|
755
807
|
url: `https://api.linqapp.com/api/partner/v2/contacts/${contactId}`,
|
|
756
|
-
headers: {
|
|
808
|
+
headers: {
|
|
809
|
+
'X-LINQ-INTEGRATION-TOKEN': credentials.integrationToken,
|
|
810
|
+
'Accept': 'application/json'
|
|
811
|
+
},
|
|
757
812
|
json: true,
|
|
758
813
|
});
|
|
759
814
|
}
|
|
@@ -788,7 +843,8 @@ class Linq {
|
|
|
788
843
|
url: `https://api.linqapp.com/api/partner/v2/contacts/${contactId}`,
|
|
789
844
|
headers: {
|
|
790
845
|
'X-LINQ-INTEGRATION-TOKEN': credentials.integrationToken,
|
|
791
|
-
'Content-Type': 'application/json'
|
|
846
|
+
'Content-Type': 'application/json',
|
|
847
|
+
'Accept': 'application/json'
|
|
792
848
|
},
|
|
793
849
|
body: body,
|
|
794
850
|
json: true,
|
|
@@ -799,7 +855,10 @@ class Linq {
|
|
|
799
855
|
responseData = await this.helpers.request({
|
|
800
856
|
method: 'DELETE',
|
|
801
857
|
url: `https://api.linqapp.com/api/partner/v2/contacts/${contactId}`,
|
|
802
|
-
headers: {
|
|
858
|
+
headers: {
|
|
859
|
+
'X-LINQ-INTEGRATION-TOKEN': credentials.integrationToken,
|
|
860
|
+
'Accept': 'application/json'
|
|
861
|
+
},
|
|
803
862
|
json: true,
|
|
804
863
|
});
|
|
805
864
|
}
|