@node-red/nodes 3.1.0-beta.4 → 3.1.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.
@@ -77,14 +77,15 @@
77
77
  <div id="func-tabs-content" style="min-height: calc(100% - 95px);">
78
78
 
79
79
  <div id="func-tab-config" style="display:none">
80
- <div class="form-row">
81
- <label for="node-input-outputs"><i class="fa fa-random"></i> <span data-i18n="function.label.outputs"></span></label>
82
- <input id="node-input-outputs" style="width: 60px;" value="1">
83
- </div>
84
-
85
- <div class="form-row">
86
- <label for="node-input-timeout"><i class="fa fa-clock-o"></i> <span data-i18n="function.label.timeout"></span></label>
87
- <input id="node-input-timeout" style="width: 60px;" data-i18n="[placeholder]join.seconds">
80
+ <div>
81
+ <div class="form-row" style="display: inline-block; margin-right: 50px;">
82
+ <label for="node-input-outputs"><i class="fa fa-random"></i> <span data-i18n="function.label.outputs"></span></label>
83
+ <input id="node-input-outputs" style="width: 60px;" value="1">
84
+ </div>
85
+ <div class="form-row" style="display: inline-block;">
86
+ <label for="node-input-timeout"><i class="fa fa-clock-o"></i> <span data-i18n="function.label.timeout"></span></label>
87
+ <input id="node-input-timeout" style="width: 60px;" data-i18n="[placeholder]join.seconds">
88
+ </div>
88
89
  </div>
89
90
 
90
91
  <div class="form-row node-input-libs-row hide" style="margin-bottom: 0px;">
@@ -365,7 +366,7 @@
365
366
  name: {value:"_DEFAULT_"},
366
367
  func: {value:"\nreturn msg;"},
367
368
  outputs: {value:1},
368
- timeout:{value:0},
369
+ timeout:{value:RED.settings.functionTimeout || 0},
369
370
  noerr: {value:0,required:true,
370
371
  validate: function(v, opt) {
371
372
  if (!v) {
@@ -521,7 +521,8 @@ module.exports = function(RED) {
521
521
  RED.nodes.registerType("function",FunctionNode, {
522
522
  dynamicModuleList: "libs",
523
523
  settings: {
524
- functionExternalModules: { value: true, exportable: true }
524
+ functionExternalModules: { value: true, exportable: true },
525
+ functionTimeout: { value:0, exportable: true }
525
526
  }
526
527
  });
527
528
  RED.library.register("functions");
@@ -103,7 +103,6 @@
103
103
  } else if (type === "istype") {
104
104
  r.v = rule.find(".node-input-rule-type-value").typedInput('type');
105
105
  r.vt = rule.find(".node-input-rule-type-value").typedInput('type');
106
- r.vt = (r.vt === "number") ? "num" : "str";
107
106
  } else if (type === "jsonata_exp") {
108
107
  r.v = rule.find(".node-input-rule-exp-value").typedInput('value');
109
108
  r.vt = rule.find(".node-input-rule-exp-value").typedInput('type');
@@ -218,7 +217,11 @@
218
217
  if (i > 0) {
219
218
  var lastRule = $("#node-input-rule-container").editableList('getItemAt',i-1);
220
219
  var exportedRule = exportRule(lastRule.element);
221
- opt.r.vt = exportedRule.vt;
220
+ if (exportedRule.t === "istype") {
221
+ opt.r.vt = (exportedRule.vt === "number") ? "num" : "str";
222
+ } else {
223
+ opt.r.vt = exportedRule.vt;
224
+ }
222
225
  opt.r.v = "";
223
226
  // We could copy the value over as well and preselect it (see the 'activeElement' code below)
224
227
  // But not sure that feels right. Is copying over the last value 'expected' behaviour?
@@ -492,12 +492,12 @@
492
492
  let ok = true;
493
493
  if ($("#node-config-input-clientid").length) {
494
494
  // Currently editing the node
495
- let needClientId = !$("#node-config-input-cleansession").is(":checked") || !$("#node-config-input-autoUnsubscribe").is(":checked")
495
+ let needClientId = !$("#node-config-input-cleansession").is(":checked")
496
496
  if (needClientId) {
497
497
  ok = (v||"").length > 0;
498
498
  }
499
499
  } else {
500
- let needClientId = !(this.cleansession===undefined || this.cleansession) || this.autoUnsubscribe;
500
+ let needClientId = !(this.cleansession===undefined || this.cleansession)
501
501
  if (needClientId) {
502
502
  ok = (v||"").length > 0;
503
503
  }
@@ -24,7 +24,6 @@ module.exports = function(RED) {
24
24
  "text/css":"string",
25
25
  "text/html":"string",
26
26
  "text/plain":"string",
27
- "text/html":"string",
28
27
  "application/json":"json",
29
28
  "application/octet-stream":"buffer",
30
29
  "application/pdf":"buffer",
@@ -452,10 +452,6 @@ in your Node-RED user directory (${RED.settings.userDir}).
452
452
  formData.append(opt, val);
453
453
  } else if (typeof val === 'object' && val.hasOwnProperty('value')) {
454
454
  formData.append(opt,val.value,val.options || {});
455
- } else if (Array.isArray(val)) {
456
- for (var i=0; i<val.length; i++) {
457
- formData.append(opt, val[i])
458
- }
459
455
  } else {
460
456
  formData.append(opt,JSON.stringify(val));
461
457
  }
@@ -637,6 +633,7 @@ in your Node-RED user directory (${RED.settings.userDir}).
637
633
  msg.payload = msg.payload.toString('utf8'); // txt
638
634
 
639
635
  if (node.ret === "obj") {
636
+ if (msg.statusCode == 204){msg.payload= "{}"};
640
637
  try { msg.payload = JSON.parse(msg.payload); } // obj
641
638
  catch(e) { node.warn(RED._("httpin.errors.json-error")); }
642
639
  }
@@ -68,6 +68,9 @@ module.exports = function(RED) {
68
68
  node.error(err,msg);
69
69
  return done();
70
70
  } else {
71
+ if (typeof value !== 'string' && value !== null && value !== undefined) {
72
+ value = value.toString();
73
+ }
71
74
  processMsg2(msg,nodeSend,value,done);
72
75
  }
73
76
  });
@@ -278,7 +281,6 @@ module.exports = function(RED) {
278
281
  }
279
282
  RED.nodes.registerType("file",FileNode);
280
283
 
281
-
282
284
  function FileInNode(n) {
283
285
  // Read a file
284
286
  RED.nodes.createNode(this,n);
@@ -314,6 +316,9 @@ module.exports = function(RED) {
314
316
  node.error(err,msg);
315
317
  return done();
316
318
  } else {
319
+ if (typeof value !== 'string' && value !== null && value !== undefined) {
320
+ value = value.toString();
321
+ }
317
322
  processMsg2(msg, nodeSend, (value || "").replace(/\t|\r|\n/g,''), nodeDone);
318
323
  }
319
324
  });
@@ -0,0 +1 @@
1
+ <svg width="40" height="60" viewBox="0, 0, 40, 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" stroke="#fff"><path d="m9.7884 22.379c-5.2427-0.41732-9.6475 5.7885-7.4975 10.585 2.0949 5.2041 9.9782 6.6154 13.727 2.4477 3.633-3.5613 5.0332-9.0411 9.4821-11.853 4.5205-3.0872 11.797-0.172 12.68 5.3144 0.86 5.2537-4.8017 10.364-9.9231 8.8205-3.7873-0.85449-6.5051-4.0905-8.0487-7.4975-1.9019-3.2526-4.3882-6.7257-8.2693-7.6077-0.6891-0.15656-1.4003-0.21831-2.1059-0.21721z" stroke-width="3.3"/><path d="m6.7012 29.821h6.6154" stroke-width="1.4"/><path d="m26.988 29.821h5.5128m-2.8115-2.7564v5.5128" stroke-width="1.8"/></g></svg>
@@ -0,0 +1 @@
1
+ <svg width="40" height="60" viewBox="0, 0, 40, 60" xmlns="http://www.w3.org/2000/svg"><path d="m8.3474 17.75 22.298 22.444-10.747 13.013v-46.497l10.747 12.428-22.298 21.859" fill="none" stroke="#fff" stroke-width="4"/></svg>
@@ -0,0 +1 @@
1
+ <svg width="40" height="60" viewBox="0, 0, 40, 60" xmlns="http://www.w3.org/2000/svg"><path d="m2.7078 12.986c0 7.7994-0.36386 21.569 0 32.545s35.118 9.8751 34.848 0c-0.26959-9.8751 0-24.82 0-32.545 0-7.7243-34.848-7.7995-34.848 0z" fill="none" stroke="#fff"/><g fill="#fff"><path d="m3.8741 13.406v8.955c0.021834 3.5781 19.543 5.0789 25.575 3.2543 0 0 0.02229-2.6683 0.02998-2.6673l5.5325 0.7238c0.64508 0.0844 1.1345-0.74597 1.134-1.3284v-8.573l-0.99896 0.93349-15.217-2.2765c4.5883 2.1798 9.808 4.1312 9.808 4.1312-9.3667 3.1562-25.846-0.31965-25.864-3.1525z"/><path d="m3.886 26.607v8.1052c3.2188 6.1087 29.901 5.8574 32.272 0v-8.1052c-3.3598 4.6685-29.204 5.1534-32.272 0z"/><path d="m4.0032 39.082v7.1522c2.556 7.4622 28.918 7.6072 32.272 0v-7.1522c-3.2345 4.9471-29.087 5.359-32.272 0z"/></g></svg>
@@ -0,0 +1 @@
1
+ <svg width="40" height="60" viewBox="0, 0, 40, 60" xmlns="http://www.w3.org/2000/svg"><path d="m23.515 13.831c-4.7594-5.8789-2.6084-5.7751-7.3474 0-8.0368 10.477-8.3322 24.431 2.5476 32.935 0.13181 2.0418 0.46056 4.9803 0.46056 4.9803h1.315s0.32875-2.9219 0.46017-4.9803c2.8458-2.2339 16.799-14.619 2.5641-32.935z" fill="#fff"/></svg>
@@ -0,0 +1 @@
1
+ <svg width="40" height="60" viewBox="0, 0, 40, 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" stroke="#fff" stroke-width="3"><path d="m6 30c6 5 24 4 29-0.07"/><path d="m21 33 0.1-19c0.02-4 4-3 4-6s-4-2-4-5"/><path d="m6 22c0-11 29-10 29 0v21c0 18-29 19-29 0s4e-7 -11 0-21z"/></g></svg>
package/icons/rbe.svg ADDED
@@ -0,0 +1 @@
1
+ <svg width="40" height="60" viewBox="0, 0, 40, 60" xmlns="http://www.w3.org/2000/svg"><path d="m29 12s0.1 30 0.05 31-3 5-7 5-19 0.04-19 0.04c6-4 9-5 17-5 0 0 4-0.1 4-2 0-2 8e-3 -29 8e-3 -29z" fill="#fff"/><path d="m12 47s-0.1-30-0.05-31 3-5 7-5 19-0.04 19-0.04c-6 4-9 5-17 5 0 0-4 0.1-4 2 0 2-8e-3 29-8e-3 29z" fill="#fff"/></svg>
@@ -0,0 +1 @@
1
+ <svg width="40" height="60" viewBox="0, 0, 40, 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" stroke="#fff" stroke-width="3"><path class="cls-4" d="m17.639 30.221c-1.7087-0.88225-12.465-5.6284-14.414-6.636-1.9492-1.0075-1.9868-1.7073-0.075164-2.5188 1.9117-0.81145 12.643-5.3861 14.91-6.2738 2.2675-0.8877 3.0517-0.91493 4.9785-0.14704 1.9267 0.76789 12.026 5.1329 13.923 5.8898 1.8966 0.75699 1.9843 1.386 0.02631 2.4861-1.958 1.1001-12.1 5.6611-14.285 6.8729s-3.355 1.2091-5.0636 0.32685z"/><path class="cls-4" d="m32.23 25.251c2.8239 1.2039 4.155 1.764 4.7307 1.9938 1.8966 0.75699 1.9843 1.386 0.0263 2.4861s-12.1 5.6611-14.285 6.8729c-2.1848 1.2117-3.3548 1.209-5.0634 0.32676-1.7087-0.88225-12.465-5.6284-14.414-6.636-1.9492-1.0075-1.9868-1.7073-0.075164-2.5188 10.883-4.6196-9.1087 3.8612 4.9598-2.1076"/><path class="cls-4" d="m32.23 31.961c2.8239 1.2039 4.155 1.764 4.7307 1.9938 1.8966 0.75699 1.9843 1.386 0.0263 2.4861s-12.1 5.6611-14.285 6.8729c-2.1848 1.2117-3.3548 1.209-5.0634 0.32676-1.7087-0.88225-12.465-5.6284-14.414-6.636-1.9492-1.0075-1.9868-1.7073-0.075164-2.5188 10.883-4.6196-9.1087 3.8612 4.9598-2.1076"/></g></svg>
@@ -25,7 +25,7 @@
25
25
  <p>Wenn ein promise-Objekt aus dem Start-Code zurückgegeben wird,
26
26
  beginnt danach die reguläre Verarbeitung der Eingangsnachrichten.</p>
27
27
  <h3>Details</h3>
28
- <p>Siehe <a target="_blank" href="http://nodered.org/docs/writing-functions.html">Onlinedokumentation</a>
28
+ <p>Siehe <a target="_blank" href="https://nodered.org/docs/writing-functions.html">Onlinedokumentation</a>
29
29
  für weitere Informationen zum Schreiben von Funktionen.</p>
30
30
  <h4><b>Nachrichten senden</b></h4>
31
31
  <p>Die Funktion kann die Nachrichten zurückgeben, die sie an die nächsten Nodes im Flow weitergeben möchte,
@@ -26,7 +26,7 @@
26
26
  <p>If the On Start code returns a Promise object, the node will not start handling messages
27
27
  until the promise is resolved.</p>
28
28
  <h3>Details</h3>
29
- <p>See the <a target="_blank" href="http://nodered.org/docs/writing-functions.html">online documentation</a>
29
+ <p>See the <a target="_blank" href="https://nodered.org/docs/writing-functions.html">online documentation</a>
30
30
  for more information on writing functions.</p>
31
31
  <h4>Sending messages</h4>
32
32
  <p>The function can either return the messages it wants to pass on to the next nodes
@@ -26,7 +26,7 @@
26
26
  <p>Si le code 'Au démarrage' renvoie un objet Promise (promesse), le noeud ne commencera pas à gérer les messages
27
27
  jusqu'à ce que la promesse soit résolue.</p>
28
28
  <h3>Détails</h3>
29
- <p>Voir la <a target="_blank" href="http://nodered.org/docs/writing-functions.html">documentation en ligne</a>
29
+ <p>Voir la <a target="_blank" href="https://nodered.org/docs/writing-functions.html">documentation en ligne</a>
30
30
  pour plus d'informations sur les fonctions d'écriture.</p>
31
31
  <h4>Envoi de messages</h4>
32
32
  <p>La fonction peut envoyer les messages qu'elle souhaite transmettre aux noeuds suivants
@@ -22,7 +22,7 @@
22
22
  <p><b>初期化処理</b>タブにはノードの開始時に実行されるコードを、<b>終了処理</b>タブにはノードの終了時に実行されるコードを指定します。</p>
23
23
  <p>初期化処理タブの返却値としてPromiseオブジェクトを返却すると、入力メッセージの処理を開始する前にその完了を待ちます。</p>
24
24
  <h3>詳細</h3>
25
- <p>コードの書き方の詳細については、<a target="_blank" href="http://nodered.org/docs/writing-functions.html">オンラインドキュメント</a>を参照してください。</p>
25
+ <p>コードの書き方の詳細については、<a target="_blank" href="https://nodered.org/docs/writing-functions.html">オンラインドキュメント</a>を参照してください。</p>
26
26
  <h4>メッセージの送信</h4>
27
27
  <p>フロー内の次ノードにメッセージを渡すためには、メッセージを返却するか<code>node.send(messages)</code>を呼び出します。</p>
28
28
  <p>返却/sendの対象は次のとおりです:</p>
@@ -20,7 +20,7 @@
20
20
  <p><code>msg</code>오브젝트는<code>msg.payload</code>프로퍼티에 메시지 본체를 유지하는 것이 관례입니다.</p>
21
21
  <p>보통 코드는 메시지 오브젝트(혹은 여러 메시지 객체)를 반환합니다.후속 플로우의 실행을 정지하고 싶은 경우에는, 오브젝트를 반환하지 않아도 상관없습니다.</p>
22
22
  <h3>상세</h3>
23
- <p>코드 쓰는 방식에 대한 자세한 내용은, <a target="_blank" href="http://nodered.org/docs/writing-functions.html">공식 홈페이지</a>를 참조해 주세요.</p>
23
+ <p>코드 쓰는 방식에 대한 자세한 내용은, <a target="_blank" href="https://nodered.org/docs/writing-functions.html">공식 홈페이지</a>를 참조해 주세요.</p>
24
24
  <h4>메세지 송신</h4>
25
25
  <p>플로우 내의 다음 노드에 메세지를 전달하기 위해서는, 메세지를 반환하거나, <code>node.send(messages)</code>를 호출합니다.</p>
26
26
  <p>반환/send 대상은 다음과 같습니다:</p>
@@ -26,7 +26,7 @@
26
26
  <p>Se o código <b>On Start</b> retornar um objeto do tipo promessa, o nó não começará a tratar as mensagens
27
27
  até que a promessa seja resolvida.</p>
28
28
  <h3>Detalhes</h3>
29
- <p>Consulte a <a target="_blank" href="http://nodered.org/docs/writing-functions.html">documentação online</a>
29
+ <p>Consulte a <a target="_blank" href="https://nodered.org/docs/writing-functions.html">documentação online</a>
30
30
  para obter maiores informações sobre funções de escrita.</p>
31
31
  <h4>Enviando mensagens</h4>
32
32
  <p>A função pode retornar as mensagens que deseja passar para os próximos nós
File without changes
@@ -36,7 +36,7 @@
36
36
 
37
37
  <h3>Подробности</h3>
38
38
  <p>
39
- Смотрите <a target="_blank" href="http://nodered.org/docs/writing-functions.html">онлайн-документацию</a> для получения дополнительной информации по написанию функций.
39
+ Смотрите <a target="_blank" href="https://nodered.org/docs/writing-functions.html">онлайн-документацию</a> для получения дополнительной информации по написанию функций.
40
40
  </p>
41
41
 
42
42
  <h4>Отправка сообщений</h4>
@@ -20,7 +20,7 @@
20
20
  <p>通常,<code>msg</code>对象将消息正文保留在<code>msg.payload</code>属性中。</p>
21
21
  <p>该函数一般会返回一个消息对象(或多个消息对象),但也可以为了停止流而什么都不返回。</p>
22
22
  <h3>详细</h3>
23
- <p>请参见<a target="_blank" href="http://nodered.org/docs/writing-functions.html">在线文档</a>来获得更多有关编写函数的信息。</p>
23
+ <p>请参见<a target="_blank" href="https://nodered.org/docs/writing-functions.html">在线文档</a>来获得更多有关编写函数的信息。</p>
24
24
  <h4>传送消息</h4>
25
25
  <p>要将消息传递到流中的下一个节点,请返回消息或调用<code>node.send(messages)</code>。</p>
26
26
  <p>它将返回/send:</p>
@@ -20,7 +20,7 @@
20
20
  <p>通常,<code>msg</code>對象將消息正文保留在<code>msg.payload</code>屬性中。</p>
21
21
  <p>該函數一般會返回一個消息對象(或多個消息對象),但也可以爲了停止流程而什麽都不返回。</p>
22
22
  <h3>詳細</h3>
23
- <p>請參見<a target="_blank" href="http://nodered.org/docs/writing-functions.html">在線文檔</a>來獲得更多有關編寫函數的信息。</p>
23
+ <p>請參見<a target="_blank" href="https://nodered.org/docs/writing-functions.html">在線文檔</a>來獲得更多有關編寫函數的信息。</p>
24
24
  <h4>傳送消息</h4>
25
25
  <p>要將消息傳遞到流程中的下一個節點,請返回消息或調用<code>node.send(messages)</code>。</p>
26
26
  <p>它將返回/send:</p>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node-red/nodes",
3
- "version": "3.1.0-beta.4",
3
+ "version": "3.1.0",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -38,13 +38,13 @@
38
38
  "mqtt": "4.3.7",
39
39
  "multer": "1.4.5-lts.1",
40
40
  "mustache": "4.2.0",
41
- "node-watch": "0.7.3",
41
+ "node-watch": "0.7.4",
42
42
  "on-headers": "1.0.2",
43
43
  "raw-body": "2.5.2",
44
- "tough-cookie": "4.1.2",
44
+ "tough-cookie": "4.1.3",
45
45
  "uuid": "9.0.0",
46
46
  "ws": "7.5.6",
47
- "xml2js": "0.6.0",
47
+ "xml2js": "0.6.2",
48
48
  "iconv-lite": "0.6.3"
49
49
  }
50
50
  }
package/icons/arduino.png DELETED
Binary file
Binary file
package/icons/leveldb.png DELETED
Binary file
package/icons/mongodb.png DELETED
Binary file
package/icons/mouse.png DELETED
Binary file
package/icons/rbe.png DELETED
Binary file
package/icons/redis.png DELETED
Binary file