Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@node-red/nodes

Package Overview
Dependencies
Maintainers
2
Versions
116
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@node-red/nodes - npm Package Compare versions

Comparing version 0.20.0-beta.5 to 0.20.0

2

core/core/lib/debug/debug-utils.js

@@ -452,3 +452,3 @@ /**

if (sourceNode) {
$('<a>',{href:"#",class:"debug-message-name"}).html('node: '+(sourceNode.name||sourceNode.id))
$('<a>',{href:"#",class:"debug-message-name"}).text('node: '+(sourceNode.name||sourceNode.id))
.appendTo(metaRow)

@@ -455,0 +455,0 @@ .click(function(evt) {

@@ -36,2 +36,3 @@ /**

this.ret = n.ret || "txt";
this.authType = n.authType || "basic";
if (RED.settings.httpRequestTimeout) { this.reqTimeout = parseInt(RED.settings.httpRequestTimeout) || 120000; }

@@ -179,7 +180,25 @@ else { this.reqTimeout = 120000; }

}
if (this.credentials && this.credentials.user) {
opts.auth = {
user: this.credentials.user,
pass: this.credentials.password||""
};
if (this.credentials) {
if (this.authType === "basic") {
if (this.credentials.user) {
opts.auth = {
user: this.credentials.user,
pass: this.credentials.password || ""
};
}
} else if (this.authType === "digest") {
if (this.credentials.user) {
// The first request will be sent without auth information. Based on the 401 response, the library can determine
// which auth type is required by the server. Then the request is resubmitted with the appropriate auth header.
opts.auth = {
user: this.credentials.user,
pass: this.credentials.password || "",
sendImmediately: false
};
}
} else if (this.authType === "bearer") {
opts.auth = {
bearer: this.credentials.password || ""
};
}
}

@@ -189,24 +208,28 @@ var payload = null;

if (method !== 'GET' && method !== 'HEAD' && typeof msg.payload !== "undefined") {
if (typeof msg.payload === "string" || Buffer.isBuffer(msg.payload)) {
payload = msg.payload;
} else if (typeof msg.payload == "number") {
payload = msg.payload+"";
if (opts.headers['content-type'] == 'multipart/form-data' && typeof payload === "object") {
opts.formData = msg.payload;
} else {
if (opts.headers['content-type'] == 'application/x-www-form-urlencoded') {
payload = querystring.stringify(msg.payload);
if (typeof msg.payload === "string" || Buffer.isBuffer(msg.payload)) {
payload = msg.payload;
} else if (typeof msg.payload == "number") {
payload = msg.payload+"";
} else {
payload = JSON.stringify(msg.payload);
if (opts.headers['content-type'] == null) {
opts.headers[ctSet] = "application/json";
if (opts.headers['content-type'] == 'application/x-www-form-urlencoded') {
payload = querystring.stringify(msg.payload);
} else {
payload = JSON.stringify(msg.payload);
if (opts.headers['content-type'] == null) {
opts.headers[ctSet] = "application/json";
}
}
}
}
if (opts.headers['content-length'] == null) {
if (Buffer.isBuffer(payload)) {
opts.headers[clSet] = payload.length;
} else {
opts.headers[clSet] = Buffer.byteLength(payload);
if (opts.headers['content-length'] == null) {
if (Buffer.isBuffer(payload)) {
opts.headers[clSet] = payload.length;
} else {
opts.headers[clSet] = Buffer.byteLength(payload);
}
}
opts.body = payload;
}
opts.body = payload;
}

@@ -213,0 +236,0 @@

@@ -75,7 +75,7 @@ /**

node._clients[id] = socket;
node.emit('opened',Object.keys(node._clients).length);
node.emit('opened',{count:Object.keys(node._clients).length,id:id});
}
socket.on('open',function() {
if (!node.isServer) {
node.emit('opened','');
node.emit('opened',{count:'',id:id});
}

@@ -86,5 +86,5 @@ });

delete node._clients[id];
node.emit('closed',Object.keys(node._clients).length);
node.emit('closed',{count:Object.keys(node._clients).length,id:id});
} else {
node.emit('closed');
node.emit('closed',{count:'',id:id});
}

@@ -100,3 +100,3 @@ if (!node.closing && !node.isServer) {

socket.on('error', function(err) {
node.emit('erro');
node.emit('erro',{err:err,id:id});
if (!node.closing && !node.isServer) {

@@ -236,10 +236,26 @@ clearTimeout(node.tout);

// TODO: nls
this.serverConfig.on('opened', function(n) { node.status({fill:"green",shape:"dot",text:RED._("websocket.status.connected",{count:n})}); });
this.serverConfig.on('erro', function() { node.status({fill:"red",shape:"ring",text:"common.status.error"}); });
this.serverConfig.on('closed', function(n) {
if (n > 0) {
node.status({fill:"green",shape:"dot",text:RED._("websocket.status.connected",{count:n})});
this.serverConfig.on('opened', function(event) {
node.status({
fill:"green",shape:"dot",text:RED._("websocket.status.connected",{count:event.count}),
event:"connect",
_session: {type:"websocket",id:event.id}
});
});
this.serverConfig.on('erro', function(event) {
node.status({
fill:"red",shape:"ring",text:"common.status.error",
event:"error",
_session: {type:"websocket",id:event.id}
});
});
this.serverConfig.on('closed', function(event) {
var status;
if (event.count > 0) {
status = {fill:"green",shape:"dot",text:RED._("websocket.status.connected",{count:event.count})};
} else {
node.status({fill:"red",shape:"ring",text:"common.status.disconnected"});
status = {fill:"red",shape:"ring",text:"common.status.disconnected"};
}
status.event = "disconnect";
status._session = {type:"websocket",id:event.id}
node.status(status);
});

@@ -268,8 +284,27 @@ } else {

// TODO: nls
this.serverConfig.on('opened', function(n) { node.status({fill:"green",shape:"dot",text:RED._("websocket.status.connected",{count:n})}); });
this.serverConfig.on('erro', function() { node.status({fill:"red",shape:"ring",text:"common.status.error"}); });
this.serverConfig.on('closed', function(n) {
if (n > 0) { node.status({fill:"green",shape:"dot",text:RED._("websocket.status.connected",{count:n})}); }
else { node.status({fill:"red",shape:"ring",text:"common.status.disconnected"}); }
this.serverConfig.on('opened', function(event) {
node.status({
fill:"green",shape:"dot",text:RED._("websocket.status.connected",{count:event.count}),
event:"connect",
_session: {type:"websocket",id:event.id}
});
});
this.serverConfig.on('erro', function(event) {
node.status({
fill:"red",shape:"ring",text:"common.status.error",
event:"error",
_session: {type:"websocket",id:event.id}
})
});
this.serverConfig.on('closed', function(event) {
var status;
if (event.count > 0) {
status = {fill:"green",shape:"dot",text:RED._("websocket.status.connected",{count:event.count})};
} else {
status = {fill:"red",shape:"ring",text:"common.status.disconnected"};
}
status.event = "disconnect";
status._session = {type:"websocket",id:event.id}
node.status(status);
});
}

@@ -276,0 +311,0 @@ this.on("input", function(msg) {

@@ -161,3 +161,9 @@ /**

count++;
node.status({text:RED._("tcpin.status.connections",{count:count})});
node.status({
text:RED._("tcpin.status.connections",{count:count}),
event:"connect",
ip:socket.remoteAddress,
port:socket.remotePort,
_session: {type:"tcp",id:id}
});

@@ -213,3 +219,10 @@ var buffer = (node.datatype == 'buffer') ? Buffer.alloc(0) : "";

count--;
node.status({text:RED._("tcpin.status.connections",{count:count})});
node.status({
text:RED._("tcpin.status.connections",{count:count}),
event:"disconnect",
ip:socket.remoteAddress,
port:socket.remotePort,
_session: {type:"tcp",id:id}
});
});

@@ -216,0 +229,0 @@ socket.on('error',function(err) {

@@ -634,4 +634,3 @@ /**

group.payload[propertyKey] = property;
group.currentCount = Object.keys(group.payload).length;
//msg.topic = node.topic || msg.topic;
group.currentCount = (group.currentCount || 0) + 1;
} else if (payloadType === 'merged') {

@@ -638,0 +637,0 @@ if (Array.isArray(property) || typeof property !== 'object') {

@@ -85,3 +85,3 @@ /**

}
else if (typeof value === "object") {
else if ((typeof value === "object") || (typeof value === "boolean") || (typeof value === "number")) {
if (node.action === "" || node.action === "str") {

@@ -88,0 +88,0 @@ if (!Buffer.isBuffer(value)) {

@@ -22,3 +22,18 @@ /**

var path = require("path");
var iconv = require("iconv-lite")
function encode(data, enc) {
if (enc !== "none") {
return iconv.encode(data, enc);
}
return Buffer.from(data);
}
function decode(data, enc) {
if (enc !== "none") {
return iconv.decode(data, enc);
}
return data.toString();
}
function FileNode(n) {

@@ -30,2 +45,3 @@ RED.nodes.createNode(this,n);

this.createDir = n.createDir || false;
this.encoding = n.encoding || "none";
var node = this;

@@ -80,2 +96,3 @@ node.wstream = null;

if ((node.appendNewline) && (!Buffer.isBuffer(data))) { data += os.EOL; }
var buf = encode(data, node.encoding);
if (node.overwriteFile === "true") {

@@ -89,3 +106,3 @@ var wstream = fs.createWriteStream(filename, { encoding:'binary', flags:'w', autoClose:true });

wstream.on("open", function() {
wstream.end(data, function() {
wstream.end(buf, function() {
node.send(msg);

@@ -139,3 +156,3 @@ done();

// Static filename - write and reuse the stream next time
node.wstream.write(data, function() {
node.wstream.write(buf, function() {
node.send(msg);

@@ -146,3 +163,3 @@ done();

// Dynamic filename - write and close the stream
node.wstream.end(data, function() {
node.wstream.end(buf, function() {
node.send(msg);

@@ -230,2 +247,3 @@ delete node.wstream;

this.chunk = false;
this.encoding = n.encoding || "none";
if (n.sendError === undefined) {

@@ -270,3 +288,3 @@ this.sendError = true;

if (node.format === "lines") {
spare += chunk.toString();
spare += decode(chunk, node.encoding);
var bits = spare.split("\n");

@@ -316,3 +334,5 @@ for (var i=0; i < bits.length - 1; i++) {

if (node.chunk === false) {
if (node.format === "utf8") { msg.payload = lines.toString(); }
if (node.format === "utf8") {
msg.payload = decode(lines, node.encoding);
}
else { msg.payload = lines; }

@@ -319,0 +339,0 @@ node.send(msg);

@@ -38,3 +38,18 @@ {

"label": {
"repeat": "Repeat"
"repeat": "Repeat",
"flow": "flow context",
"global": "global context",
"str": "string",
"num": "number",
"bool": "boolean",
"json": "object",
"bin": "buffer",
"date": "timestamp",
"env": "env variable",
"object": "object",
"string": "string",
"boolean": "boolean",
"number": "number",
"Array": "Array",
"invalid": "Invalid JSON Object"
},

@@ -178,3 +193,6 @@ "timestamp": "timestamp",

"return": "Output",
"seconds": "seconds"
"seconds": "seconds",
"stdout": "stdout",
"stderr": "stderr",
"retcode": "return code"
},

@@ -229,3 +247,3 @@ "placeholder": {

"timedqueue": "Send all topics",
"milisecs": "Miliseconds",
"milisecs": "Milliseconds",
"secs": "Seconds",

@@ -386,8 +404,16 @@ "sec": "Second",

"other": "other",
"paytoqs" : "Append msg.payload as query string parameters"
"paytoqs" : "Append msg.payload as query string parameters",
"utf8String": "UTF8 string",
"binaryBuffer": "binary buffer",
"jsonObject": "parsed JSON object",
"authType": "Type",
"bearerToken": "Token"
},
"setby": "- set by msg.method -",
"basicauth": "Use basic authentication",
"basicauth": "Use authentication",
"use-tls": "Enable secure (SSL/TLS) connection",
"tls-config":"TLS Configuration",
"basic": "basic authentication",
"digest": "digest authentication",
"bearer": "bearer authentication",
"use-proxy": "Use proxy",

@@ -444,3 +470,3 @@ "proxy-config": "Proxy Configuration",

"errors": {
"connect-error": "An error occured on the ws connection: ",
"connect-error": "An error occurred on the ws connection: ",
"send-error": "An error occurred while sending: ",

@@ -841,3 +867,5 @@ "missing-conf": "Missing server configuration",

"sendError": "Send message on error (legacy mode)",
"deletelabel": "delete __file__"
"deletelabel": "delete __file__",
"utf8String": "UTF8 string",
"binaryBuffer": "binary buffer"
},

@@ -860,2 +888,17 @@ "action": {

},
"encoding": {
"none": "default",
"native": "Native",
"unicode": "Unicode",
"japanese": "Japanese",
"chinese": "Chinese",
"korean": "Korean",
"taiwan": "Taiwan/Hong Kong",
"windows": "Windows codepages",
"iso": "ISO codepages",
"ibm": "IBM codepages",
"mac": "Mac codepages",
"koi8": "KOI8 codepages",
"misc": "Miscellaneous"
},
"errors": {

@@ -862,0 +905,0 @@ "nofilename": "No filename specified",

@@ -38,5 +38,20 @@ {

"label": {
"repeat": "繰り返し"
"repeat": "繰り返し",
"flow": "フローコンテクスト",
"global": "グローバルコンテクスト",
"str": "文字列",
"num": "数値",
"bool": "真偽値",
"json": "オブジェクト",
"bin": "バッファ",
"date": "タイムスタンプ",
"env": "環境変数",
"object": "オブジェクト",
"string": "文字列",
"boolean": "真偽値",
"number": "数値",
"Array": "配列",
"invalid": "不正なJSON"
},
"timestamp": "timestamp",
"timestamp": "タイムスタンプ",
"none": "なし",

@@ -66,3 +81,3 @@ "interval": "指定した時間間隔",

"onceDelay": "秒後、以下を行う",
"tip": "<b>注釈:</b> 「指定した時間間隔、日時」と「指定した日時」はcronを使用します。<br/>「時間感覚」'には596時間より小さな値を指定します。<br/>詳細はノードの「情報」を確認してください。",
"tip": "<b>注釈:</b> 「指定した時間間隔、日時」と「指定した日時」はcronを使用します。<br/>「時間間隔」には596時間より小さな値を指定します。<br/>詳細はノードの「情報」を確認してください。",
"success": "inject処理を実行しました: __label__",

@@ -179,3 +194,6 @@ "errors": {

"return": "出力",
"seconds": "秒"
"seconds": "秒",
"stdout": "標準出力",
"stderr": "標準エラー出力",
"retcode": "返却コード"
},

@@ -386,8 +404,16 @@ "placeholder": {

"other": "その他",
"paytoqs" : "msg.payloadをクエリパラメータに追加"
"paytoqs" : "msg.payloadをクエリパラメータに追加",
"utf8String": "UTF8文字列",
"binaryBuffer": "バイナリバッファ",
"jsonObject": "JSONオブジェクト",
"authType": "種別",
"bearerToken": "トークン"
},
"setby": "- msg.methodに定義 -",
"basicauth": "ベーシック認証を使用",
"basicauth": "認証を使用",
"use-tls": "SSL/TLS接続を有効化",
"tls-config": "TLS設定",
"basic": "Basic認証",
"digest": "Digest認証",
"bearer": "Bearer認証",
"use-proxy": "プロキシを使用",

@@ -397,5 +423,5 @@ "proxy-config": "プロキシ設定",

"noproxy-hosts": "例外ホスト",
"utf8": "文字列",
"utf8": "UTF8文字列",
"binary": "バイナリバッファ",
"json": "JSON",
"json": "JSONオブジェクト",
"tip": {

@@ -839,3 +865,5 @@ "in": "URLは相対パスになります。",

"sendError": "エラーメッセージを送信(互換モード)",
"deletelabel": "delete __file__"
"deletelabel": "delete __file__",
"utf8String": "UTF8文字列",
"binaryBuffer": "バイナリバッファ"
},

@@ -858,2 +886,17 @@ "action": {

},
"encoding": {
"none": "デフォルト",
"native": "ネイティブ",
"unicode": "UNICODE",
"japanese": "日本",
"chinese": "中国",
"korean": "韓国",
"taiwan": "台湾/香港",
"windows": "Windowsコードページ",
"iso": "ISOコードページ",
"ibm": "IBMコードページ",
"mac": "Macコードページ",
"koi8": "KOI8コードページ",
"misc": "その他"
},
"errors": {

@@ -860,0 +903,0 @@ "nofilename": "ファイル名が設定されていません",

{
"name": "@node-red/nodes",
"version": "0.20.0-beta.5",
"version": "0.20.0",
"license": "Apache-2.0",

@@ -18,9 +18,9 @@ "repository": {

"dependencies": {
"ajv": "6.8.1",
"ajv": "6.10.0",
"body-parser": "1.18.3",
"cheerio": "0.22.0",
"cookie-parser": "1.4.3",
"cookie-parser": "1.4.4",
"cookie": "0.3.1",
"cors": "2.8.5",
"cron": "1.6.0",
"cron": "1.7.0",
"denque": "1.4.0",

@@ -32,3 +32,3 @@ "fs-extra": "7.0.1",

"is-utf8": "0.2.1",
"js-yaml": "3.12.1",
"js-yaml": "3.12.2",
"media-typer": "1.0.1",

@@ -38,8 +38,9 @@ "mqtt": "2.18.8",

"mustache": "3.0.1",
"on-headers": "1.0.1",
"on-headers": "1.0.2",
"raw-body": "2.3.3",
"request": "2.88.0",
"ws": "6.1.3",
"xml2js": "0.4.19"
"ws": "6.2.0",
"xml2js": "0.4.19",
"iconv-lite": "0.4.24"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc