@5minds/node-red-contrib-processcube 1.15.0 → 1.15.1-develop-1a7787-maqgn1n9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@5minds/node-red-contrib-processcube",
3
- "version": "1.15.0",
3
+ "version": "1.15.1-develop-1a7787-maqgn1n9",
4
4
  "license": "MIT",
5
5
  "description": "Node-RED nodes for ProcessCube",
6
6
  "scripts": {
@@ -2,10 +2,10 @@ module.exports = function (RED) {
2
2
 
3
3
  const fs = require('fs');
4
4
  const path = require('path');
5
- const os = require('os');
6
5
  const { pipeline } = require('stream');
7
6
  const { promisify } = require('util');
8
7
  const AdmZip = require('adm-zip');
8
+ const fetch = require('node-fetch');
9
9
 
10
10
  const streamPipeline = promisify(pipeline);
11
11
 
@@ -19,6 +19,30 @@ module.exports = function (RED) {
19
19
 
20
20
  try {
21
21
 
22
+ async function inlineCssImport(html) {
23
+ // 1. Finde @import-Zeile
24
+ const importRegex = /@import\s+url\(([^)]+)\);?/;
25
+ const match = html.match(importRegex);
26
+ if (!match) return html; // keine @import-Zeile gefunden
27
+
28
+ const url = match[1].replace(/['"]/g, ''); // evtl. Anführungszeichen entfernen
29
+
30
+ try {
31
+ const response = await fetch(url);
32
+ if (!response.ok) throw new Error(`Fehler beim Laden von ${url}`);
33
+
34
+ const cssContent = await response.text();
35
+
36
+ // 2. Ersetze @import-Zeile durch eingebettetes CSS
37
+ const embeddedStyle = `\n/* inlined from ${url} */\n${cssContent}`;
38
+ return html.replace(importRegex, embeddedStyle);
39
+ } catch (error) {
40
+ console.error('Fehler beim Inlining der CSS-Datei:', error);
41
+ return html; // Fallback: Original belassen
42
+ }
43
+ }
44
+
45
+
22
46
  function convertGoogleDriveLink(link) {
23
47
  // Format 0: https://docs.google.com/document/d/FILE_ID/edit
24
48
  const editMatch = link.match(/https:\/\/docs\.google\.com\/document\/d\/([^/]+)/);
@@ -112,6 +136,8 @@ module.exports = function (RED) {
112
136
  }
113
137
  }
114
138
 
139
+ html = await inlineCssImport(html);
140
+
115
141
  let new_payload = renderTemplate(html, msg.payload);
116
142
 
117
143
  // ggf. mit schalter
@@ -37,40 +37,43 @@
37
37
  <input type="text" id="node-input-name" placeholder="Name" />
38
38
  </div>
39
39
  <div class="form-row">
40
- <label for="node-input-engine"><i class="fa fa-tag"></i> Engine-URL</label>
40
+ <label for="node-input-engine"><i class="fa fa-link"></i> Engine-URL</label>
41
41
  <input type="text" id="node-input-engine" placeholder="Engine-URL" />
42
42
  </div>
43
43
  <div class="form-row">
44
- <label for="node-input-query"><i class="fa fa-tag"></i> Query</label>
44
+ <label for="node-input-query"><i class="fa fa-search"></i> Query</label>
45
45
  <input type="text" id="node-input-query" />
46
46
  </div>
47
47
  <div class="form-row" style="margin-bottom: 3px;">
48
- <input type="checkbox" checked id="node-input-delete_releated" style="display: inline-block; width: auto; vertical-align: top; margin-left: 30px; margin-right: 5px;">
49
- <label style="width:auto" for="node-input-delete_releated">Delete related</label>
48
+ <label style="width:auto" for="node-input-delete_releated"><i class="fa fa-trash"></i> Related Data</label>
49
+ <input
50
+ type="checkbox"
51
+ checked
52
+ id="node-input-delete_releated"
53
+ style="display: inline-block; width: auto; vertical-align: top; margin-left: 5px; margin-right: 3px;"
54
+ />
55
+ <label style="width:auto"> Delete</label>
50
56
  </div>
51
57
  </script>
52
58
 
53
59
  <script type="text/markdown" data-help-name="processinstance-delete-advanced">
54
- Delete old instances of a process model in the ProcessCube.
60
+ Delete outdated instances of a process model in ProcessCube.
55
61
 
56
- Only engines version >= 19 are supported.
62
+ *Supported only on engines version 19 or higher.*
57
63
 
58
64
  ## Inputs
59
65
 
60
- : payload (json): The Parameter to delete the instances.
66
+ The node can take an input query from either a specific field on the msg object or as a json object directly in the nodes configuration.
67
+ In both cases the node supports the following fields in the query:
61
68
 
62
69
 
63
- ## Outputs
70
+ : processInstanceId (String): The IDs of the ProcessInstances to delete.
71
+ : processModelId (String): The ID of the ProcessModel to delete the instances from.
72
+ : finishedBefore (Datetime): The date before which the instances should be deleted.
73
+ : finshedAfter (Datetime): The date after which the instances should be deleted.
64
74
 
65
- : Explanation of the payload:
66
75
 
67
- Object
68
- {
69
- processInstanceId: The IDs of the ProcessInstances to delete (Example : 12345678,87654321).
70
- processModelId: The ID of the ProcessModel to delete the instances from.
71
- finishedBefore: The date before which the instances should be deleted.
72
- finshedAfter: The date after which the instances should be deleted.
73
- }
76
+ ## Outputs
74
77
 
75
78
  ### References
76
79