@5minds/node-red-contrib-processcube-tools 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.
@@ -0,0 +1,6 @@
1
+ {
2
+ "singleQuote": true,
3
+ "printWidth": 120,
4
+ "arrowParens": "always",
5
+ "tabWidth": 4
6
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 5Minds IT-Solutions GmbH & Co. KG
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # Some Nodes to efficent with the ProcessCube LowCode component (Node-RED)
2
+
3
+ This repository contains some nodes to efficent with the ProcessCube LowCode component (Node-RED).
4
+
5
+ Details see @ [ProcessCub.io - LowCode Integration Nodes](https://processcube.io/docs/node-red/integration-nodes) and [ProcessCub.io - LowCode Event Nodes](https://processcube.io/docs/node-red/event-nodes).
File without changes
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@5minds/node-red-contrib-processcube-tools",
3
+ "version": "1.0.0",
4
+ "license": "MIT",
5
+ "description": "Node-RED tools nodes for ProcessCube",
6
+ "scripts": {
7
+ "lint": "prettier --write --config ./.prettierrc.json \"**/*.{html,js}\""
8
+ },
9
+ "authors": [
10
+ {
11
+ "name": "Martin Moellenbeck",
12
+ "email": "Martin.Moellenbeck@5Minds.de"
13
+ },
14
+ {
15
+ "name": "Robin Lenz",
16
+ "email": "Robin.Lenz@5Minds.de"
17
+ }
18
+ ],
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "https://github.com/5minds/node-red-contrib-processcube-tools"
22
+ },
23
+ "bugs": {
24
+ "url": "https://github.com/5minds/node-red-contrib-processcube-tools/issues",
25
+ "email": "processcube@5minds.de"
26
+ },
27
+ "engines": {
28
+ "node": ">=14",
29
+ "npm": ">=8.0.0"
30
+ },
31
+ "node-red": {
32
+ "version": ">=3.1.9",
33
+ "nodes": {
34
+ "HtmlToText": "processcube-html-to-text.js"
35
+ },
36
+ "examples": "examples"
37
+ },
38
+ "dependencies": {
39
+ "html-to-text": "^9.0.5"
40
+ },
41
+ "keywords": [
42
+ "node-red",
43
+ "processcube",
44
+ "tools",
45
+ "low-code"
46
+ ]
47
+ }
@@ -0,0 +1,41 @@
1
+ <script type="text/javascript">
2
+ RED.nodes.registerType('processcube-html-to-text', {
3
+ category: 'ProcessCube Tools',
4
+ color: '#02AFD6',
5
+ defaults: {
6
+ name: { value: '' },
7
+ },
8
+ inputs: 1,
9
+ outputs: 1,
10
+ icon: 'font-awesome/fa-sign-in',
11
+ label: function () {
12
+ return this.name || 'processcube-html-to-text';
13
+ },
14
+ });
15
+ </script>
16
+
17
+ <script type="text/html" data-template-name="processcube-html-to-text">
18
+ <div class="form-row">
19
+ <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
20
+ <input type="text" id="node-input-name" placeholder="Name" />
21
+ </div>
22
+ </script>
23
+
24
+ <script type="text/markdown" data-help-name="processcube-google-docs-mail-template">
25
+ # Html 2 Text
26
+
27
+ ## Inputs
28
+
29
+ : payload (String) : html content to convert to text
30
+
31
+ ## Outputs
32
+
33
+ : payload (String) : text content
34
+
35
+ ---
36
+
37
+ ## References
38
+
39
+ - [The ProcessCube Developer Network](https://processcube.io) – All documentation for the ProcessCube&copy; platform
40
+ - [Node-RED Integration in ProcessCube&copy;](https://processcube.io/docs/node-red) – Node-RED integration in ProcessCube&copy;
41
+ </script>
@@ -0,0 +1,25 @@
1
+ module.exports = function (RED) {
2
+
3
+ const { compile } = require('html-to-text');
4
+
5
+ function HtmlToText(config) {
6
+ RED.nodes.createNode(this, config);
7
+ const node = this;
8
+
9
+ const options = {
10
+ wordwrap: 130,
11
+ // ...
12
+ };
13
+ const compiledConvert = compile(options); // options passed here
14
+
15
+
16
+ node.on('input', async function (msg) {
17
+
18
+ msg.payload = compiledConvert(msg.payload);
19
+
20
+ node.send(msg);
21
+ });
22
+ }
23
+
24
+ RED.nodes.registerType('processcube-html-to-text', HtmlToText);
25
+ };