1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Merge branch 'master' into stop-start-flows

This commit is contained in:
Stephen McLaughlin 2022-06-09 22:29:09 +01:00 committed by GitHub
commit d83516584d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 385 additions and 348 deletions

View File

@ -3,7 +3,7 @@
"label": { "label": {
"name": "Name", "name": "Name",
"ok": "Ok", "ok": "Ok",
"done":"Done", "done": "Done",
"cancel": "Cancel", "cancel": "Cancel",
"delete": "Delete", "delete": "Delete",
"close": "Close", "close": "Close",
@ -66,7 +66,7 @@
"listSubflows": "List subflows", "listSubflows": "List subflows",
"status": "Status", "status": "Status",
"enabled": "Enabled", "enabled": "Enabled",
"disabled":"Disabled", "disabled": "Disabled",
"info": "Description", "info": "Description",
"selectNodes": "Click nodes to select" "selectNodes": "Click nodes to select"
}, },
@ -114,7 +114,7 @@
"keyboardShortcuts": "Keyboard shortcuts", "keyboardShortcuts": "Keyboard shortcuts",
"login": "Login", "login": "Login",
"logout": "Logout", "logout": "Logout",
"editPalette":"Manage palette", "editPalette": "Manage palette",
"other": "Other", "other": "Other",
"showTips": "Show tips", "showTips": "Show tips",
"showWelcomeTours": "Show guided tours for new versions", "showWelcomeTours": "Show guided tours for new versions",
@ -130,19 +130,19 @@
"ungroupSelection": "Ungroup selection", "ungroupSelection": "Ungroup selection",
"groupMergeSelection": "Merge selection", "groupMergeSelection": "Merge selection",
"groupRemoveSelection": "Remove from group", "groupRemoveSelection": "Remove from group",
"arrange":"Arrange", "arrange": "Arrange",
"alignLeft":"Align to left", "alignLeft": "Align to left",
"alignCenter":"Align to center", "alignCenter": "Align to center",
"alignRight":"Align to right", "alignRight": "Align to right",
"alignTop":"Align to top", "alignTop": "Align to top",
"alignMiddle":"Align to middle", "alignMiddle": "Align to middle",
"alignBottom":"Align to bottom", "alignBottom": "Align to bottom",
"distributeHorizontally":"Distribute horizontally", "distributeHorizontally": "Distribute horizontally",
"distributeVertically":"Distribute vertically", "distributeVertically": "Distribute vertically",
"moveToBack":"Move to back", "moveToBack": "Move to back",
"moveToFront":"Move to front", "moveToFront": "Move to front",
"moveBackwards":"Move backwards", "moveBackwards": "Move backwards",
"moveForwards":"Move forwards" "moveForwards": "Move forwards"
} }
}, },
"actions": { "actions": {
@ -176,10 +176,10 @@
"nodeActionDisabledSubflow": "node actions disabled within subflow", "nodeActionDisabledSubflow": "node actions disabled within subflow",
"missing-types": "<p>Flows stopped due to missing node types.</p>", "missing-types": "<p>Flows stopped due to missing node types.</p>",
"missing-modules": "<p>Flows stopped due to missing modules.</p>", "missing-modules": "<p>Flows stopped due to missing modules.</p>",
"safe-mode":"<p>Flows stopped in safe mode.</p><p>You can modify your flows and deploy the changes to restart.</p>", "safe-mode": "<p>Flows stopped in safe mode.</p><p>You can modify your flows and deploy the changes to restart.</p>",
"restartRequired": "Node-RED must be restarted to enable upgraded modules", "restartRequired": "Node-RED must be restarted to enable upgraded modules",
"credentials_load_failed": "<p>Flows stopped as the credentials could not be decrypted.</p><p>The flow credential file is encrypted, but the project's encryption key is missing or invalid.</p>", "credentials_load_failed": "<p>Flows stopped as the credentials could not be decrypted.</p><p>The flow credential file is encrypted, but the project's encryption key is missing or invalid.</p>",
"credentials_load_failed_reset":"<p>Credentials could not be decrypted</p><p>The flow credential file is encrypted, but the project's encryption key is missing or invalid.</p><p>The flow credential file will be reset on the next deployment. Any existing flow credentials will be cleared.</p>", "credentials_load_failed_reset": "<p>Credentials could not be decrypted</p><p>The flow credential file is encrypted, but the project's encryption key is missing or invalid.</p><p>The flow credential file will be reset on the next deployment. Any existing flow credentials will be cleared.</p>",
"missing_flow_file": "<p>Project flow file not found.</p><p>The project is not configured with a flow file.</p>", "missing_flow_file": "<p>Project flow file not found.</p><p>The project is not configured with a flow file.</p>",
"missing_package_file": "<p>Project package file not found.</p><p>The project is missing a package.json file.</p>", "missing_package_file": "<p>Project package file not found.</p><p>The project is missing a package.json file.</p>",
"project_empty": "<p>The project is empty.</p><p>Do you want to create a default set of project files?<br/>Otherwise, you will have to manually add files to the project outside of the editor.</p>", "project_empty": "<p>The project is empty.</p><p>Do you want to create a default set of project files?<br/>Otherwise, you will have to manually add files to the project outside of the editor.</p>",
@ -257,11 +257,11 @@
"recoveredNodesInfo": "The nodes on this flow were missing a valid flow id when they were imported. They have been added to this flow so you can either restore or delete them.", "recoveredNodesInfo": "The nodes on this flow were missing a valid flow id when they were imported. They have been added to this flow so you can either restore or delete them.",
"recoveredNodesNotification": "<p>Imported nodes without a valid flow id</p><p>They have been added to a new flow called '__flowName__'.</p>", "recoveredNodesNotification": "<p>Imported nodes without a valid flow id</p><p>They have been added to a new flow called '__flowName__'.</p>",
"export": { "export": {
"selected":"selected nodes", "selected": "selected nodes",
"current":"current flow", "current": "current flow",
"all":"all flows", "all": "all flows",
"compact":"compact", "compact": "compact",
"formatted":"formatted", "formatted": "formatted",
"copy": "Copy to clipboard", "copy": "Copy to clipboard",
"export": "Export to library", "export": "Export to library",
"exportAs": "Export as", "exportAs": "Export as",
@ -301,10 +301,10 @@
"successfulDeploy": "Successfully deployed", "successfulDeploy": "Successfully deployed",
"successfulRestart": "Successfully restarted flows", "successfulRestart": "Successfully restarted flows",
"deployFailed": "Deploy failed: __message__", "deployFailed": "Deploy failed: __message__",
"unusedConfigNodes":"You have some unused configuration nodes.", "unusedConfigNodes": "You have some unused configuration nodes.",
"unusedConfigNodesButton":"Search unused config nodes", "unusedConfigNodesButton": "Search unused config nodes",
"unknownNodesButton":"Search for unknown nodes", "unknownNodesButton": "Search for unknown nodes",
"invalidNodesButton":"Search for invalid nodes", "invalidNodesButton": "Search for invalid nodes",
"errors": { "errors": {
"noResponse": "no response from server" "noResponse": "no response from server"
}, },
@ -351,8 +351,8 @@
}, },
"nodeCount": "__count__ node", "nodeCount": "__count__ node",
"nodeCount_plural": "__count__ nodes", "nodeCount_plural": "__count__ nodes",
"local":"Local changes", "local": "Local changes",
"remote":"Remote changes", "remote": "Remote changes",
"reviewChanges": "Review Changes", "reviewChanges": "Review Changes",
"noBinaryFileShowed": "Cannot show binary file contents", "noBinaryFileShowed": "Cannot show binary file contents",
"viewCommitDiff": "View Commit Changes", "viewCommitDiff": "View Commit Changes",
@ -436,7 +436,7 @@
"inputType": "Input type", "inputType": "Input type",
"selectType": "select types...", "selectType": "select types...",
"loadCredentials": "Loading node credentials", "loadCredentials": "Loading node credentials",
"inputs" : { "inputs": {
"input": "input", "input": "input",
"select": "select", "select": "select",
"checkbox": "checkbox", "checkbox": "checkbox",
@ -617,19 +617,19 @@
}, },
"confirm": { "confirm": {
"install": { "install": {
"body":"<p>Installing '__module__'</p><p>Before installing, please read the node's documentation. Some nodes have dependencies that cannot be automatically resolved and can require a restart of Node-RED.</p>", "body": "<p>Installing '__module__'</p><p>Before installing, please read the node's documentation. Some nodes have dependencies that cannot be automatically resolved and can require a restart of Node-RED.</p>",
"title": "Install nodes" "title": "Install nodes"
}, },
"remove": { "remove": {
"body":"<p>Removing '__module__'</p><p>Removing the node will uninstall it from Node-RED. The node may continue to use resources until Node-RED is restarted.</p>", "body": "<p>Removing '__module__'</p><p>Removing the node will uninstall it from Node-RED. The node may continue to use resources until Node-RED is restarted.</p>",
"title": "Remove nodes" "title": "Remove nodes"
}, },
"update": { "update": {
"body":"<p>Updating '__module__'</p><p>Updating the node will require a restart of Node-RED to complete the update. This must be done manually.</p>", "body": "<p>Updating '__module__'</p><p>Updating the node will require a restart of Node-RED to complete the update. This must be done manually.</p>",
"title": "Update nodes" "title": "Update nodes"
}, },
"cannotUpdate": { "cannotUpdate": {
"body":"An update for this node is available, but it is not installed in a location that the palette manager can update.<br/><br/>Please refer to the documentation for how to update this node." "body": "An update for this node is available, but it is not installed in a location that the palette manager can update.<br/><br/>Please refer to the documentation for how to update this node."
}, },
"button": { "button": {
"review": "Open node information", "review": "Open node information",
@ -663,14 +663,14 @@
"showMore": "show more", "showMore": "show more",
"showLess": "show less", "showLess": "show less",
"flow": "Flow", "flow": "Flow",
"selection":"Selection", "selection": "Selection",
"nodes":"__count__ nodes", "nodes": "__count__ nodes",
"flowDesc": "Flow Description", "flowDesc": "Flow Description",
"subflowDesc": "Subflow Description", "subflowDesc": "Subflow Description",
"nodeHelp": "Node Help", "nodeHelp": "Node Help",
"none":"None", "none": "None",
"arrayItems": "__count__ items", "arrayItems": "__count__ items",
"showTips":"You can open the tips from the settings panel", "showTips": "You can open the tips from the settings panel",
"outline": "Outline", "outline": "Outline",
"empty": "empty", "empty": "empty",
"globalConfig": "Global Configuration Nodes", "globalConfig": "Global Configuration Nodes",
@ -701,8 +701,8 @@
"filtered": "__count__ hidden" "filtered": "__count__ hidden"
}, },
"context": { "context": {
"name":"Context Data", "name": "Context Data",
"label":"context", "label": "context",
"none": "none selected", "none": "none selected",
"refresh": "refresh to load", "refresh": "refresh to load",
"empty": "empty", "empty": "empty",
@ -740,9 +740,9 @@
"files": "Files", "files": "Files",
"flow": "Flow", "flow": "Flow",
"credentials": "Credentials", "credentials": "Credentials",
"package":"Package", "package": "Package",
"packageCreate":"File will be created when changes are saved", "packageCreate": "File will be created when changes are saved",
"fileNotExist":"File does not exist", "fileNotExist": "File does not exist",
"selectFile": "Select File", "selectFile": "Select File",
"invalidEncryptionKey": "Invalid encryption key", "invalidEncryptionKey": "Invalid encryption key",
"encryptionEnabled": "Encryption enabled", "encryptionEnabled": "Encryption enabled",
@ -978,7 +978,7 @@
"title": "Buffer editor", "title": "Buffer editor",
"modeString": "Handle as UTF-8 String", "modeString": "Handle as UTF-8 String",
"modeArray": "Handle as JSON array", "modeArray": "Handle as JSON array",
"modeDesc":"<h3>Buffer editor</h3><p>The Buffer type is stored as a JSON array of byte values. The editor will attempt to parse the entered value as a JSON array. If it is not valid JSON, it will be treated as a UTF-8 String and converted to an array of the individual character code points.</p><p>For example, a value of <code>Hello World</code> will be converted to the JSON array:<pre>[72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100]</pre></p>" "modeDesc": "<h3>Buffer editor</h3><p>The Buffer type is stored as a JSON array of byte values. The editor will attempt to parse the entered value as a JSON array. If it is not valid JSON, it will be treated as a UTF-8 String and converted to an array of the individual character code points.</p><p>For example, a value of <code>Hello World</code> will be converted to the JSON array:<pre>[72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100]</pre></p>"
}, },
"projects": { "projects": {
"config-git": "Configure Git client", "config-git": "Configure Git client",
@ -1140,7 +1140,7 @@
"no-empty": "Cannot create default file set on a non-empty project", "no-empty": "Cannot create default file set on a non-empty project",
"git-error": "git error" "git-error": "git error"
}, },
"errors" : { "errors": {
"no-username-email": "Your Git client is not configured with a username/email.", "no-username-email": "Your Git client is not configured with a username/email.",
"unexpected": "An unexpected error occurred", "unexpected": "An unexpected error occurred",
"code": "code" "code": "code"
@ -1163,7 +1163,7 @@
"diagnostics": { "diagnostics": {
"title": "System Info" "title": "System Info"
}, },
"languages" : { "languages": {
"de": "German", "de": "German",
"en-US": "English", "en-US": "English",
"ja": "Japanese", "ja": "Japanese",

View File

@ -1,23 +1,23 @@
{ {
"info": { "info": {
"tip0" : "You can remove the selected nodes or links with {{core:delete-selection}}", "tip0": "You can remove the selected nodes or links with {{core:delete-selection}}",
"tip1" : "Search for nodes using {{core:search}}", "tip1": "Search for nodes using {{core:search}}",
"tip2" : "{{core:toggle-sidebar}} will toggle the view of this sidebar", "tip2": "{{core:toggle-sidebar}} will toggle the view of this sidebar",
"tip3" : "You can manage your palette of nodes with {{core:manage-palette}}", "tip3": "You can manage your palette of nodes with {{core:manage-palette}}",
"tip4" : "Your flow configuration nodes are listed in the sidebar panel. It can be accessed from the menu or with {{core:show-config-tab}}", "tip4": "Your flow configuration nodes are listed in the sidebar panel. It can be accessed from the menu or with {{core:show-config-tab}}",
"tip5" : "Enable or disable these tips from the option in the settings", "tip5": "Enable or disable these tips from the option in the settings",
"tip6" : "Move the selected nodes using the [left] [up] [down] and [right] keys. Hold [shift] to nudge them further", "tip6": "Move the selected nodes using the [left] [up] [down] and [right] keys. Hold [shift] to nudge them further",
"tip7" : "Dragging a node onto a wire will splice it into the link", "tip7": "Dragging a node onto a wire will splice it into the link",
"tip8" : "Export the selected nodes, or the current tab with {{core:show-export-dialog}}", "tip8": "Export the selected nodes, or the current tab with {{core:show-export-dialog}}",
"tip9" : "Import a flow by dragging its JSON into the editor, or with {{core:show-import-dialog}}", "tip9": "Import a flow by dragging its JSON into the editor, or with {{core:show-import-dialog}}",
"tip10" : "[shift] [click] and drag on a node port to move all of the attached wires or just the selected one", "tip10": "[shift] [click] and drag on a node port to move all of the attached wires or just the selected one",
"tip11" : "Show the Info tab with {{core:show-info-tab}} or the Debug tab with {{core:show-debug-tab}}", "tip11": "Show the Info tab with {{core:show-info-tab}} or the Debug tab with {{core:show-debug-tab}}",
"tip12" : "[ctrl] [click] in the workspace to open the quick-add dialog", "tip12": "[ctrl] [click] in the workspace to open the quick-add dialog",
"tip13" : "Hold down [ctrl] when you [click] on a node port to enable quick-wiring", "tip13": "Hold down [ctrl] when you [click] on a node port to enable quick-wiring",
"tip14" : "Hold down [shift] when you [click] on a node to also select all of its connected nodes", "tip14": "Hold down [shift] when you [click] on a node to also select all of its connected nodes",
"tip15" : "Hold down [ctrl] when you [click] on a node to add or remove it from the current selection", "tip15": "Hold down [ctrl] when you [click] on a node to add or remove it from the current selection",
"tip16" : "Switch flow tabs with {{core:show-previous-tab}} and {{core:show-next-tab}}", "tip16": "Switch flow tabs with {{core:show-previous-tab}} and {{core:show-next-tab}}",
"tip17" : "You can confirm your changes in the node edit tray with {{core:confirm-edit-tray}} or cancel them with {{core:cancel-edit-tray}}", "tip17": "You can confirm your changes in the node edit tray with {{core:confirm-edit-tray}} or cancel them with {{core:cancel-edit-tray}}",
"tip18" : "Pressing {{core:edit-selected-node}} will edit the first node in the current selection" "tip18": "Pressing {{core:edit-selected-node}} will edit the first node in the current selection"
} }
} }

View File

@ -52,52 +52,52 @@
"desc": "Finds occurrences of `pattern` within `str` and replaces them with `replacement`.\n\nThe optional `limit` parameter is the maximum number of replacements." "desc": "Finds occurrences of `pattern` within `str` and replaces them with `replacement`.\n\nThe optional `limit` parameter is the maximum number of replacements."
}, },
"$now": { "$now": {
"args":"$[picture [, timezone]]", "args": "$[picture [, timezone]]",
"desc":"Generates a timestamp in ISO 8601 compatible format and returns it as a string. If the optional picture and timezone parameters are supplied, then the current timestamp is formatted as described by the `$fromMillis()` function" "desc": "Generates a timestamp in ISO 8601 compatible format and returns it as a string. If the optional picture and timezone parameters are supplied, then the current timestamp is formatted as described by the `$fromMillis()` function"
}, },
"$base64encode": { "$base64encode": {
"args":"string", "args": "string",
"desc":"Converts an ASCII string to a base 64 representation. Each character in the string is treated as a byte of binary data. This requires that all characters in the string are in the 0x00 to 0xFF range, which includes all characters in URI encoded strings. Unicode characters outside of that range are not supported." "desc": "Converts an ASCII string to a base 64 representation. Each character in the string is treated as a byte of binary data. This requires that all characters in the string are in the 0x00 to 0xFF range, which includes all characters in URI encoded strings. Unicode characters outside of that range are not supported."
}, },
"$base64decode": { "$base64decode": {
"args":"string", "args": "string",
"desc":"Converts base 64 encoded bytes to a string, using a UTF-8 Unicode codepage." "desc": "Converts base 64 encoded bytes to a string, using a UTF-8 Unicode codepage."
}, },
"$number": { "$number": {
"args": "arg", "args": "arg",
"desc": "Casts the `arg` parameter to a number using the following casting rules:\n\n - Numbers are unchanged\n - Strings that contain a sequence of characters that represent a legal JSON number are converted to that number\n - All other values cause an error to be thrown." "desc": "Casts the `arg` parameter to a number using the following casting rules:\n\n - Numbers are unchanged\n - Strings that contain a sequence of characters that represent a legal JSON number are converted to that number\n - All other values cause an error to be thrown."
}, },
"$abs": { "$abs": {
"args":"number", "args": "number",
"desc":"Returns the absolute value of the `number` parameter." "desc": "Returns the absolute value of the `number` parameter."
}, },
"$floor": { "$floor": {
"args":"number", "args": "number",
"desc":"Returns the value of `number` rounded down to the nearest integer that is smaller or equal to `number`." "desc": "Returns the value of `number` rounded down to the nearest integer that is smaller or equal to `number`."
}, },
"$ceil": { "$ceil": {
"args":"number", "args": "number",
"desc":"Returns the value of `number` rounded up to the nearest integer that is greater than or equal to `number`." "desc": "Returns the value of `number` rounded up to the nearest integer that is greater than or equal to `number`."
}, },
"$round": { "$round": {
"args":"number [, precision]", "args": "number [, precision]",
"desc":"Returns the value of the `number` parameter rounded to the number of decimal places specified by the optional `precision` parameter." "desc": "Returns the value of the `number` parameter rounded to the number of decimal places specified by the optional `precision` parameter."
}, },
"$power": { "$power": {
"args":"base, exponent", "args": "base, exponent",
"desc":"Returns the value of `base` raised to the power of `exponent`." "desc": "Returns the value of `base` raised to the power of `exponent`."
}, },
"$sqrt": { "$sqrt": {
"args":"number", "args": "number",
"desc":"Returns the square root of the value of the `number` parameter." "desc": "Returns the square root of the value of the `number` parameter."
}, },
"$random": { "$random": {
"args":"", "args": "",
"desc":"Returns a pseudo random number greater than or equal to zero and less than one." "desc": "Returns a pseudo random number greater than or equal to zero and less than one."
}, },
"$millis": { "$millis": {
"args":"", "args": "",
"desc":"Returns the number of milliseconds since the Unix Epoch (1 January, 1970 UTC) as a number. All invocations of `$millis()` within an evaluation of an expression will all return the same value." "desc": "Returns the number of milliseconds since the Unix Epoch (1 January, 1970 UTC) as a number. All invocations of `$millis()` within an evaluation of an expression will all return the same value."
}, },
"$sum": { "$sum": {
"args": "array", "args": "array",
@ -136,20 +136,20 @@
"desc": "Appends two arrays" "desc": "Appends two arrays"
}, },
"$sort": { "$sort": {
"args":"array [, function]", "args": "array [, function]",
"desc":"Returns an array containing all the values in the `array` parameter, but sorted into order.\n\nIf a comparator `function` is supplied, then it must be a function that takes two parameters:\n\n`function(left, right)`\n\nThis function gets invoked by the sorting algorithm to compare two values left and right. If the value of left should be placed after the value of right in the desired sort order, then the function must return Boolean `true` to indicate a swap. Otherwise it must return `false`." "desc": "Returns an array containing all the values in the `array` parameter, but sorted into order.\n\nIf a comparator `function` is supplied, then it must be a function that takes two parameters:\n\n`function(left, right)`\n\nThis function gets invoked by the sorting algorithm to compare two values left and right. If the value of left should be placed after the value of right in the desired sort order, then the function must return Boolean `true` to indicate a swap. Otherwise it must return `false`."
}, },
"$reverse": { "$reverse": {
"args":"array", "args": "array",
"desc":"Returns an array containing all the values from the `array` parameter, but in reverse order." "desc": "Returns an array containing all the values from the `array` parameter, but in reverse order."
}, },
"$shuffle": { "$shuffle": {
"args":"array", "args": "array",
"desc":"Returns an array containing all the values from the `array` parameter, but shuffled into random order." "desc": "Returns an array containing all the values from the `array` parameter, but shuffled into random order."
}, },
"$zip": { "$zip": {
"args":"array, ...", "args": "array, ...",
"desc":"Returns a convolved (zipped) array containing grouped arrays of values from the `array1` … `arrayN` arguments from index 0, 1, 2...." "desc": "Returns a convolved (zipped) array containing grouped arrays of values from the `array1` … `arrayN` arguments from index 0, 1, 2...."
}, },
"$keys": { "$keys": {
"args": "object", "args": "object",
@ -168,24 +168,24 @@
"desc": "Merges an array of `objects` into a single `object` containing all the key/value pairs from each of the objects in the input array. If any of the input objects contain the same key, then the returned `object` will contain the value of the last one in the array. It is an error if the input array contains an item that is not an object." "desc": "Merges an array of `objects` into a single `object` containing all the key/value pairs from each of the objects in the input array. If any of the input objects contain the same key, then the returned `object` will contain the value of the last one in the array. It is an error if the input array contains an item that is not an object."
}, },
"$sift": { "$sift": {
"args":"object, function", "args": "object, function",
"desc":"Returns an object that contains only the key/value pairs from the `object` parameter that satisfy the predicate `function` passed in as the second parameter.\n\nThe `function` that is supplied as the second parameter must have the following signature:\n\n`function(value [, key [, object]])`" "desc": "Returns an object that contains only the key/value pairs from the `object` parameter that satisfy the predicate `function` passed in as the second parameter.\n\nThe `function` that is supplied as the second parameter must have the following signature:\n\n`function(value [, key [, object]])`"
}, },
"$each": { "$each": {
"args":"object, function", "args": "object, function",
"desc":"Returns an array containing the values return by the `function` when applied to each key/value pair in the `object`." "desc": "Returns an array containing the values return by the `function` when applied to each key/value pair in the `object`."
}, },
"$map": { "$map": {
"args":"array, function", "args": "array, function",
"desc":"Returns an array containing the results of applying the `function` parameter to each value in the `array` parameter.\n\nThe `function` that is supplied as the second parameter must have the following signature:\n\n`function(value [, index [, array]])`" "desc": "Returns an array containing the results of applying the `function` parameter to each value in the `array` parameter.\n\nThe `function` that is supplied as the second parameter must have the following signature:\n\n`function(value [, index [, array]])`"
}, },
"$filter": { "$filter": {
"args":"array, function", "args": "array, function",
"desc":"Returns an array containing only the values in the `array` parameter that satisfy the `function` predicate.\n\nThe `function` that is supplied as the second parameter must have the following signature:\n\n`function(value [, index [, array]])`" "desc": "Returns an array containing only the values in the `array` parameter that satisfy the `function` predicate.\n\nThe `function` that is supplied as the second parameter must have the following signature:\n\n`function(value [, index [, array]])`"
}, },
"$reduce": { "$reduce": {
"args":"array, function [, init]", "args": "array, function [, init]",
"desc":"Returns an aggregated value derived from applying the `function` parameter successively to each value in `array` in combination with the result of the previous application of the function.\n\nThe function must accept two arguments, and behaves like an infix operator between each value within the `array`. The signature of `function` must be of the form: `myfunc($accumulator, $value[, $index[, $array]])`\n\nThe optional `init` parameter is used as the initial value in the aggregation." "desc": "Returns an aggregated value derived from applying the `function` parameter successively to each value in `array` in combination with the result of the previous application of the function.\n\nThe function must accept two arguments, and behaves like an infix operator between each value within the `array`. The signature of `function` must be of the form: `myfunc($accumulator, $value[, $index[, $array]])`\n\nThe optional `init` parameter is used as the initial value in the aggregation."
}, },
"$flowContext": { "$flowContext": {
"args": "string[, string]", "args": "string[, string]",

View File

@ -907,7 +907,8 @@
"uknownNodes": "未知のノード", "uknownNodes": "未知のノード",
"unusedSubflows": "未使用のサブフロー", "unusedSubflows": "未使用のサブフロー",
"hiddenFlows": "非表示のフロー", "hiddenFlows": "非表示のフロー",
"modifiedNodes": "修正したノードやフロー" "modifiedNodes": "修正したノードやフロー",
"thisFlow": "現在のフロー"
} }
}, },
"expressionEditor": { "expressionEditor": {

View File

@ -17,7 +17,7 @@
"tip14": "[shift] を押しながらノードを [click] すると、接続された全てのノードを選択できます。", "tip14": "[shift] を押しながらノードを [click] すると、接続された全てのノードを選択できます。",
"tip15": "[ctrl] を押しながらノードを [click] すると、選択/非選択を切り替えできます。", "tip15": "[ctrl] を押しながらノードを [click] すると、選択/非選択を切り替えできます。",
"tip16": "{{core:show-previous-tab}} や {{core:show-next-tab}} で、タブの切り替えができます。", "tip16": "{{core:show-previous-tab}} や {{core:show-next-tab}} で、タブの切り替えができます。",
"tip17": "ノードのプロティ設定画面にて {{core:confirm-edit-tray}} を押すと、変更を確定できます。また、 {{core:cancel-edit-tray}} を押すと、変更を取り消せます。", "tip17": "ノードのプロティ設定画面にて {{core:confirm-edit-tray}} を押すと、変更を確定できます。また、 {{core:cancel-edit-tray}} を押すと、変更を取り消せます。",
"tip18": "ノードを選択し、 {{core:edit-selected-node}} を押すとプロパティ設定画面が表示されます。" "tip18": "ノードを選択し、 {{core:edit-selected-node}} を押すとプロパティ設定画面が表示されます。"
} }
} }

View File

@ -363,14 +363,22 @@ RED.library = (function() {
options.onconfirm(item); options.onconfirm(item);
} }
}); });
var itemTools = $("<div>").css({position: "absolute",bottom:"6px",right:"8px"}); var itemTools = null;
if (options.folderTools) {
dirList.on('treelistselect', function(event, item) {
if (item.writable !== false && item.treeList) {
if (itemTools) {
itemTools.remove();
}
itemTools = $("<div>").css({position: "absolute",bottom:"6px",right:"8px"});
var menuButton = $('<button class="red-ui-button red-ui-button-small" type="button"><i class="fa fa-ellipsis-h"></i></button>') var menuButton = $('<button class="red-ui-button red-ui-button-small" type="button"><i class="fa fa-ellipsis-h"></i></button>')
.on("click", function(evt) { .on("click", function(evt) {
evt.preventDefault(); evt.preventDefault();
evt.stopPropagation(); evt.stopPropagation();
var elementPos = menuButton.offset(); var elementPos = menuButton.offset();
var menuOptionMenu = RED.menu.init({id:"red-ui-library-browser-menu", var menuOptionMenu
= RED.menu.init({id:"red-ui-library-browser-menu",
options: [ options: [
{id:"red-ui-library-browser-menu-addFolder",label:RED._("library.newFolder"), onselect: function() { {id:"red-ui-library-browser-menu-addFolder",label:RED._("library.newFolder"), onselect: function() {
var defaultFolderName = "new-folder"; var defaultFolderName = "new-folder";
@ -460,9 +468,7 @@ RED.library = (function() {
}).show(); }).show();
}).appendTo(itemTools); }).appendTo(itemTools);
if (options.folderTools) {
dirList.on('treelistselect', function(event, item) {
if (item.writable !== false && item.treeList) {
itemTools.appendTo(item.treeList.label); itemTools.appendTo(item.treeList.label);
} }
}); });

View File

@ -526,6 +526,23 @@ RED.view = (function() {
nn.x = mousePos[0]; nn.x = mousePos[0];
nn.y = mousePos[1]; nn.y = mousePos[1];
var minX = nn.w/2 -5;
if (nn.x < minX) {
nn.x = minX;
}
var minY = nn.h/2 -5;
if (nn.y < minY) {
nn.y = minY;
}
var maxX = space_width -nn.w/2 +5;
if (nn.x > maxX) {
nn.x = maxX;
}
var maxY = space_height -nn.h +5;
if (nn.y > maxY) {
nn.y = maxY;
}
if (snapGrid) { if (snapGrid) {
var gridOffset = RED.view.tools.calculateGridSnapOffsets(nn); var gridOffset = RED.view.tools.calculateGridSnapOffsets(nn);
nn.x -= gridOffset.x; nn.x -= gridOffset.x;

View File

@ -131,6 +131,7 @@
width: 120px; width: 120px;
background-size: contain; background-size: contain;
position: relative; position: relative;
z-index: 4;
&:not(.red-ui-palette-node-config):not(.red-ui-palette-node-small):first-child { &:not(.red-ui-palette-node-config):not(.red-ui-palette-node-small):first-child {
margin-top: 15px; margin-top: 15px;
} }

View File

@ -109,9 +109,10 @@ module.exports = function(RED) {
if (!property) return; if (!property) return;
if (valueType === "jsonata") { if (valueType === "jsonata") {
if (p.exp) { if (p.v) {
try { try {
var val = RED.util.evaluateJSONataExpression(p.exp, msg); var exp = RED.util.prepareJSONataExpression(p.v, node);
var val = RED.util.evaluateJSONataExpression(exp, msg);
RED.util.setMessageProperty(msg, property, val, true); RED.util.setMessageProperty(msg, property, val, true);
} }
catch (err) { catch (err) {

View File

@ -237,7 +237,7 @@
}).text(label).appendTo(encSel); }).text(label).appendTo(encSel);
$("#node-input-filename").typedInput({ $("#node-input-filename").typedInput({
default: "msg", default: "msg",
types:[{ value: "str", label:"", icon:"red/images/typedInput/az.svg"}, "msg", "jsonata", "env"], types: ["str", "msg", "jsonata", "env"],
typeField: $("#node-input-filenameType") typeField: $("#node-input-filenameType")
}); });
if(typeof node.filenameType == 'undefined') { if(typeof node.filenameType == 'undefined') {
@ -342,7 +342,7 @@
}).text(label).appendTo(encSel); }).text(label).appendTo(encSel);
$("#node-input-filename").typedInput({ $("#node-input-filename").typedInput({
default: "msg", default: "msg",
types:[{ value: "str", label:"", icon:"red/images/typedInput/az.svg"}, "msg", "jsonata", "env"], types: ["str", "msg", "jsonata", "env"],
typeField: $("#node-input-filenameType") typeField: $("#node-input-filenameType")
}); });
if(typeof node.filenameType == 'undefined') { if(typeof node.filenameType == 'undefined') {

136
packages/node_modules/@node-red/nodes/locales/en-US/messages.json vendored Executable file → Normal file
View File

@ -194,17 +194,17 @@
"key": "Private Key", "key": "Private Key",
"passphrase": "Passphrase", "passphrase": "Passphrase",
"ca": "CA Certificate", "ca": "CA Certificate",
"verify-server-cert":"Verify server certificate", "verify-server-cert": "Verify server certificate",
"servername": "Server Name", "servername": "Server Name",
"alpnprotocol": "ALPN Protocol" "alpnprotocol": "ALPN Protocol"
}, },
"placeholder": { "placeholder": {
"cert":"path to certificate (PEM format)", "cert": "path to certificate (PEM format)",
"key":"path to private key (PEM format)", "key": "path to private key (PEM format)",
"ca":"path to CA certificate (PEM format)", "ca": "path to CA certificate (PEM format)",
"passphrase":"private key passphrase (optional)", "passphrase": "private key passphrase (optional)",
"servername":"for use with SNI", "servername": "for use with SNI",
"alpnprotocol":"for use with ALPN" "alpnprotocol": "for use with ALPN"
}, },
"error": { "error": {
"missing-file": "No certificate/key file provided", "missing-file": "No certificate/key file provided",
@ -263,8 +263,8 @@
"moduleLoadError": "Failed to load module __module__: __error__", "moduleLoadError": "Failed to load module __module__: __error__",
"moduleNameError": "Invalid module variable name: __name__", "moduleNameError": "Invalid module variable name: __name__",
"moduleNameReserved": "Reserved variable name: __name__", "moduleNameReserved": "Reserved variable name: __name__",
"inputListener":"Cannot add listener to 'input' event within Function", "inputListener": "Cannot add listener to 'input' event within Function",
"non-message-returned":"Function tried to send a message of type __type__", "non-message-returned": "Function tried to send a message of type __type__",
"invalid-js": "Error in JavaScript code", "invalid-js": "Error in JavaScript code",
"missing-module": "Module __module__ missing" "missing-module": "Module __module__ missing"
} }
@ -323,27 +323,27 @@
"rate": "rate", "rate": "rate",
"random-first": "first random value", "random-first": "first random value",
"random-last": "last random value", "random-last": "last random value",
"units" : { "units": {
"second": { "second": {
"plural" : "Seconds", "plural": "Seconds",
"singular": "Second" "singular": "Second"
}, },
"minute": { "minute": {
"plural" : "Minutes", "plural": "Minutes",
"singular": "Minute" "singular": "Minute"
}, },
"hour": { "hour": {
"plural" : "Hours", "plural": "Hours",
"singular": "Hour" "singular": "Hour"
}, },
"day": { "day": {
"plural" : "Days", "plural": "Days",
"singular": "Day" "singular": "Day"
} }
} }
}, },
"errors": { "errors": {
"too-many" : "too many pending messages in delay node", "too-many": "too many pending messages in delay node",
"invalid-timeout": "Invalid delay value", "invalid-timeout": "Invalid delay value",
"invalid-rate": "Invalid rate value", "invalid-rate": "Invalid rate value",
"invalid-rate-unit": "Invalid rate unit value", "invalid-rate-unit": "Invalid rate unit value",
@ -383,8 +383,8 @@
"trigger-block": "trigger & block", "trigger-block": "trigger & block",
"trigger-loop": "resend every", "trigger-loop": "resend every",
"reset": "Reset the trigger if:", "reset": "Reset the trigger if:",
"resetMessage":"msg.reset is set", "resetMessage": "msg.reset is set",
"resetPayload":"msg.payload equals", "resetPayload": "msg.payload equals",
"resetprompt": "optional", "resetprompt": "optional",
"duration": "duration", "duration": "duration",
"topic": "topic" "topic": "topic"
@ -412,8 +412,8 @@
"cleansession": "Use clean session", "cleansession": "Use clean session",
"cleanstart": "Use clean start", "cleanstart": "Use clean start",
"use-tls": "Use TLS", "use-tls": "Use TLS",
"tls-config":"TLS Configuration", "tls-config": "TLS Configuration",
"verify-server-cert":"Verify server certificate", "verify-server-cert": "Verify server certificate",
"compatmode": "Use legacy MQTT 3.1 support", "compatmode": "Use legacy MQTT 3.1 support",
"userProperties": "User Properties", "userProperties": "User Properties",
"subscriptionIdentifier": "Subscription ID", "subscriptionIdentifier": "Subscription ID",
@ -448,10 +448,10 @@
"auto-connect": "Connect automatically", "auto-connect": "Connect automatically",
"auto-mode-depreciated": "This option is depreciated. Please use the new auto-detect mode." "auto-mode-depreciated": "This option is depreciated. Please use the new auto-detect mode."
}, },
"sections-label":{ "sections-label": {
"birth-message": "Message sent on connection (birth message)", "birth-message": "Message sent on connection (birth message)",
"will-message":"Message sent on an unexpected disconnection (will message)", "will-message": "Message sent on an unexpected disconnection (will message)",
"close-message":"Message sent before disconnecting (close message)" "close-message": "Message sent before disconnecting (close message)"
}, },
"tabs-label": { "tabs-label": {
"connection": "Connection", "connection": "Connection",
@ -460,7 +460,7 @@
}, },
"placeholder": { "placeholder": {
"clientid": "Leave blank for auto generated", "clientid": "Leave blank for auto generated",
"clientid-nonclean":"Must be set for non-clean sessions", "clientid-nonclean": "Must be set for non-clean sessions",
"will-topic": "Leave blank to disable will message", "will-topic": "Leave blank to disable will message",
"birth-topic": "Leave blank to disable birth message", "birth-topic": "Leave blank to disable birth message",
"close-topic": "Leave blank to disable close message" "close-topic": "Leave blank to disable close message"
@ -494,7 +494,6 @@
"invalid-action-alreadyconnected": "Disconnect from broker before connecting", "invalid-action-alreadyconnected": "Disconnect from broker before connecting",
"invalid-action-badsubscription": "msg.topic is missing or invalid", "invalid-action-badsubscription": "msg.topic is missing or invalid",
"invalid-client-id": "Missing Client ID" "invalid-client-id": "Missing Client ID"
} }
}, },
"httpin": { "httpin": {
@ -507,7 +506,7 @@
"status": "Status code", "status": "Status code",
"headers": "Headers", "headers": "Headers",
"other": "other", "other": "other",
"paytoqs" : { "paytoqs": {
"ignore": "Ignore", "ignore": "Ignore",
"query": "Append to query-string parameters", "query": "Append to query-string parameters",
"body": "Send as request body" "body": "Send as request body"
@ -521,7 +520,7 @@
"setby": "- set by msg.method -", "setby": "- set by msg.method -",
"basicauth": "Use authentication", "basicauth": "Use authentication",
"use-tls": "Enable secure (SSL/TLS) connection", "use-tls": "Enable secure (SSL/TLS) connection",
"tls-config":"TLS Configuration", "tls-config": "TLS Configuration",
"basic": "basic authentication", "basic": "basic authentication",
"digest": "digest authentication", "digest": "digest authentication",
"bearer": "bearer authentication", "bearer": "bearer authentication",
@ -546,8 +545,8 @@
"no-response": "No response object", "no-response": "No response object",
"json-error": "JSON parse error", "json-error": "JSON parse error",
"no-url": "No url specified", "no-url": "No url specified",
"deprecated-call":"Deprecated call to __method__", "deprecated-call": "Deprecated call to __method__",
"invalid-transport":"non-http transport requested", "invalid-transport": "non-http transport requested",
"timeout-isnan": "Timeout value is not a valid number, ignoring", "timeout-isnan": "Timeout value is not a valid number, ignoring",
"timeout-isnegative": "Timeout value is negative, ignoring", "timeout-isnegative": "Timeout value is negative, ignoring",
"invalid-payload": "Invalid payload", "invalid-payload": "Invalid payload",
@ -646,7 +645,6 @@
"connection-closed": "connection closed from __host__:__port__", "connection-closed": "connection closed from __host__:__port__",
"connections": "__count__ connection", "connections": "__count__ connection",
"connections_plural": "__count__ connections" "connections_plural": "__count__ connections"
}, },
"errors": { "errors": {
"connection-lost": "connection lost to __host__:__port__", "connection-lost": "connection lost to __host__:__port__",
@ -902,8 +900,8 @@
"property": "Property", "property": "Property",
"actions": { "actions": {
"toggle": "Convert between JSON String & Object", "toggle": "Convert between JSON String & Object",
"str":"Always convert to JSON String", "str": "Always convert to JSON String",
"obj":"Always convert to JavaScript Object" "obj": "Always convert to JavaScript Object"
} }
} }
}, },
@ -989,15 +987,15 @@
}, },
"split": { "split": {
"split": "split", "split": "split",
"intro":"Split <code>msg.payload</code> based on type:", "intro": "Split <code>msg.payload</code> based on type:",
"object":"<b>Object</b>", "object": "<b>Object</b>",
"objectSend":"Send a message for each key/value pair", "objectSend": "Send a message for each key/value pair",
"strBuff":"<b>String</b> / <b>Buffer</b>", "strBuff": "<b>String</b> / <b>Buffer</b>",
"array":"<b>Array</b>", "array": "<b>Array</b>",
"splitUsing":"Split using", "splitUsing": "Split using",
"splitLength":"Fixed length of", "splitLength": "Fixed length of",
"stream":"Handle as a stream of messages", "stream": "Handle as a stream of messages",
"addname":" Copy key to " "addname": " Copy key to "
}, },
"join": { "join": {
"join": "join", "join": "join",
@ -1049,46 +1047,46 @@
"invalid-type": "Cannot join __error__ to buffer" "invalid-type": "Cannot join __error__ to buffer"
} }
}, },
"sort" : { "sort": {
"sort": "sort", "sort": "sort",
"target" : "Sort", "target": "Sort",
"seq" : "message sequence", "seq": "message sequence",
"key" : "Key", "key": "Key",
"elem" : "element value", "elem": "element value",
"order" : "Order", "order": "Order",
"ascending" : "ascending", "ascending": "ascending",
"descending" : "descending", "descending": "descending",
"as-number" : "as number", "as-number": "as number",
"invalid-exp" : "Invalid JSONata expression in sort node: __message__", "invalid-exp": "Invalid JSONata expression in sort node: __message__",
"too-many" : "Too many pending messages in sort node", "too-many": "Too many pending messages in sort node",
"clear" : "clear pending message in sort node" "clear": "clear pending message in sort node"
}, },
"batch" : { "batch": {
"batch": "batch", "batch": "batch",
"mode": { "mode": {
"label" : "Mode", "label": "Mode",
"num-msgs" : "Group by number of messages", "num-msgs": "Group by number of messages",
"interval" : "Group by time interval", "interval": "Group by time interval",
"concat" : "Concatenate sequences" "concat": "Concatenate sequences"
}, },
"count": { "count": {
"label" : "Number of messages", "label": "Number of messages",
"overlap" : "Overlap", "overlap": "Overlap",
"count" : "count", "count": "count",
"invalid" : "Invalid count and overlap" "invalid": "Invalid count and overlap"
}, },
"interval": { "interval": {
"label" : "Interval", "label": "Interval",
"seconds" : "seconds", "seconds": "seconds",
"empty" : "send empty message when no message arrives" "empty": "send empty message when no message arrives"
}, },
"concat": { "concat": {
"topics-label": "Topics", "topics-label": "Topics",
"topic" : "topic" "topic": "topic"
}, },
"too-many" : "too many pending messages in batch node", "too-many": "too many pending messages in batch node",
"unexpected" : "unexpected mode", "unexpected": "unexpected mode",
"no-parts" : "no parts property in message", "no-parts": "no parts property in message",
"error": { "error": {
"invalid-count": "Invalid count", "invalid-count": "Invalid count",
"invalid-overlap": "Invalid overlap", "invalid-overlap": "Invalid overlap",
@ -1107,7 +1105,7 @@
"property": "property", "property": "property",
"topic": "topic" "topic": "topic"
}, },
"placeholder":{ "placeholder": {
"bandgap": "e.g. 10 or 5%", "bandgap": "e.g. 10 or 5%",
"start": "leave blank to use first data received" "start": "leave blank to use first data received"
}, },

View File

@ -8,7 +8,6 @@
"httpStatic": "HTTP Static : __path__" "httpStatic": "HTTP Static : __path__"
} }
}, },
"server": { "server": {
"loading": "Loading palette nodes", "loading": "Loading palette nodes",
"palette-editor": { "palette-editor": {
@ -61,7 +60,6 @@
"function-required": "httpsRefreshInterval requires https property to be a function" "function-required": "httpsRefreshInterval requires https property to be a function"
} }
}, },
"api": { "api": {
"flows": { "flows": {
"error-save": "Error saving flows: __message__", "error-save": "Error saving flows: __message__",
@ -79,18 +77,16 @@
"error-enable": "Failed to enable node:" "error-enable": "Failed to enable node:"
} }
}, },
"comms": { "comms": {
"error": "Communication channel error: __message__", "error": "Communication channel error: __message__",
"error-server": "Communication server error: __message__", "error-server": "Communication server error: __message__",
"error-send": "Communication send error: __message__" "error-send": "Communication send error: __message__"
}, },
"settings": { "settings": {
"user-not-available": "Cannot save user settings: __message__", "user-not-available": "Cannot save user settings: __message__",
"not-available": "Settings not available", "not-available": "Settings not available",
"property-read-only": "Property '__prop__' is read-only", "property-read-only": "Property '__prop__' is read-only",
"readonly-mode" : "Runtime in read-only mode. Changes will not be saved." "readonly-mode": "Runtime in read-only mode. Changes will not be saved."
}, },
"library": { "library": {
"unknownLibrary": "Unknown library: __library__", "unknownLibrary": "Unknown library: __library__",
@ -101,12 +97,12 @@
}, },
"nodes": { "nodes": {
"credentials": { "credentials": {
"error":"Error loading credentials: __message__", "error": "Error loading credentials: __message__",
"error-saving":"Error saving credentials: __message__", "error-saving": "Error saving credentials: __message__",
"not-registered": "Credential type '__type__' is not registered", "not-registered": "Credential type '__type__' is not registered",
"system-key-warning": "\n\n---------------------------------------------------------------------\nYour flow credentials file is encrypted using a system-generated key.\n\nIf the system-generated key is lost for any reason, your credentials\nfile will not be recoverable, you will have to delete it and re-enter\nyour credentials.\n\nYou should set your own key using the 'credentialSecret' option in\nyour settings file. Node-RED will then re-encrypt your credentials\nfile using your chosen key the next time you deploy a change.\n---------------------------------------------------------------------\n", "system-key-warning": "\n\n---------------------------------------------------------------------\nYour flow credentials file is encrypted using a system-generated key.\n\nIf the system-generated key is lost for any reason, your credentials\nfile will not be recoverable, you will have to delete it and re-enter\nyour credentials.\n\nYou should set your own key using the 'credentialSecret' option in\nyour settings file. Node-RED will then re-encrypt your credentials\nfile using your chosen key the next time you deploy a change.\n---------------------------------------------------------------------\n",
"unencrypted" : "Using unencrypted credentials", "unencrypted": "Using unencrypted credentials",
"encryptedNotFound" : "Encrypted credentials not found" "encryptedNotFound": "Encrypted credentials not found"
}, },
"flows": { "flows": {
"safe-mode": "Flows stopped in safe mode. Deploy to start.", "safe-mode": "Flows stopped in safe mode. Deploy to start.",
@ -150,7 +146,6 @@
} }
} }
}, },
"storage": { "storage": {
"index": { "index": {
"forbidden-flow-name": "forbidden flow name" "forbidden-flow-name": "forbidden flow name"
@ -180,7 +175,6 @@
} }
} }
}, },
"context": { "context": {
"log-store-init": "Context store : '__name__' [__info__]", "log-store-init": "Context store : '__name__' [__info__]",
"error-loading-module": "Error loading context store: __message__", "error-loading-module": "Error loading context store: __message__",
@ -195,5 +189,4 @@
"error-write": "Error writing context: __message__" "error-write": "Error writing context: __message__"
} }
} }
} }

View File

@ -641,7 +641,12 @@ function evaluateNodeProperty(value, type, node, msg, callback) {
result = Date.now(); result = Date.now();
} else if (type === 'bin') { } else if (type === 'bin') {
var data = JSON.parse(value); var data = JSON.parse(value);
if (Array.isArray(data) || (typeof(data) === "string")) {
result = Buffer.from(data); result = Buffer.from(data);
}
else {
throw createError("INVALID_BUFFER_DATA", "Not string or array");
}
} else if (type === 'msg' && msg) { } else if (type === 'msg' && msg) {
try { try {
result = getMessageProperty(msg,value); result = getMessageProperty(msg,value);

View File

@ -906,6 +906,7 @@ describe('inject node', function() {
msg.should.have.property("str1", "1"); //injected prop msg.should.have.property("str1", "1"); //injected prop
msg.should.have.property("num1", 1); //injected prop msg.should.have.property("num1", 1); //injected prop
msg.should.have.property("bool1", true); //injected prop msg.should.have.property("bool1", true); //injected prop
msg.should.have.property("jsonata1", "AB"); //injected prop
helper.clearFlows().then(function() { helper.clearFlows().then(function() {
done(); done();
@ -919,6 +920,7 @@ describe('inject node', function() {
{p:"str1", v:"1", vt:"str"}, //new prop {p:"str1", v:"1", vt:"str"}, //new prop
{p:"num1", v:"1", vt:"num"}, //new prop {p:"num1", v:"1", vt:"num"}, //new prop
{p:"bool1", v:"true", vt:"bool"}, //new prop {p:"bool1", v:"true", vt:"bool"}, //new prop
{p:"jsonata1", v:'"A" & "B"', vt:"jsonata"}, //new prop
]}) ]})
.expect(200).end(function(err) { .expect(200).end(function(err) {
if (err) { if (err) {

View File

@ -388,6 +388,19 @@ describe("@node-red/util/util", function() {
result[0].should.eql(1); result[0].should.eql(1);
result[1].should.eql(2); result[1].should.eql(2);
}); });
it('throws an error if buffer data is not array or string', function (done) {
try {
var result = util.evaluateNodeProperty('12','bin');
done("should throw an error");
} catch (err) {
if (err.code === "INVALID_BUFFER_DATA") {
done();
}
else {
done("should throw an error");
}
}
});
it('returns msg property',function() { it('returns msg property',function() {
var result = util.evaluateNodeProperty('foo.bar','msg',{},{foo:{bar:"123"}}); var result = util.evaluateNodeProperty('foo.bar','msg',{},{foo:{bar:"123"}});
result.should.eql("123"); result.should.eql("123");