diff --git a/.github/ISSUE_TEMPLATE/--bug_report.md b/.github/ISSUE_TEMPLATE/--bug_report.md index 63923455e..7cdc9caad 100644 --- a/.github/ISSUE_TEMPLATE/--bug_report.md +++ b/.github/ISSUE_TEMPLATE/--bug_report.md @@ -1,6 +1,6 @@ --- name: Bug report -about: Reproducable software issues in the core of Node-RED +about: Reproducible software issues in the core of Node-RED title: '' labels: '' assignees: '' diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 05fdacd51..92a0abb8a 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -29,6 +29,6 @@ the [forum](https://discourse.nodered.org) or - [ ] I have read the [contribution guidelines](https://github.com/node-red/node-red/blob/master/CONTRIBUTING.md) -- [ ] For non-bugfix PRs, I have discussed this change on the mailing list/slack team. +- [ ] For non-bugfix PRs, I have discussed this change on the forum/slack team. - [ ] I have run `grunt` to verify the unit tests pass - [ ] I have added suitable unit tests to cover the new/changed functionality diff --git a/CHANGELOG.md b/CHANGELOG.md index e0e6e2cb6..7ea3845c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,115 @@ +#### 1.0.4: Maintenance Release + +Runtime + + - Update all dependencies to latest fix versions + - Update JSONata to 1.8.1 + - #2473 Handle httpAdminRoot missing ending slash with login strategy Fixes + - #2470 Update https-proxy-agent + - #2461 Allow credentials to be provided as part of /flows api + - #2444 Move receive metric position to better reflect async changes Fixes + - #2406 Improve file store error when cache disabled and sync api used Closes + - #2399 cloneMessage should handle undefined without throwing err Fixes + - #2418 Fix the library api routes to prevent too broad matching of regex URLs + - #2417 Remove undefined loadFlowLibrary call + +Editor + + - #2465 Add better regex highlighting in jsonata edit mode Fixes + - Add regex awareness to jsonata formatter + - #2472 Avoid adding extra newlines when formating jsonata Fixes + - #2475 Add UI test case for error handling + - Avoid adding extra divs to edit form to avoid size miscalculation + - Upgrade to latest marked and dompurify libs + - Ensure catalog load errors are logged to the console + - #2460 Track context sidebar element paths to track formatting changes Fixes + - Battling Chrome Autocomplete, part 31: Wrap search input with form + - #2445 Trick chrome into autofilling dummy username/password inputs Fixes + - #2457 Fix garbled characters in library + - #2409 Filter palette using raw label not html formatted label Fixes + - #2400 Wrap long context values when displaying in sidebar Fixes + - Fix duplicating array item in visual json editor + - #2338 Modify history sidebar button positioning to handle long labels Fixes + - #2438 Add some auto-complete snippets to the nrjavascript mode Close + - #2430 Ignore disabled nodes when checking for invalid configs on deploy Closes + - #2442 #2458 #2453 Update zh-CN translations + - #2235 Add initial zh-TW translation + - Re-enable jshint on editor and fixup issues + - #2431 Remove unnecessary namespaces for i18n + - #2440 Support BrowserStack in UI testing + - #2358 Add path property to debug messages Fixes + - Fix false change detection when no config node selected + - Fix IME bug in text editor + - Make node highlighting a bit more obvious for busy flows + - #2392 Add icons and support i18n in typedInput of JSON editor + +Nodes + - #2462 MQTT: Ensure IPv6 broker names are wrapped in brackets Fixes + - Join node - check existance before clearing timeout + - Trigger: Complete 2nd msg when set to send latest + - TCP: clarify text regarding blank parameters. + - #2449 HTTP Request: Add HEAD as Method + - Make min-height for change, switch, batch and mqtt consistent + + +#### 1.0.3: Maintenance Release + +Runtime + - Increase timeouts in Subflow tests to minimise false positives + - Update grunt-sass and add node-sass for node12 support + - Fix timings of Delay node tests + - #2340 Update JSONata to 1.7.0 + - Bump https-proxy-agent version + - #2332 Fix error handling of nodes with multiple input handlers + - Add script to generate npm publish script + - #2371 Ensure folder is present before write (e.g. flows file not in user folder) + - #2371 Handle windows UNC '\\' paths + - #2366 Handle logging of non-JSON encodable objects + +Editor + - #2328 Fix language handling in subflow node + - Use default language if lng param not set in i18n req + - #2326 Fix palette editor search visualization + - #2375 Subflow status not showing i18n version of contained core nodes status + - Fix inverse of 'replace' editor event + - #2376 Fallback to base language files if present + - #2373 Support UI testing on the latest Google Chrome + - #2364 Add tooltip to expand button in markdown editor + - #2363 Support ctrl key to select tabs for Windows + - #2356 Make JSONata help initially shown in expression editor + - #2355 Prohibit line break in type menu of typedInput + +Nodes + - Delay: Fix delay to not pass through .reset and .flush props consistently + - #2352 File: Using the ‘a msg per line’ the last line does not get msg.topic passed + - #2339 HTTP Request: Check auth type on opening + - HTTP Request: add units info + - #2372 MQTT/WS: Improved proxy support for MQTT and WebSocket nodes + - #2370 MQTT: Add clarification that MQTT Out requires payload to send msg + + +#### 1.0.2: Maintenance Release + +Runtime + - Allow node.status() to be passed number/bool types + - Allow node emitted events to have multiple arguments + - #2323 Fixed docstrings to have them match the function signature (name of parameters). + - #2318 NLS: Unify translations of "boolean" + +Editor + - Ensure node status is refreshed whenever node is edited + - #2316 Ensure z property included in full message debug payload #2315 + - #2321 Fixed editor.json (JA nls) + - #2313 Fix element to collapse items in visual JSON editor + - #2314 Insert divider in menu by calling RED.menu.addItem('id', null); + +Nodes + - Change: Fixup use of node.done + - #2322 Template: Fix invalid JSON data in template node docs + - #2320 File: Fixed a typo in 10-file.html (JA nls) + - #2312 Template: Remove unnecessary comma in help text + - #2319 Inject: Interval of inject node should be 596 hours or less. + #### 1.0.1: Maintenance Release Runtime @@ -55,9 +167,9 @@ Editor - Move flow-status button to footer for consistency - Fix node hover effect to prevent jumping position - Filter quick-add properly when splicing a wire - - Mark workspace dirty when deleting link node link Fixes #2274 + - #2274 Mark workspace dirty when deleting link node link Fixes - Add red-ui-button class to strategy login button - - Fix padding of subflow locale select Closes #2276 + - #2276 Fix padding of subflow locale select Closes - Update info text of complete node & add JP text - Add class red-ui-button to cancel button - Add css class to login submit button (#2275) @@ -80,12 +192,12 @@ Runtime - [FEATURE] Add Node Done API - make message passing async - Ensure the subflow stop promise is waiting for before restarting - Limit the regex for the /nodes/ api end points - - Add error event handler to ssh-keygen child_process Fixes #2255 - - Fix default value handling on context array access Fixes #2252 + - #2255 Add error event handler to ssh-keygen child_process Fixes + - #2252 Fix default value handling on context array access Fixes - Remove all ui test dependencies from package.json - Add req back to audit log events and extend to Projects api - - Ensure 2nd arg to node.error is an object Fixes #2228 - - Use a more atomic process for writing context files Fixes #2271 + - #2228 Ensure 2nd arg to node.error is an object Fixes + - #2271 Use a more atomic process for writing context files Fixes Editor @@ -104,25 +216,25 @@ Editor - [FEATURE] add support for specifying subflow template color - [FEATURE] Use ctrl-click on wire to splice node in place - [FEATURE] Allow search results to show more than 25 results - - [FEATURE] Allow a node to change if it has an input port Closes #2268 - - Revealing node position needs to account for zoom level Fixes #2172 - - Fix typedInput option selection Fixes #2174 - - Fix palette node id handling so search works Fixes #2173 + - #2268 [FEATURE] Allow a node to change if it has an input port Closes + - #2172 Revealing node position needs to account for zoom level Fixes + - #2174 Fix typedInput option selection Fixes + - #2173 Fix palette node id handling so search works Fixes - Add popover tooltips to debug sidebar,function and template - Add popovers to context sidebar mini buttons - Ensure node status icon is shown when value set - Revert treeList children function signature change - Restore tray component css for compatibility. Mark as deprecated - fix function name & string compare function - - Handle empty list of example flows Fixes #2171 + - #2171 Handle empty list of example flows Fixes - Ensure library list has an item selected when opened - Ensure tooltip popover doesn't replace normal popover - Fix clipboard export download button - Ensure input box has focus on repeated quick add - Fix width calculation of typedInput - Remove some hardcoded css colors - - Fix display of node help when clicking in palette Fixes #2194 - - Ensure node help is loaded in the right language Fixes #2195 + - #2194 Fix display of node help when clicking in palette Fixes + - #2195 Ensure node help is loaded in the right language Fixes - Do not allow tab focus on clipboard hidden element - Fix undefined error on typedInput due to valueLabel used before being added - Fix undo of flow disable state change @@ -135,7 +247,7 @@ Editor - Update all node icons to SVG - Handle png/svg fallback for def.icon values. Remove old pngs - Ignore empty examples directories (don't add to import menu) - - better handle example file at any depth - #2222 + - #2222 better handle example file at any depth - - Properly escape node types in palette - Ensure session expiry timeout doesn't exceed limit - Use node/tab map to make filterNodes more efficient @@ -143,22 +255,22 @@ Editor - Handle undefined node.\_def in edit stack title. - fix converting selection to subflow - Fix inserting new subflow node to existing wire between nodes - - Support displaying falsey node status values Fixes #2246 + - #2246 Support displaying falsey node status values Fixes - Remove tab menu from node property UI for subflow and config nodes - - Mark workspace dirty when shift-click-drag detaches wires Fixes #2260 + - #2260 Mark workspace dirty when shift-click-drag detaches wires Fixes - Fix subflow category change on palette Nodes - Remove pi gpi, twitter, email and feedparser nodes from core - - Fix error handling in Websocket broadcast function Fixes #2182 + - #2182 Fix error handling in Websocket broadcast function Fixes - Handle websocket item being parseable but not an object better - stop join tripping up if last message of buffer is blank. - Add support for env var propety in switch node - Improve handling of file upload in request node - Add "has key" rule to switch node + tests - Optimise generation of switch node edit dialog - - Add keep-alive option to HTTP Request - #2261 + - #2261 Add keep-alive option to HTTP Request - #### 1.0.0-beta.2: Beta Release @@ -170,7 +282,7 @@ Runtime Runtime - Update runtime apis to support multiple libraries - Add Node 12 to travis (allow_failures) - - Bump all dependencies Fixes #2152 + - #2152 Bump all dependencies Fixes Editor - [BREAKING] complete overhaul of editor DOM/CSS structure @@ -182,17 +294,17 @@ Editor - Allow script tags with src to reference esm modules - Upgrade to jq 3.4.1 / jq-ui 1.12.1 - Allow editor language to be chosen in editor settings - - Only NLS status text that starts with a letter Fixes #2128 - - Fix display of link node list within subflow Fixes #2140 - - Blur the active element when closing edit dialog via action Fixes #2097 - - Trigger change evnt on typedInput when type changes and options present Fixes #2160 + - #2128 Only NLS status text that starts with a letter Fixes + - #2140 Fix display of link node list within subflow Fixes + - #2097 Blur the active element when closing edit dialog via action Fixes + - #2160 Trigger change evnt on typedInput when type changes and options present Fixes - Move library import/export to single dialog - Move type-library dialogs to new style dialog - Fix node drag and drop animation - let status be simple text if wanted - Add workspace statusBar - Complete refresh of German translations - - Fix memory leak in Debug sidebar #2163 + - #2163 Fix memory leak in Debug sidebar - Introduce toggleButton and move flow-disabled to use it - Allow RED.settings.get/set to use full property desc - Add auto-refresh toggle to context sidebar @@ -211,26 +323,26 @@ Nodes #### 0.20.8: Maintenance Release - Sanitize tab name in edit dialog - - Pass httpServer to runtime even when httpAdmin disabled Fixes #2272 + - #2272 Pass httpServer to runtime even when httpAdmin disabled Fixes #### 0.20.7: Maintenance Release - - Update jsonata to 1.6.5 which should fix #2183 + - #2183 Update jsonata to 1.6.5 which should fix - Ensure the subflow stop promise is waiting for before restarting - Properly escape node types in palette #### 0.20.6: Maintenance Release - - Revealing node position needs to account for zoom level Fixes #2172 + - #2172 Revealing node position needs to account for zoom level Fixes - stop join tripping up if last message of buffer is blank. - Improve handling of file upload in request node - - Handle subflow internal node wired to a non-existant node Fixes #2202 + - #2202 Handle subflow internal node wired to a non-existant node Fixes - Do not save subflow env vars with blank names - Don't allow a link node virtual wire to connect to normal port - - Clear HTTP Request node authType when auth disabled Fixes #2215 - - Fix parsing of content-type header Fixes #2216 + - #2215 Clear HTTP Request node authType when auth disabled Fixes + - #2216 Fix parsing of content-type header Fixes - Fix join node reset issue with merging objects - - Copy data-i18n attribute on TypedInput Fixes #2211 + - #2211 Copy data-i18n attribute on TypedInput Fixes #### 0.20.5: Maintenance Release @@ -267,27 +379,27 @@ Nodes #### 0.20.1: Maintenance Release - - Ensure all subflow instances are stopped when flow stopping Fixes #2095 - - modify name of korean locale forders #2091 + - #2095 Ensure all subflow instances are stopped when flow stopping Fixes + - #2091 modify name of korean locale forders - Ensure node names are sanitized before being presented - - Subflow status node must pass status to parent flow Fixes #2087 - - fix problem on displaying option label on Firefox #2090 + - #2087 Subflow status node must pass status to parent flow Fixes + - #2090 fix problem on displaying option label on Firefox #### 0.20.0: Milestone Release Runtime - Pass complete status to Status node and filter to editor - - Ensure flows wait for all nodes to close before restarting Fixes #2067 + - #2067 Ensure flows wait for all nodes to close before restarting Fixes - Fix git clone with password protected key - Allow a project to be located below the root of repo - Detect the cloning of an empty git repo properly - Fix use of custom auth strategy plugins - - Remove remnants of when library in git/index Fixes #2057 + - #2057 Remove remnants of when library in git/index Fixes - Clear subflow status on close - Add exportGlobalContextKeys to prevent exposing functionGlobalContext keys - Add --no-audit and --no-update-notifier flags to npm commands to reduce workload - Add envVarExcludes setting to block named env vars - - Update settings.js docs on userDir to match reality Fixes #2082 + - #2082 Update settings.js docs on userDir to match reality Fixes - Add Korean Language @@ -331,16 +443,16 @@ Editor - Add env type to subflow env var types - Display parent subflow properties in edit dialog - Fix direction value of subflow output - - Add Status Node to Subflow to allow subflow-specific status Closes #597 - - Better handling of multiple flow merges Fixes #2039 + - #597 Add Status Node to Subflow to allow subflow-specific status Closes + - #2039 Better handling of multiple flow merges Fixes Nodes - Various translation updates - - Catch: Add 'catch uncaught only' mode. Closes #1747 + - #1747 Catch: Add 'catch uncaught only' mode. Closes - Link: scroll to current flow in node list - HTTPRequest: add option to urlencode cookies - - HTTPRequest: option to use msg.payload as query params on GET. #1981 + - #1981 HTTPRequest: option to use msg.payload as query params on GET. - Debug: Add local time display option to numerics in debug window - MQTT: Add parsed JSON output option @@ -358,9 +470,9 @@ Editor - German translation - Change default dropdown appearance and sidebar tab menu handling - - Handle multiple-select box when nothing selected Fixes #2021 - - Handle i18n properly when key is a valid sub-identifier Fixes #2028 - - Avoid duplicate links when missing node type installed Fixes #2032 + - #2021 Handle multiple-select box when nothing selected Fixes + - #2028 Handle i18n properly when key is a valid sub-identifier Fixes + - #2032 Avoid duplicate links when missing node type installed Fixes - Add View Tools - Don't collapse version control header when clicking refresh - Add fast entry via keyboard for string of nodes @@ -380,15 +492,15 @@ Editor - Update palette manager view properly when module updated - Add TreeList common widget - - Fix visual jump when opening Comment editor on Safari Part of #2008 - - Fix vertical align of markdown editor in Safari Fixes #2008 - - Avoid marking node as changed if label state is default Fixes #2009 + - #2008 Fix visual jump when opening Comment editor on Safari Part of + - #2008 Fix vertical align of markdown editor in Safari Fixes + - #2009 Avoid marking node as changed if label state is default Fixes - Highlight port on node hover while joining - Support drag-wiring of link nodes - Allow TypeSearch to include a filter option - Improve diff colouring - Allow sections to toggle in 2-element stack - - Add support for ${} env var syntax when skipping validation Closes #1980 + - #1980 Add support for ${} env var syntax when skipping validation Closes - i18 support for markdown editor tooltip - Add RED.editor.registerTypeEditor for custom type editors - Tidy up markdown toolbar handling across all editors @@ -398,15 +510,15 @@ Editor Runtime - - Bump JSONata to 1.6.4 Fixes #2023 + - #2023 Bump JSONata to 1.6.4 Fixes - Add audit logging to admin api - - Fix failure of RED.require #2010 - - Allow oauth strategy callback method to be customised Closes #1998 - - Ensure fs context cache is flushed on close Fixes #2001 + - #2010 Fix failure of RED.require + - #1998 Allow oauth strategy callback method to be customised Closes + - #2001 Ensure fs context cache is flushed on close Fixes - Fix library Buffer( to Buffer.alloc( for node 10 - Catch file-not-found on startup when non-existant flow file specified - Actively expire login sesssions and notify user - - Add quotation marks for basic auth challenge #1976 + - #1976 Add quotation marks for basic auth challenge Nodes @@ -424,7 +536,7 @@ Nodes Editor - Allow the editor to use a custom admin api url root - - Improve performance of Flow Diff dialog - @TothiViseo #1989 + - #1989 Improve performance of Flow Diff dialog - @TothiViseo - Add 'open project' option to Projects Welcome dialog - Add 'type already registered' check in palette editor - Handle missing tab.disabled property @@ -442,11 +554,11 @@ Editor - Allow left-hand node button to act as toggle - Support dbl-click in tab bar to add new flow in position - Fix duplicate subflow detection on import - - Add import notification with info on what has been imported Closes #1862 + - #1862 Add import notification with info on what has been imported Closes - Show error details when trying to import invalid json - Show default icon when non-existent font-awesome icon was specified - Add configurable option for showing node label - - Avoid http redirects as Safari doesn't reuse Auth header Fixes #1903 + - #1903 Avoid http redirects as Safari doesn't reuse Auth header Fixes - Tidy up ace tooltip styling - Add event log to editor - Add tooltips to multiple editor elements @@ -474,30 +586,30 @@ Editor Runtime - Allow a project to be loaded from cmdline - - Handle lookup of undefined property in Global context Fixes #1978 + - #1978 Handle lookup of undefined property in Global context Fixes - Refuse to enable Manage Palette if npm too old - Remove restriction on upgrading non-local modules - - Remove deprecated Buffer constructor usage Fixes #1709 + - #1709 Remove deprecated Buffer constructor usage Fixes - Update httpServerOptions doc in settings.js - Exclude non-testable .js files from the unit tests - Add --safe mode flag to allow starting without flows running - - Add setting-defined accessToken for automated access to the adminAPI - #1789 + - #1789 Add setting-defined accessToken for automated access to the adminAPI - Nodes - - Move all core node EN help to their own locale files - #1990 + - #1990 Move all core node EN help to their own locale files - - CSV: better regex for number detection - Debug: hide button if not configured to send to sidebar - Delay: report queue activity when in by-topic mode - Delay: add msg.flush mode - Exec: Preserve existing properties on msg object - File: remove CR/LF from incoming filename - - Function: create custom ace javascript mode to handle ES6 Fixes #1911 + - #1911 Function: create custom ace javascript mode to handle ES6 Fixes - Function: add env.get - - HTTP Request: Add http-proxy config #1913 + - #1913 HTTP Request: Add http-proxy config - HTTP Request: add msg.redirectList to output - - HTTP Request: add msg.requestTimeout option for per-message setting - @natcl #1959 - - MQTT: add auto-detect and base64 output to mqtt node Fixes #1912 - @DurandA + - #1959 HTTP Request: add msg.requestTimeout option for per-message setting - @natcl + - #1912 - @DurandA MQTT: add auto-detect and base64 output to mqtt node Fixes - MQTT: only unsubscribe node that is being removed - Sentiment: move to node-red-node-sentiment - Switch: add missing edit dialog icon @@ -512,48 +624,48 @@ Nodes #### 0.19.6: Maintenance Release - - Fix encoding of file node from binary to utf8 - #2051 + - #2051 Fix encoding of file node from binary to utf8 - #### 0.19.5: Maintenance Release - Recognize pip installs of RPi.GPIO (#1934) - - Merge pull request #1941 from node-red-hitachi/master-batch - - Merge pull request #1931 from node-red-hitachi/master-typedinput + - #1941 from node-red-hitachi/master-batch Merge pull request + - #1931 from node-red-hitachi/master-typedinput Merge pull request - Set min value of properties and spinners for batch - Fix that unnecessary optionMenu remains - - Merge pull request #1894 from node-red-hitachi/fix-overlapping-file-node-execution - - Merge pull request #1924 from imZack/patch-1 + - #1894 from node-red-hitachi/fix-overlapping-file-node-execution Merge pull request + - #1924 from imZack/patch-1 Merge pull request - Add missing comma - - Do not disable context sidebar during node edit Fixes #1921 - - Don't allow virtual links to be spliced Fixes #1920 + - #1921 Do not disable context sidebar during node edit Fixes + - #1920 Don't allow virtual links to be spliced Fixes - Merge project package changes to avoid overwritten changes - - Handle manually added project deps that are unused Fixes #1908 + - #1908 Handle manually added project deps that are unused Fixes - update close & input handling of File node - make close handler argument only one - - Merge pull request #1907 from amilajack/patch-2 + - #1907 from amilajack/patch-2 Merge pull request - Change repo badge to point to master branch - invoke callbacks if async handler is specified - - Merge pull request #1891 from camlow325/resolve-example-path-for-windows-support - - Merge pull request #1900 from kazuhitoyokoi/master-addtestcases4settings.js + - #1891 from camlow325/resolve-example-path-for-windows-support Merge pull request + - #1900 from kazuhitoyokoi/master-addtestcases4settings.js Merge pull request - wait closing while pending messages exist - Add test cases for red/api/editor/settings.js - - Ensure all palette categories are opened properly Closes #1893 + - #1893 Ensure all palette categories are opened properly Closes - Resolve path when sending example file for Windows support - fix multiple input message processing of file node #### 0.19.4: Maintenance Release - - Fix race condition in non-cache lfs context Fixes #1888 + - #1888 Fix race condition in non-cache lfs context Fixes - LocalFileSystem Context: Remove extra flush code - Prevent race condition in caching mode of lfs context (#1889) - Allow context store name to be provided in the key - Switch node: only use promises when absolutely necessary - Fix dbl-click handling on webkit-based browsers - Ensure context.flow/global cannot be deleted or enumerated - - Handle context.get with multiple levels of unknown key Fixes #1883 + - #1883 Handle context.get with multiple levels of unknown key Fixes - Fix global.get("foo.bar") for functionGlobalContext set values - Fix node color bug (#1877) - - Merge pull request #1857 from cclauss/patch-1 + - #1857 from cclauss/patch-1 Merge pull request - Define raw_input() in Python 3 & fix time.sleep() #### 0.19.3: Maintenance Release @@ -568,14 +680,14 @@ Nodes - TCP-request node - only write payload - JSON schema: perform validation when obj -> obj or str -> str - JSON schema: add draft-06 support (via $schema keyword) - - Mqtt proxy configuration for websocket connection, #1651. + - #1651. Mqtt proxy configuration for websocket connection, - Allows MQTT Shared Subscriptions for MQTT-In core node - Fix use of HTML tag or CSS class specification as icon of typedInput #### 0.19.2: Maintenance Release - Ensure node default colour is used if palette.theme has no match - - fix lost messages / properties in TCPRequest Node; closes #1863 (#1864) + - #1863 (#1864) fix lost messages / properties in TCPRequest Node; closes - Fix typo in template.html - Improve error reporting from context plugin loading - Prevent no-op edit of node marking as changed due to icon @@ -595,8 +707,8 @@ Nodes Editor - Add editorTheme.palette.theme to allow overriding colours - - Index all node properties when searching Fixes #1446 - - Handle NaN and Infinity properly in debug sidebar Fixes #1778 #1779 + - #1446 Index all node properties when searching Fixes + - #1779 Handle NaN and Infinity properly in debug sidebar Fixes #1778 - Prevent horizontal scroll when palette name cannot wrap - Ignore middle-click on node/ports to enable panning - Better wire layout when looping back @@ -610,7 +722,7 @@ Editor - Only edit nodes on dbl click on primary button with no modifiers - Allow subflows to be put in any palette category - Add flow navigator widget - - Cache flow library result to improve response time Fixes #1753 + - #1753 Cache flow library result to improve response time Fixes - Add middle-button-drag to pan the workspace - allow multi-line category name in editor - Redesign sidebar tabs @@ -618,20 +730,20 @@ Editor Nodes - - Change: Ensure runtime errors in Change node can be caught Fixes #1769 + - #1769 Change: Ensure runtime errors in Change node can be caught Fixes - File: Add output to File Out node - Function: add expandable JavaScript editor pane - Function: allow id and name reference in function node code (#1731) - HTTP Request: Move to request module - - HTTP: Ensure apiMaxLength applies to HTTP Nodes Fixes #1278 + - #1278 HTTP: Ensure apiMaxLength applies to HTTP Nodes Fixes - Join: accumulate top level properties - Join: allow environment variable as reduce init value - JSON: add JSON schema validation via msg.schema - Pi: Let nrgpio code work with python 3 - Pi: let Pi nodes be visible/editable on all platforms - Switch: add isEmpty rule - - TCP: queue messages while connecting; closes #1414 - - TLS: Add servername option to TLS config node for SNI Fixes #1805 + - #1414 TCP: queue messages while connecting; closes + - #1805 TLS: Add servername option to TLS config node for SNI Fixes - UDP: Don't accidentally re-use udp port when set to not do so Persistent Context @@ -646,8 +758,8 @@ Persistent Context Runtime - Support flow.disabled and .info in /flow API - - Node errors should be Strings not Errors Fixes #1781 - - Add detection of connection timeout in git communication Fixes #1770 + - #1781 Node errors should be Strings not Errors Fixes + - #1770 Add detection of connection timeout in git communication Fixes - Handle loading empty nodesDir - Add 'private' property to userDir generated package.json - Add RED.require to allow nodes to access other modules @@ -657,7 +769,7 @@ Runtime Editor Fixes - - Do not trim wires if node declares outputs in defaults but misses value Fixes #1737 + - #1737 Do not trim wires if node declares outputs in defaults but misses value Fixes Node Fixes @@ -667,16 +779,16 @@ Node Fixes - typo fix in node help (#1735) Other Fixes - - Tidy up default grunt task and fixup test break due to reorder Fixes #1738 + - #1738 Tidy up default grunt task and fixup test break due to reorder Fixes - Bump jsonata version #### 0.18.6: Maintenance Release Editor Fixes - - Handle a node having wires in the editor on ports it no longer has Fixes #1724 + - #1724 Handle a node having wires in the editor on ports it no longer has Fixes - Add missing ACE snippet files - - Fix wireClippedNodes is not defined Fixes #1726 + - #1726 Fix wireClippedNodes is not defined Fixes - Split node html to isolate bad nodes when loading - Avoid unnecessary use of .html() where .text() will do @@ -703,32 +815,32 @@ New Features Editor Fixes - - Highlight subflow node when log msg comes from inside Fixes #1698 - - Ensure node wires array is not longer than outputs value Fixes #1678 - - Allow importing an unknown config node to be undone Fixes #1681 - - Ensure keyboard shortcuts get saved in runtime settings Fixes #1696 + - #1698 Highlight subflow node when log msg comes from inside Fixes + - #1678 Ensure node wires array is not longer than outputs value Fixes + - #1681 Allow importing an unknown config node to be undone Fixes + - #1696 Ensure keyboard shortcuts get saved in runtime settings Fixes - Don't mark a subflow changed when actually modified nothing (#1665) Node Fixes - bind to correct port when doing udp broadcast/multicast (#1686) - Provide full error stack in Function node log message (#1700) - - Fix http request doc type Fixes #1690 + - #1690 Fix http request doc type Fixes - Make debug slightly larger to pass WCAG AA rating - - Make core nodes labels more consistent, to close #1673 - - Allow template node to be updated more than once Fixes #1671 + - #1673 Make core nodes labels more consistent, to close + - #1671 Allow template node to be updated more than once Fixes - Fix the problem that output labels of switch node sometimes disappear (#1664) - Chinese translations for core nodes (#1607) Runtime Fixes - - Handle and display for invalid flow credentials when project is disabled #1689 (#1694) + - #1689 (#1694) Handle and display for invalid flow credentials when project is disabled - node-red-pi: fix behavior with old bash version (#1713) - Fix ENOENT error on first start when no user dir (#1711) - - Handle null error object in Flow.handleError Fixes #1721 + - #1721 Handle null error object in Flow.handleError Fixes - update settings comments to describe how to setup for ipv6 (#1675) - - Remove credential props after diffing flow to prevent future false positives Fixes #1359 - - Log error if settings unavailable when saving user settings Fixes #1645 + - #1359 Remove credential props after diffing flow to prevent future false positives Fixes + - #1645 Log error if settings unavailable when saving user settings Fixes - Keep backup of .config.json - Add warning if using \_credentialSecret from .config.json - Filter req.user in /settings to prevent potentially leaking info @@ -754,7 +866,7 @@ Editor Fixes - Fix merging a remote diff - Fixed the problems when using a node without defaults - Disable user defined icon for subflow - - getDefaultNodeIcon should handle subflow instance nodes Fixes #1635 + - #1635 getDefaultNodeIcon should handle subflow instance nodes Fixes - Add Japanese info text for core nodes - Fix message lookup for core nodes in case of i18 locales directory exists - Prevent the last tab from being deleted @@ -785,7 +897,7 @@ Editor Fixes - Fix offset calculation when dragging node from palette - Allow a library entry to use non-default node-input- prefixes - - Change remote-diff shortcut and add it to keymap Fixes #1628 + - #1628 Change remote-diff shortcut and add it to keymap Fixes #### 0.18.2: Maintenance Release @@ -824,7 +936,7 @@ Projects - Handle more repo clone error cases - Relax validation of git urls - Revalidate project name on return to project-details view - - Avoid unnecessary project refresh on branch-switch Fixes #1597 + - #1597 Avoid unnecessary project refresh on branch-switch Fixes - Add support for file:// git urls - Handle project first-run without existing flow file - Handle delete of last remote in project settings @@ -835,9 +947,9 @@ Projects Node Fixes - Trigger node migration - ensure bytopic not blank - - Add HEAD to list of methods with no body in http req node #1598 - - Do not include payload in GET requests Fixes #1598 - - Update sort/batch docs Fixes #1601 + - #1598 Add HEAD to list of methods with no body in http req node + - #1598 Do not include payload in GET requests Fixes + - #1601 Update sort/batch docs Fixes - Don't assume node has defaults when exporting icon property @@ -850,11 +962,11 @@ Runtime - Better error reporting when module provides duplicate type - Update jsonata to 1.5.0 - add express-session memorystore without leaks (#1435) - - Allow adminAuth.user to be a Function Fixes #1461 + - #1461 Allow adminAuth.user to be a Function Fixes - Ensure RED.server is set even if admin api disabled - - Ensure strategy login button uses relative URL Fixes #1481 + - #1481 Ensure strategy login button uses relative URL Fixes - ignore `_msgid` when merging full objects - - Move node install to spawn to allow for big stdout Fixes #1488 + - #1488 Move node install to spawn to allow for big stdout Fixes - SIGINT handler should wait for stop to complete before exit Editor @@ -862,12 +974,12 @@ Editor - allow a node's icon to be set dynamically (#1490) - Batch messages sent over comms to increase throughput - Migrate deploy confirmations to notifications - - `oneditdelete` should be available to all node types Closes #1346 + - #1346 `oneditdelete` should be available to all node types Closes - Sort typeSearch results based on position of match - Update ACE to test and add python highlighter (#1373) - - Clear mouse state when typeSearch cancelled Fixes #1517 + - #1517 Clear mouse state when typeSearch cancelled Fixes - Handle scoped modules via palette editor - - TypedInput: handle user defined value/labels options Fixes #1549 + - #1549 TypedInput: handle user defined value/labels options Fixes Nodes @@ -882,7 +994,7 @@ Nodes - Add support for rejectUnauthorized msg property - Add TLS options to WebSocket client - Added parsed YAML support for template node (#1443) - - Allow delay node in rate-limit mode to be reset Fixes #1360 + - #1360 Allow delay node in rate-limit mode to be reset Fixes - Allow setTimeout in Function node to be promisified in node 8 - Debug to status option (#1499) - enable template config via msg.template for stored or generated templates (#1503) @@ -901,13 +1013,13 @@ Nodes - MQTT node - if Server/URL config contains '//' use it as a complete url; enabled ws:// and wss:// - clone messages before delayed send (#1474) - Decrement connected client count rather than show disconnected - - Don't end mqtt client on first error Fixes #1566 - - File out - create dirs synchronously to ensure they exist Fixes #1489 + - #1566 Don't end mqtt client on first error Fixes + - #1489 File out - create dirs synchronously to ensure they exist Fixes - Fix debug message format for Buffer (#1444) - Fix global.keys() bug in function node (#1417) - Handle escape characters in template node which uses Mustache format and JSON output mode (#1377) - - Move all node.send to end of timer functions in trigger node (issue #1527) (#1539) - - Publish null/undefined to mqtt as blank not toString Fixes #1521 + - #1527) (#1539) Move all node.send to end of timer functions in trigger node (issue + - #1521 Publish null/undefined to mqtt as blank not toString Fixes - remove inject node at specific time spinner - restrict inject interval to less that 2^31 millisecs - tag UDP ports in use properly so they get closed correctly (#1508) @@ -916,10 +1028,10 @@ Nodes - Add express-session missing dependency for oauth - Fix improper type tests is core test cases - - File node: recreate write stream when file deleted Fixes #1351 + - #1351 File node: recreate write stream when file deleted Fixes - Add flow stopping trace messages - Fix userDir test case when .config.json exists (#1350) - - Do not try to send msg after http request error handled Fixes #1344 + - #1344 Do not try to send msg after http request error handled Fixes - Fix boundary problem in range node (#1338) - Modify messages in node properties to refer messages.json (#1339) - Fix settings.js replacing webSocketVerifyClient by webSocketNodeVerifyClient (#1343) @@ -930,16 +1042,16 @@ Nodes - Add request node test case for POSTing 0 - Allow false and 0 in payload for httprequest (#1334) - Add file extension into flow name of library automatically (#1331) - - Fix accessing global context from jsonata expressions Fixes #1335 - - Disable editor whilst a deploy is inflight Fixes #1332 + - #1335 Fix accessing global context from jsonata expressions Fixes + - #1332 Disable editor whilst a deploy is inflight Fixes - Replace Unknown nodes with their real versions when node loaded - Retry auto-install of modules that fail - Fix column name in link nodes to refer language file (#1330) - - Use namespaces with link node title attributes i18n name Fixes #1329 - - Tidy up GPIO pin table presentation Fixes #1328 + - #1329 Use namespaces with link node title attributes i18n name Fixes + - #1328 Tidy up GPIO pin table presentation Fixes - Join: count of 0 should not send on every msg - Handle importing only one end of a link node pair - - Make sending to Debug synchronous again Fixes #1323 + - #1323 Make sending to Debug synchronous again Fixes - Make send-error behaviour optional in file node - Restore File In node behaviour of sending msg on error - Expose context.keys within Function node @@ -953,10 +1065,10 @@ Nodes - Fix missing icons for some nodes (#1321) - Add reformat button to JSONata test data editor - Update delay node status without spawning unnecessary intervals - - Avoid stringify ServerResponse and Socket in Debug node Fixes #1311 + - #1311 Avoid stringify ServerResponse and Socket in Debug node Fixes - Fix creating userDir other than system drive on Windows (#1317) - - Trigger node not handling a duration of 0 as block mode Fixes #1316 - - Unable to config GPIO Pin 13 Fixes #1314 + - #1316 Trigger node not handling a duration of 0 as block mode Fixes + - #1314 Unable to config GPIO Pin 13 Fixes #### 0.17.2: Maintenance Release @@ -965,7 +1077,7 @@ Nodes #### 0.17.1: Maintenance Release - Fix PI gpio to use BCM - - Prevent event thread contention when sending to Debug node Closes #1311 + - #1311 Prevent event thread contention when sending to Debug node Closes - Fix Bug: Can not display node icon when npm package has scope (#1305) (#1309) - Clear moved flag when nodes are deployed @@ -973,7 +1085,7 @@ Nodes Runtime - - Return flow rev on reload api when api v2 enabled Closes #1273 + - #1273 Return flow rev on reload api when api v2 enabled Closes - Provide single endpoint to load all node message catalogs - Add .trace and .debug to Node prototype - Rename oauth auth scheme to strategy as it works for openid @@ -981,16 +1093,16 @@ Runtime - Add support for oauth adminAuth configs - Cache auth details to save needlessly recalculating hashes - Add context.keys function to list top-level keys - - Strip BOM character from JSON files if present Fixes #1239 + - #1239 Strip BOM character from JSON files if present Fixes - Version check no meta (#1243) - - Ensure all nodes have access to global context Fixes #1230 - - Don't process subscription for unauthenticated comms link Fixes #851 - - Clone credentials when passing to node Fixes #1198 + - #1230 Ensure all nodes have access to global context Fixes + - #851 Don't process subscription for unauthenticated comms link Fixes + - #1198 Clone credentials when passing to node Fixes - Resolve dir argument of getLocalNodeFiles function (#1216) - Add wait for writing a library entry into a file. (#1186) - Use correct Buffer.from method rather than constructor - update core nodes to use newer Buffer syntax - - Treat missing msg properties as undefined rather than throw error Fixes #1167 + - #1167 Treat missing msg properties as undefined rather than throw error Fixes - Allows flows to be enabled/disabled in the runtime - add off option to logging settings comment - Log error stack traces if verbose flag is set @@ -1023,8 +1135,8 @@ Nodes - Fix wrong number of double quotes in CSV parsing - let csv node handle ip addresses without trying to parse - Update debug node to register the settings it uses - - Handle IncomingMessage/ServerResponse object types in debug Fixes #1202 - - Toggling debug node enabled/disabled state should set state dirty Fixes #1203 + - #1202 Handle IncomingMessage/ServerResponse object types in debug Fixes + - #1203 Toggling debug node enabled/disabled state should set state dirty Fixes - redo delay node status messages to be interval based - Update delay node ui - Add new msg.delay option to delay node @@ -1060,16 +1172,16 @@ Nodes - First pass of new node-info style - MQTT new style info - Fix empty extra node help content issue - - Handle HTTP In url that is missing its leading / Fixes #1218 + - #1218 Handle HTTP In url that is missing its leading / Fixes - Add file upload support to HTTP In node - HTTP Request node: add info on how to do form encoding - - Prevent unmodified msg.headers from breaking HTTP Request flows Closed #1015 + - #1015 Prevent unmodified msg.headers from breaking HTTP Request flows Closed - Add cookie handling to HTTP Request node - Add guard against the http-request buffer fix being reverted - Multipart streaming - Add http-request node unit tests - http request node add transport validity check and warn. - - Update follow_redirects to fix http_proxy handling Fixes #1172 + - #1172 Update follow_redirects to fix http_proxy handling Fixes - Allow statusCode/headers to be set directly within HTTP Response node - let inject "between time" also fire at start - Plus new info - remove repeat symbol from inject if repeat is 0 @@ -1118,7 +1230,7 @@ Nodes - Move udp sock error listener to only be instantiated once. - Let watch node recurse into subdirectories - Misconfigured WebSocket nodes should not register msg handlers - - Add websocketVerifyClient option to enable custom websocket auth Fixes #1127 + - #1127 Add websocketVerifyClient option to enable custom websocket auth Fixes Editor @@ -1140,11 +1252,11 @@ Editor - Remove unused modified flag on debug messages - Add copy path/value buttons to debug messages - dont match only part of the node type (#1242) - - Add editorTheme.logout.redirect to allow redirect on logout Closes #1213 - - Handle logging out and already logged-out editor Fixes #1288 + - #1213 Add editorTheme.logout.redirect to allow redirect on logout Closes + - #1288 Handle logging out and already logged-out editor Fixes - Fix bug: Export Subflows (#1282) - destroy editor to ensure fully removed on close (function, template, comment) - - Don't try to nls status text starting with '.' Fixes #1258 + - #1258 Don't try to nls status text starting with '.' Fixes - Add note of removed flows in diffConfig (#1253) - Add description to flow same as subflow - Allow tabs to be enabled/disabled in the editor @@ -1216,7 +1328,7 @@ Editor - Allow RED.validators.number to allow blank values as valid - Support dropping json files into the editor - NLS Expression/JSON editor and fix their height calculation - - Update JSONata to 1.2.4 Closes #1275 + - #1275 Update JSONata to 1.2.4 Closes - Remember test expression data on a per-node basis - NLS jsonata test messages - Add JSONata expr tester and improved feedback @@ -1233,13 +1345,13 @@ Other #### 0.16.2: Maintenance Release - - Ensure custom mustache context parent set in Template node fixes #1126 + - #1126 Ensure custom mustache context parent set in Template node fixes - Display debug node name in debug panel if its known - Ensure auth-tokens are removed when no user is specified in settings - Ensure all a tags have blank target in info sidebar - Ensure links do not span tabs in the editor - Avoid creating multiple reconnect timers in websocket node - - Fix inner reference in install fail message catalog entry Fixes #1120 + - #1120 Fix inner reference in install fail message catalog entry Fixes - Display buffer data properly for truncated buffers under Object property #### 0.16.1: Maintenance Release @@ -1247,9 +1359,9 @@ Other - Add colour swatches to debug when hex colour matched - Nodes with hasUsers set to false should not appear unused - Change hard error to verbose warning if using old node.js level - - Don't filter debug properties starting with _ Fixes #1117 - - Node logged errors not displayed properly in debug pane Fixes #1116 - - Do not look for existing nodes when checking for wires on paste Fixes #1114 + - #1117 Don't filter debug properties starting with _ Fixes + - #1116 Node logged errors not displayed properly in debug pane Fixes + - #1114 Do not look for existing nodes when checking for wires on paste Fixes - -v option not enabling verbose mode properly - Add node.js version check on startup @@ -1261,10 +1373,10 @@ Runtime Nodes - - Add option to colourise debug console output Closes #1103 + - #1103 Add option to colourise debug console output Closes - Add property validation to nodes using typedInput - - Add common validator for typedInput fields Closes #1104 - - Update debug node console logging indicator icon Closes #1094 + - #1104 Add common validator for typedInput fields Closes + - #1094 Update debug node console logging indicator icon Closes - Let exec node (spawn) handle commands with spaces in path - Add symbol to debug node to indicate debugging also to console.log - Change file node to use node 4 syntax (drops support for 0.8) @@ -1276,9 +1388,9 @@ Nodes Editor - - Add install/remove dialog to increase friction Closes #1109 - - Report node catalogue load errors Closes #1009 - - Properly report module remove errors in palette editor Fixes #1043 + - #1109 Add install/remove dialog to increase friction Closes + - #1009 Report node catalogue load errors Closes + - #1043 Properly report module remove errors in palette editor Fixes - Update rather than hide install button after success install - Tweak search box styling - Display info tips slightly longer @@ -1299,36 +1411,36 @@ Editor - Focus tray body when edit dialog opened - Hit enter to edit first node in selection - Add node delete button to edit dialog - - Add notification when runtime stopped due to missing types Part of #832 + - #832 Add notification when runtime stopped due to missing types Part of Fixes - - Do not tie debug src loading to needsPermission Fixes #1111 - - Initialise nodeApp regardless of httpAdmin setting Closes #1096 #1095 + - #1111 Do not tie debug src loading to needsPermission Fixes + - #1095 Initialise nodeApp regardless of httpAdmin setting Closes #1096 - Speed up reveal of search dialogs - - Ensure flows exist before delegating status/error events Fixes #1069 + - #1069 Ensure flows exist before delegating status/error events Fixes - Update package dependencies - Update MQTT to latest 2.2.1 - Node status not being refreshed properly in the editor - - Try to prevent auto-fill of password fields in node edit tray Fixes #1081 + - #1081 Try to prevent auto-fill of password fields in node edit tray Fixes - Fix whitespace in localfilesystem - fix bug where savesettings did not honor local settings variables (#1073) - - Tidy up unused/duplicate editor messages Closes #922 + - #922 Tidy up unused/duplicate editor messages Closes - Property expressions must not be blank - Tidy up merge commit of validatePropertyExpression - add port if wires array > number of ports declared. - - Allow quoted property expressions Fixes #1101 + - #1101 Allow quoted property expressions Fixes - Index all node properties for node search - Remove node 0.10 from travis config - update welcome message to use logger so it can be turned off/on if required (#1083) - Fix dynamically loading multiple node-sets from palette editor - - Allow a node to reorder its outputs and maintain links Fixes #1031 + - #1031 Allow a node to reorder its outputs and maintain links Fixes #### 0.15.3: Maintenance Release - Tcpgetfix: Another small check (#1070) - TCPGet: Ensure done() is called only once (#1068) - - Allow $ and _ at start of property identifiers Fixes #1063 + - #1063 Allow $ and _ at start of property identifiers Fixes - TCPGet: Separated the node.connected property for each instance (#1062) - Corrected 'overide' typo in XML node help (#1061) - TCPGet: Last property check (hopefully) (#1059) @@ -1361,11 +1473,11 @@ Fixes #### 0.15.2: Maintenance Release - - Revert bidi changes to nodes and hide menu option until fixed Fixes #1024 + - #1024 Revert bidi changes to nodes and hide menu option until fixed Fixes - Let xml node set options both ways - Bump serialport to use version 4 - gpio node handle multiple bits of data returned in one go - - HTTP In should pass application/octet-stream as buffer not string Fixes #1023 + - #1023 HTTP In should pass application/octet-stream as buffer not string Fixes - Handle missing httpNodeRoot setting properly - Config sidebar not handling node definition error properly - Add minimum show time to deploy spinner to avoid flicker @@ -1373,24 +1485,24 @@ Fixes - Add log.removeHandler function - Add Crtl/Shift/p shortcut for manage palette - Add spinner to deploy button - - Status messages from nodes in subflows not delegated properly Fixes #1016 + - #1016 Status messages from nodes in subflows not delegated properly Fixes - fix spelling in join node info - Speed up tab scrolling - - Update delay burst test to be more tolerant of timing Fixes #1013 + - #1013 Update delay burst test to be more tolerant of timing Fixes #### 0.15.1: Maintenance Release - Update default palette catalogue to use https - Disable palette editor if npm not found - and fix for Windows - - Searching package catalogue should be case-insensitive Fixes #1010 - - contenteditable fields not handled in config nodes Fixes #1011 + - #1010 Searching package catalogue should be case-insensitive Fixes + - #1011 contenteditable fields not handled in config nodes Fixes - Change html link refs from `_new` to `_blank` to be standards compliant #### 0.15.0: Milestone Release Runtime - - Increase default apiMaxLength to 5mb and add to default settings Closes #1001 + - #1001 Increase default apiMaxLength to 5mb and add to default settings Closes - Add v2 /flows api and deploy-overwrite protection - Encrypt credentials by default - Ensure errors thrown by RED.events handlers don't percolate up @@ -1399,7 +1511,7 @@ Editor - Mark nodes as changed when they are moved - Added parent containment option for draggable. (#1006) - - Ignore bidi event handling on non-existent and non-Input elements Closes #999 + - #999 Ignore bidi event handling on non-existent and non-Input elements Closes - Remove list of flows from menu - Allow nodes to be imported with their credentials - Add workspace search option @@ -1411,7 +1523,7 @@ Editor - Add import-to-new-tab option - Add new options to export-nodes dialog - Stop nodes being added beyond the outer bounds of the workspace - - Default config nodes to global scope unless in a subflow Closes #972 + - #972 Default config nodes to global scope unless in a subflow Closes - Bidi support for Text Direction and Structured Text (#961) - Fix jQuery selector, selecting more than one help pane/popover and displaying incorrectly. (#970) - Fixes removeItem not passing row data to callback. (#965) @@ -1425,7 +1537,7 @@ Nodes - Clean up status on close for several core nodes. - Change node: re-parse JSON set value each time to avoid pass-by-ref - Better handle HTTP Request header capitalisation - - Enable ES6 parsing in Function editor by default Fixes #985 + - #985 Enable ES6 parsing in Function editor by default Fixes - Update debug sidebar to use RED.view.reveal to show debug nodes - Add full path tip to file node, And tidy up Pi node tips - Remove WebSocket node maxlistener warning @@ -1444,7 +1556,7 @@ Nodes Other - - Add npm build/test scripts Closes #946 #660 + - #660 Add npm build/test scripts Closes #946 - Move travis to node 6 and 7 - drop 5 and 0.12 @@ -1452,15 +1564,15 @@ Other Fixes - - Tell ace about Function node globals. Closes #927 - - Tidy up mqtt nodes - linting and done handling. Closes #935 + - #927 Tell ace about Function node globals. Closes + - #935 Tidy up mqtt nodes - linting and done handling. Closes - Fix invalid html in TCP and HTML node edit templates - Add proper help text to link nodes - Handle importing old mqtt-broker configs that lack properties - Update ace to 1.2.4 - Allow config nodes to provide a sort function for their select list - Add log warning if node module required version cannot be satisfied - - Handle empty credentials file. Closes #937 + - #937 Handle empty credentials file. Closes - Add RPi.GPIO lib test for ArchLinux #### 0.14.5: Maintenance Release @@ -1470,8 +1582,8 @@ Fixes - Cannot clear cookies with http nodes - let HTML parse node allow msg.select set select - Validate nodes on import after any references have been remapped - - Debug node handles objects without constructor property Fixes #933 - - Ensure 'false' property values are displayed in info panel Fixes #940 + - #933 Debug node handles objects without constructor property Fixes + - #940 Ensure 'false' property values are displayed in info panel Fixes - Fix node enable/disable over restart - load configs after settings init #### 0.14.4: Maintenance Release @@ -1480,20 +1592,20 @@ Nodes - Update trigger node ui to use typedInputs - Better handling of quotes in CSV node - - Clarify the MQTT node sends msg.payload - closes #929 - - Inject node should reuse the message it is triggered with Closes #914 + - #929 Clarify the MQTT node sends msg.payload - closes + - #914 Inject node should reuse the message it is triggered with Closes - Stop trigger node re-using old message - Allow node.status text to be 'falsey' values Fixes - - Handle DOMException when embedded in an iframe of different origin Fixes #932 + - #932 Handle DOMException when embedded in an iframe of different origin Fixes - Fix double firing of menu actions - - Fix select box handling in Safari - fixes #928 - - Clear context in node test helper Fixes #858 - - Allow node properties to be same as existing object functions Fixes #880 + - #928 Fix select box handling in Safari - fixes + - #858 Clear context in node test helper Fixes + - #880 Allow node properties to be same as existing object functions Fixes - Handle comms link closing whilst completing the initial connect - - Protect against node type names that clash with Object property names Fixes #917 + - #917 Protect against node type names that clash with Object property names Fixes - Clone default node properties to avoid reference leakage - Strip tab node definition when exporting - Check for null config properties in editor before over-writing them @@ -1503,16 +1615,16 @@ Editor - Add sql mode to ace editor - Keyboard shortcuts dialog update (#923) - - Ensure importing link nodes to a subflow doesn't add outbound links Fixes #921 + - #921 Ensure importing link nodes to a subflow doesn't add outbound links Fixes - Add updateConfigNodeUsers function to editor - Scroll to bottom when item added to editableList - - Form input widths behave more consistently when resizing Fixes #919 #920 + - #920 Form input widths behave more consistently when resizing Fixes #919 #### 0.14.3: Maintenance Release Fixes - - Create default setting.js in user-specified directory. Fixes #908 + - #908 Create default setting.js in user-specified directory. Fixes - MQTT In subscription qos not defaulting properly - Let exec node handle 0 as well as "0" @@ -1520,7 +1632,7 @@ Fixes Fixes - - Cannot add new twitter credentials. Fixes #913 + - #913 Cannot add new twitter credentials. Fixes - Support array references in Debug property field #### 0.14.1: Maintenance Release @@ -1528,8 +1640,8 @@ Fixes Fixes - Handle undefined property that led to missing wires in the editor - - Remove duplicate 'Delete' entry in keyboard shortcut window. Closes #911 - - Add 'exec' to node-red-pi launch script. Closes #910 + - #911 Remove duplicate 'Delete' entry in keyboard shortcut window. Closes + - #910 Add 'exec' to node-red-pi launch script. Closes #### 0.14.0: Milestone Release @@ -1551,9 +1663,9 @@ Editor Runtime - Always log node warnings on start without requiring -v - - Add support for loading scoped node modules. Closes #885 + - #885 Add support for loading scoped node modules. Closes - Add process.env.PORT to settings.js - - Clear node context on deploy. Closes #870 + - #870 Clear node context on deploy. Closes - Enable finer grained permissions in adminAuth Nodes @@ -1561,9 +1673,9 @@ Nodes - Enable config nodes to reference other config nodes - Add Split/Join nodes - Add Link nodes - - Add support to HTTP In node for PATCH requests. Closes #904 + - #904 Add support to HTTP In node for PATCH requests. Closes - Add cookie handling to HTTP In and HTTP Response nodes - - Add repeat indicator to inject node label. Closes #887 + - #887 Add repeat indicator to inject node label. Closes - Add javascript highlighter to template node - Add optional timeout to exec node - Add TLS node and update MQTT/HTTP nodes to use it @@ -1575,19 +1687,19 @@ Nodes - Update Serial node to support custom baud rates - Add support for array-syntax in typedInput msg properties - Add RED.util to Function node sandbox - - Capture error stack on node.error. Closes #879 + - #879 Capture error stack on node.error. Closes Fixes - Add error handling to all node definition api calls - Handle null return from Function node in array of messages - - Defer loading of token sessions until they are accessed. Fixes #895 + - #895 Defer loading of token sessions until they are accessed. Fixes - set pi gpio pin status correctly if set on start - - Prevent parent window scrolling when view is focused. Fixes #635 + - #635 Prevent parent window scrolling when view is focused. Fixes - Handle missing tab nodes in a loaded flow config - Ensure typedInput dropdown doesn't fall off the page - - Protect against node types with reserved names such as toString. Fixes #880 + - #880 Protect against node types with reserved names such as toString. Fixes - Do not rely on the HTML file to identify where nodes are registered from - Preserve node properties on import - Fix regression in delay node. topic based queue was emptying all the time instead of spreading out messages. @@ -1603,22 +1715,22 @@ Fixes #### 0.13.4: Maintenance Release - Add timed release mode to delay node - - Enable link splicing for when import_dragging nodes. Closes #811 + - #811 Enable link splicing for when import_dragging nodes. Closes - Fix uncaught exception on deploy whilst node sending messages - Deprecate old mqtt client and connection pool modules - - Change node: add bool/num types to change mode Closes #835 - - Validate fields that are `$(env-vars)` Closes #825 + - #835 Change node: add bool/num types to change mode Closes + - #825 Validate fields that are `$(env-vars)` Closes - Handle missing config nodes when validating node properties - Pi node - don't try to send data if closing - Load node message catalog when added dynamically - Split palette labels on spaces and hyphens when laying out - - Warn if editor routes are accessed but runtime not started Closes #816 - - Better handling of zero-length flow files Closes #819 + - #816 Warn if editor routes are accessed but runtime not started Closes + - #819 Better handling of zero-length flow files Closes - Allow runtime calls to RED._ to specify other namespace - Better right alignment of numerics in delay and trigger nodes - Allow node modules to include example flows - Create node_modules in userDir - - Ensure errors in node def functions don't break view rendering Fixes #815 + - #815 Ensure errors in node def functions don't break view rendering Fixes - Updated Inject node info with instructions for flow and global options @@ -1642,13 +1754,13 @@ Fixes - Make jquery spinner element css consistent with other inputs - tcp node add reply (to all) capability - Allow the template node to be treated as plain text - - Validate MQTT In topics Fixes #792 - - httpNodeAuth should not block http options requests Fixes #793 + - #792 Validate MQTT In topics Fixes + - #793 httpNodeAuth should not block http options requests Fixes - Disable perMessageDeflate on WS servers - fixes 'zlib binding closed' error - Clear trigger status icon on re-deploy - Don't default inject payload to blank string - Trigger node, add configurable reset - - Allow function properties in settings Fixes #790 - fixes use of httpNodeMiddleware + - #790 - fixes use of httpNodeMiddleware Allow function properties in settings Fixes - Fix order of config dialog calls to save/creds/validate - Add debounce to Pi GPIO node @@ -1664,7 +1776,7 @@ Fixes - Add 'previous value' option to Switch node - Allow existing nodes to splice into links on drag - - CORS not properly configured on multiple http routes Fixes #783 + - #783 CORS not properly configured on multiple http routes Fixes - Restore shift-drag to snap/unsnap to grid - Moving nodes with keyboard should flag workspace dirty - Notifications flagged as fixed should not be click-closable diff --git a/Gruntfile.js b/Gruntfile.js index caa043e76..7f7e80f32 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -16,6 +16,7 @@ var path = require("path"); var fs = require("fs-extra"); +var sass = require("node-sass"); module.exports = function(grunt) { @@ -25,9 +26,13 @@ module.exports = function(grunt) { nodemonArgs.push(flowFile); } + var browserstack = grunt.option('browserstack'); + if (browserstack) { + process.env.BROWSERSTACK = true; + } var nonHeadless = grunt.option('non-headless'); if (nonHeadless) { - process.env.NODE_RED_NON_HEADLESS = 'true'; + process.env.NODE_RED_NON_HEADLESS = true; } grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), @@ -79,20 +84,20 @@ module.exports = function(grunt) { //"loopfunc": true, // allow functions to be defined in loops //"sub": true // don't warn that foo['bar'] should be written as foo.bar }, - all: [ - 'Gruntfile.js', - 'red.js', - 'packages/**/*.js' - ], - core: { - files: { - src: [ - 'Gruntfile.js', - 'red.js', - 'packages/**/*.js', - ] - } - }, + // all: [ + // 'Gruntfile.js', + // 'red.js', + // 'packages/**/*.js' + // ], + // core: { + // files: { + // src: [ + // 'Gruntfile.js', + // 'red.js', + // 'packages/**/*.js', + // ] + // } + // }, nodes: { files: { src: [ 'nodes/core/*/*.js' ] @@ -100,7 +105,7 @@ module.exports = function(grunt) { }, editor: { files: { - src: [ 'editor/js/**/*.js' ] + src: [ 'packages/node_modules/@node-red/editor-client/src/js/**/*.js' ] } }, tests: { @@ -188,7 +193,8 @@ module.exports = function(grunt) { "packages/node_modules/@node-red/editor-client/src/vendor/jquery/js/jquery-migrate-3.0.1.min.js", "packages/node_modules/@node-red/editor-client/src/vendor/jquery/js/jquery-ui.min.js", "packages/node_modules/@node-red/editor-client/src/vendor/jquery/js/jquery.ui.touch-punch.min.js", - "packages/node_modules/@node-red/editor-client/src/vendor/marked/marked.min.js", + "node_modules/marked/marked.min.js", + "node_modules/dompurify/dist/purify.min.js", "packages/node_modules/@node-red/editor-client/src/vendor/d3/d3.v3.min.js", "packages/node_modules/@node-red/editor-client/src/vendor/i18next/i18next.min.js", "node_modules/jsonata/jsonata-es5.min.js", @@ -220,6 +226,7 @@ module.exports = function(grunt) { sass: { build: { options: { + implementation: sass, outputStyle: 'compressed' }, files: [{ @@ -562,7 +569,20 @@ module.exports = function(grunt) { return false; } }); + grunt.registerTask('generatePublishScript', + 'Generates a script to publish build output to npm', + function () { + const done = this.async(); + const generatePublishScript = require("./scripts/generate-publish-script.js"); + generatePublishScript().then(function(output) { + grunt.log.writeln(output); + const filePath = path.join(grunt.config.get('paths.dist'),"modules","publish.sh"); + grunt.file.write(filePath,output); + + done(); + }); + }); grunt.registerTask('setDevEnv', 'Sets NODE_ENV=development so non-minified assets are used', function () { @@ -605,7 +625,7 @@ module.exports = function(grunt) { grunt.registerTask('release', 'Create distribution zip file', - ['build','verifyPackageDependencies','clean:release','mkdir:release','chmod:release','compress:release','pack-modules']); + ['build','verifyPackageDependencies','clean:release','mkdir:release','chmod:release','compress:release','pack-modules','generatePublishScript']); grunt.registerTask('pack-modules', 'Create module pack files for release', diff --git a/package.json b/package.json index 61242d8e1..ca61f0e49 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-red", - "version": "1.0.1", + "version": "1.0.4", "description": "Low-code programming for event-driven applications", "homepage": "http://nodered.org", "license": "Apache-2.0", @@ -24,7 +24,7 @@ } ], "dependencies": { - "ajv": "6.10.2", + "ajv": "6.12.0", "basic-auth": "2.0.1", "bcryptjs": "2.4.3", "body-parser": "1.19.0", @@ -34,47 +34,49 @@ "cookie": "0.4.0", "cookie-parser": "1.4.4", "cors": "2.8.5", - "cron": "1.7.1", + "cron": "1.8.2", "denque": "1.4.1", "express": "4.17.1", - "express-session": "1.16.2", + "express-session": "1.17.0", "fs-extra": "8.1.0", "fs.notify": "0.0.4", "hash-sum": "2.0.0", - "https-proxy-agent": "2.2.2", + "https-proxy-agent": "5.0.0", "i18next": "15.1.2", - "iconv-lite": "0.5.0", + "iconv-lite": "0.5.1", "is-utf8": "0.2.1", "js-yaml": "3.13.1", "json-stringify-safe": "5.0.1", - "jsonata": "1.6.5", + "jsonata": "1.8.1", "media-typer": "1.1.0", - "memorystore": "1.6.1", + "memorystore": "1.6.2", "mime": "2.4.4", "mqtt": "2.18.8", "multer": "1.4.2", - "mustache": "3.0.2", - "node-red-node-rbe": "^0.2.5", - "node-red-node-sentiment": "^0.1.4", - "node-red-node-tail": "^0.0.3", + "mustache": "4.0.0", + "node-red-node-rbe": "^0.2.6", + "node-red-node-sentiment": "^0.1.6", + "node-red-node-tail": "^0.1.0", "nopt": "4.0.1", "oauth2orize": "1.11.0", "on-headers": "1.0.2", - "passport": "0.4.0", + "passport": "0.4.1", "passport-http-bearer": "1.0.1", "passport-oauth2-client-password": "0.1.2", "raw-body": "2.4.1", "request": "2.88.0", "semver": "6.3.0", - "uglify-js": "3.6.0", + "uglify-js": "3.8.0", "when": "3.7.8", "ws": "6.2.1", - "xml2js": "0.4.19" + "xml2js": "0.4.23" }, "optionalDependencies": { "bcrypt": "3.0.6" }, "devDependencies": { + "marked": "0.8.0", + "dompurify": "2.0.8", "grunt": "~1.0.4", "grunt-chmod": "~1.1.1", "grunt-cli": "~1.3.2", @@ -93,19 +95,20 @@ "grunt-mocha-istanbul": "5.0.2", "grunt-nodemon": "~0.4.2", "grunt-npm-command": "~0.1.2", - "grunt-sass": "~2.0.0", + "grunt-sass": "~3.1.0", "grunt-simple-mocha": "~0.4.1", - "http-proxy": "^1.16.2", + "http-proxy": "1.18.0", "istanbul": "0.4.5", + "jsdoc-nr-template": "github:node-red/jsdoc-nr-template", "minami": "1.2.3", "mocha": "^5.2.0", "mosca": "^2.8.3", + "node-red-node-test-helper": "^0.2.3", + "node-sass": "^4.13.1", "should": "^8.4.0", "sinon": "1.17.7", "stoppable": "^1.1.0", - "supertest": "3.4.2", - "node-red-node-test-helper": "^0.2.3", - "jsdoc-nr-template": "node-red/jsdoc-nr-template" + "supertest": "3.4.2" }, "engines": { "node": ">=8" diff --git a/packages/node_modules/@node-red/editor-api/lib/auth/index.js b/packages/node_modules/@node-red/editor-api/lib/auth/index.js index a7ee2e7f3..189f903d8 100644 --- a/packages/node_modules/@node-red/editor-api/lib/auth/index.js +++ b/packages/node_modules/@node-red/editor-api/lib/auth/index.js @@ -100,7 +100,10 @@ function login(req,res) { } } else if (mergedAdminAuth.type === "strategy") { - var urlPrefix = (settings.httpAdminRoot==='/')?"":settings.httpAdminRoot; + var urlPrefix = (settings.httpAdminRoot||"").replace(/\/$/,""); + if (urlPrefix.length > 0) { + urlPrefix += "/"; + } response = { "type":"strategy", "prompts":[{type:"button",label:mergedAdminAuth.strategy.label, url: urlPrefix + "auth/strategy"}] diff --git a/packages/node_modules/@node-red/editor-api/lib/editor/index.js b/packages/node_modules/@node-red/editor-api/lib/editor/index.js index 3628fa702..a9cdf0ffc 100644 --- a/packages/node_modules/@node-red/editor-api/lib/editor/index.js +++ b/packages/node_modules/@node-red/editor-api/lib/editor/index.js @@ -88,13 +88,13 @@ module.exports = { // Locales var locales = require("./locales"); locales.init(runtimeAPI); - editorApp.get(/locales\/(.+)\/?$/,locales.get,apiUtil.errorHandler); + editorApp.get(/^\/locales\/(.+)\/?$/,locales.get,apiUtil.errorHandler); // Library var library = require("./library"); library.init(runtimeAPI); - editorApp.get(/library\/([^\/]+)\/([^\/]+)(?:$|\/(.*))/,needsPermission("library.read"),library.getEntry); - editorApp.post(/library\/([^\/]+)\/([^\/]+)\/(.*)/,needsPermission("library.write"),library.saveEntry); + editorApp.get(/^\/library\/([^\/]+)\/([^\/]+)(?:$|\/(.*))/,needsPermission("library.read"),library.getEntry); + editorApp.post(/^\/library\/([^\/]+)\/([^\/]+)\/(.*)/,needsPermission("library.write"),library.saveEntry); // Credentials diff --git a/packages/node_modules/@node-red/editor-api/lib/editor/locales.js b/packages/node_modules/@node-red/editor-api/lib/editor/locales.js index 5e10647e7..a7f300cd3 100644 --- a/packages/node_modules/@node-red/editor-api/lib/editor/locales.js +++ b/packages/node_modules/@node-red/editor-api/lib/editor/locales.js @@ -15,7 +15,7 @@ **/ var fs = require('fs'); var path = require('path'); -//var apiUtil = require('../util'); +// var apiUtil = require('../util'); var i18n = require("@node-red/util").i18n; // TODO: separate module @@ -41,7 +41,7 @@ module.exports = { var namespace = req.params[0]; var lngs = req.query.lng; namespace = namespace.replace(/\.json$/,""); - var lang = req.query.lng; //apiUtil.determineLangFromHeaders(req.acceptsLanguages() || []); + var lang = req.query.lng || i18n.defaultLang; //apiUtil.determineLangFromHeaders(req.acceptsLanguages() || []); var prevLang = i18n.i.language; // Trigger a load from disk of the language if it is not the default i18n.i.changeLanguage(lang, function(){ diff --git a/packages/node_modules/@node-red/editor-api/lib/index.js b/packages/node_modules/@node-red/editor-api/lib/index.js index 10c9912ed..0dc06ab71 100644 --- a/packages/node_modules/@node-red/editor-api/lib/index.js +++ b/packages/node_modules/@node-red/editor-api/lib/index.js @@ -42,7 +42,7 @@ var editor; /** * Initialise the module. * @param {Object} settings The runtime settings - * @param {HTTPServer} server An instance of HTTP Server + * @param {HTTPServer} _server An instance of HTTP Server * @param {Storage} storage An instance of Node-RED Storage * @param {Runtime} runtimeAPI An instance of Node-RED Runtime * @memberof @node-red/editor-api diff --git a/packages/node_modules/@node-red/editor-api/package.json b/packages/node_modules/@node-red/editor-api/package.json index bd461734d..9866a81ad 100644 --- a/packages/node_modules/@node-red/editor-api/package.json +++ b/packages/node_modules/@node-red/editor-api/package.json @@ -1,6 +1,6 @@ { "name": "@node-red/editor-api", - "version": "1.0.1", + "version": "1.0.4", "license": "Apache-2.0", "main": "./lib/index.js", "repository": { @@ -16,21 +16,21 @@ } ], "dependencies": { - "@node-red/util": "1.0.1", - "@node-red/editor-client": "1.0.1", + "@node-red/util": "1.0.4", + "@node-red/editor-client": "1.0.4", "bcryptjs": "2.4.3", "body-parser": "1.19.0", "clone": "2.1.2", "cors": "2.8.5", - "express-session": "1.16.2", + "express-session": "1.17.0", "express": "4.17.1", - "memorystore": "1.6.1", + "memorystore": "1.6.2", "mime": "2.4.4", - "mustache": "3.0.2", + "mustache": "4.0.0", "oauth2orize": "1.11.0", "passport-http-bearer": "1.0.1", "passport-oauth2-client-password": "0.1.2", - "passport": "0.4.0", + "passport": "0.4.1", "when": "3.7.8", "ws": "6.2.1" }, diff --git a/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json b/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json index fa347e6ea..a5f232aa6 100755 --- a/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json +++ b/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json @@ -15,6 +15,17 @@ "next": "Next", "clone": "Clone project", "cont": "Continue" + }, + "type": { + "string": "string", + "number": "number", + "boolean": "boolean", + "array": "array", + "buffer": "buffer", + "object": "object", + "jsonString": "JSON string", + "undefined": "undefined", + "null": "null" } }, "workspace": { @@ -792,10 +803,14 @@ "copyPath": "Copy path to item", "expandItems": "Expand items", "collapseItems": "Collapse items", - "duplicate": "Duplicate" + "duplicate": "Duplicate", + "error": { + "invalidJSON": "Invalid JSON: " + } }, "markdownEditor": { "title": "Markdown editor", + "expand": "Expand", "format": "Formatted with markdown", "heading1": "Heading 1", "heading2": "Heading 2", @@ -993,6 +1008,7 @@ "en-US": "English", "ja": "Japanese", "ko": "Korean", - "zh-CN": "Chinese(Simplified)" + "zh-CN": "Chinese(Simplified)", + "zh-TW": "Chinese(Traditional)" } } diff --git a/packages/node_modules/@node-red/editor-client/locales/en-US/jsonata.json b/packages/node_modules/@node-red/editor-client/locales/en-US/jsonata.json index 9c33e8d6d..d777d1919 100755 --- a/packages/node_modules/@node-red/editor-client/locales/en-US/jsonata.json +++ b/packages/node_modules/@node-red/editor-client/locales/en-US/jsonata.json @@ -1,7 +1,7 @@ { "$string": { - "args": "arg", - "desc": "Casts the *arg* parameter to a string using the following casting rules:\n\n - Strings are unchanged\n - Functions are converted to an empty string\n - Numeric infinity and NaN throw an error because they cannot be represented as a JSON number\n - All other values are converted to a JSON string using the `JSON.stringify` function" + "args": "arg[, prettify]", + "desc": "Casts the `arg` parameter to a string using the following casting rules:\n\n - Strings are unchanged\n - Functions are converted to an empty string\n - Numeric infinity and NaN throw an error because they cannot be represented as a JSON number\n - All other values are converted to a JSON string using the `JSON.stringify` function. If `prettify` is true, then \"prettified\" JSON is produced. i.e One line per field and lines will be indented based on the field depth." }, "$length": { "args": "str", @@ -185,7 +185,7 @@ }, "$reduce": { "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`.\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": { "args": "string[, string]", @@ -230,6 +230,41 @@ "$parseInteger": { "args": "string, picture", "desc": "Parses the contents of the `string` parameter to an integer (as a JSON number) using the format specified by the `picture` string. The `picture` string parameter has the same format as `$formatInteger`." - + }, + "$error": { + "args": "[str]", + "desc": "Throws an error with a message. The optional `str` will replace the default message of `$error() function evaluated`" + }, + "$assert": { + "args": "arg, str", + "desc": "If `arg` is true the function returns undefined. If `arg` is false an exception is thrown with `str` as the message of the exception." + }, + "$single": { + "args": "array, function", + "desc": "Returns the one and only value in the `array` parameter that satisfies the `function` predicate (i.e. the `function` returns Boolean `true` when passed the value). Throws an exception if the number of matching values is not exactly one.\n\nThe function should be supplied in the following signature: `function(value [, index [, array]])` where value is each input of the array, index is the position of that value and the whole array is passed as the third argument" + }, + "$encodeUrl": { + "args": "str", + "desc": "Encodes a Uniform Resource Locator (URL) component by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character.\n\nExample: `$encodeUrlComponent(\"?x=test\")` => `\"%3Fx%3Dtest\"`" + }, + "$encodeUrlComponent": { + "args": "str", + "desc": "Encodes a Uniform Resource Locator (URL) by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character. \n\nExample: `$encodeUrl(\"https://mozilla.org/?x=шеллы\")` => `\"https://mozilla.org/?x=%D1%88%D0%B5%D0%BB%D0%BB%D1%8B\"`" + }, + "$decodeUrl": { + "args": "str", + "desc": "Decodes a Uniform Resource Locator (URL) component previously created by encodeUrlComponent. \n\nExample: `$decodeUrlComponent(\"%3Fx%3Dtest\")` => `\"?x=test\"`" + }, + "$decodeUrlComponent": { + "args": "str", + "desc": "Decodes a Uniform Resource Locator (URL) previously created by encodeUrl. \n\nExample: `$decodeUrl(\"https://mozilla.org/?x=%D1%88%D0%B5%D0%BB%D0%BB%D1%8B\")` => `\"https://mozilla.org/?x=шеллы\"`" + }, + "$distinct": { + "args": "array", + "desc": "Returns an array with duplicate values removed from `array`" + }, + "$type": { + "args": "value", + "desc": "Returns the type of `value` as a string. If `value` is undefined, this will return `undefined`" } } diff --git a/packages/node_modules/@node-red/editor-client/locales/ja/editor.json b/packages/node_modules/@node-red/editor-client/locales/ja/editor.json index 989516b65..cf04ced1d 100755 --- a/packages/node_modules/@node-red/editor-client/locales/ja/editor.json +++ b/packages/node_modules/@node-red/editor-client/locales/ja/editor.json @@ -15,6 +15,17 @@ "next": "進む", "clone": "プロジェクトをクローン", "cont": "続ける" + }, + "type": { + "string": "文字列", + "number": "数値", + "boolean": "真偽値", + "array": "配列", + "buffer": "バッファ", + "object": "オブジェクト", + "jsonString": "JSON文字列", + "undefined": "undefined", + "null": "null" } }, "workspace": { @@ -791,10 +802,14 @@ "copyPath": "要素のパスをコピー", "expandItems": "要素を展開", "collapseItems": "要素を折り畳む", - "duplicate": "複製" + "duplicate": "複製", + "error": { + "invalidJSON": "不正なJSON: " + } }, "markdownEditor": { "title": "マークダウンエディタ", + "expand": "拡大", "format": "マークダウン形式で記述", "heading1": "見出しレベル1", "heading2": "見出しレベル2", @@ -955,7 +970,7 @@ "confirm": "

デプロイされていない変更は失われます。

続けますか?

" }, "send-req": { - "auth-req": "リポジトリ対する認証が必要です", + "auth-req": "リポジトリに対する認証が必要です", "username": "ユーザ名", "password": "パスワード", "passphrase": "パスフレーズ", @@ -992,6 +1007,7 @@ "en-US": "英語", "ja": "日本語", "ko": "韓国語", - "zh-CN": "中国語(簡体)" + "zh-CN": "中国語(簡体)", + "zh-TW": "中国語(繁体)" } } diff --git a/packages/node_modules/@node-red/editor-client/locales/ja/jsonata.json b/packages/node_modules/@node-red/editor-client/locales/ja/jsonata.json index 14cadfecf..659cf66df 100755 --- a/packages/node_modules/@node-red/editor-client/locales/ja/jsonata.json +++ b/packages/node_modules/@node-red/editor-client/locales/ja/jsonata.json @@ -1,7 +1,7 @@ { "$string": { - "args": "arg", - "desc": "以下の型変換ルールを用いて、引数 *arg* を文字列へ型変換します。:\n\n - 文字列は変換しません。\n - 関数は空の文字列に変換します。\n - JSONの数値として表現できないため、無限大やNaNはエラーになります。\n - 他の値は `JSON.stringify` 関数を用いて、JSONの文字列へ変換します。" + "args": "arg[, prettify]", + "desc": "以下の型変換ルールを用いて、引数 *arg* を文字列へ型変換します。:\n\n - 文字列は変換しません。\n - 関数は空の文字列に変換します。\n - JSONの数値として表現できないため、無限大やNaNはエラーになります。\n - 他の値は `JSON.stringify` 関数を用いて、JSONの文字列へ変換します。`prettify`が真の場合、JSONを整形出力します。フィールドを1行毎に出力。フィールドのネスト深さによってインデントを行います。" }, "$length": { "args": "str", @@ -185,7 +185,7 @@ }, "$reduce": { "args": "array, function [, init]", - "desc": "配列の各要素値に関数 `function` を連続的に適用して得られる集約値を返します。 `function` の適用の際には、直前の `function` の適用結果と要素値が引数として与えられます。\n\n関数 `function` は引数を2つ取り、配列の各要素の間に配置する中置演算子のように作用しなくてはなりません。\n\n任意の引数 `init` には、集約時の初期値を設定します。" + "desc": "配列の各要素値に関数 `function` を連続的に適用して得られる集約値を返します。 `function` の適用の際には、直前の `function` の適用結果と要素値が引数として与えられます。\n\n関数 `function` は引数を2つ取り、配列の各要素の間に配置する中置演算子のように作用しなくてはなりません。関数`function`のシグネチャは`myfunc($accumulator, $value[, $index[, $array]])`という形式でなければなりません。\n\n任意の引数 `init` には、集約時の初期値を設定します。" }, "$flowContext": { "args": "string", @@ -230,5 +230,41 @@ "$parseInteger": { "args": "string, picture", "desc": "`picture`文字列の指定に従って、`string`パラメータを整数(JSON数値)に変換します。`picture`文字列は`$formatInteger`と同じ形式です。" + }, + "$error": { + "args": "[str]", + "desc": "メッセージを指定して例外を送出します。メッセージ`str`を省略した場合は`$error() function evaluated`をメッセージとします。" + }, + "$assert": { + "args": "arg, str", + "desc": "`arg`が真の場合、undefinedを返します。偽の場合、`str`をメッセージとする例外を送出します。" + }, + "$single": { + "args": "array, function", + "desc": "`array`の要素のうち、条件判定関数`function`を満たす(`function`に与えた場合に真偽値`true`を返す)要素が1つのみである場合、それを返します。マッチする要素が1つのみでない場合、例外を送出します。\n\n指定する関数は`function(value [, index [, array]])`というシグネチャでなければなりません。ここで、`value`は`array`の要素値、`index`は要素の添字、第三引数には配列全体を渡します。" + }, + "$encodeUrl": { + "args": "str", + "desc": "Uniform Resource Locator (URL)を構成する文字を1、2、3、もしくは、4文字エスケープシーケンスのUTF-8文字エンコーディングで置換します。\n\n例: `$encodeUrlComponent(\"?x=test\")` => `\"%3Fx%3Dtest\"`" + }, + "$encodeUrlComponent": { + "args": "str", + "desc": "Uniform Resource Locator (URL)要素を構成する文字を1、2、3、もしくは、4文字エスケープシーケンスのUTF-8文字エンコーディングで置換します。\n\n例: `$encodeUrl(\"https://mozilla.org/?x=шеллы\")` => `\"https://mozilla.org/?x=%D1%88%D0%B5%D0%BB%D0%BB%D1%8B\"`" + }, + "$decodeUrl": { + "args": "str", + "desc": "encodeUrlComponentで置換したUniform Resource Locator (URL)をデコードします。\n\n例: `$decodeUrlComponent(\"%3Fx%3Dtest\")` => `\"?x=test\"`" + }, + "$decodeUrlComponent": { + "args": "str", + "desc": "encodeUrlで置換したUniform Resource Locator (URL)要素をデコードします。 \n\n例: `$decodeUrl(\"https://mozilla.org/?x=%D1%88%D0%B5%D0%BB%D0%BB%D1%8B\")` => `\"https://mozilla.org/?x=шеллы\"`" + }, + "$distinct": { + "args": "array", + "desc": "配列`array`から重複要素を削除した配列を返します。" + }, + "$type": { + "args": "value", + "desc": "`value` の型を文字列として返します。もし `value` が未定義の場合、 `undefined` が返されます。" } } diff --git a/packages/node_modules/@node-red/editor-client/locales/zh-CN/editor.json b/packages/node_modules/@node-red/editor-client/locales/zh-CN/editor.json index a45f37f66..95d3fa5ee 100644 --- a/packages/node_modules/@node-red/editor-client/locales/zh-CN/editor.json +++ b/packages/node_modules/@node-red/editor-client/locales/zh-CN/editor.json @@ -10,7 +10,22 @@ "load": "读取", "save": "保存", "import": "导入", - "export": "导出" + "export": "导出", + "back": "后退", + "next": "下一个", + "clone": "克隆项目", + "cont": "继续" + }, + "type": { + "string": "字符串", + "number": "数字", + "boolean": "布尔值", + "array": "数组", + "buffer": "buffer", + "object": "对象", + "jsonString": "JSON字符串", + "undefined": "未定义", + "null": "空" } }, "workspace": { @@ -19,10 +34,13 @@ "confirmDelete": "确认删除", "delete": "你确定想删除 '__label__'?", "dropFlowHere": "把流程放到这里", + "addFlow": "添加流程", + "listFlows": "流程一览", "status": "状态", "enabled": "有效", "disabled": "无效", - "info": "详细描述" + "info": "详细描述", + "selectNodes": "点击节点来选择" }, "menu": { "label": { @@ -36,11 +54,16 @@ "defaultDir": "默认方向", "ltr": "从左到右", "rtl": "从右到左", - "auto": "上下文" + "auto": "上下文", + "language": "语言", + "browserDefault": "浏览器默认" }, "sidebar": { "show": "显示侧边栏" }, + "palette": { + "show": "显示控制板" + }, "settings": "设置", "userSettings": "用户设置", "nodes": "节点", @@ -60,11 +83,23 @@ "keyboardShortcuts": "键盘快捷方式", "login": "登陆", "logout": "退出", - "editPalette":"节点管理", + "editPalette": "节点管理", "other": "其他", - "showTips": "显示小提示" + "showTips": "显示小提示", + "help": "Node-RED网页", + "projects": "项目", + "projects-new": "新建", + "projects-open": "打开", + "projects-settings": "项目设定", + "showNodeLabelDefault": "显示新添加的节点的标签" } }, + "actions": { + "toggle-navigator": "切换导航器", + "zoom-out": "缩小", + "zoom-reset": "重设缩放", + "zoom-in": "放大" + }, "user": { "loggedInAs": "作为__name__登陆", "username": "账号", @@ -82,29 +117,73 @@ "warning": "警告: __message__", "warnings": { "undeployedChanges": "节点中存在未部署的更改", + "nodeActionDisabled": "节点操作已禁用", "nodeActionDisabledSubflow": "节点动作在子流程中被禁用", "missing-types": "流程由于缺少节点类型而停止。请检查日志的详细信息", - "restartRequired": "Node-RED必须重新启动,以启用升级的模块" + "safe-mode": "

流程以安全模式停止。

您可以修改流程并部署更改以重新启动。

", + "restartRequired": "Node-RED必须重新启动,以启用升级的模块", + "credentials_load_failed": "

由于无法解密凭据,因此流程停止。

流程凭据文件已加密,但是项目的加密密钥丢失或无效。

", + "credentials_load_failed_reset": "

凭据无法解密

流凭据文件已加密,但是项目的加密密钥丢失或无效。

流凭据文件将在下一次部署时重置。任何现有的流凭证将被清除。

", + "missing_flow_file": "

找不到项目流程文件。

该项目未配置流程文件。

", + "missing_package_file": "

找不到项目包文件。

项目缺少package.json文件。

", + "project_empty": "

该项目为空。

是否要创建一组默认的项目文件?
否则,您将必须在编辑器外部手动将文件添加到项目中。

", + "project_not_found": "

未找到项目'__project__'。

", + "git_merge_conflict": "

自动合并更改失败。

修复未合并的冲突,然后提交结果。

" }, - "error": "Error: __message__", + "error": "错误: __message__", "errors": { "lostConnection": "丢失与服务器的连接,重新连接...", "lostConnectionReconnect": "丢失与服务器的连接,__time__秒后重新连接", "lostConnectionTry": "现在尝试", "cannotAddSubflowToItself": "无法向其自身添加子流程", "cannotAddCircularReference": "无法添加子流程 - 循环引用", - "unsupportedVersion": "您正在使用不受支持的Node.js版本
请升级到最新版本的Node.js LTS" + "unsupportedVersion": "您正在使用不受支持的Node.js版本
请升级到最新版本的Node.js LTS", + "failedToAppendNode": "

'__module__'加载失败

__error__

" + }, + "project": { + "change-branch": "转到本地分支'__project__'", + "merge-abort": "Git合并中止", + "loaded": "项目'__project__'已加载", + "updated": "项目'__project__'已更新", + "pull": "项目'__project__'已重新加载", + "revert": "项目 '__project__'已还原", + "merge-complete": "Git合并完成", + "setupCredentials": "设定证书", + "setupProjectFiles": "设置项目文件", + "no": "不了,谢谢", + "createDefault": "创建默认项目文件", + "mergeConflict": "显示合并冲突" + }, + "label": { + "manage-project-dep": "管理项目依赖性", + "setup-cred": "设定证书", + "setup-project": "设置项目文件", + "create-default-package": "创建默认的包文件", + "no-thanks": "不了,谢谢", + "create-default-project": "创建默认项目文件", + "show-merge-conflicts": "显示合并冲突" } }, "clipboard": { "clipboard": "剪贴板", "nodes": "节点", + "node": "__count__节点", + "node_plural": "__count__节点", + "configNode": "__count__配置节点", + "configNode_plural": "__count__配置节点", + "flow": "__count__流程", + "flow_plural": "__count__流程", + "subflow": "__count__子流程", + "subflow_plural": "__count__子流程", "pasteNodes": "在这里粘贴节点", + "selectFile": "选择要导入的文件", "importNodes": "导入节点", "exportNodes": "导出节点至剪贴板", + "download": "下载", "importUnrecognised": "导入了无法识别的类型:", "importUnrecognised_plural": "导入了无法识别的类型:", "nodesExported": "节点导出到了剪贴板", + "nodesImported": "导入:", "nodeCopied": "已复制__count__个节点", "nodeCopied_plural": "已复制__count__个节点", "invalidFlow": "无效的流程: __message__", @@ -114,11 +193,21 @@ "all": "所有流程", "compact": "紧凑", "formatted": "已格式化", - "copy": "导出到剪贴板" + "copy": "导出到剪贴板", + "export": "到处到库", + "exportAs": "导出为", + "overwrite": "替换", + "exists": "

\"__file__\"已存在

是否要替换它?

" }, "import": { "import": "导入到", - "newFlow": "新流程" + "newFlow": "新流程", + "errors": { + "notArray": "输入的不是JSON数组", + "itemNotObject": "输入的流无效 - 项目__index__不是节点对象", + "missingId": "输入的流无效-项 __index__ 缺少'id'属性", + "missingType": "输入的流程无效-项__index__缺少'类型'属性" + } }, "copyMessagePath": "已复制路径", "copyMessageValue": "已复制数值", @@ -132,7 +221,10 @@ "modifiedFlowsDesc": "只部署包含已更改节点的流", "modifiedNodes": "已更改的节点", "modifiedNodesDesc": "只部署已经更改的节点", + "restartFlows": "重启流程", + "restartFlowsDesc": "重新启动当前部署的流程", "successfulDeploy": "部署成功", + "successfulRestart": "成功重启流程", "deployFailed": "部署失败: __message__", "unusedConfigNodes": "您有一些未使用的配置节点", "unusedConfigNodesLink": "点击此处查看它们", @@ -152,16 +244,24 @@ "improperlyConfigured": "工作区包含一些未正确配置的节点:", "unknown": "工作区包含一些未知的节点类型:", "confirm": "你确定要部署吗?", + "doNotWarn": "不要再对此发出警告", "conflict": "服务器正在运行较新的一组流程。", "backgroundUpdate": "服务器上的流程已更新。", "conflictChecking": "检查是否可以自动合并更改", "conflictAutoMerge": "此更改不包括冲突,可以自动合并", - "conflictManualMerge": "这些更改包括了在部署之前必须解决的冲突。" + "conflictManualMerge": "这些更改包括了在部署之前必须解决的冲突。", + "plusNMore": "+ __count__更多" } }, + "eventLog": { + "title": "事件记录日志", + "view": "查看日志" + }, "diff": { "unresolvedCount": "__count__个未解决的冲突", "unresolvedCount_plural": "__count__个未解决的冲突", + "globalNodes": "全局节点", + "flowProperties": "流程属性", "type": { "added": "已添加", "changed": "已更改", @@ -175,9 +275,19 @@ "nodeCount": "__count__个节点", "nodeCount_plural": "__count__个节点", "local": "本地", - "remote": "远程" + "remote": "远程", + "reviewChanges": "查看变更", + "noBinaryFileShowed": "无法显示二进制文件内容", + "viewCommitDiff": "查看提交更改", + "compareChanges": "比较变更", + "saveConflict": "保存冲突解决", + "conflictHeader": "已解决__unresolved__中的__resolved__个冲突", + "commonVersionError": "通用版本不包含有效的JSON:", + "oldVersionError": "旧版本不包含有效的JSON:", + "newVersionError": "新版本不包含有效的JSON:" }, "subflow": { + "editSubflowInstance": "编辑子流实例:__name__", "editSubflow": "编辑流程模板: __name__", "edit": "编辑流程模板", "subflowInstances": "这个子流程模板有__count__个实例", @@ -185,8 +295,14 @@ "editSubflowProperties": "编辑属性", "input": "输入:", "output": "输出:", + "status": "状态节点", "deleteSubflow": "删除子流程", "info": "详细描述", + "category": "类别", + "env": { + "restore": "恢复为默认子流", + "remove": "删除环境变量" + }, "errors": { "noNodesSelected": "无法创建子流程: 未选择节点", "multipleInputsToSelection": "无法创建子流程: 多个输入到了选择" @@ -204,18 +320,68 @@ "editConfig": "编辑__type__配置", "addNewType": "添加新的__type__节点", "nodeProperties": "节点属性", + "label": "标签", + "color": "颜色", "portLabels": "端口标签", "labelInputs": "输入", "labelOutputs": "输出", + "settingIcon": "图标", + "default": "默认", "noDefaultLabel": "无", "defaultLabel": "使用默认标签", + "searchIcons": "搜索图标", + "useDefault": "使用默认", + "description": "描述", + "show": "显示", + "hide": "隐藏", + "locale": "选择界面语言", + "icon": "图标", + "inputType": "输入类型", + "inputs": { + "input": "输入", + "select": "选择", + "checkbox": "复选框", + "spinner": "微调器", + "none": "空", + "hidden": "隐藏属性" + }, + "types": { + "str": "字符串", + "num": "数字", + "bool": "布尔", + "json": "JSON", + "bin": "buffer", + "env": "环境变量" + }, + "menu": { + "input": "输入", + "select": "选择", + "checkbox": "复选框", + "spinner": "微调器", + "hidden": "仅标签" + }, + "select": { + "label": "标签", + "value": "值" + }, + "spinner": { + "min": "最小值", + "max": "最大值" + }, "errors": { - "scopeChange": "更改范围将使其他流中的节点无法使用" + "scopeChange": "更改范围将使其他流中的节点无法使用", + "invalidProperties": "无效的属性:" } }, "keyboard": { "title": "键盘快捷键", + "keyboard": "键盘", + "filterActions": "筛选动作", + "shortcut": "快捷键", + "scope": "范围", "unassigned": "未分配", + "global": "全局", + "workspace": "工作组", "selectAll": "选择所有节点", "selectAllConnected": "选择所有连接的节点", "addRemoveNode": "从选择中添加/删除节点", @@ -226,12 +392,14 @@ "nudgeNode": "移动所选节点(1px)", "moveNode": "移动所选节点(20px)", "toggleSidebar": "切换侧边栏", + "togglePalette": "切换控制板", "copyNode": "复制所选节点", "cutNode": "剪切所选节点", "pasteNode": "粘贴节点", "undoChange": "撤消上次执行的更改", "searchBox": "打开搜索框", - "managePalette": "管理面板" + "managePalette": "管理面板", + "actionList": "动作列表" }, "library": { "library": "库", @@ -239,30 +407,42 @@ "saveToLibrary": "保存到库...", "typeLibrary": "__type__类型库", "unnamedType": "无名__type__", - "exportToLibrary": "将节点导出到库", + "exportedToLibrary": "节点导出到库", "dialogSaveOverwrite": "一个叫做__libraryName__的__libraryType__已经存在,您需要覆盖么?", "invalidFilename": "无效的文件名", "savedNodes": "保存的节点", "savedType": "已保存__type__", "saveFailed": "保存失败: __message__", + "newFolder": "新文件夹", "types": { + "local": "本地的", "examples": "例子" - } + }, + "exportToLibrary": "将节点导出到库" }, "palette": { "noInfo": "无可用信息", "filter": "过滤节点", "search": "搜索模块", + "addCategory": "添加新的...", "label": { "subflows": "子流程", + "network": "网络", + "common": "共通", "input": "输入", "output": "输出", "function": "功能", + "sequence": "序列", + "parser": "解析", "social": "社交", "storage": "存储", "analysis": "分析", "advanced": "高级" }, + "actions": { + "collapse-all": "收起所有类别", + "expand-all": "展开所有类别" + }, "event": { "nodeAdded": "添加到面板中的节点:", "nodeAdded_plural": "添加到面板中的多个节点", @@ -276,6 +456,7 @@ }, "editor": { "title": "面板管理", + "palette": "控制板", "times": { "seconds": "秒前", "minutes": "分前", @@ -309,6 +490,8 @@ "updated": "已更新", "install": "安装", "installed": "已安装", + "conflict": "冲突", + "conflictTip": "

无法安装此模块,因为它包含已安装的
节点类型

__module__冲突

", "loading": "加载目录...", "tab-nodes": "节点", "tab-install": "安装", @@ -356,6 +539,7 @@ "label": "信息", "node": "节点", "type": "类型", + "module": "模组", "id": "ID", "status": "状态", "enabled": "启用", @@ -364,17 +548,18 @@ "instances": "实例", "properties": "属性", "info": "信息", + "desc": "描述", "blank": "空白", "null": "空", "showMore": "展开", "showLess": "收起", "flow": "流程", - "selection":"选择", - "nodes":"__count__ 个节点", + "selection": "选择", + "nodes": "__count__ 个节点", "flowDesc": "流程描述", "subflowDesc": "子流程描述", "nodeHelp": "节点帮助", - "none":"无", + "none": "无", "arrayItems": "__count__个项目", "showTips": "您可以从设置面板启用提示信息" }, @@ -386,9 +571,25 @@ "subflows": "子流程", "flows": "流程", "filterAll": "所有", + "showAllConfigNodes": "显示所有配置节点", "filterUnused": "未使用", + "showAllUnusedConfigNodes": "显示所有未使用的配置节点", "filtered": "__count__ 个隐藏" }, + "context": { + "name": "上下文数据", + "label": "上下午", + "none": "未选择", + "refresh": "刷新以加载", + "empty": "空", + "node": "节点", + "flow": "流程", + "global": "全局", + "deleteConfirm": "你确定要删除这个项目吗?", + "autoRefresh": "刷新选择更改", + "refrsh": "刷新", + "delete": "删除" + }, "palette": { "name": "节点管理", "label": "节点" @@ -399,8 +600,151 @@ "description": "描述", "dependencies": "依赖", "settings": "设置", + "noSummaryAvailable": "无可用摘要", "editDescription": "编辑项目描述", - "editDependencies": "编辑项目依赖" + "editDependencies": "编辑项目依赖", + "noDescriptionAvailable": "没有可用的描述", + "editReadme": "编辑README.md", + "showProjectSettings": "显示项目设置", + "projectSettings": { + "title": "项目设置", + "edit": "编辑", + "none": "空", + "install": "安装", + "removeFromProject": "从项目中删除", + "addToProject": "添加到项目", + "files": "文件", + "package": "包", + "flow": "流程", + "credentials": "证书", + "packageCreate": "保存更改后将创建文件", + "fileNotExist": "文件不存在", + "selectFile": "选择文件", + "invalidEncryptionKey": "无效的加密密钥", + "encryptionEnabled": "启用加密", + "encryptionDisabled": "加密已禁用", + "setTheEncryptionKey": "设置加密密钥", + "resetTheEncryptionKey": "重置加密密钥", + "changeTheEncryptionKey": "更改加密密钥", + "currentKey": "当前密钥", + "newKey": "新密钥", + "credentialsAlert": "这将删除所有现有凭证", + "versionControl": "版本控制", + "branches": "分支", + "noBranches": "没有分支", + "deleteConfirm": "您确定要删除本地分支'__name__'吗? 这不能被撤消。", + "unmergedConfirm": "本地分支'__name__'具有未合并的更改,这些更改将丢失。你确定要删除吗?", + "deleteUnmergedBranch": "删除未合并的分支", + "gitRemotes": "Git远程仓库", + "addRemote": "添加远程仓库", + "addRemote2": "添加远程仓库", + "remoteName": "远程仓库名", + "nameRule": "只能包含A-Z 0-9 _ -", + "url": "URL", + "urlRule": "https://, ssh:// or file://", + "urlRule2": "网址中不能包含用户名/密码", + "noRemotes": "没有远程仓库", + "deleteRemoteConfrim": "您确定要删除远程仓库'__name__'吗?", + "deleteRemote": "删除远程仓库" + }, + "userSettings": { + "committerDetail": "提交者详细信息", + "committerTip": "保留空白以使用系统默认值", + "userName": "用户名", + "email": "电子邮件", + "sshKeys": "SSH密钥", + "sshKeysTip": "允许您创建到远程git存储库的安全连接。", + "add": "添加密钥", + "addSshKey": "添加SSH密钥", + "addSshKeyTip": "生成新的公钥/私钥对", + "name": "名字", + "nameRule": "只能包含A-Z 0-9 _ -", + "passphrase": "密码短语", + "passphraseShort": "密码短语过短", + "optional": "可选的", + "cancel": "取消", + "generate": "生成密钥", + "noSshKeys": "没有SSH密钥", + "copyPublicKey": "将公钥复制到剪贴板", + "delete": "删除密钥", + "gitConfig": "Git配置", + "deleteConfirm": "您确定要删除SSH密钥__name__吗?这不能被撤消。" + }, + "versionControl": { + "unstagedChanges": "未暂存的变更", + "stagedChanges": "暂存的变更", + "unstageChange": "取消变更的暂存", + "stageChange": "暂存变更", + "unstageAllChange": "取消所有变更的暂存", + "stageAllChange": "暂存所有变更", + "commitChanges": "提交变更", + "resolveConflicts": "解决冲突", + "head": "HEAD", + "staged": "暂存的", + "unstaged": "未暂存的", + "local": "本地的", + "remote": "远程的", + "revert": "您确定要将更改恢复为'__file__'吗?这不能被撤消。", + "revertChanges": "还原变更", + "localChanges": "本地变更", + "none": "None", + "conflictResolve": "解决所有冲突。提交更改以完成合并。", + "localFiles": "本地文件", + "all": "所有的", + "unmergedChanges": "未合并的更改", + "abortMerge": "中止合并", + "commit": "提交", + "changeToCommit": "提交变更", + "commitPlaceholder": "输入您的提交信息", + "cancelCapital": "取消", + "commitCapital": "提交", + "commitHistory": "提交历史", + "branch": "分支:", + "moreCommits": "更多提交", + "changeLocalBranch": "变更本地分支", + "createBranchPlaceholder": "查找或创建分支", + "upstream": "上游", + "localOverwrite": "切换分支会覆盖您现有的本地更改。您必须先提交或撤消那些更改。", + "manageRemoteBranch": "管理远程分支", + "unableToAccess": "无法访问远程存储库", + "retry": "重试", + "setUpstreamBranch": "设置为上游分支", + "createRemoteBranchPlaceholder": "查找或创建远程分支", + "trackedUpstreamBranch": "创建的分支将被设置为跟踪的上游分支。", + "selectUpstreamBranch": "分支将被创建。 在下面选择以将其设置为被跟踪的上游分支。", + "pushFailed": "推送失败,因为远程具有更多的最新提交。请先拉取并合并,然后再尝试推送。", + "push": "推送", + "pull": "拉取", + "unablePull": "

无法提取远程更改;您未暂存的本地更改将被覆盖。

请先提交更改,然后重试。

", + "showUnstagedChanges": "显示未暂存的更改", + "connectionFailed": "无法连接到远程存储库:", + "pullUnrelatedHistory": "

远程有无关的提交历史

您确定要将这些更改拉入本地仓库吗?

", + "pullChanges": "拉取更改", + "history": "历史", + "projectHistory": "项目历史", + "daysAgo": "__count__天前", + "daysAgo_plural": "__count__天前", + "hoursAgo": "__count__小时前", + "hoursAgo_plural": "__count__小时前", + "minsAgo": "__count__分钟前", + "minsAgo_plural": "__count__分钟前", + "secondsAgo": "秒前", + "notTracking": "您的本地分支当前未跟踪一个远程分支。", + "statusUnmergedChanged": "您的仓库中有未合并的更改。您需要解决冲突并提交结果。", + "repositoryUpToDate": "您的仓库是最新的。", + "commitsAhead": "您的存储库领先远程仓库__count__次提交。您现在可以推送这些提交。", + "commitsAhead_plural": "您的存储库领先远程仓库__count__次提交。您现在可以推送这些提交。", + "commitsBehind": "您的存储库落后远程仓库__count__次提交。您现在可以拉取这些提交。", + "commitsBehind_plural": "您的存储库落后远程仓库__count__次提交。您现在可以拉取这些提交。", + "commitsAheadAndBehind1": "您的存储库落后远程仓库__count__次提交", + "commitsAheadAndBehind1_plural": "您的存储库落后远程仓库__count__次提交", + "commitsAheadAndBehind2": "领先远程仓库__count__次提交。", + "commitsAheadAndBehind2_plural": "领先远程仓库__count__次提交。", + "commitsAheadAndBehind3": "您必须先拉取远程提交,然后才能进行推送。", + "commitsAheadAndBehind3_plural": "您必须先拉取远程提交,然后才能进行推送。", + "refreshCommitHistory": "刷新提交历史", + "refreshChanges": "刷新更改" + } } }, "typedInput": { @@ -408,10 +752,12 @@ "str": "文字列", "num": "数字", "re": "正则表达式", - "bool": "布尔", + "bool": "布尔值", "json": "JSON", "bin": "二进制流", - "date": "时间戳" + "date": "时间戳", + "jsonata": "表达式", + "env": "环境变量" } }, "editableList": { @@ -423,8 +769,10 @@ }, "expressionEditor": { "functions": "功能", + "functionReference": "功能reference", "insert": "插入", "title": "JSONata表达式编辑器", + "test": "测试", "data": "示例消息", "result": "结果", "format": "格式表达方法", @@ -438,14 +786,229 @@ "eval": "评估表达式错误:\n __message__" } }, + "jsEditor": { + "title": "JavaScript编辑器" + }, + "textEditor": { + "title": "文本编辑器" + }, "jsonEditor": { "title": "JSON编辑器", - "format": "格式化JSON" + "format": "格式化JSON", + "rawMode": "编辑 JSON", + "uiMode": "Visual编辑器", + "insertAbove": "在上方插入", + "insertBelow": "在下方插入", + "addItem": "添加项目", + "copyPath": "复制路径到项目", + "expandItems": "展开项目", + "collapseItems": "收合项目", + "duplicate": "重复", + "error": { + "invalidJSON": "无效的JSON: " + } + }, + "markdownEditor": { + "title": "Markdown编辑器", + "expand": "展开", + "format": "格式化为markdown", + "heading1": "标题 1", + "heading2": "标题 2", + "heading3": "标题 3", + "bold": "粗体", + "italic": "斜体", + "code": "代码", + "ordered-list": "排序的列表", + "unordered-list": "非排序的列表", + "quote": "引用", + "link": "链接", + "horizontal-rule": "水平线", + "toggle-preview": "切换预览" }, "bufferEditor": { "title": "缓冲区编辑器", "modeString": "作为UTF-8字符串处理", "modeArray": "作为JSON数组处理", "modeDesc": "

缓冲区编辑器

缓冲区类型被存储为字节值的JSON数组。编辑器将尝试将输入的数值解析为JSON数组。如果它不是有效的JSON,它将被视为UTF-8字符串,并被转换为单个字符代码点的数组。

例如,Hello World的值会被转换为JSON数组:

[72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100]

" + }, + "projects": { + "config-git": "配置Git客户端", + "welcome": { + "hello": "你好! 我们已经将“项目”引入了Node-RED。", + "desc0": "这是一种用于管理流程文件的新方法,并且包括对流程的版本控制。", + "desc1": "首先,您可以创建您的第一个项目或从git存储库克隆现有项目。", + "desc2": "如果不确定,可以暂时跳过此步骤。您仍然可以随时通过“项目”菜单创建第一个项目。", + "create": "建立专案", + "clone": "克隆仓库", + "openExistingProject": "打开现有项目", + "not-right-now": "不是现在" + }, + "git-config": { + "setup": "设置您的版本控制客户端", + "desc0": "Node-RED使用开源工具Git进行版本控制。它跟踪对项目文件的更改,并允许您将其推送到远程存储库。", + "desc1": "提交一组更改时,Git会使用用户名和电子邮件地址记录谁进行了更改。用户名可以是您想要的任何名称-不必是您的真实姓名。", + "desc2": "您的Git客户端已经配置了以下详细信息。", + "desc3": "您可以稍后在设置对话框的'Git config'标签下更改这些设置。", + "username": "用户名", + "email": "电子邮件" + }, + "project-details": { + "create": "创建你的项目", + "desc0": "项目被维护为Git仓库。与他人一起共享您的流程", + "desc1": "您可以创建多个项目,并通过编辑器在它们之间快速切换。", + "desc2": "首先,您的项目需要一个名称和一个可选的描述。", + "already-exists": "项目已存在", + "must-contain": "只能包含A-Z 0-9 _ -", + "project-name": "项目名", + "desc": "描述", + "opt": "可选的" + }, + "clone-project": { + "clone": "克隆一个项目", + "desc0": "如果您已经有一个包含项目的git仓库,则可以对其进行克隆以开始使用。", + "already-exists": "项目已存在", + "must-contain": "只能包含A-Z 0-9 _ -", + "project-name": "项目名", + "no-info-in-url": "网址中不要包含用户名/密码", + "git-url": "Git仓库的url", + "protocols": "https://, ssh:// or file://", + "auth-failed": "认证失败", + "username": "用户名", + "passwd": "秘密啊", + "ssh-key": "SSH密钥", + "passphrase": "密码短语", + "ssh-key-desc": "在通过ssh克隆仓库之前,必须添加SSH密钥才能访问它。", + "ssh-key-add": "添加一个ssh密钥", + "credential-key": "证书加密密钥", + "cant-get-ssh-key": "错误! 无法获取所选的SSH密钥路径。", + "already-exists2": "已存在", + "git-error": "git错误", + "connection-failed": "连接失败", + "not-git-repo": "不是一个git仓库", + "repo-not-found": "未发现仓库" + }, + "default-files": { + "create": "创建您的项目文件", + "desc0": "一个包含您的流程文件,Readme文件和package.json文件的项目。", + "desc1": "它可以包含您要在Git仓库中维护的任何其他文件。", + "desc2": "您现有的流程和凭证文件将被复制到项目中。", + "flow-file": "流程文件", + "credentials-file": "证书文件" + }, + "encryption-config": { + "setup": "设置证书文件的加密", + "desc0": "您的流程证书文件可以被加密以确保其内容安全。", + "desc1": "如果要将这些证书存储在公共Git存储库中,则必须通过提供密钥短语来对它们进行加密。", + "desc2": "您的流程证书文件当前未加密。", + "desc3": "这意味着任何有权访问该文件的人都可以读取其内容,例如密码和访问令牌。", + "desc4": "如果要将这些证书存储在公共Git仓库中,则必须通过提供密钥短语来对它们进行加密。", + "desc5": "当前,使用设置文件中的credentialSecret属性作为密钥来加密流程证书文件。", + "desc6": "您的流程证书文件当前使用系统生成的密钥加密。您应该为此项目提供一个新的密钥。", + "desc7": "密钥将与项目文件分开存储。您将需要提供在另一个Node-RED实例中使用该项目的密钥。", + "credentials": "证书", + "enable": "启用加密", + "disable": "禁用加密", + "disabled": "禁用的", + "copy": "复制现有密钥", + "use-custom": "使用自定义密钥", + "desc8": "证书文件不会被加密,其内容很容易阅读", + "create-project-files": "创建项目文件", + "create-project": "创建项目", + "already-exists": "已存在", + "git-error": "git错误", + "git-auth-error": "git认证错误" + }, + "create-success": { + "success": "您已经成功创建了第一个项目!", + "desc0": "现在,您可以像往常一样继续使用Node-RED。", + "desc1": "侧栏中的“信息”标签显示了您当前的活动项目。名称旁边的按钮可用于访问项目设置视图。", + "desc2": "侧栏中的“历史记录”标签可用于查看项目中已更改的文件并提交。它向您显示了提交的完整历史记录,并允许您将更改推送到远程存储库。" + }, + "create": { + "projects": "项目", + "already-exists": "项目已存在", + "must-contain": "只能包含A-Z 0-9 _ -", + "no-info-in-url": "网址中不要包含用户名/密码", + "open": "打开项目", + "create": "创建项目", + "clone": "克隆仓库", + "project-name": "项目名", + "desc": "描述", + "opt": "可选的", + "flow-file": "流程文件", + "credentials": "证书", + "enable-encryption": "启用加密", + "disable-encryption": "禁用加密", + "encryption-key": "加密密钥", + "desc0": "用来保护您的凭证的短语", + "desc1": "凭证文件不会被加密,其内容很容易阅读", + "git-url": "Git存储库URL", + "protocols": "https://, ssh:// or file://", + "auth-failed": "验证失败", + "username": "用户名", + "password": "密码", + "ssh-key": "SSH密钥", + "passphrase": "密码短语", + "desc2": "在通过ssh克隆存储库之前,必须添加SSH密钥才能访问它。", + "add-ssh-key": "添加一个ssh密钥", + "credentials-encryption-key": "证书加密密钥", + "already-exists-2": "已存在", + "git-error": "git错误", + "con-failed": "连接失败", + "not-git": "不是git仓库", + "no-resource": "找不到存储库", + "cant-get-ssh-key-path": "错误!无法获取所选的SSH密钥路径。", + "unexpected_error": "意外的错误" + }, + "delete": { + "confirm": "您确定要删除此项目吗?" + }, + "create-project-list": { + "search": "搜索您的项目", + "current": "当前的" + }, + "require-clean": { + "confirm": "

您有未部署的更改,这些更改将丢失。

您要继续吗?

" + }, + "send-req": { + "auth-req": "存储库需要认证", + "username": "用户名", + "password": "秘密", + "passphrase": "密码短语", + "retry": "重试", + "update-failed": "无法更新身份验证", + "unhandled": "未处理的错误响应" + }, + "create-branch-list": { + "invalid": "无效的分支", + "create": "创建分支", + "current": "当前的" + }, + "create-default-file-set": { + "no-active": "没有活动项目就无法创建默认文件集", + "no-empty": "无法在非空项目上创建默认文件集", + "git-error": "git错误" + }, + "errors": { + "no-username-email": "您的Git客户端未配置用户名/电子邮件。", + "unexpected": "发生了一个意料之外的问题", + "code": "代码" + } + }, + "editor-tab": { + "properties": "属性", + "envProperties": "环境变量", + "description": "描述", + "appearance": "外观", + "preview": "UI预览", + "defaultValue": "默认值" + }, + "languages": { + "de": "德语", + "en-US": "英文", + "ja": "日语", + "ko": "韩文", + "zh-CN": "简体中文", + "zh-TW": "繁体中文" } } diff --git a/packages/node_modules/@node-red/editor-client/locales/zh-CN/jsonata.json b/packages/node_modules/@node-red/editor-client/locales/zh-CN/jsonata.json index 669a7683a..f27ec1f51 100644 --- a/packages/node_modules/@node-red/editor-client/locales/zh-CN/jsonata.json +++ b/packages/node_modules/@node-red/editor-client/locales/zh-CN/jsonata.json @@ -214,5 +214,57 @@ "$toMillis": { "args": "timestamp", "desc": "将ISO 8601格式的字符串`timestamp`转换为从UNIX时间 (1970年1月1日 UTC/GMT的午夜)开始到现在的毫秒数。如果该字符串的格式不正确,则抛出错误。" + }, + "$env": { + "args": "arg", + "desc": "返回环境变量的值。\n\n这是Node-RED定义的函数。" + }, + "$eval": { + "args": "expr [, context]", + "desc": "使用当前上下文来作为评估依据,分析并评估字符串`expr`,其中包含文字JSON或JSONata表达式。" + }, + "$formatInteger": { + "args": "number, picture", + "desc": "将“数字”转换为字符串,并将其格式化为“图片”字符串指定的整数表示形式。图片字符串参数定义了数字的格式,并具有与XPath F&O 3.1 规范中的fn:format-integer相同的语法。" + }, + "$parseInteger": { + "args": "string, picture", + "desc": "使用“图片”字符串指定的格式将“字符串”参数的内容解析为整数(作为JSON数字)。图片字符串参数与$formatInteger格式相同。." + }, + "$error": { + "args": "[str]", + "desc": "引发错误并显示一条消息。 可选的`str`将替代$error()函数评估的默认消息。" + }, + "$assert": { + "args": "arg, str", + "desc": "如果`arg`为真,则该函数返回。 如果arg为假,则抛出带有str的异常作为异常消息。" + }, + "$single": { + "args": "array, function", + "desc": "返回满足参数function谓语的array参数中的唯一值 (比如:传递值时,函数返回布尔值“true”)。如果匹配值的数量不唯一时,则抛出异常。\n\n应在以下签名中提供函数:`function(value [,index [,array []]])`其中value是数组的每个输入,index是该值的位置,整个数组作为第三个参数传递。" + }, + "$encodeUrl": { + "args": "str", + "desc": "通过用表示字符的UTF-8编码的一个,两个,三个或四个转义序列替换某些字符的每个实例,对统一资源定位符(URL)组件进行编码。\n\n示例:`$encodeUrlComponent(\"?x=test\")` => `\"%3Fx%3Dtest\"`" + }, + "$encodeUrlComponent": { + "args": "str", + "desc": "通过用表示字符的UTF-8编码的一个,两个,三个或四个转义序列替换某些字符的每个实例,对统一资源定位符(URL)进行编码。\n\n示例: `$encodeUrl(\"https://mozilla.org/?x=шеллы\")` => `\"https://mozilla.org/?x=%D1%88%D0%B5%D0%BB%D0%BB%D1%8B\"`" + }, + "$decodeUrl": { + "args": "str", + "desc": "解码以前由encodeUrlComponent创建的统一资源定位器(URL)组件。 \n\n示例: `$decodeUrlComponent(\"%3Fx%3Dtest\")` => `\"?x=test\"`" + }, + "$decodeUrlComponent": { + "args": "str", + "desc": "解码先前由encodeUrl创建的统一资源定位符(URL)。 \n\n示例: `$decodeUrl(\"https://mozilla.org/?x=%D1%88%D0%B5%D0%BB%D0%BB%D1%8B\")` => `\"https://mozilla.org/?x=шеллы\"`" + }, + "$distinct": { + "args": "array", + "desc": "返回一个数组,其中重复的值已从`数组`中删除" + }, + "$type": { + "args": "value", + "desc": "以字符串形式返回`值`的类型。 如果该`值`未定义,则将返回`未定义`" } } diff --git a/packages/node_modules/@node-red/editor-client/locales/zh-TW/editor.json b/packages/node_modules/@node-red/editor-client/locales/zh-TW/editor.json new file mode 100644 index 000000000..897599bc7 --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/locales/zh-TW/editor.json @@ -0,0 +1,1015 @@ +{ + "common": { + "label": { + "name": "名稱", + "ok": "確認", + "done": "完成", + "cancel": "取消", + "delete": "刪除", + "close": "關閉", + "load": "讀取", + "save": "保存", + "import": "匯入", + "export": "匯出", + "back": "返回", + "next": "下一步", + "clone": "複製專案", + "cont": "Continue" + }, + "type": { + "string": "字符串", + "number": "數值", + "boolean": "布林", + "array": "數組", + "buffer": "buffer", + "object": "對象", + "jsonString": "JSON字符串", + "undefined": "未定義", + "null": "空" + } + }, + "workspace": { + "defaultName": "流程__number__", + "editFlow": "編輯流程: __name__", + "confirmDelete": "確認刪除", + "delete": "確定想要刪除 '__label__'?", + "dropFlowHere": "把流程放到這裡", + "addFlow": "新增流程", + "listFlows": "流程列表", + "status": "狀態", + "enabled": "有效", + "disabled": "無效", + "info": "詳細描述", + "selectNodes": "點擊節點用於選擇" + }, + "menu": { + "label": { + "view": { + "view": "顯示", + "grid": "格線", + "showGrid": "顯示格線", + "snapGrid": "對齊格線", + "gridSize": "格線尺寸", + "textDir": "文本方向", + "defaultDir": "默認方向", + "ltr": "從左到右", + "rtl": "從右到左", + "auto": "上下文", + "language": "語言", + "browserDefault": "瀏覽器默認" + }, + "sidebar": { + "show": "顯示側邊欄" + }, + "palette": { + "show": "顯示控制板" + }, + "settings": "設置", + "userSettings": "使用者設置", + "nodes": "節點", + "displayStatus": "顯示節點狀態", + "displayConfig": "修改節點配置", + "import": "匯入", + "export": "匯出", + "search": "搜尋流程", + "searchInput": "搜尋流程", + "subflows": "子流程", + "createSubflow": "新建子流程", + "selectionToSubflow": "將選擇部分更改為子流程", + "flows": "流程", + "add": "增加", + "rename": "重新命名", + "delete": "刪除", + "keyboardShortcuts": "鍵盤快速鍵", + "login": "登入", + "logout": "退出", + "editPalette": "節點管理", + "other": "其他", + "showTips": "顯示小提示", + "help": "Node-RED website", + "projects": "專案", + "projects-new": "新專案", + "projects-open": "開啟專案", + "projects-settings": "專案設定", + "showNodeLabelDefault": "顯示新添加節點的標籤" + } + }, + "actions": { + "toggle-navigator": "切換導航器", + "zoom-out": "縮小", + "zoom-reset": "重置縮放", + "zoom-in": "放大" + }, + "user": { + "loggedInAs": "作為__name__登入", + "username": "帳號", + "password": "密碼", + "login": "登入", + "loginFailed": "登入失敗", + "notAuthorized": "未授權", + "errors": { + "settings": "設置資訊需要登入後才能訪問", + "deploy": "改動需要登入後才能部署", + "notAuthorized": "此操作需要登入後才能執行" + } + }, + "notification": { + "warning": "警告: __message__", + "warnings": { + "undeployedChanges": "節點中存在未部署的更改", + "nodeActionDisabled": "節點動作在子流程中被禁用", + "nodeActionDisabledSubflow": "子流程中禁用了節點操作", + "missing-types": "流程由於缺少節點類型而停止。請檢查日誌的詳細資訊", + "safe-mode": "

流程在安全模式下停止。

您可以修改流程並部署更改以重新啟動。

", + "restartRequired": "Node-RED必須重新啟動,以啟用升級的模組", + "credentials_load_failed": "

流程由於無法解密證書而停止。

流程證書文件已加密,但是項目的加密密鑰丟失或無效。

", + "credentials_load_failed_reset": "

證書無法解密

流程證書文件已加密,但是項目的加密密鑰丟失或無效。

流程證書文件將在下一次部署時重置。任何現有的流程證書將被清除。

", + "missing_flow_file": "

找不到項目流程文件。

該項目未配置流程文件。

", + "missing_package_file": "

找不到項目包文件。

項目缺少package.json文件。

", + "project_empty": "

該項目為空。

是否要創建一組默認的項目文件?
否則,您將不得不在編輯器外部手動將文件添加到項目中。

", + "project_not_found": "

找不到項目的'__project__'

", + "git_merge_conflict": "

自動合併更改失敗。

修復未合併的衝突,然後提交結果。

" + }, + "error": "Error: __message__", + "errors": { + "lostConnection": "丟失與伺服器的連接,重新連接...", + "lostConnectionReconnect": "丟失與伺服器的連接,__time__秒後重新連接", + "lostConnectionTry": "現在嘗試", + "cannotAddSubflowToItself": "無法向其自身添加子流程", + "cannotAddCircularReference": "無法添加子流程 - 迴圈引用", + "unsupportedVersion": "您正在使用不受支持的Node.js版本
請升級到最新版本的Node.js LTS", + "failedToAppendNode": "

加載'__module__'失敗

__error__

" + }, + "project": { + "change-branch": "轉到本地分支'__project__'", + "merge-abort": "Git合併中止", + "loaded": "已加載項目'__project__'", + "updated": "已更新項目'__project__'", + "pull": "已重新加載項目'__project__'", + "revert": "項目“__project__”已還原", + "merge-complete": "Git合併完成", + "setupCredentials": "設定證書", + "setupProjectFiles": "設置項目文件", + "no": "不了,謝謝", + "createDefault": "創建默認項目文件", + "mergeConflict": "顯示合併衝突" + }, + "label": { + "manage-project-dep": "管理項目依賴性", + "setup-cred": "設定憑證", + "setup-project": "設置項目文件", + "create-default-package": "創建默認的包文件", + "no-thanks": "不了,謝謝", + "create-default-project": "創建默認項目文件", + "show-merge-conflicts": "顯示合併衝突" + } + }, + "clipboard": { + "clipboard": "剪貼簿", + "nodes": "節點", + "node": "__count__ 節點", + "node_plural": "__count__ 多個節點", + "configNode": "__count__ 節點組態", + "configNode_plural": "__count__ 多節點組態", + "flow": "__count__ 流程", + "flow_plural": "__count__ 多流程", + "subflow": "__count__ 子流程", + "subflow_plural": "__count__ 多子流程", + "pasteNodes": "在這裡粘貼節點", + "selectFile": "匯入所選檔案", + "importNodes": "匯入節點", + "exportNodes": "匯出節點至剪貼簿", + "download": "下載", + "importUnrecognised": "匯入了無法識別的類型:", + "importUnrecognised_plural": "匯入了無法識別的類型:", + "nodesExported": "節點匯出到了剪貼簿", + "nodesImported": "已匯入:", + "nodeCopied": "已複製__count__個節點", + "nodeCopied_plural": "已複製__count__個節點", + "invalidFlow": "無效的流程: __message__", + "export": { + "selected": "已選擇的節點", + "current": "現在的節點", + "all": "所有流程", + "compact": "緊湊", + "formatted": "已格式化", + "copy": "匯出到剪貼簿", + "export": "匯出到庫", + "exportAs": "匯出為", + "overwrite": "取代", + "exists": "

\"__file__\" 已經存在.

是否要取代?

" + }, + "import": { + "import": "匯入到", + "newFlow": "新流程", + "errors": { + "notArray": "輸入的不是JSON數組", + "itemNotObject": "輸入的流程無效-項目__index__不是節點對象", + "missingId": "輸入的流程無效-項__index__缺少“ id”屬性", + "missingType": "輸入的流程無效-項__index__缺少“類型”屬性" + } + }, + "copyMessagePath": "已複製路徑", + "copyMessageValue": "已複製數值", + "copyMessageValue_truncated": "已複製捨棄的數值" + }, + "deploy": { + "deploy": "部署", + "full": "全面", + "fullDesc": "在工作區中部署所有內容", + "modifiedFlows": "已修改的流程", + "modifiedFlowsDesc": "只部署包含已更改節點的流程", + "modifiedNodes": "已更改的節點", + "modifiedNodesDesc": "只部署已經更改的節點", + "restartFlows": "重新啟動流程", + "restartFlowsDesc": "重新啟動當前部署的流程", + "successfulDeploy": "部署成功", + "successfulRestart": "成功重啟流程", + "deployFailed": "部署失敗: __message__", + "unusedConfigNodes": "您有一些未使用的配置節點", + "unusedConfigNodesLink": "點擊此處查看它們", + "errors": { + "noResponse": "伺服器沒有回應" + }, + "confirm": { + "button": { + "ignore": "忽略", + "confirm": "確認部署", + "review": "查看更改", + "cancel": "取消", + "merge": "合併", + "overwrite": "忽略 & 部署" + }, + "undeployedChanges": "您有未部署的更改。\n\n離開此頁面將丟失這些更改。", + "improperlyConfigured": "工作區包含一些未正確配置的節點:", + "unknown": "工作區包含一些未知的節點類型:", + "confirm": "確定要部署嗎?", + "doNotWarn": "不要再對此發出警告", + "conflict": "伺服器正在運行較新的一組流程。", + "backgroundUpdate": "伺服器上的流程已更新。", + "conflictChecking": "檢查是否可以自動合併更改", + "conflictAutoMerge": "此更改不包括衝突,可以自動合併", + "conflictManualMerge": "這些更改包括了在部署之前必須解決的衝突。", + "plusNMore": "+更多的__count__" + } + }, + "eventLog": { + "title": "事件日誌", + "view": "查看日誌" + }, + "diff": { + "unresolvedCount": "__count__個未解決的衝突", + "unresolvedCount_plural": "__count__個未解決的衝突", + "globalNodes": "全局節點", + "flowProperties": "流程屬性", + "type": { + "added": "已添加", + "changed": "已更改", + "unchanged": "未更改", + "deleted": "已刪除", + "flowDeleted": "已刪除流程", + "flowAdded": "已添加流程", + "movedTo": "移動至__id__", + "movedFrom": "從__id__移動" + }, + "nodeCount": "__count__個節點", + "nodeCount_plural": "__count__個節點", + "local": "本地", + "remote": "遠端", + "reviewChanges": "查看變更", + "noBinaryFileShowed": "無法顯示二進製文件內容", + "viewCommitDiff": "查看提交更改", + "compareChanges": "比較變更", + "saveConflict": "保存衝突解決", + "conflictHeader": "已解決__unresolved__中的__resolved__個衝突", + "commonVersionError": "通用版本不包含有效的JSON:", + "oldVersionError": "舊版本不包含有效的JSON:", + "newVersionError": "新版本不包含有效的JSON:" + }, + "subflow": { + "editSubflowInstance": "編輯子流程實例:__name__", + "editSubflow": "編輯流程範本: __name__", + "edit": "編輯流程範本", + "subflowInstances": "這個子流程範本有__count__個實例", + "subflowInstances_plural": "這個子流程範本有__count__個實例", + "editSubflowProperties": "編輯屬性", + "input": "輸入:", + "output": "輸出:", + "status": "狀態節點", + "deleteSubflow": "刪除子流程", + "info": "詳細描述", + "category": "類別", + "env": { + "restore": "恢復為默認子流程", + "remove": "類別刪除環境變量" + }, + "errors": { + "noNodesSelected": "無法創建子流程: 未選擇節點", + "multipleInputsToSelection": "無法創建子流程: 多個輸入到了選擇" + } + }, + "editor": { + "configEdit": "編輯", + "configAdd": "添加", + "configUpdate": "更新", + "configDelete": "刪除", + "nodesUse": "__count__個節點使用此配置", + "nodesUse_plural": "__count__個節點使用此配置", + "addNewConfig": "添加新的__type__配置", + "editNode": "編輯__type__節點", + "editConfig": "編輯__type__配置", + "addNewType": "添加新的__type__節點", + "nodeProperties": "節點屬性", + "label": "Label", + "color": "顏色", + "portLabels": "埠標籤", + "labelInputs": "輸入", + "labelOutputs": "輸出", + "settingIcon": "Icon", + "default": "默認", + "noDefaultLabel": "無", + "defaultLabel": "使用默認標籤", + "searchIcons": "搜尋圖標", + "useDefault": "使用默認", + "description": "描述", + "show": "顯示", + "hide": "隱藏", + "locale": "選擇界面語言", + "icon": "圖標", + "inputType": "輸入類型", + "inputs": { + "input": "輸入", + "select": "選擇", + "checkbox": "復選框", + "spinner": "微調器", + "none": "空", + "hidden": "隱藏屬性" + }, + "types": { + "str": "字符串", + "num": "數字", + "bool": "布爾", + "json": "JSON", + "bin": "buffer", + "env": "環境變量" + }, + "menu": { + "input": "輸入", + "select": "選擇", + "checkbox": "復選框", + "spinner": "微調器", + "hidden": "僅標簽" + }, + "select": { + "label": "標簽", + "value": "值" + }, + "spinner": { + "min": "最小值", + "max": "最大值" + }, + "errors": { + "scopeChange": "更改範圍將使其他流程中的節點無法使用", + "invalidProperties": "無效的屬性:" + } + }, + "keyboard": { + "title": "鍵盤快速鍵", + "keyboard": "鍵盤", + "filterActions": "篩選動作", + "shortcut": "快捷鍵", + "scope": "範圍", + "unassigned": "未分配", + "global": "全局", + "workspace": "工作區", + "selectAll": "選擇所有節點", + "selectAllConnected": "選擇所有連接的節點", + "addRemoveNode": "從選擇中添加/刪除節點", + "editSelected": "編輯選定節點", + "deleteSelected": "刪除選定節點或連結", + "importNode": "匯入節點", + "exportNode": "匯出節點", + "nudgeNode": "移動所選節點(1px)", + "moveNode": "移動所選節點(20px)", + "toggleSidebar": "切換側邊欄", + "togglePalette": "切換調色板", + "copyNode": "複製所選節點", + "cutNode": "剪切所選節點", + "pasteNode": "粘貼節點", + "undoChange": "撤銷上次執行的更改", + "searchBox": "打開搜尋框", + "managePalette": "管理面板", + "actionList": "動作列表" + }, + "library": { + "library": "庫", + "openLibrary": "打開庫...", + "saveToLibrary": "保存到庫...", + "typeLibrary": "__type__型別程式庫", + "unnamedType": "無名__type__", + "exportedToLibrary": "節點導出到庫", + "dialogSaveOverwrite": "一個叫做__libraryName__的__libraryType__已經存在,您需要覆蓋麼?", + "invalidFilename": "無效的檔案名", + "savedNodes": "保存的節點", + "savedType": "已保存__type__", + "saveFailed": "保存失敗: __message__", + "newFolder": "新文件夾", + "types": { + "local": "本地", + "examples": "例子" + }, + "exportToLibrary": "將節點匯出到庫" + }, + "palette": { + "noInfo": "無可用資訊", + "filter": "過濾節點", + "search": "搜尋模組", + "addCategory": "添加新的...", + "label": { + "subflows": "子流程", + "network": "網絡", + "common": "共通", + "input": "輸入", + "output": "輸出", + "function": "功能", + "sequence": "序列", + "parser": "解析", + "social": "社交", + "storage": "存儲", + "analysis": "分析", + "advanced": "高級" + }, + "actions": { + "collapse-all": "收起所有類別", + "expand-all": "展開所有類別" + }, + "event": { + "nodeAdded": "添加到面板中的節點:", + "nodeAdded_plural": "添加到面板中的多個節點", + "nodeRemoved": "從面板中刪除的節點:", + "nodeRemoved_plural": "從面板中刪除的多個節點:", + "nodeEnabled": "啟用節點:", + "nodeEnabled_plural": "啟用多個節點:", + "nodeDisabled": "禁用節點:", + "nodeDisabled_plural": "禁用多個節點:", + "nodeUpgraded": "節點模組__module__升級到__version__版本" + }, + "editor": { + "title": "面板管理", + "palette": "Palette", + "times": { + "seconds": "秒前", + "minutes": "分前", + "minutesV": "__count__分前", + "hoursV": "__count__小時前", + "hoursV_plural": "__count__小時前", + "daysV": "__count__天前", + "daysV_plural": "__count__天前", + "weeksV": "__count__周前", + "weeksV_plural": "__count__周前", + "monthsV": "__count__月前", + "monthsV_plural": "__count__月前", + "yearsV": "__count__年前", + "yearsV_plural": "__count__年前", + "yearMonthsV": "__y__年, __count__月前", + "yearMonthsV_plural": "__y__年, __count__月前", + "yearsMonthsV": "__y__年, __count__月前", + "yearsMonthsV_plural": "__y__年, __count__月前" + }, + "nodeCount": "__label__個節點", + "nodeCount_plural": "__label__個節點", + "moduleCount": "__count__個可用模組", + "moduleCount_plural": "__count__個可用模組", + "inuse": "使用中", + "enableall": "全部啟用", + "disableall": "全部禁用", + "enable": "啟用", + "disable": "禁用", + "remove": "移除", + "update": "更新至__version__版本", + "updated": "已更新", + "install": "安裝", + "installed": "已安裝", + "conflict": "conflict", + "conflictTip": "

無法安裝此模塊,因為它包含已安裝的
節點類型

__module__衝突

", + "loading": "載入目錄...", + "tab-nodes": "節點", + "tab-install": "安裝", + "sort": "排序:", + "sortAZ": "a-z順序", + "sortRecent": "日期順序", + "more": "增加__count__個", + "errors": { + "catalogLoadFailed": "無法載入節點目錄。
查看瀏覽器控制臺瞭解更多資訊", + "installFailed": "無法安裝: __module__
__message__
查看日誌瞭解更多資訊", + "removeFailed": "無法刪除: __module__
__message__
查看日誌瞭解更多資訊", + "updateFailed": "無法更新: __module__
__message__
查看日誌瞭解更多資訊", + "enableFailed": "無法啟用: __module__
__message__
查看日誌瞭解更多資訊", + "disableFailed": "無法禁用: __module__
__message__
查看日誌瞭解更多資訊" + }, + "confirm": { + "install": { + "body": "在安裝之前,請閱讀節點的文檔,某些節點的依賴關係不能自動解決,可能需要重新啟動Node-RED。", + "title": "安裝節點" + }, + "remove": { + "body": "刪除節點將從Node-RED卸載它。節點可能會繼續使用資源,直到重新啟動Node-RED。", + "title": "刪除節點" + }, + "update": { + "body": "更新節點將需要重新啟動Node-RED來完成更新,該過程必須由手動完成。", + "title": "更新節點" + }, + "cannotUpdate": { + "body": "此節點的更新可用,但不會安裝在面板管理器可以更新的位置。

請參閱有關如何更新此節點的文檔。" + }, + "button": { + "review": "打開節點資訊", + "install": "安裝", + "remove": "刪除", + "update": "更新" + } + } + } + }, + "sidebar": { + "info": { + "name": "節點信息", + "tabName": "名稱", + "label": "信息", + "node": "節點", + "type": "類型", + "module": "Module", + "id": "ID", + "status": "狀態", + "enabled": "啟用", + "disabled": "禁用", + "subflow": "子流程", + "instances": "實例", + "properties": "屬性", + "info": "信息", + "desc": "描述", + "blank": "空白", + "null": "空", + "showMore": "展開", + "showLess": "收起", + "flow": "流程", + "selection": "選擇", + "nodes": "__count__ 個節點", + "flowDesc": "流程描述", + "subflowDesc": "子流程描述", + "nodeHelp": "節點幫助", + "none": "無", + "arrayItems": "__count__個項目", + "showTips": "您可以從設置面板啟用提示資訊" + }, + "config": { + "name": "配置節點", + "label": "配置", + "global": "所有流程", + "none": "無", + "subflows": "子流程", + "flows": "流程", + "filterAll": "所有", + "showAllConfigNodes": "顯示所有配置節點", + "filterUnused": "未使用", + "showAllUnusedConfigNodes": "顯示所有未使用的配置節點", + "filtered": "__count__ 個隱藏" + }, + "context": { + "name": "上下文數據", + "label": "上下文", + "none": "未選擇", + "refresh": "刷新以加載", + "empty": "空", + "node": "節點", + "flow": "流程", + "global": "全局的", + "deleteConfirm": "你確定要刪除這個項目嗎?", + "autoRefresh": "自動刷新", + "refrsh": "刷新", + "delete": "刪除" + }, + "palette": { + "name": "節點管理", + "label": "節點" + }, + "project": { + "label": "項目", + "name": "名稱", + "description": "描述", + "dependencies": "依賴", + "settings": "設置", + "noSummaryAvailable": "無可用摘要", + "editDescription": "編輯專案描述", + "editDependencies": "編輯項目依賴", + "noDescriptionAvailable": "沒有可用的描述", + "editReadme": "Edit README.md", + "showProjectSettings": "顯示項目設置", + "projectSettings": { + "title": "項目設定", + "edit": "編輯", + "none": "None", + "install": "安裝", + "removeFromProject": "從項目中刪除", + "addToProject": "添加到項目", + "files": "文件", + "package": "包", + "flow": "流程", + "credentials": "證書", + "packageCreate": "保存更改後將創建文件", + "fileNotExist": "文件不存在", + "selectFile": "選擇文件", + "invalidEncryptionKey": "無效的加密密鑰", + "encryptionEnabled": "啟用加密", + "encryptionDisabled": "禁用加密", + "setTheEncryptionKey": "設置加密密鑰", + "resetTheEncryptionKey": "重置加密密鑰", + "changeTheEncryptionKey": "更改加密密鑰", + "currentKey": "當前密鑰", + "newKey": "新密鑰", + "credentialsAlert": "這將刪除所有現有證書", + "versionControl": "版本控制", + "branches": "分支", + "noBranches": "沒有分支", + "deleteConfirm": "您確定要刪除本地分支'__name__'嗎?這不能被撤消。", + "unmergedConfirm": "本地分支'__name__'具有未合併的更改,這些更改將丟失。你確定要刪除嗎?", + "deleteUnmergedBranch": "刪除未合併的分支", + "gitRemotes": "Git遠程倉庫", + "addRemote": "添加遠程倉庫", + "addRemote2": "添加遠程倉庫", + "remoteName": "遠程倉庫名", + "nameRule": "必須僅包含A-Z 0-9 _ -", + "url": "URL", + "urlRule": "https://, ssh:// or file://", + "urlRule2": "網址中不要包含用戶名/密碼", + "noRemotes": "沒有遠程倉庫", + "deleteRemoteConfrim": "確定要刪除遠程倉庫'__name__'嗎?", + "deleteRemote": "刪除遠程倉庫" + }, + "userSettings": { + "committerDetail": "提交者詳細信息", + "committerTip": "保留空白以使用系統默認值", + "userName": "用戶名", + "email": "電子郵件", + "sshKeys": "SSH密鑰", + "sshKeysTip": "允許您創建到遠程git存儲庫的安全連接。", + "add": "添加密鑰", + "addSshKey": "添加SSH密鑰", + "addSshKeyTip": "生成新的公鑰/私鑰對", + "name": "名字", + "nameRule": "必須僅包含A-Z 0-9 _ -", + "passphrase": "密碼短語", + "passphraseShort": "密碼短語太短", + "optional": "可選的", + "cancel": "取消", + "generate": "產生密鑰", + "noSshKeys": "沒有SSH密鑰", + "copyPublicKey": "將公鑰複製到剪貼板", + "delete": "刪除密鑰", + "gitConfig": "Git配置", + "deleteConfirm": "您確定要刪除SSH密鑰__name__嗎? 這不能被撤消。" + }, + "versionControl": { + "unstagedChanges": "未暫存的更改", + "stagedChanges": "已暫存的更改", + "unstageChange": "取消暫存更改", + "stageChange": "暫存更改", + "unstageAllChange": "取消暫存所有更改", + "stageAllChange": "暫存所有更改", + "commitChanges": "提交變更", + "resolveConflicts": "解決衝突", + "head": "HEAD", + "staged": "以暫存", + "unstaged": "未暫存", + "local": "本地的", + "remote": "遠程的", + "revert": "您確定要將更改恢復為'__file__'嗎? 這不能被撤消。", + "revertChanges": "還原變更", + "localChanges": "當地變化", + "none": "None", + "conflictResolve": "解決所有衝突。 提交更改以完成合併。", + "localFiles": "本地文件", + "all": "所有的", + "unmergedChanges": "未合併的更改", + "abortMerge": "合併中止", + "commit": "提交", + "changeToCommit": "提交變更", + "commitPlaceholder": "輸入您的提交信息", + "cancelCapital": "取消", + "commitCapital": "提交", + "commitHistory": "提交歷史", + "branch": "分支:", + "moreCommits": "更多提交", + "changeLocalBranch": "變更當地分支", + "createBranchPlaceholder": "查找或創建分支", + "upstream": "上遊的", + "localOverwrite": "您有可通過切換分支覆蓋的本地更改。您必須先提交或撤銷那些更改。", + "manageRemoteBranch": "管理遠程分支", + "unableToAccess": "無法訪問遠程存儲庫", + "retry": "重試", + "setUpstreamBranch": "設置為上遊分支", + "createRemoteBranchPlaceholder": "查找或創建遠程分支", + "trackedUpstreamBranch": "創建的分支將被設置為跟蹤的上遊分支。", + "selectUpstreamBranch": "分支將被創建。 在下面選擇以將其設置為被跟蹤的上遊分支。", + "pushFailed": "Push失敗,因為遠程具有更多的最新提交。請先進行pull與merge,然後再嘗試push。", + "push": "push", + "pull": "pull", + "unablePull": "

無法提取遠程更改;您未進行的暫存本地更改將被覆蓋。

提交更改,然後重試。

", + "showUnstagedChanges": "顯示未分階段的更改", + "connectionFailed": "無法連接到遠程存儲庫:", + "pullUnrelatedHistory": "

遠程服務器具有不相關的提交歷史記錄。

您確定要將更改保存到本地存儲庫中嗎?

", + "pullChanges": "Pull變更", + "history": "歷史", + "projectHistory": "項目歷史", + "daysAgo": "__count__天前", + "daysAgo_plural": "__count__天前", + "hoursAgo": "__count__小時前", + "hoursAgo_plural": "__count__小時前", + "minsAgo": "__count__分鐘前", + "minsAgo_plural": "__count__分鐘前", + "secondsAgo": "秒前", + "notTracking": "您的本地分支當前未跟蹤遠程分支。", + "statusUnmergedChanged": "您的存儲庫中有未合併的更改。您需要解決衝突並提交結果。", + "repositoryUpToDate": "您的存儲庫是最新的。", + "commitsAhead": "您的倉庫領先遠程倉庫__count__次提交。您現在可以push這些提交。", + "commitsAhead_plural": "您的倉庫領先遠程倉庫__count__次提交。您現在可以push這些提交。", + "commitsBehind": "您的倉庫落後遠程倉庫__count__次提交。您現在可以pull這些提交。", + "commitsBehind_plural": "您的倉庫落後遠程倉庫__count__次提交。您現在可以pull這些提交。", + "commitsAheadAndBehind1": "您的倉庫落後遠程倉庫__count__次提交", + "commitsAheadAndBehind1_plural": "您的倉庫落後遠程倉庫__count__次提交", + "commitsAheadAndBehind2": "領先遠程倉庫__count__次提交。", + "commitsAheadAndBehind2_plural": "領先遠程倉庫__count__次提交。", + "commitsAheadAndBehind3": "您必須先pull遠程提交,然後再進行push。", + "commitsAheadAndBehind3_plural": "您必須先pull遠程提交,然後再進行push。", + "refreshCommitHistory": "刷新提交歷史", + "refreshChanges": "刷新更改" + } + } + }, + "typedInput": { + "type": { + "str": "文字列", + "num": "數字", + "re": "規則運算式", + "bool": "布林", + "json": "JSON", + "bin": "二進位流", + "date": "時間戳記", + "jsonata": "expression", + "env": "env variable" + } + }, + "editableList": { + "add": "添加" + }, + "search": { + "empty": "找不到匹配", + "addNode": "添加一個節點..." + }, + "expressionEditor": { + "functions": "功能", + "functionReference": "Function reference", + "insert": "插入", + "title": "JSONata運算式編輯器", + "test": "Test", + "data": "示例消息", + "result": "結果", + "format": "格式表達方法", + "compatMode": "相容模式啟用", + "compatModeDesc": "

JSONata的相容模式

目前的運算式仍然參考msg,所以將以相容性模式進行評估。請更新運算式,使其不使用msg,因為此模式將在將來刪除。

當JSONata支持首次添加到Node-RED時,它需要運算式引用msg物件。例如msg.payload將用於訪問有效負載。

這樣便不再需要運算式直接針對消息進行評估。要訪問有效負載,運算式應該只是payload.

", + "noMatch": "無匹配結果", + "errors": { + "invalid-expr": "無效的JSONata運算式:\n __message__", + "invalid-msg": "無效的示例JSON消息:\n __message__", + "context-unsupported": "無法測試上下文函數\n $flowContext 或 $globalContext", + "eval": "評估運算式錯誤:\n __message__" + } + }, + "jsEditor": { + "title": "JavaScript 編輯器" + }, + "textEditor": { + "title": "Text 編輯器" + }, + "jsonEditor": { + "title": "JSON編輯器", + "format": "格式化JSON", + "rawMode": "編輯 JSON", + "uiMode": "Visual編輯器", + "insertAbove": "在上方插入", + "insertBelow": "在下方插入", + "addItem": "添加項目", + "copyPath": "復制路徑到項目", + "expandItems": "展開項目", + "collapseItems": "收合項目", + "duplicate": "重復", + "error": { + "invalidJSON": "無效的JSON: " + } + }, + "markdownEditor": { + "title": "Markdown 編輯器", + "expand": "展開", + "format": "F使用markdown格式化", + "heading1": "Heading 1", + "heading2": "Heading 2", + "heading3": "Heading 3", + "bold": "粗體", + "italic": "斜體", + "code": "程式碼", + "ordered-list": "編號清單", + "unordered-list": "符號清單", + "quote": "引用", + "link": "連結", + "horizontal-rule": "分隔線", + "toggle-preview": "預覽" + }, + "bufferEditor": { + "title": "緩衝區編輯器", + "modeString": "作為UTF-8字串處理", + "modeArray": "作為JSON陣列處理", + "modeDesc": "

緩衝區編輯器

緩衝區類型被存儲為位元組值的JSON陣列。編輯器將嘗試將輸入的數值解析為JSON陣列。如果它不是有效的JSON,它將被視為UTF-8字串,並被轉換為單個字元代碼點的陣列。

例如,Hello World的值會被轉換為JSON陣列:

[72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100]

" + }, + "projects": { + "config-git": "配置Git客戶端", + "welcome": { + "hello": "你好! 我們已經將“項目”引入了Node-RED。", + "desc0": "這是一種用於管理流程文件的新方法,並且包括對流程的版本控制。", + "desc1": "首先,您可以創建您的第一個項目或從git存儲庫克隆現有項目。", + "desc2": "如果不確定,可以暫時跳過此步驟。 您仍然可以隨時通過“項目”菜單創建第一個項目。", + "create": "創建項目", + "clone": "克隆存儲庫", + "openExistingProject": "打開現有項目", + "not-right-now": "不是現在" + }, + "git-config": { + "setup": "設置您的版本控制客戶端", + "desc0": "Node-RED使用開源工具Git進行版本控制。 它跟蹤對項目文件的更改,並允許您將其推送到遠程存儲庫。", + "desc1": "提交一組更改時,Git會使用用戶名和電子郵件地址記錄誰進行了更改。 用戶名可以是您想要的任何名稱-不必是您的真實姓名。", + "desc2": "您的Git客戶端已經配置了以下詳細信息。", + "desc3": "您可以稍後在設置對話框的“ Git config”標籤下更改這些設置。", + "username": "用戶名", + "email": "電子郵件" + }, + "project-details": { + "create": "創建您的項目", + "desc0": "項目被維護為Git存儲庫。 與他人共享您的流程並進行協作更容易。", + "desc1": "您可以創建多個項目,並通過編輯器在它們之間快速切換。", + "desc2": "首先,您的項目需要一個名稱和一個可選的描述。", + "already-exists": "項目已存在", + "must-contain": "必須僅包含A-Z 0-9 _ -", + "project-name": "項目名", + "desc": "描述", + "opt": "可選的" + }, + "clone-project": { + "clone": "克隆項目", + "desc0": "如果您已經有一個包含項目的git存儲庫,則可以對其進行克隆以開始使用。", + "already-exists": "項目已經存在", + "must-contain": "必須僅包含A-Z 0-9 _ -", + "project-name": "項目名", + "no-info-in-url": "網址中不要包含用戶名/密碼", + "git-url": "Git存儲庫URL", + "protocols": "https://, ssh:// or file://", + "auth-failed": "驗證失敗", + "username": "用戶名", + "passwd": "密碼", + "ssh-key": "SSH密鑰", + "passphrase": "密碼短語", + "ssh-key-desc": "在通過ssh克隆存儲庫之前,必須添加SSH密鑰才能訪問它。", + "ssh-key-add": "添加一個ssh密鑰", + "credential-key": "證書加密密鑰", + "cant-get-ssh-key": "錯誤! 無法獲取所選的SSH密鑰路徑。", + "already-exists2": "已存在", + "git-error": "git錯誤", + "connection-failed": "連接失敗", + "not-git-repo": "不是一個git倉庫", + "repo-not-found": "未發現倉庫" + }, + "default-files": { + "create": "創建您的項目文件", + "desc0": "一個項目包含您的流程文件,自述文件和package.json文件。", + "desc1": "它可以包含您要在Git存儲庫中維護的任何其他文件。", + "desc2": "您現有的流程和證書文件將被複製到項目中。", + "flow-file": "流文件", + "credentials-file": "證書文件" + }, + "encryption-config": { + "setup": "設置證書文件的加密", + "desc0": "您的流程證書文件可以被加密以確保其內容安全。", + "desc1": "如果要將這些證書存儲在公共Git存儲庫中,則必須通過提供密鑰短語來對它們進行加密。", + "desc2": "您的流程證書文件當前未加密。", + "desc3": "這意味著任何有權訪問該文件的人都可以讀取其內容,例如密碼和訪問令牌。", + "desc4": "如果要將這些證書存儲在公共Git存儲庫中,則必須通過提供密鑰短語來對它們進行加密。", + "desc5": "當前,使用設置文件中的credentialSecret屬性作為密鑰來加密流憑據文件。", + "desc6": "您的流程證書文件當前使用系統生成的密鑰加密。 您應該為此項目提供一個新的密鑰。", + "desc7": "密鑰將與項目文件分開存儲。 您將需要提供在另一個Node-RED實例中使用該項目的密鑰。", + "credentials": "證書", + "enable": "啟用加密", + "disable": "禁用加密", + "disabled": "禁用的", + "copy": "複製現有密鑰", + "use-custom": "使用自定義密鑰", + "desc8": "憑證文件不會被加密,其內容很容易閱讀", + "create-project-files": "創建項目文件", + "create-project": "創建項目", + "already-exists": "已存在", + "git-error": "git錯誤", + "git-auth-error": "git認證錯誤" + }, + "create-success": { + "success": "您已經成功創建了第一個項目!", + "desc0": "現在,您可以像往常一樣繼續使用Node-RED。", + "desc1": "側欄中的“信息”標籤顯示了您當前的活動項目。名稱旁邊的按鈕可用於訪問項目設置視圖。", + "desc2": "側欄中的“歷史記錄”標籤可用於查看項目中已更改的文件並提交。 它向您顯示了提交的完整歷史記錄,並允許您將更改推送到遠程存儲庫。" + }, + "create": { + "projects": "項目", + "already-exists": "項目已存在", + "must-contain": "必須僅包含A-Z 0-9 _ -", + "no-info-in-url": "網址中不要包含用戶名/密碼", + "open": "打開項目", + "create": "創建項目", + "clone": "克隆倉庫", + "project-name": "項目名", + "desc": "描述", + "opt": "可選的", + "flow-file": "流程文件", + "credentials": "證書", + "enable-encryption": "啟用加密", + "disable-encryption": "禁用加密", + "encryption-key": "加密的密鑰", + "desc0": "用來保護您的憑證的短語", + "desc1": "憑證文件不會被加密,其內容很容易閱讀", + "git-url": "Git倉庫的URL", + "protocols": "https://, ssh:// or file://", + "auth-failed": "驗證失敗", + "username": "用戶名", + "password": "密碼", + "ssh-key": "SSH密鑰", + "passphrase": "密碼短語", + "desc2": "在通過ssh克隆存儲庫之前,必須添加SSH密鑰才能訪問它。", + "add-ssh-key": "添加一個ssh密鑰", + "credentials-encryption-key": "憑證加密密鑰", + "already-exists-2": "已存在", + "git-error": "git錯誤", + "con-failed": "連接失敗", + "not-git": "不是git倉庫", + "no-resource": "找不到存儲庫", + "cant-get-ssh-key-path": "錯誤! 無法獲取所選的SSH密鑰路徑。", + "unexpected_error": "意外的錯誤" + }, + "delete": { + "confirm": "您確定要刪除此項目嗎?" + }, + "create-project-list": { + "search": "搜尋您的項目", + "current": "當前的" + }, + "require-clean": { + "confirm": "

您有未部署的更改,這些更改將丟失。

您要繼續嗎?

" + }, + "send-req": { + "auth-req": "存儲庫需要認證", + "username": "用戶名", + "password": "密碼", + "passphrase": "密碼短語", + "retry": "重試", + "update-failed": "無法更新身份驗證", + "unhandled": "未處理的錯誤響應" + }, + "create-branch-list": { + "invalid": "無效的分支", + "create": "創建分支", + "current": "當前的" + }, + "create-default-file-set": { + "no-active": "沒有活動項目就無法創建默認文件集", + "no-empty": "無法在非空項目上創建默認文件集", + "git-error": "git error" + }, + "errors": { + "no-username-email": "您的Git客戶端未配置用戶名/電子郵件。", + "unexpected": "發生了一個意料之外的問題", + "code": "代碼" + } + }, + "editor-tab": { + "properties": "屬性", + "envProperties": "環境變量", + "description": "描述", + "appearance": "外觀", + "preview": "UI預覽", + "defaultValue": "默認值", + "env": "環境變量" + }, + "languages": { + "de": "德語", + "en-US": "英語", + "ja": "日語", + "ko": "韓語", + "zh-CN": "簡體中文", + "zh-TW": "繁體中文" + } +} diff --git a/packages/node_modules/@node-red/editor-client/locales/zh-TW/infotips.json b/packages/node_modules/@node-red/editor-client/locales/zh-TW/infotips.json new file mode 100644 index 000000000..f783f2e8b --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/locales/zh-TW/infotips.json @@ -0,0 +1,23 @@ +{ + "info": { + "tip0" : "您可以用 {{core:delete-selection}} 刪除選擇的節點或連結。", + "tip1" : "{{core:search}} 可以在流程內搜索節點。", + "tip2": "{{core:toggle-sidebar}} 可以顯示或隱藏邊側欄。", + "tip3": "您可以在 {{core:manage-palette}} 中管理節點的控制台。", + "tip4": "側邊欄中會列出流程中所有的配置節點。您可以通過功能表或者 {{core:show-config-tab}} 來訪問這些節點。", + "tip5": "您可以在設定中選擇顯示或隱藏這些提示。", + "tip6": "您可以用[left] [up] [down] [right]鍵來移動被選中的節點。按住[shift]可以更快地移動節點。", + "tip7": "把節點拖到連接上可以向連接中插入節點。", + "tip8": "您可以用 {{core:show-export-dialog}} 來匯出被選中的節點或標籤頁中的流程。", + "tip9": "您可以將流程的json文字檔拖入編輯方塊或 {{core:show-import-dialog}} 來導入流程。", + "tip10": "按住[shift]後按一下並拖動節點可以將該節點的多個連接一併移動到其他節點的埠。", + "tip11": "{{core:show-info-tab}} 可以顯示「資訊」標籤頁。 {{core:show-debug-tab}} 可以顯示「調試」標籤頁。", + "tip12": "按住[ctrl]的同時點擊工作介面可以在節點的對話欄中快速添加節點。", + "tip13": "按住[ctrl]的同時點擊節點的埠或後續節點可以快速連接多個節點。", + "tip14": "按住[shift]的同時點擊節點會選中所有被連接的節點。", + "tip15": "按住[ctrl]的同時點擊節點可以在選中或取消選中節點。", + "tip16": "{{core:show-previous-tab}} 和 {{core:show-next-tab}} 可以切換標籤頁。", + "tip17": "您可以在節點的屬性配置畫面中通過 {{core:confirm-edit-tray}} 來更改設置,或者用 {{core:cancel-edit-tray}} 來取消更改。", + "tip18": "您可以通過點擊 {{core:edit-selected-node}} 來顯示被選中節點的屬性設置畫面。" + } +} diff --git a/packages/node_modules/@node-red/editor-client/locales/zh-TW/jsonata.json b/packages/node_modules/@node-red/editor-client/locales/zh-TW/jsonata.json new file mode 100644 index 000000000..6d99ffc6a --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/locales/zh-TW/jsonata.json @@ -0,0 +1,270 @@ +{ + "$string": { + "args": "arg", + "desc": "通過以下的類型轉換規則將參數*arg*轉換成字串:\n\n - 字串不轉換。\n -函數轉換成空的字串。\n - JSON的值無法用數字表示所以用無限大或者NaN(非數)表示。\n - 用’JSON.stringify’函數將其他值轉換成JSON字串。" + }, + "$length": { + "args": "str", + "desc": "輸出字串’str’的字數。如果’str’不是字串,拋出錯誤。" + }, + "$substring": { + "args": "str, start[, length]", + "desc": "輸出`start`位置後的的首次出現的包括`str`的子字串。 如果`length`被指定,那麼的字串中將只包括前`length`個文字。如果`start`是負數則輸出從`str`末尾開始的`length`個文字" + }, + "$substringBefore": { + "args": "str, chars", + "desc": "輸出’str’中首次出現的’chars’之前的子字串,如果’str’中不包括’chars’則輸出’str’。" + }, + "$substringAfter": { + "args": "str, chars", + "desc": "輸出’str’中首次出現的’chars’之後的子字串,如果’str’中不包括’chars’則輸出’str’。" + }, + "$uppercase": { + "args": "str", + "desc": "`將’str’中的所有字母變為大寫後輸出。" + }, + "$lowercase": { + "args": "str", + "desc": "將’str’中的所有字母變為小寫後輸出。" + }, + "$trim": { + "args": "str", + "desc": "將以下步驟應用於`str`來去除所有空白文字並實現標準化。\n\n – 將全部tab定位字元、Enter鍵、換行字元用空白代替。\n- 將連續的空白文字變成一個空白文字。\n- 消除開頭和末尾的空白文字。\n\n如果`str`沒有被指定(即在無輸入參數的情況下調用本函數),將上下文的值作為`str`來使用。 如果`str` 不是字串則拋出錯誤。" + }, + "$contains": { + "args": "str, pattern", + "desc": "字串`str` 和 `pattern`匹配的話輸出`true`,不匹配的情況下輸出 `false`。 不指定`str`的情況下(比如用一個參數調用本函數時)、將上下文的值作為`str`來使用。參數 `pattern`可以為字串或正則表達。" + }, + "$split": { + "args": "str[, separator][, limit]", + "desc": "將參數`str`分解成由子字串組成的陣列。 如果`str`不是字串拋出錯誤。可以省略的參數 `separator`中指定字串`str`的分隔符號。分隔符號可以是文字或規則運算式。在不指定`separator`的情況下、將分隔符號看作空的字串並把`str`拆分成由單個字母組成的陣列。如果`separator`不是字串則拋出錯誤。在可省略的參數`limit`中指定分割後的子字串的最大個數。超出個數的子字串將被捨棄。如果`limit`沒有被指定,`str` 將不考慮子字串的個數而將字串完全分隔。如果`limit`是負數則拋出錯誤。" + }, + "$join": { + "args": "array[, separator]", + "desc": "用可以省略的參數 `separator`來把多個字元串連接。如果`array`不是字串則拋出錯誤。 如果沒有指定`separator`,則用空字串來連接字元(即字串之間沒有`separator`)。 如果`separator`不是字元則拋出錯誤。" + }, + "$match": { + "args": "str, pattern [, limit]", + "desc": "對字串`str`使用規則運算式`pattern`並輸出與`str`相匹配的部分資訊。" + }, + "$replace": { + "args": "str, pattern, replacement [, limit]", + "desc": "在字串`str`中搜索`pattern`並用`replacement`來替換。\n\n可選參數`limit`用來指定替換次數的上限。" + }, + "$now": { + "args": "", + "desc": "生成ISO 8601互換格式的時刻,並作為字串輸出。" + }, + "$base64encode": { + "args": "string", + "desc": "將ASCII格式的字串轉換為Base 64格式。將字串中的文字視作二進位形式的資料處理。包含URI編碼在內的字串文字必須在0x00到0xFF的範圍內,否則不會被支持。" + }, + "$base64decode": { + "args": "string", + "desc": "用UTF-8內碼表將Base 64形式二進位值轉換為字串。" + }, + "$number": { + "args": "arg", + "desc": "用下述的規則將參數 `arg`轉換為數值。:\n\n – 數值不做轉換。\n – 將字串中合法的JSON數値表示轉換成數値。\n – 其他形式的值則拋出錯誤。" + }, + "$abs": { + "args": "number", + "desc": "輸出參數`number`的絕對值。" + }, + "$floor": { + "args": "number", + "desc": "輸出比`number`的值小的最大整數。" + }, + "$ceil": { + "args": "number", + "desc": "輸出比`number`的值大的最小整數。" + }, + "$round": { + "args": "number [, precision]", + "desc": "輸出四捨五入後的參數`number`。可省略的參數 `precision`指定四捨五入後小數點下的位數。" + }, + "$power": { + "args": "base, exponent", + "desc": "輸出底數`base`的`exponent`次冪。" + }, + "$sqrt": { + "args": "number", + "desc": "輸出參數 `number`的平方根。" + }, + "$random": { + "args": "", + "desc": "輸出比0大,比1小的偽亂數。" + }, + "$millis": { + "args": "", + "desc": "返回從UNIX時間 (1970年1月1日 UTC/GMT的午夜)開始到現在的毫秒數。在同一個運算式的測試中所有對`$millis()`的調用將會返回相同的值。" + }, + "$sum": { + "args": "array", + "desc": "輸出陣列`array`的總和。如果`array`不是數值則拋出錯誤。" + }, + "$max": { + "args": "array", + "desc": "輸出陣列`array`的最大值。如果`array`不是數值則拋出錯誤。" + }, + "$min": { + "args": "array", + "desc": "輸出陣列`array`的最小值。如果`array`不是數值則拋出錯誤。。" + }, + "$average": { + "args": "array", + "desc": "輸出陣列`array`的平均數。如果`array`不是數值則拋出錯誤。。" + }, + "$boolean": { + "args": "arg", + "desc": "用下述規則將資料轉換成布林值。:\n\n - 不轉換布林值`Boolean`。\n – 將空的字串`string`轉換為`false`\n – 將不為空的字串`string`轉換為`true`\n – 將為0的數位`number`轉換成`false`\n –將不為0的數位`number`轉換成`true`\n –將`null`轉換成`false`\n –將空的陣列`array`轉換成`false`\n –如果陣列`array`中含有可以轉換成`true`的要素則轉換成`true`\n –如果`array`中沒有可轉換成`true`的要素則轉換成`false`\n – 空的物件`object`轉換成`false`\n – 非空的物件`object`轉換成`true`\n –將函數`function`轉換成`false`" + }, + "$not": { + "args": "arg", + "desc": "輸出做反轉運算後的布林值。首先將`arg`轉換為布林值。" + }, + "$exists": { + "args": "arg", + "desc": "如果算式`arg`的值存在則輸出`true`。如果算式的值不存在(比如指向不存在區域的引用)則輸出`false`。" + }, + "$count": { + "args": "array", + "desc": "輸出陣列中的元素數。" + }, + "$append": { + "args": "array, array", + "desc": "將兩個陣列連接。" + }, + "$sort": { + "args": "array [, function]", + "desc": "輸出排序後的陣列`array`。\n\n如果使用了比較函數`function`,則下述兩個參數需要被指定。\n\n`function(left, right)`\n\n該比較函數是為了比較left和right兩個值而被排序演算法調用的。如果使用者希望left的值被置於right的值之後,那麼該函數必須輸出布林值`true`來表示位置交換。而在不需要位置交換時函數必須輸出`false`。" + }, + "$reverse": { + "args": "array", + "desc": "輸出倒序後的陣列`array`。" + }, + "$shuffle": { + "args": "array", + "desc": "輸出隨機排序後的陣列 `array`。" + }, + "$zip": { + "args": "array, ...", + "desc": "將陣列中的值按索引順序打包後輸出。" + }, + "$keys": { + "args": "object", + "desc": "輸出由物件內的鍵組成的陣列。如果參數是物件的陣列則輸出由所有物件中的鍵去重後組成的佇列。" + }, + "$lookup": { + "args": "object, key", + "desc": "輸出對象中與參數`key`對應的值。如果第一個參數`object`是陣列,那麼陣列中所有的物件都將被搜索並輸出這些物件中與參數`key`對應的值。" + }, + "$spread": { + "args": "object", + "desc": "將物件中的鍵值對分隔成每個要素中只含有一個鍵值對的陣列。如果參數`object`是陣列,那麼返回值的陣列中包含所有物件中的鍵值對。" + }, + "$merge": { + "args": "array<object>", + "desc": "將輸入陣列`objects`中所有的鍵值對合併到一個`object`中並返回。如果輸入陣列的要素中含有重複的鍵,則返回的`object`中將只包含陣列中最後出現要素的值。如果輸入陣列中包括物件以外的元素,則拋出錯誤。" + }, + "$sift": { + "args": "object, function", + "desc": "輸出參數`object`中符合`function`的鍵值對。\n\n`function`必須含有下述參數。\n\n`function(value [, key [, object]])`" + }, + "$each": { + "args": "object, function", + "desc": "將函數`function`應用於`object`中的所有鍵值對並輸出由所有返回值組成的陣列。" + }, + "$map": { + "args": "array, function", + "desc": "將函數`function`應用於陣列`array`中所有的值並輸出由返回值組成的陣列。\n\n`function`中必須含有下述參數。\n\n`function(value [, index [, array]])`" + }, + "$filter": { + "args": "array, function", + "desc": "輸出陣列`array`中符合函數`function`條件的值組成的陣列。\n\n`function`必須包括下述參數。\n\n`function(value [, index [, array]])`" + }, + "$reduce": { + "args": "array, function [, init]", + "desc": "將`function`依次應用於陣列中的各要素值。 其中,前一個要素值的計算結果將參與到下一次的函數運算中。。\n\n函數`function`接受兩個參數並作為中綴標記法中的操作符。\n\n可省略的參數`init`將作為運算的初始值。" + }, + "$flowContext": { + "args": "string", + "desc": "獲取流上下文(流等級的上下文,可以讓所有節點共用)的屬性。" + }, + "$globalContext": { + "args": "string", + "desc": "獲取全域上下文的屬性。" + }, + "$pad": { + "args": "string, width [, char]", + "desc": "根據需要,向字串`string`的副本中填充文字使該字串的字數達到`width`的絕對值並返回填充文字後的字串。\n\n如果`width`的值為正,則向字串`string`的右側填充文字,如果`width`為負,則向字串`string`的左側填充文字。\n\n可選參數`char`用來指定填充的文字。如果未指定該參數,則填充空白文字。" + }, + "$fromMillis": { + "args": "number", + "desc": "將表示從UNIX時間 (1970年1月1日 UTC/GMT的午夜)開始到現在的毫秒數的數值轉換成ISO 8601形式時間戳記的字串。" + }, + "$formatNumber": { + "args": "number, picture [, options]", + "desc": "將`number`轉換成具有`picture`所指定的數值格式的字串。\n\n此函數的功能與XPath F&O 3.1規格中定義的XPath/XQuery函數的fn:format-number功能相一致。參數`picture`用於指定數值的轉換格式,其語法與fn:format-number中的定義一致。\n\n可選的第三參數`options`用來覆蓋預設的局部環境格式,如小數點分隔符號。如果指定該參數,那麼該參數必須是包含name/value對的物件,並且name/value對必須符合XPath F&O 3.1規格中記述的數值格式。" + }, + "$formatBase": { + "args": "number [, radix]", + "desc": "將`number`變換為以參數`radix`的值為基數形式的字串。如果不指定`radix`的值,則默認基數為10。指定的`radix`值必須在2~36之間,否則拋出錯誤。" + }, + "$toMillis": { + "args": "timestamp", + "desc": "將ISO 8601格式的字串`timestamp`轉換為從UNIX時間 (1970年1月1日 UTC/GMT的午夜)開始到現在的毫秒數。如果該字串的格式不正確,則拋出錯誤。" + }, + "$env": { + "args": "arg", + "desc": "返回環境變量的值。\n\n這是Node-RED定義的函數。" + }, + "$eval": { + "args": "expr [, context]", + "desc": "使用當前上下文來作為評估依據,分析並評估字符串`expr`,其中包含文字JSON或JSONata表達式。" + }, + "$formatInteger": { + "args": "number, picture", + "desc": "將“數字”轉換為字符串,並將其格式化為“圖片”字符串指定的整數表示形式。圖片字符串參數定義了數字的格式,並具有與XPath F&O 3.1 規範中的fn:format-integer相同的語法。" + }, + "$parseInteger": { + "args": "string, picture", + "desc": "使用“圖片”字符串指定的格式將“字符串”參數的內容解析為整數(作為JSON數字)。圖片字符串參數與$formatInteger格式相同。." + }, + "$error": { + "args": "[str]", + "desc": "引發錯誤並顯示一條消息。 可選的`str`將替代$error()函數評估的默認消息。" + }, + "$assert": { + "args": "arg, str", + "desc": "如果`arg`為真,則該函數返回。 如果arg為假,則拋出帶有str的異常作為異常消息。" + }, + "$single": { + "args": "array, function", + "desc": "返回滿足參數function謂語的array參數中的唯一值 (比如:傳遞值時,函數返回布林值“true”)。如果匹配值的數量不唯一時,則拋出異常。\n\n應在以下簽名中提供函數:`function(value [,index [,array []]])`其中value是數組的每個輸入,index是該值的位置,整個數組作為第三個參數傳遞。" + }, + "$encodeUrl": { + "args": "str", + "desc": "通過用表示字符的UTF-8編碼的一個,兩個,三個或四個轉義序列替換某些字符的每個實例,對統一資源定位符(URL)組件進行編碼。\n\n示例:`$encodeUrlComponent(\"?x=test\")` => `\"%3Fx%3Dtest\"`" + }, + "$encodeUrlComponent": { + "args": "str", + "desc": "通過用表示字符的UTF-8編碼的一個,兩個,三個或四個轉義序列替換某些字符的每個實例,對統一資源定位符(URL)進行編碼。\n\n示例: `$encodeUrl(\"https://mozilla.org/?x=шеллы\")` => `\"https://mozilla.org/?x=%D1%88%D0%B5%D0%BB%D0%BB%D1%8B\"`" + }, + "$decodeUrl": { + "args": "str", + "desc": "解碼以前由encodeUrlComponent創建的統一資源定位器(URL)組件。 \n\n示例: `$decodeUrlComponent(\"%3Fx%3Dtest\")` => `\"?x=test\"`" + }, + "$decodeUrlComponent": { + "args": "str", + "desc": "解碼先前由encodeUrl創建的統一資源定位符(URL)。 \n\n示例: `$decodeUrl(\"https://mozilla.org/?x=%D1%88%D0%B5%D0%BB%D0%BB%D1%8B\")` => `\"https://mozilla.org/?x=шеллы\"`" + }, + "$distinct": { + "args": "array", + "desc": "返回一個數組,其中重復的值已從`數組`中刪除" + }, + "$type": { + "args": "value", + "desc": "以字符串形式返回`值`的類型。 如果該`值`未定義,則將返回`未定義`" + } +} diff --git a/packages/node_modules/@node-red/editor-client/package.json b/packages/node_modules/@node-red/editor-client/package.json index 410e154e7..0b3e16e7f 100644 --- a/packages/node_modules/@node-red/editor-client/package.json +++ b/packages/node_modules/@node-red/editor-client/package.json @@ -1,6 +1,6 @@ { "name": "@node-red/editor-client", - "version": "1.0.1", + "version": "1.0.4", "license": "Apache-2.0", "repository": { "type": "git", diff --git a/packages/node_modules/@node-red/editor-client/src/ace/bin/snippets/nrjavascript.js b/packages/node_modules/@node-red/editor-client/src/ace/bin/snippets/nrjavascript.js index d11f3fc6a..c0f5c2e0d 100644 --- a/packages/node_modules/@node-red/editor-client/src/ace/bin/snippets/nrjavascript.js +++ b/packages/node_modules/@node-red/editor-client/src/ace/bin/snippets/nrjavascript.js @@ -1,4 +1,4 @@ -ace.define("ace/snippets/nrjavascript",[],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="nrjavascript"}); +ace.define("ace/snippets/nrjavascript",[],function(e,t,n){"use strict";t.snippetText='# Prototype\nsnippet proto\n ${1:class_name}.prototype.${2:method_name} = function(${3:first_argument}) {\n ${4:// body...}\n };\n# Function\nsnippet fun\n function ${1?:function_name}(${2:argument}) {\n ${3:// body...}\n }\n# Anonymous Function\nregex /((=)\\s*|(:)\\s*|(\\()|\\b)/f/(\\))?/\nsnippet f\n function${M1?: ${1:functionName}}($2) {\n ${0:$TM_SELECTED_TEXT}\n }${M2?;}${M3?,}${M4?)}\n# Immediate function\ntrigger \\(?f\\(\nendTrigger \\)?\nsnippet f(\n (function(${1}) {\n ${0:${TM_SELECTED_TEXT:/* code */}}\n }(${1}));\n# if\nsnippet if\n if (${1:true}) {\n ${0}\n }\n# if ... else\nsnippet ife\n if (${1:true}) {\n ${2}\n } else {\n ${0}\n }\n# tertiary conditional\nsnippet ter\n ${1:/* condition */} ? ${2:a} : ${3:b}\n# switch\nsnippet switch\n switch (${1:expression}) {\n case \'${3:case}\':\n ${4:// code}\n break;\n ${5}\n default:\n ${2:// code}\n }\n# case\nsnippet case\n case \'${1:case}\':\n ${2:// code}\n break;\n ${3}\n\n# while (...) {...}\nsnippet wh\n while (${1:/* condition */}) {\n ${0:/* code */}\n }\n# try\nsnippet try\n try {\n ${0:/* code */}\n } catch (e) {}\n# do...while\nsnippet do\n do {\n ${2:/* code */}\n } while (${1:/* condition */});\n# Object Method\nsnippet :f\nregex /([,{[])|^\\s*/:f/\n ${1:method_name}: function(${2:attribute}) {\n ${0}\n }${3:,}\n# setTimeout function\nsnippet setTimeout\nregex /\\b/st|timeout|setTimeo?u?t?/\n setTimeout(function() {${3:$TM_SELECTED_TEXT}}, ${1:10});\n# console.log (Firebug)\nsnippet cl\n console.log(${1});\n# return\nsnippet ret\n return ${1:result}\n# for (property in object ) { ... }\nsnippet fori\n for (var ${1:prop} in ${2:Things}) {\n ${0:$2[$1]}\n }\n# hasOwnProperty\nsnippet has\n hasOwnProperty(${1})\n# docstring\nsnippet /**\n /**\n * ${1:description}\n *\n */\nsnippet @par\nregex /^\\s*\\*\\s*/@(para?m?)?/\n @param {${1:type}} ${2:name} ${3:description}\nsnippet @ret\n @return {${1:type}} ${2:description}\n# JSON.parse\nsnippet jsonp\n JSON.parse(${1:jstr});\n# JSON.stringify\nsnippet jsons\n JSON.stringify(${1:object});\n# self-defining function\nsnippet sdf\n var ${1:function_name} = function(${2:argument}) {\n ${3:// initial code ...}\n\n $1 = function($2) {\n ${4:// main code}\n };\n }\n# \nsnippet for-\n for (var ${1:i} = ${2:Things}.length; ${1:i}--; ) {\n ${0:${2:Things}[${1:i}];}\n }\n# for (...) {...}\nsnippet for\n for (var ${1:i} = 0; $1 < ${2:Things}.length; $1++) {\n ${3:$2[$1]}$0\n }\n# for (...) {...} (Improved Native For-Loop)\nsnippet forr\n for (var ${1:i} = ${2:Things}.length - 1; $1 >= 0; $1--) {\n ${3:$2[$1]}$0\n }\n# Node-RED Specific Funcs\nsnippet nodes\n node.send(${1:msg})\nsnippet clone\n RED.util.cloneMessage(${1:msg})\nsnippet nodel\n node.log($1)\nsnippet nodew\n node.warn($1)\nsnippet nodee\n node.error($1)\nsnippet noded\n node.debug($1)\nsnippet done\n node.done($1)\nsnippet flowg\n flow.get($1)\nsnippet flows\n flow.set($1, $2)\nsnippet globalg\n global.get($1)\nsnippet globals\n global.set($1, $2)\n',t.scope="nrjavascript"}); (function() { ace.require(["ace/snippets/nrjavascript"], function(m) { if (typeof module == "object" && typeof exports == "object" && module) { @@ -6,4 +6,3 @@ ace.define("ace/snippets/nrjavascript",[],function(e,t,n){"use strict";t.snippet } }); })(); - \ No newline at end of file diff --git a/packages/node_modules/@node-red/editor-client/src/js/history.js b/packages/node_modules/@node-red/editor-client/src/js/history.js index db54701bb..51d0e00a0 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/history.js +++ b/packages/node_modules/@node-red/editor-client/src/js/history.js @@ -39,7 +39,7 @@ RED.history = (function() { inverseEv = { t: 'replace', config: RED.nodes.createCompleteNodeSet(), - changed: [], + changed: {}, rev: RED.nodes.version() }; RED.nodes.clear(); diff --git a/packages/node_modules/@node-red/editor-client/src/js/nodes.js b/packages/node_modules/@node-red/editor-client/src/js/nodes.js index d956684ce..5c0778fba 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/nodes.js +++ b/packages/node_modules/@node-red/editor-client/src/js/nodes.js @@ -845,7 +845,7 @@ RED.nodes = (function() { var m = /^subflow:(.+)$/.exec(newNodes[i].type); if (m) { var subflowId = m[1]; - var parent = getSubflow(newNodes[i].z || activeWorkspace); + var parent = getSubflow(activeWorkspace); if (parent) { var err; if (subflowId === parent.id) { diff --git a/packages/node_modules/@node-red/editor-client/src/js/red.js b/packages/node_modules/@node-red/editor-client/src/js/red.js index 78f82e507..f0c11cdd9 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/red.js +++ b/packages/node_modules/@node-red/editor-client/src/js/red.js @@ -418,8 +418,6 @@ var RED = (function() { RED.notify(RED._("palette.event.nodeUpgraded", {module:msg.module,version:msg.version}),"success"); RED.nodes.registry.setModulePendingUpdated(msg.module,msg.version); } - // Refresh flow library to ensure any examples are updated - RED.library.loadFlowLibrary(); }); RED.comms.subscribe("event-log/#", function(topic,payload) { var id = topic.substring(9); @@ -433,7 +431,7 @@ var RED = (function() { ''+ ''; - RED.sidebar.info.set(aboutHeader+marked(data)); + RED.sidebar.info.set(aboutHeader+RED.utils.renderMarkdown(data)); RED.sidebar.info.show(); }); } diff --git a/packages/node_modules/@node-red/editor-client/src/js/settings.js b/packages/node_modules/@node-red/editor-client/src/js/settings.js index e360cea7d..760165581 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/settings.js +++ b/packages/node_modules/@node-red/editor-client/src/js/settings.js @@ -56,8 +56,9 @@ RED.settings = (function () { if (key === "auth-tokens") { return JSON.parse(localStorage.getItem(key)); } else { + var v; try { - var v = RED.utils.getMessageProperty(userSettings,key); + v = RED.utils.getMessageProperty(userSettings,key); if (v === undefined) { v = defaultIfUndefined; } diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/common/menu.js b/packages/node_modules/@node-red/editor-client/src/js/ui/common/menu.js index 131dc1f13..e73c82293 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/common/menu.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/common/menu.js @@ -244,7 +244,7 @@ RED.menu = (function() { function addItem(id,opt) { var item = createMenuItem(opt); - if (opt.group) { + if (opt !== null && opt.group) { var groupItems = $("#"+id+"-submenu").children(".red-ui-menu-group-"+opt.group); if (groupItems.length === 0) { item.appendTo("#"+id+"-submenu"); diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/common/searchBox.js b/packages/node_modules/@node-red/editor-client/src/js/ui/common/searchBox.js index 214668485..b707ccbf5 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/common/searchBox.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/common/searchBox.js @@ -38,7 +38,10 @@ this.element.addClass("red-ui-searchBox-input"); this.uiContainer = this.element.wrap("
").parent(); this.uiContainer.addClass("red-ui-searchBox-container"); - + if (this.element.parents("form").length === 0) { + var form = this.element.wrap("
").parent(); + form.addClass("red-ui-searchBox-form"); + } $('').prependTo(this.uiContainer); this.clearButton = $('').appendTo(this.uiContainer); this.clearButton.on("click",function(e) { diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/common/tabs.js b/packages/node_modules/@node-red/editor-client/src/js/ui/common/tabs.js index 0d371e56f..249d7daa7 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/common/tabs.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/common/tabs.js @@ -218,7 +218,7 @@ RED.tabs = (function() { var thisTab = $(this).parent(); var fireSelectionChanged = false; if (options.onselect) { - if (evt.metaKey) { + if (evt.metaKey || evt.ctrlKey) { if (thisTab.hasClass("selected")) { thisTab.removeClass("selected"); if (thisTab[0] !== currentTab[0]) { diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js b/packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js index 0e391a5b8..ed04733c9 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js @@ -410,7 +410,7 @@ return; } if (container.hasClass("expanded")) { - done && done(); + if (done) { done() } return; } if (!container.hasClass("built") && (item.deferBuild || typeof item.children === 'function')) { @@ -435,7 +435,7 @@ spinner.remove(); } } - done && done(); + if (done) { done() } that._trigger("childrenloaded",null,item) } if (typeof item.children === 'function') { @@ -457,7 +457,7 @@ } else { item.treeList.childList.slideDown('fast'); } - done && done(); + if (done) { done() } } container.addClass("expanded"); } diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/deploy.js b/packages/node_modules/@node-red/editor-client/src/js/ui/deploy.js index cdf84d02f..9e91410a9 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/deploy.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/deploy.js @@ -334,8 +334,7 @@ RED.deploy = (function() { var invalidNodes = []; RED.nodes.eachNode(function(node) { - hasInvalid = hasInvalid || !node.valid; - if (!node.valid) { + if (!node.valid && !node.d) { invalidNodes.push(getNodeInfo(node)); } if (node.type === "unknown") { @@ -345,6 +344,7 @@ RED.deploy = (function() { } }); hasUnknown = unknownNodes.length > 0; + hasInvalid = invalidNodes.length > 0; var unusedConfigNodes = []; RED.nodes.eachConfig(function(node) { diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/diff.js b/packages/node_modules/@node-red/editor-client/src/js/ui/diff.js index 7c5b22f26..13a157e21 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/diff.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/diff.js @@ -1029,9 +1029,9 @@ RED.diff = (function() { } var localSelectDiv = $('
'; var template = ''; var _subflowTemplateEditTemplate = ' diff --git a/packages/node_modules/@node-red/nodes/core/common/21-debug.html b/packages/node_modules/@node-red/nodes/core/common/21-debug.html index ebfb8532b..5e2f3ba49 100644 --- a/packages/node_modules/@node-red/nodes/core/common/21-debug.html +++ b/packages/node_modules/@node-red/nodes/core/common/21-debug.html @@ -131,8 +131,32 @@ RED.view.redraw(); } }, - messageSourceClick: function(sourceId) { - RED.view.reveal(sourceId); + messageSourceClick: function(sourceId, aliasId, path) { + // Get all of the nodes that could have logged this message + var candidateNodes = [RED.nodes.node(sourceId)] + if (path) { + for (var i=2;i 1) { + // The node is in a subflow. Check to see if the active + // workspace is a subflow in the node's parentage. If + // so, reveal the relevant subflow instance node. + var ws = RED.workspaces.active(); + for (var i=0;i",o.id,o.z,o._alias); + // + // sourceNode should be the top-level node - one that is on a flow. + var sourceNode; + var pathParts; + if (o.path) { + // Path is a `/`-separated list of ids that identifies the + // complete parentage of the node that generated this message. + // flow-id/subflow-A-instance/subflow-A-type/subflow-B-instance/subflow-B-type/node-id + + // If it has one id, that is a top level flow + // each subsequent id is the instance id of a subflow node + // + pathParts = o.path.split("/"); + if (pathParts.length === 1) { + // The source node is on a flow - so can use its id to find + sourceNode = RED.nodes.node(o.id); + } else if (pathParts.length > 1) { + // Highlight the subflow instance node. + sourceNode = RED.nodes.node(pathParts[1]); + } + } else { + // This is probably redundant... + sourceNode = RED.nodes.node(o.id) || RED.nodes.node(o.z); + } if (sourceNode) { - o._source = {id:sourceNode.id,z:sourceNode.z,name:sourceNode.name,type:sourceNode.type,_alias:o._alias}; + o._source = { + id:sourceNode.id, + z:sourceNode.z, + name:sourceNode.name, + type:sourceNode.type, + // _alias identifies the actual logging node. This is + // not necessarily the same as sourceNode, which will be + // the top-level subflow instance node. + // This means the node's name is displayed in the sidebar. + _alias:o._alias, + path: pathParts + }; } RED.debug.handleDebugMessage(o); if (subWindow) { @@ -235,7 +294,7 @@ } else if (msg.event === "mouseLeave") { options.messageMouseLeave(msg.id); } else if (msg.event === "mouseClick") { - options.messageSourceClick(msg.id); + options.messageSourceClick(msg.id,msg._alias,msg.path); } else if (msg.event === "clear") { options.clear(); } diff --git a/packages/node_modules/@node-red/nodes/core/common/21-debug.js b/packages/node_modules/@node-red/nodes/core/common/21-debug.js index 9beff7809..b00371bbd 100644 --- a/packages/node_modules/@node-red/nodes/core/common/21-debug.js +++ b/packages/node_modules/@node-red/nodes/core/common/21-debug.js @@ -62,7 +62,7 @@ module.exports = function(RED) { if (err) { done(RED._("debug.invalid-exp", {error: editExpression})); } else { - done(null,{id:node.id, name:node.name, topic:msg.topic, msg:value, _path:msg._path}); + done(null,{id:node.id, z:node.z, _alias: node._alias, path:node._flow.path, name:node.name, topic:msg.topic, msg:value}); } }); } else { @@ -77,7 +77,7 @@ module.exports = function(RED) { output = undefined; } } - done(null,{id:node.id, z:node.z, name:node.name, topic:msg.topic, property:property, msg:output, _path:msg._path}); + done(null,{id:node.id, z:node.z, _alias: node._alias, path:node._flow.path, name:node.name, topic:msg.topic, property:property, msg:output}); } } @@ -88,7 +88,7 @@ module.exports = function(RED) { node.log("\n"+util.inspect(msg, {colors:useColors, depth:10})); } if (this.active && this.tosidebar) { - sendDebug({id:node.id, name:node.name, topic:msg.topic, msg:msg, _path:msg._path}); + sendDebug({id:node.id, z:node.z, _alias: node._alias, path:node._flow.path, name:node.name, topic:msg.topic, msg:msg}); } done(); } else { diff --git a/packages/node_modules/@node-red/nodes/core/common/90-comment.html b/packages/node_modules/@node-red/nodes/core/common/90-comment.html index 1631c6314..76c4547c0 100644 --- a/packages/node_modules/@node-red/nodes/core/common/90-comment.html +++ b/packages/node_modules/@node-red/nodes/core/common/90-comment.html @@ -2,7 +2,7 @@ - - diff --git a/packages/node_modules/@node-red/nodes/core/sequence/19-batch.html b/packages/node_modules/@node-red/nodes/core/sequence/19-batch.html index 5781ffbe5..418ac605b 100644 --- a/packages/node_modules/@node-red/nodes/core/sequence/19-batch.html +++ b/packages/node_modules/@node-red/nodes/core/sequence/19-batch.html @@ -14,7 +14,7 @@ limitations under the License. --> - @@ -99,7 +99,7 @@ } $("#node-input-topics-container") - .css('min-height','200px').css('min-width','430px') + .css('min-height','150px').css('min-width','430px') .editableList({ addItem: function(container, i, opt) { if (!opt.hasOwnProperty('topic')) { diff --git a/packages/node_modules/@node-red/nodes/core/storage/10-file.js b/packages/node_modules/@node-red/nodes/core/storage/10-file.js index c27c3ed5f..54ce55764 100644 --- a/packages/node_modules/@node-red/nodes/core/storage/10-file.js +++ b/packages/node_modules/@node-red/nodes/core/storage/10-file.js @@ -341,6 +341,7 @@ module.exports = function(RED) { } else if (node.format === "lines") { var m = { payload: spare, + topic:msg.topic, parts: { index: count, count: count+1, diff --git a/packages/node_modules/@node-red/nodes/locales/de/function/80-template.html b/packages/node_modules/@node-red/nodes/locales/de/function/80-template.html index a00b8d449..e3d58d2eb 100755 --- a/packages/node_modules/@node-red/nodes/locales/de/function/80-template.html +++ b/packages/node_modules/@node-red/nodes/locales/de/function/80-template.html @@ -35,10 +35,12 @@

Beispiel: Wenn eine Vorlage von:

 Hallo {{payload.name}}. Heute ist {{date}} 

eine Nachricht empfangt, die folgendes enthält: -

 {
-Datum: "Montag"
-Payload: { Name: "Fred"}
-} 
+
{
+  date: "Montag",
+  payload: {
+    name: "Fred"
+  }
+}

wird die resultierende Nachrich wie folgt sein:

 Hallo Fred. Heute ist Montag 

Es ist möglich, eine Eigenschaft aus dem Flowkontext oder dem globalen Kontext zu verwenden. diff --git a/packages/node_modules/@node-red/nodes/locales/en-US/function/80-template.html b/packages/node_modules/@node-red/nodes/locales/en-US/function/80-template.html index 8be8234b5..1e541c605 100644 --- a/packages/node_modules/@node-red/nodes/locales/en-US/function/80-template.html +++ b/packages/node_modules/@node-red/nodes/locales/en-US/function/80-template.html @@ -36,9 +36,9 @@

Hello {{payload.name}}. Today is {{date}}

receives a message containing:

{
-  date: "Monday"
+  date: "Monday",
   payload: {
-    name: "Fred",
+    name: "Fred"
   }
 }

The resulting property will be: diff --git a/packages/node_modules/@node-red/nodes/locales/en-US/messages.json b/packages/node_modules/@node-red/nodes/locales/en-US/messages.json index 4999cb8a7..e1d7c6368 100755 --- a/packages/node_modules/@node-red/nodes/locales/en-US/messages.json +++ b/packages/node_modules/@node-red/nodes/locales/en-US/messages.json @@ -79,7 +79,7 @@ "on": "on", "onstart": "Inject once after", "onceDelay": "seconds, then", - "tip": "Note: \"interval between times\" and \"at a specific time\" will use cron.
\"interval\" should be less than 596 hours.
See info box for details.", + "tip": "Note: \"interval between times\" and \"at a specific time\" will use cron.
\"interval\" should be 596 hours or less.
See info box for details.", "success": "Successfully injected: __label__", "errors": { "failed": "inject failed, see log for details", @@ -604,33 +604,34 @@ "label": { "property": "Property", "rule": "rule", - "repair" : "recreate message sequences" + "repair": "recreate message sequences" }, + "previous": "previous value", "and": "and", "checkall": "checking all rules", "stopfirst": "stopping after first match", "ignorecase": "ignore case", "rules": { - "btwn":"is between", - "cont":"contains", - "regex":"matches regex", - "true":"is true", - "false":"is false", - "null":"is null", - "nnull":"is not null", - "istype":"is of type", - "empty":"is empty", - "nempty":"is not empty", - "head":"head", - "tail":"tail", - "index":"index between", - "exp":"JSONata exp", - "else":"otherwise", - "hask":"has key" + "btwn": "is between", + "cont": "contains", + "regex": "matches regex", + "true": "is true", + "false": "is false", + "null": "is null", + "nnull": "is not null", + "istype": "is of type", + "empty": "is empty", + "nempty": "is not empty", + "head": "head", + "tail": "tail", + "index": "index between", + "exp": "JSONata exp", + "else": "otherwise", + "hask": "has key" }, "errors": { "invalid-expr": "Invalid JSONata expression: __error__", - "too-many" : "too many pending messages in switch node" + "too-many": "too many pending messages in switch node" } }, "change": { @@ -848,41 +849,42 @@ "stream":"Handle as a stream of messages", "addname":" Copy key to " }, - "join":{ + "join": { "join": "join", - "mode":{ - "mode":"Mode", - "auto":"automatic", - "merge":"merge sequences", - "reduce":"reduce sequence", - "custom":"manual" + "mode": { + "mode": "Mode", + "auto": "automatic", + "merge": "merge sequences", + "reduce": "reduce sequence", + "custom": "manual" }, - "combine":"Combine each", - "create":"to create", - "type":{ - "string":"a String", - "array":"an Array", - "buffer":"a Buffer", - "object":"a key/value Object", - "merged":"a merged Object" + "combine": "Combine each", + "completeMessage": "complete message", + "create": "to create", + "type": { + "string": "a String", + "array": "an Array", + "buffer": "a Buffer", + "object": "a key/value Object", + "merged": "a merged Object" }, - "using":"using the value of", - "key":"as the key", - "joinedUsing":"joined using", - "send":"Send the message:", - "afterCount":"After a number of message parts", - "count":"count", - "subsequent":"and every subsequent message.", - "afterTimeout":"After a timeout following the first message", - "seconds":"seconds", - "complete":"After a message with the msg.complete property set", - "tip":"This mode assumes this node is either paired with a split node or the received messages will have a properly configured msg.parts property.", - "too-many" : "too many pending messages in join node", + "using": "using the value of", + "key": "as the key", + "joinedUsing": "joined using", + "send": "Send the message:", + "afterCount": "After a number of message parts", + "count": "count", + "subsequent": "and every subsequent message.", + "afterTimeout": "After a timeout following the first message", + "seconds": "seconds", + "complete": "After a message with the msg.complete property set", + "tip": "This mode assumes this node is either paired with a split node or the received messages will have a properly configured msg.parts property.", + "too-many": "too many pending messages in join node", "merge": { - "topics-label":"Merged Topics", - "topics":"topics", - "topic" : "topic", - "on-change":"Send merged message on arrival of a new topic" + "topics-label": "Merged Topics", + "topics": "topics", + "topic": "topic", + "on-change": "Send merged message on arrival of a new topic" }, "reduce": { "exp": "Reduce exp", diff --git a/packages/node_modules/@node-red/nodes/locales/en-US/network/10-mqtt.html b/packages/node_modules/@node-red/nodes/locales/en-US/network/10-mqtt.html index c0bf67f40..94c9c091a 100644 --- a/packages/node_modules/@node-red/nodes/locales/en-US/network/10-mqtt.html +++ b/packages/node_modules/@node-red/nodes/locales/en-US/network/10-mqtt.html @@ -36,7 +36,7 @@

Inputs

payload string | buffer
-
most users prefer simple text payloads, but binary buffers can also be published.
+
the payload to publish. If this property is not set, no message will be sent. To send a blank message, set this property to an empty String.
topic string
the MQTT topic to publish to.
diff --git a/packages/node_modules/@node-red/nodes/locales/en-US/network/21-httprequest.html b/packages/node_modules/@node-red/nodes/locales/en-US/network/21-httprequest.html index fcc852c65..3daf92f49 100644 --- a/packages/node_modules/@node-red/nodes/locales/en-US/network/21-httprequest.html +++ b/packages/node_modules/@node-red/nodes/locales/en-US/network/21-httprequest.html @@ -36,7 +36,7 @@
followRedirects
If set to false prevent following Redirect (HTTP 301).true by default
requestTimeout
-
If set to a positive number, will override the globally set httpRequestTimeout parameter.
+
If set to a positive number of milliseconds, will override the globally set httpRequestTimeout parameter.

Outputs

diff --git a/packages/node_modules/@node-red/nodes/locales/en-US/network/31-tcpin.html b/packages/node_modules/@node-red/nodes/locales/en-US/network/31-tcpin.html index e8cb29ffc..173f003f7 100644 --- a/packages/node_modules/@node-red/nodes/locales/en-US/network/31-tcpin.html +++ b/packages/node_modules/@node-red/nodes/locales/en-US/network/31-tcpin.html @@ -14,14 +14,14 @@ limitations under the License. --> - - - diff --git a/packages/node_modules/@node-red/nodes/locales/ja/common/20-inject.html b/packages/node_modules/@node-red/nodes/locales/ja/common/20-inject.html index a9ecef1c4..429471173 100644 --- a/packages/node_modules/@node-red/nodes/locales/ja/common/20-inject.html +++ b/packages/node_modules/@node-red/nodes/locales/ja/common/20-inject.html @@ -25,7 +25,7 @@

詳細

injectノードを用いることで、指定したペイロード値を用いてフローを開始できます。デフォルトのペイロード値は現在時刻のタイムスタンプを1970年1月1日からの経過ミリ秒で表現した値です。

-

文字列、数値、論理値、JavaScriptオブジェクト、フロー/グローバルコンテキストの値などの送出も可能です。

+

文字列、数値、真偽値、JavaScriptオブジェクト、フロー/グローバルコンテキストの値などの送出も可能です。

デフォルト設定では、エディタ内に表示されるボタンをクリックすることで、ノードを手動で起動できます。指定間隔もしくはスケジュールに従ってメッセージを送出するように設定することも可能です。

また、フロー開始の際に一度だけメッセージを送出させることもできます。

時間間隔」に指定可能な値の最大値は、約596時間(もしくは24日)です。一日より長い間隔を扱いたい場合は、電源停止や再起動にも対応可能なスケジューラノードの利用を検討すると良いでしょう。

diff --git a/packages/node_modules/@node-red/nodes/locales/ja/function/80-template.html b/packages/node_modules/@node-red/nodes/locales/ja/function/80-template.html index f8c97ab59..802c268f6 100644 --- a/packages/node_modules/@node-red/nodes/locales/ja/function/80-template.html +++ b/packages/node_modules/@node-red/nodes/locales/ja/function/80-template.html @@ -34,9 +34,9 @@
こんにちは{{payload.name}}さん。今日は{{date}}です。

というテンプレートに対して、

{
-  date: "月曜日"
+  date: "月曜日",
   payload: {
-    name: "山田",
+    name: "山田"
   }
 }

というメッセージを受信した場合、

diff --git a/packages/node_modules/@node-red/nodes/locales/ja/messages.json b/packages/node_modules/@node-red/nodes/locales/ja/messages.json index 8e241dc5f..adc033390 100755 --- a/packages/node_modules/@node-red/nodes/locales/ja/messages.json +++ b/packages/node_modules/@node-red/nodes/locales/ja/messages.json @@ -604,6 +604,7 @@ "rule": "条件", "repair": "メッセージ列の補正" }, + "previous": "前回の値", "and": "~", "checkall": "全ての条件を適用", "stopfirst": "最初に合致した条件で終了", @@ -856,6 +857,7 @@ "custom": "手動" }, "combine": "結合", + "completeMessage": "メッセージ全体", "create": "出力", "type": { "string": "文字列", diff --git a/packages/node_modules/@node-red/nodes/locales/ja/network/10-mqtt.html b/packages/node_modules/@node-red/nodes/locales/ja/network/10-mqtt.html index 2beb49493..c4a3ce0dd 100644 --- a/packages/node_modules/@node-red/nodes/locales/ja/network/10-mqtt.html +++ b/packages/node_modules/@node-red/nodes/locales/ja/network/10-mqtt.html @@ -38,13 +38,13 @@

入力

payload 文字列 | バッファ
-
多くの場合単純なテキスト形式のペイロードが使われますが、バイナリバッファを発行することも可能です。
+
発行するペイロード。プロパティが設定されていない場合には、メッセージは送信されません。空のメッセージを送信するには、プロパティに空文字列を設定します。
topic 文字列
発行対象のMQTTトピック
qos 数値
-
0: 最大1度到着, 1: 一度以上到着, 2: 1度のみ到着。デフォルトは0です。
+
0: 最大一度到着, 1: 一度以上到着, 2: 一度のみ到着。デフォルトは0です。
retain 真偽値
真の場合、メッセージをブローカに保持します。デフォルトは偽です。
diff --git a/packages/node_modules/@node-red/nodes/locales/ja/network/21-httprequest.html b/packages/node_modules/@node-red/nodes/locales/ja/network/21-httprequest.html index ba20c8bc7..e87bb7542 100644 --- a/packages/node_modules/@node-red/nodes/locales/ja/network/21-httprequest.html +++ b/packages/node_modules/@node-red/nodes/locales/ja/network/21-httprequest.html @@ -33,6 +33,8 @@
falseをセットすると、自己署名証明書を使用するhttpsサイトへのリクエストを許可します。
followRedirects
falseをセットすると、リダイレクトを行いません。デフォルトはtrueです。
+
requestTimeout
+
正のミリ秒数をセットすると、 グローバルに設定されたhttpRequestTimeoutパラメータを上書きします。

出力

diff --git a/packages/node_modules/@node-red/nodes/locales/ja/sequence/17-split.html b/packages/node_modules/@node-red/nodes/locales/ja/sequence/17-split.html index e94134a59..6205bac52 100644 --- a/packages/node_modules/@node-red/nodes/locales/ja/sequence/17-split.html +++ b/packages/node_modules/@node-red/nodes/locales/ja/sequence/17-split.html @@ -98,7 +98,7 @@

合計値」には出力メッセージを送信する前に受信すべきメッセージ数を指定します。オブジェクト出力の場合、この合計値に達すると後続メッセージの到着毎にメッセージを出力するように設定することもできます。

」には新規メッセージを送信するまでの経過時間を設定します。

msg.completeプロパティを設定したメッセージを受信すると、出力メッセージを送信します。この時、メッセージ列の数をリセットします。

-

msg.resetプロパティを設定したメッセージを受診すると、部分的に受信済みのメッセージを破棄します。これらのメッセージは送信されません。この時、メッセージ列の数をリセットします。

+

msg.resetプロパティを設定したメッセージを受信すると、部分的に受信済みのメッセージを破棄します。これらのメッセージは送信されません。この時、メッセージ列の数をリセットします。

列の集約モード

列の集約モードを選択すると、メッセージ列を構成する各々のメッセージに対して式を適用し、集約した値を用いて一つのメッセージを構成します。

diff --git a/packages/node_modules/@node-red/nodes/locales/ja/storage/10-file.html b/packages/node_modules/@node-red/nodes/locales/ja/storage/10-file.html index 6bf7f5999..2df174104 100644 --- a/packages/node_modules/@node-red/nodes/locales/ja/storage/10-file.html +++ b/packages/node_modules/@node-red/nodes/locales/ja/storage/10-file.html @@ -52,7 +52,7 @@

Windowsではパスの区切り文字を(例えば、\\ユーザー\\名前のように)エスケープする必要があります。

テキストファイルの場合、行毎に分割して各々メッセージを送信することができます。また、バイナリファイルの場合、小さな塊のバッファに分割して送信できます。バッファの分割単位はオペレーティングシステム依存ですが、一般に64k(Linux/Mac)もしくは41k(Windows)です。

複数のメッセージに分割する場合、各メッセージにはpartsプロパティが設定され、メッセージ列を構成します。

-

主力形式が文字列の場合、入力データのエンコーディングをエンコーディングリストから選択できます。

+

出力形式が文字列の場合、入力データのエンコーディングをエンコーディングリストから選択できます。

旧式のエラー処理

Node-RED 0.17より前の版では、ファイルの読み込み時にエラーが発生するとpayloadを持たずerrorプロパティにエラーの詳細情報を設定したメッセージを送信します。この動作モードは非推奨であり、新しいノード実装ではデフォルトでは無効としています。ノードの設定により、必要に応じてこのモードを有効にできます。

エラーはcatchノードで補足して処理することを推奨します。

diff --git a/packages/node_modules/@node-red/nodes/locales/ko/function/80-template.html b/packages/node_modules/@node-red/nodes/locales/ko/function/80-template.html index c3e3d7226..7415b63c3 100644 --- a/packages/node_modules/@node-red/nodes/locales/ko/function/80-template.html +++ b/packages/node_modules/@node-red/nodes/locales/ko/function/80-template.html @@ -34,9 +34,9 @@
안녕하세요, {{payload.name}}씨. 오늘은 {{date}}입니다.

라는 템플릿에 대해,

{
-  date: "월요일"
+  date: "월요일",
   payload: {
-    name: "홍길동",
+    name: "홍길동"
   }
 }

이라는 메세지를 수신한 경우,

diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/common/20-inject.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/common/20-inject.html new file mode 100644 index 000000000..78b218083 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/common/20-inject.html @@ -0,0 +1,34 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/common/21-debug.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/common/21-debug.html new file mode 100644 index 000000000..e3137c50d --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/common/21-debug.html @@ -0,0 +1,25 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/common/24-complete.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/common/24-complete.html new file mode 100644 index 000000000..e69ebc6a0 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/common/24-complete.html @@ -0,0 +1,24 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/common/25-catch.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/common/25-catch.html new file mode 100644 index 000000000..5b2b4c3b2 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/common/25-catch.html @@ -0,0 +1,36 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/common/25-status.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/common/25-status.html new file mode 100644 index 000000000..7d9504c9f --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/common/25-status.html @@ -0,0 +1,33 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/common/60-link.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/common/60-link.html new file mode 100644 index 000000000..6f2bc5f99 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/common/60-link.html @@ -0,0 +1,31 @@ + + + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/common/90-comment.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/common/90-comment.html new file mode 100644 index 000000000..f98577ff4 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/common/90-comment.html @@ -0,0 +1,21 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/common/98-unknown.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/common/98-unknown.html new file mode 100644 index 000000000..108e19228 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/common/98-unknown.html @@ -0,0 +1,24 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/function/10-function.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/function/10-function.html new file mode 100644 index 000000000..035ccc81f --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/function/10-function.html @@ -0,0 +1,51 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/function/10-switch.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/function/10-switch.html new file mode 100644 index 000000000..7ad25c24f --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/function/10-switch.html @@ -0,0 +1,37 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/function/15-change.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/function/15-change.html new file mode 100644 index 000000000..fcba3fed4 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/function/15-change.html @@ -0,0 +1,33 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/function/16-range.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/function/16-range.html new file mode 100644 index 000000000..b5d2d033f --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/function/16-range.html @@ -0,0 +1,40 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/function/80-template.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/function/80-template.html new file mode 100644 index 000000000..938a77818 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/function/80-template.html @@ -0,0 +1,46 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/function/89-delay.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/function/89-delay.html new file mode 100644 index 000000000..690bddaea --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/function/89-delay.html @@ -0,0 +1,32 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/function/89-trigger.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/function/89-trigger.html new file mode 100644 index 000000000..5f27a5002 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/function/89-trigger.html @@ -0,0 +1,33 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/function/90-exec.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/function/90-exec.html new file mode 100644 index 000000000..27c421160 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/function/90-exec.html @@ -0,0 +1,74 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/messages.json b/packages/node_modules/@node-red/nodes/locales/zh-CN/messages.json index 9202bb3a7..4fc5dc4d4 100644 --- a/packages/node_modules/@node-red/nodes/locales/zh-CN/messages.json +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/messages.json @@ -6,7 +6,9 @@ "name": "名称", "username": "用户名", "password": "密码", - "property": "属性" + "property": "属性", + "selectNodes": "选择节点...", + "expand": "扩展" }, "status": { "connected": "已连接", @@ -35,7 +37,22 @@ "stopped": "停止", "failed": "注入失败: __error__", "label": { - "repeat": "重复" + "repeat": "重复", + "flow": "流上下午", + "global": "全局上下文", + "str": "字符串", + "num": "数值", + "bool": "布尔值", + "json": "JSON对象", + "bin": "buffer", + "date": "时间戳", + "env": "环境变量", + "object": "对象", + "string": "字符串", + "boolean": "布尔值", + "number": "数值", + "Array": "数组", + "invalid": "无效的JSON对象" }, "timestamp": "时间戳", "none": "无", @@ -70,15 +87,13 @@ } }, "catch": { - "catch": "监测所有节点", - "catchNodes": "监测__number__个节点", + "catch": "捕获:所有节点", + "catchNodes": "捕获:__number__个节点", + "catchUncaught": "捕获:未捕获", "label": { - "source": "监测范围", - "node": "节点", - "type": "类型", + "source": "捕获范围", "selectAll": "全选", - "sortByLabel": "按名称排序", - "sortByType": "按类型排序" + "uncaught": "忽略其他捕获节点处理的错误" }, "scope": { "all": "所有节点", @@ -90,10 +105,6 @@ "statusNodes": "报告__number__个节点状态", "label": { "source": "报告状态范围", - "node": "节点", - "type": "类型", - "selectAll": "全选", - "sortByLabel": "按名称排序", "sortByType": "按类型排序" }, "scope": { @@ -101,8 +112,13 @@ "selected": "指定节点" } }, + "complete": { + "completeNodes": "完成: __number__个节点" + }, "debug": { "output": "输出", + "none": "None", + "invalid-exp": "无效的JSONata表达式: __error__", "msgprop": "信息属性", "msgobj": "完整信息", "to": "目标", @@ -124,7 +140,11 @@ "filterCurrent": "当前流程", "debugNodes": "调试节点", "clearLog": "清空日志", - "openWindow": "在新窗口打开" + "filterLog": "过滤日志", + "openWindow": "在新窗口打开", + "copyPath": "复制路径", + "copyPayload": "复制值", + "pinPath": "固定展开" }, "messageMenu": { "collapseAll": "折叠所有路径", @@ -146,26 +166,33 @@ "key": "私钥", "passphrase": "密码", "ca": "CA证书", - "verify-server-cert":"验证服务器证书" + "verify-server-cert":"验证服务器证书", + "servername": "服务器名" }, "placeholder": { "cert":"证书路径 (PEM 格式)", "key":"私钥路径 (PEM 格式)", "ca":"CA证书路径 (PEM 格式)", - "passphrase":"私钥密码 (可选)" + "passphrase":"私钥密码 (可选)", + "servername":"用于SNI" }, "error": { "missing-file": "未提供证书/密钥文件" } }, "exec": { + "exec": "exec", + "spawn": "spawn", "label": { "command": "命令", "append": "追加", "timeout": "超时", "timeoutplace": "可选填", "return": "输出", - "seconds": "秒" + "seconds": "秒", + "stdout": "标准输出", + "stderr": "标准错误输出", + "retcode": "返回码" }, "placeholder": { "extraparams": "额外的输入参数" @@ -177,6 +204,7 @@ "oldrc": "使用旧式输出 (兼容模式)" }, "function": { + "function": "函数", "label": { "function": "函数", "outputs": "输出" @@ -187,6 +215,7 @@ } }, "template": { + "template": "模板", "label": { "template": "模版", "property": "属性", @@ -199,7 +228,7 @@ "yaml": "YAML", "none": "无" }, - "templatevalue": "This is the payload: {{payload}} !" + "templatevalue": "这是有效载荷: {{payload}} !" }, "delay": { "action": "行为设置", @@ -272,6 +301,9 @@ "wait-reset": "等待被重置", "wait-for": "等待", "wait-loop": "周期性重发", + "for": "处理", + "bytopics": "每个msg.topic", + "alltopics": "所有消息", "duration": { "ms": "毫秒", "s": "秒", @@ -290,6 +322,7 @@ } }, "comment": { + "comment": "注释" }, "unknown": { "label": { @@ -300,9 +333,10 @@ "mqtt": { "label": { "broker": "服务端", - "example": "e.g. localhost", + "example": "比如:本地主机", "output": "输出", "qos": "QoS", + "retain": "保持", "clientid": "客户端ID", "port": "端口", "keepalive": "Keepalive计时(秒)", @@ -312,17 +346,22 @@ "verify-server-cert":"验证服务器证书", "compatmode": "使用旧式MQTT 3.1支持" }, + "sections-label":{ + "birth-message": "连接时发送的消息(出生消息)", + "will-message":"意外断开连接时的发送消息(Will消息)", + "close-message":"断开连接前发送的消息(关闭消息)" + }, "tabs-label": { "connection": "连接", "security": "安全", - "will": "Will信息", - "birth": "Birth信息" + "messages": "消息" }, "placeholder": { "clientid": "留白则自动生成", "clientid-nonclean":"如非新会话,必须设置客户端ID", "will-topic": "留白将禁止Will信息", - "birth-topic": "留白将禁止Birth信息" + "birth-topic": "留白将禁止Birth信息", + "close-topic": "留白以禁用关闭消息" }, "state": { "connected": "已连接到服务端: __broker__", @@ -333,7 +372,9 @@ "output": { "buffer": "Buffer", "string": "字符串", - "base64": "Base64编码字符串" + "base64": "Base64编码字符串", + "auto": "自动检测 (字符串或buffer)", + "json": "解析的JSON对象" }, "true": "是", "false": "否", @@ -342,7 +383,9 @@ "not-defined": "主题未设置", "missing-config": "未设置服务端", "invalid-topic": "主题无效", - "nonclean-missingclientid": "客户端ID未设定,使用新会话" + "nonclean-missingclientid": "客户端ID未设定,使用新会话", + "invalid-json-string": "无效的JSON字符串", + "invalid-json-parse": "无法解析JSON字符串" } }, "httpin": { @@ -353,13 +396,27 @@ "return": "返回", "upload": "接受文件上传?", "status": "状态码", - "headers": "Header", - "other": "其他" + "headers": "头", + "other": "其他", + "paytoqs" : "将msg.payload附加为查询字符串参数", + "utf8String": "UTF8格式的字符串", + "binaryBuffer": "二进制buffer", + "jsonObject": "解析的JSON对象", + "authType": "类型", + "bearerToken": "Token" }, "setby": "- 用 msg.method 设定 -", "basicauth": "基本认证", "use-tls": "使用安全连接 (SSL/TLS) ", "tls-config":"TLS 设置", + "basic": "基本认证", + "digest": "摘要认证", + "bearer": "bearer认证", + "use-proxy": "使用代理服务器", + "persist": "对连接启用keep-alive", + "proxy-config": "代理服务器设置", + "use-proxyauth": "使用代理身份验证", + "noproxy-hosts": "代理例外", "utf8": "UTF-8 字符串", "binary": "二进制数据", "json": "JSON对象", @@ -376,7 +433,10 @@ "json-error": "JSON 解析错误", "no-url": "未设定 URL", "deprecated-call":"__method__方法已弃用", - "invalid-transport":"非HTTP传输请求" + "invalid-transport":"非HTTP传输请求", + "timeout-isnan": "超时值不是有效数字,忽略", + "timeout-isnegative": "超时值为负,忽略", + "invalid-payload": "无效的有效载荷" }, "status": { "requesting": "请求中" @@ -399,13 +459,19 @@ "url1": "URL 应该使用ws://或者wss://方案并指向现有的websocket侦听器.", "url2": "默认情况下,payload 将包含要发送或从Websocket接收的数据。可以将客户端配置为以JSON格式的字符串发送或接收整个消息对象." }, + "status": { + "connected": "连接数 __count__", + "connected_plural": "连接数 __count__" + }, "errors": { "connect-error": "ws连接发生了错误: ", "send-error": "发送时发生了错误: ", - "missing-conf": "未设置服务器" + "missing-conf": "未设置服务器", + "duplicate-path": "同一路径上不能有两个WebSocket侦听器: __path__" } }, "watch": { + "watch": "watch", "label": { "files": "文件", "recursive": "递归所有子文件夹" @@ -421,7 +487,7 @@ "output": "输出", "port": "端口", "host": "主机地址", - "payload": "的有效载荷", + "payload": "有效载荷", "delimited": "分隔符号", "close-connection": "是否在成功发送每条信息后断开连接?", "decode-base64": "用 Base64 解码信息?", @@ -480,7 +546,6 @@ "output": "输出", "group": "组", "interface": "本地IP", - "interfaceprompt": "(可选)本地 IP 绑定到", "send": "发送一个", "toport": "到端口", "address": "地址", @@ -488,6 +553,7 @@ }, "placeholder": { "interface": "(可选)eth0的IP地址", + "interfaceprompt": "(可选) 要绑定的本地接口或地址", "address": "目标IP地址" }, "udpmsgs": "udp信息", @@ -529,15 +595,18 @@ "ip-notset": "udp: IP地址未设定", "port-notset": "udp: 端口未设定", "port-invalid": "udp: 无效端口号码", - "alreadyused": "udp: 端口已被占用" + "alreadyused": "udp: 端口已被占用", + "ifnotfound": "udp: 接口 __iface__ 未发现" } }, "switch": { + "switch": "switch", "label": { "property": "属性", "rule": "规则", "repair" : "重建信息队列" }, + "previous": "先前值", "and": "与", "checkall": "全选所有规则", "stopfirst": "接受第一条匹配信息后停止", @@ -550,11 +619,15 @@ "false":"为假", "null":"为空", "nnull":"非空", - "head":"head", - "tail":"tail", - "index":"index between", + "istype": "类型是", + "empty": "为空", + "nempty": "非空", + "head":"头", + "tail":"尾", + "index":"索引在..中间", "exp":"JSONata表达式", - "else":"除此以外" + "else":"除此以外", + "hask": "拥有键" }, "errors": { "invalid-expr": "无效的JSONata表达式: __error__", @@ -588,6 +661,7 @@ } }, "range": { + "range": "range", "label": { "action": "操作", "inputrange": "映射输入数据", @@ -623,7 +697,8 @@ "firstrow": "第一行包含列名", "output": "输出", "includerow": "包含列名行", - "newline": "换行符" + "newline": "换行符", + "usestrings": "解析数值" }, "placeholder": { "columns": "用逗号分割列名" @@ -654,7 +729,8 @@ "html": { "label": { "select": "选取项", - "output": "输出" + "output": "输出", + "in": "in" }, "output": { "html": "选定元素的html内容", @@ -670,7 +746,9 @@ "errors": { "dropped-object": "忽略非对象格式的有效负载", "dropped": "忽略不支持格式的有效负载类型", - "dropped-error": "转换有效负载失败" + "dropped-error": "转换有效负载失败", + "schema-error": "JSON架构错误", + "schema-error-compile": "JSON架构错误: 未能编译架构" }, "label": { "o2j": "对象至JSON", @@ -713,7 +791,10 @@ "breaklines": "分拆成行", "filelabel": "文件", "sendError": "发生错误时发送消息(传统模式)", - "deletelabel": "删除 __file__" + "deletelabel": "删除 __file__", + "encoding": "编码", + "utf8String": "UTF8字符串", + "binaryBuffer": "二进制buffer" }, "action": { "append": "追加至文件", @@ -731,6 +812,21 @@ "deletedfile": "删除文件: __file__", "appendedfile": "追加至文件: __file__" }, + "encoding": { + "none": "默认", + "native": "Native", + "unicode": "Unicode", + "japanese": "日本", + "chinese": "中国", + "korean": "韩国", + "taiwan": "台湾/香港", + "windows": "Windows代码页", + "iso": "ISO代码页", + "ibm": "IBM代码页", + "mac": "Mac代码页", + "koi8": "KOI8代码页", + "misc": "其它" + }, "errors": { "nofilename": "未指定文件名", "invaliddelete": "警告:无效删除。请在配置对话框中使用特定的删除选项", @@ -742,6 +838,7 @@ "tip": "提示: 文件名应该是绝对路径,否则它将相对于Node-RED进程的工作目录。" }, "split": { + "split": "split", "intro":"基于以下类型拆分msg.payload:", "object":"对象", "objectSend":"每个键值对作为单个消息发送", @@ -753,6 +850,7 @@ "addname":" 复制键到 " }, "join":{ + "join": "join", "mode":{ "mode":"模式", "auto":"自动", @@ -761,6 +859,7 @@ "custom":"手动" }, "combine":"合并每个", + "completeMessage": "完整的消息", "create":"输出为", "type":{ "string":"字符串", @@ -799,6 +898,7 @@ } }, "sort" : { + "sort": "排序", "target" : "排序属性", "seq" : "信息队列", "key" : "键值", @@ -807,11 +907,12 @@ "ascending" : "升序", "descending" : "降序", "as-number" : "作为数值", - "invalid-exp" : "sort节点中存在无效的JSONata表达式", - "too-many" : "sort节点中有太多待定信息", - "clear" : "清空sort节点中的待定信息" + "invalid-exp" : "排序节点中存在无效的JSONata表达式", + "too-many" : "排序节点中有太多待定信息", + "clear" : "清空排序节点中的待定信息" }, "batch" : { + "batch": "batch", "mode": { "label" : "模式", "num-msgs" : "按指定数量分组", diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/network/05-tls.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/network/05-tls.html new file mode 100644 index 000000000..5a9603946 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/network/05-tls.html @@ -0,0 +1,19 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/network/06-httpproxy.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/network/06-httpproxy.html new file mode 100644 index 000000000..e84971973 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/network/06-httpproxy.html @@ -0,0 +1,22 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/network/10-mqtt.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/network/10-mqtt.html new file mode 100644 index 000000000..520d7f4ef --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/network/10-mqtt.html @@ -0,0 +1,71 @@ + + + + + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/network/21-httpin.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/network/21-httpin.html new file mode 100644 index 000000000..0fb52efd1 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/network/21-httpin.html @@ -0,0 +1,81 @@ + + + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/network/21-httprequest.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/network/21-httprequest.html new file mode 100644 index 000000000..3c7b163e2 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/network/21-httprequest.html @@ -0,0 +1,78 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/network/22-websocket.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/network/22-websocket.html new file mode 100644 index 000000000..d2ee29dfa --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/network/22-websocket.html @@ -0,0 +1,35 @@ + + + + + + + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/network/31-tcpin.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/network/31-tcpin.html new file mode 100644 index 000000000..2f00ed5f5 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/network/31-tcpin.html @@ -0,0 +1,35 @@ + + + + + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/network/32-udp.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/network/32-udp.html new file mode 100644 index 000000000..1e01aa0a3 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/network/32-udp.html @@ -0,0 +1,28 @@ + + + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/parsers/70-CSV.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/parsers/70-CSV.html new file mode 100644 index 000000000..5657f4cd3 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/parsers/70-CSV.html @@ -0,0 +1,43 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/parsers/70-HTML.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/parsers/70-HTML.html new file mode 100644 index 000000000..73b365600 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/parsers/70-HTML.html @@ -0,0 +1,33 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/parsers/70-JSON.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/parsers/70-JSON.html new file mode 100644 index 000000000..2e574a0bf --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/parsers/70-JSON.html @@ -0,0 +1,43 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/parsers/70-XML.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/parsers/70-XML.html new file mode 100644 index 000000000..04a7783ef --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/parsers/70-XML.html @@ -0,0 +1,48 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/parsers/70-YAML.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/parsers/70-YAML.html new file mode 100644 index 000000000..e65d1b87d --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/parsers/70-YAML.html @@ -0,0 +1,34 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/sequence/17-split.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/sequence/17-split.html new file mode 100644 index 000000000..22f01832a --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/sequence/17-split.html @@ -0,0 +1,133 @@ + + + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/sequence/18-sort.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/sequence/18-sort.html new file mode 100644 index 000000000..226355a8c --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/sequence/18-sort.html @@ -0,0 +1,41 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/sequence/19-batch.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/sequence/19-batch.html new file mode 100644 index 000000000..012f20816 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/sequence/19-batch.html @@ -0,0 +1,34 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/storage/10-file.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/storage/10-file.html new file mode 100644 index 000000000..4ec78cdb4 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/storage/10-file.html @@ -0,0 +1,59 @@ + + + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-CN/storage/23-watch.html b/packages/node_modules/@node-red/nodes/locales/zh-CN/storage/23-watch.html new file mode 100644 index 000000000..eec611429 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-CN/storage/23-watch.html @@ -0,0 +1,25 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/common/20-inject.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/common/20-inject.html new file mode 100644 index 000000000..046eddd7e --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/common/20-inject.html @@ -0,0 +1,35 @@ + + + + \ No newline at end of file diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/common/21-debug.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/common/21-debug.html new file mode 100644 index 000000000..31f78e907 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/common/21-debug.html @@ -0,0 +1,25 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/common/24-complete.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/common/24-complete.html new file mode 100644 index 000000000..862745310 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/common/24-complete.html @@ -0,0 +1,24 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/common/25-catch.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/common/25-catch.html new file mode 100644 index 000000000..4e3db015d --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/common/25-catch.html @@ -0,0 +1,36 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/common/25-status.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/common/25-status.html new file mode 100644 index 000000000..d961c8e52 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/common/25-status.html @@ -0,0 +1,33 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/common/60-link.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/common/60-link.html new file mode 100644 index 000000000..e7723c499 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/common/60-link.html @@ -0,0 +1,31 @@ + + + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/common/90-comment.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/common/90-comment.html new file mode 100644 index 000000000..d044f28db --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/common/90-comment.html @@ -0,0 +1,21 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/common/98-unknown.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/common/98-unknown.html new file mode 100644 index 000000000..c3588def1 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/common/98-unknown.html @@ -0,0 +1,24 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/function/10-function.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/function/10-function.html new file mode 100644 index 000000000..9f8ddb43f --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/function/10-function.html @@ -0,0 +1,51 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/function/10-switch.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/function/10-switch.html new file mode 100644 index 000000000..5a65eff93 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/function/10-switch.html @@ -0,0 +1,37 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/function/15-change.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/function/15-change.html new file mode 100644 index 000000000..91a320945 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/function/15-change.html @@ -0,0 +1,33 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/function/16-range.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/function/16-range.html new file mode 100644 index 000000000..62eb63d0b --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/function/16-range.html @@ -0,0 +1,40 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/function/80-template.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/function/80-template.html new file mode 100644 index 000000000..874ae3801 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/function/80-template.html @@ -0,0 +1,46 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/function/89-delay.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/function/89-delay.html new file mode 100644 index 000000000..28c291de8 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/function/89-delay.html @@ -0,0 +1,32 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/function/89-trigger.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/function/89-trigger.html new file mode 100644 index 000000000..6bbe72f4d --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/function/89-trigger.html @@ -0,0 +1,33 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/function/90-exec.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/function/90-exec.html new file mode 100644 index 000000000..27be34e00 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/function/90-exec.html @@ -0,0 +1,74 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/messages.json b/packages/node_modules/@node-red/nodes/locales/zh-TW/messages.json new file mode 100644 index 000000000..7ece3333d --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/messages.json @@ -0,0 +1,940 @@ +{ + "common": { + "label": { + "payload": "內容", + "topic": "主題", + "name": "名稱", + "username": "使用者名稱", + "password": "密碼", + "property": "屬性", + "selectNodes": "選擇節點...", + "expand": "擴展" + }, + "status": { + "connected": "已連接", + "not-connected": "未連接", + "disconnected": "已斷開", + "connecting": "連接中", + "error": "錯誤", + "ok": "確定" + }, + "notification": { + "error": "錯誤: __message__", + "errors": { + "not-deployed": "節點未部署", + "no-response": "伺服器無反應", + "unexpected": "發生意外錯誤 (__status__) __message__" + } + }, + "errors": { + "nooverride": "警告: 資訊的屬性已經不可以改寫節點的屬性. 詳情參考 bit.ly/nr-override-msg-props" + } + }, + "inject": { + "inject": "注入", + "repeat": "重複 = __repeat__", + "crontab": "crontab = __crontab__", + "stopped": "停止", + "failed": "注入失敗: __error__", + "label": { + "repeat": "重複", + "flow": "流上下午", + "global": "全局上下文", + "str": "字符串", + "num": "數值", + "bool": "布爾值", + "json": "JSON對象", + "bin": "buffer", + "date": "時間戳", + "env": "環境變量", + "object": "對象", + "string": "字符串", + "boolean": "布爾值", + "number": "數值", + "Array": "數組", + "invalid": "無效的JSON對象" + }, + "timestamp": "時間戳記", + "none": "無", + "interval": "週期性執行", + "interval-time": "指定時間段並週期性執行", + "time": "指定時間", + "seconds": "秒", + "minutes": "分鐘", + "hours": "小時", + "between": "介於", + "previous": "之前數值", + "at": "在", + "and": "至", + "every": "每隔", + "days": [ + "星期一", + "星期二", + "星期三", + "星期四", + "星期五", + "星期六", + "星期天" + ], + "on": "在", + "onstart": "立刻執行於", + "onceDelay": "秒後, 此後", + "tip": "注意: \"指定時間段並週期性執行\" 和 \"指定時間\" 會使用cron系統.
詳情查看信息頁.", + "success": "成功注入: __label__", + "errors": { + "failed": "注入失敗, 請查看日誌", + "toolong": "週期過長" + } + }, + "catch": { + "catch": "監測所有節點", + "catchNodes": "監測__number__個節點", + "catchUncaught": "捕獲:未捕獲", + "label": { + "source": "監測範圍", + "selectAll": "全選", + "uncaught": "忽略其他捕獲節點處理的錯誤" + }, + "scope": { + "all": "所有節點", + "selected": "指定節點" + } + }, + "status": { + "status": "報告所有節點狀態", + "statusNodes": "報告__number__個節點狀態", + "label": { + "source": "報告狀態範圍", + "sortByType": "按類型排序" + }, + "scope": { + "all": "所有節點", + "selected": "指定節點" + } + }, + "complete": { + "completeNodes": "完成: __number__個節點" + }, + "debug": { + "output": "輸出", + "none": "None", + "invalid-exp": "無效的JSONata表達式: __error__", + "msgprop": "資訊屬性", + "msgobj": "完整資訊", + "to": "目標", + "debtab": "除錯窗口", + "tabcon": "除錯窗口及Console", + "toSidebar": "除錯窗口", + "toConsole": "Console", + "toStatus": "節點狀態 (32位元字元)", + "severity": "級別", + "notification": { + "activated": "成功啟動: __label__", + "deactivated": "成功取消: __label__" + }, + "sidebar": { + "label": "除錯窗口", + "name": "名稱", + "filterAll": "所有節點", + "filterSelected": "已選節點", + "filterCurrent": "當前流程", + "debugNodes": "除錯節點", + "clearLog": "清空日誌", + "filterLog": "過濾日誌", + "openWindow": "在新視窗打開", + "copyPath": "復制路徑", + "copyPayload": "復制值", + "pinPath": "固定展開" + }, + "messageMenu": { + "collapseAll": "折疊所有路徑", + "clearPinned": "清空已固定路徑", + "filterNode": "過濾此節點", + "clearFilter": "清空過濾條件" + } + }, + "link": { + "linkIn": "輸入", + "linkOut": "輸出" + }, + "tls": { + "tls": "TLS設置", + "label": { + "use-local-files": "使用本地密鑰及證書檔", + "upload": "上傳", + "cert": "證書", + "key": "私密金鑰", + "passphrase": "密碼", + "ca": "CA證書", + "verify-server-cert": "驗證伺服器憑證", + "servername": "服務器名" + }, + "placeholder": { + "cert": "憑證路徑 (PEM 格式)", + "key": "私密金鑰路徑 (PEM 格式)", + "ca": "CA憑證路徑 (PEM 格式)", + "passphrase": "私密金鑰密碼 (可選)", + "servername": "用於SNI" + }, + "error": { + "missing-file": "未提供證書/金鑰檔案" + } + }, + "exec": { + "exec": "exec", + "spawn": "spawn", + "label": { + "command": "命令", + "append": "追加", + "timeout": "超時", + "timeoutplace": "可選填", + "return": "輸出", + "seconds": "秒", + "stdout": "標準輸出", + "stderr": "標準錯誤輸出", + "retcode": "返回碼" + }, + "placeholder": { + "extraparams": "額外的輸入參數" + }, + "opt": { + "exec": "當命令完成時 - exec模式", + "spawn": "當命令進行時 - spawn模式" + }, + "oldrc": "使用舊式輸出 (相容模式)" + }, + "function": { + "function": "函數", + "label": { + "function": "函數", + "outputs": "輸出" + }, + "error": { + "inputListener": "無法在函數中監聽對'注入'事件", + "non-message-returned": "函數節點嘗試返回類型為 __type__ 的資訊" + } + }, + "template": { + "template": "模板", + "label": { + "template": "模版", + "property": "屬性", + "format": "語法高亮", + "syntax": "格式", + "output": "輸出為", + "mustache": "Mustache 模版", + "plain": "純文字", + "json": "JSON", + "yaml": "YAML", + "none": "無" + }, + "templatevalue": "This is the payload: {{payload}} !" + }, + "delay": { + "action": "行為設置", + "for": "時長", + "delaymsg": "延遲每一條資訊", + "delayfixed": "固定延遲時間", + "delayvarmsg": "允許msg.delay複寫延遲時長", + "randomdelay": "隨機延遲", + "limitrate": "限制資訊頻率", + "limitall": "所有資訊", + "limittopic": "每一個msg.topic", + "fairqueue": "依次發送每一個topic", + "timedqueue": "發所有topic", + "milisecs": "毫秒", + "secs": "秒", + "sec": "秒", + "mins": "分", + "min": "分", + "hours": "小時", + "hour": "小時", + "days": "天", + "day": "天", + "between": "介於", + "and": "至", + "rate": "速度", + "msgper": "信息 每", + "dropmsg": "不傳輸中間資訊", + "label": { + "delay": "延遲", + "variable": "變數", + "limit": "限制", + "limitTopic": "限制主題", + "random": "隨機", + "units": { + "second": { + "plural": "秒", + "singular": "秒" + }, + "minute": { + "plural": "分鐘", + "singular": "分鐘" + }, + "hour": { + "plural": "小時", + "singular": "小時" + }, + "day": { + "plural": "天", + "singular": "天" + } + } + }, + "error": { + "buffer": "緩衝了超過 1000 條資訊", + "buffer1": "緩衝了超過 10000 條資訊" + } + }, + "trigger": { + "send": "發送", + "then": "然後", + "then-send": "然後發送", + "output": { + "string": "字串", + "number": "數字", + "existing": "現有資訊物件", + "original": "原本資訊物件", + "latest": "最新資訊物件", + "nothing": "無" + }, + "wait-reset": "等待被重置", + "wait-for": "等待", + "wait-loop": "週期性重發", + "for": "處理", + "bytopics": "每個msg.topic", + "alltopics": "所有消息", + "duration": { + "ms": "毫秒", + "s": "秒", + "m": "分鐘", + "h": "小時" + }, + "extend": " 如有新資訊,延長延遲", + "label": { + "trigger": "觸發", + "trigger-block": "觸發並阻止", + "trigger-loop": "週期性重發", + "reset": "重置觸發節點條件 如果:", + "resetMessage": "msg.reset已設置", + "resetPayload": "msg.payload等於", + "resetprompt": "可選填" + } + }, + "comment": { + "comment": "注釋" + }, + "unknown": { + "label": { + "unknown": "未知" + }, + "tip": "

此節點是您安裝,但Node-RED所不知道的類型。

如果在此狀態下部署節點,那麼它的配置將被保留,但是流程將不會啟動,直到安裝缺少的節點。

有關更多説明,請參閱資訊側欄

" + }, + "mqtt": { + "label": { + "broker": "服務端", + "example": "e.g. localhost", + "output": "輸出", + "qos": "QoS", + "retain": "保持", + "clientid": "使用者端ID", + "port": "埠", + "keepalive": "Keepalive計時(秒)", + "cleansession": "使用新的會話", + "use-tls": "使用安全連接 (SSL/TLS)", + "tls-config": "TLS 設置", + "verify-server-cert": "驗證伺服器憑證", + "compatmode": "使用舊式MQTT 3.1支援" + }, + "sections-label": { + "birth-message": "連接時發送的消息(出生消息)", + "will-message": "意外斷開連接時的發送消息(Will消息)", + "close-message": "斷開連接前發送的消息(關閉消息)" + }, + "tabs-label": { + "connection": "連接", + "security": "安全", + "messages": "消息" + }, + "placeholder": { + "clientid": "留白則自動隨機生成", + "clientid-nonclean": "如非新會話,必須設置使用者端ID", + "will-topic": "留白將禁止Will資訊", + "birth-topic": "留白將禁止Birth資訊", + "close-topic": "留白以禁用關閉消息" + }, + "state": { + "connected": "已連接到服務端: __broker__", + "disconnected": "已斷開與服務端 __broker__ 的連結", + "connect-failed": "與服務端 __broker__ 的連接失敗" + }, + "retain": "保留", + "output": { + "buffer": "Buffer", + "string": "字串", + "base64": "Base64編碼字串", + "auto": "自動檢測 (字符串或buffer)", + "json": "解析的JSON對象" + }, + "true": "是", + "false": "否", + "tip": "提示: 若希望通過msg屬性對topic(資訊), qos及retain(保留)進行設置, 則將上述項留白", + "errors": { + "not-defined": "主題未設置", + "missing-config": "未設置服務端", + "invalid-topic": "主題無效", + "nonclean-missingclientid": "使用者端ID未設定,使用新會話", + "invalid-json-string": "無效的JSON字符串", + "invalid-json-parse": "無法解析JSON字符串" + } + }, + "httpin": { + "label": { + "method": "請求方式", + "url": "URL", + "doc": "文字檔", + "return": "返回", + "upload": "接受檔案上傳?", + "status": "狀態碼", + "headers": "Header", + "other": "其他", + "paytoqs": "將msg.payload附加為查詢字符串參數", + "utf8String": "UTF8格式的字符串", + "binaryBuffer": "二進制buffer", + "jsonObject": "解析的JSON對象", + "authType": "類型", + "bearerToken": "Token" + }, + "setby": "- 用 msg.method 設定 -", + "basicauth": "基本認證", + "use-tls": "使用安全連接 (SSL/TLS) ", + "tls-config": "TLS 設置", + "basic": "基本認證", + "digest": "摘要認證", + "bearer": "bearer認證", + "use-proxy": "使用代理服務器", + "persist": "對連接啟用keep-alive", + "proxy-config": "代理服務器設置", + "use-proxyauth": "使用代理身份驗證", + "noproxy-hosts": "代理例外", + "utf8": "UTF-8 字串", + "binary": "二進位資料", + "json": "JSON對象", + "tip": { + "in": "相對URL", + "res": "發送到此節點的消息必須來自http input節點", + "req": "提示:如果JSON解析失敗,則獲取的字串將按原樣返回." + }, + "httpreq": "http 請求", + "errors": { + "not-created": "當httpNodeRoot為否時,無法創建http-in節點", + "missing-path": "無路徑", + "no-response": "無響應物件", + "json-error": "JSON 解析錯誤", + "no-url": "未設定 URL", + "deprecated-call": "__method__方法已棄用", + "invalid-transport": "非HTTP傳輸請求", + "timeout-isnan": "超時值不是有效數字,忽略", + "timeout-isnegative": "超時值為負,忽略", + "invalid-payload": "無效的有效載荷" + }, + "status": { + "requesting": "請求中" + } + }, + "websocket": { + "label": { + "type": "類型", + "path": "路徑", + "url": "URL" + }, + "listenon": "監聽", + "connectto": "連接", + "sendrec": "發送/接受", + "payload": "有效載荷", + "message": "完整資訊", + "tip": { + "path1": "預設情況下,payload將包含要發送或從Websocket接收的資料。偵聽器可以配置為以JSON格式的字串發送或接收整個消息物件.", + "path2": "這條路徑將相對於 ", + "url1": "URL 應該使用ws://或者wss://方案並指向現有的websocket監聽器.", + "url2": "預設情況下,payload 將包含要發送或從Websocket接收的資料。可以將使用者端配置為以JSON格式的字串發送或接收整個消息物件." + }, + "status": { + "connected": "連接數 __count__", + "connected_plural": "連接數 __count__" + }, + "errors": { + "connect-error": "ws連接發生了錯誤: ", + "send-error": "發送時發生了錯誤: ", + "missing-conf": "未設置伺服器", + "duplicate-path": "同一路徑上不能有兩個WebSocket偵聽器: __path__" + } + }, + "watch": { + "watch": "watch", + "label": { + "files": "文件", + "recursive": "遞迴所有子資料夾" + }, + "placeholder": { + "files": "逗號分開文件或資料夾" + }, + "tip": "在Windows上,請務必使用雙斜杠 \\\\ 來隔開資料夾名字" + }, + "tcpin": { + "label": { + "type": "類型", + "output": "輸出", + "port": "埠", + "host": "主機位址", + "payload": "的有效載荷", + "delimited": "分隔符號號", + "close-connection": "是否在成功發送每條資訊後斷開連接?", + "decode-base64": "用 Base64 解碼信息?", + "server": "伺服器", + "return": "返回", + "ms": "毫秒", + "chars": "字元" + }, + "type": { + "listen": "監聽", + "connect": "連接", + "reply": "回應 TCP" + }, + "output": { + "stream": "字串流", + "single": "單一", + "buffer": "Buffer", + "string": "字串", + "base64": "Base64 字串" + }, + "return": { + "timeout": "指定時間後", + "character": "當收到某個字元為", + "number": "指定字元數", + "never": "永不 - 保持連接", + "immed": "馬上 - 不需要等待回復" + }, + "status": { + "connecting": "正在連接到 __host__:__port__", + "connected": "已經連接到 __host__:__port__", + "listening-port": "監聽埠 __port__", + "stopped-listening": "已停止監聽埠", + "connection-from": "連接來自 __host__:__port__", + "connection-closed": "連接已關閉 __host__:__port__", + "connections": "__count__ 個連接", + "connections_plural": "__count__ 個連接" + }, + "errors": { + "connection-lost": "連接中斷 __host__:__port__", + "timeout": "超時關閉通訊端連接,埠 __port__", + "cannot-listen": "無法監聽埠 __port__, 錯誤: __error__", + "error": "錯誤: __error__", + "socket-error": "通訊端連接錯誤來自 __host__:__port__", + "no-host": "主機位址或埠未設定", + "connect-timeout": "連接逾時", + "connect-fail": "連接失敗" + } + }, + "udp": { + "label": { + "listen": "監聽", + "onport": "埠", + "using": "使用", + "output": "輸出", + "group": "組", + "interface": "本地IP", + "send": "發送一個", + "toport": "到埠", + "address": "地址", + "decode-base64": "是否解碼Base64編碼的資訊?", + "interfaceprompt": "(可選)本地 IP 綁定到" + }, + "placeholder": { + "interface": "(可選)eth0的IP地址", + "interfaceprompt": "(可選) 要綁定的本地接口或地址", + "address": "目標IP位址" + }, + "udpmsgs": "udp信息", + "mcmsgs": "群播信息", + "udpmsg": "udp信息", + "bcmsg": "廣播資訊", + "mcmsg": "群播信息", + "output": { + "buffer": "Buffer", + "string": "字串", + "base64": "Base64編碼字串" + }, + "bind": { + "random": "綁定到任意本地埠", + "local": "綁定到本地埠", + "target": "綁定到目標埠" + }, + "tip": { + "in": "提示:確保您的防火牆將允許資料進入", + "out": "提示:如果要使用msg.ipmsg.port設置,請將位址和埠留空", + "port": "正在使用埠: " + }, + "status": { + "listener-at": "udp 監聽器正在監聽 __host__:__port__", + "mc-group": "udp 群播到 __group__", + "listener-stopped": "udp 監聽器已停止", + "output-stopped": "udp 輸出已停止", + "mc-ready": "udp 群播已準備好: __outport__ -> __host__:__port__", + "bc-ready": "udp 廣播已準備好: __outport__ -> __host__:__port__", + "ready": "udp 已準備好: __outport__ -> __host__:__port__", + "ready-nolocal": "udp 已準備好: __host__:__port__", + "re-use": "udp 重用通訊端: __outport__ -> __host__:__port__" + }, + "errors": { + "access-error": "UDP 訪問錯誤, 你可能需要root許可權才能接入1024以下的埠", + "error": "錯誤: __error__", + "bad-mcaddress": "無效的群播地址", + "interface": "必須是指定介面的IP位址", + "ip-notset": "udp: IP地址未設定", + "port-notset": "udp: 埠未設定", + "port-invalid": "udp: 無效埠號碼", + "alreadyused": "udp: 埠已被佔用", + "ifnotfound": "udp: 接口 __iface__ 未發現" + } + }, + "switch": { + "switch": "switch", + "label": { + "property": "屬性", + "rule": "規則", + "repair": "重建資訊佇列" + }, + "previous": "先前值", + "and": "與", + "checkall": "全選所有規則", + "stopfirst": "接受第一條匹配資訊後停止", + "ignorecase": "忽略大小寫", + "rules": { + "btwn": "在之間", + "cont": "包含", + "regex": "匹配規則運算式", + "true": "為真", + "false": "為假", + "null": "為空", + "nnull": "非空", + "istype": "類型是", + "empty": "為空", + "nempty": "非空", + "head": "head", + "tail": "tail", + "index": "index between", + "exp": "JSONata運算式", + "else": "除此以外", + "hask": "擁有鍵" + }, + "errors": { + "invalid-expr": "無效的JSONata運算式: __error__", + "too-many": "Switch節點中有太多待定信息" + } + }, + "change": { + "label": { + "rules": "規則", + "rule": "規則", + "set": "設定 __property__", + "change": "修改 __property__", + "delete": "刪除 __property__", + "move": "移動 __property__", + "changeCount": "修改: __count__條規矩", + "regex": "使用規則運算式" + }, + "action": { + "set": "設定", + "change": "修改", + "delete": "刪除", + "move": "轉移", + "to": "到", + "search": "搜索", + "replace": "替代為" + }, + "errors": { + "invalid-from": "無效的'from'屬性: __error__", + "invalid-json": "無效的'to'JSON 屬性", + "invalid-expr": "無效的JSONata運算式: __error__" + } + }, + "range": { + "range": "range", + "label": { + "action": "操作", + "inputrange": "映射輸入資料", + "resultrange": "至目標範圍", + "from": "從", + "to": "到", + "roundresult": "取最接近整數?" + }, + "placeholder": { + "min": "e.g. 0", + "maxin": "e.g. 99", + "maxout": "e.g. 255" + }, + "scale": { + "payload": "按比例msg.payload", + "limit": "按比例並設定界限至目標範圍", + "wrap": "按比例並包含在目標範圍內" + }, + "tip": "提示: 此節點僅對數字有效", + "errors": { + "notnumber": "不是一個數字" + } + }, + "csv": { + "label": { + "columns": "列", + "separator": "分隔符號", + "c2o": "CSV至對象", + "o2c": "對象至CSV", + "input": "輸入", + "skip-s": "忽略前", + "skip-e": "行", + "firstrow": "第一行包含列名", + "output": "輸出", + "includerow": "包含列名行", + "newline": "分行符號", + "usestrings": "解析數值" + }, + "placeholder": { + "columns": "用逗號分割列名" + }, + "separator": { + "comma": "逗號", + "tab": "Tab", + "space": "空格", + "semicolon": "分號", + "colon": "冒號", + "hashtag": "井號", + "other": "其他..." + }, + "output": { + "row": "每行一條信息", + "array": "僅一條資訊 [陣列]" + }, + "newline": { + "linux": "Linux (\\n)", + "mac": "Mac (\\r)", + "windows": "Windows (\\r\\n)" + }, + "errors": { + "csv_js": "此節點僅處理CSV字串或JS物件", + "obj_csv": "對象->CSV轉換未設定列模版" + } + }, + "html": { + "label": { + "select": "選取項", + "output": "輸出", + "in": "in" + }, + "output": { + "html": "選定元素的html內容", + "text": "選定元素的純文字內容", + "attr": "包含選定元素的所有屬性的物件" + }, + "format": { + "single": "一條資訊 [陣列]", + "multi": "多條資訊,每條一個元素" + } + }, + "json": { + "errors": { + "dropped-object": "忽略非物件格式的有效負載", + "dropped": "忽略不支援格式的有效負載類型", + "dropped-error": "轉換有效負載失敗", + "schema-error": "JSON架構錯誤", + "schema-error-compile": "JSON架構錯誤: 未能編譯架構" + }, + "label": { + "o2j": "對象至JSON", + "pretty": "格式化JSON字串", + "action": "操作", + "property": "屬性", + "actions": { + "toggle": "JSON字串與物件互轉", + "str": "總是轉為JSON字串", + "obj": "總是轉為JS對象" + } + } + }, + "yaml": { + "errors": { + "dropped-object": "忽略非物件格式的有效負載", + "dropped": "忽略不支援格式的有效負載類型", + "dropped-error": "轉換有效負載失敗" + } + }, + "xml": { + "label": { + "represent": "XML標籤屬性的屬性名稱", + "prefix": "標籤文本內容的屬性名稱", + "advanced": "高級選項", + "x2o": "XML到物件選項" + }, + "errors": { + "xml_js": "此節點僅處理XML字串或JS物件." + } + }, + "file": { + "label": { + "filename": "檔案名", + "action": "行為", + "addnewline": "向每個有效載荷添加分行符號(\\n)?", + "createdir": "創建目錄(如果不存在)?", + "outputas": "輸出", + "breakchunks": "分拆成塊", + "breaklines": "分拆成行", + "filelabel": "文件", + "sendError": "發生錯誤時發送消息(傳統模式)", + "deletelabel": "刪除 __file__", + "encoding": "編碼", + "utf8String": "UTF8字符串", + "binaryBuffer": "二進制buffer" + }, + "action": { + "append": "追加至文件", + "overwrite": "複寫文件", + "delete": "刪除檔" + }, + "output": { + "utf8": "一個utf8字串", + "buffer": "一個Buffer物件", + "lines": "每行一條信息", + "stream": "一個Buffer流" + }, + "status": { + "wrotefile": "寫入至文件: __file__", + "deletedfile": "刪除檔: __file__", + "appendedfile": "追加至文件: __file__" + }, + "encoding": { + "none": "默認", + "native": "Native", + "unicode": "Unicode", + "japanese": "日本", + "chinese": "中國", + "korean": "韓國", + "taiwan": "臺灣/香港", + "windows": "Windows代碼頁", + "iso": "ISO代碼頁", + "ibm": "IBM代碼頁", + "mac": "Mac代碼頁", + "koi8": "KOI8代碼頁", + "misc": "其它" + }, + "errors": { + "nofilename": "未指定檔案名", + "invaliddelete": "警告:無效刪除。請在配置對話方塊中使用特定的刪除選項", + "deletefail": "無法刪除檔: __error__", + "writefail": "無法寫入文件: __error__", + "appendfail": "無法追加到文件: __error__", + "createfail": "檔創建失敗: __error__" + }, + "tip": "提示: 檔案名應該是絕對路徑,否則它將相對於Node-RED進程的工作目錄。" + }, + "split": { + "split": "split", + "intro": "基於以下類型拆分msg.payload:", + "object": "對象", + "objectSend": "每個鍵值對作為單個消息發送", + "strBuff": "字串 / Buffer", + "array": "陣列", + "splitUsing": "拆分使用", + "splitLength": "固定長度", + "stream": "作為消息流處理", + "addname": " 複製鍵到 " + }, + "join": { + "join": "join", + "mode": { + "mode": "模式", + "auto": "自動", + "merge": "合併序列", + "reduce": "縮減序列", + "custom": "手動" + }, + "combine": "合併每個", + "completeMessage": "完整的消息", + "create": "輸出為", + "type": { + "string": "字串", + "array": "陣列", + "buffer": "Buffer", + "object": "鍵值對對象", + "merged": "合併對象" + }, + "using": "使用此值", + "key": "作為鍵", + "joinedUsing": "合併符號", + "send": "發送資訊:", + "afterCount": "達到一定數量的資訊時", + "count": "數量", + "subsequent": "和每個後續的消息", + "afterTimeout": "第一條消息的若幹時間後", + "seconds": "秒", + "complete": "在收到存在msg.complete的消息後", + "tip": "此模式假定此節點與split相連, 或者接收到的消息有正確配置的msg.parts屬性.", + "too-many": "join節點中有太多待定信息", + "merge": { + "topics-label": "合併主題", + "topics": "主題", + "topic": "主題", + "on-change": "當收到一個新主題時發送已合併資訊" + }, + "reduce": { + "exp": "Reduce運算式", + "exp-value": "exp", + "init": "初始值", + "right": "反向求值(從後往前)", + "fixup": "Fix-up exp" + }, + "errors": { + "invalid-expr": "無效的JSONata運算式: __error__" + } + }, + "sort": { + "sort": "排序", + "target": "排序屬性", + "seq": "資訊佇列", + "key": "鍵值", + "elem": "元素值", + "order": "順序", + "ascending": "昇冪", + "descending": "降冪", + "as-number": "作為數值", + "invalid-exp": "排序節點中存在無效的JSONata運算式", + "too-many": "排序節點中有太多待定信息", + "clear": "清空排序節點中的待定資訊" + }, + "batch": { + "batch": "batch", + "mode": { + "label": "模式", + "num-msgs": "按指定數量分組", + "interval": "按時間間隔分組", + "concat": "按主題分組" + }, + "count": { + "label": "分組數量", + "overlap": "隊末隊首重疊數量", + "count": "數量", + "invalid": "無效的分組數量或重疊數量" + }, + "interval": { + "label": "時間間隔", + "seconds": "秒", + "empty": "無數據到達時發送空資訊" + }, + "concat": { + "topics-label": "主題", + "topic": "主題" + }, + "too-many": "batch節點中有太多待定信息", + "unexpected": "未知模式", + "no-parts": "資訊中沒有parts屬性" + } +} diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/network/05-tls.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/network/05-tls.html new file mode 100644 index 000000000..ee4b3bd95 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/network/05-tls.html @@ -0,0 +1,19 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/network/06-httpproxy.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/network/06-httpproxy.html new file mode 100644 index 000000000..23f899627 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/network/06-httpproxy.html @@ -0,0 +1,22 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/network/10-mqtt.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/network/10-mqtt.html new file mode 100644 index 000000000..825bf218e --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/network/10-mqtt.html @@ -0,0 +1,70 @@ + + + + + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/network/21-httpin.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/network/21-httpin.html new file mode 100644 index 000000000..0d44ce3b1 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/network/21-httpin.html @@ -0,0 +1,81 @@ + + + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/network/21-httprequest.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/network/21-httprequest.html new file mode 100644 index 000000000..71ed96087 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/network/21-httprequest.html @@ -0,0 +1,78 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/network/22-websocket.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/network/22-websocket.html new file mode 100644 index 000000000..4bb2c7f4d --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/network/22-websocket.html @@ -0,0 +1,35 @@ + + + + + + + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/network/31-tcpin.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/network/31-tcpin.html new file mode 100644 index 000000000..2898ca718 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/network/31-tcpin.html @@ -0,0 +1,35 @@ + + + + + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/network/32-udp.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/network/32-udp.html new file mode 100644 index 000000000..401af48e3 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/network/32-udp.html @@ -0,0 +1,28 @@ + + + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/parsers/70-CSV.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/parsers/70-CSV.html new file mode 100644 index 000000000..9a8638614 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/parsers/70-CSV.html @@ -0,0 +1,43 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/parsers/70-HTML.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/parsers/70-HTML.html new file mode 100644 index 000000000..b1559455f --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/parsers/70-HTML.html @@ -0,0 +1,33 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/parsers/70-JSON.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/parsers/70-JSON.html new file mode 100644 index 000000000..1a46c3690 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/parsers/70-JSON.html @@ -0,0 +1,43 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/parsers/70-XML.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/parsers/70-XML.html new file mode 100644 index 000000000..4f0491291 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/parsers/70-XML.html @@ -0,0 +1,48 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/parsers/70-YAML.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/parsers/70-YAML.html new file mode 100644 index 000000000..8ea4f87f8 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/parsers/70-YAML.html @@ -0,0 +1,34 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/sequence/17-split.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/sequence/17-split.html new file mode 100644 index 000000000..fd97b497a --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/sequence/17-split.html @@ -0,0 +1,133 @@ + + + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/sequence/18-sort.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/sequence/18-sort.html new file mode 100644 index 000000000..cb8e7fa21 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/sequence/18-sort.html @@ -0,0 +1,41 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/sequence/19-batch.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/sequence/19-batch.html new file mode 100644 index 000000000..79879076e --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/sequence/19-batch.html @@ -0,0 +1,34 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/storage/10-file.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/storage/10-file.html new file mode 100644 index 000000000..03705ea5c --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/storage/10-file.html @@ -0,0 +1,59 @@ + + + + + diff --git a/packages/node_modules/@node-red/nodes/locales/zh-TW/storage/23-watch.html b/packages/node_modules/@node-red/nodes/locales/zh-TW/storage/23-watch.html new file mode 100644 index 000000000..d8e1b5807 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/zh-TW/storage/23-watch.html @@ -0,0 +1,25 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/package.json b/packages/node_modules/@node-red/nodes/package.json index 1147c59b1..cf897dbb0 100644 --- a/packages/node_modules/@node-red/nodes/package.json +++ b/packages/node_modules/@node-red/nodes/package.json @@ -1,6 +1,6 @@ { "name": "@node-red/nodes", - "version": "1.0.1", + "version": "1.0.4", "license": "Apache-2.0", "repository": { "type": "git", @@ -15,30 +15,30 @@ } ], "dependencies": { - "ajv": "6.10.2", + "ajv": "6.12.0", "body-parser": "1.19.0", "cheerio": "0.22.0", "content-type": "1.0.4", "cookie-parser": "1.4.4", "cookie": "0.4.0", "cors": "2.8.5", - "cron": "1.7.1", + "cron": "1.8.2", "denque": "1.4.1", "fs-extra": "8.1.0", "fs.notify": "0.0.4", "hash-sum": "2.0.0", - "https-proxy-agent": "2.2.2", + "https-proxy-agent": "5.0.0", "is-utf8": "0.2.1", "js-yaml": "3.13.1", "media-typer": "1.1.0", "mqtt": "2.18.8", "multer": "1.4.2", - "mustache": "3.0.2", + "mustache": "4.0.0", "on-headers": "1.0.2", "raw-body": "2.4.1", "request": "2.88.0", "ws": "6.2.1", - "xml2js": "0.4.19", - "iconv-lite": "0.5.0" + "xml2js": "0.4.23", + "iconv-lite": "0.5.1" } } diff --git a/packages/node_modules/@node-red/registry/package.json b/packages/node_modules/@node-red/registry/package.json index c50243c04..448c46861 100644 --- a/packages/node_modules/@node-red/registry/package.json +++ b/packages/node_modules/@node-red/registry/package.json @@ -1,6 +1,6 @@ { "name": "@node-red/registry", - "version": "1.0.1", + "version": "1.0.4", "license": "Apache-2.0", "main": "./lib/index.js", "repository": { @@ -16,9 +16,9 @@ } ], "dependencies": { - "@node-red/util": "1.0.1", + "@node-red/util": "1.0.4", "semver": "6.3.0", - "uglify-js": "3.6.0", + "uglify-js": "3.8.0", "when": "3.7.8" } } diff --git a/packages/node_modules/@node-red/runtime/lib/api/flows.js b/packages/node_modules/@node-red/runtime/lib/api/flows.js index 1e6e72dc7..e58531190 100644 --- a/packages/node_modules/@node-red/runtime/lib/api/flows.js +++ b/packages/node_modules/@node-red/runtime/lib/api/flows.js @@ -57,6 +57,8 @@ var api = module.exports = { * Sets the current flow configuration * @param {Object} opts * @param {User} opts.user - the user calling the api + * @param {Object} opts.flows - the flow configuration: `{flows: [..], credentials: {}}` + * @param {Object} opts.deploymentType - the type of deployment - "full", "nodes", "flows", "reload" * @param {Object} opts.req - the request to log (optional) * @return {Promise} - the active flow configuration * @memberof @node-red/runtime_flows @@ -83,7 +85,7 @@ var api = module.exports = { return reject(err); } } - apiPromise = runtime.nodes.setFlows(flows.flows,deploymentType); + apiPromise = runtime.nodes.setFlows(flows.flows,flows.credentials,deploymentType); } apiPromise.then(function(flowId) { return resolve({rev:flowId}); diff --git a/packages/node_modules/@node-red/runtime/lib/nodes/Node.js b/packages/node_modules/@node-red/runtime/lib/nodes/Node.js index 7d2424e18..a834c8c34 100644 --- a/packages/node_modules/@node-red/runtime/lib/nodes/Node.js +++ b/packages/node_modules/@node-red/runtime/lib/nodes/Node.js @@ -52,7 +52,7 @@ function Node(n) { // the object (such as dashboard) will not like circular refs // The value must still be writable in the case that a node does: // Object.assign(this,config) - // as part of its constructure - config._flow will overwrite this._flow + // as part of its constructor - config._flow will overwrite this._flow // which we can tolerate as they are the same object. Object.defineProperty(this,'_flow', {value: n._flow, enumerable: false, writable: true }) this._asyncDelivery = n._flow.asyncMessageDelivery; @@ -169,20 +169,20 @@ Node.prototype._emit = Node.prototype.emit; /** * Emit an event to all registered listeners. */ -Node.prototype.emit = function(event,arg) { +Node.prototype.emit = function(event, ...args) { var node = this; if (event === "input") { // When Pluggable Message Routing arrives, this will be called from // that and will already be sync/async depending on the router. if (this._asyncDelivery) { setImmediate(function() { - node._emitInput(arg); + node._emitInput.apply(node,args); }); } else { - this._emitInput(arg); + this._emitInput.apply(this,args); } } else { - this._emit(event,arg); + this._emit.apply(this,arguments); } } @@ -193,6 +193,7 @@ Node.prototype.emit = function(event,arg) { */ Node.prototype._emitInput = function(arg) { var node = this; + this.metric("receive", arg); if (node._inputCallback) { // Just one callback registered. try { @@ -224,7 +225,7 @@ Node.prototype._emitInput = function(arg) { } ); } catch(err) { - node.error(err,msg); + node.error(err,arg); } } } @@ -448,7 +449,6 @@ Node.prototype.receive = function(msg) { if (!msg._msgid) { msg._msgid = redUtil.generateId(); } - this.metric("receive",msg); this.emit("input",msg); }; @@ -462,6 +462,9 @@ function log_helper(self, level, msg) { if (self._alias) { o._alias = self._alias; } + if (self._flow) { + o.path = self._flow.path; + } if (self.z) { o.z = self.z; } @@ -539,7 +542,12 @@ Node.prototype.metric = function(eventname, msg, metricValue) { * status: "simple text status" */ Node.prototype.status = function(status) { - if (typeof(status) === "string") { status = {text:status}; } + switch (typeof status) { + case "string": + case "number": + case "boolean": + status = {text:""+status} + } this._flow.handleStatus(this,status); }; diff --git a/packages/node_modules/@node-red/runtime/lib/nodes/context/localfilesystem.js b/packages/node_modules/@node-red/runtime/lib/nodes/context/localfilesystem.js index 0f83573e8..cf1769700 100644 --- a/packages/node_modules/@node-red/runtime/lib/nodes/context/localfilesystem.js +++ b/packages/node_modules/@node-red/runtime/lib/nodes/context/localfilesystem.js @@ -245,7 +245,7 @@ LocalFileSystem.prototype.get = function(scope, key, callback) { return this.cache.get(scope,key,callback); } if(typeof callback !== "function"){ - throw new Error("Callback must be a function"); + throw new Error("File Store cache disabled - only asynchronous access supported"); } var storagePath = getStoragePath(this.storageBaseDir ,scope); loadFile(storagePath + ".json").then(function(data){ @@ -304,7 +304,7 @@ LocalFileSystem.prototype.set = function(scope, key, value, callback) { }, this.flushInterval); } } else if (callback && typeof callback !== 'function') { - throw new Error("Callback must be a function"); + throw new Error("File Store cache disabled - only asynchronous access supported"); } else { self.writePromise = self.writePromise.then(function() { return loadFile(storagePath + ".json") }).then(function(data){ var obj = data ? JSON.parse(data) : {} diff --git a/packages/node_modules/@node-red/runtime/lib/nodes/flows/Flow.js b/packages/node_modules/@node-red/runtime/lib/nodes/flows/Flow.js index 40855793f..db15e8eb5 100644 --- a/packages/node_modules/@node-red/runtime/lib/nodes/flows/Flow.js +++ b/packages/node_modules/@node-red/runtime/lib/nodes/flows/Flow.js @@ -53,6 +53,7 @@ class Flow { this.subflowInstanceNodes = {}; this.catchNodes = []; this.statusNodes = []; + this.path = this.id; } /** @@ -120,7 +121,7 @@ class Flow { * @return {[type]} [description] */ start(diff) { - this.trace("start "+this.TYPE); + this.trace("start "+this.TYPE+" ["+this.path+"]"); var node; var newNode; var id; @@ -234,7 +235,7 @@ class Flow { for (id in this.activeNodes) { if (this.activeNodes.hasOwnProperty(id)) { node = this.activeNodes[id]; - this.trace(" "+id.padEnd(16)+" | "+node.type.padEnd(12)+" | "+(node._alias||"")); + this.trace(" "+id.padEnd(16)+" | "+node.type.padEnd(12)+" | "+(node._alias||"")+(node._zAlias?" [zAlias:"+node._zAlias+"]":"")); if (node.type === "catch") { this.catchNodes.push(node); } else if (node.type === "status") { diff --git a/packages/node_modules/@node-red/runtime/lib/nodes/flows/Subflow.js b/packages/node_modules/@node-red/runtime/lib/nodes/flows/Subflow.js index 47c382688..a7bec1234 100644 --- a/packages/node_modules/@node-red/runtime/lib/nodes/flows/Subflow.js +++ b/packages/node_modules/@node-red/runtime/lib/nodes/flows/Subflow.js @@ -88,7 +88,7 @@ class Subflow extends Flow { * @param {[type]} subflowInstance [description] */ constructor(parent,globalFlow,subflowDef,subflowInstance) { - // console.log("CREATE SUBFLOW",subflowDef.id,subflowInstance.id); + // console.log("CREATE SUBFLOW",subflowDef.id,subflowInstance.id,"alias?",subflowInstance._alias); // console.log("SubflowInstance\n"+JSON.stringify(subflowInstance," ",2)); // console.log("SubflowDef\n"+JSON.stringify(subflowDef," ",2)); var subflows = parent.flow.subflows; @@ -140,6 +140,7 @@ class Subflow extends Flow { this.subflowDef = subflowDef; this.subflowInstance = subflowInstance; this.node_map = node_map; + this.path = parent.path+"/"+(subflowInstance._alias||subflowInstance.id); var env = []; if (this.subflowDef.env) { @@ -200,6 +201,9 @@ class Subflow extends Flow { self.node.status({text:text}); } else if (msg.status !== undefined) { // if msg.status exists + if (msg.status.hasOwnProperty("text") && msg.status.text.indexOf("common.") === 0) { + msg.status.text = "node-red:"+msg.status.text; + } self.node.status(msg.status) } }) @@ -310,7 +314,6 @@ class Subflow extends Flow { } } } - super.start(diff); } @@ -435,7 +438,6 @@ class Subflow extends Flow { } return handled; } - } @@ -450,7 +452,7 @@ class Subflow extends Flow { function createNodeInSubflow(subflowInstanceId, def) { let node = clone(def); let nid = redUtil.generateId(); - // console.log("Create Node In subflow",node.id, "--->",nid, "(",node.type,")") + // console.log("Create Node In subflow",node._alias, "--->",nid, "(",node.type,")") // node_map[node.id] = node; node._alias = node.id; node.id = nid; diff --git a/packages/node_modules/@node-red/runtime/lib/nodes/flows/index.js b/packages/node_modules/@node-red/runtime/lib/nodes/flows/index.js index 981ed7173..16166fbc1 100644 --- a/packages/node_modules/@node-red/runtime/lib/nodes/flows/index.js +++ b/packages/node_modules/@node-red/runtime/lib/nodes/flows/index.js @@ -106,15 +106,20 @@ function load(forceStart) { // This is a force reload from the API - disable safeMode delete settings.safeMode; } - return setFlows(null,"load",false,forceStart); + return setFlows(null,null,"load",false,forceStart); } /* * _config - new node array configuration + * _credentials - new credentials configuration (optional) * type - full/nodes/flows/load (default full) * muteLog - don't emit the standard log messages (used for individual flow api) */ -function setFlows(_config,type,muteLog,forceStart) { +function setFlows(_config,_credentials,type,muteLog,forceStart) { + if (typeof _credentials === "string") { + type = _credentials; + _credentials = null; + } type = type||"full"; if (settings.safeMode) { if (type !== "load") { @@ -155,16 +160,27 @@ function setFlows(_config,type,muteLog,forceStart) { delete newFlowConfig.allNodes[id].credentials; } } + var credsDirty; - // Allow the credential store to remove anything no longer needed - credentials.clean(config); + if (_credentials) { + // A full set of credentials have been provided. Use those instead + configSavePromise = credentials.load(_credentials); + credsDirty = true; + } else { + // Allow the credential store to remove anything no longer needed + credentials.clean(config); - // Remember whether credentials need saving or not - var credsDirty = credentials.dirty(); + // Remember whether credentials need saving or not + var credsDirty = credentials.dirty(); + + configSavePromise = Promise.resolve(); + } // Get the latest credentials and ask storage to save them (if needed) // as well as the new flow configuration. - configSavePromise = credentials.export().then(function(creds) { + configSavePromise = configSavePromise.then(function() { + return credentials.export() + }).then(function(creds) { var saveConfig = { flows: config, credentialsDirty:credsDirty, @@ -515,7 +531,7 @@ function addFlow(flow) { var newConfig = clone(activeConfig.flows); newConfig = newConfig.concat(nodes); - return setFlows(newConfig,'flows',true).then(function() { + return setFlows(newConfig,null,'flows',true).then(function() { log.info(log._("nodes.flows.added-flow",{label:(flow.label?flow.label+" ":"")+"["+flow.id+"]"})); return flow.id; }); @@ -646,7 +662,7 @@ function updateFlow(id,newFlow) { } newConfig = newConfig.concat(nodes); - return setFlows(newConfig,'flows',true).then(function() { + return setFlows(newConfig,null,'flows',true).then(function() { log.info(log._("nodes.flows.updated-flow",{label:(label?label+" ":"")+"["+id+"]"})); }) } @@ -668,7 +684,7 @@ function removeFlow(id) { return node.z !== id && node.id !== id; }); - return setFlows(newConfig,'flows',true).then(function() { + return setFlows(newConfig,null,'flows',true).then(function() { log.info(log._("nodes.flows.removed-flow",{label:(flow.label?flow.label+" ":"")+"["+flow.id+"]"})); }); } diff --git a/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/library.js b/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/library.js index da0e1f94f..f72ce1e1e 100644 --- a/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/library.js +++ b/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/library.js @@ -25,73 +25,54 @@ var settings; var libDir; var libFlowsDir; - -function getFileMeta(root,path) { - var fn = fspath.join(root,path); - var fd = fs.openSync(fn,"r"); +function getFileMeta(root, path) { + var fn = fspath.join(root, path); + var fd = fs.openSync(fn, 'r'); var size = fs.fstatSync(fd).size; var meta = {}; var read = 0; var length = 10; - var remaining = ""; + var remaining = Buffer.alloc(0); var buffer = Buffer.alloc(length); - while(read < size) { - read+=fs.readSync(fd,buffer,0,length); - var data = remaining+buffer.toString(); - var parts = data.split("\n"); - remaining = parts.splice(-1); - for (var i=0;i 0?"\n":"")+parts[i]; - } - } - if (!scanning) { - body += remaining; - } - } else { - read += thisRead; - body += buffer.slice(0,thisRead).toString(); + for (var i = 0; i < parts.length; i++) { + if (! /^\/\/ \w+: /.test(parts[i]) || !scanning) { + body += (body.length > 0 ? '\n' : '') + parts[i]; + scanning = false; } } - fs.closeSync(fd); return body; } + function getLibraryEntry(type,path) { var root = fspath.join(libDir,type); var rootPath = fspath.join(libDir,type,path); diff --git a/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/index.js b/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/index.js index 674b380e6..82c1f8d39 100644 --- a/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/index.js +++ b/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/projects/index.js @@ -56,8 +56,9 @@ function init(_settings, _runtime) { if (settings.flowFile) { flowsFile = settings.flowFile; - // handle Unix and Windows "C:\" - if ((flowsFile[0] == "/") || (flowsFile[1] == ":")) { + // handle Unix and Windows "C:\" and Windows "\\" for UNC. + if (fspath.isAbsolute(flowsFile)) { + //if (((flowsFile[0] == "\\") && (flowsFile[1] == "\\")) || (flowsFile[0] == "/") || (flowsFile[1] == ":")) { // Absolute path flowsFullPath = flowsFile; } else if (flowsFile.substring(0,2) === "./") { diff --git a/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/util.js b/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/util.js index 267f8c933..b18c80643 100644 --- a/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/util.js +++ b/packages/node_modules/@node-red/runtime/lib/storage/localfilesystem/util.js @@ -15,6 +15,7 @@ **/ var fs = require('fs-extra'); +var fspath = require('path'); var when = require('when'); var nodeFn = require('when/node/function'); @@ -79,25 +80,31 @@ module.exports = { * the write hits disk. */ writeFile: function(path,content,backupPath) { - if (backupPath) { + if (backupPath) { if (fs.existsSync(path)) { fs.renameSync(path,backupPath); } } return when.promise(function(resolve,reject) { - var stream = fs.createWriteStream(path); - stream.on('open',function(fd) { - stream.write(content,'utf8',function() { - fs.fsync(fd,function(err) { - if (err) { - log.warn(log._("storage.localfilesystem.fsync-fail",{path: path, message: err.toString()})); - } - stream.end(resolve); + fs.ensureDir(fspath.dirname(path), (err)=>{ + if (err) { + reject(err); + return; + } + var stream = fs.createWriteStream(path); + stream.on('open',function(fd) { + stream.write(content,'utf8',function() { + fs.fsync(fd,function(err) { + if (err) { + log.warn(log._("storage.localfilesystem.fsync-fail",{path: path, message: err.toString()})); + } + stream.end(resolve); + }); }); }); - }); - stream.on('error',function(err) { - reject(err); + stream.on('error',function(err) { + reject(err); + }); }); }); }, diff --git a/packages/node_modules/@node-red/runtime/locales/zh-CN/runtime.json b/packages/node_modules/@node-red/runtime/locales/zh-CN/runtime.json new file mode 100644 index 000000000..d0813f476 --- /dev/null +++ b/packages/node_modules/@node-red/runtime/locales/zh-CN/runtime.json @@ -0,0 +1,174 @@ +{ + "runtime": { + "welcome": "欢迎使用Node-RED", + "version": "__component__ 版本: __version__", + "unsupported_version": "__component__的不受支持的版本。要求: __requires__ 找到: __version__", + "paths": { + "settings": "设置文件 : __path__", + "httpStatic": "HTTP Static : __path__" + } + }, + + "server": { + "loading": "加载控制板节点", + "palette-editor": { + "disabled": "控制板编辑器已禁用:用户设置", + "npm-not-found": "控制板编辑器已禁用:找不到npm命令", + "npm-too-old": "控制板编辑器已禁用: npm版本太旧。需要版本npm >= 3.x" + }, + "errors": "无法注册__count__节点类型", + "errors_plural": "无法注册__count__个节点类型", + "errors-help": "使用-v运行以获取详细信息", + "missing-modules": "缺少节点模块:", + "node-version-mismatch": "无法在此版本上加载节点模块。要求:__ version__", + "type-already-registered": "'__type__'已由模块__module__注册", + "removing-modules": "从配置中删除模块", + "added-types": "添加的节点类型:", + "removed-types": "删除的节点类型:", + "install": { + "invalid": "无效的模块名称", + "installing": "安装模块:__ name__,版本:__ version__", + "installed": "已安装的模块:__ name__", + "install-failed": "安装失败", + "install-failed-long": "模块__name__安装失败:", + "install-failed-not-found": "$t(server.install.install-failed-long) 模块未发现", + "upgrading": "更新模块: __name__ 至版本: __version__", + "upgraded": "更新模块: __name__。 重新启动Node-RED以使用新版本", + "upgrade-failed-not-found": "$t(server.install.install-failed-long) 未发现版本", + "uninstalling": "卸载模块: __name__", + "uninstall-failed": "卸载失败", + "uninstall-failed-long": "卸载模块__name__失败:", + "uninstalled": "卸载模块: __name__" + }, + "unable-to-listen": "无法在__listenpath__上收听", + "port-in-use": "错误: 端口正在使用中", + "uncaught-exception": "未捕获的异常:", + "admin-ui-disabled": "管理员界面已禁用", + "now-running": "服务器现在在__listenpath__上运行", + "failed-to-start": "无法启动服务器:", + "headless-mode": "在headless模式下运行", + "httpadminauth-deprecated": "不建议使用httpAdminAuth。请改用adminAuth" + }, + + "api": { + "flows": { + "error-save": "保存流程错误: __message__", + "error-reload": "重载流程错误: __message__" + }, + "library": { + "error-load-entry": "加载库条目'__path__'时出错:__message__", + "error-save-entry": "保存库条目'__path__'时出错:__ message__", + "error-load-flow": "加载流程'__path__'时出错:__ message__", + "error-save-flow": "保存流'__path__'时出错:__ message__" + }, + "nodes": { + "enabled": "启用的节点类型:", + "disabled": "禁用的节点类型:", + "error-enable": "无法启用节点:" + } + }, + + "comms": { + "error": "通讯渠道错误:__ message__", + "error-server": "通信服务器错误:__ message__", + "error-send": "通讯发送错误:__ message__" + }, + + "settings": { + "user-not-available": "无法保存用户设置:__ message__", + "not-available": "设置不可用", + "property-read-only": "属性“ __prop__”是只读的" + }, + + "nodes": { + "credentials": { + "error":"加载证书时出错:__ message__", + "error-saving":"保存证书时出错:__ message__", + "not-registered": "证书类型'__type__'未注册", + "system-key-warning": "\n\n---------------------------------------------------------------------\n您的流程证书文件是使用系统生成的密钥加密的。\n\n如果系统生成的密钥由于任何原因丢失,则您的证书文件将无法恢复,您将必须删除它并重新输入您的证书。\n\n您应该使用您的设置文件中的'credentialSecret'选项设置自己的密钥。然后,下次部署更改时,Node-RED将使用选择的密钥重新加密您的证书文件。\n---------------------------------------------------------------------\n" + }, + "flows": { + "safe-mode": "流程在安全模式下停止。部署开始。", + "registered-missing": "缺少注册的类型:__ type__", + "error": "错误加载流程:__ message__", + "starting-modified-nodes": "启动修改的节点", + "starting-modified-flows": "启动修改的流程", + "starting-flows": "启动流程", + "started-modified-nodes": "修改的节点已启动", + "started-modified-flows": "修改的流程已启动", + "started-flows": "流程已启动", + "stopping-modified-nodes": "停止修改的节点", + "stopping-modified-flows": "停止修改的流程", + "stopping-flows": "停止流程", + "stopped-modified-nodes": "修改的节点已停止", + "stopped-modified-flows": "修改的流程已停止", + "stopped-flows": "流程已停止", + "stopped": "已停止", + "stopping-error": "错误停止节点:__ message__", + "added-flow": "流程已添加: __label__", + "updated-flow": "流程已更新: __label__", + "removed-flow": "流程已移除: __label__", + "missing-types": "等待缺少的类型被注册:", + "missing-type-provided": " - __type__ (由npm模块__module__提供)", + "missing-type-install-1": "要安装所有缺少的模块,请运行:", + "missing-type-install-2": "在目录中:" + }, + "flow": { + "unknown-type": "未知类型: __type__", + "missing-types": "缺少类型", + "error-loop": "邮件已超过最大捕获数" + }, + "index": { + "unrecognised-id": "无法识别的ID: __id__", + "type-in-use": "使用中的类型: __msg__", + "unrecognised-module": "无法识别的模块: __module__" + }, + "registry": { + "localfilesystem": { + "module-not-found": "找不到模块:'__module__'" + } + } + }, + + "storage": { + "index": { + "forbidden-flow-name": "禁止流程名称" + }, + "localfilesystem": { + "user-dir": "用户目录: __path__", + "flows-file": "流程文件: __path__", + "create": "创建新__type__文件", + "empty": "现有__type__文件为空", + "invalid": "现有__type__文件为无效json", + "restore": "恢复__type__文件备份:__path__", + "restore-fail": "恢复__type__文件备份失败:__ message__", + "fsync-fail": "将文件__path__刷新到磁盘失败:__message__", + "projects": { + "changing-project": "设置活动项目:__ project__", + "active-project": "活动项目:__ project__", + "project-not-found": "找不到项目:__ project__", + "no-active-project": "没有活动的项目:使用默认流文件", + "disabled": "项目已禁用:editorTheme.projects.enabled = false", + "disabledNoFlag": "项目已禁用:设置editorTheme.projects.enabled = true来启用", + "git-not-found": "项目已禁用:找不到git命令", + "git-version-old": "项目已禁用:不支持的git __version__。 需要的git版本为2.x", + "summary": "一个Node-RED项目", + "readme": "### 关于\n\n这是您项目的README.md文件。它可以帮助用户了解您的项目,如何使用它以及他们可能需要知道的其他任何信息。" + } + } + }, + + "context": { + "log-store-init": "上下文储存: '__name__' [__info__]", + "error-loading-module": "加载上下文存储时出错: __message__", + "error-loading-module2": "加载上下文存储时出错 '__module__': __message__", + "error-module-not-defined": "上下文存储库'__storage__'缺少“模块”选项", + "error-invalid-module-name": "无效的上下文存储名称:'__ name__'", + "error-invalid-default-module": "无效的默认的上下文存储库: '__storage__'", + "unknown-store": "指定了未知的上下文存储库'__name__'。 使用默认存储库。", + "localfilesystem": { + "error-circular": "上下文__scope__包含无法保留的循环引用", + "error-write": "编写上下文时出错:__ message__" + } + } +} diff --git a/packages/node_modules/@node-red/runtime/locales/zh-TW/runtime.json b/packages/node_modules/@node-red/runtime/locales/zh-TW/runtime.json new file mode 100644 index 000000000..b96d87a6e --- /dev/null +++ b/packages/node_modules/@node-red/runtime/locales/zh-TW/runtime.json @@ -0,0 +1,174 @@ +{ + "runtime": { + "welcome": "歡迎使用Node-RED", + "version": "__component__ 版本: __version__", + "unsupported_version": "__component__的不受支持的版本。要求: __requires__ 找到: __version__", + "paths": { + "settings": "設置文件 : __path__", + "httpStatic": "HTTP Static : __path__" + } + }, + + "server": { + "loading": "加載控制板節點", + "palette-editor": { + "disabled": "控制板編輯器已禁用:用戶設置", + "npm-not-found": "控制板編輯器已禁用:找不到npm命令", + "npm-too-old": "控制板編輯器已禁用: npm版本太舊。需要版本npm >= 3.x" + }, + "errors": "無法註冊__count__節點類型", + "errors_plural": "無法註冊__count__個節點類型", + "errors-help": "使用-v運行以獲取詳細信息", + "missing-modules": "缺少節點模組:", + "node-version-mismatch": "無法在此版本上加載節點模組。要求:__ version__", + "type-already-registered": "'__type__'已由模組__module__註冊", + "removing-modules": "從配置中刪除模組", + "added-types": "添加的節點類型:", + "removed-types": "刪除的節點類型:", + "install": { + "invalid": "無效的模組名稱", + "installing": "安裝模組:__ name__,版本:__ version__", + "installed": "已安裝的模組:__ name__", + "install-failed": "安裝失敗", + "install-failed-long": "模組__name__安裝失敗:", + "install-failed-not-found": "$t(server.install.install-failed-long) 模組未發現", + "upgrading": "更新模組: __name__ 至版本: __version__", + "upgraded": "更新模組: __name__。 重新啟動Node-RED以使用新版本", + "upgrade-failed-not-found": "$t(server.install.install-failed-long) 未發現版本", + "uninstalling": "卸載模組: __name__", + "uninstall-failed": "卸載失敗", + "uninstall-failed-long": "卸載模組__name__失敗:", + "uninstalled": "卸載模組: __name__" + }, + "unable-to-listen": "無法在__listenpath__上收聽", + "port-in-use": "錯誤: 端口正在使用中", + "uncaught-exception": "未捕獲的異常:", + "admin-ui-disabled": "管理員界面已禁用", + "now-running": "服務器現在在__listenpath__上運行", + "failed-to-start": "無法啟動服務器:", + "headless-mode": "在headless模式下運行", + "httpadminauth-deprecated": "不建議使用httpAdminAuth。請改用adminAuth" + }, + + "api": { + "flows": { + "error-save": "保存流程錯誤: __message__", + "error-reload": "重載流程錯誤: __message__" + }, + "library": { + "error-load-entry": "加載庫條目'__path__'時出錯:__message__", + "error-save-entry": "保存庫條目'__path__'時出錯:__ message__", + "error-load-flow": "加載流程'__path__'時出錯:__ message__", + "error-save-flow": "保存流'__path__'時出錯:__ message__" + }, + "nodes": { + "enabled": "啟用的節點類型:", + "disabled": "禁用的節點類型:", + "error-enable": "無法啟用節點:" + } + }, + + "comms": { + "error": "通訊渠道錯誤:__ message__", + "error-server": "通信服務器錯誤:__ message__", + "error-send": "通訊發送錯誤:__ message__" + }, + + "settings": { + "user-not-available": "無法保存用戶設置:__ message__", + "not-available": "設置不可用", + "property-read-only": "屬性“ __prop__”是只讀的" + }, + + "nodes": { + "credentials": { + "error":"加載證書時出錯:__ message__", + "error-saving":"保存證書時出錯:__ message__", + "not-registered": "證書類型'__type__'未註冊", + "system-key-warning": "\n\n---------------------------------------------------------------------\n您的流程證書文件是使用系統生成的密鑰加密的。\n\n如果系統生成的密鑰由於任何原因丟失,則您的證書文件將無法恢復,您將必須刪除它並重新輸入您的證書。\n\n您應該使用您的設置文件中的'credentialSecret'選項設置自己的密鑰。然後,下次部署更改時,Node-RED將使用選擇的密鑰重新加密您的證書文件。\n---------------------------------------------------------------------\n" + }, + "flows": { + "safe-mode": "流程在安全模式下停止。部署開始。", + "registered-missing": "缺少註冊的類型:__ type__", + "error": "錯誤加載流程:__ message__", + "starting-modified-nodes": "啟動修改的節點", + "starting-modified-flows": "啟動修改的流程", + "starting-flows": "啟動流程", + "started-modified-nodes": "修改的節點已啟動", + "started-modified-flows": "修改的流程已啟動", + "started-flows": "流程已啟動", + "stopping-modified-nodes": "停止修改的節點", + "stopping-modified-flows": "停止修改的流程", + "stopping-flows": "停止流程", + "stopped-modified-nodes": "修改的節點已停止", + "stopped-modified-flows": "修改的流程已停止", + "stopped-flows": "流程已停止", + "stopped": "已停止", + "stopping-error": "錯誤停止節點:__ message__", + "added-flow": "流程已添加: __label__", + "updated-flow": "流程已更新: __label__", + "removed-flow": "流程已移除: __label__", + "missing-types": "等待缺少的類型被註冊:", + "missing-type-provided": " - __type__ (由npm模組__module__提供)", + "missing-type-install-1": "要安裝所有缺少的模組,請運行:", + "missing-type-install-2": "在目錄中:" + }, + "flow": { + "unknown-type": "未知類型: __type__", + "missing-types": "缺少類型", + "error-loop": "郵件已超過最大捕獲數" + }, + "index": { + "unrecognised-id": "無法識別的ID: __id__", + "type-in-use": "使用中的類型: __msg__", + "unrecognised-module": "無法識別的模組: __module__" + }, + "registry": { + "localfilesystem": { + "module-not-found": "找不到模組:'__module__'" + } + } + }, + + "storage": { + "index": { + "forbidden-flow-name": "禁止流程名稱" + }, + "localfilesystem": { + "user-dir": "用戶目錄: __path__", + "flows-file": "流程文件: __path__", + "create": "創建新__type__文件", + "empty": "現有__type__文件為空", + "invalid": "現有__type__文件為無效json", + "restore": "恢復__type__文件備份:__path__", + "restore-fail": "恢復__type__文件備份失敗:__ message__", + "fsync-fail": "將文件__path__刷新到磁盤失敗:__message__", + "projects": { + "changing-project": "設置活動項目:__ project__", + "active-project": "活動項目:__ project__", + "project-not-found": "找不到項目:__ project__", + "no-active-project": "沒有活動的項目:使用默認流文件", + "disabled": "項目已禁用:editorTheme.projects.enabled = false", + "disabledNoFlag": "項目已禁用:設置editorTheme.projects.enabled = true來啟用", + "git-not-found": "項目已禁用:找不到git命令", + "git-version-old": "項目已禁用:不支持的git __version__。 需要的git版本為2.x", + "summary": "一個Node-RED項目", + "readme": "### 關於\n\n這是您項目的README.md文件。它可以幫助用戶了解您的項目,如何使用它以及他們可能需要知道的其他任何信息。" + } + } + }, + + "context": { + "log-store-init": "上下文儲存: '__name__' [__info__]", + "error-loading-module": "加載上下文存儲時出錯: __message__", + "error-loading-module2": "加載上下文存儲時出錯 '__module__': __message__", + "error-module-not-defined": "上下文存儲庫'__storage__'缺少“模組”選項", + "error-invalid-module-name": "無效的上下文存儲名稱:'__ name__'", + "error-invalid-default-module": "無效的默認的上下文存儲庫: '__storage__'", + "unknown-store": "指定了未知的上下文存儲庫'__name__'。 使用默認存儲庫。", + "localfilesystem": { + "error-circular": "上下文__scope__包含無法保留的循環引用", + "error-write": "編寫上下文時出錯:__ message__" + } + } +} diff --git a/packages/node_modules/@node-red/runtime/package.json b/packages/node_modules/@node-red/runtime/package.json index 0d7faa6f4..50f9fb264 100644 --- a/packages/node_modules/@node-red/runtime/package.json +++ b/packages/node_modules/@node-red/runtime/package.json @@ -1,6 +1,6 @@ { "name": "@node-red/runtime", - "version": "1.0.1", + "version": "1.0.4", "license": "Apache-2.0", "main": "./lib/index.js", "repository": { @@ -16,8 +16,8 @@ } ], "dependencies": { - "@node-red/registry": "1.0.1", - "@node-red/util": "1.0.1", + "@node-red/registry": "1.0.4", + "@node-red/util": "1.0.4", "clone": "2.1.2", "express": "4.17.1", "fs-extra": "8.1.0", diff --git a/packages/node_modules/@node-red/util/lib/i18n.js b/packages/node_modules/@node-red/util/lib/i18n.js index 738212b82..d95f4bec6 100644 --- a/packages/node_modules/@node-red/util/lib/i18n.js +++ b/packages/node_modules/@node-red/util/lib/i18n.js @@ -81,35 +81,55 @@ function mergeCatalog(fallback,catalog) { } } -var MessageFileLoader = { - type: "backend", - init: function(services, backendOptions, i18nextOptions) {}, - read: function(lng, ns, callback) { - if (resourceMap[ns]) { - var file = path.join(resourceMap[ns].basedir,lng,resourceMap[ns].file); - //console.log(file); - fs.readFile(file,"utf8",function(err,content) { + +function readFile(lng, ns) { + return new Promise((resolve, reject) => { + if (resourceCache[ns] && resourceCache[ns][lng]) { + resolve(resourceCache[ns][lng]); + } else if (resourceMap[ns]) { + var file = path.join(resourceMap[ns].basedir, lng, resourceMap[ns].file); + fs.readFile(file, "utf8", function (err, content) { if (err) { - callback(err); + reject(err); } else { try { - resourceCache[ns] = resourceCache[ns]||{}; + resourceCache[ns] = resourceCache[ns] || {}; resourceCache[ns][lng] = JSON.parse(content.replace(/^\uFEFF/, '')); - //console.log(resourceCache[ns][lng]); - if (lng !== defaultLang) { - mergeCatalog(resourceCache[ns][defaultLang],resourceCache[ns][lng]); + var baseLng = lng.split('-')[0]; + if (baseLng !== lng && resourceCache[ns][baseLng]) { + mergeCatalog(resourceCache[ns][baseLng], resourceCache[ns][lng]); } - callback(null, resourceCache[ns][lng]); - } catch(e) { - callback(e); + if (lng !== defaultLang) { + mergeCatalog(resourceCache[ns][defaultLang], resourceCache[ns][lng]); + } + resolve(resourceCache[ns][lng]); + } catch (e) { + reject(e); } } }); } else { - callback(new Error("Unrecognised namespace")); + reject(new Error("Unrecognised namespace")); } - } + }); +} +var MessageFileLoader = { + type: "backend", + init: function (services, backendOptions, i18nextOptions) { }, + read: function (lng, ns, callback) { + readFile(lng, ns) + .then(data => callback(null, data)) + .catch(err => { + if (/-/.test(lng)) { + // if reading language file fails -> try reading base language (e. g. 'fr' instead of 'fr-FR' or 'de' for 'de-DE') + var baseLng = lng.split('-')[0]; + readFile(baseLng, ns).then(baseData => callback(null, baseData)).catch(err => callback(err)); + } else { + callback(err); + } + }); + } } function getCurrentLocale() { diff --git a/packages/node_modules/@node-red/util/lib/log.js b/packages/node_modules/@node-red/util/lib/log.js index 155863802..8d7b84966 100644 --- a/packages/node_modules/@node-red/util/lib/log.js +++ b/packages/node_modules/@node-red/util/lib/log.js @@ -84,9 +84,14 @@ var consoleLogger = function(msg) { util.log("["+levelNames[msg.level]+"] "+(msg.type?"["+msg.type+":"+(msg.name||msg.id)+"] ":"")+msg.msg.stack); } else { var message = msg.msg; - if (typeof message === 'object' && message !== null && message.toString() === '[object Object]' && message.message) { - message = message.message; + try { + if (typeof message === 'object' && message !== null && message.toString() === '[object Object]' && message.message) { + message = message.message; + } + } catch(e){ + message = 'Exception trying to log: '+util.inspect(message); } + util.log("["+levelNames[msg.level]+"] "+(msg.type?"["+msg.type+":"+(msg.name||msg.id)+"] ":"")+message); } } diff --git a/packages/node_modules/@node-red/util/lib/util.js b/packages/node_modules/@node-red/util/lib/util.js index b4512f1ea..45a33be14 100644 --- a/packages/node_modules/@node-red/util/lib/util.js +++ b/packages/node_modules/@node-red/util/lib/util.js @@ -81,22 +81,25 @@ function ensureBuffer(o) { * @memberof @node-red/util_util */ function cloneMessage(msg) { - // Temporary fix for #97 - // TODO: remove this http-node-specific fix somehow - var req = msg.req; - var res = msg.res; - delete msg.req; - delete msg.res; - var m = clone(msg); - if (req) { - m.req = req; - msg.req = req; + if (typeof msg !== "undefined") { + // Temporary fix for #97 + // TODO: remove this http-node-specific fix somehow + var req = msg.req; + var res = msg.res; + delete msg.req; + delete msg.res; + var m = clone(msg); + if (req) { + m.req = req; + msg.req = req; + } + if (res) { + m.res = res; + msg.res = res; + } + return m; } - if (res) { - m.res = res; - msg.res = res; - } - return m; + return msg; } /** @@ -301,7 +304,7 @@ function normalisePropertyExpression(str) { * front of the property expression if present. * * @param {Object} msg - the message object - * @param {String} str - the property expression + * @param {String} expr - the property expression * @return {any} the message property, or undefined if it does not exist * @memberof @node-red/util_util */ @@ -316,7 +319,7 @@ function getMessageProperty(msg,expr) { * Gets a property of an object. * * @param {Object} msg - the object - * @param {String} str - the property expression + * @param {String} expr - the property expression * @return {any} the object property, or undefined if it does not exist * @memberof @node-red/util_util */ @@ -468,7 +471,7 @@ function evaluateEnvProperty(value, node) { * * For example, `#:(file)::foo` results in ` { store: "file", key: "foo" }`. * - * @param {String} value - the context property string to parse + * @param {String} key - the context property string to parse * @return {Object} The parsed property * @memberof @node-red/util_util */ @@ -652,130 +655,148 @@ function normaliseNodeTypeName(name) { * @memberof @node-red/util_util */ function encodeObject(msg,opts) { - var debuglength = 1000; - if (opts && opts.hasOwnProperty('maxLength')) { - debuglength = opts.maxLength; - } - var msgType = typeof msg.msg; - if (msg.msg instanceof Error) { - msg.format = "error"; - var errorMsg = {}; - if (msg.msg.name) { - errorMsg.name = msg.msg.name; + try { + var debuglength = 1000; + if (opts && opts.hasOwnProperty('maxLength')) { + debuglength = opts.maxLength; } - if (msg.msg.hasOwnProperty('message')) { - errorMsg.message = msg.msg.message; - } else { - errorMsg.message = msg.msg.toString(); - } - msg.msg = JSON.stringify(errorMsg); - } else if (msg.msg instanceof Buffer) { - msg.format = "buffer["+msg.msg.length+"]"; - msg.msg = msg.msg.toString('hex'); - if (msg.msg.length > debuglength) { - msg.msg = msg.msg.substring(0,debuglength); - } - } else if (msg.msg && msgType === 'object') { - try { - msg.format = msg.msg.constructor.name || "Object"; - // Handle special case of msg.req/res objects from HTTP In node - if (msg.format === "IncomingMessage" || msg.format === "ServerResponse") { + var msgType = typeof msg.msg; + if (msg.msg instanceof Error) { + msg.format = "error"; + var errorMsg = {}; + if (msg.msg.name) { + errorMsg.name = msg.msg.name; + } + if (msg.msg.hasOwnProperty('message')) { + errorMsg.message = msg.msg.message; + } else { + errorMsg.message = msg.msg.toString(); + } + msg.msg = JSON.stringify(errorMsg); + } else if (msg.msg instanceof Buffer) { + msg.format = "buffer["+msg.msg.length+"]"; + msg.msg = msg.msg.toString('hex'); + if (msg.msg.length > debuglength) { + msg.msg = msg.msg.substring(0,debuglength); + } + } else if (msg.msg && msgType === 'object') { + try { + msg.format = msg.msg.constructor.name || "Object"; + // Handle special case of msg.req/res objects from HTTP In node + if (msg.format === "IncomingMessage" || msg.format === "ServerResponse") { + msg.format = "Object"; + } + } catch(err) { msg.format = "Object"; } - } catch(err) { - msg.format = "Object"; - } - if (/error/i.test(msg.format)) { - msg.msg = JSON.stringify({ - name: msg.msg.name, - message: msg.msg.message - }); - } else { - var isArray = util.isArray(msg.msg); - if (isArray) { - msg.format = "array["+msg.msg.length+"]"; - if (msg.msg.length > debuglength) { - // msg.msg = msg.msg.slice(0,debuglength); - msg.msg = { - __enc__: true, - type: "array", - data: msg.msg.slice(0,debuglength), - length: msg.msg.length - } - } - } - if (isArray || (msg.format === "Object")) { - msg.msg = safeJSONStringify(msg.msg, function(key, value) { - if (key === '_req' || key === '_res') { - value = { - __enc__: true, - type: "internal" - } - } else if (value instanceof Error) { - value = value.toString() - } else if (util.isArray(value) && value.length > debuglength) { - value = { + if (/error/i.test(msg.format)) { + msg.msg = JSON.stringify({ + name: msg.msg.name, + message: msg.msg.message + }); + } else { + var isArray = util.isArray(msg.msg); + if (isArray) { + msg.format = "array["+msg.msg.length+"]"; + if (msg.msg.length > debuglength) { + // msg.msg = msg.msg.slice(0,debuglength); + msg.msg = { __enc__: true, type: "array", - data: value.slice(0,debuglength), - length: value.length - } - } else if (typeof value === 'string') { - if (value.length > debuglength) { - value = value.substring(0,debuglength)+"..."; - } - } else if (typeof value === 'function') { - value = { - __enc__: true, - type: "function" - } - } else if (typeof value === 'number') { - if (isNaN(value) || value === Infinity || value === -Infinity) { - value = { - __enc__: true, - type: "number", - data: value.toString() - } - } - } else if (value && value.constructor) { - if (value.type === "Buffer") { - value.__enc__ = true; - value.length = value.data.length; - if (value.length > debuglength) { - value.data = value.data.slice(0,debuglength); - } - } else if (value.constructor.name === "ServerResponse") { - value = "[internal]" - } else if (value.constructor.name === "Socket") { - value = "[internal]" + data: msg.msg.slice(0,debuglength), + length: msg.msg.length } } - return value; - }," "); - } else { - try { msg.msg = msg.msg.toString(); } - catch(e) { msg.msg = "[Type not printable]"; } + } + if (isArray || (msg.format === "Object")) { + msg.msg = safeJSONStringify(msg.msg, function(key, value) { + if (key === '_req' || key === '_res') { + value = { + __enc__: true, + type: "internal" + } + } else if (value instanceof Error) { + value = value.toString() + } else if (util.isArray(value) && value.length > debuglength) { + value = { + __enc__: true, + type: "array", + data: value.slice(0,debuglength), + length: value.length + } + } else if (typeof value === 'string') { + if (value.length > debuglength) { + value = value.substring(0,debuglength)+"..."; + } + } else if (typeof value === 'function') { + value = { + __enc__: true, + type: "function" + } + } else if (typeof value === 'number') { + if (isNaN(value) || value === Infinity || value === -Infinity) { + value = { + __enc__: true, + type: "number", + data: value.toString() + } + } + } else if (value && value.constructor) { + if (value.type === "Buffer") { + value.__enc__ = true; + value.length = value.data.length; + if (value.length > debuglength) { + value.data = value.data.slice(0,debuglength); + } + } else if (value.constructor.name === "ServerResponse") { + value = "[internal]" + } else if (value.constructor.name === "Socket") { + value = "[internal]" + } + } + return value; + }," "); + } else { + try { msg.msg = msg.msg.toString(); } + catch(e) { msg.msg = "[Type not printable]" + util.inspect(msg.msg); } + } + } + } else if (msgType === "function") { + msg.format = "function"; + msg.msg = "[function]" + } else if (msgType === "boolean") { + msg.format = "boolean"; + msg.msg = msg.msg.toString(); + } else if (msgType === "number") { + msg.format = "number"; + msg.msg = msg.msg.toString(); + } else if (msg.msg === null || msgType === "undefined") { + msg.format = (msg.msg === null)?"null":"undefined"; + msg.msg = "(undefined)"; + } else { + msg.format = "string["+msg.msg.length+"]"; + if (msg.msg.length > debuglength) { + msg.msg = msg.msg.substring(0,debuglength)+"..."; } } - } else if (msgType === "function") { - msg.format = "function"; - msg.msg = "[function]" - } else if (msgType === "boolean") { - msg.format = "boolean"; - msg.msg = msg.msg.toString(); - } else if (msgType === "number") { - msg.format = "number"; - msg.msg = msg.msg.toString(); - } else if (msg.msg === null || msgType === "undefined") { - msg.format = (msg.msg === null)?"null":"undefined"; - msg.msg = "(undefined)"; - } else { - msg.format = "string["+msg.msg.length+"]"; - if (msg.msg.length > debuglength) { - msg.msg = msg.msg.substring(0,debuglength)+"..."; + return msg; + } catch(e) { + msg.format = "error"; + var errorMsg = {}; + if (e.name) { + errorMsg.name = e.name; } + if (e.hasOwnProperty('message')) { + errorMsg.message = 'encodeObject Error: ['+e.message + '] Value: '+util.inspect(msg.msg); + } else { + errorMsg.message = 'encodeObject Error: ['+e.toString() + '] Value: '+util.inspect(msg.msg); + } + if (errorMsg.message.length > debuglength) { + errorMsg.message = errorMsg.message.substring(0,debuglength); + } + msg.msg = JSON.stringify(errorMsg); + return msg; } - return msg; } module.exports = { diff --git a/packages/node_modules/@node-red/util/package.json b/packages/node_modules/@node-red/util/package.json index f3751d4e2..9beb6189b 100644 --- a/packages/node_modules/@node-red/util/package.json +++ b/packages/node_modules/@node-red/util/package.json @@ -1,6 +1,6 @@ { "name": "@node-red/util", - "version": "1.0.1", + "version": "1.0.4", "license": "Apache-2.0", "repository": { "type": "git", @@ -18,7 +18,7 @@ "clone": "2.1.2", "i18next": "15.1.2", "json-stringify-safe": "5.0.1", - "jsonata": "1.6.5", + "jsonata": "1.8.1", "when": "3.7.8" } } diff --git a/packages/node_modules/node-red/package.json b/packages/node_modules/node-red/package.json index 46e34c891..2b7116f64 100644 --- a/packages/node_modules/node-red/package.json +++ b/packages/node_modules/node-red/package.json @@ -1,6 +1,6 @@ { "name": "node-red", - "version": "1.0.1", + "version": "1.0.4", "description": "Low-code programming for event-driven applications", "homepage": "http://nodered.org", "license": "Apache-2.0", @@ -31,16 +31,16 @@ "flow" ], "dependencies": { - "@node-red/editor-api": "1.0.1", - "@node-red/runtime": "1.0.1", - "@node-red/util": "1.0.1", - "@node-red/nodes": "1.0.1", + "@node-red/editor-api": "1.0.4", + "@node-red/runtime": "1.0.4", + "@node-red/util": "1.0.4", + "@node-red/nodes": "1.0.4", "basic-auth": "2.0.1", "bcryptjs": "2.4.3", "express": "4.17.1", "fs-extra": "8.1.0", - "node-red-node-rbe": "^0.2.5", - "node-red-node-tail": "^0.0.3", + "node-red-node-rbe": "^0.2.6", + "node-red-node-tail": "^0.1.0", "nopt": "4.0.1", "semver": "6.3.0" }, diff --git a/scripts/generate-publish-script.js b/scripts/generate-publish-script.js new file mode 100644 index 000000000..45a4e8423 --- /dev/null +++ b/scripts/generate-publish-script.js @@ -0,0 +1,38 @@ +#!/usr/bin/env node + +const path = require("path"); +const fs = require("fs-extra"); +const should = require("should"); + +function generateScript() { + return new Promise((resolve, reject) => { + const packages = [ + "node-red-util", + "node-red-runtime", + "node-red-registry", + "node-red-nodes", + "node-red-editor-client", + "node-red-editor-api", + "node-red" + ]; + const rootPackage = require(path.join(__dirname,"..","package.json")); + const version = rootPackage.version; + + const tagArg = /-/.test(version) ? "--tag next" : "" + + const lines = []; + + packages.forEach(name => { + lines.push(`npm publish ${name}-${version}.tgz ${tagArg}\n`); + }) + resolve(lines.join("")) + }); +} + +if (require.main === module) { + generateScript().then(output => { + console.log(output); + }); +} else { + module.exports = generateScript; +} diff --git a/scripts/install-ui-test-dependencies.sh b/scripts/install-ui-test-dependencies.sh index 0148633be..155d2b275 100755 --- a/scripts/install-ui-test-dependencies.sh +++ b/scripts/install-ui-test-dependencies.sh @@ -3,5 +3,7 @@ npm install --no-save \ wdio-chromedriver-service@^0.1.5 \ wdio-mocha-framework@^0.6.4 \ wdio-spec-reporter@^0.1.5 \ - webdriverio@^4.14.1 \ - chromedriver@2 + webdriverio@^4.14.4 \ + chromedriver@^79.0.0 \ + wdio-browserstack-service@^0.1.19 \ + browserstack-local@^1.4.4 diff --git a/test/editor/editor_helper.js b/test/editor/editor_helper.js index 8de197cef..73177c2ca 100644 --- a/test/editor/editor_helper.js +++ b/test/editor/editor_helper.js @@ -52,8 +52,14 @@ function getFlowFilename() { } function cleanup(flowFile) { - deleteFile(homeDir+"/"+flowFile); - deleteFile(homeDir+"/."+flowFile+".backup"); + var credentialFile = flowFile.replace(/\.json$/, '') + '_cred.json'; + deleteFile(homeDir + "/" + flowFile); + deleteFile(homeDir + "/." + flowFile + ".backup"); + deleteFile(homeDir + "/" + credentialFile); + deleteFile(homeDir + "/." + credentialFile + ".backup"); + deleteFile(homeDir + "/package.json"); + deleteFile(homeDir + "/lib/flows"); + deleteFile(homeDir + "/lib"); } function deleteFile(flowFile) { @@ -63,7 +69,7 @@ function deleteFile(flowFile) { fs.unlinkSync(flowFile); } } catch (e) {} -}; +} module.exports = { startServer: function() { @@ -101,7 +107,7 @@ module.exports = { }); }); browser.url(url); - browser.waitForExist(".red-ui-palette-node[data-palette-type='inject']") + browser.waitForExist(".red-ui-palette-node[data-palette-type='inject']"); } catch (err) { console.log(err); throw err; diff --git a/test/editor/pageobjects/editor/palette_page.js b/test/editor/pageobjects/editor/palette_page.js index 878f218fb..6af0b5271 100644 --- a/test/editor/pageobjects/editor/palette_page.js +++ b/test/editor/pageobjects/editor/palette_page.js @@ -15,24 +15,37 @@ **/ var idMap = { - // input + // common "inject": ".red-ui-palette-node[data-palette-type='inject']", - "httpin": ".red-ui-palette-node[data-palette-type='http in']", - "mqttIn": ".red-ui-palette-node[data-palette-type='mqtt in']", - // output "debug": ".red-ui-palette-node[data-palette-type='debug']", - "httpResponse": ".red-ui-palette-node[data-palette-type='http response']", - "mqttOut": ".red-ui-palette-node[data-palette-type='mqtt out']", + "complete": ".red-ui-palette-node[data-palette-type='complete']", + "catch": ".red-ui-palette-node[data-palette-type='catch']", + "status": ".red-ui-palette-node[data-palette-type='status']", + "comment": ".red-ui-palette-node[data-palette-type='comment']", // function "function": ".red-ui-palette-node[data-palette-type='function']", - "template": ".red-ui-palette-node[data-palette-type='template']", "change": ".red-ui-palette-node[data-palette-type='change']", "range": ".red-ui-palette-node[data-palette-type='range']", + "template": ".red-ui-palette-node[data-palette-type='template']", + "delay": ".red-ui-palette-node[data-palette-type='delay']", + // network + "mqttIn": ".red-ui-palette-node[data-palette-type='mqtt in']", + "mqttOut": ".red-ui-palette-node[data-palette-type='mqtt out']", + "httpIn": ".red-ui-palette-node[data-palette-type='http in']", + "httpResponse": ".red-ui-palette-node[data-palette-type='http response']", "httpRequest": ".red-ui-palette-node[data-palette-type='http request']", + // sequence + "split": ".red-ui-palette-node[data-palette-type='split']", + "join": ".red-ui-palette-node[data-palette-type='join']", + "batch": ".red-ui-palette-node[data-palette-type='batch']", + // parser + "csv": ".red-ui-palette-node[data-palette-type='csv']", "html": ".red-ui-palette-node[data-palette-type='html']", "json": ".red-ui-palette-node[data-palette-type='json']", + "xml": ".red-ui-palette-node[data-palette-type='xml']", + "yaml": ".red-ui-palette-node[data-palette-type='yaml']", // storage - "filein": ".red-ui-palette-node[data-palette-type='file in']", + "fileIn": ".red-ui-palette-node[data-palette-type='file in']", }; function getId(type) { diff --git a/test/editor/pageobjects/editor/workspace_page.js b/test/editor/pageobjects/editor/workspace_page.js index 18e50dcf2..92a725dac 100644 --- a/test/editor/pageobjects/editor/workspace_page.js +++ b/test/editor/pageobjects/editor/workspace_page.js @@ -14,19 +14,16 @@ * limitations under the License. **/ - var when = require("when"); - +var when = require("when"); var events = require("nr-test-utils").require("@node-red/runtime/lib/events.js"); - var palette = require("./palette_page"); var nodeFactory = require("../nodes/nodefactory_page"); - +var keyPage = require("../util/key_page"); var flowLayout = { flowRightEnd : 600, widthInterval : 300, heightInterval : 80 }; - var previousX = -flowLayout.widthInterval; var previousY = 0; @@ -44,6 +41,10 @@ function addNode(type, x, y) { previousY = previousY + flowLayout.heightInterval; } } + browser.waitForVisible('#red-ui-palette-search'); + browser.setValue('//*[@id="red-ui-palette-search"]/div/form/input', type.replace(/([A-Z])/g, ' $1').toLowerCase()); + browser.pause(300); + browser.waitForVisible(palette.getId(type)); browser.moveToObject(palette.getId(type)); browser.buttonDown(); browser.moveToObject("#red-ui-palette-search", previousX + 300, previousY + 100); // adjust to the top-left corner of workspace. @@ -56,23 +57,26 @@ function addNode(type, x, y) { } function deleteAllNodes() { - browser.click('.red-ui-workspace-chart-event-layer'); - browser.keys(['Control', 'a', 'a', 'Control']); // call twice to release the keys. + browser.waitForVisible('//*[contains(@class, "active")]/a[@class="red-ui-tab-label"]'); + browser.click('//*[contains(@class, "active")]/a[@class="red-ui-tab-label"]'); + browser.pause(1000); + browser.keys(keyPage.selectAll()); browser.keys(['Delete']); } function deploy() { browser.call(function () { - return when.promise(function(resolve, reject) { - events.on("runtime-event", function(event) { + return when.promise(function (resolve, reject) { + events.on("runtime-event", function (event) { if (event.id === 'runtime-deploy') { + events.removeListener("runtime-event", arguments.callee); resolve(); } }); browser.clickWithWait('#red-ui-header-button-deploy'); }); }); - browser.waitForText('#red-ui-header-button-deploy', 2000); + browser.waitForText('#red-ui-header-button-deploy', 10000); // Need additional wait until buttons becomes clickable. browser.pause(50); } diff --git a/test/editor/pageobjects/nodes/core/core/20-inject_page.js b/test/editor/pageobjects/nodes/core/common/20-inject_page.js similarity index 90% rename from test/editor/pageobjects/nodes/core/core/20-inject_page.js rename to test/editor/pageobjects/nodes/core/common/20-inject_page.js index 82a4e6d6e..38e6e32ed 100644 --- a/test/editor/pageobjects/nodes/core/core/20-inject_page.js +++ b/test/editor/pageobjects/nodes/core/common/20-inject_page.js @@ -47,11 +47,11 @@ injectNode.prototype.setPayload = function(payloadType, payload) { // Open a payload type list. browser.clickWithWait('//*[contains(@class, "red-ui-typedInput-container")]'); // Select a payload type. - var payloadTypeXPath = '//*[@class="red-ui-typedInput-options"]/a[' + payloadTypeList[payloadType] + ']'; + var payloadTypeXPath = '//*[contains(@class, "red-ui-typedInput-options")]/a[' + payloadTypeList[payloadType] + ']'; browser.clickWithWait(payloadTypeXPath); if (payload) { // Input a value. - browser.setValue('//*[@class="red-ui-typedInput-input"]/input', payload); + browser.setValue('//*[contains(@class, "red-ui-typedInput-input")]/input', payload); } } diff --git a/test/editor/pageobjects/nodes/core/core/58-debug_page.js b/test/editor/pageobjects/nodes/core/common/21-debug_page.js similarity index 86% rename from test/editor/pageobjects/nodes/core/core/58-debug_page.js rename to test/editor/pageobjects/nodes/core/common/21-debug_page.js index 2b1eabe64..56854b195 100644 --- a/test/editor/pageobjects/nodes/core/core/58-debug_page.js +++ b/test/editor/pageobjects/nodes/core/common/21-debug_page.js @@ -26,16 +26,15 @@ function debugNode(id) { util.inherits(debugNode, nodePage); -debugNode.prototype.setOutput = function(complete) { +debugNode.prototype.setOutput = function (complete) { // Open a payload type list. browser.clickWithWait('//*[contains(@class, "red-ui-typedInput-container")]/button'); if (complete !== 'true') { // Select the "msg" type. - browser.clickWithWait('//div[@class="red-ui-typedInput-options"][1]/a[1]'); + browser.clickWithWait('//div[contains(@class, "red-ui-typedInput-options")][1]/a[1]'); // Input the path in msg. browser.clickWithWait('//*[contains(@class, "red-ui-typedInput-input")]/input'); - browser.keys(keyPage.selectAll()); - browser.keys(['Delete']); + browser.keys(Array('payload'.length).fill('Backspace')); browser.setValue('//*[contains(@class, "red-ui-typedInput-input")]/input', complete); } else { // Select the "complete msg object" type. diff --git a/test/editor/pageobjects/nodes/core/common/24-complete_page.js b/test/editor/pageobjects/nodes/core/common/24-complete_page.js new file mode 100644 index 000000000..558ee709a --- /dev/null +++ b/test/editor/pageobjects/nodes/core/common/24-complete_page.js @@ -0,0 +1,47 @@ +/** + * Copyright JS Foundation and other contributors, http://js.foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ + +var util = require('util'); + +var nodePage = require('../../node_page'); + +function completeNode(id) { + nodePage.call(this, id); +} + +util.inherits(completeNode, nodePage); + +completeNode.prototype.setScope = function (scope) { + if (scope) { + browser.clickWithWait('//*[@id="node-input-complete-target-select"]'); + browser.pause(1000); + if (Array.isArray(scope)) { + for (var i = 0; i < scope.length; i++) { + browser.moveToObject(scope[i].id); + browser.buttonDown(); + browser.buttonUp(); + } + } else { + browser.moveToObject(scope.id); + browser.buttonDown(); + browser.buttonUp(); + } + browser.clickWithWait('//*[contains(@class, "red-ui-notification")]/div/button[2]'); + browser.pause(1000); + } +} + +module.exports = completeNode; diff --git a/test/editor/pageobjects/nodes/core/common/25-catch_page.js b/test/editor/pageobjects/nodes/core/common/25-catch_page.js new file mode 100644 index 000000000..89bcb7f1e --- /dev/null +++ b/test/editor/pageobjects/nodes/core/common/25-catch_page.js @@ -0,0 +1,48 @@ +/** + * Copyright JS Foundation and other contributors, http://js.foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ + +var util = require('util'); + +var nodePage = require('../../node_page'); + +function catchNode(id) { + nodePage.call(this, id); +} + +util.inherits(catchNode, nodePage); + +catchNode.prototype.setScope = function (scope) { + if (scope) { + browser.selectWithWait('#node-input-scope-select', 'target'); + browser.clickWithWait('//*[@id="node-input-catch-target-select"]'); + browser.pause(1000); + if (Array.isArray(scope)) { + for (var i = 0; i < scope.length; i++) { + browser.moveToObject(scope[i].id); + browser.buttonDown(); + browser.buttonUp(); + } + } else { + browser.moveToObject(scope.id); + browser.buttonDown(); + browser.buttonUp(); + } + browser.clickWithWait('//*[contains(@class, "red-ui-notification")]/div/button[2]'); + browser.pause(1000); + } +} + +module.exports = catchNode; diff --git a/test/editor/pageobjects/nodes/core/common/25-status_page.js b/test/editor/pageobjects/nodes/core/common/25-status_page.js new file mode 100644 index 000000000..6de0fcde7 --- /dev/null +++ b/test/editor/pageobjects/nodes/core/common/25-status_page.js @@ -0,0 +1,48 @@ +/** + * Copyright JS Foundation and other contributors, http://js.foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ + +var util = require('util'); + +var nodePage = require('../../node_page'); + +function statusNode(id) { + nodePage.call(this, id); +} + +util.inherits(statusNode, nodePage); + +statusNode.prototype.setScope = function (scope) { + if (scope) { + browser.selectWithWait('#node-input-scope-select', 'target'); + browser.clickWithWait('//*[@id="node-input-status-target-select"]'); + browser.pause(1000); + if (Array.isArray(scope)) { + for (var i = 0; i < scope.length; i++) { + browser.moveToObject(scope[i].id); + browser.buttonDown(); + browser.buttonUp(); + } + } else { + browser.moveToObject(scope.id); + browser.buttonDown(); + browser.buttonUp(); + } + browser.clickWithWait('//*[contains(@class, "red-ui-notification")]/div/button[2]'); + browser.pause(1000); + } +} + +module.exports = statusNode; diff --git a/test/editor/pageobjects/nodes/core/common/90-comment_page.js b/test/editor/pageobjects/nodes/core/common/90-comment_page.js new file mode 100644 index 000000000..2687dacfe --- /dev/null +++ b/test/editor/pageobjects/nodes/core/common/90-comment_page.js @@ -0,0 +1,27 @@ +/** + * Copyright JS Foundation and other contributors, http://js.foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ + +var util = require('util'); + +var nodePage = require('../../node_page'); + +function commentNode(id) { + nodePage.call(this, id); +} + +util.inherits(commentNode, nodePage); + +module.exports = commentNode; diff --git a/test/editor/pageobjects/nodes/core/core/80-function_page.js b/test/editor/pageobjects/nodes/core/function/10-function_page.js similarity index 89% rename from test/editor/pageobjects/nodes/core/core/80-function_page.js rename to test/editor/pageobjects/nodes/core/function/10-function_page.js index f39aba912..c1bb80a80 100644 --- a/test/editor/pageobjects/nodes/core/core/80-function_page.js +++ b/test/editor/pageobjects/nodes/core/function/10-function_page.js @@ -26,12 +26,11 @@ function functionNode(id) { util.inherits(functionNode, nodePage); -functionNode.prototype.setFunction = function(func) { +functionNode.prototype.setFunction = function (func) { browser.clickWithWait('#node-input-func-editor'); browser.keys(keyPage.selectAll()); - for (var i = 0; i < func.length; i++) { - browser.keys([func.charAt(i)]); - } + browser.keys(['Delete']); + browser.keys(func); // Delete the unnecessary code that ace editor does the autocompletion. browser.keys(keyPage.selectToEnd()); browser.keys(['Delete']); diff --git a/test/editor/pageobjects/nodes/core/logic/15-change_page.js b/test/editor/pageobjects/nodes/core/function/15-change_page.js similarity index 75% rename from test/editor/pageobjects/nodes/core/logic/15-change_page.js rename to test/editor/pageobjects/nodes/core/function/15-change_page.js index 51589f7b5..59ac4f2f1 100644 --- a/test/editor/pageobjects/nodes/core/logic/15-change_page.js +++ b/test/editor/pageobjects/nodes/core/function/15-change_page.js @@ -14,9 +14,9 @@ * limitations under the License. **/ -var util = require("util"); +var util = require('util'); -var nodePage = require("../../node_page"); +var nodePage = require('../../node_page'); function changeNode(id) { nodePage.call(this, id); @@ -49,13 +49,13 @@ function setT(t, index) { } // It is better to create a function whose input value is the object type in the future, -changeNode.prototype.ruleSet = function(p, pt, to, tot, index) { - index = index ? index : 1; +changeNode.prototype.ruleSet = function (p, pt, to, tot, index) { + index = index || 1; setT("set", index); if (pt) { browser.clickWithWait('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[1]/div/button[1]'); var num = 5 * (index - 1) + 1; - var ptXPath = '//div[@class="red-ui-typedInput-options"][' + num + ']/a[' + ptType[pt] + ']'; + var ptXPath = '//div[contains(@class, "red-ui-typedInput-options")][' + num + ']/a[' + ptType[pt] + ']'; browser.clickWithWait(ptXPath); } if (p) { @@ -64,28 +64,28 @@ changeNode.prototype.ruleSet = function(p, pt, to, tot, index) { if (tot) { browser.clickWithWait('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[2]/div[2]/button[1]'); var num = 5 * (index - 1) + 2; - var totXPath = '//div[@class="red-ui-typedInput-options"][' + num + ']/a[' + totType[tot] + ']'; + var totXPath = '//div[contains(@class, "red-ui-typedInput-options")][' + num + ']/a[' + totType[tot] + ']'; browser.clickWithWait(totXPath); } if (to) { - browser.setValue('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[2]/div[2]/div/input' , to); + browser.setValue('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[2]/div[2]/div/input', to); } } -changeNode.prototype.ruleDelete = function(index) { - index = index ? index : 1; +changeNode.prototype.ruleDelete = function (index) { + index = index || 1; setT("delete", index); } -changeNode.prototype.ruleMove = function(p, to, index) { - index = index ? index : 1; +changeNode.prototype.ruleMove = function (p, to, index) { + index = index || 1; setT("move", index); browser.setValue('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[1]/div/div/input', p); browser.setValue('//*[@id="node-input-rule-container"]/li[' + index + ']/div/div[4]/div[2]/div/input', to); } -changeNode.prototype.addRule = function() { - browser.clickWithWait('//*[@id="dialog-form"]/div[3]/div/a'); +changeNode.prototype.addRule = function () { + browser.clickWithWait('//*[@id="dialog-form"]/div[5]/div/a'); } module.exports = changeNode; diff --git a/test/editor/pageobjects/nodes/core/logic/16-range_page.js b/test/editor/pageobjects/nodes/core/function/16-range_page.js similarity index 100% rename from test/editor/pageobjects/nodes/core/logic/16-range_page.js rename to test/editor/pageobjects/nodes/core/function/16-range_page.js diff --git a/test/editor/pageobjects/nodes/core/core/80-template_page.js b/test/editor/pageobjects/nodes/core/function/80-template_page.js similarity index 77% rename from test/editor/pageobjects/nodes/core/core/80-template_page.js rename to test/editor/pageobjects/nodes/core/function/80-template_page.js index 68cf46acf..bf1786ba2 100644 --- a/test/editor/pageobjects/nodes/core/core/80-template_page.js +++ b/test/editor/pageobjects/nodes/core/function/80-template_page.js @@ -26,21 +26,19 @@ function templateNode(id) { util.inherits(templateNode, nodePage); -templateNode.prototype.setSyntax = function(syntax) { +templateNode.prototype.setSyntax = function (syntax) { browser.selectWithWait('#node-input-syntax', syntax); } -templateNode.prototype.setFormat = function(format) { +templateNode.prototype.setFormat = function (format) { browser.selectWithWait('#node-input-format', format); } -templateNode.prototype.setTemplate = function(template) { +templateNode.prototype.setTemplate = function (template) { browser.clickWithWait('#node-input-template-editor'); browser.keys(keyPage.selectAll()); - // Need to add a character one by one since some words such as 'Control' are treated as a special word. - for (var i = 0; i < template.length; i++) { - browser.keys([template.charAt(i)]); - } + browser.keys(['Delete']); + browser.keys(template); browser.keys(keyPage.selectToEnd()); browser.keys(['Delete']); // Need to wait until ace editor correctly checks the syntax. diff --git a/test/editor/pageobjects/nodes/core/function/89-delay_page.js b/test/editor/pageobjects/nodes/core/function/89-delay_page.js new file mode 100644 index 000000000..a4e2197e4 --- /dev/null +++ b/test/editor/pageobjects/nodes/core/function/89-delay_page.js @@ -0,0 +1,33 @@ +/** + * Copyright JS Foundation and other contributors, http://js.foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ + +var util = require("util"); + +var nodePage = require("../../node_page"); + +var keyPage = require("../../../util/key_page"); + +function delayNode(id) { + nodePage.call(this, id); +} + +util.inherits(delayNode, nodePage); + +delayNode.prototype.setTimeout = function (timeout) { + browser.setValue('//*[@id="node-input-timeout"]', timeout); +} + +module.exports = delayNode; diff --git a/test/editor/pageobjects/nodes/core/io/10-mqttconfig_page.js b/test/editor/pageobjects/nodes/core/network/10-mqttconfig_page.js similarity index 82% rename from test/editor/pageobjects/nodes/core/io/10-mqttconfig_page.js rename to test/editor/pageobjects/nodes/core/network/10-mqttconfig_page.js index 69266f9e8..c7cdc90c5 100644 --- a/test/editor/pageobjects/nodes/core/io/10-mqttconfig_page.js +++ b/test/editor/pageobjects/nodes/core/network/10-mqttconfig_page.js @@ -23,13 +23,14 @@ function setServer(broker, port) { function clickOk() { browser.clickWithWait('#node-config-dialog-ok'); // Wait until an config dialog closes. - browser.waitForVisible('#node-config-dialog-ok', 2000, true); + browser.waitForVisible('#node-config-dialog-ok', 10000, true); } function edit() { - browser.clickWithWait('#node-input-lookup-broker'); + browser.waitForVisible('#node-input-lookup-broker'); + browser.click('#node-input-lookup-broker'); // Wait until a config dialog opens. - browser.waitForVisible('#node-config-dialog-ok', 2000); + browser.waitForVisible('#node-config-dialog-ok', 10000); } module.exports = { diff --git a/test/editor/pageobjects/nodes/core/io/10-mqttin_page.js b/test/editor/pageobjects/nodes/core/network/10-mqttin_page.js similarity index 100% rename from test/editor/pageobjects/nodes/core/io/10-mqttin_page.js rename to test/editor/pageobjects/nodes/core/network/10-mqttin_page.js diff --git a/test/editor/pageobjects/nodes/core/io/10-mqttout_page.js b/test/editor/pageobjects/nodes/core/network/10-mqttout_page.js similarity index 100% rename from test/editor/pageobjects/nodes/core/io/10-mqttout_page.js rename to test/editor/pageobjects/nodes/core/network/10-mqttout_page.js diff --git a/test/editor/pageobjects/nodes/core/io/21-httpin_page.js b/test/editor/pageobjects/nodes/core/network/21-httpin_page.js similarity index 81% rename from test/editor/pageobjects/nodes/core/io/21-httpin_page.js rename to test/editor/pageobjects/nodes/core/network/21-httpin_page.js index 97648f395..9454ef034 100644 --- a/test/editor/pageobjects/nodes/core/io/21-httpin_page.js +++ b/test/editor/pageobjects/nodes/core/network/21-httpin_page.js @@ -18,18 +18,18 @@ var util = require("util"); var nodePage = require("../../node_page"); -function httpinNode(id) { +function httpInNode(id) { nodePage.call(this, id); } -util.inherits(httpinNode, nodePage); +util.inherits(httpInNode, nodePage); -httpinNode.prototype.setMethod = function(method) { +httpInNode.prototype.setMethod = function(method) { browser.selectWithWait('#node-input-method', method); } -httpinNode.prototype.setUrl = function(url) { +httpInNode.prototype.setUrl = function(url) { browser.setValue('#node-input-url', url); } -module.exports = httpinNode; +module.exports = httpInNode; diff --git a/test/editor/pageobjects/nodes/core/io/21-httprequest_page.js b/test/editor/pageobjects/nodes/core/network/21-httprequest_page.js similarity index 100% rename from test/editor/pageobjects/nodes/core/io/21-httprequest_page.js rename to test/editor/pageobjects/nodes/core/network/21-httprequest_page.js diff --git a/test/editor/pageobjects/nodes/core/io/21-httpresponse_page.js b/test/editor/pageobjects/nodes/core/network/21-httpresponse_page.js similarity index 100% rename from test/editor/pageobjects/nodes/core/io/21-httpresponse_page.js rename to test/editor/pageobjects/nodes/core/network/21-httpresponse_page.js diff --git a/test/editor/pageobjects/nodes/core/parsers/70-CSV_page.js b/test/editor/pageobjects/nodes/core/parsers/70-CSV_page.js new file mode 100644 index 000000000..e4bc9502c --- /dev/null +++ b/test/editor/pageobjects/nodes/core/parsers/70-CSV_page.js @@ -0,0 +1,51 @@ +/** + * Copyright JS Foundation and other contributors, http://js.foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ + +var util = require('util'); + +var nodePage = require('../../node_page'); + +function csvNode(id) { + nodePage.call(this, id); +} + +util.inherits(csvNode, nodePage); + +csvNode.prototype.setColumns = function (columns) { + browser.setValue('#node-input-temp', columns); +} + +csvNode.prototype.setSkipLines = function (skip) { + browser.setValue('#node-input-skip', skip); +} + +csvNode.prototype.setFirstRow4Names = function (checkbox) { + if (browser.isSelected('#node-input-hdrin') !== checkbox) { + browser.click('#node-input-hdrin'); + } +} + +csvNode.prototype.setOutput = function (output) { + browser.selectWithWait('#node-input-multi', output); +} + +csvNode.prototype.setIncludeRow = function (checkbox) { + if (browser.isSelected('#node-input-hdrout') !== checkbox) { + browser.click('#node-input-hdrout'); + } +} + +module.exports = csvNode; diff --git a/test/editor/pageobjects/nodes/core/parsers/70-HTML_page.js b/test/editor/pageobjects/nodes/core/parsers/70-HTML_page.js index 9c89bc8e2..243e4c905 100644 --- a/test/editor/pageobjects/nodes/core/parsers/70-HTML_page.js +++ b/test/editor/pageobjects/nodes/core/parsers/70-HTML_page.js @@ -14,9 +14,9 @@ * limitations under the License. **/ -var util = require("util"); +var util = require('util'); -var nodePage = require("../../node_page"); +var nodePage = require('../../node_page'); function htmlNode(id) { nodePage.call(this, id); @@ -24,7 +24,7 @@ function htmlNode(id) { util.inherits(htmlNode, nodePage); -htmlNode.prototype.setSelector = function(tag) { +htmlNode.prototype.setSelector = function (tag) { browser.setValue('#node-input-tag', tag); } diff --git a/test/editor/pageobjects/nodes/core/parsers/70-JSON_page.js b/test/editor/pageobjects/nodes/core/parsers/70-JSON_page.js index 10a7e648f..875c3b013 100644 --- a/test/editor/pageobjects/nodes/core/parsers/70-JSON_page.js +++ b/test/editor/pageobjects/nodes/core/parsers/70-JSON_page.js @@ -14,9 +14,9 @@ * limitations under the License. **/ -var util = require("util"); +var util = require('util'); -var nodePage = require("../../node_page"); +var nodePage = require('../../node_page'); function jsonNode(id) { nodePage.call(this, id); @@ -28,8 +28,8 @@ jsonNode.prototype.setAction = function (action) { browser.setValue('node-input-action', action); } -jsonNode.prototype.setProperty = function(property) { - browser.setValue('//*[@id="dialog-form"]/div[2]/div/div/input', property); +jsonNode.prototype.setProperty = function (property) { + browser.setValue('//*[@id="dialog-form"]/div[4]/div/div[1]/input', property); } module.exports = jsonNode; diff --git a/test/editor/pageobjects/nodes/core/parsers/70-XML_page.js b/test/editor/pageobjects/nodes/core/parsers/70-XML_page.js new file mode 100644 index 000000000..2a8be7d95 --- /dev/null +++ b/test/editor/pageobjects/nodes/core/parsers/70-XML_page.js @@ -0,0 +1,35 @@ +/** + * Copyright JS Foundation and other contributors, http://js.foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ + +var util = require('util'); + +var nodePage = require('../../node_page'); + +function xmlNode(id) { + nodePage.call(this, id); +} + +util.inherits(xmlNode, nodePage); + +xmlNode.prototype.setAction = function (action) { + browser.setValue('node-input-action', action); +} + +xmlNode.prototype.setProperty = function (property) { + browser.setValue('//*[@id="dialog-form"]/div[3]/div/div[1]/input', property); +} + +module.exports = xmlNode; diff --git a/test/editor/pageobjects/nodes/core/parsers/70-YAML_page.js b/test/editor/pageobjects/nodes/core/parsers/70-YAML_page.js new file mode 100644 index 000000000..16e4a678d --- /dev/null +++ b/test/editor/pageobjects/nodes/core/parsers/70-YAML_page.js @@ -0,0 +1,35 @@ +/** + * Copyright JS Foundation and other contributors, http://js.foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ + +var util = require('util'); + +var nodePage = require('../../node_page'); + +function yamlNode(id) { + nodePage.call(this, id); +} + +util.inherits(yamlNode, nodePage); + +yamlNode.prototype.setAction = function (action) { + browser.setValue('node-input-action', action); +} + +yamlNode.prototype.setProperty = function (property) { + browser.setValue('//*[@id="dialog-form"]/div[3]/div/div[1]/input', property); +} + +module.exports = yamlNode; diff --git a/test/editor/pageobjects/nodes/core/sequence/17-split_page.js b/test/editor/pageobjects/nodes/core/sequence/17-split_page.js new file mode 100644 index 000000000..3c8c70aa5 --- /dev/null +++ b/test/editor/pageobjects/nodes/core/sequence/17-split_page.js @@ -0,0 +1,35 @@ +/** + * Copyright JS Foundation and other contributors, http://js.foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ + +var util = require('util'); + +var nodePage = require('../../node_page'); + +function splitNode(id) { + nodePage.call(this, id); +} + +util.inherits(splitNode, nodePage); + +module.exports = splitNode; + +function joinNode(id) { + nodePage.call(this, id); +} + +util.inherits(joinNode, nodePage); + +module.exports = joinNode; diff --git a/test/editor/pageobjects/nodes/core/sequence/19-batch_page.js b/test/editor/pageobjects/nodes/core/sequence/19-batch_page.js new file mode 100644 index 000000000..0d7b13028 --- /dev/null +++ b/test/editor/pageobjects/nodes/core/sequence/19-batch_page.js @@ -0,0 +1,39 @@ +/** + * Copyright JS Foundation and other contributors, http://js.foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ + +var util = require('util'); + +var nodePage = require('../../node_page'); + +function batchNode(id) { + nodePage.call(this, id); +} + +batchNode.prototype.setMode = function (mode) { + browser.selectWithWait('#node-input-mode', mode); +} + +batchNode.prototype.setCount = function (count) { + browser.setValue('#node-input-count', count); +} + +batchNode.prototype.setOverlap = function (overlap) { + browser.setValue('#node-input-overlap', overlap); +} + +util.inherits(batchNode, nodePage); + +module.exports = batchNode; diff --git a/test/editor/pageobjects/nodes/core/storage/50-filein_page.js b/test/editor/pageobjects/nodes/core/storage/10-filein_page.js similarity index 84% rename from test/editor/pageobjects/nodes/core/storage/50-filein_page.js rename to test/editor/pageobjects/nodes/core/storage/10-filein_page.js index 5a327f14c..942ea63d8 100644 --- a/test/editor/pageobjects/nodes/core/storage/50-filein_page.js +++ b/test/editor/pageobjects/nodes/core/storage/10-filein_page.js @@ -18,11 +18,11 @@ var util = require("util"); var nodePage = require("../../node_page"); -function fileinNode(id) { +function fileInNode(id) { nodePage.call(this, id); } -util.inherits(fileinNode, nodePage); +util.inherits(fileInNode, nodePage); var formatType = { "utf8": 1, @@ -31,14 +31,14 @@ var formatType = { "stream": 4 }; -fileinNode.prototype.setFilename = function(filename) { +fileInNode.prototype.setFilename = function(filename) { browser.setValue('#node-input-filename', filename); } -fileinNode.prototype.setOutput = function(format) { +fileInNode.prototype.setOutput = function(format) { browser.clickWithWait('#node-input-format'); var formatTypeXPath = '//*[@id="node-input-format"]/option[' + formatType[format] + ']'; browser.clickWithWait(formatTypeXPath); } -module.exports = fileinNode; +module.exports = fileInNode; diff --git a/test/editor/pageobjects/nodes/node_page.js b/test/editor/pageobjects/nodes/node_page.js index a093a2335..5250250e7 100644 --- a/test/editor/pageobjects/nodes/node_page.js +++ b/test/editor/pageobjects/nodes/node_page.js @@ -18,28 +18,33 @@ function Node(id) { this.id = '//*[@id="' + id + '"]'; } -Node.prototype.edit = function() { - browser.clickWithWait(this.id); - browser.clickWithWait(this.id); +Node.prototype.edit = function () { + browser.waitForVisible(this.id); + browser.moveToObject(this.id); + browser.buttonDown(); + browser.buttonUp(); + browser.keys(['Enter']); // Wait until an edit dialog opens. - browser.waitForVisible('#node-dialog-ok', 2000); + browser.waitForVisible('#node-dialog-ok', 10000); } -Node.prototype.clickOk = function() { +Node.prototype.clickOk = function () { browser.clickWithWait('#node-dialog-ok'); // Wait untile an edit dialog closes. - browser.waitForVisible('#node-dialog-ok', 2000, true); + browser.waitForVisible('#node-dialog-ok', 10000, true); browser.pause(50); } -Node.prototype.connect = function(targetNode) { +Node.prototype.connect = function (targetNode) { var outputPort = this.id + '/*[@class="red-ui-flow-port-output"]'; var inputPort = targetNode.id + '/*[@class="red-ui-flow-port-input"]'; browser.dragAndDrop(outputPort, inputPort) } -Node.prototype.clickLeftButton = function() { - browser.clickWithWait(this.id + '/*[@class="red-ui-flow-node-button"]'); +Node.prototype.clickLeftButton = function () { + browser.moveToObject(this.id + '/*[@class="red-ui-flow-node-button"]'); + browser.buttonDown(); + browser.buttonUp(); } module.exports = Node; diff --git a/test/editor/pageobjects/nodes/nodefactory_page.js b/test/editor/pageobjects/nodes/nodefactory_page.js index 8cb364ad1..17949e313 100644 --- a/test/editor/pageobjects/nodes/nodefactory_page.js +++ b/test/editor/pageobjects/nodes/nodefactory_page.js @@ -14,46 +14,69 @@ * limitations under the License. **/ -var injectNode = require('./core/core/20-inject_page'); -var debugNode = require('./core/core/58-debug_page'); -var templateNode = require('./core/core/80-template_page'); -var functionNode = require('./core/core/80-function_page'); -var mqttInNode = require('./core/io/10-mqttin_page'); -var mqttOutNode = require('./core/io/10-mqttout_page'); -var httpinNode = require('./core/io/21-httpin_page'); -var httpResponseNode = require('./core/io/21-httpresponse_page'); -var changeNode = require('./core/logic/15-change_page'); -var rangeNode = require('./core/logic/16-range_page'); -var httpRequestNode = require('./core/io/21-httprequest_page'); +var injectNode = require('./core/common/20-inject_page'); +var debugNode = require('./core/common/21-debug_page'); +var completeNode = require('./core/common/24-complete_page'); +var catchNode = require('./core/common/25-catch_page'); +var statusNode = require('./core/common/25-status_page'); +var commentNode = require('./core/common/90-comment_page'); +var functionNode = require('./core/function/10-function_page'); +var changeNode = require('./core/function/15-change_page'); +var rangeNode = require('./core/function/16-range_page'); +var templateNode = require('./core/function/80-template_page'); +var delayNode = require('./core/function/89-delay_page'); +var mqttInNode = require('./core/network/10-mqttin_page'); +var mqttOutNode = require('./core/network/10-mqttout_page'); +var httpInNode = require('./core/network/21-httpin_page'); +var httpResponseNode = require('./core/network/21-httpresponse_page'); +var httpRequestNode = require('./core/network/21-httprequest_page'); +var splitNode = require('./core/sequence/17-split_page'); +var joinNode = require('./core/sequence/17-split_page'); +var batchNode = require('./core/sequence/19-batch_page'); +var csvNode = require('./core/parsers/70-CSV_page'); var htmlNode = require('./core/parsers/70-HTML_page'); var jsonNode = require('./core/parsers/70-JSON_page'); -var fileinNode = require('./core/storage/50-filein_page'); - +var xmlNode = require('./core/parsers/70-XML_page'); +var yamlNode = require('./core/parsers/70-YAML_page'); +var fileInNode = require('./core/storage/10-filein_page'); var nodeCatalog = { - // input + // common "inject": injectNode, - "httpin": httpinNode, - "mqttIn":mqttInNode, - // output "debug": debugNode, - "httpResponse": httpResponseNode, - "mqttOut": mqttOutNode, + "complete": completeNode, + "catch": catchNode, + "status": statusNode, + "comment": commentNode, // function "function": functionNode, - "template": templateNode, "change": changeNode, "range": rangeNode, + "template": templateNode, + "delay": delayNode, + // network + "mqttIn": mqttInNode, + "mqttOut": mqttOutNode, + "httpIn": httpInNode, + "httpResponse": httpResponseNode, "httpRequest": httpRequestNode, + // sequence + "split": splitNode, + "join": joinNode, + "batch": batchNode, + // parser + "csv": csvNode, "html": htmlNode, - "json":jsonNode, + "json": jsonNode, + "xml": xmlNode, + "yaml": yamlNode, // storage - "filein": fileinNode, -} + "fileIn": fileInNode +}; function create(type, id) { - var node = nodeCatalog[type]; - return new node(id); + var Node = nodeCatalog[type]; + return new Node(id); } module.exports = { diff --git a/test/editor/pageobjects/util/key_page.js b/test/editor/pageobjects/util/key_page.js index 9a8a867b4..497a8a141 100644 --- a/test/editor/pageobjects/util/key_page.js +++ b/test/editor/pageobjects/util/key_page.js @@ -17,21 +17,26 @@ var os = require("os"); var shortCutKeyMap = { - "selectAll": ['Control', 'a', 'Control'], + "selectAll": ['Control', 'a', 'a', 'Control'], "selectToEnd": ['Control', 'Shift', 'End', 'Shift', 'Control'], }; var shortCutKeyMapForMac = { - "selectAll": ['Command', 'a', 'Command'], + "selectAll": ['Command', 'a', 'a', 'Command'], "selectToEnd": ['Command', 'Shift', 'ArrowDown', 'Shift', 'Command'], }; function getShortCutKey(type) { - if (os.type() === "Darwin") { - return shortCutKeyMapForMac[type]; - } else { + if (process.env.BROWSERSTACK) { + if (browser.desiredCapabilities.os === 'OS X') { + return shortCutKeyMapForMac[type]; + } return shortCutKeyMap[type]; } + if (os.type() === 'Darwin') { + return shortCutKeyMapForMac[type]; + } + return shortCutKeyMap[type]; } function selectAll() { diff --git a/test/editor/specs/editor/workspace_uispec.js b/test/editor/specs/editor/workspace_uispec.js index fb6c02b9a..15de1a044 100644 --- a/test/editor/specs/editor/workspace_uispec.js +++ b/test/editor/specs/editor/workspace_uispec.js @@ -37,7 +37,7 @@ describe('Workspace', function() { }); it('should have a right title', function () { - browser.getTitle().should.equal('Node-RED'); + browser.getTitle().should.startWith('Node-RED'); }); it('should output a timestamp', function() { diff --git a/test/editor/specs/scenario/cookbook_dataformats_uispec.js b/test/editor/specs/scenario/cookbook_dataformats_uispec.js new file mode 100644 index 000000000..23bb4fb1b --- /dev/null +++ b/test/editor/specs/scenario/cookbook_dataformats_uispec.js @@ -0,0 +1,364 @@ +/** + * Copyright JS Foundation and other contributors, http://js.foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ + +var when = require('when'); +var should = require('should'); +var fs = require('fs-extra'); + +var helper = require('../../editor_helper'); +var debugTab = require('../../pageobjects/editor/debugTab_page'); +var workspace = require('../../pageobjects/editor/workspace_page'); +var specUtil = require('../../pageobjects/util/spec_util_page'); + +var httpNodeRoot = '/api'; + +// https://cookbook.nodered.org/ +describe('cookbook', function () { + beforeEach(function () { + workspace.init(); + }); + + before(function () { + helper.startServer(); + }); + + after(function () { + helper.stopServer(); + }); + + describe('working with data formats', function () { + it('convert to/from JSON', function () { + var injectNode1 = workspace.addNode('inject'); + var jsonNode1 = workspace.addNode('json'); + var debugNode1 = workspace.addNode('debug'); + + injectNode1.edit(); + injectNode1.setPayload('str', '{"a":1}'); + injectNode1.clickOk(); + + jsonNode1.edit(); + jsonNode1.setProperty('payload'); + jsonNode1.clickOk(); + + injectNode1.connect(jsonNode1); + jsonNode1.connect(debugNode1); + + var injectNode2 = workspace.addNode('inject'); + var jsonNode2 = workspace.addNode('json'); + var debugNode2 = workspace.addNode('debug'); + + injectNode2.edit(); + injectNode2.setPayload('json', '{"a":1}'); + injectNode2.clickOk(); + + jsonNode2.edit(); + jsonNode2.setProperty('payload'); + jsonNode2.clickOk(); + + injectNode2.connect(jsonNode2); + jsonNode2.connect(debugNode2); + + workspace.deploy(); + + debugTab.open(); + injectNode1.clickLeftButton(); + debugTab.getMessage().should.eql('1'); + debugTab.clearMessage(); + injectNode2.clickLeftButton(); + debugTab.getMessage().should.eql('"{"a":1}"'); + }); + + it('convert to/from XML', function () { + var injectNode1 = workspace.addNode('inject', 0); + var templateNode1 = workspace.addNode('template', 200); + var xmlNode1 = workspace.addNode('xml', 400); + var debugNode1 = workspace.addNode('debug', 600); + + injectNode1.edit(); + injectNode1.setPayload('str', '{"a":1}'); + injectNode1.clickOk(); + + templateNode1.edit(); + templateNode1.setFormat('text'); + templateNode1.setSyntax('plain'); + templateNode1.setTemplate('' + + ' Nick' + + ' Dave' + + ' Reminder' + + ' Update the website' + + ''); + templateNode1.clickOk(); + + xmlNode1.edit(); + xmlNode1.setProperty('payload'); + xmlNode1.clickOk(); + + injectNode1.connect(templateNode1); + templateNode1.connect(xmlNode1); + xmlNode1.connect(debugNode1); + + var injectNode2 = workspace.addNode('inject'); + var xmlNode2 = workspace.addNode('xml'); + var debugNode2 = workspace.addNode('debug'); + + injectNode2.edit(); + injectNode2.setPayload('json', '{' + + ' "note": {' + + ' "$": { "priority": "high" },' + + ' "to": [ "Nick" ],' + + ' "from": [ "Dave" ],' + + ' "heading": [ "Reminder" ],' + + ' "body": [ "Update the website" ]' + + ' }' + + '}'); + injectNode2.clickOk(); + + xmlNode2.edit(); + xmlNode2.setProperty('payload'); + xmlNode2.clickOk(); + + injectNode2.connect(xmlNode2); + xmlNode2.connect(debugNode2); + + workspace.deploy(); + + debugTab.open(); + injectNode1.clickLeftButton(); + debugTab.getMessage().should.eql('object'); + debugTab.clearMessage(); + injectNode2.clickLeftButton(); + debugTab.getMessage().should.eql('"' + + '' + + 'Nick' + + 'Dave' + + 'Reminder' + + 'Update the website' + + '"'); + }); + + it('convert to/from YAML', function () { + var injectNode1 = workspace.addNode('inject', 0); + var templateNode1 = workspace.addNode('template', 200); + var yamlNode1 = workspace.addNode('yaml', 400); + var debugNode1 = workspace.addNode('debug', 600); + + injectNode1.edit(); + injectNode1.setPayload('str', '{"a":1}'); + injectNode1.clickOk(); + + templateNode1.edit(); + templateNode1.setFormat('yaml'); + templateNode1.setSyntax('plain'); + templateNode1.setTemplate('a: 1\n' + + 'b:\n' + + ' - 1\n' + + '- 2\n' + + '- 3'); + templateNode1.clickOk(); + + yamlNode1.edit(); + yamlNode1.setProperty('payload'); + yamlNode1.clickOk(); + + injectNode1.connect(templateNode1); + templateNode1.connect(yamlNode1); + yamlNode1.connect(debugNode1); + + var injectNode2 = workspace.addNode('inject'); + var yamlNode2 = workspace.addNode('yaml'); + var debugNode2 = workspace.addNode('debug'); + + injectNode2.edit(); + injectNode2.setPayload('json', '{"a":1, "b":[1,2,3]}'); + injectNode2.clickOk(); + + yamlNode2.edit(); + yamlNode2.setProperty('payload'); + yamlNode2.clickOk(); + + injectNode2.connect(yamlNode2); + yamlNode2.connect(debugNode2); + + workspace.deploy(); + + debugTab.open(); + injectNode1.clickLeftButton(); + debugTab.getMessage().should.eql([ '1', 'array[3]' ]); + debugTab.clearMessage(); + injectNode2.clickLeftButton(); + debugTab.getMessage().should.eql('"a: 1↵b:↵ - 1↵ - 2↵ - 3↵"'); + }); + + it('generate CSV output', function () { + var injectNode1 = workspace.addNode('inject', 0); + var changeNode1 = workspace.addNode('change', 200); + var csvNode1 = workspace.addNode('csv', 400); + var debugNode1 = workspace.addNode('debug', 600); + + changeNode1.edit(); + changeNode1.ruleSet('payload', 'msg', '{' + + ' "a": $floor(100*$random()),' + + ' "b": $floor(100*$random()),' + + ' "c": $floor(100*$random())' + + '}', 'jsonata'); + changeNode1.clickOk(); + + csvNode1.edit(); + csvNode1.setColumns('a,b,c'); + csvNode1.clickOk(); + + injectNode1.connect(changeNode1); + changeNode1.connect(csvNode1); + csvNode1.connect(debugNode1); + + var injectNode2 = workspace.addNode('inject', 0, 80); + var changeNode2 = workspace.addNode('change', 200, 80); + var csvNode2 = workspace.addNode('csv', 400, 80); + var debugNode2 = workspace.addNode('debug', 600, 80); + + changeNode2.edit(); + changeNode2.ruleSet('payload', 'msg', '[' + + ' {' + + ' "a": $floor(100*$random()),' + + ' "b": $floor(100*$random()),' + + ' "c": $floor(100*$random())' + + ' }, {' + + ' "a": $floor(100*$random()),' + + ' "b": $floor(100*$random()),' + + ' "c": $floor(100*$random())' + + ' }, {' + + ' "a": $floor(100*$random()),' + + ' "b": $floor(100*$random()),' + + ' "c": $floor(100*$random())' + + ' }, {' + + ' "a": $floor(100*$random()),' + + ' "b": $floor(100*$random()),' + + ' "c": $floor(100*$random())' + + ' }' + + ']', 'jsonata'); + changeNode2.clickOk(); + + csvNode2.edit(); + csvNode2.setColumns('a,b,c'); + csvNode2.setIncludeRow(true); + csvNode2.clickOk(); + + injectNode2.connect(changeNode2); + changeNode2.connect(csvNode2); + csvNode2.connect(debugNode2); + + workspace.deploy(); + + debugTab.open(); + injectNode1.clickLeftButton(); + debugTab.getMessage().should.match(/^"([1-9]?[0-9],){2}[1-9]?[0-9]↵"$/); + debugTab.clearMessage(); + injectNode2.clickLeftButton(); + debugTab.getMessage().should.match(/^"a,b,c↵(([1-9]?[0-9],){2}[1-9]?[0-9]↵){4}"$/); + }); + + it('parse CSV input', function () { + var injectNode = workspace.addNode('inject'); + var templateNode = workspace.addNode('template'); + var csvNode = workspace.addNode('csv'); + var debugNode = workspace.addNode('debug'); + + templateNode.edit(); + templateNode.setFormat('handlebars'); + templateNode.setSyntax('mustache'); + templateNode.setTemplate('# This is some random data\n' + + 'a,b,c\n' + + '80,18,2\n' + + '52,36,10\n' + + '91,18,61\n' + + '32,47,65'); + templateNode.clickOk(); + + csvNode.edit(); + csvNode.setSkipLines(1); + csvNode.setFirstRow4Names(true); + csvNode.setOutput('mult'); + csvNode.clickOk(); + + injectNode.connect(templateNode); + templateNode.connect(csvNode); + csvNode.connect(debugNode); + + workspace.deploy(); + + debugTab.open(); + injectNode.clickLeftButton(); + debugTab.getMessage().should.eql([ 'object', 'object', 'object', 'object' ]); + }); + + it('simple GET request', function () { + var injectNode = workspace.addNode('inject'); + var httpRequestNode = workspace.addNode('httpRequest'); + var htmlNode = workspace.addNode('html'); + var debugNode = workspace.addNode('debug'); + + httpRequestNode.edit(); + httpRequestNode.setMethod('GET'); + httpRequestNode.setUrl('https://nodered.org'); + httpRequestNode.clickOk(); + + htmlNode.edit(); + htmlNode.setSelector('.node-red-latest-version'); + htmlNode.clickOk(); + + injectNode.connect(httpRequestNode); + httpRequestNode.connect(htmlNode); + htmlNode.connect(debugNode); + + workspace.deploy(); + + debugTab.open(); + injectNode.clickLeftButton(); + debugTab.getMessage().should.match(/^"v[0-9]+\.[0-9]+\.[0-9]"$/); + }); + + it('split text into one message per line', function () { + var injectNode = workspace.addNode('inject'); + var templateNode = workspace.addNode('template'); + var splitNode = workspace.addNode('split'); + var changeNode = workspace.addNode('change'); + var joinNode = workspace.addNode('join'); + var debugNode = workspace.addNode('debug'); + + templateNode.edit(); + templateNode.setFormat('handlebars'); + templateNode.setSyntax('mustache'); + templateNode.setTemplate('one\ntwo\nthree\nfour\nfive'); + templateNode.clickOk(); + + changeNode.edit(); + changeNode.ruleSet('payload', 'msg', '(parts.index+1) & ": " & payload', 'jsonata'); + changeNode.clickOk(); + + injectNode.connect(templateNode); + templateNode.connect(splitNode); + splitNode.connect(changeNode); + changeNode.connect(joinNode); + joinNode.connect(debugNode); + + workspace.deploy(); + + debugTab.open(); + injectNode.clickLeftButton(); + debugTab.getMessage().should.eql('"1: one↵2: two↵3: three↵4: four↵5: five"'); + }); + }); +}); diff --git a/test/editor/specs/scenario/cookbook_errorhandling_uispec.js b/test/editor/specs/scenario/cookbook_errorhandling_uispec.js new file mode 100644 index 000000000..5285c5c0f --- /dev/null +++ b/test/editor/specs/scenario/cookbook_errorhandling_uispec.js @@ -0,0 +1,74 @@ +/** + * Copyright JS Foundation and other contributors, http://js.foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ + +var when = require('when'); +var should = require('should'); +var fs = require('fs-extra'); + +var helper = require('../../editor_helper'); +var debugTab = require('../../pageobjects/editor/debugTab_page'); +var workspace = require('../../pageobjects/editor/workspace_page'); +var specUtil = require('../../pageobjects/util/spec_util_page'); + +var httpNodeRoot = '/api'; + +// https://cookbook.nodered.org/ +describe('cookbook', function () { + beforeEach(function () { + workspace.init(); + }); + + before(function () { + helper.startServer(); + }); + + after(function () { + helper.stopServer(); + }); + + describe('messages', function () { + it('trigger a flow when a node throws an error', function () { + var injectNode = workspace.addNode('inject'); + var functionNode = workspace.addNode('function'); + var catchNode = workspace.addNode('catch', 0 , 80); + var debugNode = workspace.addNode('debug'); + + functionNode.edit(); + functionNode.setFunction('node.error("an example error", msg);'); + functionNode.clickOk(); + + catchNode.edit(); + catchNode.setScope(functionNode); + catchNode.clickOk(); + + debugNode.edit(); + debugNode.setOutput('error'); + debugNode.clickOk(); + + injectNode.connect(functionNode); + catchNode.connect(debugNode); + + workspace.deploy(); + + debugTab.open(); + injectNode.clickLeftButton(); + debugTab.getMessage().should.eql(['"an example error"', 'function']); + }); + + // skip this case since the flow outputs random results. + it.skip('automatically retry an action after an error'); + }); +}); diff --git a/test/editor/specs/scenario/cookbook_flowcontrol_uispec.js b/test/editor/specs/scenario/cookbook_flowcontrol_uispec.js new file mode 100644 index 000000000..724d1c56f --- /dev/null +++ b/test/editor/specs/scenario/cookbook_flowcontrol_uispec.js @@ -0,0 +1,81 @@ +/** + * Copyright JS Foundation and other contributors, http://js.foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ + +var when = require('when'); +var should = require('should'); +var fs = require('fs-extra'); + +var helper = require('../../editor_helper'); +var debugTab = require('../../pageobjects/editor/debugTab_page'); +var workspace = require('../../pageobjects/editor/workspace_page'); +var specUtil = require('../../pageobjects/util/spec_util_page'); + +var httpNodeRoot = '/api'; + +// https://cookbook.nodered.org/ +describe('cookbook', function () { + beforeEach(function () { + workspace.init(); + }); + + before(function () { + helper.startServer(); + }); + + after(function () { + helper.stopServer(); + }); + + describe('flow control', function () { + it('trigger a flow whenever Node-RED starts', function () { + var injectNode = workspace.addNode('inject'); + var debugNode = workspace.addNode('debug'); + + injectNode.edit(); + injectNode.setPayload('str', 'Started!'); + injectNode.setOnce(true); + injectNode.clickOk(); + injectNode.connect(debugNode); + + debugTab.open(); + workspace.deploy(); + debugTab.getMessage().should.eql('"Started!"'); + }); + + it('trigger a flow at regular intervals', function () { + var injectNode = workspace.addNode('inject'); + var debugNode = workspace.addNode('debug'); + + injectNode.edit(); + injectNode.setRepeat('interval'); + injectNode.setRepeatInterval(1); + injectNode.clickOk(); + injectNode.connect(debugNode); + + workspace.deploy(); + + debugTab.open(); + specUtil.pause(1000); + var t1 = Number(debugTab.getMessage(1)); + t1.should.within(1500000000000, 3000000000000); + specUtil.pause(1000); + debugTab.getMessage(2).should.within(t1 + 900, 3000000000000); + }); + + // skip this case since it needs up to one minite. + it.skip('trigger a flow at a specific time'); + }); +}); diff --git a/test/editor/specs/scenario/cookbook_endpoint_uispec.js b/test/editor/specs/scenario/cookbook_httpendpoints_uispec.js similarity index 82% rename from test/editor/specs/scenario/cookbook_endpoint_uispec.js rename to test/editor/specs/scenario/cookbook_httpendpoints_uispec.js index 95b78d03c..134498370 100644 --- a/test/editor/specs/scenario/cookbook_endpoint_uispec.js +++ b/test/editor/specs/scenario/cookbook_httpendpoints_uispec.js @@ -23,29 +23,29 @@ var workspace = require('../../pageobjects/editor/workspace_page'); var httpNodeRoot = "/api"; // https://cookbook.nodered.org/ -describe('cookbook', function() { - beforeEach(function() { +describe('cookbook', function () { + beforeEach(function () { workspace.init(); }); - before(function() { + before(function () { helper.startServer(); }); - after(function() { + after(function () { helper.stopServer(); }); describe('HTTP endpoints', function () { it('create an HTTP endpoint', function () { - var httpinNode = workspace.addNode("httpin"); + var httpInNode = workspace.addNode("httpIn"); var templateNode = workspace.addNode("template"); var httpResponseNode = workspace.addNode("httpResponse"); - httpinNode.edit(); - httpinNode.setMethod("get"); - httpinNode.setUrl("/hello"); - httpinNode.clickOk(); + httpInNode.edit(); + httpInNode.setMethod("get"); + httpInNode.setUrl("/hello"); + httpInNode.clickOk(); templateNode.edit(); templateNode.setSyntax("mustache"); @@ -53,7 +53,7 @@ describe('cookbook', function() { templateNode.setTemplate("\n\n\n

Hello World!

\n\n"); templateNode.clickOk(); - httpinNode.connect(templateNode); + httpInNode.connect(templateNode); templateNode.connect(httpResponseNode); // The code for confirmation starts from here. @@ -77,14 +77,14 @@ describe('cookbook', function() { }); it('handle query parameters passed to an HTTP endpoint', function () { - var httpinNode = workspace.addNode("httpin"); + var httpInNode = workspace.addNode("httpIn"); var templateNode = workspace.addNode("template"); var httpResponseNode = workspace.addNode("httpResponse"); - httpinNode.edit(); - httpinNode.setMethod("get"); - httpinNode.setUrl("/hello-query"); - httpinNode.clickOk(); + httpInNode.edit(); + httpInNode.setMethod("get"); + httpInNode.setUrl("/hello-query"); + httpInNode.clickOk(); templateNode.edit(); templateNode.setSyntax("mustache"); @@ -92,7 +92,7 @@ describe('cookbook', function() { templateNode.setTemplate("\n\n\n

Hello {{req.query.name}}!

\n\n"); templateNode.clickOk(); - httpinNode.connect(templateNode); + httpInNode.connect(templateNode); templateNode.connect(httpResponseNode); // The code for confirmation starts from here. @@ -116,14 +116,14 @@ describe('cookbook', function() { }); it('handle url parameters in an HTTP endpoint', function () { - var httpinNode = workspace.addNode("httpin"); + var httpInNode = workspace.addNode("httpIn"); var templateNode = workspace.addNode("template"); var httpResponseNode = workspace.addNode("httpResponse"); - httpinNode.edit(); - httpinNode.setMethod("get"); - httpinNode.setUrl("/hello-param/:name"); - httpinNode.clickOk(); + httpInNode.edit(); + httpInNode.setMethod("get"); + httpInNode.setUrl("/hello-param/:name"); + httpInNode.clickOk(); templateNode.edit(); templateNode.setSyntax("mustache"); @@ -131,7 +131,7 @@ describe('cookbook', function() { templateNode.setTemplate("\n\n\n

Hello {{req.params.name}}!

\n\n"); templateNode.clickOk(); - httpinNode.connect(templateNode); + httpInNode.connect(templateNode); templateNode.connect(httpResponseNode); // The code for confirmation starts from here. @@ -155,14 +155,14 @@ describe('cookbook', function() { }); it('access HTTP request headers', function () { - var httpinNode = workspace.addNode("httpin"); + var httpInNode = workspace.addNode("httpIn"); var templateNode = workspace.addNode("template"); var httpResponseNode = workspace.addNode("httpResponse"); - httpinNode.edit(); - httpinNode.setMethod("get"); - httpinNode.setUrl("/hello-headers"); - httpinNode.clickOk(); + httpInNode.edit(); + httpInNode.setMethod("get"); + httpInNode.setUrl("/hello-headers"); + httpInNode.clickOk(); templateNode.edit(); templateNode.setSyntax("mustache"); @@ -170,7 +170,7 @@ describe('cookbook', function() { templateNode.setTemplate("\n\n\n

User agent: {{req.headers.user-agent}}

\n\n"); templateNode.clickOk(); - httpinNode.connect(templateNode); + httpInNode.connect(templateNode); templateNode.connect(httpResponseNode); // The code for confirmation starts from here. @@ -203,7 +203,7 @@ describe('cookbook', function() { var injectNodeTimestamp = workspace.addNode("inject"); var changeNodeStore = workspace.addNode("change"); - var httpinNode = workspace.addNode("httpin", 0, 100); + var httpInNode = workspace.addNode("httpIn", 0, 100); var changeNodeCopy = workspace.addNode("change"); var templateNode = workspace.addNode("template"); var httpResponseNode = workspace.addNode("httpResponse"); @@ -218,10 +218,10 @@ describe('cookbook', function() { injectNodeTimestamp.connect(changeNodeStore); - httpinNode.edit(); - httpinNode.setMethod("get"); - httpinNode.setUrl("/hello-data"); - httpinNode.clickOk(); + httpInNode.edit(); + httpInNode.setMethod("get"); + httpInNode.setUrl("/hello-data"); + httpInNode.clickOk(); changeNodeCopy.edit(); changeNodeCopy.ruleSet("timestamp", "msg", "timestamp", "flow"); @@ -233,7 +233,7 @@ describe('cookbook', function() { templateNode.setTemplate("\n\n\n

Time: {{ timestamp }}

\n\n"); templateNode.clickOk(); - httpinNode.connect(changeNodeCopy); + httpInNode.connect(changeNodeCopy); changeNodeCopy.connect(templateNode); templateNode.connect(httpResponseNode); @@ -260,15 +260,15 @@ describe('cookbook', function() { }); it('serve JSON content', function () { - var httpinNode = workspace.addNode("httpin"); + var httpInNode = workspace.addNode("httpIn"); var templateNode = workspace.addNode("template"); var changeNode = workspace.addNode("change"); var httpResponseNode = workspace.addNode("httpResponse"); - httpinNode.edit(); - httpinNode.setMethod("get"); - httpinNode.setUrl("/hello-json"); - httpinNode.clickOk(); + httpInNode.edit(); + httpInNode.setMethod("get"); + httpInNode.setUrl("/hello-json"); + httpInNode.clickOk(); templateNode.edit(); templateNode.setSyntax("mustache"); @@ -282,7 +282,7 @@ describe('cookbook', function() { changeNode.ruleSet("headers.content-type", "msg", "application/json", "str", "2"); changeNode.clickOk(); - httpinNode.connect(templateNode); + httpInNode.connect(templateNode); templateNode.connect(changeNode); changeNode.connect(httpResponseNode); @@ -314,20 +314,20 @@ describe('cookbook', function() { }); it('serve a local file', function () { - var httpinNode = workspace.addNode("httpin"); - var fileinNode = workspace.addNode("filein"); + var httpInNode = workspace.addNode("httpIn"); + var fileInNode = workspace.addNode("fileIn"); var changeNode = workspace.addNode("change", 200, 100); var httpResponseNode = workspace.addNode("httpResponse"); - httpinNode.edit(); - httpinNode.setMethod("get"); - httpinNode.setUrl("/hello-file"); - httpinNode.clickOk(); + httpInNode.edit(); + httpInNode.setMethod("get"); + httpInNode.setUrl("/hello-file"); + httpInNode.clickOk(); - fileinNode.edit(); - fileinNode.setFilename("test/resources/file-in-node/test.txt"); - fileinNode.setOutput(""); - fileinNode.clickOk(); + fileInNode.edit(); + fileInNode.setFilename("test/resources/file-in-node/test.txt"); + fileInNode.setOutput(""); + fileInNode.clickOk(); changeNode.edit(); changeNode.ruleSet("headers", "msg", "{}", "json"); @@ -335,8 +335,8 @@ describe('cookbook', function() { changeNode.ruleSet("headers.content-type", "msg", "text/plain", "str", "2"); changeNode.clickOk(); - httpinNode.connect(fileinNode); - fileinNode.connect(changeNode); + httpInNode.connect(fileInNode); + fileInNode.connect(changeNode); changeNode.connect(httpResponseNode); // The code for confirmation starts from here. @@ -359,15 +359,15 @@ describe('cookbook', function() { debugTab.getMessage().indexOf('Text file').should.not.eql(-1); }); - it('post raw data to a flow', function() { - var httpinNode = workspace.addNode("httpin"); + it('post raw data to a flow', function () { + var httpInNode = workspace.addNode("httpIn"); var templateNode = workspace.addNode("template"); var httpResponseNode = workspace.addNode("httpResponse"); - httpinNode.edit(); - httpinNode.setMethod("post"); - httpinNode.setUrl("/hello-raw"); - httpinNode.clickOk(); + httpInNode.edit(); + httpInNode.setMethod("post"); + httpInNode.setUrl("/hello-raw"); + httpInNode.clickOk(); templateNode.edit(); templateNode.setSyntax("mustache"); @@ -375,7 +375,7 @@ describe('cookbook', function() { templateNode.setTemplate("\n\n\n

Hello {{ payload }}!

\n\n"); templateNode.clickOk(); - httpinNode.connect(templateNode); + httpInNode.connect(templateNode); templateNode.connect(httpResponseNode); // The code for confirmation starts from here. @@ -383,7 +383,7 @@ describe('cookbook', function() { var httpRequestNode = workspace.addNode("httpRequest"); var debugNode = workspace.addNode("debug"); - injectNode.edit() + injectNode.edit(); injectNode.setPayload("str", "Nick"); injectNode.clickOk(); @@ -403,14 +403,14 @@ describe('cookbook', function() { }); it('post form data to a flow', function () { - var httpinNode = workspace.addNode("httpin"); + var httpInNode = workspace.addNode("httpIn"); var templateNode = workspace.addNode("template"); var httpResponseNode = workspace.addNode("httpResponse"); - httpinNode.edit(); - httpinNode.setMethod("post"); - httpinNode.setUrl("/hello-form"); - httpinNode.clickOk(); + httpInNode.edit(); + httpInNode.setMethod("post"); + httpInNode.setUrl("/hello-form"); + httpInNode.clickOk(); templateNode.edit(); templateNode.setSyntax("mustache"); @@ -418,7 +418,7 @@ describe('cookbook', function() { templateNode.setTemplate("\n\n\n

Hello {{ payload.name }}!

\n\n"); templateNode.clickOk(); - httpinNode.connect(templateNode); + httpInNode.connect(templateNode); templateNode.connect(httpResponseNode); // The code for confirmation starts from here. @@ -427,7 +427,7 @@ describe('cookbook', function() { var httpRequestNode = workspace.addNode("httpRequest"); var debugNode = workspace.addNode("debug"); - injectNode.edit() + injectNode.edit(); injectNode.setPayload("str", "name=Nick"); injectNode.clickOk(); @@ -451,15 +451,15 @@ describe('cookbook', function() { debugTab.getMessage().indexOf('Hello Nick!').should.not.eql(-1); }); - it('post JSON data to a flow', function() { - var httpinNode = workspace.addNode("httpin"); + it('post JSON data to a flow', function () { + var httpInNode = workspace.addNode("httpIn"); var templateNode = workspace.addNode("template"); var httpResponseNode = workspace.addNode("httpResponse"); - httpinNode.edit(); - httpinNode.setMethod("post"); - httpinNode.setUrl("/hello-json"); - httpinNode.clickOk(); + httpInNode.edit(); + httpInNode.setMethod("post"); + httpInNode.setUrl("/hello-json"); + httpInNode.clickOk(); templateNode.edit(); templateNode.setSyntax("mustache"); @@ -467,7 +467,7 @@ describe('cookbook', function() { templateNode.setTemplate("\n\n\n

Hello {{ payload.name }}!

\n\n"); templateNode.clickOk(); - httpinNode.connect(templateNode); + httpInNode.connect(templateNode); templateNode.connect(httpResponseNode); // The code for confirmation starts from here. @@ -476,7 +476,7 @@ describe('cookbook', function() { var httpRequestNode = workspace.addNode("httpRequest"); var debugNode = workspace.addNode("debug"); - injectNode.edit() + injectNode.edit(); injectNode.setPayload("json", '{"name":"Nick"}'); injectNode.clickOk(); @@ -501,24 +501,22 @@ describe('cookbook', function() { }); it('work with cookies', function () { - this.timeout(60000); - - var httpinNodeFormat = workspace.addNode("httpin"); + var httpInNodeFormat = workspace.addNode("httpIn"); var functionNodeFormat = workspace.addNode("function", 240); var templateNode = workspace.addNode("template", 400); var httpResponseNode = workspace.addNode("httpResponse", 600); - var httpinNodeAdd = workspace.addNode("httpin", 0, 100); + var httpInNodeAdd = workspace.addNode("httpIn", 0, 100); var functionNodeAdd = workspace.addNode("function", 240); var changeNode = workspace.addNode("change", 400); - var httpinNodeClear = workspace.addNode("httpin", 0, 200); + var httpInNodeClear = workspace.addNode("httpIn", 0, 200); var functionNodeClear = workspace.addNode("function", 250); - httpinNodeFormat.edit(); - httpinNodeFormat.setMethod("get"); - httpinNodeFormat.setUrl("/hello-cookie"); - httpinNodeFormat.clickOk(); + httpInNodeFormat.edit(); + httpInNodeFormat.setMethod("get"); + httpInNodeFormat.setUrl("/hello-cookie"); + httpInNodeFormat.clickOk(); functionNodeFormat.edit(); functionNodeFormat.setFunction("msg.payload = JSON.stringify(msg.req.cookies,null,4);\nreturn msg;"); @@ -530,14 +528,14 @@ describe('cookbook', function() { templateNode.setTemplate('\n\n\n

Cookies

\n

Add a cookieClear cookies

\n
{{ payload }}
\n\n'); templateNode.clickOk(); - httpinNodeFormat.connect(functionNodeFormat); + httpInNodeFormat.connect(functionNodeFormat); functionNodeFormat.connect(templateNode); templateNode.connect(httpResponseNode); - httpinNodeAdd.edit(); - httpinNodeAdd.setMethod("get"); - httpinNodeAdd.setUrl("/hello-cookie/add"); - httpinNodeAdd.clickOk(); + httpInNodeAdd.edit(); + httpInNodeAdd.setMethod("get"); + httpInNodeAdd.setUrl("/hello-cookie/add"); + httpInNodeAdd.clickOk(); functionNodeAdd.edit(); functionNodeAdd.setFunction('msg.cookies = { };\n msg.cookies["demo-"+(Math.floor(Math.random()*1000))] = Date.now();\nreturn msg;'); @@ -551,20 +549,20 @@ describe('cookbook', function() { changeNode.ruleSet("headers.location", "msg", httpNodeRoot + "/hello-cookie", "str", "3"); changeNode.clickOk(); - httpinNodeAdd.connect(functionNodeAdd); + httpInNodeAdd.connect(functionNodeAdd); functionNodeAdd.connect(changeNode); changeNode.connect(httpResponseNode); - httpinNodeClear.edit(); - httpinNodeClear.setMethod("get"); - httpinNodeClear.setUrl("/hello-cookie/clear"); - httpinNodeClear.clickOk(); + httpInNodeClear.edit(); + httpInNodeClear.setMethod("get"); + httpInNodeClear.setUrl("/hello-cookie/clear"); + httpInNodeClear.clickOk(); functionNodeClear.edit(); functionNodeClear.setFunction("var cookieNames = Object.keys(msg.req.cookies).filter(function(cookieName) { return /^demo-/.test(cookieName);});\nmsg.cookies = {};\n\ncookieNames.forEach(function(cookieName) {\n msg.cookies[cookieName] = null;\n});\nreturn msg;\n"); functionNodeClear.clickOk(); - httpinNodeClear.connect(functionNodeClear); + httpInNodeClear.connect(functionNodeClear); functionNodeClear.connect(changeNode); workspace.deploy(); diff --git a/test/editor/specs/scenario/cookbook_httprequests_uispec.js b/test/editor/specs/scenario/cookbook_httprequests_uispec.js new file mode 100644 index 000000000..797b06041 --- /dev/null +++ b/test/editor/specs/scenario/cookbook_httprequests_uispec.js @@ -0,0 +1,300 @@ +/** + * Copyright JS Foundation and other contributors, http://js.foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ + +var when = require('when'); +var should = require('should'); +var fs = require('fs-extra'); + +var helper = require('../../editor_helper'); +var debugTab = require('../../pageobjects/editor/debugTab_page'); +var workspace = require('../../pageobjects/editor/workspace_page'); +var specUtil = require('../../pageobjects/util/spec_util_page'); + +var httpNodeRoot = '/api'; + +// https://cookbook.nodered.org/ +describe('cookbook', function () { + beforeEach(function () { + workspace.init(); + }); + + before(function () { + helper.startServer(); + }); + + after(function () { + helper.stopServer(); + }); + + describe('HTTP requests', function () { + it('simple get request', function () { + var injectNode = workspace.addNode('inject'); + var httpRequestNode = workspace.addNode('httpRequest'); + var htmlNode = workspace.addNode('html'); + var debugNode = workspace.addNode('debug'); + + httpRequestNode.edit(); + httpRequestNode.setMethod('GET'); + httpRequestNode.setUrl(helper.url()); + httpRequestNode.clickOk(); + + htmlNode.edit(); + htmlNode.setSelector('title'); + htmlNode.clickOk(); + + injectNode.connect(httpRequestNode); + httpRequestNode.connect(htmlNode); + htmlNode.connect(debugNode); + + workspace.deploy(); + + debugTab.open(); + injectNode.clickLeftButton(); + debugTab.getMessage().should.eql('"Node-RED"'); + }); + + it('set the URL of a request', function () { + var injectNode = workspace.addNode('inject'); + var changeNode = workspace.addNode('change'); + var httpRequestNode = workspace.addNode('httpRequest'); + var debugNode = workspace.addNode('debug'); + + injectNode.edit(); + injectNode.setPayload('str', helper.url()); + injectNode.clickOk(); + + changeNode.edit(); + changeNode.ruleSet('url', 'msg', 'payload', 'msg'); + changeNode.clickOk(); + + injectNode.connect(changeNode); + changeNode.connect(httpRequestNode); + httpRequestNode.connect(debugNode); + + workspace.deploy(); + + debugTab.open(); + injectNode.clickLeftButton(); + debugTab.getMessage().should.containEql('Node-RED'); + }); + + it('set the URL of a request using a template', function () { + var injectNode = workspace.addNode('inject'); + var changeNode = workspace.addNode('change'); + var httpRequestNode = workspace.addNode('httpRequest'); + var debugNode = workspace.addNode('debug'); + + injectNode.edit(); + injectNode.setPayload('str', 'settings'); + injectNode.clickOk(); + + changeNode.edit(); + changeNode.ruleSet('query', 'msg', 'payload', 'msg'); + changeNode.clickOk(); + + httpRequestNode.edit(); + httpRequestNode.setUrl(helper.url() + '/{{{query}}}'); + httpRequestNode.clickOk(); + + injectNode.connect(changeNode); + changeNode.connect(httpRequestNode); + httpRequestNode.connect(debugNode); + + workspace.deploy(); + + debugTab.open(); + injectNode.clickLeftButton(); + debugTab.getMessage().should.containEql('httpNodeRoot'); + }); + + it('set the query string parameters', function () { + var injectNode = workspace.addNode('inject'); + var changeNode = workspace.addNode('change'); + var httpRequestNode = workspace.addNode('httpRequest'); + var debugNode = workspace.addNode('debug'); + + injectNode.edit(); + injectNode.setPayload('str', 'Nick'); + injectNode.clickOk(); + + changeNode.edit(); + changeNode.ruleSet('query', 'msg', 'payload', 'msg'); + changeNode.clickOk(); + + httpRequestNode.edit(); + httpRequestNode.setUrl(helper.url() + httpNodeRoot + '/set-query?q={{{query}}}'); + httpRequestNode.clickOk(); + + injectNode.connect(changeNode); + changeNode.connect(httpRequestNode); + httpRequestNode.connect(debugNode); + + // The code for confirmation starts from here. + var httpInNode = workspace.addNode('httpIn', 0, 200); + var templateNode = workspace.addNode('template'); + var httpResponseNode = workspace.addNode('httpResponse'); + + httpInNode.edit(); + httpInNode.setMethod('get'); + httpInNode.setUrl('/set-query'); + httpInNode.clickOk(); + + templateNode.edit(); + templateNode.setSyntax('mustache'); + templateNode.setFormat('handlebars'); + templateNode.setTemplate('Hello {{req.query.q}}'); + templateNode.clickOk(); + + httpInNode.connect(templateNode); + templateNode.connect(httpResponseNode); + // The code for confirmation ends here. + + workspace.deploy(); + debugTab.open(); + injectNode.clickLeftButton(); + debugTab.getMessage().should.eql('"Hello Nick"'); + }); + + it('get a parsed JSON response', function () { + var injectNode = workspace.addNode('inject'); + var changeNodeSetPost = workspace.addNode('change'); + var httpRequestNode = workspace.addNode('httpRequest'); + var debugNode = workspace.addNode('debug'); + + injectNode.edit(); + injectNode.setPayload('str', 'json-response'); + injectNode.clickOk(); + + changeNodeSetPost.edit(); + changeNodeSetPost.ruleSet('post', 'msg', 'payload', 'msg'); + changeNodeSetPost.clickOk(); + + httpRequestNode.edit(); + httpRequestNode.setMethod('GET'); + var url = helper.url() + httpNodeRoot + '/{{post}}'; + httpRequestNode.setUrl(url); + httpRequestNode.setReturn('obj'); + httpRequestNode.clickOk(); + + debugNode.edit(); + debugNode.setOutput('payload.title'); + debugNode.clickOk(); + + injectNode.connect(changeNodeSetPost); + changeNodeSetPost.connect(httpRequestNode); + httpRequestNode.connect(debugNode); + + // The code for confirmation starts from here. + var httpInNode = workspace.addNode('httpIn', 0, 200); + var templateNode = workspace.addNode('template'); + var changeNodeSetHeader = workspace.addNode('change'); + var httpResponseNode = workspace.addNode('httpResponse'); + + httpInNode.edit(); + httpInNode.setMethod('get'); + httpInNode.setUrl('/json-response'); + httpInNode.clickOk(); + + templateNode.edit(); + templateNode.setSyntax('mustache'); + templateNode.setFormat('handlebars'); + templateNode.setTemplate('{"title": "Hello"}'); + templateNode.clickOk(); + + changeNodeSetHeader.edit(); + changeNodeSetHeader.ruleSet('headers', 'msg', '{"content-type":"application/json"}', 'json'); + changeNodeSetHeader.clickOk(); + + httpInNode.connect(templateNode); + templateNode.connect(changeNodeSetHeader); + changeNodeSetHeader.connect(httpResponseNode); + // The code for confirmation ends here. + + workspace.deploy(); + debugTab.open(); + injectNode.clickLeftButton(); + debugTab.getMessage().should.eql('"Hello"'); + }); + + it('get a binary response', function () { + var injectNode = workspace.addNode('inject'); + var httpRequestNode = workspace.addNode('httpRequest'); + var debugNode = workspace.addNode('debug'); + + httpRequestNode.edit(); + httpRequestNode.setMethod('GET'); + httpRequestNode.setUrl(helper.url() + '/settings'); + httpRequestNode.setReturn('bin'); + httpRequestNode.clickOk(); + + injectNode.connect(httpRequestNode); + httpRequestNode.connect(debugNode); + + workspace.deploy(); + + debugTab.open(); + injectNode.clickLeftButton(); + + debugTab.getMessage().should.eql(['123', '34', '104', '116', '116', '112', '78', '111', '100', '101']); + }); + + it('set a request header', function () { + var injectNode = workspace.addNode('inject'); + var functionNode = workspace.addNode('function'); + var httpRequestNode = workspace.addNode('httpRequest'); + var debugNode = workspace.addNode('debug'); + + functionNode.edit(); + functionNode.setFunction('msg.payload = "data to post";\nreturn msg;'); + functionNode.clickOk(); + + httpRequestNode.edit(); + httpRequestNode.setMethod('POST'); + var url = helper.url() + httpNodeRoot + '/set-header'; + httpRequestNode.setUrl(url); + httpRequestNode.clickOk(); + + injectNode.connect(functionNode); + functionNode.connect(httpRequestNode); + httpRequestNode.connect(debugNode); + + // The code for confirmation starts from here. + var httpInNode = workspace.addNode('httpIn', 0, 200); + var templateNode = workspace.addNode('template'); + var httpResponseNode = workspace.addNode('httpResponse'); + + httpInNode.edit(); + httpInNode.setMethod('post'); + httpInNode.setUrl('/set-header'); + httpInNode.clickOk(); + + templateNode.edit(); + templateNode.setSyntax('mustache'); + templateNode.setFormat('handlebars'); + templateNode.setTemplate('{{ payload }}'); + templateNode.clickOk(); + + httpInNode.connect(templateNode); + templateNode.connect(httpResponseNode); + // The code for confirmation ends here. + + workspace.deploy(); + debugTab.open(); + injectNode.clickLeftButton(); + debugTab.getMessage().should.eql('"data to post"'); + }); + }); +}); diff --git a/test/editor/specs/scenario/cookbook_messages_uispec.js b/test/editor/specs/scenario/cookbook_messages_uispec.js new file mode 100644 index 000000000..a9465e5d8 --- /dev/null +++ b/test/editor/specs/scenario/cookbook_messages_uispec.js @@ -0,0 +1,142 @@ +/** + * Copyright JS Foundation and other contributors, http://js.foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ + +var when = require('when'); +var should = require('should'); +var fs = require('fs-extra'); + +var helper = require('../../editor_helper'); +var debugTab = require('../../pageobjects/editor/debugTab_page'); +var workspace = require('../../pageobjects/editor/workspace_page'); +var specUtil = require('../../pageobjects/util/spec_util_page'); + +var httpNodeRoot = '/api'; + +// https://cookbook.nodered.org/ +describe('cookbook', function () { + beforeEach(function () { + workspace.init(); + }); + + before(function () { + helper.startServer(); + }); + + after(function () { + helper.stopServer(); + }); + + describe('messages', function () { + it('set a message property to a fixed value', function () { + var injectNode = workspace.addNode('inject'); + var changeNode = workspace.addNode('change'); + var debugNode = workspace.addNode('debug'); + + changeNode.edit(); + changeNode.ruleSet('payload', 'msg', 'Hello World!'); + changeNode.clickOk(); + + injectNode.connect(changeNode); + changeNode.connect(debugNode); + + workspace.deploy(); + + debugTab.open(); + injectNode.clickLeftButton(); + debugTab.getMessage().should.eql('"Hello World!"'); + }); + + it('delete a message property', function () { + var injectNode = workspace.addNode('inject'); + var changeNode = workspace.addNode('change'); + var debugNode = workspace.addNode('debug'); + + changeNode.edit(); + changeNode.ruleDelete(); + changeNode.clickOk(); + + injectNode.connect(changeNode); + changeNode.connect(debugNode); + + workspace.deploy(); + + debugTab.open(); + injectNode.clickLeftButton(); + debugTab.getMessage().should.eql('undefined'); + }); + + it('move a message property', function () { + var injectNode = workspace.addNode('inject'); + var changeNode = workspace.addNode('change'); + var debugNode = workspace.addNode('debug'); + + injectNode.edit(); + injectNode.setTopic('Hello'); + injectNode.clickOk(); + + changeNode.edit(); + changeNode.ruleMove('topic', 'payload'); + changeNode.clickOk(); + + injectNode.connect(changeNode); + changeNode.connect(debugNode); + + workspace.deploy(); + + debugTab.open(); + injectNode.clickLeftButton(); + debugTab.getMessage().should.eql('"Hello"'); + }); + + it('map a property between different numeric ranges', function () { + var injectNode1 = workspace.addNode('inject'); + var injectNode2 = workspace.addNode('inject', 0, 100); + var injectNode3 = workspace.addNode('inject', 0, 200); + var rangeNode = workspace.addNode('range', 200, 100); + var debugNode = workspace.addNode('debug', 400); + + injectNode1.edit(); + injectNode1.setPayload('num', 0); + injectNode1.clickOk(); + injectNode2.edit(); + injectNode2.setPayload('num', 512); + injectNode2.clickOk(); + injectNode3.edit(); + injectNode3.setPayload('num', 1023); + injectNode3.clickOk(); + + rangeNode.edit(); + rangeNode.setAction('clamp'); + rangeNode.setRange(0, 1023, 0, 5); + rangeNode.clickOk(); + + injectNode1.connect(rangeNode); + injectNode2.connect(rangeNode); + injectNode3.connect(rangeNode); + rangeNode.connect(debugNode); + + workspace.deploy(); + + debugTab.open(); + injectNode1.clickLeftButton(); + debugTab.getMessage(1).should.eql('0'); + injectNode2.clickLeftButton(); + debugTab.getMessage(2).should.eql('2.5024437927663734'); + injectNode3.clickLeftButton(); + debugTab.getMessage(3).should.eql('5'); + }); + }); +}); diff --git a/test/editor/specs/scenario/cookbook_mqtt_uispec.js b/test/editor/specs/scenario/cookbook_mqtt_uispec.js index ecfe8da7d..655074750 100644 --- a/test/editor/specs/scenario/cookbook_mqtt_uispec.js +++ b/test/editor/specs/scenario/cookbook_mqtt_uispec.js @@ -22,42 +22,45 @@ var helper = require("../../editor_helper"); var debugTab = require('../../pageobjects/editor/debugTab_page'); var workspace = require('../../pageobjects/editor/workspace_page'); var specUtil = require('../../pageobjects/util/spec_util_page'); -var mqttConfig = require('../../pageobjects/nodes/core/io/10-mqttconfig_page.js'); +var mqttConfig = require('../../pageobjects/nodes/core/network/10-mqttconfig_page.js'); var httpNodeRoot = "/api"; var mqttServer; var mosca = require('mosca'); var moscaSettings = { - port: 1883, + port: parseInt(Math.random() * 16383 + 49152), persistence: { // Needs for retaining messages. factory: mosca.persistence.Memory } }; - // https://cookbook.nodered.org/ -describe('cookbook', function() { - beforeEach(function() { +describe('cookbook', function () { + beforeEach(function () { workspace.init(); }); - before(function() { - browser.call(function() { - return new Promise(function(resolve, reject) { - mqttServer = new mosca.Server(moscaSettings, function() { - resolve(); + before(function () { + browser.call(function () { + return new Promise(function (resolve, reject) { + mqttServer = new mosca.Server(moscaSettings, function (err) { + if (err) { + reject(err); + } else { + resolve(); + } }); }); }); helper.startServer(); }); - after(function() { - browser.call(function() { - return new Promise(function(resolve, reject) { - mqttServer.close(function() { + after(function () { + browser.call(function () { + return new Promise(function (resolve, reject) { + mqttServer.close(function () { resolve(); }); }); @@ -65,20 +68,20 @@ describe('cookbook', function() { helper.stopServer(); }); - describe('MQTT', function() { - it('Add an MQTT broker to prepare for UI test', function() { + describe('MQTT', function () { + it('Add an MQTT broker to prepare for UI test', function () { var mqttOutNode = workspace.addNode("mqttOut"); mqttOutNode.edit(); mqttConfig.edit(); - mqttConfig.setServer("localhost"); + mqttConfig.setServer("localhost", moscaSettings.port); mqttConfig.clickOk(); mqttOutNode.clickOk(); workspace.deploy(); }); - it('Connect to an MQTT broker', function() { + it('Connect to an MQTT broker', function () { var injectNode = workspace.addNode("inject"); var mqttOutNode = workspace.addNode("mqttOut"); @@ -112,7 +115,7 @@ describe('cookbook', function() { // skip this case since it is same as other cases. it.skip('Publish messages to a topic'); - it('Set the topic of a published message', function() { + it('Set the topic of a published message', function () { var injectNode = workspace.addNode("inject"); var mqttOutNode = workspace.addNode("mqttOut"); @@ -144,7 +147,7 @@ describe('cookbook', function() { debugTab.getMessage().should.eql('"22"'); }); - it('Publish a retained message to a topic', function() { + it('Publish a retained message to a topic', function () { var injectNode = workspace.addNode("inject"); var mqttOutNode = workspace.addNode("mqttOut"); @@ -182,7 +185,7 @@ describe('cookbook', function() { // skip this case since it is same as other cases. it.skip('Subscribe to a topic'); - it('Receive a parsed JSON message', function() { + it('Receive a parsed JSON message', function () { var injectNode = workspace.addNode("inject"); var mqttOutNode = workspace.addNode("mqttOut"); diff --git a/test/editor/specs/scenario/cookbook_uispec.js b/test/editor/specs/scenario/cookbook_uispec.js deleted file mode 100644 index f14f02469..000000000 --- a/test/editor/specs/scenario/cookbook_uispec.js +++ /dev/null @@ -1,441 +0,0 @@ -/** - * Copyright JS Foundation and other contributors, http://js.foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - **/ - -var when = require('when'); -var should = require("should"); -var fs = require('fs-extra'); - -var helper = require("../../editor_helper"); -var debugTab = require('../../pageobjects/editor/debugTab_page'); -var workspace = require('../../pageobjects/editor/workspace_page'); -var specUtil = require('../../pageobjects/util/spec_util_page'); - -var httpNodeRoot = "/api"; - -// https://cookbook.nodered.org/ -describe('cookbook', function() { - beforeEach(function() { - workspace.init(); - }); - - before(function() { - helper.startServer(); - }); - - after(function() { - helper.stopServer(); - }); - - describe('messages', function() { - it('set a message property to a fixed value', function() { - var injectNode = workspace.addNode("inject"); - var changeNode = workspace.addNode("change"); - var debugNode = workspace.addNode("debug"); - - changeNode.edit(); - changeNode.ruleSet("payload", "msg", "Hello World!"); - changeNode.clickOk(); - - injectNode.connect(changeNode); - changeNode.connect(debugNode); - - workspace.deploy(); - - debugTab.open(); - injectNode.clickLeftButton(); - debugTab.getMessage().should.eql('"Hello World!"'); - }); - - it('delete a message property', function() { - var injectNode = workspace.addNode("inject"); - var changeNode = workspace.addNode("change"); - var debugNode = workspace.addNode("debug"); - - changeNode.edit(); - changeNode.ruleDelete(); - changeNode.clickOk(); - - injectNode.connect(changeNode); - changeNode.connect(debugNode); - - workspace.deploy(); - - debugTab.open(); - injectNode.clickLeftButton(); - debugTab.getMessage().should.eql("undefined"); - }); - - it('move a message property', function() { - var injectNode = workspace.addNode("inject"); - var changeNode = workspace.addNode("change"); - var debugNode = workspace.addNode("debug"); - - injectNode.edit(); - injectNode.setTopic("Hello"); - injectNode.clickOk(); - - changeNode.edit(); - changeNode.ruleMove("topic", "payload"); - changeNode.clickOk(); - - injectNode.connect(changeNode); - changeNode.connect(debugNode); - - workspace.deploy(); - - debugTab.open(); - injectNode.clickLeftButton(); - debugTab.getMessage().should.eql('"Hello"'); - }); - - it('map a property between different numeric ranges', function() { - var injectNode1 = workspace.addNode("inject"); - var injectNode2 = workspace.addNode("inject", 0, 100); - var injectNode3 = workspace.addNode("inject", 0, 200); - var rangeNode = workspace.addNode("range", 200, 100); - var debugNode = workspace.addNode("debug", 400); - - injectNode1.edit(); - injectNode1.setPayload("num", 0); - injectNode1.clickOk(); - injectNode2.edit(); - injectNode2.setPayload("num", 512); - injectNode2.clickOk(); - injectNode3.edit(); - injectNode3.setPayload("num", 1023); - injectNode3.clickOk(); - - rangeNode.edit(); - rangeNode.setAction("clamp"); - rangeNode.setRange(0, 1023, 0, 5); - rangeNode.clickOk(); - - injectNode1.connect(rangeNode); - injectNode2.connect(rangeNode); - injectNode3.connect(rangeNode); - rangeNode.connect(debugNode); - - workspace.deploy(); - - debugTab.open(); - injectNode1.clickLeftButton(); - debugTab.getMessage(1).should.eql('0'); - injectNode2.clickLeftButton(); - debugTab.getMessage(2).should.eql('2.5024437927663734'); - injectNode3.clickLeftButton(); - debugTab.getMessage(3).should.eql('5'); - }); - }); - - describe('flow control', function() { - it('trigger a flow whenever Node-RED starts', function() { - var injectNode = workspace.addNode("inject"); - var debugNode = workspace.addNode("debug"); - - injectNode.edit(); - injectNode.setPayload("str", "Started!") - injectNode.setOnce(true); - injectNode.clickOk(); - injectNode.connect(debugNode); - - debugTab.open(); - workspace.deploy(); - debugTab.getMessage().should.eql('"Started!"'); - }); - - it('trigger a flow at regular intervals', function() { - var injectNode = workspace.addNode("inject"); - var debugNode = workspace.addNode("debug"); - - injectNode.edit(); - injectNode.setRepeat("interval"); - injectNode.setRepeatInterval(1); - injectNode.clickOk(); - injectNode.connect(debugNode); - - workspace.deploy(); - - debugTab.open(); - specUtil.pause(1000); - var t1 = Number(debugTab.getMessage(1)); - t1.should.within(1500000000000, 3000000000000); - specUtil.pause(1000); - debugTab.getMessage(2).should.within(t1 + 900, 3000000000000); - }); - - // skip this case since it needs up to one minite. - it.skip('trigger a flow at a specific time'); - }); - - describe('HTTP requests', function() { - it('simple get request', function() { - var injectNode = workspace.addNode("inject"); - var httpRequetNode = workspace.addNode("httpRequest"); - var htmlNode = workspace.addNode("html"); - var debugNode = workspace.addNode("debug"); - - httpRequetNode.edit(); - httpRequetNode.setMethod("GET"); - httpRequetNode.setUrl(helper.url()); - httpRequetNode.clickOk(); - - htmlNode.edit(); - htmlNode.setSelector("title"); - htmlNode.clickOk(); - - injectNode.connect(httpRequetNode); - httpRequetNode.connect(htmlNode); - htmlNode.connect(debugNode); - - workspace.deploy(); - - debugTab.open(); - injectNode.clickLeftButton(); - debugTab.getMessage().should.eql('"Node-RED"'); - }); - - it('set the URL of a request', function() { - var injectNode = workspace.addNode("inject"); - var changeNode = workspace.addNode("change"); - var httpRequetNode = workspace.addNode("httpRequest"); - var debugNode = workspace.addNode("debug"); - - injectNode.edit(); - injectNode.setPayload("str", helper.url()); - injectNode.clickOk(); - - changeNode.edit(); - changeNode.ruleSet("url", "msg", "payload", "msg"); - changeNode.clickOk(); - - injectNode.connect(changeNode); - changeNode.connect(httpRequetNode); - httpRequetNode.connect(debugNode); - - workspace.deploy(); - - debugTab.open(); - injectNode.clickLeftButton(); - debugTab.getMessage().should.containEql('Node-RED'); - }); - - it('set the URL of a request using a template', function() { - var injectNode = workspace.addNode("inject"); - var changeNode = workspace.addNode("change"); - var httpRequetNode = workspace.addNode("httpRequest"); - var debugNode = workspace.addNode("debug"); - - injectNode.edit(); - injectNode.setPayload("str", 'settings'); - injectNode.clickOk(); - - changeNode.edit(); - changeNode.ruleSet("query", "msg", "payload", "msg"); - changeNode.clickOk(); - - httpRequetNode.edit(); - httpRequetNode.setUrl(helper.url() + "/{{{query}}}"); - httpRequetNode.clickOk(); - - injectNode.connect(changeNode); - changeNode.connect(httpRequetNode); - httpRequetNode.connect(debugNode); - - workspace.deploy(); - - debugTab.open(); - injectNode.clickLeftButton(); - debugTab.getMessage().should.containEql('httpNodeRoot'); - }); - - it('set the query string parameters', function() { - var injectNode = workspace.addNode("inject"); - var changeNode = workspace.addNode("change"); - var httpRequetNode = workspace.addNode("httpRequest"); - var debugNode = workspace.addNode("debug"); - - injectNode.edit(); - injectNode.setPayload("str", 'Nick'); - injectNode.clickOk(); - - changeNode.edit(); - changeNode.ruleSet("query", "msg", "payload", "msg"); - changeNode.clickOk(); - - httpRequetNode.edit(); - httpRequetNode.setUrl(helper.url() + httpNodeRoot + '/set-query?q={{{query}}}'); - httpRequetNode.clickOk(); - - injectNode.connect(changeNode); - changeNode.connect(httpRequetNode); - httpRequetNode.connect(debugNode); - - // The code for confirmation starts from here. - var httpinNode = workspace.addNode("httpin", 0, 200); - var templateNode = workspace.addNode("template"); - var httpResponseNode = workspace.addNode("httpResponse"); - - httpinNode.edit(); - httpinNode.setMethod("get"); - httpinNode.setUrl("/set-query"); - httpinNode.clickOk(); - - templateNode.edit(); - templateNode.setSyntax("mustache"); - templateNode.setFormat("handlebars"); - templateNode.setTemplate("Hello {{req.query.q}}"); - templateNode.clickOk(); - - httpinNode.connect(templateNode); - templateNode.connect(httpResponseNode); - // The code for confirmation ends here. - - workspace.deploy(); - debugTab.open(); - injectNode.clickLeftButton(); - debugTab.getMessage().should.eql('"Hello Nick"'); - }); - - it('get a parsed JSON response', function() { - var injectNode = workspace.addNode("inject"); - var changeNodeSetPost = workspace.addNode("change"); - var httpRequetNode = workspace.addNode("httpRequest"); - var debugNode = workspace.addNode("debug"); - - injectNode.edit(); - injectNode.setPayload("str", "json-response"); - injectNode.clickOk(); - - changeNodeSetPost.edit(); - changeNodeSetPost.ruleSet("post", "msg", "payload", "msg"); - changeNodeSetPost.clickOk(); - - httpRequetNode.edit(); - httpRequetNode.setMethod("GET"); - var url = helper.url() + httpNodeRoot + "/{{post}}"; - httpRequetNode.setUrl(url); - httpRequetNode.setReturn("obj"); - httpRequetNode.clickOk(); - - debugNode.edit(); - debugNode.setOutput("payload.title"); - debugNode.clickOk(); - - injectNode.connect(changeNodeSetPost); - changeNodeSetPost.connect(httpRequetNode); - httpRequetNode.connect(debugNode); - - // The code for confirmation starts from here. - var httpinNode = workspace.addNode("httpin", 0, 200); - var templateNode = workspace.addNode("template"); - var changeNodeSetHeader = workspace.addNode("change"); - var httpResponseNode = workspace.addNode("httpResponse"); - - httpinNode.edit(); - httpinNode.setMethod("get"); - httpinNode.setUrl("/json-response"); - httpinNode.clickOk(); - - templateNode.edit(); - templateNode.setSyntax("mustache"); - templateNode.setFormat("handlebars"); - templateNode.setTemplate('{"title": "Hello"}'); - templateNode.clickOk(); - - changeNodeSetHeader.edit(); - changeNodeSetHeader.ruleSet("headers", "msg", '{"content-type":"application/json"}', "json"); - changeNodeSetHeader.clickOk(); - - httpinNode.connect(templateNode); - templateNode.connect(changeNodeSetHeader); - changeNodeSetHeader.connect(httpResponseNode); - // The code for confirmation ends here. - - workspace.deploy(); - debugTab.open(); - injectNode.clickLeftButton(); - debugTab.getMessage().should.eql('"Hello"'); - }); - - it('get a binary response', function() { - var injectNode = workspace.addNode("inject"); - var httpRequetNode = workspace.addNode("httpRequest"); - var debugNode = workspace.addNode("debug"); - - httpRequetNode.edit(); - httpRequetNode.setMethod("GET"); - httpRequetNode.setUrl(helper.url() + "/settings"); - httpRequetNode.setReturn("bin"); - httpRequetNode.clickOk(); - - injectNode.connect(httpRequetNode); - httpRequetNode.connect(debugNode); - - workspace.deploy(); - - debugTab.open(); - injectNode.clickLeftButton(); - - debugTab.getMessage().should.eql(['123', '34', '104', '116', '116', '112', '78', '111', '100', '101']); - }); - - it('set a request header', function() { - var injectNode = workspace.addNode("inject"); - var functionNode = workspace.addNode("function"); - var httpRequetNode = workspace.addNode("httpRequest"); - var debugNode = workspace.addNode("debug"); - - functionNode.edit(); - functionNode.setFunction('msg.payload = "data to post";\nreturn msg;'); - functionNode.clickOk(); - - httpRequetNode.edit(); - httpRequetNode.setMethod("POST"); - var url = helper.url() + httpNodeRoot + "/set-header"; - httpRequetNode.setUrl(url); - httpRequetNode.clickOk(); - - injectNode.connect(functionNode); - functionNode.connect(httpRequetNode); - httpRequetNode.connect(debugNode); - - // The code for confirmation starts from here. - var httpinNode = workspace.addNode("httpin", 0, 200); - var templateNode = workspace.addNode("template"); - var httpResponseNode = workspace.addNode("httpResponse"); - - httpinNode.edit(); - httpinNode.setMethod("post"); - httpinNode.setUrl("/set-header"); - httpinNode.clickOk(); - - templateNode.edit(); - templateNode.setSyntax("mustache"); - templateNode.setFormat("handlebars"); - templateNode.setTemplate("{{ payload }}"); - templateNode.clickOk(); - - httpinNode.connect(templateNode); - templateNode.connect(httpResponseNode); - // The code for confirmation ends here. - - workspace.deploy(); - debugTab.open(); - injectNode.clickLeftButton(); - debugTab.getMessage().should.eql('"data to post"'); - }); - }); -}); diff --git a/test/editor/wdio.conf.js b/test/editor/wdio.conf.js index 7822cbbf3..4e5a602e0 100644 --- a/test/editor/wdio.conf.js +++ b/test/editor/wdio.conf.js @@ -14,8 +14,9 @@ * limitations under the License. **/ +var browserstack = require('browserstack-local'); exports.config = { - + // // ================== // Specify Test Files @@ -48,27 +49,20 @@ exports.config = { // and 30 processes will get spawned. The property handles how many capabilities // from the same test should run tests. // - maxInstances: 10, + // maxInstances: 10, // // If you have trouble getting all important capabilities together, check out the // Sauce Labs platform configurator - a great tool to configure your capabilities: // https://docs.saucelabs.com/reference/platforms-configurator // - capabilities: [{ + // capabilities: [{ // maxInstances can get overwritten per capability. So if you have an in-house Selenium // grid with only 5 firefox instances available you can make sure that not more than // 5 instances get started at a time. - maxInstances: 2, + // maxInstances: 5, // - browserName: 'chrome', - chromeOptions: { - args: process.env.NODE_RED_NON_HEADLESS - // Runs tests with opening a browser. - ? ['--disable-gpu'] - // Runs tests without opening a browser. - : ['--headless', '--disable-gpu', 'window-size=1920,1080'] - }, - }], + // browserName: 'firefox' + // }], // // =================== // Test Configurations @@ -103,7 +97,7 @@ exports.config = { baseUrl: 'http://localhost', // // Default timeout for all waitFor* commands. - waitforTimeout: 10000, + waitforTimeout: 20000, // // Default timeout in milliseconds for request // if Selenium Grid doesn't send response @@ -134,9 +128,7 @@ exports.config = { // Services take over a specific job you don't want to take care of. They enhance // your test setup with almost no effort. Unlike plugins, they don't add new // commands. Instead, they hook themselves up into the test process. - port: '9515', - path: '/', - services: ['chromedriver'], + //services: ['chromedriver'], // // Framework you want to run your specs with. // The following are supported: Mocha, Jasmine, and Cucumber @@ -150,12 +142,12 @@ exports.config = { // The only one supported by default is 'dot' // see also: http://webdriver.io/guide/reporters/dot.html reporters: ['spec'], - + // // Options to be passed to Mocha. // See the full list at http://mochajs.org/ mochaOpts: { - timeout: 60000, + timeout: 1000000, ui: 'bdd' }, // @@ -171,8 +163,44 @@ exports.config = { * @param {Object} config wdio configuration object * @param {Array.} capabilities list of capabilities details */ - // onPrepare: function (config, capabilities) { - // }, + onPrepare: function (config, capabilities) { + if (process.env.BROWSERSTACK) { + return new Promise(function (resolve, reject) { + var options = { key: exports.config.key }; + var proxy = process.env.http_proxy || process.env.HTTP_PROXY; + if (proxy) { + var proxyConfigs = proxy.match(/^(https?):\/\/(([^:@\/]+):([^:@\/]+)@)?([^:@\/]+)(:([^:@\/]+))?\/?$/); + if (proxyConfigs) { + var protocol = proxyConfigs[1]; + var user = proxyConfigs[3]; + var pass = proxyConfigs[4]; + var host = proxyConfigs[5]; + var port = proxyConfigs[7]; + if (!port) { + if (protocol === 'http') { + port = 80; + } else if (protocol === 'https') { + port = 443; + } + } + if (host) { options.proxyHost = host; } + if (port) { options.proxyPort = port; } + if (user) { options.proxyUser = user; } + if (pass) { options.proxyPass = pass; } + } else { + reject('error in parsing the environment variable, http_proxy'); + } + } + exports.bs_local = new browserstack.Local(); + exports.bs_local.start(options, function (error) { + if (error) { + return reject(error); + } + resolve(); + }); + }); + } + }, /** * Gets executed just before initialising the webdriver session and test framework. It allows you * to manipulate configurations depending on the capability or spec. @@ -197,7 +225,7 @@ exports.config = { */ // beforeCommand: function (commandName, args) { // }, - + /** * Hook that gets executed before the suite starts * @param {Object} suite suite details @@ -217,13 +245,13 @@ exports.config = { // beforeHook: function () { // }, /** - * Hook that gets executed _after_ a hook within the suite starts (e.g. runs after calling + * Hook that gets executed _after_ a hook within the suite ends (e.g. runs after calling * afterEach in Mocha) */ // afterHook: function () { // }, /** - * Function to be executed after a test (in Mocha/Jasmine) or a step (in Cucumber) starts. + * Function to be executed after a test (in Mocha/Jasmine) or a step (in Cucumber) ends. * @param {Object} test test details */ // afterTest: function (test) { @@ -234,7 +262,7 @@ exports.config = { */ // afterSuite: function (suite) { // }, - + /** * Runs after a WebdriverIO command gets executed * @param {String} commandName hook command name @@ -267,6 +295,44 @@ exports.config = { * @param {Object} config wdio configuration object * @param {Array.} capabilities list of capabilities details */ - // onComplete: function(exitCode, config, capabilities) { - // } + onComplete: function(exitCode, config, capabilities) { + if (process.env.BROWSERSTACK) { + exports.bs_local.stop(function () {}); + } + } +}; + +if (process.env.BROWSERSTACK) { + exports.config.maxInstances = 1; + if (process.env.BROWSERSTACK_USERNAME && process.env.BROWSERSTACK_ACCESS_KEY) { + exports.config.user = process.env.BROWSERSTACK_USERNAME; + exports.config.key = process.env.BROWSERSTACK_ACCESS_KEY; + } else { + console.log('You need to set the following environment variables.'); + console.log('BROWSERSTACK_USERNAME='); + console.log('BROWSERSTACK_ACCESS_KEY='); + } + exports.config.services = ['browserstack']; + var capabilities = []; + capabilities.push({ os: 'Windows', os_version: '10', browser: 'Chrome', resolution: '1920x1080', 'browserstack.local': true }); + capabilities.push({ os: 'Windows', os_version: '10', browser: 'Firefox', resolution: '1920x1080', 'browserstack.local': true }); + capabilities.push({ os: 'OS X', os_version: 'Catalina', browser: 'Chrome', resolution: '1920x1080', 'browserstack.local': true }); + capabilities.push({ os: 'OS X', os_version: 'Catalina', browser: 'Firefox', resolution: '1920x1080', 'browserstack.local': true }); + exports.config.capabilities = capabilities; +} else { + exports.config.maxInstances = 10; + exports.config.port = 9515; + exports.config.path = '/'; + exports.config.services = ['chromedriver']; + exports.config.capabilities = [{ + maxInstances: 2, + browserName: 'chrome', + 'goog:chromeOptions': { + args: process.env.NODE_RED_NON_HEADLESS + // Runs tests with opening a browser. + ? ['--disable-gpu', '--no-sandbox'] + // Runs tests without opening a browser. + : ['--headless', '--disable-gpu', 'window-size=1920,1080', '--no-sandbox'] + } + }]; } diff --git a/test/nodes/core/common/21-debug_spec.js b/test/nodes/core/common/21-debug_spec.js index c3a5d4d2a..bdff7976c 100644 --- a/test/nodes/core/common/21-debug_spec.js +++ b/test/nodes/core/common/21-debug_spec.js @@ -58,7 +58,7 @@ describe('debug node', function() { n1.emit("input", {payload:"test"}); }, function(msg) { JSON.parse(msg).should.eql([{ - topic:"debug",data:{id:"n1",name:"Debug",msg:"test", + topic:"debug",data:{id:"n1",name:"Debug",msg:"test",path:"global", format:"string[4]",property:"payload"} }]); }, done); @@ -74,7 +74,7 @@ describe('debug node', function() { n1.emit("input", {payload:"test"}); }, function(msg) { JSON.parse(msg).should.eql([{ - topic:"debug",data:{id:"n1",msg:"test",property:"payload",format:"string[4]"} + topic:"debug",data:{id:"n1",msg:"test",property:"payload",format:"string[4]",path:"global"} }]); count++; }, function() { @@ -85,7 +85,7 @@ describe('debug node', function() { }); logEvents.should.have.length(1); var tstmp = logEvents[0][0].timestamp; - logEvents[0][0].should.eql({level:helper.log().INFO, id:'n1',type:'debug',msg:'test', timestamp:tstmp}); + logEvents[0][0].should.eql({level:helper.log().INFO, id:'n1',type:'debug',msg:'test', timestamp:tstmp,path:"global"}); done(); } catch(err) { @@ -104,7 +104,7 @@ describe('debug node', function() { }, function(msg) { JSON.parse(msg).should.eql([{ topic:"debug", - data:{id:"n1",msg:'{\n "payload": "test"\n}',format:"Object"} + data:{id:"n1",msg:'{\n "payload": "test"\n}',format:"Object",path:"global"} }]); }, done); }); @@ -119,7 +119,7 @@ describe('debug node', function() { }, function(msg) { JSON.parse(msg).should.eql([{ topic:"debug", - data:{id:"n1",msg:'{\n "payload": "test"\n}',format:"Object"} + data:{id:"n1",msg:'{\n "payload": "test"\n}',format:"Object",path:"global"} }]); }, function() { try { @@ -129,7 +129,7 @@ describe('debug node', function() { }); logEvents.should.have.length(1); var tstmp = logEvents[0][0].timestamp; - logEvents[0][0].should.eql({level:helper.log().INFO, id:"n1",type:"debug",msg:'\n{ payload: \'test\' }',timestamp:tstmp}); + logEvents[0][0].should.eql({level:helper.log().INFO, id:"n1",type:"debug",msg:'\n{ payload: \'test\' }',timestamp:tstmp,path:"global"}); done(); } catch(err) { done(err); @@ -146,7 +146,7 @@ describe('debug node', function() { n1.emit("input", {payload:"test", foo:"bar"}); }, function(msg) { JSON.parse(msg).should.eql([{ - topic:"debug",data:{id:"n1",msg:"bar",property:"foo",format:"string[3]"} + topic:"debug",data:{id:"n1",msg:"bar",property:"foo",format:"string[3]",path:"global"} }]); }, done); }); @@ -160,7 +160,7 @@ describe('debug node', function() { n1.emit("input", {payload:"test", foo: {bar:"bar"}}); }, function(msg) { JSON.parse(msg).should.eql([{ - topic:"debug",data:{id:"n1",msg:"bar",property:"foo.bar",format:"string[3]"} + topic:"debug",data:{id:"n1",msg:"bar",property:"foo.bar",format:"string[3]",path:"global"} }]); }, done); }); @@ -174,7 +174,7 @@ describe('debug node', function() { n1.emit("input", {payload: new Error("oops")}); }, function(msg) { JSON.parse(msg).should.eql([{ - topic:"debug",data:{id:"n1",msg:'{"name":"Error","message":"oops"}',property:"payload",format:"error"} + topic:"debug",data:{id:"n1",msg:'{"name":"Error","message":"oops"}',property:"payload",format:"error",path:"global"} }]); }, done); }); @@ -188,7 +188,7 @@ describe('debug node', function() { n1.emit("input", {payload: true}); }, function(msg) { JSON.parse(msg).should.eql([{ - topic:"debug",data:{id:"n1",msg: 'true',property:"payload",format:"boolean"} + topic:"debug",data:{id:"n1",msg: 'true',property:"payload",format:"boolean",path:"global"} }]); }, done); }); @@ -202,7 +202,7 @@ describe('debug node', function() { n1.emit("input", {payload: 7}); }, function(msg) { JSON.parse(msg).should.eql([{ - topic:"debug",data:{id:"n1",msg:"7",property:"payload",format:"number"} + topic:"debug",data:{id:"n1",msg:"7",property:"payload",format:"number",path:"global"} }]); }, done); }); @@ -216,7 +216,7 @@ describe('debug node', function() { n1.emit("input", {payload: Number.NaN}); }, function(msg) { JSON.parse(msg).should.eql([{ - topic:"debug",data:{id:"n1",msg:"NaN",property:"payload",format:"number"} + topic:"debug",data:{id:"n1",msg:"NaN",property:"payload",format:"number",path:"global"} }]); }, done); }); @@ -230,7 +230,7 @@ describe('debug node', function() { n1.emit("input", {}); }, function(msg) { JSON.parse(msg).should.eql([{ - topic:"debug",data:{id:"n1",msg:'(undefined)',property:"payload",format:"undefined"} + topic:"debug",data:{id:"n1",msg:'(undefined)',property:"payload",format:"undefined",path:"global"} }]); }, done); }); @@ -244,7 +244,7 @@ describe('debug node', function() { n1.emit("input", {payload:null}); }, function(msg) { JSON.parse(msg).should.eql([{ - topic:"debug",data:{id:"n1",msg:'(undefined)',property:"payload",format:"null"} + topic:"debug",data:{id:"n1",msg:'(undefined)',property:"payload",format:"null",path:"global"} }]); }, done); }); @@ -259,7 +259,7 @@ describe('debug node', function() { }, function(msg) { JSON.parse(msg).should.eql([{ topic:"debug", - data:{id:"n1",msg:'{\n "type": "foo"\n}',property:"payload",format:"Object"} + data:{id:"n1",msg:'{\n "type": "foo"\n}',property:"payload",format:"Object",path:"global"} }]); }, done); }); @@ -275,7 +275,7 @@ describe('debug node', function() { JSON.parse(msg).should.eql([{ topic:"debug", data:{id:"n1",msg: '[\n 0,\n 1,\n 2,\n 3\n]',format:"array[4]", - property:"payload"} + property:"payload",path:"global"} }]); }, done); }); @@ -295,7 +295,7 @@ describe('debug node', function() { data:{ id:"n1", msg:'{\n "name": "bar",\n "o": "[Circular ~]"\n}', - property:"payload",format:"Object" + property:"payload",format:"Object",path:"global" } }]); }, done); @@ -310,7 +310,7 @@ describe('debug node', function() { n1.emit("input", {payload: {type:'foo'}}); }, function(msg) { JSON.parse(msg).should.eql([{ - topic:"debug",data:{id:"n1",msg:'{\n "type": "foo"\n}',property:"payload",format:"Object"} + topic:"debug",data:{id:"n1",msg:'{\n "type": "foo"\n}',property:"payload",format:"Object",path:"global"} }]); }, function() { try { @@ -320,7 +320,7 @@ describe('debug node', function() { }); logEvents.should.have.length(1); var tstmp = logEvents[0][0].timestamp; - logEvents[0][0].should.eql({level:helper.log().INFO,id:"n1",type:"debug",msg:'\n{ type: \'foo\' }',timestamp:tstmp}); + logEvents[0][0].should.eql({level:helper.log().INFO,id:"n1",type:"debug",msg:'\n{ type: \'foo\' }',timestamp:tstmp,path:"global"}); done(); } catch(err) { done(err); @@ -337,7 +337,7 @@ describe('debug node', function() { n1.emit("input", {payload:"test\ntest"}); }, function(msg) { JSON.parse(msg).should.eql([{ - topic:"debug",data:{id:"n1",msg:"test\ntest",property:"payload",format:"string[9]"} + topic:"debug",data:{id:"n1",msg:"test\ntest",property:"payload",format:"string[9]",path:"global"} }]); }, function() { try { @@ -347,7 +347,7 @@ describe('debug node', function() { }); logEvents.should.have.length(1); var tstmp = logEvents[0][0].timestamp; - logEvents[0][0].should.eql({level:helper.log().INFO,id:"n1",type:"debug",msg:"\ntest\ntest",timestamp:tstmp}); + logEvents[0][0].should.eql({level:helper.log().INFO,id:"n1",type:"debug",msg:"\ntest\ntest",timestamp:tstmp,path:"global"}); done(); } catch(err) { done(err); @@ -366,7 +366,7 @@ describe('debug node', function() { }, function(msg) { JSON.parse(msg).should.eql([{ topic:"debug",data:{id:"n1",name:"Debug",msg:"", - format:"string[6]"} + format:"string[6]",path:"global"} }]); }, done); }); @@ -386,7 +386,8 @@ describe('debug node', function() { id:"n1", msg: Array(1001).join("X")+'...', property:"payload", - format:"string[1001]" + format:"string[1001]", + path:"global" } }]); }, done); @@ -407,7 +408,8 @@ describe('debug node', function() { id:"n1", msg:'{\n "foo": "'+Array(1001).join("X")+'..."\n}', property:"payload", - format:"Object" + format:"Object", + path:"global" } }]); }, done); @@ -433,7 +435,8 @@ describe('debug node', function() { length: 1001 },null," "), property:"payload", - format:"array[1001]" + format:"array[1001]", + path:"global" } }]); }, done); @@ -461,7 +464,8 @@ describe('debug node', function() { } },null," "), property:"payload", - format:"Object" + format:"Object", + path:"global" } }]); }, done); @@ -473,7 +477,7 @@ describe('debug node', function() { helper.load(debugNode, flow, function() { var n1 = helper.getNode("n1"); websocket_test(function() { - n1.emit("input", {payload: Buffer(501).fill("\"")}); + n1.emit("input", {payload: Buffer.alloc(501,"\"")}); }, function(msg) { var a = JSON.parse(msg); a[0].should.eql({ @@ -482,7 +486,8 @@ describe('debug node', function() { id:"n1", msg: Array(1001).join("2"), property:"payload", - format:"buffer[501]" + format:"buffer[501]", + path:"global" } }); }, done); @@ -494,7 +499,7 @@ describe('debug node', function() { helper.load(debugNode, flow, function() { var n1 = helper.getNode("n1"); websocket_test(function() { - n1.emit("input", {payload: {foo: Buffer(1001).fill("X")}}); + n1.emit("input", {payload: {foo: Buffer.alloc(1001,"X")}}); }, function(msg) { var a = JSON.parse(msg); a[0].should.eql({ @@ -510,7 +515,8 @@ describe('debug node', function() { } },null," "), property:"payload", - format:"Object" + format:"Object", + path:"global" } }); }, done); @@ -530,7 +536,8 @@ describe('debug node', function() { id:"n1", msg:'48454c4c4f', property:"payload", - format:"buffer[5]" + format:"buffer[5]", + path:"global" } }]); }, done); @@ -551,7 +558,7 @@ describe('debug node', function() { }); }, function(msg) { JSON.parse(msg).should.eql([{ - topic:"debug",data:{id:"n1",msg:"message 2",property:"payload",format:"string[9]"} + topic:"debug",data:{id:"n1",msg:"message 2",property:"payload",format:"string[9]",path:"global"} }]); }, done); }); diff --git a/test/nodes/core/function/89-delay_spec.js b/test/nodes/core/function/89-delay_spec.js index f16a13636..51583d8a4 100644 --- a/test/nodes/core/function/89-delay_spec.js +++ b/test/nodes/core/function/89-delay_spec.js @@ -251,7 +251,8 @@ describe('delay Node', function() { var helperNode1 = helper.getNode("helperNode1"); var receivedMessagesStack = []; - var rate = 1000/aLimit; + // Add a small grace to the calculated delay + var rate = 1000/aLimit + 10; var receiveTimestamp; diff --git a/test/nodes/core/function/89-trigger_spec.js b/test/nodes/core/function/89-trigger_spec.js index 5f7bfc2d1..7d7450580 100644 --- a/test/nodes/core/function/89-trigger_spec.js +++ b/test/nodes/core/function/89-trigger_spec.js @@ -736,10 +736,12 @@ describe('trigger node', function() { try { if (c === 0) { msg.should.have.a.property("payload", "Goodbye"); + msg.should.have.a.property("topic", "test2"); c += 1; } else { msg.should.have.a.property("payload", "World"); + msg.should.have.a.property("topic", "test3"); (Date.now() - ss).should.be.greaterThan(70); done(); } @@ -747,16 +749,51 @@ describe('trigger node', function() { catch(err) { done(err); } }); var ss = Date.now(); - n1.emit("input", {payload:"Hello"}); + n1.emit("input", {payload:"Hello", topic:"test1"}); setTimeout( function() { - n1.emit("input", {payload:"Goodbye"}); + n1.emit("input", {payload:"Goodbye", topic:"test2"}); },20); setTimeout( function() { - n1.emit("input", {payload:"World"}); + n1.emit("input", {payload:"World", topic:"test3"}); },80); }); }); + it('should be able output the 2nd payload and handle multiple topics', function(done) { + var flow = [{"id":"n1", "type":"trigger", "name":"triggerNode", extend:"false", op1type:"nul", op2type:"payl", op1:"false", op2:"true", duration:"80", bytopic:"topic", wires:[["n2"]] }, + {id:"n2", type:"helper"} ]; + helper.load(triggerNode, flow, function() { + var n1 = helper.getNode("n1"); + var n2 = helper.getNode("n2"); + var c = 0; + n2.on("input", function(msg) { + try { + if (c === 0) { + msg.should.have.a.property("payload", "Goodbye1"); + msg.should.have.a.property("topic", "test1"); + c += 1; + } + else { + msg.should.have.a.property("payload", "Goodbye2"); + msg.should.have.a.property("topic", "test2"); + done(); + } + } + catch(err) { done(err); } + }); + n1.emit("input", {payload:"Hello1", topic:"test1"}); + setTimeout( function() { + n1.emit("input", {payload:"Hello2", topic:"test2"}); + },20); + setTimeout( function() { + n1.emit("input", {payload:"Goodbye2", topic:"test2"}); + },20); + setTimeout( function() { + n1.emit("input", {payload:"Goodbye1", topic:"test1"}); + },20); + }); + }); + it('should be able to apply mustache templates to payloads', function(done) { var flow = [{"id":"n1", "type":"trigger", "name":"triggerNode", op1type:"val", op2type:"val", op1:"{{payload}}", op2:"{{topic}}", duration:"50", wires:[["n2"]] }, {id:"n2", type:"helper"} ]; diff --git a/test/nodes/core/network/21-httprequest_spec.js b/test/nodes/core/network/21-httprequest_spec.js index 39667f1f2..ab9020a64 100644 --- a/test/nodes/core/network/21-httprequest_spec.js +++ b/test/nodes/core/network/21-httprequest_spec.js @@ -898,7 +898,7 @@ describe('HTTP Request Node', function() { }); logEvents.should.have.length(1); var tstmp = logEvents[0][0].timestamp; - logEvents[0][0].should.eql({level:helper.log().ERROR, id:'n1',type:'http request',msg:'common.notification.errors.no-response', timestamp:tstmp}); + logEvents[0][0].should.eql({level:helper.log().ERROR, id:'n1',type:'http request',msg:'common.notification.errors.no-response', timestamp:tstmp, path:"global"}); done(); } catch(err) { done(err); @@ -924,7 +924,7 @@ describe('HTTP Request Node', function() { }); logEvents.should.have.length(1); var tstmp = logEvents[0][0].timestamp; - logEvents[0][0].should.eql({level:helper.log().ERROR, id:'n1',type:'http request',msg:'common.notification.errors.no-response', timestamp:tstmp}); + logEvents[0][0].should.eql({level:helper.log().ERROR, id:'n1',type:'http request',msg:'common.notification.errors.no-response', timestamp:tstmp, path:"global"}); done(); } catch(err) { done(err); @@ -947,7 +947,7 @@ describe('HTTP Request Node', function() { }); logEvents.should.have.length(2); var tstmp = logEvents[0][0].timestamp; - logEvents[0][0].should.eql({level:helper.log().WARN, id:'n1',type:'http request',msg:'httpin.errors.timeout-isnan', timestamp:tstmp}); + logEvents[0][0].should.eql({level:helper.log().WARN, id:'n1',type:'http request',msg:'httpin.errors.timeout-isnan', timestamp:tstmp, path:"global"}); done(); } catch(err) { done(err); @@ -970,7 +970,7 @@ describe('HTTP Request Node', function() { }); logEvents.should.have.length(2); var tstmp = logEvents[0][0].timestamp; - logEvents[0][0].should.eql({level:helper.log().WARN, id:'n1',type:'http request',msg:'httpin.errors.timeout-isnegative', timestamp:tstmp}); + logEvents[0][0].should.eql({level:helper.log().WARN, id:'n1',type:'http request',msg:'httpin.errors.timeout-isnegative', timestamp:tstmp, path:"global"}); done(); } catch(err) { done(err); @@ -993,7 +993,7 @@ describe('HTTP Request Node', function() { }); logEvents.should.have.length(2); var tstmp = logEvents[0][0].timestamp; - logEvents[0][0].should.eql({level:helper.log().WARN, id:'n1',type:'http request',msg:'httpin.errors.timeout-isnegative', timestamp:tstmp}); + logEvents[0][0].should.eql({level:helper.log().WARN, id:'n1',type:'http request',msg:'httpin.errors.timeout-isnegative', timestamp:tstmp, path:"global"}); done(); } catch(err) { done(err); @@ -1291,7 +1291,6 @@ describe('HTTP Request Node', function() { var n1 = helper.getNode("n1"); var n2 = helper.getNode("n2"); n2.on("input", function(msg) { - console.log(msg.payload); try { msg.payload.headers.should.have.property('content-type').which.startWith('application/json'); msg.payload.headers.should.not.have.property('x-node-red-request-node'); diff --git a/test/nodes/core/sequence/17-split_spec.js b/test/nodes/core/sequence/17-split_spec.js index 3d38a9ac8..2c45f0e02 100644 --- a/test/nodes/core/sequence/17-split_spec.js +++ b/test/nodes/core/sequence/17-split_spec.js @@ -517,6 +517,49 @@ describe('JOIN node', function() { }); }); + it('should join things into an array after a count with a buffer join set', function(done) { + var flow = [{id:"n1", type:"join", wires:[["n2"]], count:3, joinerType:"bin", joiner:"" ,mode:"custom"}, + {id:"n2", type:"helper"}]; + helper.load(joinNode, flow, function() { + var n1 = helper.getNode("n1"); + var n2 = helper.getNode("n2"); + n2.on("input", function(msg) { + try { + msg.should.have.property("payload"); + msg.payload.should.be.an.Array(); + msg.payload[0].should.equal(1); + msg.payload[1].should.equal(true); + //msg.payload[2].a.should.equal(1); + done(); + } + catch(e) {done(e);} + }); + n1.receive({payload:1}); + n1.receive({payload:true}); + n1.receive({payload:{a:1}}); + }); + }); + + it('should join strings into a buffer after a count', function(done) { + var flow = [{id:"n1", type:"join", wires:[["n2"]], count:2, build:"buffer", joinerType:"bin", joiner:"", mode:"custom"}, + {id:"n2", type:"helper"}]; + helper.load(joinNode, flow, function() { + var n1 = helper.getNode("n1"); + var n2 = helper.getNode("n2"); + n2.on("input", function(msg) { + try { + msg.should.have.property("payload"); + msg.payload.length.should.equal(10); + msg.payload.toString().should.equal("helloworld"); + done(); + } + catch(e) {done(e);} + }); + n1.receive({payload:"hello"}); + n1.receive({payload:"world"}); + }); + }); + it('should join things into an object after a count', function(done) { var flow = [{id:"n1", type:"join", wires:[["n2"]], count:5, build:"object", mode:"custom"}, {id:"n2", type:"helper"}]; diff --git a/test/unit/@node-red/runtime/lib/api/flows_spec.js b/test/unit/@node-red/runtime/lib/api/flows_spec.js index a7c85efa2..dafbbc69b 100644 --- a/test/unit/@node-red/runtime/lib/api/flows_spec.js +++ b/test/unit/@node-red/runtime/lib/api/flows_spec.js @@ -53,7 +53,7 @@ describe("runtime-api/flows", function() { var loadFlows; var reloadError = false; beforeEach(function() { - setFlows = sinon.spy(function(flows,type) { + setFlows = sinon.spy(function(flows,credentials,type) { if (flows[0] === "error") { var err = new Error("error"); err.code = "error"; @@ -91,7 +91,19 @@ describe("runtime-api/flows", function() { result.should.eql({rev:"newRev"}); setFlows.called.should.be.true(); setFlows.lastCall.args[0].should.eql([4,5,6]); - setFlows.lastCall.args[1].should.eql("full"); + setFlows.lastCall.args[2].should.eql("full"); + done(); + }).catch(done); + }); + it("includes credentials when part of the request", function(done) { + flows.setFlows({ + flows: {flows:[4,5,6], credentials: {$:"creds"}}, + }).then(function(result) { + result.should.eql({rev:"newRev"}); + setFlows.called.should.be.true(); + setFlows.lastCall.args[0].should.eql([4,5,6]); + setFlows.lastCall.args[1].should.eql({$:"creds"}); + setFlows.lastCall.args[2].should.eql("full"); done(); }).catch(done); }); @@ -103,7 +115,7 @@ describe("runtime-api/flows", function() { result.should.eql({rev:"newRev"}); setFlows.called.should.be.true(); setFlows.lastCall.args[0].should.eql([4,5,6]); - setFlows.lastCall.args[1].should.eql("nodes"); + setFlows.lastCall.args[2].should.eql("nodes"); done(); }).catch(done); }); @@ -125,7 +137,7 @@ describe("runtime-api/flows", function() { result.should.eql({rev:"newRev"}); setFlows.called.should.be.true(); setFlows.lastCall.args[0].should.eql([4,5,6]); - setFlows.lastCall.args[1].should.eql("nodes"); + setFlows.lastCall.args[2].should.eql("nodes"); done(); }).catch(done); }); diff --git a/test/unit/@node-red/runtime/lib/nodes/Node_spec.js b/test/unit/@node-red/runtime/lib/nodes/Node_spec.js index 5ad52211e..1f9ca04ce 100644 --- a/test/unit/@node-red/runtime/lib/nodes/Node_spec.js +++ b/test/unit/@node-red/runtime/lib/nodes/Node_spec.js @@ -613,9 +613,6 @@ describe('Node', function() { } var n = new RedNode({_flow:flow,id:'123',type:'abc'}); var status = {fill:"green",shape:"dot",text:"connected"}; - var topic; - var message; - var retain; n.status(status); @@ -624,6 +621,33 @@ describe('Node', function() { flow.handleStatus.args[0][1].should.eql(status); done(); }); + it('publishes status for plain string', function(done) { + var flow = { handleStatus: sinon.stub() } + var n = new RedNode({_flow:flow,id:'123',type:'abc'}); + n.status("text status"); + flow.handleStatus.called.should.be.true(); + flow.handleStatus.args[0][0].should.eql(n); + flow.handleStatus.args[0][1].should.eql({text:"text status"}); + done(); + }); + it('publishes status for plain boolean', function(done) { + var flow = { handleStatus: sinon.stub() } + var n = new RedNode({_flow:flow,id:'123',type:'abc'}); + n.status(false); + flow.handleStatus.called.should.be.true(); + flow.handleStatus.args[0][0].should.eql(n); + flow.handleStatus.args[0][1].should.eql({text:"false"}); + done(); + }); + it('publishes status for plain number', function(done) { + var flow = { handleStatus: sinon.stub() } + var n = new RedNode({_flow:flow,id:'123',type:'abc'}); + n.status(123); + flow.handleStatus.called.should.be.true(); + flow.handleStatus.args[0][0].should.eql(n); + flow.handleStatus.args[0][1].should.eql({text:"123"}); + done(); + }); }); }); diff --git a/test/unit/@node-red/runtime/lib/nodes/flows/Subflow_spec.js b/test/unit/@node-red/runtime/lib/nodes/flows/Subflow_spec.js index f92a01328..71bd9ad19 100644 --- a/test/unit/@node-red/runtime/lib/nodes/flows/Subflow_spec.js +++ b/test/unit/@node-red/runtime/lib/nodes/flows/Subflow_spec.js @@ -298,7 +298,7 @@ describe('Subflow', function() { // // stoppedNodes.should.have.a.property(sfConfigId); done(); }); - },50); + },150); }); it("instantiates a subflow inside a subflow and stops it",function(done) { var config = flowUtils.parseConfig([ @@ -331,7 +331,7 @@ describe('Subflow', function() { Object.keys(currentNodes).should.have.length(0); done(); }); - },50); + },150); }); it("rewires a subflow node on update/start",function(done){ @@ -391,8 +391,8 @@ describe('Subflow', function() { flow.stop().then(function() { done(); }); - },50); - },50); + },150); + },150); }); }); describe('#stop', function() { @@ -452,7 +452,7 @@ describe('Subflow', function() { flow.stop().then(function() { done(); }); - },50); + },150); }); it("passes a status event to the subflow's parent tab status node - targetted scope",function(done) { var config = flowUtils.parseConfig([ @@ -491,7 +491,7 @@ describe('Subflow', function() { done(); }); - },50); + },150); }); }); @@ -536,7 +536,7 @@ describe('Subflow', function() { done(); }); - },50); + },150); }); it("emits a status event when a message is passed to a subflow-status node - msg.payload as status obj", function(done) { var config = flowUtils.parseConfig([ @@ -578,7 +578,7 @@ describe('Subflow', function() { done(); }); - },50); + },150); }); it("emits a status event when a message is passed to a subflow-status node - msg.status", function(done) { var config = flowUtils.parseConfig([ @@ -620,7 +620,7 @@ describe('Subflow', function() { done(); }); - },50); + },150); }); it("does not emit a regular status event if it contains a subflow-status node", function(done) { var config = flowUtils.parseConfig([ @@ -690,7 +690,7 @@ describe('Subflow', function() { flow.stop().then(function() { done(); }); - },50); + },150); }); it("passes an error event to the subflow's parent tab catch node - targetted scope",function(done) { var config = flowUtils.parseConfig([ @@ -727,7 +727,7 @@ describe('Subflow', function() { flow.stop().then(function() { done(); }); - },50); + },150); }); }); @@ -777,7 +777,7 @@ describe('Subflow', function() { flow.stop().then(function() { done(); }); - },50); + },150); }); it("can access subflow env var", function(done) { @@ -817,7 +817,7 @@ describe('Subflow', function() { flow.stop().then(function() { done(); }); - },50); + },150); }); it("can access nested subflow env var", function(done) { @@ -875,9 +875,9 @@ describe('Subflow', function() { flow.stop().then(function() { done(); }); - },50); - },50); - },50); + },150); + },150); + },150); }); }); diff --git a/test/unit/@node-red/runtime/lib/nodes/flows/index_spec.js b/test/unit/@node-red/runtime/lib/nodes/flows/index_spec.js index a37d88f78..8865c5d3f 100644 --- a/test/unit/@node-red/runtime/lib/nodes/flows/index_spec.js +++ b/test/unit/@node-red/runtime/lib/nodes/flows/index_spec.js @@ -67,7 +67,10 @@ describe('flows/index', function() { }); return when.resolve(); }); - credentialsLoad = sinon.stub(credentials,"load",function() { + credentialsLoad = sinon.stub(credentials,"load",function(creds) { + if (creds && creds.hasOwnProperty("$") && creds['$'] === "fail") { + return when.reject("creds error"); + } return when.resolve(); }); flowCreate = sinon.stub(Flow,"create",function(parent, global, flow) { @@ -177,6 +180,23 @@ describe('flows/index', function() { }); }); + it('sets the full flow including credentials', function(done) { + var originalConfig = [ + {id:"t1-1",x:10,y:10,z:"t1",type:"test",wires:[]}, + {id:"t1",type:"tab"} + ]; + var credentials = {"t1-1":{"a":1}}; + + flows.init({log:mockLog, settings:{},storage:storage}); + flows.setFlows(originalConfig,credentials).then(function() { + credentialsClean.called.should.be.false(); + credentialsLoad.called.should.be.true(); + credentialsLoad.lastCall.args[0].should.eql(credentials); + flows.getFlows().flows.should.eql(originalConfig); + done(); + }); + }); + it('updates existing flows with partial deployment - nodes', function(done) { var originalConfig = [ {id:"t1-1",x:10,y:10,z:"t1",type:"test",wires:[]}, @@ -235,6 +255,20 @@ describe('flows/index', function() { }); }); + it('returns error if it cannot decrypt credentials', function(done) { + var originalConfig = [ + {id:"t1-1",x:10,y:10,z:"t1",type:"test",wires:[]}, + {id:"t1",type:"tab"} + ]; + var credentials = {"$":"fail"}; + + flows.init({log:mockLog, settings:{},storage:storage}); + flows.setFlows(originalConfig,credentials).then(function() { + done("Unexpected success when credentials couldn't be decrypted") + }).catch(function(err) { + done(); + }); + }); }); describe('#load', function() { diff --git a/test/unit/@node-red/runtime/lib/storage/localfilesystem/index_spec.js b/test/unit/@node-red/runtime/lib/storage/localfilesystem/index_spec.js index 464afa7e0..acfe3db43 100644 --- a/test/unit/@node-red/runtime/lib/storage/localfilesystem/index_spec.js +++ b/test/unit/@node-red/runtime/lib/storage/localfilesystem/index_spec.js @@ -19,6 +19,7 @@ var fs = require('fs-extra'); var path = require('path'); var sinon = require('sinon'); var NR_TEST_UTILS = require("nr-test-utils"); +var process = require("process"); var localfilesystem = NR_TEST_UTILS.require("@node-red/runtime/lib/storage/localfilesystem"); var log = NR_TEST_UTILS.require("@node-red/util").log; @@ -474,4 +475,44 @@ describe('storage/localfilesystem', function() { done(err); }); }); + + it('should handle flow file in random unc path and non-existent subfolder',function(done) { + // only test on win32 + if (process.platform !== 'win32') { + console.log('skipped test as not win32'); + done(); + return; + } + + // get a real windows path + var flowFile = path.win32.resolve(userDir+'/some/random/path'); + var rootdir = path.win32.resolve(userDir+'/some'); + // make it into a local UNC path + flowFile = flowFile.replace('C:\\', '\\\\localhost\\c$\\'); + localfilesystem.init({userDir:userDir, flowFile:flowFile}, mockRuntime).then(function() { + fs.existsSync(flowFile).should.be.false(); + localfilesystem.saveFlows(testFlow).then(function() { + fs.existsSync(flowFile).should.be.true(); + localfilesystem.getFlows().then(function(flows) { + flows.should.eql(testFlow); + // cleanup + fs.removeSync(rootdir); + done(); + }).catch(function(err) { + // cleanup + fs.removeSync(rootdir); + done(err); + }); + }).catch(function(err) { + // cleanup + fs.removeSync(rootdir); + done(err); + }); + }).catch(function(err) { + // cleanup + fs.removeSync(rootdir); + done(err); + }); + }); + }); diff --git a/test/unit/@node-red/runtime/lib/storage/localfilesystem/library_spec.js b/test/unit/@node-red/runtime/lib/storage/localfilesystem/library_spec.js index 70152ea1c..69b6e3da6 100644 --- a/test/unit/@node-red/runtime/lib/storage/localfilesystem/library_spec.js +++ b/test/unit/@node-red/runtime/lib/storage/localfilesystem/library_spec.js @@ -72,45 +72,52 @@ describe('storage/localfilesystem/library', function() { }); function createObjectLibrary(type) { - type = type ||"object"; - var objLib = path.join(userDir,"lib",type); + type = type || "object"; + var objLib = path.join(userDir, "lib", type); try { fs.mkdirSync(objLib); - } catch(err) { + } catch (err) { } - fs.mkdirSync(path.join(objLib,"A")); - fs.mkdirSync(path.join(objLib,"B")); - fs.mkdirSync(path.join(objLib,"B","C")); + fs.mkdirSync(path.join(objLib, "A")); + fs.mkdirSync(path.join(objLib, "B")); + fs.mkdirSync(path.join(objLib, "B", "C")); + fs.mkdirSync(path.join(objLib, "D")); if (type === "functions" || type === "object") { - fs.writeFileSync(path.join(objLib,"file1.js"),"// abc: def\n// not a metaline \n\n Hi",'utf8'); - fs.writeFileSync(path.join(objLib,"B","file2.js"),"// ghi: jkl\n// not a metaline \n\n Hi",'utf8'); + fs.writeFileSync(path.join(objLib, "file1.js"), "// abc: def\n// not a metaline \n\n Hi", 'utf8'); + fs.writeFileSync(path.join(objLib, "B", "file2.js"), "// ghi: jkl\n// not a metaline \n\n Hi", 'utf8'); + fs.writeFileSync(path.join(objLib, "D", "file3.js"), "// mno: 日本語テスト\n\nこんにちわ", 'utf8'); } if (type === "flows" || type === "object") { - fs.writeFileSync(path.join(objLib,"B","flow.json"),"Hi",'utf8'); + fs.writeFileSync(path.join(objLib, "B", "flow.json"), "Hi", 'utf8'); } } - it('should return a directory listing of library objects',function(done) { - localfilesystemLibrary.init({userDir:userDir}).then(function() { + it('should return a directory listing of library objects', function (done) { + localfilesystemLibrary.init({userDir: userDir}).then(function () { createObjectLibrary(); - localfilesystemLibrary.getLibraryEntry('object','').then(function(flows) { - flows.should.eql([ 'A', 'B', { abc: 'def', fn: 'file1.js' } ]); - localfilesystemLibrary.getLibraryEntry('object','B').then(function(flows) { - flows.should.eql([ 'C', { ghi: 'jkl', fn: 'file2.js' }, { fn: 'flow.json' } ]); - localfilesystemLibrary.getLibraryEntry('object','B/C').then(function(flows) { + localfilesystemLibrary.getLibraryEntry('object', '').then(function (flows) { + flows.should.eql([ 'A', 'B', 'D', { abc: 'def', fn: 'file1.js' }]); + localfilesystemLibrary.getLibraryEntry('object', 'B').then(function (flows) { + flows.should.eql([ 'C', { ghi: 'jkl', fn: 'file2.js' }, { fn: 'flow.json' }]); + localfilesystemLibrary.getLibraryEntry('object', 'B/C').then(function (flows) { flows.should.eql([]); - done(); - }).catch(function(err) { + localfilesystemLibrary.getLibraryEntry('object', 'D').then(function (flows) { + flows.should.eql([{ mno: '日本語テスト', fn: 'file3.js' }]); + done(); + }).catch(function (err) { + done(err); + }); + }).catch(function (err) { done(err); }); - }).catch(function(err) { + }).catch(function (err) { done(err); }); - }).catch(function(err) { + }).catch(function (err) { done(err); }); - }).catch(function(err) { + }).catch(function (err) { done(err); }); }); @@ -203,4 +210,35 @@ describe('storage/localfilesystem/library', function() { done(err); }); }); + + it('should return a newly saved library flow (multi-byte character)',function(done) { + localfilesystemLibrary.init({userDir:userDir}).then(function() { + createObjectLibrary("flows"); + localfilesystemLibrary.getLibraryEntry('flows','B').then(function(flows) { + flows.should.eql([ 'C', {fn:'flow.json'} ]); + var ft = path.join("B","D","file4"); + localfilesystemLibrary.saveLibraryEntry('flows',ft,{mno:'pqr'},"こんにちわこんにちわこんにちわ").then(function() { + setTimeout(function() { + localfilesystemLibrary.getLibraryEntry('flows',path.join("B","D")).then(function(flows) { + flows.should.eql([ { mno: 'pqr', fn: 'file4.json' } ]); + localfilesystemLibrary.getLibraryEntry('flows',ft+".json").then(function(body) { + body.should.eql("こんにちわこんにちわこんにちわ"); + done(); + }).catch(function(err) { + done(err); + }); + }).catch(function(err) { + done(err); + }) + }, 50); + }).catch(function(err) { + done(err); + }); + }).catch(function(err) { + done(err); + }); + }).catch(function(err) { + done(err); + }); + }); }); diff --git a/test/unit/@node-red/util/lib/log_spec.js b/test/unit/@node-red/util/lib/log_spec.js index 9a6f1ac28..c882dd2ae 100644 --- a/test/unit/@node-red/util/lib/log_spec.js +++ b/test/unit/@node-red/util/lib/log_spec.js @@ -224,5 +224,29 @@ describe("@node-red/util/log", function() { }); + it('it can log without exception', function() { + var msg = { + msg: { + mystrangeobj:"hello", + }, + }; + msg.msg.toString = function(){ + throw new Error('Exception in toString - should have been caught'); + } + msg.msg.constructor = { name: "strangeobj" }; + var ret = log.info(msg.msg); + }); + it('it can log an object but use .message', function() { + var msg = { + msg: { + message: "my special message", + mystrangeobj:"hello", + }, + }; + var ret = log.info(msg.msg); + sinon.assert.calledWithMatch(util.log,"my special message"); + }); + + }); diff --git a/test/unit/@node-red/util/lib/util_spec.js b/test/unit/@node-red/util/lib/util_spec.js index 17304e811..261dbc531 100644 --- a/test/unit/@node-red/util/lib/util_spec.js +++ b/test/unit/@node-red/util/lib/util_spec.js @@ -143,6 +143,10 @@ describe("@node-red/util/util", function() { cloned.req.should.equal(msg.req); cloned.res.should.equal(msg.res); }); + it('handles undefined values without throwing an error', function() { + var result = util.cloneMessage(undefined); + should.not.exist(result); + }) }); describe('getObjectProperty', function() { it('gets a property beginning with "msg."', function() { @@ -772,6 +776,117 @@ describe("@node-red/util/util", function() { var resultJson = JSON.parse(result.msg); resultJson.socket.should.eql('[internal]'); }); + it('object which fails to serialise', function(done) { + var msg = { + msg: { + obj:{ + cantserialise:{ + message:'this will not be displayed', + toJSON: function(val) { + throw 'this exception should have been caught'; + return 'should not display because we threw first'; + }, + }, + canserialise:{ + message:'this should be displayed', + } + }, + } + }; + var result = util.encodeObject(msg); + result.format.should.eql("error"); + var success = (result.msg.indexOf('cantserialise') > 0); + success &= (result.msg.indexOf('this exception should have been caught') > 0); + success &= (result.msg.indexOf('canserialise') > 0); + success.should.eql(1); + done(); + }); + it('object which fails to serialise - different error type', function(done) { + var msg = { + msg: { + obj:{ + cantserialise:{ + message:'this will not be displayed', + toJSON: function(val) { + throw new Error('this exception should have been caught'); + return 'should not display because we threw first'; + }, + }, + canserialise:{ + message:'this should be displayed', + } + }, + } + }; + var result = util.encodeObject(msg); + result.format.should.eql("error"); + var success = (result.msg.indexOf('cantserialise') > 0); + success &= (result.msg.indexOf('this exception should have been caught') > 0); + success &= (result.msg.indexOf('canserialise') > 0); + success.should.eql(1); + done(); + }); + it('very large object which fails to serialise should be truncated', function(done) { + var msg = { + msg: { + obj:{ + big:"", + cantserialise:{ + message:'this will not be displayed', + toJSON: function(val) { + throw new Error('this exception should have been caught'); + return 'should not display because we threw first'; + }, + }, + canserialise:{ + message:'this should be displayed', + } + }, + } + }; + + for (var i = 0; i < 1000; i++) { + msg.msg.obj.big += 'some more string '; + } + + var result = util.encodeObject(msg); + result.format.should.eql("error"); + var resultJson = JSON.parse(result.msg); + var success = (resultJson.message.length <= 1000); + success.should.eql(true); + done(); + }); + it('test bad toString', function(done) { + var msg = { + msg: { + mystrangeobj:"hello", + }, + }; + msg.msg.toString = function(){ + throw new Error('Exception in toString - should have been caught'); + } + msg.msg.constructor = { name: "strangeobj" }; + + var result = util.encodeObject(msg); + var success = (result.msg.indexOf('[Type not printable]') >= 0); + success.should.eql(true); + done(); + }); + it('test bad object constructor', function(done) { + var msg = { + msg: { + mystrangeobj:"hello", + constructor: { + get name(){ + throw new Error('Exception in constructor name'); + } + } + }, + }; + var result = util.encodeObject(msg); + done(); + }); + }); }); });