@kichat/n8n-nodes-kirimchat 1.2.2 → 1.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/README.md +8 -17
- package/dist/nodes/KirimChat/KirimChat.node.js +9 -67
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -65,32 +65,23 @@ Send a message to a customer via WhatsApp, Instagram, or Messenger.
|
|
|
65
65
|
|
|
66
66
|
#### WhatsApp Template Messages
|
|
67
67
|
|
|
68
|
-
Templates can be selected from a dropdown
|
|
68
|
+
Templates can be selected from a dropdown or entered manually.
|
|
69
69
|
|
|
70
|
-
**Dropdown Mode (Recommended):**
|
|
71
70
|
| Parameter | Description |
|
|
72
71
|
|-----------|-------------|
|
|
73
72
|
| Template | Select from approved templates. Shows variable count e.g. `[2 var]` |
|
|
74
|
-
|
|
|
75
|
-
|
|
76
|
-
**Manual Mode:**
|
|
77
|
-
| Parameter | Description |
|
|
78
|
-
|-----------|-------------|
|
|
79
|
-
| Enter Template Manually | Enable this toggle |
|
|
80
|
-
| Template Name | Name of the approved template |
|
|
81
|
-
| Template Language | Language code (e.g., `en`, `id`) |
|
|
82
|
-
| Variable 1-5 | Values for {{1}}, {{2}}, etc. |
|
|
83
|
-
| Template Components (JSON) | Advanced: For header media, buttons |
|
|
73
|
+
| Template Variables | Comma-separated values. Example: `John, ORD-123` |
|
|
74
|
+
| Enter Template Manually | Toggle to type template name/language |
|
|
84
75
|
|
|
85
76
|
**Example:**
|
|
86
77
|
|
|
87
|
-
|
|
78
|
+
Template: `Hello {{1}}, your order {{2}} is ready!`
|
|
79
|
+
|
|
80
|
+
Template Variables: `John, ORD-123`
|
|
88
81
|
|
|
89
|
-
|
|
90
|
-
- Variable 1: `John` → replaces {{1}}
|
|
91
|
-
- Variable 2: `ORD-123` → replaces {{2}}
|
|
82
|
+
Result: "Hello John, your order ORD-123 is ready!"
|
|
92
83
|
|
|
93
|
-
**Advanced
|
|
84
|
+
**Advanced (Manual Mode with JSON):**
|
|
94
85
|
```json
|
|
95
86
|
[
|
|
96
87
|
{
|
|
@@ -449,8 +449,8 @@ class KirimChat {
|
|
|
449
449
|
placeholder: 'en',
|
|
450
450
|
},
|
|
451
451
|
{
|
|
452
|
-
displayName: '
|
|
453
|
-
name: '
|
|
452
|
+
displayName: 'Template Variables',
|
|
453
|
+
name: 'templateVariables',
|
|
454
454
|
type: 'string',
|
|
455
455
|
displayOptions: {
|
|
456
456
|
show: {
|
|
@@ -459,59 +459,8 @@ class KirimChat {
|
|
|
459
459
|
},
|
|
460
460
|
},
|
|
461
461
|
default: '',
|
|
462
|
-
description: '
|
|
463
|
-
|
|
464
|
-
{
|
|
465
|
-
displayName: 'Variable 2',
|
|
466
|
-
name: 'templateVar2',
|
|
467
|
-
type: 'string',
|
|
468
|
-
displayOptions: {
|
|
469
|
-
show: {
|
|
470
|
-
operation: ['sendMessage'],
|
|
471
|
-
messageType: ['template'],
|
|
472
|
-
},
|
|
473
|
-
},
|
|
474
|
-
default: '',
|
|
475
|
-
description: 'Value for {{2}} in template (optional)',
|
|
476
|
-
},
|
|
477
|
-
{
|
|
478
|
-
displayName: 'Variable 3',
|
|
479
|
-
name: 'templateVar3',
|
|
480
|
-
type: 'string',
|
|
481
|
-
displayOptions: {
|
|
482
|
-
show: {
|
|
483
|
-
operation: ['sendMessage'],
|
|
484
|
-
messageType: ['template'],
|
|
485
|
-
},
|
|
486
|
-
},
|
|
487
|
-
default: '',
|
|
488
|
-
description: 'Value for {{3}} in template (optional)',
|
|
489
|
-
},
|
|
490
|
-
{
|
|
491
|
-
displayName: 'Variable 4',
|
|
492
|
-
name: 'templateVar4',
|
|
493
|
-
type: 'string',
|
|
494
|
-
displayOptions: {
|
|
495
|
-
show: {
|
|
496
|
-
operation: ['sendMessage'],
|
|
497
|
-
messageType: ['template'],
|
|
498
|
-
},
|
|
499
|
-
},
|
|
500
|
-
default: '',
|
|
501
|
-
description: 'Value for {{4}} in template (optional)',
|
|
502
|
-
},
|
|
503
|
-
{
|
|
504
|
-
displayName: 'Variable 5',
|
|
505
|
-
name: 'templateVar5',
|
|
506
|
-
type: 'string',
|
|
507
|
-
displayOptions: {
|
|
508
|
-
show: {
|
|
509
|
-
operation: ['sendMessage'],
|
|
510
|
-
messageType: ['template'],
|
|
511
|
-
},
|
|
512
|
-
},
|
|
513
|
-
default: '',
|
|
514
|
-
description: 'Value for {{5}} in template (optional)',
|
|
462
|
+
description: 'Comma-separated values for template variables. Example: "John, ORD-123" replaces {{1}} with John and {{2}} with ORD-123. Leave empty if template has no variables.',
|
|
463
|
+
placeholder: 'value1, value2, value3',
|
|
515
464
|
},
|
|
516
465
|
{
|
|
517
466
|
displayName: 'Advanced: Template Components (JSON)',
|
|
@@ -1002,18 +951,11 @@ class KirimChat {
|
|
|
1002
951
|
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Invalid template selection. Please re-select the template.', { itemIndex: i });
|
|
1003
952
|
}
|
|
1004
953
|
}
|
|
1005
|
-
// Handle
|
|
1006
|
-
const
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
templateVariables.push(varValue);
|
|
1011
|
-
}
|
|
1012
|
-
else {
|
|
1013
|
-
// Stop at first empty variable
|
|
1014
|
-
break;
|
|
1015
|
-
}
|
|
1016
|
-
}
|
|
954
|
+
// Handle comma-separated variables
|
|
955
|
+
const templateVariablesStr = this.getNodeParameter('templateVariables', i, '');
|
|
956
|
+
const templateVariables = templateVariablesStr
|
|
957
|
+
? templateVariablesStr.split(',').map((v) => v.trim()).filter((v) => v.length > 0)
|
|
958
|
+
: [];
|
|
1017
959
|
if (templateVariables.length > 0) {
|
|
1018
960
|
// Build body component with parameters
|
|
1019
961
|
const bodyParameters = templateVariables.map((v) => ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kichat/n8n-nodes-kirimchat",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "n8n community node for KirimChat - Send WhatsApp, Instagram & Messenger messages with interactive buttons, flexible customer lookup, and typing indicators",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"n8n-community-node-package",
|