n8n-nodes-sendzen 1.0.0
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/LICENSE.md +21 -0
- package/README.md +359 -0
- package/dist/credentials/SendZenApi.credentials.d.ts +8 -0
- package/dist/credentials/SendZenApi.credentials.js +36 -0
- package/dist/credentials/SendZenApi.credentials.js.map +1 -0
- package/dist/nodes/SendZen/SendZen.node.d.ts +14 -0
- package/dist/nodes/SendZen/SendZen.node.js +610 -0
- package/dist/nodes/SendZen/SendZen.node.js.map +1 -0
- package/dist/nodes/SendZen/SendZen.node.json +20 -0
- package/dist/nodes/SendZen/SendZenTrigger.node.d.ts +5 -0
- package/dist/nodes/SendZen/SendZenTrigger.node.js +49 -0
- package/dist/nodes/SendZen/SendZenTrigger.node.js.map +1 -0
- package/dist/nodes/SendZen/sendzen.svg +1 -0
- package/dist/package.json +76 -0
- package/dist/shared/constants.d.ts +1 -0
- package/dist/shared/constants.js +5 -0
- package/dist/shared/constants.js.map +1 -0
- package/dist/shared/nodeProperties.d.ts +10 -0
- package/dist/shared/nodeProperties.js +187 -0
- package/dist/shared/nodeProperties.js.map +1 -0
- package/dist/shared/template/template.api.types.d.ts +328 -0
- package/dist/shared/template/template.api.types.js +3 -0
- package/dist/shared/template/template.api.types.js.map +1 -0
- package/dist/shared/template/template.builder.d.ts +17 -0
- package/dist/shared/template/template.builder.js +200 -0
- package/dist/shared/template/template.builder.js.map +1 -0
- package/dist/shared/type.d.ts +38 -0
- package/dist/shared/type.js +3 -0
- package/dist/shared/type.js.map +1 -0
- package/dist/shared/utils.d.ts +2 -0
- package/dist/shared/utils.js +15 -0
- package/dist/shared/utils.js.map +1 -0
- package/index.js +10 -0
- package/jest.config.js +22 -0
- package/n8n-nodes-sendzen-1.0.0.tgz +0 -0
- package/nodes/SendZen/SendZen.node.json +20 -0
- package/nodes/SendZen/sendzen.svg +1 -0
- package/package.json +76 -0
- package/shared/constants.ts +1 -0
- package/shared/nodeProperties.ts +197 -0
- package/shared/template/template.api.types.ts +435 -0
- package/shared/template/template.builder.ts +223 -0
- package/shared/type.ts +40 -0
- package/shared/utils.ts +16 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"node": "n8n-nodes-base.SendZen",
|
|
3
|
+
"nodeVersion": "1.0",
|
|
4
|
+
"codexVersion": "1.0",
|
|
5
|
+
"categories": [
|
|
6
|
+
"Miscellaneous"
|
|
7
|
+
],
|
|
8
|
+
"resources": {
|
|
9
|
+
"credentialDocumentation": [
|
|
10
|
+
{
|
|
11
|
+
"url": "https://sendzen.io/docs"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"primaryDocumentation": [
|
|
15
|
+
{
|
|
16
|
+
"url": "https://sendzen.io/docs"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="#10b981" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-zap-icon lucide-zap"><path d="M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"/></svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "n8n-nodes-sendzen",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "SendZen is a platform for automating SMS and WhatsApp messages. This node package allows you to use SendZen in n8n.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"n8n-community-node-package",
|
|
8
|
+
"sendzen",
|
|
9
|
+
"automation",
|
|
10
|
+
"WhatsApp",
|
|
11
|
+
"WhatsApp API",
|
|
12
|
+
"WhatsApp Cloud API",
|
|
13
|
+
"WhatsApp Cloud API Integration",
|
|
14
|
+
"WhatsApp Cloud API Integration for n8n",
|
|
15
|
+
"WhatsApp Cloud API Integration for n8n workflows",
|
|
16
|
+
"WhatsApp Business API",
|
|
17
|
+
"WhatsApp Business API Integration",
|
|
18
|
+
"WhatsApp Business API Integration for n8n",
|
|
19
|
+
"WhatsApp Business API Integration for n8n workflows",
|
|
20
|
+
"WhatsApp Business API for n8n",
|
|
21
|
+
"WhatsApp Business API for n8n workflows",
|
|
22
|
+
"WhastApp Messaging API",
|
|
23
|
+
"WhastApp Messaging API Integration",
|
|
24
|
+
"WhastApp Messaging API Integration for n8n",
|
|
25
|
+
"WhastApp Messaging API Integration for n8n workflows",
|
|
26
|
+
"WhastApp Messaging API for n8n",
|
|
27
|
+
"WhastApp Messaging API for n8n workflows"
|
|
28
|
+
],
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"homepage": "https://www.sendzen.io/",
|
|
31
|
+
"author": {
|
|
32
|
+
"name": "SendZen",
|
|
33
|
+
"email": "milan@sendzen.io"
|
|
34
|
+
},
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "git+https://github.com/sendzen-io/n8n-nodes-sendzen.git"
|
|
38
|
+
},
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=18.10"
|
|
41
|
+
},
|
|
42
|
+
"packageManager": "pnpm@10.15.0",
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "tsc && gulp build:icons",
|
|
45
|
+
"dev": "nodemon -w nodes -w credentials --ext ts --exec \"tsc && n8n\"",
|
|
46
|
+
"format": "prettier nodes credentials --write",
|
|
47
|
+
"lint": "eslint nodes credentials package.json",
|
|
48
|
+
"test": "jest"
|
|
49
|
+
},
|
|
50
|
+
"n8n": {
|
|
51
|
+
"n8nNodesApiVersion": 1,
|
|
52
|
+
"credentials": [
|
|
53
|
+
"dist/credentials/SendZenApi.credentials.js"
|
|
54
|
+
],
|
|
55
|
+
"nodes": [
|
|
56
|
+
"dist/nodes/SendZen/SendZen.node.js",
|
|
57
|
+
"dist/nodes/SendZen/SendZenTrigger.node.js"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@typescript-eslint/parser": "^7.15.0",
|
|
62
|
+
"eslint": "^9.39.0",
|
|
63
|
+
"eslint-plugin-n8n-nodes-base": "^1.16.1",
|
|
64
|
+
"gulp": "^4.0.2",
|
|
65
|
+
"n8n": "^1.89.2",
|
|
66
|
+
"nodemon": "^3.1.10",
|
|
67
|
+
"prettier": "^3.3.2",
|
|
68
|
+
"typescript": "^5.5.3",
|
|
69
|
+
"@types/jest": "^29.5.12",
|
|
70
|
+
"jest": "^29.7.0",
|
|
71
|
+
"ts-jest": "^29.1.2"
|
|
72
|
+
},
|
|
73
|
+
"peerDependencies": {
|
|
74
|
+
"n8n-workflow": "*"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const BASE_DOMAIN = 'https://api.sendzen.io';
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { INodeProperties } from 'n8n-workflow';
|
|
2
|
+
|
|
3
|
+
export const OperationProperties: INodeProperties = {
|
|
4
|
+
displayName: 'Operation',
|
|
5
|
+
name: 'operation',
|
|
6
|
+
type: 'options',
|
|
7
|
+
noDataExpression: true,
|
|
8
|
+
options: [
|
|
9
|
+
{
|
|
10
|
+
name: 'Send Session Message',
|
|
11
|
+
value: 'sendSessionMessage',
|
|
12
|
+
description: 'Send a free-form message within an active 24-hour WhatsApp conversation window',
|
|
13
|
+
action: 'Send session message',
|
|
14
|
+
hint: 'Use this option to reply to a user within an active conversation without using a template.',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'Send Template Message',
|
|
18
|
+
value: 'sendTemplateMessage',
|
|
19
|
+
description: 'Send a pre-approved WhatsApp template message to a recipient',
|
|
20
|
+
action: 'Send template message',
|
|
21
|
+
hint: 'Use this option when replying outside the 24-hour session window or when a template is required by WhatsApp.',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'Mark as Read',
|
|
25
|
+
value: 'markAsRead',
|
|
26
|
+
description:
|
|
27
|
+
'Mark the incoming message as read.',
|
|
28
|
+
action: 'Mark as read',
|
|
29
|
+
hint: 'Use this option to mark the incoming message as read.',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'Show Typing Indicator',
|
|
33
|
+
value: 'showTyping',
|
|
34
|
+
description:
|
|
35
|
+
'Display a typing indicator while the workflow continues.',
|
|
36
|
+
action: 'Show typing indicator',
|
|
37
|
+
hint: 'Use this option to show a typing indicator while the workflow continues.',
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
default: 'sendSessionMessage',
|
|
41
|
+
required: true,
|
|
42
|
+
description: 'Choose how you want to interact with the recipient using SendZen.',
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const WabaAccountProperties: INodeProperties = {
|
|
46
|
+
displayName: 'WABA Account',
|
|
47
|
+
name: 'wabaAccount',
|
|
48
|
+
type: 'options',
|
|
49
|
+
noDataExpression: true,
|
|
50
|
+
hint: 'Select the WhatsApp Business Account that will be used to send messages.',
|
|
51
|
+
default: '',
|
|
52
|
+
required: true,
|
|
53
|
+
description: 'Select the WhatsApp Business Account (WABA)',
|
|
54
|
+
typeOptions: {
|
|
55
|
+
loadOptionsMethod: 'getWabaAccounts',
|
|
56
|
+
},
|
|
57
|
+
displayOptions: {
|
|
58
|
+
show: {
|
|
59
|
+
operation: ['sendSessionMessage', 'sendTemplateMessage'],
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const PhoneNumberIdProperties: INodeProperties = {
|
|
65
|
+
displayName: 'Phone Number ID',
|
|
66
|
+
name: 'phoneNumberId',
|
|
67
|
+
type: 'string',
|
|
68
|
+
hint: 'Enter the Phone Number ID associated with your WhatsApp Business account.',
|
|
69
|
+
default: '',
|
|
70
|
+
required: false,
|
|
71
|
+
description:
|
|
72
|
+
'The Phone Number ID used to mark the message as read and show the typing indicator.. If left empty, the node will try to find it automatically from the incoming data.',
|
|
73
|
+
displayOptions: {
|
|
74
|
+
show: {
|
|
75
|
+
operation: ['markAsRead', 'showTyping'],
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export const MessageIdProperties: INodeProperties = {
|
|
81
|
+
displayName: 'Message ID (Optional)',
|
|
82
|
+
name: 'messageId',
|
|
83
|
+
type: 'string',
|
|
84
|
+
required: false,
|
|
85
|
+
default: '',
|
|
86
|
+
description:
|
|
87
|
+
'Optionally override the message ID. Leave empty to automatically use the incoming message ID from the previous node.',
|
|
88
|
+
hint: 'Only use this if you need to manually specify a message ID. In most cases, this is resolved automatically.',
|
|
89
|
+
displayOptions: {
|
|
90
|
+
show: {
|
|
91
|
+
operation: ['markAsRead', 'showTyping'],
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export const RecipientPhoneNumberProperties: INodeProperties = {
|
|
97
|
+
displayName: 'Recipient Phone Number',
|
|
98
|
+
name: 'recipient',
|
|
99
|
+
type: 'string',
|
|
100
|
+
required: true,
|
|
101
|
+
placeholder: '+1234567890',
|
|
102
|
+
displayOptions: {
|
|
103
|
+
show: {
|
|
104
|
+
operation: ['sendSessionMessage', 'sendTemplateMessage'],
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
default: '',
|
|
108
|
+
description: 'The recipient’s phone number in international (E.164) format.',
|
|
109
|
+
hint: 'Enter the phone number including country code, for example: +1234567890.',
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export const TemplateProperties: INodeProperties = {
|
|
113
|
+
displayName: 'Template',
|
|
114
|
+
name: 'template',
|
|
115
|
+
type: 'options',
|
|
116
|
+
noDataExpression: true,
|
|
117
|
+
typeOptions: {
|
|
118
|
+
loadOptionsMethod: 'getTemplates',
|
|
119
|
+
loadOptionsDependsOn: ['wabaAccount'],
|
|
120
|
+
},
|
|
121
|
+
required: true,
|
|
122
|
+
displayOptions: {
|
|
123
|
+
show: {
|
|
124
|
+
operation: ['sendTemplateMessage'],
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
default: '',
|
|
128
|
+
description: 'Select a WhatsApp message template to send.',
|
|
129
|
+
hint: 'Templates are pre-approved message formats that can include variables and media.',
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export const ReplyMessageProperties: INodeProperties = {
|
|
133
|
+
displayName: 'Message Text',
|
|
134
|
+
name: 'replyMessage',
|
|
135
|
+
type: 'string',
|
|
136
|
+
required: true,
|
|
137
|
+
placeholder: 'Type your message here…',
|
|
138
|
+
displayOptions: {
|
|
139
|
+
show: {
|
|
140
|
+
operation: ['sendSessionMessage'],
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
default: '',
|
|
144
|
+
description: 'The text message that will be sent to the recipient.',
|
|
145
|
+
typeOptions: {
|
|
146
|
+
rows: 4,
|
|
147
|
+
},
|
|
148
|
+
hint: 'This message is sent immediately within an active WhatsApp session.',
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
export const EnableUrlPreviewProperties: INodeProperties = {
|
|
152
|
+
displayName: 'Enable URL Preview',
|
|
153
|
+
name: 'enableUrlPreview',
|
|
154
|
+
type: 'boolean',
|
|
155
|
+
default: false,
|
|
156
|
+
description: 'Show a preview for URLs included in the message.',
|
|
157
|
+
hint: 'Enable this to display link previews such as images and titles.',
|
|
158
|
+
displayOptions: {
|
|
159
|
+
show: {
|
|
160
|
+
operation: ['sendSessionMessage'],
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
export const TemplateNameOrIdProperties: INodeProperties = {
|
|
166
|
+
displayName: 'Template Variables',
|
|
167
|
+
name: 'templateVariables',
|
|
168
|
+
type: 'resourceMapper',
|
|
169
|
+
noDataExpression: true,
|
|
170
|
+
default: {
|
|
171
|
+
mappingMode: 'defineBelow',
|
|
172
|
+
value: null,
|
|
173
|
+
},
|
|
174
|
+
required: true,
|
|
175
|
+
placeholder: 'Add template variables',
|
|
176
|
+
description: 'Provide values for all variables required by the selected template.',
|
|
177
|
+
hint: 'Variable names and requirements are automatically derived from the selected template.',
|
|
178
|
+
displayOptions: {
|
|
179
|
+
show: {
|
|
180
|
+
operation: ['sendTemplateMessage'],
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
typeOptions: {
|
|
184
|
+
loadOptionsDependsOn: ['template'],
|
|
185
|
+
resourceMapper: {
|
|
186
|
+
resourceMapperMethod: 'getTemplateVariables',
|
|
187
|
+
mode: 'add',
|
|
188
|
+
fieldWords: {
|
|
189
|
+
singular: 'variable',
|
|
190
|
+
plural: 'variables',
|
|
191
|
+
},
|
|
192
|
+
addAllFields: true,
|
|
193
|
+
multiKeyMatch: false,
|
|
194
|
+
supportAutoMap: false,
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
};
|