@5minds/node-red-contrib-processcube-tools 1.2.0-feature-6d921c-mgp4itmd → 1.2.0-feature-6f535f-mgp6k79t
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/email-sender/email-sender.html +24 -106
- package/dist/email-sender/email-sender.js +44 -34
- package/dist/email-sender/email-sender.js.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces/EmailSenderNodeProperties.d.ts +3 -14
- package/dist/smtp-config/smtp-config.d.ts +3 -0
- package/dist/smtp-config/smtp-config.html +138 -0
- package/dist/smtp-config/smtp-config.js +22 -0
- package/dist/smtp-config/smtp-config.js.map +1 -0
- package/package.json +2 -1
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
validate: RED.validators.typedInput('senderType'),
|
|
12
12
|
},
|
|
13
13
|
senderType: { value: 'str' },
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
from: { value: '', required: true, validate: RED.validators.typedInput('fromType') },
|
|
15
|
+
fromType: { value: 'str' },
|
|
16
16
|
to: { value: '', required: true, validate: RED.validators.typedInput('toType') },
|
|
17
17
|
toType: { value: 'str' },
|
|
18
18
|
cc: { value: '', validate: RED.validators.typedInput('ccType') },
|
|
@@ -28,23 +28,8 @@
|
|
|
28
28
|
attachments: { value: '', required: false },
|
|
29
29
|
attachmentsType: { value: 'msg' },
|
|
30
30
|
|
|
31
|
-
// SMTP
|
|
32
|
-
|
|
33
|
-
hostType: { value: 'str' },
|
|
34
|
-
port: { value: '', required: true, validate: RED.validators.typedInput('portType') },
|
|
35
|
-
portType: { value: 'num' },
|
|
36
|
-
user: { value: '', required: true, validate: RED.validators.typedInput('userType') },
|
|
37
|
-
userType: { value: 'str' },
|
|
38
|
-
password: { value: '', required: true, type: 'password' },
|
|
39
|
-
passwordType: { value: 'env', required: true },
|
|
40
|
-
secure: { value: '', required: true, validate: RED.validators.typedInput('secureType') },
|
|
41
|
-
secureType: { value: 'bool' },
|
|
42
|
-
rejectUnauthorized: {
|
|
43
|
-
value: '',
|
|
44
|
-
required: true,
|
|
45
|
-
validate: RED.validators.typedInput('rejectUnauthorizedType'),
|
|
46
|
-
},
|
|
47
|
-
rejectUnauthorizedType: { value: 'bool' },
|
|
31
|
+
// SMTP Configuration reference
|
|
32
|
+
smtpConfig: { value: '', required: true, type: 'smtp-config' },
|
|
48
33
|
},
|
|
49
34
|
inputs: 1,
|
|
50
35
|
outputs: 1,
|
|
@@ -59,10 +44,10 @@
|
|
|
59
44
|
types: ['str', 'msg', 'flow', 'global', 'env'],
|
|
60
45
|
typeField: '#node-input-senderType',
|
|
61
46
|
});
|
|
62
|
-
$('#node-input-
|
|
47
|
+
$('#node-input-from').typedInput({
|
|
63
48
|
default: 'str',
|
|
64
49
|
types: ['str', 'msg', 'flow', 'global', 'env'],
|
|
65
|
-
typeField: '#node-input-
|
|
50
|
+
typeField: '#node-input-fromType',
|
|
66
51
|
});
|
|
67
52
|
$('#node-input-to').typedInput({
|
|
68
53
|
default: 'str',
|
|
@@ -99,38 +84,6 @@
|
|
|
99
84
|
types: ['msg', 'flow', 'global'],
|
|
100
85
|
typeField: '#node-input-attachmentsType',
|
|
101
86
|
});
|
|
102
|
-
|
|
103
|
-
// SMTP Fields
|
|
104
|
-
$('#node-input-host').typedInput({
|
|
105
|
-
default: 'str',
|
|
106
|
-
types: ['str', 'msg', 'flow', 'global', 'env'],
|
|
107
|
-
typeField: '#node-input-hostType',
|
|
108
|
-
});
|
|
109
|
-
$('#node-input-port').typedInput({
|
|
110
|
-
default: 'num',
|
|
111
|
-
types: ['num', 'msg', 'flow', 'global', 'env'],
|
|
112
|
-
typeField: '#node-input-portType',
|
|
113
|
-
});
|
|
114
|
-
$('#node-input-user').typedInput({
|
|
115
|
-
default: 'str',
|
|
116
|
-
types: ['str', 'msg', 'flow', 'global', 'env'],
|
|
117
|
-
typeField: '#node-input-userType',
|
|
118
|
-
});
|
|
119
|
-
$('#node-input-password').typedInput({
|
|
120
|
-
default: 'env',
|
|
121
|
-
types: ['msg', 'flow', 'global', 'env'],
|
|
122
|
-
typeField: '#node-input-passwordType',
|
|
123
|
-
});
|
|
124
|
-
$('#node-input-secure').typedInput({
|
|
125
|
-
default: 'bool',
|
|
126
|
-
types: ['bool', 'msg', 'flow', 'global', 'env'],
|
|
127
|
-
typeField: '#node-input-secureType',
|
|
128
|
-
});
|
|
129
|
-
$('#node-input-rejectUnauthorized').typedInput({
|
|
130
|
-
default: 'bool',
|
|
131
|
-
types: ['bool', 'msg', 'flow', 'global', 'env'],
|
|
132
|
-
typeField: '#node-input-rejectUnauthorizedType',
|
|
133
|
-
});
|
|
134
87
|
},
|
|
135
88
|
});
|
|
136
89
|
</script>
|
|
@@ -148,9 +101,9 @@
|
|
|
148
101
|
<input type="hidden" id="node-input-senderType" />
|
|
149
102
|
</div>
|
|
150
103
|
<div class="form-row">
|
|
151
|
-
<label for="node-input-
|
|
152
|
-
<input type="text" id="node-input-
|
|
153
|
-
<input type="hidden" id="node-input-
|
|
104
|
+
<label for="node-input-from"><i class="fa fa-envelope"></i> From</label>
|
|
105
|
+
<input type="text" id="node-input-from" placeholder="john.doe@example.com" />
|
|
106
|
+
<input type="hidden" id="node-input-fromType" />
|
|
154
107
|
</div>
|
|
155
108
|
<div class="form-row">
|
|
156
109
|
<label for="node-input-to"><i class="fa fa-user"></i> To</label>
|
|
@@ -187,37 +140,9 @@
|
|
|
187
140
|
<input type="text" id="node-input-attachments" />
|
|
188
141
|
<input type="hidden" id="node-input-attachmentsType" />
|
|
189
142
|
</div>
|
|
190
|
-
|
|
191
|
-
<h3>SMTP Configuration</h3>
|
|
192
|
-
<div class="form-row">
|
|
193
|
-
<label for="node-input-host"><i class="fa fa-server"></i> Host</label>
|
|
194
|
-
<input type="text" id="node-input-host" placeholder="smtp.gmail.com" />
|
|
195
|
-
<input type="hidden" id="node-input-hostType" />
|
|
196
|
-
</div>
|
|
197
|
-
<div class="form-row">
|
|
198
|
-
<label for="node-input-port"><i class="fa fa-plug"></i> Port</label>
|
|
199
|
-
<input type="text" id="node-input-port" placeholder="587" />
|
|
200
|
-
<input type="hidden" id="node-input-portType" />
|
|
201
|
-
</div>
|
|
202
|
-
<div class="form-row">
|
|
203
|
-
<label for="node-input-user"><i class="fa fa-user"></i> User</label>
|
|
204
|
-
<input type="text" id="node-input-user" placeholder="test.user@config.com" />
|
|
205
|
-
<input type="hidden" id="node-input-userType" />
|
|
206
|
-
</div>
|
|
207
|
-
<div class="form-row">
|
|
208
|
-
<label for="node-input-password"><i class="fa fa-lock"></i> Password</label>
|
|
209
|
-
<input type="text" id="node-input-password" />
|
|
210
|
-
<input type="hidden" id="node-input-passwordType" />
|
|
211
|
-
</div>
|
|
212
|
-
<div class="form-row">
|
|
213
|
-
<label for="node-input-secure"><i class="fa fa-shield"></i> SSL/TLS (Secure)</label>
|
|
214
|
-
<input type="text" id="node-input-secure" />
|
|
215
|
-
<input type="hidden" id="node-input-secureType" />
|
|
216
|
-
</div>
|
|
217
143
|
<div class="form-row">
|
|
218
|
-
<label for="node-input-
|
|
219
|
-
<input type="text" id="node-input-
|
|
220
|
-
<input type="hidden" id="node-input-rejectUnauthorizedType" />
|
|
144
|
+
<label for="node-input-smtpConfig"><i class="fa fa-server"></i> SMTP Config</label>
|
|
145
|
+
<input type="text" id="node-input-smtpConfig" />
|
|
221
146
|
</div>
|
|
222
147
|
</script>
|
|
223
148
|
|
|
@@ -260,7 +185,7 @@
|
|
|
260
185
|
<dd>A descriptive name for the node.</dd>
|
|
261
186
|
<dt>Sender <span class="property-type">string | variable</span></dt>
|
|
262
187
|
<dd>The name displayed as the sender to the recipient.</dd>
|
|
263
|
-
<dt>
|
|
188
|
+
<dt>From <span class="property-type">string | variable</span></dt>
|
|
264
189
|
<dd>The email address from which the email is sent.</dd>
|
|
265
190
|
<dt>To <span class="property-type">string | variable</span></dt>
|
|
266
191
|
<dd>The primary recipient(s) of the email. For multiple recipients, separate addresses with a comma.</dd>
|
|
@@ -283,24 +208,11 @@
|
|
|
283
208
|
|
|
284
209
|
<h4>SMTP Configuration</h4>
|
|
285
210
|
<dl class="message-properties">
|
|
286
|
-
<dt>
|
|
287
|
-
<dd>The hostname of your SMTP server (e.g., <code>smtp.gmail.com</code>).</dd>
|
|
288
|
-
<dt>Port <span class="property-type">number | variable</span></dt>
|
|
289
|
-
<dd>The port number for the SMTP server (e.g., <code>587</code> or <code>465</code>).</dd>
|
|
290
|
-
<dt>User <span class="property-type">string | variable</span></dt>
|
|
291
|
-
<dd>The username for SMTP authentication.</dd>
|
|
292
|
-
<dt>Password <span class="property-type">password | variable</span></dt>
|
|
211
|
+
<dt>SMTP Config <span class="property-type">smtp-config</span></dt>
|
|
293
212
|
<dd>
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
<dt>SSL/TLS (Secure) <span class="property-type">boolean | variable</span></dt>
|
|
298
|
-
<dd>Enables a secure connection. Set this to <code>true</code> to use SSL/TLS encryption.</dd>
|
|
299
|
-
<dt>Reject Unauthorized <span class="property-type">boolean | variable</span></dt>
|
|
300
|
-
<dd>
|
|
301
|
-
If <code>true</code>, the server's certificate is rejected if it isn't authorized by a trusted Certificate
|
|
302
|
-
Authority (CA). Set this to <code>false</code> only if you know the server's certificate is self-signed or
|
|
303
|
-
not from a trusted CA.
|
|
213
|
+
Reference to an SMTP configuration node that contains the server connection settings (host, port, user,
|
|
214
|
+
password, security options). This allows you to reuse the same SMTP configuration across multiple email
|
|
215
|
+
sender nodes.
|
|
304
216
|
</dd>
|
|
305
217
|
</dl>
|
|
306
218
|
|
|
@@ -310,14 +222,20 @@
|
|
|
310
222
|
<b>Dynamic Content</b>: You can use a <b>Template node</b> before the <b>email-sender</b> node to generate
|
|
311
223
|
dynamic HTML content for your emails, using <code>msg</code> properties to fill in placeholders.
|
|
312
224
|
</li>
|
|
225
|
+
<li>
|
|
226
|
+
<b>Data-Driven Emails</b>: Fields like <b>To</b>, <b>Subject</b>, and <b>HTML Content</b> can be left empty
|
|
227
|
+
in the configuration and provided dynamically via message properties (<code>msg.to</code>, <code>msg.topic</code>,
|
|
228
|
+
<code>msg.payload</code>). At least one recipient (to, cc, or bcc) must be specified before sending.
|
|
229
|
+
</li>
|
|
313
230
|
<li>
|
|
314
231
|
<b>Testing</b>: When testing, use a free service like
|
|
315
232
|
<a href="https://mailtrap.io" target="_blank">Mailtrap</a> to avoid sending real emails. This allows you to
|
|
316
233
|
inspect the email and its content without cluttering your inbox.
|
|
317
234
|
</li>
|
|
318
235
|
<li>
|
|
319
|
-
<b>Troubleshooting</b>: If you encounter a <code>
|
|
320
|
-
|
|
236
|
+
<b>Troubleshooting</b>: If you encounter a <code>SMTP configuration node is not configured</code> error, make
|
|
237
|
+
sure you have created and selected an SMTP Config node. Check that the <b>Sender</b> and <b>From</b> fields
|
|
238
|
+
are configured, as these are required.
|
|
321
239
|
</li>
|
|
322
240
|
</ul>
|
|
323
241
|
|
|
@@ -11,34 +11,36 @@ const EmailSenderNode = (RED, dependencies = defaultDependencies) => {
|
|
|
11
11
|
function EmailSender(config) {
|
|
12
12
|
RED.nodes.createNode(this, config);
|
|
13
13
|
const node = this;
|
|
14
|
-
|
|
14
|
+
// Store configuration validation error without failing construction
|
|
15
|
+
let configError = null;
|
|
16
|
+
// Get the SMTP config node
|
|
17
|
+
const smtpConfigNode = RED.nodes.getNode(config.smtpConfig);
|
|
18
|
+
try {
|
|
19
|
+
// Validate SMTP config node exists
|
|
20
|
+
if (!smtpConfigNode) {
|
|
21
|
+
throw new Error('SMTP configuration node is not configured');
|
|
22
|
+
}
|
|
23
|
+
// Validate only critical fields that can't be provided at runtime
|
|
24
|
+
// Fields like 'to', 'subject', 'htmlContent' can be empty if provided via msg
|
|
15
25
|
const requiredFields = [
|
|
16
|
-
{ name: 'sender', value:
|
|
17
|
-
{ name: '
|
|
18
|
-
{ name: 'to', value: cfg.to },
|
|
19
|
-
{ name: 'subject', value: cfg.subject },
|
|
20
|
-
{ name: 'htmlContent', value: cfg.htmlContent },
|
|
21
|
-
{ name: 'host', value: cfg.host },
|
|
22
|
-
{ name: 'port', value: cfg.port },
|
|
23
|
-
{ name: 'user', value: cfg.user },
|
|
24
|
-
{ name: 'password', value: cfg.password },
|
|
25
|
-
{ name: 'secure', value: cfg.secure },
|
|
26
|
-
{ name: 'rejectUnauthorized', value: cfg.rejectUnauthorized },
|
|
26
|
+
{ name: 'sender', value: config.sender },
|
|
27
|
+
{ name: 'from', value: config.from },
|
|
27
28
|
];
|
|
28
29
|
for (const field of requiredFields) {
|
|
29
30
|
if (field.value === undefined || field.value === null || field.value === '') {
|
|
30
|
-
|
|
31
|
+
throw new Error(`Required property '${field.name}' is missing`);
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
configError = error instanceof Error ? error : new Error(String(error));
|
|
37
|
+
node.status({ fill: 'red', shape: 'ring', text: 'config error' });
|
|
38
|
+
// Store error for test framework to detect
|
|
39
|
+
node.configError = configError;
|
|
40
|
+
// Emit error immediately during construction for test framework
|
|
38
41
|
setImmediate(() => {
|
|
39
|
-
node.error(
|
|
42
|
+
node.error(configError.message);
|
|
40
43
|
});
|
|
41
|
-
return; // Stop initialization if config is invalid
|
|
42
44
|
}
|
|
43
45
|
const safeEvaluatePropertyAttachment = (cfg, n, m) => {
|
|
44
46
|
if (cfg.attachments && cfg.attachments.trim() !== '') {
|
|
@@ -64,10 +66,16 @@ const EmailSenderNode = (RED, dependencies = defaultDependencies) => {
|
|
|
64
66
|
if (err)
|
|
65
67
|
node.error(err, msg);
|
|
66
68
|
};
|
|
69
|
+
// If there's a configuration error, report it and don't proceed
|
|
70
|
+
if (configError) {
|
|
71
|
+
node.error(configError.message);
|
|
72
|
+
done(configError);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
67
75
|
try {
|
|
68
76
|
// Retrieve and evaluate all configuration values
|
|
69
77
|
const sender = String(RED.util.evaluateNodeProperty(config.sender, config.senderType, node, msg));
|
|
70
|
-
const
|
|
78
|
+
const from = String(RED.util.evaluateNodeProperty(config.from, config.fromType, node, msg));
|
|
71
79
|
const to = String(RED.util.evaluateNodeProperty(config.to, config.toType, node, msg) || '');
|
|
72
80
|
const cc = String(RED.util.evaluateNodeProperty(config.cc, config.ccType, node, msg) || '');
|
|
73
81
|
const bcc = String(RED.util.evaluateNodeProperty(config.bcc, config.bccType, node, msg) || '');
|
|
@@ -77,13 +85,19 @@ const EmailSenderNode = (RED, dependencies = defaultDependencies) => {
|
|
|
77
85
|
'Message from Node-RED');
|
|
78
86
|
const htmlContent = String(RED.util.evaluateNodeProperty(config.htmlContent, config.htmlContentType, node, msg));
|
|
79
87
|
const attachments = safeEvaluatePropertyAttachment(config, node, msg);
|
|
80
|
-
// SMTP Configuration
|
|
81
|
-
const
|
|
82
|
-
const
|
|
83
|
-
const
|
|
84
|
-
const
|
|
85
|
-
const
|
|
86
|
-
const
|
|
88
|
+
// Get SMTP Configuration from config node
|
|
89
|
+
const smtp_user = RED.util.evaluateNodeProperty(smtpConfigNode.user, smtpConfigNode.userType || 'env', smtpConfigNode, msg);
|
|
90
|
+
const smtp_password = RED.util.evaluateNodeProperty(smtpConfigNode.password, smtpConfigNode.passwordType || 'env', smtpConfigNode, msg);
|
|
91
|
+
const host = smtpConfigNode.host;
|
|
92
|
+
const port = smtpConfigNode.port;
|
|
93
|
+
const user = String(smtp_user);
|
|
94
|
+
const password = String(smtp_password);
|
|
95
|
+
const secure = smtpConfigNode.secure;
|
|
96
|
+
const rejectUnauthorized = smtpConfigNode.rejectUnauthorized;
|
|
97
|
+
// Runtime validation: at least one recipient must be provided
|
|
98
|
+
if (!to && !cc && !bcc) {
|
|
99
|
+
throw new Error('At least one recipient (to, cc, or bcc) must be specified');
|
|
100
|
+
}
|
|
87
101
|
// Process attachments
|
|
88
102
|
let processedAttachments = [];
|
|
89
103
|
let parsedAttachments = attachments;
|
|
@@ -123,7 +137,7 @@ const EmailSenderNode = (RED, dependencies = defaultDependencies) => {
|
|
|
123
137
|
tls: { rejectUnauthorized },
|
|
124
138
|
});
|
|
125
139
|
const mailOptions = {
|
|
126
|
-
from: { name: sender, address:
|
|
140
|
+
from: { name: sender, address: from },
|
|
127
141
|
to,
|
|
128
142
|
cc,
|
|
129
143
|
bcc,
|
|
@@ -173,11 +187,7 @@ const EmailSenderNode = (RED, dependencies = defaultDependencies) => {
|
|
|
173
187
|
}
|
|
174
188
|
});
|
|
175
189
|
}
|
|
176
|
-
RED.nodes.registerType('email-sender', EmailSender
|
|
177
|
-
credentials: {
|
|
178
|
-
password: { type: 'password' },
|
|
179
|
-
},
|
|
180
|
-
});
|
|
190
|
+
RED.nodes.registerType('email-sender', EmailSender);
|
|
181
191
|
};
|
|
182
192
|
module.exports = EmailSenderNode;
|
|
183
193
|
//# sourceMappingURL=email-sender.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email-sender.js","sourceRoot":"","sources":["../../src/email-sender/email-sender.ts"],"names":[],"mappings":";;;;AACA,4DAAoC;AAUpC,2CAA2C;AAC3C,MAAM,mBAAmB,GAAiB;IACtC,UAAU,EAAE,oBAAU;CACzB,CAAC;AAEF,MAAM,eAAe,GAAoB,CAAC,GAAG,EAAE,eAA6B,mBAAmB,EAAE,EAAE;IAC/F,SAAS,WAAW,CAAa,MAAiC;QAC9D,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACnC,MAAM,IAAI,GAAG,IAAI,CAAC;QAElB,
|
|
1
|
+
{"version":3,"file":"email-sender.js","sourceRoot":"","sources":["../../src/email-sender/email-sender.ts"],"names":[],"mappings":";;;;AACA,4DAAoC;AAUpC,2CAA2C;AAC3C,MAAM,mBAAmB,GAAiB;IACtC,UAAU,EAAE,oBAAU;CACzB,CAAC;AAEF,MAAM,eAAe,GAAoB,CAAC,GAAG,EAAE,eAA6B,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,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;YAC9D,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAED,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;AACxD,CAAC,CAAC;AAEF,iBAAS,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,12 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
// Importiere die Registrierungsfunktion für deine Nodes.
|
|
6
6
|
const imap_config_1 = __importDefault(require("./imap-config/imap-config"));
|
|
7
|
+
const smtp_config_1 = __importDefault(require("./smtp-config/smtp-config"));
|
|
7
8
|
const email_receiver_1 = __importDefault(require("./email-receiver/email-receiver"));
|
|
8
9
|
const email_sender_1 = __importDefault(require("./email-sender/email-sender"));
|
|
9
10
|
const html_to_text_1 = __importDefault(require("./html-to-text/html-to-text"));
|
|
10
11
|
module.exports = function (RED) {
|
|
11
12
|
// Rufe die Registrierungsfunktionen für jede Node auf.
|
|
12
13
|
(0, imap_config_1.default)(RED);
|
|
14
|
+
(0, smtp_config_1.default)(RED);
|
|
13
15
|
(0, email_receiver_1.default)(RED);
|
|
14
16
|
(0, email_sender_1.default)(RED);
|
|
15
17
|
(0, html_to_text_1.default)(RED);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,yDAAyD;AACzD,4EAA+D;AAC/D,qFAAwE;AACxE,+EAAkE;AAClE,+EAAiE;AAGjE,iBAAS,UAAU,GAAQ;IACvB,uDAAuD;IACvD,IAAA,qBAAsB,EAAC,GAAG,CAAC,CAAC;IAC5B,IAAA,wBAAyB,EAAC,GAAG,CAAC,CAAC;IAC/B,IAAA,sBAAuB,EAAC,GAAG,CAAC,CAAC;IAC7B,IAAA,sBAAsB,EAAC,GAAG,CAAC,CAAC;AAChC,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,yDAAyD;AACzD,4EAA+D;AAC/D,4EAA+D;AAC/D,qFAAwE;AACxE,+EAAkE;AAClE,+EAAiE;AAGjE,iBAAS,UAAU,GAAQ;IACvB,uDAAuD;IACvD,IAAA,qBAAsB,EAAC,GAAG,CAAC,CAAC;IAC5B,IAAA,qBAAsB,EAAC,GAAG,CAAC,CAAC;IAC5B,IAAA,wBAAyB,EAAC,GAAG,CAAC,CAAC;IAC/B,IAAA,sBAAuB,EAAC,GAAG,CAAC,CAAC;IAC7B,IAAA,sBAAsB,EAAC,GAAG,CAAC,CAAC;AAChC,CAAC,CAAC"}
|
|
@@ -2,8 +2,8 @@ import { NodeDef } from 'node-red';
|
|
|
2
2
|
export interface EmailSenderNodeProperties extends NodeDef {
|
|
3
3
|
sender: string;
|
|
4
4
|
senderType: string;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
from: string;
|
|
6
|
+
fromType: string;
|
|
7
7
|
to: string;
|
|
8
8
|
toType: string;
|
|
9
9
|
cc: string;
|
|
@@ -18,16 +18,5 @@ export interface EmailSenderNodeProperties extends NodeDef {
|
|
|
18
18
|
htmlContentType: string;
|
|
19
19
|
attachments: string;
|
|
20
20
|
attachmentsType: string;
|
|
21
|
-
|
|
22
|
-
hostType: string;
|
|
23
|
-
port: string;
|
|
24
|
-
portType: string;
|
|
25
|
-
user: string;
|
|
26
|
-
userType: string;
|
|
27
|
-
password: string;
|
|
28
|
-
passwordType: string;
|
|
29
|
-
secure: string;
|
|
30
|
-
secureType: string;
|
|
31
|
-
rejectUnauthorized: string;
|
|
32
|
-
rejectUnauthorizedType: string;
|
|
21
|
+
smtpConfig: string;
|
|
33
22
|
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
<script type="text/javascript">
|
|
2
|
+
RED.nodes.registerType('smtp-config', {
|
|
3
|
+
category: 'config',
|
|
4
|
+
defaults: {
|
|
5
|
+
name: { value: '' },
|
|
6
|
+
host: { value: '', required: true },
|
|
7
|
+
port: { value: 587, required: true, validate: RED.validators.number() },
|
|
8
|
+
user: { value: '', required: true, validate: RED.validators.typedInput('userType') },
|
|
9
|
+
userType: { value: 'env' },
|
|
10
|
+
password: { value: '', required: true, validate: RED.validators.typedInput('passwordType') },
|
|
11
|
+
passwordType: { value: 'env' },
|
|
12
|
+
connTimeout: { value: 10000, validate: RED.validators.number() },
|
|
13
|
+
authTimeout: { value: 5000, validate: RED.validators.number() },
|
|
14
|
+
keepalive: { value: true },
|
|
15
|
+
secure: { value: false },
|
|
16
|
+
autotls: { value: 'never' },
|
|
17
|
+
rejectUnauthorized: { value: false },
|
|
18
|
+
},
|
|
19
|
+
label: function () {
|
|
20
|
+
return this.name || `${this.user}@${this.host}`;
|
|
21
|
+
},
|
|
22
|
+
oneditprepare: function () {
|
|
23
|
+
$('#node-config-input-user').typedInput({
|
|
24
|
+
default: 'env',
|
|
25
|
+
types: ['global', 'env'],
|
|
26
|
+
typeField: '#node-config-input-userType',
|
|
27
|
+
});
|
|
28
|
+
$('#node-config-input-password').typedInput({
|
|
29
|
+
default: 'env',
|
|
30
|
+
types: ['global', 'env'],
|
|
31
|
+
typeField: '#node-config-input-passwordType',
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<script type="text/html" data-template-name="smtp-config">
|
|
38
|
+
<div class="form-row">
|
|
39
|
+
<label for="node-config-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
40
|
+
<input type="text" id="node-config-input-name" placeholder="My SMTP Server" />
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div class="form-row">
|
|
44
|
+
<label for="node-config-input-host"><i class="fa fa-server"></i> SMTP Host</label>
|
|
45
|
+
<input type="text" id="node-config-input-host" placeholder="smtp.gmail.com" />
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<div class="form-row">
|
|
49
|
+
<label for="node-config-input-port"><i class="fa fa-terminal"></i> Port</label>
|
|
50
|
+
<input type="text" id="node-config-input-port" placeholder="587" />
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<div class="form-row">
|
|
54
|
+
<label for="node-config-input-user"><i class="fa fa-user"></i> User</label>
|
|
55
|
+
<input type="text" id="node-config-input-user" placeholder="SMTP_USER" />
|
|
56
|
+
<input type="hidden" id="node-config-input-userType" />
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<div class="form-row">
|
|
60
|
+
<label for="node-config-input-password"><i class="fa fa-key"></i> Password</label>
|
|
61
|
+
<input type="text" id="node-config-input-password" placeholder="SMTP_PASSWORD" />
|
|
62
|
+
<input type="hidden" id="node-config-input-passwordType" />
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
<div class="form-row">
|
|
66
|
+
<label for="node-config-input-connTimeout"><i class="fa fa-clock-o"></i> Connection Timeout (ms)</label>
|
|
67
|
+
<input type="text" id="node-config-input-connTimeout" placeholder="10000" />
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
<div class="form-row">
|
|
71
|
+
<label for="node-config-input-authTimeout"><i class="fa fa-clock-o"></i> Auth Timeout (ms)</label>
|
|
72
|
+
<input type="text" id="node-config-input-authTimeout" placeholder="5000" />
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
<div class="form-row">
|
|
76
|
+
<label for="node-config-input-keepalive"><i class="fa fa-heart"></i> Keep Alive</label>
|
|
77
|
+
<input type="checkbox" id="node-config-input-keepalive" style="display: inline-block; width: auto; vertical-align: top;" />
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
<div class="form-row">
|
|
81
|
+
<label for="node-config-input-secure"><i class="fa fa-shield"></i> Use SSL/TLS (Secure)</label>
|
|
82
|
+
<input type="checkbox" id="node-config-input-secure" style="display: inline-block; width: auto; vertical-align: top;" />
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
<div class="form-row">
|
|
86
|
+
<label for="node-config-input-autotls"><i class="fa fa-shield"></i> Auto TLS</label>
|
|
87
|
+
<select id="node-config-input-autotls" style="width: 70%;">
|
|
88
|
+
<option value="never">Never</option>
|
|
89
|
+
<option value="always">Always</option>
|
|
90
|
+
<option value="required">Required</option>
|
|
91
|
+
</select>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<div class="form-row">
|
|
95
|
+
<label for="node-config-input-rejectUnauthorized"><i class="fa fa-certificate"></i> Reject Unauthorized</label>
|
|
96
|
+
<input type="checkbox" id="node-config-input-rejectUnauthorized" style="display: inline-block; width: auto; vertical-align: top;" />
|
|
97
|
+
</div>
|
|
98
|
+
</script>
|
|
99
|
+
|
|
100
|
+
<script type="text/html" data-help-name="smtp-config">
|
|
101
|
+
<p>Configuration node for SMTP server connection settings.</p>
|
|
102
|
+
|
|
103
|
+
<h3>Configuration</h3>
|
|
104
|
+
<dl class="message-properties">
|
|
105
|
+
<dt>Name <span class="property-type">string</span></dt>
|
|
106
|
+
<dd>A friendly name for this SMTP configuration.</dd>
|
|
107
|
+
|
|
108
|
+
<dt>SMTP Host <span class="property-type">string</span></dt>
|
|
109
|
+
<dd>The hostname or IP address of the SMTP server (e.g., smtp.gmail.com).</dd>
|
|
110
|
+
|
|
111
|
+
<dt>Port <span class="property-type">number</span></dt>
|
|
112
|
+
<dd>The port number for SMTP connection (typically 587 for STARTTLS, 465 for SSL/TLS).</dd>
|
|
113
|
+
|
|
114
|
+
<dt>User <span class="property-type">string | variable</span></dt>
|
|
115
|
+
<dd>The username for SMTP authentication. Supports environment variables and global context.</dd>
|
|
116
|
+
|
|
117
|
+
<dt>Password <span class="property-type">string | variable</span></dt>
|
|
118
|
+
<dd>The password for SMTP authentication. Supports environment variables and global context.</dd>
|
|
119
|
+
|
|
120
|
+
<dt>Connection Timeout <span class="property-type">number</span></dt>
|
|
121
|
+
<dd>The connection timeout in milliseconds (default: 10000).</dd>
|
|
122
|
+
|
|
123
|
+
<dt>Auth Timeout <span class="property-type">number</span></dt>
|
|
124
|
+
<dd>The authentication timeout in milliseconds (default: 5000).</dd>
|
|
125
|
+
|
|
126
|
+
<dt>Keep Alive <span class="property-type">boolean</span></dt>
|
|
127
|
+
<dd>Keep the connection alive by sending periodic commands (default: true).</dd>
|
|
128
|
+
|
|
129
|
+
<dt>Use SSL/TLS (Secure) <span class="property-type">boolean</span></dt>
|
|
130
|
+
<dd>Enable SSL/TLS encryption for the connection (default: false).</dd>
|
|
131
|
+
|
|
132
|
+
<dt>Auto TLS <span class="property-type">string</span></dt>
|
|
133
|
+
<dd>Controls STARTTLS behavior: never, always, or required (default: never).</dd>
|
|
134
|
+
|
|
135
|
+
<dt>Reject Unauthorized <span class="property-type">boolean</span></dt>
|
|
136
|
+
<dd>Reject connections with invalid TLS certificates (default: false).</dd>
|
|
137
|
+
</dl>
|
|
138
|
+
</script>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const SmtpConfigNode = (RED) => {
|
|
3
|
+
function SmtpConfig(config) {
|
|
4
|
+
RED.nodes.createNode(this, config);
|
|
5
|
+
// Store configuration properties
|
|
6
|
+
this.host = config.host;
|
|
7
|
+
this.port = config.port;
|
|
8
|
+
this.user = config.user;
|
|
9
|
+
this.userType = config.userType;
|
|
10
|
+
this.password = config.password;
|
|
11
|
+
this.passwordType = config.passwordType;
|
|
12
|
+
this.connTimeout = config.connTimeout !== undefined ? config.connTimeout : 10000;
|
|
13
|
+
this.authTimeout = config.authTimeout !== undefined ? config.authTimeout : 5000;
|
|
14
|
+
this.keepalive = config.keepalive !== undefined ? config.keepalive : true;
|
|
15
|
+
this.secure = config.secure !== undefined ? config.secure : false;
|
|
16
|
+
this.autotls = config.autotls || 'never';
|
|
17
|
+
this.rejectUnauthorized = config.rejectUnauthorized !== undefined ? config.rejectUnauthorized : false;
|
|
18
|
+
}
|
|
19
|
+
RED.nodes.registerType('smtp-config', SmtpConfig);
|
|
20
|
+
};
|
|
21
|
+
module.exports = SmtpConfigNode;
|
|
22
|
+
//# sourceMappingURL=smtp-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smtp-config.js","sourceRoot":"","sources":["../../src/smtp-config/smtp-config.ts"],"names":[],"mappings":";AAiBA,MAAM,cAAc,GAAoB,CAAC,GAAG,EAAE,EAAE;IAC5C,SAAS,UAAU,CAAY,MAAgC;QAC3D,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAEnC,iCAAiC;QACjC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAChC,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAChC,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;QACxC,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC;QACjF,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC;QAChF,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;QAC1E,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;QAClE,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,OAAO,CAAC;QACzC,IAAI,CAAC,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,KAAK,CAAC;IAC1G,CAAC;IAED,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;AACtD,CAAC,CAAC;AAEF,iBAAS,cAAc,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@5minds/node-red-contrib-processcube-tools",
|
|
3
|
-
"version": "1.2.0-feature-
|
|
3
|
+
"version": "1.2.0-feature-6f535f-mgp6k79t",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Node-RED tools nodes for ProcessCube",
|
|
6
6
|
"scripts": {
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"version": "^4.1.0",
|
|
43
43
|
"nodes": {
|
|
44
44
|
"ImapConfig": "dist/imap-config/imap-config.js",
|
|
45
|
+
"SmtpConfig": "dist/smtp-config/smtp-config.js",
|
|
45
46
|
"EmailReceiver": "dist/email-receiver/email-receiver.js",
|
|
46
47
|
"EmailSender": "dist/email-sender/email-sender.js",
|
|
47
48
|
"HtmlToText": "dist/html-to-text/html-to-text.js"
|