diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 92a0abb8a..d673df676 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -30,5 +30,5 @@ 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 forum/slack team. -- [ ] I have run `grunt` to verify the unit tests pass +- [ ] I have run `npm run test` to verify the unit tests pass - [ ] I have added suitable unit tests to cover the new/changed functionality diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..ad3a4ca7a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,15 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "github-actions" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "monthly" + groups: + github-actions: + patterns: + - "*" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 85fc1f92a..84140e311 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,25 +14,25 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out node-red repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: 'node-red' - name: Check out node-red-docker repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: 'node-red/node-red-docker' path: 'node-red-docker' - name: Check out node-red.github.io repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: 'node-red/node-red.github.io' path: 'node-red.github.io' - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v4 with: node-version: '16' - run: node ./node-red/.github/scripts/update-node-red-docker.js - name: Create Docker Pull Request - uses: peter-evans/create-pull-request@v2 + uses: peter-evans/create-pull-request@v6 with: token: ${{ secrets.NR_REPO_TOKEN }} committer: GitHub @@ -48,7 +48,7 @@ jobs: This PR was auto-generated by a GitHub Action. Any questions, speak to @knolleary - run: node ./node-red/.github/scripts/update-node-red-website.js - name: Create Website Pull Request - uses: peter-evans/create-pull-request@v2 + uses: peter-evans/create-pull-request@v6 with: token: ${{ secrets.NR_REPO_TOKEN }} committer: GitHub diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cdba11d2a..8e010c63e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,16 +12,15 @@ permissions: jobs: build: permissions: - checks: write # for coverallsapp/github-action to create new checks contents: read # for actions/checkout to fetch code runs-on: ubuntu-latest strategy: matrix: - node-version: [16, 18, 20] + node-version: [18, 20] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - name: Install Dependencies @@ -29,8 +28,3 @@ jobs: - name: Run tests run: | npm run test - # - name: Publish to coveralls.io - # if: ${{ matrix.node-version == 16 }} - # uses: coverallsapp/github-action@v1.1.2 - # with: - # github-token: ${{ github.token }} diff --git a/.gitignore b/.gitignore index d4c991688..6a2ebfaa1 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ docs .vscode .nyc_output sync.ffs_db +package-lock.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 26ec431bc..618c3d8b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,123 @@ +#### 3.1.5: Maintenance Release + +Runtime + + - Fix require of dns module (#4562) @knolleary + - Ensure global creds object is initialised when adding first cred (#4561) @knolleary + +#### 3.1.4: Maintenance Release + +Editor + + - Highlight errors in config node sidebar (#4529) @knolleary + - Improve feedback in import dialog to show conflicted nodes (#4550) @knolleary + - Modify node users info in config editor footer (#4528) @knolleary + - Handle modified-nodes deploy after replacing unknown config node (#4556) @knolleary + - Handle undefined default export when importing module (#4539) @knolleary + - Fix icon scaling for non .svg icons (#4491) @ralphwetzel + - (convertNode) Do not create the credentials object if there is nothing to export (#4544) @GogoVega + - Ensure subflow instance node has g property set (#4538) @knolleary + - Handle importing flow with existing subflow and instance node (#4546) @knolleary + - Update index.mst (#4483) @gorenje + - Include top level property name when copying path from context (#4527) @knolleary + - Add handling to disable items on context menu (#4500) @kazuhitoyokoi + - Focus Quick Add dialog from context menu (#4516) @kazuhitoyokoi + - Fix subflow ports in Quick Add dialog (#4518) @kazuhitoyokoi + - Fix location of subflow ports in palette (#4502) @kazuhitoyokoi + - Client/Editor Events: fix off-in-on pattern emulating once (#4484) @gorenje + - Restore caching busting functionality without using explict version number (#4512) @knolleary + - Do not translate the list of available languages (#4531) @GogoVega + - Add French translation of v3.1.3 changes (#4477) @GogoVega + - i18n(es-ES) Spanish Spain translation (#4495) @joebordes + - Add missing validation messages (#4487) @GogoVega + - Add Japanese translations for v3.1.3 (#4498) @kazuhitoyokoi + - Replace `rename` by `edit` for the menu flow label (#4506) @GogoVega + - Update editor.json fix typo in German translation (#4552) @guidoffm + +Runtime + + - Bump the github-actions group with 1 update (#4554) @app/dependabot + - Clone objects types when getting env values (#4519) @knolleary + - Ensure global-config credential env vars are merged on deploy (#4526) @knolleary + +Nodes + + - 21-httprequest.js remove unused code, because of broken use of toLowercase (#4522) @gorenje + +#### 3.1.3: Maintenance Release + +Editor + + - Add missing en-us messages (#4475) @knolleary + +#### 3.1.2: Maintenance Release + +Editor + + - Relax some node validators to allow undefined value (#4471) @knolleary + - Fix switch validation of typeof field (#4465) @knolleary + - Use move cursor when hovering on group border (#4467) @knolleary + - Added action list Chinese (Simplified and Traditional) translation + v3.1.1 changes (#4470) @wangyiyi2056 + - Add French translation of `action-list` + v3.1.1 changes (#4466) @GogoVega + + Runtime + + - Ensure nested groups inside subflows have their g props remapped (#4472) @knolleary + +#### 3.1.1: Maintenance Release + +Editor + + - Fix debug filter (#4461) @knolleary + - Fix various issues with debug pop-out window (#4459) @knolleary + - Ensure subflow instances keep track of their groups (#4457) @knolleary + - Fix `validateNodeProperty` without validator provided (#4455) @GogoVega + - Debounce node-removed notifications (#4453) @knolleary + - Don't try to load the parents of the first commit (#4448) @bonanitech + - Allow a theme to specifiy which theme mermaid should use (#4441) @knolleary + - Update browser title with flow name if set (#4427) @knolleary + - Ensure typeSearch handles undefined node definitions (#4423) @knolleary + - Ensure group w/h are imported if present (#4426) @knolleary + - Hide node status background when there is no status to show (#4425) @knolleary + - Add a close button to the restart-required notification (#4407) @knolleary + - Extend typedInput "num" type validity check to NaN, binary, octal & hex (#4371) @ralphwetzel + - Fix unintended new line in node name (#4399) @kazuhitoyokoi + - Ctrl-Enter does not close tray (Monaco) #4377 (#4382) @hazymat + - fix buffer viewer to handle 0b style binary (#4393) @dceejay + - Rework mermaid integration to support off-DOM rendering (#4364) @knolleary + - Add missing nls labels to context menu (#4365) @knolleary + +Runtime + + - Bump the github-actions group with 2 updates (#4404) @app/dependabot + - Handle unknown node reference inside subflow module (#4460) @knolleary + - Add modules.install audit event when external module installed (#4452) @knolleary + - Allow import of modules with subpath in specifier (#4451) @knolleary + - Update node-red-admin version (#4438) @knolleary + - Handle false-like env vars properly (#4411) @knolleary + - Only save settings once during node load process (#4409) @knolleary + - Ensure global-config nodes lookup cred values properly (#4405) @knolleary + - Handle credential env var evaluation when no value set (#4362) @knolleary + - Don't commit package-lock.json (#4354) @bonanitech + - Fix env evaluation when one env references another in the same object (#4361) @knolleary + - Add dependabot for Github Actions (#4312) @Rotzbua + - Update outdated Github Actions (#4311) @Rotzbua + - github: Request `npm run test` in PR template (#4348) @ZJvandeWeg + - Add French translation of v3.1.0-beta.4 changes + slight improvements (#4329) @GogoVega + - Handle nodes with multiple input handlers properly (#4332) @knolleary + - Soften the language around unrequited PRs (#4351) @knolleary + +Nodes + + - CSV: make CSV export way faster by not re-allocating and handling huge string (#4349) @Fadoli + - Delay: Fix regression in delay node to not pass on msg.reset (#4350) @dceejay + - Link Call: Handle undefined linkType value for existing link-call nodes (#4331) @knolleary + - MQTT: Guard against node.broker being undefined (#4454) @knolleary + - MQTT: check topic length > 0 before publish (#4416) @dceejay + - Switch/Change: Improve validation of switch/change node rules (#4368) @knolleary + - Template: Fix height of description editor in template node (#4346) @kazuhitoyokoi + - Various: Add validators to any fields using msg-typed Input (#4440) @knolleary + #### 3.1.0: Milestone Release Editor diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 95287d81f..f8fb04304 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,6 +16,9 @@ behavior to the project's core team at team@nodered.org. Please raise any bug reports on the relevant project's issue tracker. Be sure to search the list to see if your issue has already been raised. +If your issue is more of a question on how to do something with Node-RED, please +consider using the [community forum](https://discourse.nodered.org/). + A good bug report is one that make it easy for us to understand what you were trying to do and what went wrong. @@ -35,14 +38,18 @@ For feature requests, please raise them on the [forum](https://discourse.nodered ## Pull-Requests If you want to raise a pull-request with a new feature, or a refactoring -of existing code, it may well get rejected if you haven't discussed it on -the [forum](https://discourse.nodered.org) first. +of existing code, please come and discuss it with us first. We prefer to +do it that way to make sure your time and effort is well spent on something +that fits with our goals. + +If you've got a bug-fix or similar for us, then you are most welcome to +get it raised - just make sure you link back to the issue it's fixing and +try to include some tests! All contributors need to sign the OpenJS Foundation's Contributor License Agreement. It is an online process and quick to do. If you raise a pull-request without having signed the CLA, you will be prompted to do so automatically. - ### Code Branches When raising a PR for a fix or a new feature, it is important to target the right branch. diff --git a/Gruntfile.js b/Gruntfile.js index 44f4c97f6..09b057837 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -151,7 +151,6 @@ module.exports = function(grunt) { "packages/node_modules/@node-red/editor-client/src/js/font-awesome.js", "packages/node_modules/@node-red/editor-client/src/js/history.js", "packages/node_modules/@node-red/editor-client/src/js/validators.js", - "packages/node_modules/@node-red/editor-client/src/js/ui/mermaid.js", "packages/node_modules/@node-red/editor-client/src/js/ui/utils.js", "packages/node_modules/@node-red/editor-client/src/js/ui/common/editableList.js", "packages/node_modules/@node-red/editor-client/src/js/ui/common/treeList.js", diff --git a/package.json b/package.json index 2af24212d..173e4c929 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "is-utf8": "0.2.1", "js-yaml": "4.1.0", "json-stringify-safe": "5.0.1", - "jsonata": "1.8.6", + "jsonata": "2.0.4", "lodash.clonedeep": "^4.5.0", "media-typer": "1.1.0", "memorystore": "1.6.7", @@ -64,7 +64,7 @@ "mqtt": "4.3.7", "multer": "1.4.5-lts.1", "mustache": "4.2.0", - "node-red-admin": "^3.1.0", + "node-red-admin": "^3.1.2", "node-watch": "0.7.4", "nopt": "5.0.0", "oauth2orize": "1.11.1", @@ -109,7 +109,7 @@ "jquery-i18next": "1.2.1", "jsdoc-nr-template": "github:node-red/jsdoc-nr-template", "marked": "4.3.0", - "mermaid": "^9.4.3", + "mermaid": "^10.4.0", "minami": "1.2.3", "mocha": "9.2.2", "node-red-node-test-helper": "^0.3.2", @@ -122,6 +122,6 @@ "supertest": "6.3.3" }, "engines": { - "node": ">=14" + "node": ">=18" } } diff --git a/packages/node_modules/@node-red/editor-api/lib/admin/context.js b/packages/node_modules/@node-red/editor-api/lib/admin/context.js index 54bfd9f85..4124b812d 100644 --- a/packages/node_modules/@node-red/editor-api/lib/admin/context.js +++ b/packages/node_modules/@node-red/editor-api/lib/admin/context.js @@ -33,6 +33,9 @@ module.exports = { store: req.query['store'], req: apiUtils.getRequestLogObject(req) } + if (req.query['keysOnly'] !== undefined) { + opts.keysOnly = true + } runtimeAPI.context.getValue(opts).then(function(result) { res.json(result); }).catch(function(err) { 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 42be1f270..648daa09b 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 @@ -51,7 +51,7 @@ module.exports = { var ui = require("./ui"); - ui.init(runtimeAPI); + ui.init(settings, runtimeAPI); const editorApp = apiUtil.createExpressApp(settings) diff --git a/packages/node_modules/@node-red/editor-api/lib/editor/theme.js b/packages/node_modules/@node-red/editor-api/lib/editor/theme.js index c3e8f975e..e5c3904c7 100644 --- a/packages/node_modules/@node-red/editor-api/lib/editor/theme.js +++ b/packages/node_modules/@node-red/editor-api/lib/editor/theme.js @@ -339,6 +339,8 @@ module.exports = { } theme.codeEditor = theme.codeEditor || {} theme.codeEditor.options = Object.assign({}, themePlugin.monacoOptions, theme.codeEditor.options); + + theme.mermaid = Object.assign({}, themePlugin.mermaid, theme.mermaid) } activeThemeInitialised = true; } diff --git a/packages/node_modules/@node-red/editor-api/lib/editor/ui.js b/packages/node_modules/@node-red/editor-api/lib/editor/ui.js index 998816f5e..e7bf15069 100644 --- a/packages/node_modules/@node-red/editor-api/lib/editor/ui.js +++ b/packages/node_modules/@node-red/editor-api/lib/editor/ui.js @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. **/ +const crypto = require('crypto') var express = require('express'); var fs = require("fs"); var path = require("path"); @@ -24,13 +25,16 @@ var apiUtils = require("../util"); var theme = require("./theme"); var runtimeAPI; +let settings; var editorClientDir = path.dirname(require.resolve("@node-red/editor-client")); var defaultNodeIcon = path.join(editorClientDir,"public","red","images","icons","arrow-in.svg"); var editorTemplatePath = path.join(editorClientDir,"templates","index.mst"); var editorTemplate; +let cacheBuster module.exports = { - init: function(_runtimeAPI) { + init: function(_settings, _runtimeAPI) { + settings = _settings; runtimeAPI = _runtimeAPI; editorTemplate = fs.readFileSync(editorTemplatePath,"utf8"); Mustache.parse(editorTemplate); @@ -91,6 +95,12 @@ module.exports = { }, editor: async function(req,res) { + if (!cacheBuster) { + // settings.instanceId is set asynchronously to the editor-api + // being initiaised. So we defer calculating the cacheBuster hash + // until the first load of the editor + cacheBuster = crypto.createHash('md5').update(`${settings.version || 'version'}-${settings.instanceId || 'instanceId'}`).digest("hex").substring(0,12) + } let sessionMessages; if (req.session && req.session.messages) { @@ -99,6 +109,7 @@ module.exports = { } res.send(Mustache.render(editorTemplate,{ sessionMessages, + cacheBuster, ...await theme.context() })); }, diff --git a/packages/node_modules/@node-red/editor-client/locales/de/editor.json b/packages/node_modules/@node-red/editor-client/locales/de/editor.json index f2955c266..d47241617 100644 --- a/packages/node_modules/@node-red/editor-client/locales/de/editor.json +++ b/packages/node_modules/@node-red/editor-client/locales/de/editor.json @@ -109,7 +109,6 @@ "selectionToSubflow": "Auswahl in Subflow umwandeln", "flows": "Flow", "add": "Hinzufügen", - "rename": "Umbenennen", "delete": "Löschen", "keyboardShortcuts": "Tastenkürzel", "login": "Anmelden", @@ -1076,7 +1075,7 @@ "git-auth-error": "Git-Authentifizierungsfehler" }, "create-success": { - "success": "Sie haben Ihr erstes Projekt erfolgreich erstduellt!", + "success": "Sie haben Ihr erstes Projekt erfolgreich erstellt!", "desc0": "Sie können jetzt Node-RED wie bisher verwenden.", "desc1": "Im Tab 'Info' in der Seitenleiste wird angezeigt, welches das aktuelle Projekt ist. Über die Schaltfläche rechts neben dem Projektnamen gelangt man zu 'Projekteinstellungen'.", "desc2": "Im Tab 'Commit-Historie' in der Seitenleiste werden alle Dateien angezeigt, die sich in Ihrem Projekt geändert haben, und um sie ins lokale Repository zu übertragen (commit). Es zeigt Ihnen eine vollständige Historie Ihrer Commits an und ermöglicht es Ihnen, Ihre Commits in ein (remote) Server-Repository zu schieben (push)." @@ -1172,17 +1171,6 @@ "diagnostics": { "title": "System-Informationen" }, - "languages": { - "de": "Deutsch", - "en-US": "Englisch", - "fr": "Französisch", - "ja": "Japanisch", - "ko": "Koreanisch", - "pt-BR":"Portugiesisch", - "ru": "Russisch", - "zh-CN": "Chinesisch (Vereinfacht)", - "zh-TW": "Chinesisch (Traditionell)" - }, "validator": { "errors": { "invalid-json": "Ungültige JSON-Daten: __error__", 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 8742a6c6f..5f69475ed 100644 --- 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 @@ -113,7 +113,7 @@ "displayStatus": "Show node status", "displayConfig": "Configuration nodes", "import": "Import", - "importExample": "Import Example Flow", + "importExample": "Import example flow", "export": "Export", "search": "Search flows", "searchInput": "search your flows", @@ -122,7 +122,6 @@ "selectionToSubflow": "Selection to Subflow", "flows": "Flows", "add": "Add", - "rename": "Rename", "delete": "Delete", "keyboardShortcuts": "Keyboard shortcuts", "login": "Login", @@ -130,6 +129,11 @@ "editPalette": "Manage palette", "other": "Other", "showTips": "Show tips", + "showNodeHelp": "Show node help", + "enableSelectedNodes": "Enable selected nodes", + "disableSelectedNodes": "Disable selected nodes", + "showSelectedNodeLabels": "Show selected node labels", + "hideSelectedNodeLabels": "Hide selected node labels", "showWelcomeTours": "Show guided tours for new versions", "help": "Node-RED website", "projects": "Projects", @@ -299,7 +303,8 @@ "missingType": "Input not a valid flow - item __index__ missing 'type' property" }, "conflictNotification1": "Some of the nodes you are importing already exist in your workspace.", - "conflictNotification2": "Select which nodes to import and whether to replace the existing nodes, or to import a copy of them." + "conflictNotification2": "Select which nodes to import and whether to replace the existing nodes, or to import a copy of them.", + "alreadyExists": "This node already exists" }, "copyMessagePath": "Path copied", "copyMessageValue": "Value copied", @@ -511,8 +516,8 @@ "selectAllConnected": "Select connected", "addRemoveNode": "Add/remove node from selection", "editSelected": "Edit selected node", - "deleteSelected": "Delete selected nodes or link", - "deleteReconnect": "Delete and Reconnect", + "deleteSelected": "Delete selection", + "deleteReconnect": "Delete and reconnect", "importNode": "Import nodes", "exportNode": "Export nodes", "nudgeNode": "Move selected nodes (1px)", @@ -703,7 +708,7 @@ "triggerAction": "Trigger action", "find": "Find in workspace", "copyItemUrl": "Copy item url", - "copyURL2Clipboard": "Copied url to clipboard", + "copyURL2Clipboard": "Copied url to clipboard", "showFlow": "Show", "hideFlow": "Hide" }, @@ -920,6 +925,12 @@ "jsonata": "expression", "env": "env variable", "cred": "credential" + }, + "date": { + "format": { + "timestamp": "milliseconds since epoch", + "object": "JavaScript Date Object" + } } }, "editableList": { @@ -1202,22 +1213,22 @@ "title": "System Info" }, "languages": { - "de": "German", + "de": "Deutsch", "en-US": "English", - "fr": "French", - "ja": "Japanese", + "es-ES": "Español (España)", + "fr": "Français", + "ja": "日本語", "ko": "Korean", - "pt-BR":"Portuguese", - "ru": "Russian", - "zh-CN": "Chinese(Simplified)", - "zh-TW": "Chinese(Traditional)" + "pt-BR": "Português (Brasil)", + "ru": "Русский", + "zh-CN": "简体中文", + "zh-TW": "繁體中文" }, "validator": { "errors": { "invalid-json": "Invalid JSON data: __error__", - "invalid-json-prop": "__prop__: invalid JSON data: __error__", + "invalid-expr": "Invalid JSONata expression: __error__", "invalid-prop": "Invalid property expression", - "invalid-prop-prop": "__prop__: invalid property expression", "invalid-num": "Invalid number", "invalid-num-prop": "__prop__: invalid number", "invalid-regexp": "Invalid input pattern", @@ -1229,6 +1240,7 @@ } }, "contextMenu": { + "showActionList": "Show action list", "insert": "Insert", "node": "Node", "junction": "Junction", diff --git a/packages/node_modules/@node-red/editor-client/locales/es-ES/editor.json b/packages/node_modules/@node-red/editor-client/locales/es-ES/editor.json new file mode 100644 index 000000000..2655dfe27 --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/locales/es-ES/editor.json @@ -0,0 +1,1235 @@ +{ + "common": { + "label": { + "name": "Nombre", + "ok": "Vale", + "done": "Hecho", + "cancel": "Cancelar", + "delete": "Eliminar", + "close": "Cerrar", + "load": "Cargar", + "save": "Guardar", + "import": "Importar", + "export": "Exportar", + "back": "Atrás", + "next": "Siguiente", + "clone": "Clonar proyecto", + "cont": "Continuar", + "style": "Estilo", + "line": "Contorno", + "fill": "Rellenar", + "label": "Etiqueta", + "color": "Color", + "position": "Posición", + "enable": "Habilitar", + "disable": "Deshabilitar", + "upload": "Subir", + "lock": "Bloquear", + "unlock": "Desbloquear", + "locked": "Bloqueado", + "unlocked": "Desbloqueado" + }, + "type": { + "string": "texto", + "number": "número", + "boolean": "booleano", + "array": "array", + "buffer": "buffer", + "object": "objeto", + "jsonString": "texto JSON", + "undefined": "indefinido", + "null": "nulo" + } + }, + "event": { + "loadPlugins": "Cargando Extensiones", + "loadPalette": "Cargando Paleta", + "loadNodeCatalogs": "Cargando catálogos de Nodos", + "loadNodes": "Cargando Nodos __count__", + "loadFlows": "Cargando Flujos", + "importFlows": "Añadiendo Flujos al espacio de trabajo", + "importError": "

Error añadiendo flujos

__message__

", + "loadingProject": "Cargando proyecto" + }, + "workspace": { + "defaultName": "Flujo __number__", + "editFlow": "Editar flujo: __name__", + "confirmDelete": "Confirmar eliminación", + "delete": "¿Estás seguro de que quieres eliminar '__label__'?", + "dropFlowHere": "Suelta el flujo aquí", + "dropImageHere": "Suelta la imagen aquí", + "addFlow": "Añadir flujo", + "addFlowToRight": "Añadir flujo a la derecha", + "closeFlow": "Cerrar flujo", + "hideFlow": "Esconder flujo", + "hideOtherFlows": "Esconder otros flujos", + "showAllFlows": "Mostrar todos los flujos (__count__ escondidos)", + "hideAllFlows": "Esconder todos los flujos", + "hiddenFlows": "Listar __count__ flujo escondido", + "hiddenFlows_plural": "Listar __count__ flujos escondidos", + "showLastHiddenFlow": "Abrir flujo escondido", + "listFlows": "Listar flujos", + "listSubflows": "Listar subflujos", + "status": "Estado", + "enabled": "Habilitado", + "disabled": "Deshabilitado", + "info": "Descripción", + "selectNodes": "Haz clic en los nodos para seleccionar", + "enableFlow": "Habilitar flujo", + "disableFlow": "Deshabilitar flujo", + "lockFlow": "Bloquear flujo", + "unlockFlow": "desbloquear flujo", + "moveToStart": "Mover flujo al inicio", + "moveToEnd": "Mover flujo al final" + }, + "menu": { + "label": { + "view": { + "view": "Vista", + "grid": "Rejilla", + "storeZoom": "Restaurar nivel de zoom al iniciar", + "storePosition": "Restaurar la posición de desplazamiento al iniciar", + "showGrid": "Mostrar rejilla", + "snapGrid": "Ajustar a rejilla", + "gridSize": "Tamaño rejilla", + "textDir": "Dirección Texto", + "defaultDir": "Predeterminado", + "ltr": "Izquierda-a-derecha", + "rtl": "Derecha-a-izquierda", + "auto": "Contextual", + "language": "Idioma", + "browserDefault": "El del Navegador" + }, + "sidebar": { + "show": "Mostrar barra lateral" + }, + "palette": { + "show": "Mostrar paleta" + }, + "edit": "Editar", + "settings": "Ajustes", + "userSettings": "Ajustes de usuario", + "nodes": "Nodos", + "displayStatus": "Mostrar estado del nodo", + "displayConfig": "Nodos de configuración", + "import": "Importar", + "importExample": "Importar flujo de ejemplo", + "export": "Exportar", + "search": "Buscar flujos", + "searchInput": "busca tus flujos", + "subflows": "Subflujos", + "createSubflow": "Crear subflujo", + "selectionToSubflow": "Convertir selección a Subflujo", + "flows": "Flujos", + "add": "Añadir", + "delete": "Eliminar", + "keyboardShortcuts": "Atajos de teclado", + "login": "Acceso", + "logout": "Salir", + "editPalette": "Administrar paleta", + "other": "Otro", + "showTips": "Mostrar ayudas", + "showNodeHelp": "Mostrar ayuda nodo", + "enableSelectedNodes": "Habilitar nodos seleccionados", + "disableSelectedNodes": "Deshabilitar nodos seleccionados", + "showSelectedNodeLabels": "Mostrar etiquetas de nodos seleccionados", + "hideSelectedNodeLabels": "Esconder etiquetas de nodos seleccionados", + "showWelcomeTours": "Mostrar visitas guiadas para nuevas versiones", + "help": "Sitio web de Node-RED", + "projects": "Proyectos", + "projects-new": "Nuevo", + "projects-open": "Abrir", + "projects-settings": "Ajustes del proyecto", + "showNodeLabelDefault": "Mostrar etiqueta de nodos añadidos recientemente", + "codeEditor": "Editor de código", + "groups": "Grupos", + "groupSelection": "Agrupar selección", + "ungroupSelection": "Desagrupar selección", + "groupMergeSelection": "Fusionar selección", + "groupRemoveSelection": "Sacar del grupo", + "arrange": "Organizar", + "alignLeft": "Alinear a la izquierda", + "alignCenter": "Alinear al centro", + "alignRight": "Alinear a la derecha", + "alignTop": "Alinear arriba", + "alignMiddle": "Alinear en medio", + "alignBottom": "Alinear abajo", + "distributeHorizontally": "Distribuir horizontalmente", + "distributeVertically": "Distribuir verticalmente", + "moveToBack": "Mover al fondo", + "moveToFront": "Mover al frente", + "moveBackwards": "Mover atrás", + "moveForwards": "Mover adelante" + } + }, + "actions": { + "toggle-navigator": "Alternar navegador", + "zoom-out": "Alejar", + "zoom-reset": "Restablecer zoom", + "zoom-in": "Acercar", + "search-flows": "Buscar flujos", + "search-prev": "Anterior", + "search-next": "Siguiente", + "search-counter": "\"__term__\" __result__ de __count__" + }, + "user": { + "loggedInAs": "Conectado como __name__", + "username": "Usuario", + "password": "Contraseña", + "login": "Acceso", + "loginFailed": "Acceso fallido", + "notAuthorized": "No autorizado", + "errors": { + "settings": "Debes iniciar sesión para acceder a los ajustes", + "deploy": "Debes iniciar sesión para instanciar cambios", + "notAuthorized": "Debes iniciar sesión para realizar esta acción" + } + }, + "notification": { + "state": { + "flowsStopped": "Flujos detenidos", + "flowsStarted": "Flujos iniciados" + }, + "warning": "Aviso: __message__", + "warnings": { + "undeployedChanges": "nodo tiene cambios no instanciados", + "nodeActionDisabled": "acciones del nodo deshabilitados", + "nodeActionDisabledSubflow": "acciones del nodo deshabilitados dentro del subflujo", + "missing-types": "

Flujos detenidos por falta de tipo de nodo.

", + "missing-modules": "

Flujos detenidos por módulos no encontrados.

", + "safe-mode": "

Flujos detenidos en modo seguro.

Puedes modificar los flujos e instanciar los cambios para reiniciar.

", + "restartRequired": "Node-RED debe reiniciarse para habilitar los módulos actualizados", + "credentials_load_failed": "

Los flujos se detuvieron porque las credenciales no se pudieron descifrar.

El archivo de credenciales de flujo está cifrado, pero la clave de cifrado del proyecto falta o no es válida.

", + "credentials_load_failed_reset": "

No se pudieron descifrar las credenciales

El archivo de credenciales de flujo está cifrado, y falta la clave de cifrado del proyecto o no es válida.

El archivo de credenciales de flujo se restablecerá en la siguiente instanciación. Se borrarán todas las credenciales de flujo existentes.

", + "missing_flow_file": "

No se encontró el archivo de flujo del proyecto.

El proyecto no está configurado con un archivo de flujo.

", + "missing_package_file": "

No se encontró el archivo del paquete del proyecto.

Al proyecto le falta un archivo package.json.

", + "project_empty": "

El proyecto está vacío.

¿Quieres crear un conjunto predeterminado de archivos de proyecto?
De lo contrario, tendrás que agregar archivos manualmente al proyecto fuera del editor.

", + "project_not_found": "

Proyecto '__project__' no encontrado.

", + "git_merge_conflict": "

Falló la fusión automática de cambios.

Soluciona los conflictos no combinados y luego confirma los resultados.

" + }, + "error": "Error: __message__", + "errors": { + "lostConnection": "Se perdió la conexión al servidor, reconectándo...", + "lostConnectionReconnect": "Se perdió la conexión al servidor, reconectándo en __time__s.", + "lostConnectionTry": "Intentar ahora", + "cannotAddSubflowToItself": "No se puede añadir subflujo a si mismo", + "cannotAddCircularReference": "No se puede añadir subflujo: se detectó una referencia circular", + "unsupportedVersion": "

Usando una versión no compatible de Node.js

Debes actualizar a la última versión LTS de Node.js

", + "failedToAppendNode": "

Fallo al cargar '__module__'

__error__

" + }, + "project": { + "change-branch": "Cambiar a rama local '__project__'", + "merge-abort": "Fusión Git abortado", + "loaded": "Proyecto '__project__' cargado", + "updated": "Proyecto '__project__' actualizado", + "pull": "Proyecto '__project__' actualizado", + "revert": "Proyecto '__project__' revertido", + "merge-complete": "Fusión Git completado", + "setupCredentials": "Configurar credenciales", + "setupProjectFiles": "Configurar archivos de proyecto", + "no": "No, gracias", + "createDefault": "Crear archivos de proyecto predeterminados", + "mergeConflict": "Mostrar conflictos fusión" + }, + "label": { + "manage-project-dep": "Gestionar las dependencias del proyecto", + "setup-cred": "Configurar credenciales", + "setup-project": "Configurar ficheros proyecto", + "create-default-package": "Crear archivo de paquete predeterminado", + "no-thanks": "No gracias", + "create-default-project": "Crear archivos de proyecto predeterminados", + "show-merge-conflicts": "Mostrar conflictos fusión", + "unknownNodesButton": "Buscar nodos desconocidos" + } + }, + "clipboard": { + "clipboard": "Portapapeles", + "nodes": "Nodos", + "node": "__count__ nodo", + "node_plural": "__count__ nodos", + "configNode": "__count__ nodo de configuración", + "configNode_plural": "__count__ nodos de configuración", + "group": "__count__ grupo", + "group_plural": "__count__ grupos", + "flow": "__count__ flujo", + "flow_plural": "__count__ flujos", + "subflow": "__count__ subflujo", + "subflow_plural": "__count__ subflujos", + "replacedNodes": "__count__ nodo reemplazado", + "replacedNodes_plural": "__count__ nodos reemplazados", + "pasteNodes": "Pegar flujo JSON o", + "selectFile": "seleccionar un archivo para importar", + "importNodes": "Importar nodos", + "exportNodes": "Exportar nodos", + "download": "Descargar", + "importUnrecognised": "Tipo importado no reconocido:", + "importUnrecognised_plural": "Tipos importados no reconocidos:", + "importDuplicate": "Nodo duplicado importado:", + "importDuplicate_plural": "Nodos duplicados importados:", + "nodesExported": "Nodos exportados al portapapeles", + "nodesImported": "Importado:", + "nodeCopied": "__count__ nodo copiado", + "nodeCopied_plural": "__count__ nodos copiados", + "groupCopied": "__count__ grupo copiado", + "groupCopied_plural": "__count__ grupos copiados", + "groupStyleCopied": "Estilo de grupo copiado", + "invalidFlow": "Flujo inválido: __message__", + "recoveredNodes": "Nodos recuperados", + "recoveredNodesInfo": "A los nodos de este flujo les faltaba una identificación de flujo válida cuando se importaron. Se han agregado a este flujo para que puedas restaurarlos o eliminarlos.", + "recoveredNodesNotification": "

Nodos importados sin una identificación de flujo válida

Se han agregado a un nuevo flujo llamado '__flowName__'.

", + "export": { + "selected": "nodos seleccionados", + "current": "flujo actual", + "all": "todos los flujos", + "compact": "compacto", + "formatted": "formateado", + "copy": "Copiar al portapapeles", + "export": "Exportar a librería", + "exportAs": "Exportar como", + "overwrite": "Reemplazar", + "exists": "

\"__file__\" ya existe.

¿Quieres reemplazarlo?

" + }, + "import": { + "import": "Importar a", + "importSelected": "Importar seleccionado", + "importCopy": "Importar copia", + "viewNodes": "Ver nodos...", + "newFlow": "nuevo flujo", + "replace": "reemplazar", + "errors": { + "notArray": "Entrada no es un Array JSON", + "itemNotObject": "La entrada no es un flujo válido - elemento __index__ no es un objeto de nodo", + "missingId": "La entrada no es un flujo válido - elemento __index__ falta la propiedad 'id'", + "missingType": "La entrada no es un flujo válido - elemento __index__ falta la propiedad 'type'" + }, + "conflictNotification1": "Algunos de los nodos que estás importando ya existen en tu espacio de trabajo.", + "conflictNotification2": "Selecciona qué nodos importar y si reemplazar los nodos existentes o importar una copia de los mismos." + }, + "copyMessagePath": "Ruta copiada", + "copyMessageValue": "Valor copiado", + "copyMessageValue_truncated": "Valor truncado copiado" + }, + "deploy": { + "deploy": "Instanciar", + "full": "Completo", + "fullDesc": "Instanciación todo en el espacio de trabajo.", + "modifiedFlows": "Flujos Modificados", + "modifiedFlowsDesc": "Solo instancia flujos que han cambiado", + "modifiedNodes": "Nodos Modificados", + "modifiedNodesDesc": "Solo instancia nodos que han cambiado", + "startFlows": "Iniciar", + "startFlowsDesc": "Iniciar Flujos", + "stopFlows": "Detener", + "stopFlowsDesc": "Detener Flujos", + "restartFlows": "Reiniciar Flujos", + "restartFlowsDesc": "Reinicia los flujos instanciados.", + "successfulDeploy": "Instanciación con éxito", + "successfulRestart": "Flujos reiniciados exitosamente", + "deployFailed": "Instanciación fallida: __message__", + "unusedConfigNodes": "Tienes algunos nodos de configuración no utilizados.", + "unusedConfigNodesButton": "Buscar nodos de configuración no utilizados", + "unknownNodesButton": "Buscar nodos desconocidos", + "invalidNodesButton": "Buscar nodos inválidos", + "errors": { + "noResponse": "no hay respuesta del servidor" + }, + "confirm": { + "button": { + "ignore": "Ignorar", + "confirm": "Confirmar instanciación", + "review": "Revisar cambios", + "cancel": "Cancelar", + "merge": "Fusionar", + "overwrite": "Ignorar e instanciar" + }, + "undeployedChanges": "Tienes cambios no instanciados.\n\nAl salir de esta página, se perderán estos cambios.", + "improperlyConfigured": "El espacio de trabajo contiene algunos nodos que no están configurados correctamente:", + "unknown": "El espacio de trabajo contiene algunos tipos de nodos desconocidos:", + "confirm": "¿Estás seguro de que quieres instanciar?", + "doNotWarn": "no advertir sobre esto", + "conflict": "El servidor está ejecutando un conjunto de flujos más reciente.", + "backgroundUpdate": "Los flujos en el servidor han sido actualizados..", + "conflictChecking": "Comprobando si los cambios se pueden fusionar automáticamente", + "conflictAutoMerge": "Los cambios no incluyen conflictos y se pueden fusionar automáticamente.", + "conflictManualMerge": "Los cambios incluyen conflictos que deben resolverse antes de poder instanciarse.", + "plusNMore": "+ __count__ más" + } + }, + "eventLog": { + "title": "Registro de eventos", + "view": "Ver registro" + }, + "diff": { + "unresolvedCount": "__count__ conflicto no resuelto", + "unresolvedCount_plural": "__count__ conflictos no resueltos", + "globalNodes": "Nodos globales", + "flowProperties": "Propiedades flujo", + "type": { + "added": "añadido", + "changed": "modificado", + "unchanged": "sin modificar", + "deleted": "eliminado", + "flowDeleted": "flujo eliminado", + "flowAdded": "flujo añadido", + "movedTo": "movido a __id__", + "movedFrom": "movido desde __id__" + }, + "nodeCount": "__count__ nodo", + "nodeCount_plural": "__count__ nodos", + "local": "Cambios locales", + "remote": "Cambios remotos", + "reviewChanges": "Revisar Cambios", + "noBinaryFileShowed": "No se puede mostrar el contenido del archivo binario", + "viewCommitDiff": "Ver cambios de commit", + "compareChanges": "Comparar Cambios", + "saveConflict": "Guardar resolución de conflictos", + "conflictHeader": "__resolved__ de __unresolved__ conflictos resueltos", + "commonVersionError": "La versión común no contiene JSON válido:", + "oldVersionError": "La versión anterior no contiene JSON válido:", + "newVersionError": "La versión nueva no contiene JSON válido:" + }, + "subflow": { + "editSubflowInstance": "Editar subflujo: __name__", + "editSubflow": "Editar plantilla subflujo: __name__", + "edit": "Editar plantilla subflujo", + "subflowInstances": "Hay __count__ instancia de esta plantilla de subflujo", + "subflowInstances_plural": "Hay __count__ instancias de esta plantilla de subflujo", + "editSubflowProperties": "editar propiedades", + "input": "entradas:", + "output": "salidas:", + "status": "nodo de estado", + "deleteSubflow": "eliminar subflujo", + "confirmDelete": "¿Estás seguro de que quieres eliminar este subflujo?", + "info": "Descripción", + "category": "Categoría", + "module": "Módulo", + "license": "Licencia", + "licenseNone": "ninguna", + "licenseOther": "Otra", + "type": "Tipo de nodo", + "version": "Versión", + "versionPlaceholder": "x.y.z", + "keys": "Palabras clave", + "keysPlaceholder": "Palabras clave separadas por comas", + "author": "Autor", + "authorPlaceholder": "Tu Nombre ", + "desc": "Descripción", + "env": { + "restore": "Restaurar al valor predeterminado del subflujo", + "remove": "Eliminar variable de entorno" + }, + "errors": { + "noNodesSelected": "Cannot create subflow: no nodes selected", + "acrossMultipleGroups": "Cannot create subflow across multiple groups", + "multipleInputsToSelection": "Cannot create subflow: multiple inputs to selection" + } + }, + "group": { + "editGroup": "Editar grupo: __name__", + "errors": { + "cannotCreateDiffGroups": "Cannot create group using nodes from different groups", + "cannotAddSubflowPorts": "Cannot add subflow ports to a group" + } + }, + "editor": { + "configEdit": "Editar", + "configAdd": "Añadir", + "configUpdate": "Actualizar", + "configDelete": "Eliminar", + "nodesUse": "__count__ nodo utiliza esta configuración", + "nodesUse_plural": "__count__ nodos utilizan esta configuración", + "addNewConfig": "Añadir nuevo nodo de configuración __type__", + "editNode": "Editar nodo __type__", + "editConfig": "Editar nodo de configuración __type__", + "addNewType": "Añadir nuevo __type__...", + "nodeProperties": "propiedades del nodo", + "label": "Etiqueta", + "color": "Color", + "portLabels": "Etiquetas de puerto", + "labelInputs": "Entradas", + "labelOutputs": "Salidas", + "settingIcon": "Icono", + "default": "predeterminado", + "noDefaultLabel": "ninguno", + "defaultLabel": "usar etiqueta predeterminada", + "searchIcons": "Buscar iconos", + "useDefault": "usar predeterminado", + "description": "Descripción", + "show": "Mostrar", + "hide": "Ocultar", + "locale": "Seleccionar idioma de la interfaz de usuario", + "icon": "Icono", + "inputType": "Tipo de entrada", + "selectType": "seleccionar tipos...", + "loadCredentials": "Cargando credenciales de nodo", + "inputs": { + "input": "entrada", + "select": "seleccionar", + "checkbox": "checkbox", + "spinner": "spinner", + "none": "ninguno", + "hidden": "ocultar propiedad" + }, + "types": { + "str": "texto", + "num": "número", + "bool": "booleano", + "json": "JSON", + "bin": "buffer", + "env": "variable entorno", + "cred": "credencial" + }, + "menu": { + "input": "entrada", + "select": "selección", + "checkbox": "checkbox", + "spinner": "spinner", + "hidden": "solo etiqueta" + }, + "select": { + "label": "Etiqueta", + "value": "Valor" + }, + "spinner": { + "min": "Mínimo", + "max": "Máximo" + }, + "errors": { + "scopeChange": "Cambiar el alcance hará que no esté disponible para nodos en otros flujos que lo utilicen", + "invalidProperties": "Propiedades inválidas:", + "credentialLoadFailed": "Falló al cargar credenciales del nodo" + } + }, + "keyboard": { + "title": "Atajos de teclado", + "keyboard": "Teclado", + "filterActions": "filtrar acciones", + "shortcut": "atajo", + "scope": "alcance", + "unassigned": "Sin asignar", + "global": "global", + "workspace": "espacio trabajo", + "editor": "diálogo edición", + "selectAll": "Seleccionar todos", + "selectNone": "Seleccionar ninguno", + "selectAllConnected": "Seleccionar conectados", + "addRemoveNode": "Añadir/eliminar nodo de la selección", + "editSelected": "Editar nodo seleccionado", + "deleteSelected": "Eliminar los nodos o el enlace seleccionados", + "deleteReconnect": "Eliminar y reconectar", + "importNode": "Importar nodos", + "exportNode": "Exportar nodos", + "nudgeNode": "Mover nodos seleccionados (1px)", + "moveNode": "Mover nodos seleccionados (20px)", + "toggleSidebar": "Alternar barra lateral", + "togglePalette": "Alternar paleta", + "copyNode": "Copiar nodos seleccionados", + "cutNode": "Cortar nodos seleccionados", + "pasteNode": "Pegar nodos", + "copyGroupStyle": "Copiar estilo de grupo", + "pasteGroupStyle": "Pegar estilo de grupo", + "undoChange": "Deshacer", + "redoChange": "Rehacer", + "searchBox": "Abrir cuadro de búsqueda", + "managePalette": "Gestionar paleta", + "actionList": "Lista de acciones", + "splitWireWithLinks": "Divide la selección con nodos de enlace" + }, + "library": { + "library": "Librería", + "openLibrary": "Abrir Librería...", + "saveToLibrary": "Guardar en Librería...", + "typeLibrary": "Librería __type__", + "unnamedType": "__type__ sin nombre", + "exportedToLibrary": "Nodos exportados a la librería", + "dialogSaveOverwrite": "Una __libraryType__ llamada __libraryName__ ya existe. ¿Sobrescribir?", + "invalidFilename": "Nombre de archivo inválido", + "savedNodes": "Nodos guardados", + "savedType": "__type__ guardado", + "saveFailed": "Falló al guardar: __message__", + "newFolder": "Nueva carpeta", + "types": { + "local": "Local", + "examples": "Ejemplos" + } + }, + "palette": { + "noInfo": "no hay información disponible", + "filter": "filtrar nodos", + "search": "buscar módulos", + "addCategory": "Añadir nueva...", + "label": { + "subflows": "subflujos", + "network": "red", + "common": "común", + "input": "entrada", + "output": "salida", + "function": "función", + "sequence": "secuencia", + "parser": "analizador", + "social": "social", + "storage": "almacenamiento", + "analysis": "análisis", + "advanced": "avanzado" + }, + "actions": { + "collapse-all": "Colapsar todas las categorías", + "expand-all": "Expandir todas las categorías" + }, + "event": { + "nodeAdded": "Nodo añadido a la paleta:", + "nodeAdded_plural": "Nodos añadidos a la paleta:", + "nodeRemoved": "Nodo eliminado de la paleta:", + "nodeRemoved_plural": "Nodos eliminados de la paleta:", + "nodeEnabled": "Nodo activado:", + "nodeEnabled_plural": "Nodos activados:", + "nodeDisabled": "Nodo desactivado:", + "nodeDisabled_plural": "Nodos desactivados:", + "nodeUpgraded": "Módulo de nodo __module__ actualizado a la versión __version__", + "unknownNodeRegistered": "Error cargando el nodo:
  • __type__
    __error__
" + }, + "editor": { + "title": "Gestionar paleta", + "palette": "Paleta", + "allCatalogs": "Todos los Catálogos", + "times": { + "seconds": "segundos hace", + "minutes": "minutos hace", + "minutesV": "hace __count__ minutos", + "hoursV": "hace __count__ hora", + "hoursV_plural": "hace __count__ horas", + "daysV": "hace __count__ día", + "daysV_plural": "hace __count__ días", + "weeksV": "hace __count__ semana", + "weeksV_plural": "hace __count__ semanas", + "monthsV": "hace __count__ mes", + "monthsV_plural": "hace __count__ meses", + "yearsV": "hace __count__ año", + "yearsV_plural": "hace __count__ años", + "yearMonthsV": "hace __y__ año y __count__ mes", + "yearMonthsV_plural": "hace __y__ año y __count__ meses", + "yearsMonthsV": "hace __y__ años y __count__ mes", + "yearsMonthsV_plural": "hace __y__ años y __count__ meses" + }, + "nodeCount": "__label__ nodo", + "nodeCount_plural": "__label__ nodos", + "moduleCount": "__count__ módulo disponible", + "moduleCount_plural": "__count__ módulos disponibles", + "inuse": "en uso", + "enableall": "habilitar todo", + "disableall": "deshabilitar todo", + "enable": "habilitar", + "disable": "deshabilitar", + "remove": "eliminar", + "update": "actualizar a __version__", + "updated": "actualizado", + "install": "instalar", + "installed": "instalado", + "conflict": "conflicto", + "conflictTip": "

Este módulo no puede ser instalado debido a que incluye un
tipo de nodo que ya ha sido instalado

Conflictos con __module__

", + "loading": "Cargando catálogos...", + "tab-nodes": "Nodos", + "tab-install": "Instalar", + "sort": "ordenar:", + "sortRelevance": "relevancia", + "sortAZ": "a-z", + "sortRecent": "reciente", + "more": "+ __count__ más", + "upload": "Cargar módulo en archivo tgz", + "refresh": "Actualizar lista de módulos", + "errors": { + "catalogLoadFailed": "

La carga del catálogo de nodos ha fallado

Revise la consola del navegador para mas información

", + "installFailed": "

Fallo al instalar: __module__

__message__

Revise el log para mas información

", + "removeFailed": "

Fallo al eliminar: __module__

__message__

Revise el log para mas información

", + "updateFailed": "

Fallo al actualizar: __module__

__message__

Revise el log para mas información

", + "enableFailed": "

Fallo al activar: __module__

__message__

Revise el log para mas información

", + "disableFailed": "

Fallo al desactivar: __module__

__message__

Revise el log para mas información

" + }, + "confirm": { + "install": { + "body":"

Instalando '__module__'

Lea la documentación del nodo antes de instalarlo. Algunos nodos poseen dependencias que no pueden ser resueltas automáticamente y pueden requerir que Node-RED sea reiniciado.

", + "title": "Instalar nodos" + }, + "remove": { + "body":"

Eliminando '__module__'

La eliminación del nodo lo desinstalará de Node-RED. Es posible que el nodo siga utilizando recursos hasta que Node-RED sea reiniciado.

", + "title": "Eliminar nodos" + }, + "update": { + "body":"

Actualizando '__module__'

La actualización del nodo requerirá un reinicio manual de Node-RED para completarse. Debe ser reiniciado manualmente.

", + "title": "Actualizar nodos" + }, + "cannotUpdate": { + "body":"Se encuentra disponible una actualización para este nodo, pero el mismo no se encuentra instalado en una ubicación accesible por el gestor de nodos.

Por favor revise la documentación para obtener mas información sobre como actualizar este nodo." + }, + "button": { + "review": "Abrir información del nodo", + "install": "Instalar", + "remove": "Eliminar", + "update": "Actualizar" + } + } + } + }, + "sidebar": { + "info": { + "name": "Información", + "tabName": "Nombre", + "label": "info", + "node": "Nodo", + "type": "Tipo", + "group": "Grupo", + "module": "Módulo", + "id": "ID", + "status": "Estado", + "enabled": "Habilitado", + "disabled": "Deshabilitado", + "subflow": "Subflujo", + "instances": "Instancias", + "properties": "Propiedades", + "info": "Información", + "desc": "Descripción", + "blank": "vacío", + "null": "nulo", + "showMore": "mostrar más", + "showLess": "mostrar menos", + "flow": "Flujo", + "selection": "Selección", + "nodes": "__count__ nodos", + "flowDesc": "Descripción del flujo", + "subflowDesc": "Descripción del subflujo", + "nodeHelp": "Ayuda del nodo", + "none": "Ninguno", + "arrayItems": "__count__ elementos", + "showTips": "Puedes abrir las sugerencias desde el panel de ajustes", + "outline": "Contorno", + "empty": "vacío", + "globalConfig": "Nodos de configuración global", + "triggerAction": "Acción de inicio", + "find": "Encontrar en espacio de trabajo", + "copyItemUrl": "Copiar URL elemento", + "copyURL2Clipboard": "URL copiada al portapapeles", + "showFlow": "Mostrar", + "hideFlow": "Esconder" + }, + "help": { + "name": "Ayuda", + "label": "ayuda", + "search": "Buscar en la ayuda", + "nodeHelp": "Ayuda de nodo", + "showHelp": "Mostrar ayuda", + "showInOutline": "Mostrar en controno", + "showTopics": "Mostrar temas", + "noHelp": "No hay ningun tema de ayuda seleccionado", + "changeLog": "Registro de Cambios" + }, + "config": { + "name": "Nodos de configuración", + "label": "config", + "global": "En todos los flujos", + "none": "ninguno", + "subflows": "subflujos", + "flows": "flujos", + "filterAll": "todos", + "showAllConfigNodes": "Mostrar todos los nodos de configuración", + "filterUnused": "no utilizado", + "showAllUnusedConfigNodes": "Mostrar todos los nodos de configuración no utilizados", + "filtered": "__count__ escondidos" + }, + "context": { + "name":"Información de contexto", + "label":"contexto", + "none": "ninguno seleccionado", + "refresh": "actualice para cargar", + "empty": "vacío", + "node": "Nodo", + "flow": "Flujo", + "global": "Global", + "deleteConfirm": "¿Estás seguro de que quieres eliminar este elemento?", + "autoRefresh": "Actualizar automáticamente al seleccionar", + "refrsh": "Actualizar", + "delete": "Eliminar" + }, + "palette": { + "name": "Gestión de Paleta", + "label": "paleta" + }, + "project": { + "label": "proyecto", + "name": "Proyecto", + "description": "Descripción", + "dependencies": "Dependencias", + "settings": "Ajustes", + "noSummaryAvailable": "No hay resumen disponible", + "editDescription": "Editar descripción proyecto", + "editDependencies": "Editar dependencias proyecto", + "noDescriptionAvailable": "Ninguna descripción disponible", + "editReadme": "Editar README.md", + "showProjectSettings": "Mostrar ajustes del proyecto", + "projectSettings": { + "title": "Ajustes del proyecto", + "edit": "editar", + "none": "Ninguno", + "install": "instalar", + "removeFromProject": "eliminar del proyecto", + "addToProject": "agregar al proyecto", + "files": "Archivos", + "flow": "Flujo", + "credentials": "Credenciales", + "package": "Paquete", + "packageCreate": "El archivo será creado cuando se guarden los cambios", + "fileNotExist": "El archivo no existe", + "selectFile": "Seleccionar archivo", + "invalidEncryptionKey": "Clave de encriptación inválida", + "encryptionEnabled": "Encriptación habilitada", + "encryptionDisabled": "Encryption disabled", + "setTheEncryptionKey": "Establecer la clave de encriptación", + "resetTheEncryptionKey": "Reestablecer la clave de encriptación", + "changeTheEncryptionKey": "Cambiar la clave de encriptación", + "currentKey": "Clave actual", + "newKey": "Nueva clave", + "credentialsAlert": "Esto eliminará todas las credenciales existentes", + "versionControl": "Control de versiones", + "branches": "Ramas", + "noBranches": "Sin ramas", + "deleteConfirm": "¿Estás seguro de que quieres eliminar la rama local '__name__'? Esta acción no puede deshacerse.", + "unmergedConfirm": "La rama local '__name__' tiene cambios no fusionados que se perderán. ¿Estás seguro de que quieres eliminarla?", + "deleteUnmergedBranch": "Eliminar rama no fusionada", + "gitRemotes": "Git remotes", + "addRemote": "añadir remoto", + "addRemote2": "Añadir remoto", + "remoteName": "Nombre del repositorio remoto", + "nameRule": "Solo se permiten los caracteres A-Z 0-9 _ -", + "url": "URL", + "urlRule": "https://, ssh:// ó file://", + "urlRule2": "No incluyas el usuario ni la contraseña en la URL", + "noRemotes": "No hay remotos", + "deleteRemoteConfrim": "¿Estás seguro de que quieres eliminar el repositorio remoto '__name__'?", + "deleteRemote": "Eliminar repositorio remoto" + }, + "userSettings": { + "committerDetail": "Detalles del commiter", + "committerTip": "Dejar este campo vacío para usar el valor por defecto del sistema", + "userName": "Usuario", + "email": "Email", + "workflow": "Flujo de Trabajo", + "workfowTip": "Elige tu flujo de trabajo GIT preferido", + "workflowManual": "Manual", + "workflowManualTip": "Todos los cambios deben confirmarse manualmente en la sección 'historia' de la barra lateral", + "workflowAuto": "Automático", + "workflowAutoTip": "Los cambios serán confirmadoos a git automáticamente con cada instanciación", + "sshKeys": "Claves SSH", + "sshKeysTip": "Permiten crear conexiones seguras a repositorios de git remotos.", + "add": "añadir clave", + "addSshKey": "Añadir Clave SSH", + "addSshKeyTip": "Generar un nuevo par de claves publica/privada", + "name": "Nombre", + "nameRule": "Debe contener exclusivamente los siguientes caracteres: A-Z 0-9 _ -", + "passphrase": "Contraseña", + "passphraseShort": "La contraseña es demasiado corta", + "optional": "Opcional", + "cancel": "Cancelar", + "generate": "Generar clave", + "noSshKeys": "No hay claves SSH", + "copyPublicKey": "Copiar la clave pública al portapapeles", + "delete": "Eliminar clave", + "gitConfig": "configuración Git", + "deleteConfirm": "¿Estás seguro de que quieres eliminar la clave SSH '__name__'? Esto no puede deshacerse." + }, + "versionControl": { + "unstagedChanges": "Cambios no preparados", + "stagedChanges": "Cambios preparados", + "unstageChange": "Des-preparar cambio", + "stageChange": "Preparar cambio", + "unstageAllChange": "Despreparar todos los cambios", + "stageAllChange": "Preparar todos los cambios", + "commitChanges": "Confirmar cambios", + "resolveConflicts": "Resolver conflictos", + "head": "HEAD", + "staged": "Preparado", + "unstaged": "No preparado", + "local": "Local", + "remote": "Remoto", + "revert": "¿Estás seguro de que quieres revertir los cambios en '__file__'? Esto no puede deshacerse.", + "revertChanges": "Revertir cambios", + "localChanges": "Cambios locales", + "none": "Ninguno", + "conflictResolve": "Todos los conflictos resueltos. Confirma los cambios para completar la fusión.", + "localFiles": "Archivos locales", + "all": "todo", + "unmergedChanges": "Cambios sin mergear", + "abortMerge": "cancelar merge", + "commit": "commit", + "changeToCommit": "Cambios al commit", + "commitPlaceholder": "Escriba su mensaje de commit", + "cancelCapital": "Cancelar", + "commitCapital": "Commit", + "commitHistory": "Historial de commits", + "branch": "Branch:", + "moreCommits": " commit(s) más", + "changeLocalBranch": "Cambiar rama local", + "createBranchPlaceholder": "Buscar o crear una rama", + "upstream": "fuente", + "localOverwrite": "Tienes cambios locales que podrían ser sobreescritos si cambias de rama. Debes confirmar o deshacer esos cambios primero.", + "manageRemoteBranch": "Gestionar rama remota", + "unableToAccess": "No es posible acceder al repositorio remoto", + "retry": "Reintentar", + "setUpstreamBranch": "Establecer rama como rama fuente", + "createRemoteBranchPlaceholder": "Encontrar o crear una rama remota", + "trackedUpstreamBranch": "La rama creada será establecida como la rama fuente.", + "selectUpstreamBranch": "La rama será creada. Elígela debajo para establecerla como la rama fuente.", + "pushFailed": "El envío falló ya que el remoto tiene commits mas recientes. Trae esos cambios primero y luego vuelve a subir.", + "push": "enviar", + "pull": "traer", + "unablePull": "

No es posible traer los cambios remotos; tus cambios locales no preparados serían sobreescritos.

Confirma tus cambios primero e intente nuevamente.

", + "showUnstagedChanges": "Mostrar cambios no preparados", + "connectionFailed": "No fue posible conectarse al repositorio remoto: ", + "pullUnrelatedHistory": "

El servidor remoto tiene una historia de commits no relacionada.

¿Estás seguro de que quieres traer los cambios a tu repositorio local?

", + "pullChanges": "Traer cambios", + "history": "historial", + "projectHistory": "Historial del proyecto", + "daysAgo": "hace __count__ día", + "daysAgo_plural": "hace __count__ días", + "hoursAgo": "hace __count__ hora", + "hoursAgo_plural": "hace __count__ horas", + "minsAgo": "hace __count__ minuto", + "minsAgo_plural": "hace __count__ minutos", + "secondsAgo": "Segundos desde que ocurrió", + "notTracking": "Tu rama local no esta siguiendo ninguna rama remota.", + "statusUnmergedChanged": "Tu repositorio tiene cambios sin unificar. Debes solucionar los conflictos y hacer commit del resultado.", + "repositoryUpToDate": "Tu repositorio esta al día.", + "commitsAhead": "Tu repositorio está __count__ commit por delante del repositorio remoto. Puedes enviar este commit ahora.", + "commitsAhead_plural": "Tu repositorio está __count__ commits por delante del repositorio remoto. Puedes enviar estos commits ahora.", + "commitsBehind": "Tu repositorio está __count__ commit atrasado contra el repositorio remoto. Puedes traer este commit ahora.", + "commitsBehind_plural": "Tu repositorio está __count__ commits atrasado contra el repositorio remoto. Puedes traer estos commits ahora.", + "commitsAheadAndBehind1": "Tu repositorio está __count__ commit atrasado y ", + "commitsAheadAndBehind1_plural": "Tu repositorio está __count__ commits atrasado y ", + "commitsAheadAndBehind2": "__count__ commit adelantado del servidor remoto. ", + "commitsAheadAndBehind2_plural": "__count__ commits adelantado del servidor remoto. ", + "commitsAheadAndBehind3": "Debes traer el commit remoto antes de enviar tus commits.", + "commitsAheadAndBehind3_plural": "Debes traer los commits remotos antes de enviar tus commits.", + "refreshCommitHistory": "Actualizar historial de commits", + "refreshChanges": "Actualizar cambios" + } + } + }, + "typedInput": { + "type": { + "str": "texto", + "num": "número", + "re": "expresión regular", + "bool": "booleano", + "json": "JSON", + "bin": "buffer", + "date": "marca tiempo", + "jsonata": "expresión", + "env": "variable de entorno", + "cred": "credencial" + } + }, + "editableList": { + "add": "añadir", + "addTitle": "añadir un elemento" + }, + "search": { + "history": "Buscar en el historial", + "clear": "limpiar todo", + "empty": "No hay coincidencias", + "addNode": "añadir un nodo...", + "options": { + "configNodes": "Nodos de Configuración", + "unusedConfigNodes": "Nodos de Configuración sin uso", + "invalidNodes": "Nodos inválidos", + "uknownNodes": "Nodos desconocidos", + "unusedSubflows": "Subflujos sin uso", + "hiddenFlows": "Flujos escondidos", + "modifiedNodes": "Nodos y flujos modificados", + "thisFlow": "Flujo actual" + } + }, + "expressionEditor": { + "functions": "Funciones", + "functionReference": "Referencia a función", + "insert": "Insertar", + "title": "Editor de expresiones JSONata", + "test": "Prueba", + "data": "Mensaje ejemplo", + "result": "Resultado", + "format": "expresión de formato", + "compatMode": "Modo de compatibilidad activado", + "compatModeDesc": "

Modo de compatibilidad JSONata

La expresión actual todavía hace referencia a msg por lo que será evaluada en modo de compatibilidad. Por favor actualice la expresión evitando utilizar msg debido a que este modo será eliminado en el futuro.

Cuando el soporte para JSONata fue añadido a Node-RED, se requería que la expresión haga referencia al objeto msg. Por ejemplo msg.payload era usado para acceder a la carga útil del mensaje.

Eso ya no es necesario ya que la expresión será evaluada contra el mensaje directamente. Para acceder a la carga util, la expresión debe ser simplemente payload.

", + "noMatch": "No hay coincidencias", + "errors": { + "invalid-expr": "Expresión JSONata inválida:\n __message__", + "invalid-msg": "Mensaje JSON de ejemplo inválido:\n __message__", + "context-unsupported": "No se puede probar las funciones de contexto\n $flowContext o $globalContext", + "env-unsupported": "No se puede probar la función $env", + "moment-unsupported": "No se puede probar la función $moment", + "clone-unsupported": "No se puede probar la función $clone", + "eval": "Error al evaluar la expresión:\n __message__" + } + }, + "monaco": { + "setTheme": "Establecer tema" + }, + "jsEditor": { + "title": "Editor de JavaScript" + }, + "textEditor": { + "title": "Editor de texto" + }, + "jsonEditor": { + "title": "Editor de JSON", + "format": "formatear JSON", + "rawMode": "Editar JSON", + "uiMode": "Editor Visual", + "rawMode-readonly": "JSON", + "uiMode-readonly": "Visual", + "insertAbove": "Insertar encima", + "insertBelow": "Insertar debajo", + "addItem": "Añadir elemento", + "copyPath": "Copiar ruta al elemento", + "expandItems": "Expandir elementos", + "collapseItems": "Colapsar elementos", + "duplicate": "Duplicar", + "error": { + "invalidJSON": "JSON inválido: " + } + }, + "markdownEditor": { + "title": "Editor Markdown", + "expand": "Expandir", + "format": "Formateado con markdown", + "heading1": "Encabezado 1", + "heading2": "Encabezado 2", + "heading3": "Encabezado 3", + "bold": "Negrita", + "italic": "Itálica", + "code": "Código", + "ordered-list": "Lista ordenada", + "unordered-list": "Lista desordenada", + "quote": "Cita", + "link": "Enlace", + "horizontal-rule": "Regla horizontal", + "toggle-preview": "Activar/Desactivar vista previa", + "mermaid": { + "summary": "Diagrama Mermaid" + } + }, + "bufferEditor": { + "title": "Editor de buffer", + "modeString": "Tratar como cadena UTF-8", + "modeArray": "Tratar como vector JSON", + "modeDesc": "

Editor de buffer

El tipo buffer es almacenado como un arreglo JSON de valores de tipo byte. El editor intentará procesar el valor ingresado como un arreglo JSON. Si no es JSON válido, será tratado como un string UTF-8 y convertido a un arreglo de los códigos de sus caracteres individuales.

Por ejemplo, el valor Hello World será convertido al arreglo JSON:

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

" + }, + "projects": { + "config-git": "Configurar cliente Git", + "welcome": { + "hello": "Hola! Hemos añadido 'proyectos' a Node-RED.", + "desc0": "Esta es una nueva manera de gestionar tus archivos de flujo e incluir control de versiones en los mismos.", + "desc1": "Para comenzar puedes crear tu primer proyecto o clonar un proyecto existente de un repositorio de Git.", + "desc2": "Si no estás seguro, puedes saltear esto por ahora. De cualquier modo podrás crear tu primero proyecto desde el menu de 'Proyectos' en cualquier momento.", + "create": "Crear proyecto", + "clone": "Clonar repositorio", + "openExistingProject": "Abrir proyecto existente", + "not-right-now": "No ahora mismo" + }, + "git-config": { + "setup": "Configurar tu cliente de control de versiones", + "desc0": "Node-RED utiliza la herramienta de codigo abierto Git para el control de versiones. La misma hace un seguimiento de los cambios en los archivos del proyecto y permite enviarlos a repositorios remotos.", + "desc1": "Cuando confirmas un conjunto de cambios, Git almacena quien hizo los cambios con un nombre y una dirección de email. El usuario puede ser lo que quieres - no es necesario que sea tu nombre real.", + "desc2": "Tu cliente de Git ya se encuentra configurado con los detalles mostrados debajo.", + "desc3": "Puedes cambiar estos ajustes más tarde en la pestaña 'Git config' del menú de ajustes.", + "username": "Usuario", + "email": "Email" + }, + "project-details": { + "create": "Crear proyecto", + "desc0": "Un proyecto es mantenido como un repositorio Git. De esta manera es mas fácil compartir tus flujos con otros y colaborar en ellos.", + "desc1": "Puedes crear múltiples proyectos y cambiar entre ellos usando el editor.", + "desc2": "Para comenzar, tu proyecto necesita un nombre y una descripción opcional.", + "already-exists": "El proyecto ya existe", + "must-contain": "Solo se permiten los caracteres A-Z 0-9 _ -", + "project-name": "Nombre del proyecto", + "desc": "Descripción", + "opt": "Opcional" + }, + "clone-project": { + "clone": "Clonar un proyecto", + "desc0": "Si ya cuentas con un repositorio git que contenga un proyecto, puedes clonarlo para comenzar.", + "already-exists": "El proyecto ya existe", + "must-contain": "Solo se permiten los caracteres A-Z 0-9 _ -", + "project-name": "Nombre del proyecto", + "no-info-in-url": "No incluyas tu usuario ni contraseña en la URL", + "git-url": "URL del repositorio de Git", + "protocols": "https://, ssh:// o file://", + "auth-failed": "Autenticación fallida", + "username": "Usuario", + "passwd": "Contraseña", + "ssh-key": "Clave SSH", + "passphrase": "Frase secreta", + "ssh-key-desc": "Antes de poder clonar un repositorio por SSH debes añadir una clave SSH.", + "ssh-key-add": "Añadir una clave SSH", + "credential-key": "Clave para encriptación de credenciales", + "cant-get-ssh-key": "Error! No se puede obtener la ruta hasta la clave SSH seleccionada.", + "already-exists2": "ya existe", + "git-error": "error de Git", + "connection-failed": "Conexion fallida", + "not-git-repo": "No es un repositorio Git", + "repo-not-found": "Repositorio no encontrado" + }, + "default-files": { + "create": "Crear tus archivos de proyecto", + "desc0": "Un proyecto contiene tus archivos de flujo, un archivo README y un package.json.", + "desc1": "Puede contener cualquier otro archivo que quiera mantener en el repositorio Git.", + "desc2": "Tu flujo existente y tus archivos de credencial serán copiados al proyecto.", + "flow-file": "Archivo de flujo", + "credentials-file": "Archivo de credenciales" + }, + "encryption-config": { + "setup": "Configura la encriptación de tu archivo de credenciales", + "desc0": "Tu archivo de credenciales de flujo puede ser encriptado para mantener seguro tu contenido.", + "desc1": "Si quieres almacenar estas credenciales en un repositorio de Git público, debes encriptarlos mediante una frase secreta.", + "desc2": "Actualmente, tus credenciales de flujo no estan encriptadas.", + "desc3": "Esto significa que tu contenido, tal como contraseñas y tokens de acceso, pueden ser leidos por cualquier con acceso al archivo.", + "desc4": "Si quieres almacenar estas credenciales en un repositorio de Git público, debes encriptarlas mediante una frase secreta.", + "desc5": "Tu archivo de credenciales de flujo esta actualmente encriptado usando la propiedad credentialSecret de tu archivo de ajustes como clave.", + "desc6": "Tu archivo de credenciales de flujo esta actualmente encriptado usando una clave generada por el sistema. Debes proveer una nueva clave secreta para este proyecto.", + "desc7": "La clave será almacenada separada de tus archivos de proyecto. Deberás proveer la clave para usar este proyecto en otra instancia de Node-RED.", + "credentials": "Credenciales", + "enable": "Activar encriptación", + "disable": "Desactivar encriptación", + "disabled": "desactivado", + "copy": "Copiar encima de la clave existente", + "use-custom": "Usar clave personalizada", + "desc8": "El archivo de credenciales no será encriptado y tus contenidos serán legibles fácilmente", + "create-project-files": "Crear archivos de proyecto", + "create-project": "Crear proyecto", + "already-exists": "ya existe", + "git-error": "error de Git", + "git-auth-error": "error de autenticación de Git" + }, + "create-success": { + "success": "Has creado exitosamente tu primer proyecto!", + "desc0": "Ahora puedes seguir utilizando Node-RED como siempre lo has hecho.", + "desc1": "La pestaña 'info' en la barra lateral muestra tu proyecto activo actual. El botón contiguo al nombre puede utilizarse para acceder a los ajustes del proyecto.", + "desc2": "La pestaña 'historia' en la barra lateral muestra los archivos que cambiaron en tu proyecto y permite confirmar los cambios. Muestra una historia completa de tus commits y permite enviar tus cambios a un repositorio remoto." + }, + "create": { + "projects": "Proyectos", + "already-exists": "El proyecto ya existe", + "must-contain": "Solo se permiten los caracteres A-Z 0-9 _ -", + "no-info-in-url": "No incluyas tu usuario ni tu contraseña en la URL", + "open": "Abrir Proyecto", + "create": "Crear Proyecto", + "clone": "Clonar Repositorio", + "project-name": "Nombre del proyecto", + "desc": "Descripción", + "opt": "Opcional", + "flow-file": "Archivo de flujo", + "credentials": "Credenciales", + "enable-encryption": "Activar encriptación", + "disable-encryption": "Desactivar encriptación", + "encryption-key": "Clave de encriptación", + "desc0": "Una frase secreta con la cual asegurar tus credenciales", + "desc1": "El archivo de credenciales no será encriptado y tu contenido será fácilmente legible", + "git-url": "URL del repositorio de Git", + "protocols": "https://, ssh:// o file://", + "auth-failed": "Autenticación fallida", + "username": "Usuario", + "password": "Contraseña", + "ssh-key": "Clave SSH", + "passphrase": "Frase secreta", + "desc2": "Antes de clonar un repositorio mediante SSH debes añadir una clave SSH para acceder.", + "add-ssh-key": "Agregar una clave SSH", + "credentials-encryption-key": "Clave de encriptación de credenciales", + "already-exists-2": "ya existe", + "git-error": "error de Git", + "con-failed": "Conexión fallida", + "not-git": "No es un repositorio de Git", + "no-resource": "Repositorio no encontrado", + "cant-get-ssh-key-path": "Erorr! No se puede obtener la ruta a la clave SSH seleccionada.", + "unexpected_error": "error_inesperado", + "clearContext": "Iniciar contexto al cambiar de proyecto" + }, + "delete": { + "confirm": "¿Estás seguro que quieres eliminar este proyecto?" + }, + "create-project-list": { + "search": "buscar tus proyectos", + "current": "actual" + }, + "require-clean": { + "confirm": "

Tienes cambios no instanciados que se perderán.

¿Quieres continuar?

" + }, + "send-req": { + "auth-req": "Se requiere autenticación para el repositorio", + "username": "Usuario", + "password": "Contraseña", + "passphrase": "Frase de contraseña", + "retry": "Reintentar", + "update-failed": "No se pudo actualizar la autenticación", + "unhandled": "Respuesta de error no controlada", + "host-key-verify-failed": "

Error en la verificación de la clave del servidor.

No se pudo verificar la clave del servidor del repositorio. Actualiza tu archivo known_hosts e inténtelo de nuevo.

" + }, + "create-branch-list": { + "invalid": "Rama inválida", + "create": "Crear rama", + "current": "actual" + }, + "create-default-file-set": { + "no-active": "No se pudo crear el conjunto de archivos predeterminado porque no hay un proyecto activo", + "no-empty": "No se puede crear un conjunto de archivos predeterminado en un proyecto que no esté vacío", + "git-error": "Error de Git" + }, + "errors": { + "no-username-email": "Tu cliente Git no está configurado con un nombre de usuario/correo electrónico.", + "unexpected": "Ocurrió un error inesperado", + "code": "código" + } + }, + "editor-tab": { + "properties": "Propiedades", + "envProperties": "Variables de Entorno", + "module": "Propiedades del módulo", + "description": "Descripción", + "appearance": "Apariencia", + "preview": "Vista previa interfaz de usuario", + "defaultValue": "Valor por defecto" + }, + "tourGuide": { + "takeATour": "Hacer un recorrido", + "start": "Iniciar", + "next": "Siguiente", + "welcomeTours": "Recorridos de Bienvenida" + }, + "diagnostics": { + "title": "Información Sistema" + }, + "validator": { + "errors": { + "invalid-json": "Datos JSON inválidos: __error__", + "invalid-expr": "Expresión JSONata inválida: __error__", + "invalid-prop": "Expresión de propiedad inválida", + "invalid-num": "Número inválido", + "invalid-num-prop": "__prop__: número inválido", + "invalid-regexp": "Entrada inválida", + "invalid-regex-prop": "__prop__: entrada inválida", + "missing-required-prop": "__prop__: falta valor de propiedad", + "invalid-config": "__prop__: nodo de configuración inválido", + "missing-config": "__prop__: nodo de configuración no encontrado", + "validation-error": "__prop__: error de validación: __node__, __id__: __error__" + } + }, + "contextMenu": { + "showActionList": "Mostrar lista de acciones", + "insert": "Insertar", + "node": "Nodo", + "junction": "Unión", + "linkNodes": "Enlazar Nodos" + }, + "env-var": { + "environment": "Entorno", + "header": "Variables Globales de Entorno", + "revert": "Revertir" + } +} diff --git a/packages/node_modules/@node-red/editor-client/locales/es-ES/infotips.json b/packages/node_modules/@node-red/editor-client/locales/es-ES/infotips.json new file mode 100644 index 000000000..bdd17c667 --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/locales/es-ES/infotips.json @@ -0,0 +1,26 @@ +{ + "info": { + "tip0": "Puedes eliminar los nodos o enlaces seleccionados con {{core:delete-selection}}", + "tip1": "Busca nodos con {{core:search}}", + "tip2": "{{core:toggle-sidebar}} alternará la vista de esta barra lateral", + "tip3": "Puedes gestionar tu paleta de nodos con {{core:manage-palette}}", + "tip4": "Tus nodos de configuración de flujo aparecen en el panel de la barra lateral. Se puede acceder desde el menú o con {{core:show-config-tab}}", + "tip5": "Activa o desactiva estos consejos desde la opción en la configuración", + "tip6": "Mueve los nodos seleccionados usando las teclas [izquierda] [arriba] [abajo] y [derecha]. Mantén pulsada [Mayús] para desplazarlos más", + "tip7": "Arrastrar un nodo a un cable lo insertará en el enlace", + "tip8": "Exporta los nodos seleccionados, o la pestaña actual con {{core:show-export-dialog}}", + "tip9": "Importa un flujo arrastrando su JSON al editor, o con {{core:show-import-dialog}}", + "tip10": "[shift][clic] y arrastrar en un puerto de nodo para mover todos los cables conectados o sólo el seleccionado", + "tip11": "Mostrar la pestaña Información con {{core:show-info-tab}} o la pestaña Depuración con {{core:show-debug-tab}}", + "tip12": "[ctrl] [clic] en el área de trabajo para abrir el diálogo de adición rápida", + "tip13": "Mantén pulsada [ctrl] cuando [haces clic] en un puerto de nodo para habilitar el enlazado rápido", + "tip14": "Mantén pulsada [shift] cuando [haces clic] en un nodo para seleccionar también todos sus nodos conectados", + "tip15": "Mantén pulsada [ctrl] cuando [haces clic] en un nodo para añadirlo o eliminarlo de la selección actual", + "tip16": "Cambia de pestaña de flujo con {{core:show-previous-tab}} y {{core:show-next-tab}}", + "tip17": "Puedes confirmar tus cambios en la bandeja de edición de nodos con {{core:confirm-edit-tray}} o cancelarlos con {{core:cancel-edit-tray}}", + "tip18": "Al pulsar {{core:edit-selected-node}} se editará el primer nodo de la selección actual" + } +} + + + diff --git a/packages/node_modules/@node-red/editor-client/locales/es-ES/jsonata.json b/packages/node_modules/@node-red/editor-client/locales/es-ES/jsonata.json new file mode 100644 index 000000000..eaf720bfb --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/locales/es-ES/jsonata.json @@ -0,0 +1,278 @@ +{ + "$string": { + "args": "arg[, prettify]", + "desc": "Convierte el parámetro `arg` a una cadena usando las siguientes reglas de conversión:\n\n - Las cadenas no cambian\n - Las funciones se convierten en una cadena vacía\n - El infinito numérico y NaN arrojan un error porque no se pueden representar como un número JSON\n: todos los demás valores se convierten a una cadena JSON usando la función `JSON.stringify`. Si `prettify` es verdadero, entonces se produce JSON \"prettified\". es decir, una línea por campo y las líneas se indentarán según la profundidad del campo." + }, + "$length": { + "args": "str", + "desc": "Devuelve el número de caracteres de la cadena `str`. Se genera un error si `str` no es una cadena." + }, + "$substring": { + "args": "str, start[, length]", + "desc": "Devuelve una cadena que contiene los caracteres del primer parámetro `str` comenzando en la posición `start` (desplazamiento cero). Si se especifica 'longitud', la subcadena contendrá el máximo de caracteres de 'longitud'. Si 'inicio' es negativo, indica el número de caracteres desde el final de 'cadena'." + }, + "$substringBefore": { + "args": "str, chars", + "desc": "Devuelve la subcadena antes de la primera aparición de la secuencia de caracteres `chars` en `str`. Si `str` no contiene `caracteres`, entonces devuelve `str`." + }, + "$substringAfter": { + "args": "str, chars", + "desc": "Devuelve la subcadena después de la primera aparición de la secuencia de caracteres `chars` en `str`. Si `str` no contiene `caracteres`, entonces devuelve `str`." + }, + "$uppercase": { + "args": "str", + "desc": "Devuelve una cadena con todos los caracteres de `str` convertidos a mayúsculas." + }, + "$lowercase": { + "args": "str", + "desc": "Devuelve una cadena con todos los caracteres de `str` convertidos a minúsculas." + }, + "$trim": { + "args": "str", + "desc": "Normaliza y recorta todos los caracteres de espacio en blanco en `str` aplicando los siguientes pasos:\n\n - Todas las tabulaciones, retornos de carro y avances de línea se reemplazan con espacios.\n- Las secuencias contiguas de espacios se reducen a un solo espacio.\n- Se eliminan los espacios iniciales y finales.\n\n Si no se especifica `str` (es decir, esta función se invoca sin argumentos), entonces el valor de contexto se utiliza como el valor de `str`. Se genera un error si `str` no es una cadena." + }, + "$contains": { + "args": "str, pattern", + "desc": "Devuelve 'verdadero' si 'cadena' coincide con 'patrón', de lo contrario, devuelve 'falso'. Si no se especifica `str` (es decir, esta función se invoca con un argumento), entonces el valor del contexto se utiliza como valor de `str`. El parámetro `patrón` puede ser una cadena o una expresión regular." + }, + "$split": { + "args": "str[, separator][, limit]", + "desc": "Divide el parámetro `str` en una matriz de subcadenas. Es un error si `str` no es una cadena. El parámetro opcional `separador` especifica los caracteres dentro de la `cadena` sobre los cuales se debe dividir como una cadena o una expresión regular. Si no se especifica 'separador', se supone que la cadena está vacía y 'cadena' se dividirá en una matriz de caracteres individuales. Es un error si el 'separador' no es una cadena. El parámetro opcional 'límite' es un número que especifica el número máximo de subcadenas que se incluirán en la matriz resultante. Cualquier subcadena adicional se descarta. Si no se especifica `límite`, entonces `str` se divide completamente sin límite para el tamaño de la matriz resultante. Es un error si 'límite' no es un número positivo." + }, + "$join": { + "args": "array[, separator]", + "desc": "Une una matriz de cadenas de componentes en una única cadena concatenada con cada cadena de componentes separada por el parámetro 'separador' opcional. Es un error si la 'matriz' de entrada contiene un elemento que no es una cadena. Si no se especifica 'separador', se supone que es una cadena vacía, es decir, que no hay 'separador' entre las cadenas componentes. Es un error si el 'separador' no es una cadena." + }, + "$match": { + "args": "str, pattern [, limit]", + "desc": "Aplica la cadena `str` a la expresión regular `pattern` y devuelve una matriz de objetos, cada objeto contiene información sobre cada aparición de una coincidencia dentro de `str`." + }, + "$replace": { + "args": "str, pattern, replacement [, limit]", + "desc": "Encuentra apariciones de `patrón` dentro de `str` y las reemplaza con `reemplazo`.\n\nEl parámetro opcional `límite` es el número máximo de reemplazos." + }, + "$now": { + "args": "$[picture [, timezone]]", + "desc": "Genera una marca de tiempo en formato compatible con ISO 8601 y la devuelve como una cadena. Si se proporcionan los parámetros opcionales `picture` y `zona horaria`, entonces la marca de tiempo actual se formatea como se describe en la función `$fromMillis()`" + }, + "$base64encode": { + "args": "string", + "desc": "Convierte una cadena ASCII a una representación base 64. Cada carácter de la cadena se trata como un byte de datos binarios. Esto requiere que todos los caracteres de la cadena estén en el rango de 0x00 a 0xFF, que incluye todos los caracteres de las cadenas codificadas con URI. No se admiten caracteres Unicode fuera de ese rango." + }, + "$base64decode": { + "args": "string", + "desc": "Convierte bytes codificados en base 64 en una cadena, utilizando una página de códigos Unicode UTF-8." + }, + "$number": { + "args": "arg", + "desc": "Convierte el parámetro `arg` a un número usando las siguientes reglas de conversión:\n\n - Los números no cambian\n - Las cadenas que contienen una secuencia de caracteres que representan un número JSON legal se convierten a ese número\n - Todos los demás valores provocar que se arroje un error." + }, + "$abs": { + "args": "number", + "desc": "Devuelve el valor absoluto del parámetro 'número'." + }, + "$floor": { + "args": "number", + "desc": "Devuelve el valor de 'número' redondeado hacia abajo al entero más cercano que sea menor o igual a 'número'." + }, + "$ceil": { + "args": "number", + "desc": "Devuelve el valor de 'número' redondeado al número entero más cercano que sea mayor o igual a 'número'." + }, + "$round": { + "args": "number [, precision]", + "desc": "Devuelve el valor del parámetro 'número' redondeado al número de decimales especificado por el parámetro opcional 'precisión'." + }, + "$power": { + "args": "base, exponent", + "desc": "Devuelve el valor de 'base' elevado a la potencia de 'exponente'." + }, + "$sqrt": { + "args": "number", + "desc": "Devuelve la raíz cuadrada del valor del parámetro 'número'." + }, + "$random": { + "args": "", + "desc": "Devuelve un número pseudoaleatorio mayor o igual a cero y menor que uno." + }, + "$millis": { + "args": "", + "desc": "Devuelve el número de milisegundos desde la época Unix (1 de enero de 1970 UTC) como un número. Todas las invocaciones de `$millis()` dentro de una evaluación de una expresión devolverán el mismo valor." + }, + "$sum": { + "args": "array", + "desc": "Devuelve la suma aritmética de una 'matriz' de números. Es un error si la 'matriz' de entrada contiene un elemento que no es un número." + }, + "$max": { + "args": "array", + "desc": "Devuelve el número máximo en una 'matriz' de números. Es un error si la 'matriz' de entrada contiene un elemento que no es un número." + }, + "$min": { + "args": "array", + "desc": "Devuelve el número mínimo en una 'matriz' de números. Es un error si la 'matriz' de entrada contiene un elemento que no es un número." + }, + "$average": { + "args": "array", + "desc": "Devuelve el valor medio de una 'matriz' de números. Es un error si la 'matriz' de entrada contiene un elemento que no es un número." + }, + "$boolean": { + "args": "arg", + "desc": "Convierte el argumento a un booleano usando las siguientes reglas:\n\n - `Booleano`: sin cambios\n - `cadena`: vacía: `falso`\n - `cadena`: no vacía: `verdadero`\n - `número`: `0`: `falso`\n - `número`: distinto de cero: `verdadero`\n - `nulo`: `falso`\n - `matriz`: vacía: `falso`\n - `array`: contiene un miembro que se convierte en `true`: `true`\n - `array`: todos los miembros se convierten en `false`: `false`\n - `object`: vacío: `false`\n - `objeto`: no vacío: `verdadero`\n - `función`: `falso`" + }, + "$not": { + "args": "arg", + "desc": "Devuelve booleano NEGADO del argumento. `arg` se convierte antes en un booleano" + }, + "$exists": { + "args": "arg", + "desc": "Devuelve booleano 'verdadero' si la expresión 'arg' se evalúa como un valor, o 'falso' si la expresión no coincide con nada (por ejemplo, una ruta a una referencia de campo inexistente)." + }, + "$count": { + "args": "array", + "desc": "Devuelve el número de elementos de la matriz." + }, + "$append": { + "args": "array, array", + "desc": "Agrega dos matrices" + }, + "$sort": { + "args": "array [, function]", + "desc": "Devuelve una matriz que contiene todos los valores en el parámetro `array`, pero ordenados.\n\nSi se proporciona una `función` de comparador, entonces debe ser una función que toma dos parámetros:\n\n`function(left , derecha)`\n\nEsta función es invocada por el algoritmo de clasificación para comparar dos valores `izquierda` y `derecha`. Si el valor de `izquierda` debe colocarse después del valor de `derecha` en el orden de clasificación deseado, entonces la función debe devolver un valor booleano 'verdadero' para indicar un intercambio. De lo contrario debe devolver 'falso'." + }, + "$reverse": { + "args": "array", + "desc": "Devuelve una matriz que contiene todos los valores del parámetro `matriz`, pero en orden inverso." + }, + "$shuffle": { + "args": "array", + "desc": "Devuelve una matriz que contiene todos los valores del parámetro `array`, pero mezclados en orden aleatorio." + }, + "$zip": { + "args": "array, ...", + "desc": "Devuelve una matriz convolucionada (comprimida) que contiene matrices agrupadas de valores de los argumentos `matriz1`... `matrizN` del índice 0, 1, 2...." + }, + "$keys": { + "args": "object", + "desc": "Devuelve una matriz que contiene las claves del objeto. Si el argumento es una matriz de objetos, entonces la matriz devuelta contiene una lista deduplicada de todas las claves de todos los objetos." + }, + "$lookup": { + "args": "object, key", + "desc": "Devuelve el valor asociado con la clave en el objeto. Si el primer argumento es una matriz de objetos, entonces se buscan todos los objetos de la matriz y se devuelven los valores asociados con todas las apariciones de la clave." + }, + "$spread": { + "args": "object", + "desc": "Divide un objeto que contiene pares clave/valor en una matriz de objetos, cada uno de los cuales tiene un único par clave/valor del objeto de entrada. Si el parámetro es una matriz de objetos, entonces la matriz resultante contiene un objeto para cada par clave/valor en cada objeto de la matriz proporcionada." + }, + "$merge": { + "args": "array<object>", + "desc": "Fusiona una matriz de objetos en un único objeto que contiene todos los pares clave/valor de cada uno de los objetos en la matriz de entrada. Si alguno de los objetos de entrada contiene la misma clave, entonces el objeto devuelto contendrá el valor del último en la matriz. Es un error si la matriz de entrada contiene un elemento que no es un objeto." + }, + "$sift": { + "args": "object, function", + "desc": "Devuelve un objeto que contiene solo los pares clave/valor del parámetro `objeto` que satisfacen el predicado `función` pasado como segundo parámetro.\n\nLa `función` que se proporciona como segundo parámetro debe tener la siguiente firma:\n\n`función(valor [, clave [, objeto]])`" + }, + "$each": { + "args": "object, function", + "desc": "Devuelve una matriz que contiene los valores devueltos por la función cuando se aplica a cada par clave/valor en el objeto." + }, + "$map": { + "args": "array, function", + "desc": "Devuelve una matriz que contiene los resultados de aplicar el parámetro `función` a cada valor en el parámetro `matriz`.\n\nLa `función` que se proporciona como segundo parámetro debe tener la siguiente firma:\n\n`función( valor [, índice [, matriz]])`" + }, + "$filter": { + "args": "array, function", + "desc": "Devuelve una matriz que contiene solo los valores en el parámetro `matriz` que satisfacen el predicado `función`.\n\nLa `función` que se proporciona como segundo parámetro debe tener la siguiente firma:\n\n`función(valor [ , índice [, matriz]])`" + }, + "$reduce": { + "args": "array, function [, init]", + "desc": "Devuelve un valor agregado derivado de aplicar el parámetro `función` sucesivamente a cada valor en `matriz` en combinación con el resultado de la aplicación anterior de la función.\n\nLa función debe aceptar dos argumentos y se comporta como un operador infijo entre cada valor dentro de la matriz. La firma de la `función` debe tener la forma: `myfunc($accumulator, $value[, $index[, $array]])`\n\nEl parámetro opcional `init` se utiliza como valor inicial en la agregación." + }, + "$flowContext": { + "args": "string[, string]", + "desc": "Recupera una propiedad de contexto de flujo.\n\nEsta es una función definida por Node-RED." + }, + "$globalContext": { + "args": "string[, string]", + "desc": "Recupera una propiedad de contexto global.\n\nEsta es una función definida por Node-RED." + }, + "$pad": { + "args": "string, width [, char]", + "desc": "Devuelve una copia de la `cadena` con relleno adicional, si es necesario, de modo que su número total de caracteres sea al menos el valor absoluto del parámetro `ancho`.\n\nSi `ancho` es un número positivo, entonces la cadena está acolchado hacia la derecha; si es negativo, se rellena hacia la izquierda.\n\nEl argumento opcional `char` especifica los caracteres de relleno que se utilizarán. Si no se especifica, el valor predeterminado es el carácter de espacio." + }, + "$fromMillis": { + "args": "number, [, picture [, timezone]]", + "desc": "Convierte el `número` que representa milisegundos desde la época Unix (1 de enero de 1970 UTC) en una representación de cadena formateada según la plantilla en picture.\n\nSi se omite el parámetro opcional `picture`, entonces la marca de tiempo es formateado en el formato ISO 8601.\n\nSi se proporciona la cadena opcional `picture`, entonces la marca de tiempo se formatea de acuerdo con la representación especificada en esa cadena. El comportamiento de esta función es consistente con la versión de dos argumentos de la función XPath/XQuery `format-dateTime` tal como se define en la especificación XPath F&O 3.1. El parámetro de plantilla define cómo se formatea la marca de tiempo y tiene la misma sintaxis que `format-dateTime`.\n\nSi se proporciona la cadena opcional `timezone`, entonces la marca de tiempo formateada estará en esa zona horaria. La cadena `timezone` debe tener el formato '±HHMM', donde ± es el signo más o menos y HHMM es el desplazamiento en horas y minutos desde UTC. Desplazamiento positivo para zonas horarias al este de UTC, desplazamiento negativo para zonas horarias al oeste de UTC." + }, + "$formatNumber": { + "args": "number, picture [, options]", + "desc": "Convierte el `número` en una cadena y lo formatea en una representación decimal según lo especificado en la cadena `picture`.\n\n El comportamiento de esta función es coherente con la función XPath/XQuery `fn:format-number` tal como se define en la especificación XPath F&O 3.1. El parámetro de cadena `picture` define cómo se formatea el número y tiene la misma sintaxis que `fn:formato-número`.\n\nEl tercer argumento opcional `opciones` se utiliza para anular los caracteres de formato específicos de la configuración regional predeterminada, como el decimal. separador. Si se proporciona, este argumento debe ser un objeto que contenga pares de nombre/valor especificados en la sección de formato decimal de la especificación XPath F&O 3.1." + }, + "$formatBase": { + "args": "number [, radix]", + "desc": "Convierte el número en una cadena y lo formatea como un número entero representado en la base numérica especificada por el argumento `radix`. Si no se especifica `radix`, el valor predeterminado es la base 10. `radix` puede estar entre 2 y 36; de lo contrario, se genera un error." + }, + "$toMillis": { + "args": "timestamp", + "desc": "Convierte una cadena de `marca de tiempo` en el formato ISO 8601 al número de milisegundos desde la época Unix (1 de enero de 1970 UTC) como un número. Se genera un error si la cadena no tiene el formato correcto." + }, + "$env": { + "args": "arg", + "desc": "Devuelve el valor de una variable de entorno.\n\nEsta es una función definida por Node-RED." + }, + "$eval": { + "args": "expr [, context]", + "desc": "Analiza y evalúa la cadena `expr` que contiene JSON literal o una expresión JSONata utilizando el contexto actual como contexto para la evaluación." + }, + "$formatInteger": { + "args": "number, picture", + "desc": "Convierte el número en una cadena y lo formatea en una representación entera como lo especifica la cadena `picture`. El parámetro de define cómo se formatea el número y tiene la misma sintaxis que `fn:format-integer` de la especificación XPath F&O 3.1." + }, + "$parseInteger": { + "args": "string, picture", + "desc": "Analiza el contenido del parámetro cadena en un número entero (como un número JSON) utilizando el formato especificado por la cadena `picture`. El parámetro tiene el mismo formato que `$formatInteger`." + }, + "$error": { + "args": "[str]", + "desc": "Lanza un error con un mensaje. El parámetro `str` opcional reemplazará el mensaje predeterminado de `$error() función evaluada`" + }, + "$assert": { + "args": "arg, str", + "desc": "Si `arg` es `verdadero`, la función devuelve indefinido. Si `arg` es `falso`, se lanza una excepción con `str` como mensaje de excepción." + }, + "$single": { + "args": "array, function", + "desc": "Devuelve el único valor en el parámetro `array` que satisface el predicado de `función` (es decir, la `función` devuelve booleano `verdadero` cuando se pasa el valor). Lanza una excepción si el número de valores coincidentes no es exactamente uno.\n\nLa función debe proporcionarse con la siguiente firma: `función(valor [, índice [, matriz]])` donde el valor es cada entrada de la matriz. El índice es la posición de ese valor y toda la matriz se pasa como tercer argumento." + }, + "$encodeUrlComponent": { + "args": "str", + "desc": "Codifica un componente de URL reemplazando cada instancia de ciertos caracteres por una, dos, tres o cuatro secuencias de escape que representan la codificación UTF-8 del carácter.\n\nEjemplo: `$encodeUrlComponent(\"?x=prueba\")` => `\"%3Fx%3Dprueba\"`" + }, + "$encodeUrl": { + "args": "str", + "desc": "Codifica una URL reemplazando cada instancia de ciertos caracteres por una, dos, tres o cuatro secuencias de escape que representan la codificación UTF-8 del carácter.\n\nEjemplo: `$encodeUrl(\"https://mozilla.org/?x=шеллы\")` => `\"https://mozilla.org/?x=%D1%88%D0%B5%D0%BB%D0%BB%D1%8B\"`" + }, + "$decodeUrlComponent": { + "args": "str", + "desc": "Decodifica un componente de URL creado previamente por encodeUrlComponent.\n\nEjemplo: `$decodeUrlComponent(\"%3Fx%3Dtest\")` => `\"?x=test\"`" + }, + "$decodeUrl": { + "args": "str", + "desc": "Decodifica una URL creado previamente por encodeUrl.\n\nEjemplo: `$decodeUrl(\"https://mozilla.org/?x=%D1%88%D0%B5%D0%BB%D0%BB%D1%8B\")` => `\"https://mozilla.org/?x=шеллы\"`" + }, + "$distinct": { + "args": "array", + "desc": "Devuelve una matriz con valores duplicados eliminados de `matriz`" + }, + "$type": { + "args": "value", + "desc": "Devuelve el tipo de `valor` como una cadena. Si `valor` no está definido, esto devolverá indefinido." + }, + "$moment": { + "args": "[str]", + "desc": "Obtiene un objeto de fecha usando la biblioteca Moment." + }, + "$clone": { + "args": "value", + "desc": "Clona un objeto de forma segura." + } +} diff --git a/packages/node_modules/@node-red/editor-client/locales/fr/editor.json b/packages/node_modules/@node-red/editor-client/locales/fr/editor.json index 46d85daa5..6faa1ed24 100644 --- a/packages/node_modules/@node-red/editor-client/locales/fr/editor.json +++ b/packages/node_modules/@node-red/editor-client/locales/fr/editor.json @@ -119,10 +119,9 @@ "searchInput": "Rechercher vos flux", "subflows": "Sous-flux", "createSubflow": "Créer un sous-flux", - "selectionToSubflow": "Selection d'un sous-flux", + "selectionToSubflow": "Convertir en sous-flux", "flows": "Flux", "add": "Ajouter", - "rename": "Renommer", "delete": "Supprimer", "keyboardShortcuts": "Raccourcis clavier", "login": "Se connecter", @@ -130,6 +129,11 @@ "editPalette": "Gérer la palette", "other": "Autre", "showTips": "Afficher les astuces", + "showNodeHelp": "Afficher l'aide du noeud", + "enableSelectedNodes": "Activer les noeuds sélectionnés", + "disableSelectedNodes": "Désactiver les noeuds sélectionnés", + "showSelectedNodeLabels": "Afficher les étiquettes des noeuds sélectionnés", + "hideSelectedNodeLabels": "Masquer les étiquettes des noeuds sélectionnés", "showWelcomeTours": "Afficher les visites guidées pour les nouvelles versions", "help": "Site web de Node-RED", "projects": "Projets", @@ -274,23 +278,23 @@ "recoveredNodesInfo": "Les noeuds importés sur ce flux contiennent un mauvais identifiant de flux. Ces noeuds ont été ajoutés à ce flux afin que vous puissiez les restaurer ou les supprimer.", "recoveredNodesNotification": "

Noeuds importés sans identifiant de flux valide

Ils ont été ajoutés à un nouveau flux appelé '__flowName__'.

", "export": { - "selected": "noeuds sélectionnés", - "current": "flux actuel", + "selected": "les noeuds sélectionnés", + "current": "le flux actuel", "all": "tous les flux", - "compact": "condensé", - "formatted": "formaté", + "compact": "Condensé", + "formatted": "Formaté", "copy": "Copier dans le presse-papier", "export": "Exporter vers la bibliothèque", - "exportAs": "Exporter en tant que", + "exportAs": "Exporter comme", "overwrite": "Remplacer", "exists": "

\"__file__\" existe déjà.

Voulez-vous le remplacer ?

" }, "import": { "import": "Importer vers", - "importSelected": "Importation sélectionnée", + "importSelected": "Importer la sélection", "importCopy": "Importer une copie", - "viewNodes": "Afficher les noeuds...", - "newFlow": "Nouveau flux", + "viewNodes": "Vérifier ces noeuds", + "newFlow": "un nouveau flux", "replace": "Remplacer", "errors": { "notArray": "L'entrée n'est pas un tableau JSON", @@ -299,7 +303,8 @@ "missingType": "L'entrée n'est pas un flux valide - l'élément '__index__' n'a pas de propriété 'type'" }, "conflictNotification1": "Certains des noeuds que vous avez importés existent déjà dans votre espace de travail.", - "conflictNotification2": "Sélectionner les noeuds à importer et choisir s'il faut remplacer les noeuds existants ou en importer une copie." + "conflictNotification2": "Sélectionnez les noeuds à importer et choisissez s'il faut remplacer les noeuds existants ou en importer une copie.", + "alreadyExists": "Ce noeud existe déjà" }, "copyMessagePath": "Chemin copié", "copyMessageValue": "Valeur copiée", @@ -391,10 +396,10 @@ "subflowInstances": "Il existe __count__ instance de ce modèle de sous-flux", "subflowInstances_plural": "Il existe __count__ instances de ce modèle de sous-flux", "editSubflowProperties": "modifier les propriétés", - "input": "entrées:", - "output": "sorties:", - "status": "statut du noeud", - "deleteSubflow": "supprimer le sous-flux", + "input": "Entrées:", + "output": "Sorties:", + "status": "Statut du noeud", + "deleteSubflow": "Supprimer le sous-flux", "confirmDelete": "Voulez-vous vraiment supprimer ce sous-flux ?", "info": "Description", "category": "Catégorie", @@ -416,6 +421,7 @@ }, "errors": { "noNodesSelected": "Impossible de créer un sous-flux : aucun noeud sélectionné", + "acrossMultipleGroups": "Impossible de créer un sous-flux sur plusieurs groupes", "multipleInputsToSelection": "Impossible de créer un sous-flux : plusieurs entrées pour la sélection" } }, @@ -447,8 +453,8 @@ "default": "Par défaut", "noDefaultLabel": "Aucune", "defaultLabel": "Utiliser l'étiquette par défaut", - "searchIcons": "Icônes de recherche", - "useDefault": "Utilisation par défaut", + "searchIcons": "Rechercher une icône", + "useDefault": "Icône par défaut", "description": "Description", "show": "Afficher", "hide": "Masquer", @@ -498,19 +504,19 @@ "keyboard": { "title": "Raccourcis clavier", "keyboard": "Clavier", - "filterActions": "Actions de filtrage", - "shortcut": "raccourci", - "scope": "portée", + "filterActions": "Rechercher l'action", + "shortcut": "Raccourci", + "scope": "Portée", "unassigned": "Non attribué", - "global": "global", - "workspace": "espace de travail", - "editor": "boîte de dialogue d'édition", + "global": "Global", + "workspace": "Espace de travail", + "editor": "Boîte de dialogue d'édition", "selectAll": "Tout sélectionner", "selectNone": "Ne rien sélectionner", "selectAllConnected": "Sélectionner tous les éléments connectés", "addRemoveNode": "Ajouter/supprimer un noeud de la sélection", "editSelected": "Modifier le noeud sélectionné", - "deleteSelected": "Supprimer les noeuds ou le lien sélectionné(s)", + "deleteSelected": "Supprimer la sélection", "deleteReconnect": "Supprimer et reconnecter", "importNode": "Importer les noeuds", "exportNode": "Exporter les noeuds", @@ -550,22 +556,22 @@ }, "palette": { "noInfo": "Pas d'information disponible", - "filter": "Filtrer les noeuds", + "filter": "Rechercher le noeud", "search": "Rechercher les modules", "addCategory": "Ajouter un nouveau...", "label": { - "subflows": "sous-flux", - "network": "réseau", - "common": "commun", - "input": "entrée", - "output": "sortie", - "function": "fonction", - "sequence": "séquence", - "parser": "analyseur", - "social": "social", - "storage": "stockage", - "analysis": "analyse", - "advanced": "avancé" + "subflows": "Sous-flux", + "network": "Réseau", + "common": "Commun", + "input": "Entrée", + "output": "Sortie", + "function": "Fonction", + "sequence": "Séquence", + "parser": "Analyseur", + "social": "Social", + "storage": "Stockage", + "analysis": "Analyse", + "advanced": "Avancé" }, "actions": { "collapse-all": "Réduire toutes les catégories", @@ -586,6 +592,7 @@ "editor": { "title": "Gérer la palette", "palette": "Palette", + "allCatalogs": "Tous les catalogues", "times": { "seconds": "il y a quelques secondes", "minutes": "il y a quelques minutes", @@ -609,24 +616,25 @@ "nodeCount_plural": "__label__ noeuds", "moduleCount": "__count__ module disponible", "moduleCount_plural": "__count__ modules disponibles", - "inuse": "en cours d'utilisation", - "enableall": "activer tout", - "disableall": "désactiver tout", - "enable": "activer", - "disable": "désactiver", - "remove": "supprimer", - "update": "mettre à jour vers __version__", - "updated": "mis à jour", - "install": "installer", - "installed": "installé", - "conflict": "conflit", + "inuse": "En cours d'utilisation", + "enableall": "Activer tout", + "disableall": "Désactiver tout", + "enable": "Activer", + "disable": "Désactiver", + "remove": "Supprimer", + "update": "Mettre à jour vers __version__", + "updated": "Mis à jour", + "install": "Installer", + "installed": "Installé", + "conflict": "Conflit", "conflictTip": "

Ce module ne peut pas être installé car il inclut un
type de noeud qui a déjà été installé

Conflits avec __module__

", "loading": "Chargement des catalogues...", "tab-nodes": "Noeuds", "tab-install": "Installer", - "sort": "trier:", - "sortAZ": "a-z", - "sortRecent": "récent", + "sort": "Trier:", + "sortRelevance": "Pertinence", + "sortAZ": "A-Z", + "sortRecent": "Récent", "more": "+ __count__ en plus", "upload": "Charger le fichier tgz du module", "refresh": "Actualiser la liste des modules", @@ -667,7 +675,7 @@ "info": { "name": "Information", "tabName": "Nom", - "label": "info", + "label": "Info", "node": "Noeud", "type": "Type", "group": "Groupe", @@ -681,10 +689,10 @@ "properties": "Propriétés", "info": "Information", "desc": "Description", - "blank": "vide", - "null": "nul", - "showMore": "afficher en plus", - "showLess": "afficher en moins", + "blank": "Vide", + "null": "Nul", + "showMore": "Afficher en plus", + "showLess": "Afficher en moins", "flow": "Flux", "selection": "Sélection", "nodes": "__count__ noeuds", @@ -695,7 +703,7 @@ "arrayItems": "__count__ éléments", "showTips": "Vous pouvez ouvrir les astuces à partir du panneau des paramètres", "outline": "Plan", - "empty": "vide", + "empty": "Vide", "globalConfig": "Noeuds de configuration globale", "triggerAction": "Déclencher une action", "find": "Rechercher dans l'espace de travail", @@ -706,7 +714,7 @@ }, "help": { "name": "Aide", - "label": "aide", + "label": "Aide", "search": "Aide à la recherche", "nodeHelp": "Aide sur les noeuds", "showHelp": "Afficher l'aide", @@ -717,23 +725,23 @@ }, "config": { "name": "Noeuds de configuration", - "label": "configuration", + "label": "Configuration", "global": "Tous les flux", - "none": "aucun", - "subflows": "sous-flux", - "flows": "flux", - "filterAll": "tout", + "none": "Aucun", + "subflows": "Sous-flux", + "flows": "Flux", + "filterAll": "Tout", "showAllConfigNodes": "Afficher tous les noeuds de configuration", - "filterUnused": "inutilisé", + "filterUnused": "Inutilisé", "showAllUnusedConfigNodes": "Afficher tous les noeuds de configuration inutilisés", "filtered": "__count__ caché(s)" }, "context": { "name": "Données contextuelles", - "label": "contexte", - "none": "aucune sélection", - "refresh": "actualiser pour charger", - "empty": "vide", + "label": "Contexte", + "none": "Aucune sélection", + "refresh": "Actualiser pour charger", + "empty": "Vide", "node": "Noeud", "flow": "Flux", "global": "Global", @@ -744,10 +752,10 @@ }, "palette": { "name": "Gestion des palettes", - "label": "palette" + "label": "Palette" }, "project": { - "label": "projet", + "label": "Projet", "name": "Projet", "description": "Description", "dependencies": "Dépendances", @@ -760,11 +768,11 @@ "showProjectSettings": "Afficher les paramètres du projet", "projectSettings": { "title": "Paramètres du projet", - "edit": "modifier", + "edit": "Modifier", "none": "Vide", - "install": "installer", - "removeFromProject": "supprimer du projet", - "addToProject": "ajouter au projet", + "install": "Installer", + "removeFromProject": "Supprimer du projet", + "addToProject": "Ajouter au projet", "files": "Fichiers", "flow": "Flux", "credentials": "Identifiants", @@ -812,7 +820,7 @@ "workflowAutoTip": "Les modifications sont validées automatiquement à chaque déploiement", "sshKeys": "Clés SSH", "sshKeysTip": "Vous permet de créer des connexions sécurisées aux référentiels Git distants.", - "add": "ajouter une clé", + "add": "Ajouter une clé", "addSshKey": "Ajouter une clé SSH", "addSshKeyTip": "Générer une nouvelle paire de clés publique/privée", "name": "Nom", @@ -826,7 +834,7 @@ "copyPublicKey": "Copier la clé publique dans le presse-papiers", "delete": "Supprimer une clé", "gitConfig": "Configuration Git", - "deleteConfirm": "Êtes-vous sûr de vouloir supprimer la clé SSH __nom__ ? Ça ne peut pas être annulé." + "deleteConfirm": "Êtes-vous sûr de vouloir supprimer la clé SSH __name__ ? Ça ne peut pas être annulé." }, "versionControl": { "unstagedChanges": "Abandon des changements", @@ -848,7 +856,7 @@ "none": "Vide", "conflictResolve": "Tous les conflits ont été résolus. Valider les modifications pour terminer la fusion.", "localFiles": "Fichiers locaux", - "all": "tout", + "all": "Tout", "unmergedChanges": "Modifications non fusionnées", "abortMerge": "Abandonner la fusion", "commit": "Valider", @@ -1097,9 +1105,9 @@ "desc8": "Le fichier contenant les identifiants ne sera pas crypté et son contenu sera facilement lisible", "create-project-files": "Créer des fichiers de projet", "create-project": "Créer un projet", - "already-exists": "existe déjà", + "already-exists": "Existe déjà", "git-error": "Erreur Git", - "git-auth-error": "erreur d'authentification Git" + "git-auth-error": "Erreur d'authentification Git" }, "create-success": { "success": "Vous avez créé avec succès votre premier projet !", @@ -1135,8 +1143,8 @@ "desc2": "Avant de pouvoir cloner un référentiel sur ssh, vous devez ajouter une clé SSH pour y accéder.", "add-ssh-key": "Ajouter une clé ssh", "credentials-encryption-key": "Clé de chiffrement des identifiants", - "already-exists-2": "existe déjà", - "git-error": "erreur git", + "already-exists-2": "Existe déjà", + "git-error": "Erreur git", "con-failed": "La connexion a échoué", "not-git": "Ce n'est pas un dépôt git", "no-resource": "Référentiel introuvable", @@ -1148,8 +1156,8 @@ "confirm": "Voulez-vous vraiment supprimer ce projet ?" }, "create-project-list": { - "search": "rechercher vos projets", - "current": "actuel" + "search": "Rechercher vos projets", + "current": "Actuel" }, "require-clean": { "confirm": "

Vous avez des modifications non déployées qui seront perdues.

Voulez-vous continuer ?

" @@ -1198,23 +1206,11 @@ "diagnostics": { "title": "Information système" }, - "languages": { - "de": "Allemand", - "en-US": "Anglais", - "fr": "Français", - "ja": "Japonais", - "ko": "Coréen", - "pt-BR": "Portugais brésilien", - "ru": "Russe", - "zh-CN": "Chinois (Simplifié)", - "zh-TW": "Chinois (Traditionnel)" - }, "validator": { "errors": { "invalid-json": "Données JSON invalides : __error__", - "invalid-json-prop": "__prop__: données JSON invalides : __error__", - "invalid-prop": "Expression de propriété non valide", - "invalid-prop-prop": "__prop__: expression de propriété invalide", + "invalid-expr": "Expression JSONata invalide : __error__", + "invalid-prop": "Expression de propriété invalide", "invalid-num": "Numéro invalide", "invalid-num-prop": "__prop__: numéro invalide", "invalid-regexp": "Modèle d'entrée non valide", @@ -1226,6 +1222,7 @@ } }, "contextMenu": { + "showActionList": "Afficher la liste des actions", "insert": "Insérer", "node": "Noeud", "junction": "Jonction", @@ -1235,5 +1232,159 @@ "environment": "Environment", "header": "Variables d'environnement globales", "revert": "Rétablir" + }, + "action-list": { + "toggle-show-tips": "Basculer l'affichage des astuces", + "show-about": "Afficher la description de Node-RED", + "show-welcome-tour": "Afficher la visite de bienvenue", + "show-next-tab": "Afficher l'onglet suivant", + "show-previous-tab": "Afficher l'onglet précédent", + "add-flow": "Ajouter un flux", + "add-flow-to-right": "Ajouter un flux à droite", + "edit-flow": "Modifier le flux", + "remove-flow": "Supprimer le flux", + "enable-flow": "Activer le flux", + "disable-flow": "Désactiver le flux", + "hide-flow": "Masquer le flux", + "hide-other-flows": "Masquer les autres flux", + "hide-all-flows": "Masquer tous les flux", + "show-all-flows": "Afficher tous les flux", + "show-last-hidden-flow": "Afficher le dernier flux masqué", + "list-modified-nodes": "Afficher les flux modifiés", + "list-hidden-flows": "Afficher les flux cachés", + "list-flows": "Lister les flux", + "list-subflows": "Liste les sous-flux", + "go-to-previous-location": "Aller à l'emplacement précédent", + "go-to-next-location": "Aller à l'emplacement suivant", + "copy-selection-to-internal-clipboard": "Copier la sélection dans le presse-papiers", + "cut-selection-to-internal-clipboard": "Couper la sélection dans le presse-papiers", + "paste-from-internal-clipboard": "Coller depuis le presse-papiers", + "detach-selected-nodes": "Détacher les noeuds sélectionnés", + "delete-selection": "Supprimer la sélection", + "delete-selection-and-reconnect": "Supprimer la sélection et reconnecter", + "edit-selected-node": "Modifier le noeud sélectionné", + "go-to-selection": "Aller à la sélection", + "undo": "Annuler les modifications", + "redo": "Rétablir les modifications", + "select-all-nodes": "Sélectionner tous les noeuds", + "select-none": "Sélectionner un noeud", + "enable-selected-nodes": "Activer les noeuds sélectionnés", + "disable-selected-nodes": "Désactiver les noeuds sélectionnés", + "toggle-show-grid": "Basculer l'affichage de la grille", + "toggle-snap-grid": "Basculer l'aide au placement des noeuds", + "toggle-status": "Commuter l'état", + "show-selected-node-labels": "Afficher les étiquettes des noeuds sélectionnés", + "hide-selected-node-labels": "Masquer les étiquettes des noeuds sélectionnés", + "scroll-view-up": "Faire défiler vers le haut", + "scroll-view-right": "Faire défiler vers la droite", + "scroll-view-down": "Faire défiler vers le bas", + "scroll-view-left": "Faire défiler vers la gauche", + "step-view-up": "Faire défiler d'une unité vers le haut", + "step-view-right": "Faire défiler d'une unité vers la droite", + "step-view-down": "Faire défiler d'une unité vers le bas", + "step-view-left": "Faire défiler d'une unité vers la gauche", + "move-selection-up": "Déplacer la sélection vers le haut", + "move-selection-right": "Déplacer la sélection vers la droite", + "move-selection-down": "Déplacer la sélection vers le bas", + "move-selection-left": "Déplacer la sélection vers la gauche", + "move-selection-forwards": "Avancer la sélection", + "move-selection-backwards": "Reculer la sélection", + "move-selection-to-front": "Déplacer la sélection vers l'avant", + "move-selection-to-back": "Déplacer la sélection vers l'arrière", + "step-selection-up": "Déplacer la sélection d'une unité vers le haut", + "step-selection-right": "Déplacer la sélection d'une unité vers la droite", + "step-selection-down": "Déplacer la sélection d'une unité vers le bas", + "step-selection-left": "Déplacer la sélection d'une unité vers la gauche", + "select-connected-nodes": "Sélectionner les noeuds connectés", + "select-downstream-nodes": "Sélectionner les noeuds connectés en aval", + "select-upstream-nodes": "Sélectionner les noeuds connectés en amont", + "go-to-next-node": "Aller au noeud suivant", + "go-to-previous-node": "Aller au noeud précédent", + "go-to-next-sibling": "Aller au noeud frère suivant", + "go-to-previous-sibling": "Aller au noeud frère précédent", + "go-to-nearest-node-on-left": "Aller au noeud gauche le plus proche", + "go-to-nearest-node-on-right": "Aller au noeud droit le plus proche", + "go-to-nearest-node-above": "Aller au noeud supérieur le plus proche", + "go-to-nearest-node-below": "Aller au noeud le plus proche ci-dessous", + "align-selection-to-grid": "Aligner la sélection", + "align-selection-to-left": "Aligner la sélection à gauche", + "align-selection-to-right": "Aligner la sélection à droite", + "align-selection-to-top": "Aligner la sélection en haut", + "align-selection-to-bottom": "Aligner la sélection vers le bas", + "align-selection-to-middle": "Aligner la sélection au centre verticalement", + "align-selection-to-center": "Aligner la sélection au centre horizontalement", + "distribute-selection-horizontally": "Distribuer la sélection horizontalement", + "distribute-selection-vertical": "Distribuer la sélection verticalement", + "wire-series-of-nodes": "Connecter les noeuds en série", + "wire-node-to-multiple": "Connecter les noeuds à plusieurs", + "wire-multiple-to-node": "Connecter plusieurs au noeud", + "split-wire-with-link-nodes": "Diviser le fil avec des noeuds de liaison", + "generate-node-names": "Générer les noms de noeuds", + "show-user-settings": "Afficher les paramètres utilisateur", + "show-help": "Afficher l'aide", + "toggle-palette": "Basculer l'affichage de la palette", + "show-event-log": "Afficher le journal des événements", + "manage-palette": "Gérer la palette", + "toggle-sidebar": "Basculer l'affichage de la barre latérale", + "show-info-tab": "Afficher l'onglet d'informations sur le noeud", + "show-help-tab": "Afficher l'onglet d'aide du noeud", + "show-config-tab": "Afficher l'onglet du noeud de configuration", + "select-all-config-nodes": "Sélectionner tous les noeuds de configuration", + "delete-config-selection": "Supprimer le noeud de configuration sélectionné", + "show-context-tab": "Afficher l'onglet des données contextuelles", + "create-subflow": "Créer un sous-flux", + "convert-to-subflow": "Convertir la sélection en sous-flux", + "group-selection": "Grouper la sélection", + "ungroup-selection": "Dissocier la sélection", + "merge-selection-to-group": "Fusionner la sélection dans le groupe", + "remove-selection-from-group": "Supprimer la sélection du groupe", + "copy-group-style": "Copier le style du groupe", + "paste-group-style": "Coller le style du groupe", + "show-export-dialog": "Afficher la boîte de dialogue d'exportation", + "show-import-dialog": "Afficher la boîte de dialogue d'importation", + "show-library-export-dialog": "Afficher la boîte de dialogue d'exportation de la bibliothèque", + "show-library-import-dialog": "Afficher la boîte de dialogue d'importation de bibliothèque", + "show-examples-import-dialog": "Afficher la boîte de dialogue d'importation d'exemples", + "search": "Rechercher", + "search-previous": "Recherche précédente", + "search-next": "Recherche suivante", + "show-action-list": "Afficher la liste d'actions", + "confirm-edit-tray": "Confirmer la modification", + "cancel-edit-tray": "Annuler la modification", + "show-remote-diff": "Afficher les différences avec les modifications distantes", + "deploy-flows": "Déployer des flux", + "restart-flows": "Redémarrer les flux", + "set-deploy-type-to-full": "Définir le déploiement sur 'tout'", + "set-deploy-type-to-modified-flows": "Définir le déploiement sur 'flux modifiés'", + "set-deploy-type-to-modified-nodes": "Définir le déploiement sur 'noeuds modifiés'", + "show-debug-tab": "Afficher l'onglet de débogage", + "clear-debug-messages": "Supprimer les messages de débogage", + "clear-filtered-debug-messages": "Supprimer les messages de débogage filtrés", + "activate-selected-debug-nodes": "Activer les noeuds de débogage sélectionnés", + "activate-all-debug-nodes": "Activer tous les noeuds de débogage", + "activate-all-flow-debug-nodes": "Activer tous les noeuds de débogage dans un flux", + "deactivate-selected-debug-nodes": "Désactiver les noeuds de débogage sélectionnés", + "deactivate-all-debug-nodes": "Désactiver tous les noeuds de débogage", + "deactivate-all-flow-debug-nodes": "Désactiver tous les noeuds de débogage dans un flux", + "zoom-in": "Zoomer", + "zoom-out": "Dézoomer", + "zoom-reset": "Réinitialiser le zoom", + "toggle-navigator": "Basculer l'affichage du navigateur", + "show-system-info": "Afficher les informations système", + "split-wires-with-junctions": "Diviser les fils avec des jonctions", + "new-project": "Nouveau projet", + "open-project": "Ouvrir le projet", + "show-project-settings": "Afficher les paramètres du projet", + "show-version-control-tab": "Afficher l'onglet de contrôle de version", + "start-flows": "Démarrer les flux", + "stop-flows": "Arrêter les flux", + "copy-item-url": "Copier l'URL de l'élément", + "copy-item-edit-url": "Copier l'URL de modification de l'élément", + "move-flow-to-start": "Déplacer le flux jusqu'au début", + "move-flow-to-end": "Déplacer le flux jusqu'à la fin", + "show-global-env": "Afficher les variables d'environnement globales", + "lock-flow": "Verrouiller le flux", + "unlock-flow": "Déverrouiller le flux", + "show-node-help": "Afficher l'aide du noeud" } } diff --git a/packages/node_modules/@node-red/editor-client/locales/fr/jsonata.json b/packages/node_modules/@node-red/editor-client/locales/fr/jsonata.json index ea7aff815..fca57953a 100644 --- a/packages/node_modules/@node-red/editor-client/locales/fr/jsonata.json +++ b/packages/node_modules/@node-red/editor-client/locales/fr/jsonata.json @@ -270,5 +270,9 @@ "$moment": { "args": "[str]", "desc": "Obtient un objet de date à l'aide de la bibliothèque Moment." + }, + "$clone": { + "args": "valeur", + "desc": "Cloner un objet en toute sécurité." } } 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 42257f6b0..5d988c68a 100644 --- a/packages/node_modules/@node-red/editor-client/locales/ja/editor.json +++ b/packages/node_modules/@node-red/editor-client/locales/ja/editor.json @@ -122,7 +122,6 @@ "selectionToSubflow": "選択部分をサブフロー化", "flows": "フロー", "add": "フローを新規追加", - "rename": "フロー名を変更", "delete": "フローを削除", "keyboardShortcuts": "ショートカットキーの説明", "login": "ログイン", @@ -130,6 +129,11 @@ "editPalette": "パレットの管理", "other": "その他", "showTips": "ヒントを表示", + "showNodeHelp": "ノードのヘルプを表示", + "enableSelectedNodes": "選択したノードを有効化", + "disableSelectedNodes": "選択したノードを無効化", + "showSelectedNodeLabels": "選択したノードのラベル表示", + "hideSelectedNodeLabels": "選択したノードのラベル非表示", "showWelcomeTours": "新バージョンのガイドツアーを表示", "help": "Node-REDウェブサイト", "projects": "プロジェクト", @@ -511,7 +515,7 @@ "selectAllConnected": "接続されたノードを選択", "addRemoveNode": "ノードの選択、選択解除", "editSelected": "選択したノードを編集", - "deleteSelected": "選択したノードや接続を削除", + "deleteSelected": "選択部分を削除", "deleteReconnect": "削除と再接続", "importNode": "フローの読み込み", "exportNode": "フローの書き出し", @@ -1201,23 +1205,11 @@ "diagnostics": { "title": "システム情報" }, - "languages": { - "de": "ドイツ語", - "en-US": "英語", - "fr": "フランス語", - "ja": "日本語", - "ko": "韓国語", - "pt-BR": "ポルトガル語", - "ru": "ロシア語", - "zh-CN": "中国語(簡体)", - "zh-TW": "中国語(繁体)" - }, "validator": { "errors": { "invalid-json": "JSONデータが不正: __error__", - "invalid-json-prop": "__prop__: JSONデータが不正: __error__", + "invalid-expr": "不正なJSONata式: __error__", "invalid-prop": "プロパティ式が不正", - "invalid-prop-prop": "__prop__: プロパティ式が不正", "invalid-num": "数値が不正", "invalid-num-prop": "__prop__: 数値が不正", "invalid-regexp": "入力パターンが不正", @@ -1229,6 +1221,7 @@ } }, "contextMenu": { + "showActionList": "動作一覧を表示", "insert": "挿入", "node": "ノード", "junction": "分岐点", diff --git a/packages/node_modules/@node-red/editor-client/locales/ko/editor.json b/packages/node_modules/@node-red/editor-client/locales/ko/editor.json index ad4f4354f..4de2cb5d2 100644 --- a/packages/node_modules/@node-red/editor-client/locales/ko/editor.json +++ b/packages/node_modules/@node-red/editor-client/locales/ko/editor.json @@ -79,7 +79,6 @@ "selectionToSubflow": "서브 플로우 선택", "flows": "플로우", "add": "추가", - "rename": "이름변경", "delete": "삭제", "keyboardShortcuts": "단축키", "login": "로그인", diff --git a/packages/node_modules/@node-red/editor-client/locales/pt-BR/editor.json b/packages/node_modules/@node-red/editor-client/locales/pt-BR/editor.json index 6e20bc32d..fe7ca27ba 100644 --- a/packages/node_modules/@node-red/editor-client/locales/pt-BR/editor.json +++ b/packages/node_modules/@node-red/editor-client/locales/pt-BR/editor.json @@ -109,7 +109,6 @@ "selectionToSubflow": "Seleção para subfluxo", "flows": "Fluxos", "add": "Adicionar", - "rename": "Renomear", "delete": "Apagar", "keyboardShortcuts": "Atalhos do teclado", "login": "Ingressar", @@ -1173,22 +1172,10 @@ "diagnostics": { "title": "informações do Sistema" }, - "languages": { - "de": "Alemão", - "en-US": "Inglês", - "ja": "Japonês", - "ko": "Coreano", - "pt-BR": "Português(Brasil)", - "ru": "Russo", - "zh-CN": "Chinês(Simplificado)", - "zh-TW": "Chinês(Tradicional)" - }, "validator": { "errors": { "invalid-json": "Dados JSON inválidos: __error__", - "invalid-json-prop": "__prop__: dados JSON inválidos: __error__", "invalid-prop": "Expressão de propriedade inválida", - "invalid-prop-prop": "__prop__: expressão de propriedade inválida", "invalid-num": "Número inválido", "invalid-num-prop": "__prop__: número inválido", "invalid-regexp": "Padrão de entrada inválido", diff --git a/packages/node_modules/@node-red/editor-client/locales/ru/editor.json b/packages/node_modules/@node-red/editor-client/locales/ru/editor.json index 8cfea1bde..326fbe55f 100644 --- a/packages/node_modules/@node-red/editor-client/locales/ru/editor.json +++ b/packages/node_modules/@node-red/editor-client/locales/ru/editor.json @@ -95,7 +95,6 @@ "selectionToSubflow": "Выделение в подпоток", "flows": "Потоки", "add": "Добавить", - "rename": "Переименовать", "delete": "Удалить", "keyboardShortcuts": "Сочетания клавиш", "login": "Войти", @@ -1129,16 +1128,5 @@ "appearance": "Внешний вид", "preview": "Предпросмотр редактора", "defaultValue": "Значение по умолчанию" - }, - "languages" : { - "de": "Немецкий", - "en-US": "Английский", - "fr": "Французский", - "ja": "Японский", - "ko": "Корейский", - "pt-BR":"португальский", - "ru": "Русский", - "zh-CN": "Китайский (упрощенный)", - "zh-TW": "Китайский (традиционный)" } } 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 e55240cc5..15d126e75 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 @@ -23,7 +23,11 @@ "position": "位置", "enable": "启用", "disable": "禁用", - "upload": "上传" + "upload": "上传", + "lock": "锁定", + "unlock": "解锁", + "locked": "锁定", + "unlocked": "解锁" }, "type": { "string": "字符串", @@ -68,7 +72,13 @@ "enabled": "有效", "disabled": "无效", "info": "详细描述", - "selectNodes": "点击节点来选择" + "selectNodes": "点击节点来选择", + "enableFlow": "启用流程", + "disableFlow": "禁用流程", + "lockFlow": "锁定流程", + "unlockFlow": "解除锁定", + "moveToStart": "移动到起始", + "moveToEnd": "移动到末尾" }, "menu": { "label": { @@ -101,6 +111,7 @@ "displayStatus": "显示节点状态", "displayConfig": "修改节点配置", "import": "导入", + "importExample": "导入示例流程", "export": "导出", "search": "查找流程", "searchInput": "查找流程", @@ -109,7 +120,6 @@ "selectionToSubflow": "将选择部分更改为子流程", "flows": "流程", "add": "增加", - "rename": "重命名", "delete": "删除", "keyboardShortcuts": "键盘快捷方式", "login": "登录", @@ -142,7 +152,12 @@ "moveToBack": "置于底层", "moveToFront": "置于顶层", "moveBackwards": "向后移动", - "moveForwards": "向前移动" + "moveForwards": "向前移动", + "showNodeHelp":"显示节点帮助", + "enableSelectedNodes":"启用当前选中节点", + "disableSelectedNodes":"禁用当前选中节点", + "showSelectedNodeLabels":"显示选中的节点标签", + "hideSelectedNodeLabels":"隐藏选中的节点标签" } }, "actions": { @@ -403,6 +418,7 @@ }, "errors": { "noNodesSelected": "无法创建子流程: 未选择节点", + "acrossMultipleGroups": "无法跨多个组创建子流", "multipleInputsToSelection": "无法创建子流程: 多个输入到了选择" } }, @@ -491,12 +507,14 @@ "unassigned": "未分配", "global": "全局", "workspace": "工作区", + "editor": "编辑对话框", "selectAll": "选择所有节点", "selectNone": "取消所有选择", "selectAllConnected": "选择所有连接的节点", "addRemoveNode": "从选择中添加/删除节点", "editSelected": "编辑选定节点", "deleteSelected": "删除选定节点或链接", + "deleteReconnect": "删除并重新连接", "importNode": "导入节点", "exportNode": "导出节点", "nudgeNode": "移动所选节点(1px)", @@ -571,6 +589,7 @@ "editor": { "title": "面板管理", "palette": "控制板", + "allCatalogs": "所有目录", "times": { "seconds": "秒前", "minutes": "分前", @@ -610,6 +629,7 @@ "tab-nodes": "节点", "tab-install": "安装", "sort": "排序:", + "sortRelevance": "关联", "sortAZ": "a-z顺序", "sortRecent": "日期顺序", "more": "增加 __count__ 个", @@ -683,7 +703,11 @@ "empty": "空的", "globalConfig": "全局配置节点", "triggerAction": "触发动作", - "find": "在工作区中查找" + "find": "在工作区中查找", + "copyItemUrl": "复制地址", + "copyURL2Clipboard": "复制地址到剪贴板", + "showFlow": "显示流程", + "hideFlow": "隐藏流程" }, "help": { "name": "帮助", @@ -984,7 +1008,10 @@ "quote": "引用", "link": "链接", "horizontal-rule": "水平线", - "toggle-preview": "切换预览" + "toggle-preview": "切换预览", + "mermaid": { + "summary": "美人鱼图" + } }, "bufferEditor": { "title": "Buffer 编辑器", @@ -1147,17 +1174,6 @@ "create": "创建分支", "current": "当前的" }, - "languages": { - "de": "德语", - "en-US": "英文", - "fr": "法语", - "ja": "日语", - "ko": "韩文", - "pt-BR":"葡萄牙语", - "ru":"俄語", - "zh-CN": "简体中文", - "zh-TW": "繁体中文" - }, "create-default-file-set": { "no-active": "没有活动项目就无法创建默认文件集", "no-empty": "无法在非空项目上创建默认文件集", @@ -1187,21 +1203,11 @@ "diagnostics": { "title": "系统信息" }, - "languages": { - "de": "德语-Deutsch", - "en-US": "英文-English", - "ja": "日语-日本", - "ko": "韩文-한국인", - "ru": "俄语-Русский", - "zh-CN": "简体中文", - "zh-TW": "繁體中文" - }, "validator": { "errors": { "invalid-json": "无效的 JSON 数据: __error__", - "invalid-json-prop": "__prop__: 无效的 JSON 数据: __error__", + "invalid-expr": "无效的 JSONata 表达式: __error__", "invalid-prop": "无效的属性表达式", - "invalid-prop-prop": "__prop__: 无效的属性表达式", "invalid-num": "无效的数字", "invalid-num-prop": "__prop__: 无效的数字", "invalid-regexp": "输入格式无效", @@ -1213,9 +1219,15 @@ } }, "contextMenu": { + "showActionList":"显示动作列表", "insert": "插入", "node": "节点", "junction": "连接点", "linkNodes": "链接节点" + }, + "env-var": { + "environment": "环境配置", + "header": "全局环境变量", + "revert": "重置" } } 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 db4be6d10..cf71ebc77 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 @@ -270,5 +270,9 @@ "$moment": { "args": "[str]", "desc": "使用Moment库获取日期对象。" + }, + "$clone": { + "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 index 3646f0c9e..808f83c19 100644 --- 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 @@ -23,7 +23,11 @@ "position": "位置", "enable": "啟用", "disable": "禁用", - "upload": "上傳" + "upload": "上傳", + "lock": "鎖定", + "unlock": "解鎖", + "locked": "鎖定", + "unlocked": "解鎖" }, "type": { "string": "字符串", @@ -38,11 +42,14 @@ } }, "event": { + "loadPlugins": "加載插件", "loadPalette": "加載控制板", "loadNodeCatalogs": "加載節點目錄", "loadNodes": "加載 __count__ 個節點", "loadFlows": "加載流程", - "importFlows": "往工作區中加載流程" + "importFlows": "往工作區中加載流程", + "importError": "

加載流程錯誤

__message__

", + "loadingProject": "加載項目" }, "workspace": { "defaultName": "流程__number__", @@ -51,18 +58,35 @@ "delete": "確定想要刪除 '__label__'?", "dropFlowHere": "把流程放到這裡", "addFlow": "新增流程", - "listFlows": "流程列表", + "addFlowToRight": "在右側新增流程", + "hideFlow": "隱藏流程", + "hideOtherFlows": "隱藏其它流程", + "showAllFlows": "顯示所有流程", + "hideAllFlows": "隱藏所有流程", + "hiddenFlows": "列出 __count__ 個隱藏流程", + "hiddenFlows_plural": "列出 __count__ 個隱藏流程", + "showLastHiddenFlow": "顯示最後一個隱藏流程", + " ": "流程列表", + "listSubflows": "列出子流程", "status": "狀態", "enabled": "有效", "disabled": "無效", "info": "詳細描述", - "selectNodes": "點擊節點用於選擇" + "selectNodes": "點擊節點用於選擇", + "enableFlow": "啟用流程", + "disableFlow": "禁用流程", + "lockFlow": "鎖定流程", + "unlockFlow": "解除鎖定", + "moveToStart": "移動到起始", + "moveToEnd": "移動到末尾" }, "menu": { "label": { "view": { "view": "顯示", "grid": "格線", + "storeZoom": "加載時還原縮放尺寸", + "storePosition": "加載時還原滾動位置", "showGrid": "顯示格線", "snapGrid": "對齊格線", "gridSize": "格線尺寸", @@ -80,12 +104,14 @@ "palette": { "show": "顯示控制板" }, + "edit": "編輯", "settings": "設置", "userSettings": "使用者設置", "nodes": "節點", "displayStatus": "顯示節點狀態", "displayConfig": "修改節點配置", "import": "匯入", + "importExample": "導入示例流程", "export": "匯出", "search": "搜尋流程", "searchInput": "搜尋流程", @@ -94,7 +120,6 @@ "selectionToSubflow": "將選擇部分更改為子流程", "flows": "流程", "add": "增加", - "rename": "重新命名", "delete": "刪除", "keyboardShortcuts": "鍵盤快速鍵", "login": "登入", @@ -102,24 +127,48 @@ "editPalette": "節點管理", "other": "其他", "showTips": "顯示小提示", - "help": "Node-RED website", + "showWelcomeTours": "顯示新版本向導", + "help": "Node-RED 文檔主頁", "projects": "專案", "projects-new": "新專案", "projects-open": "開啟專案", "projects-settings": "專案設定", "showNodeLabelDefault": "顯示新添加節點的標籤", + "codeEditor": "代碼編輯器", "groups": "組", "groupSelection": "選擇組", "ungroupSelection": "取消選擇組", "groupMergeSelection": "合并選擇", - "groupRemoveSelection": "從組中移除" + "groupRemoveSelection": "從組中移除", + "arrange": "布局", + "alignLeft": "左對齊", + "alignCenter": "居中對齊", + "alignRight": "右對齊", + "alignTop": "頂部對齊", + "alignMiddle": "垂直居中對齊", + "alignBottom": "底部對齊", + "distributeHorizontally": "横向分布", + "distributeVertically": "垂直分布", + "moveToBack": "置於底層", + "moveToFront": "置於頂層", + "moveBackwards": "向後移動", + "moveForwards": "向前移動", + "showNodeHelp":"顯示節點幫助", + "enableSelectedNodes":"啟用當前選中節點", + "disableSelectedNodes":"禁用當前選中節點", + "showSelectedNodeLabels":"顯示選中的節點標簽", + "hideSelectedNodeLabels":"隱藏選中的節點標簽" } }, "actions": { "toggle-navigator": "切換導航器", "zoom-out": "縮小", "zoom-reset": "重置縮放", - "zoom-in": "放大" + "zoom-in": "放大", + "search-flows": "搜索流程", + "search-prev": "上一個", + "search-next": "下一個", + "search-counter": "\"__term__\" __result__ of __count__" }, "user": { "loggedInAs": "作為 __name__ 登入", @@ -135,12 +184,17 @@ } }, "notification": { + "state": { + "flowsStopped": "流程已停止", + "flowsStarted": "流程已啟動" + }, "warning": "警告: __message__", "warnings": { "undeployedChanges": "節點中存在未部署的更改", "nodeActionDisabled": "節點動作在子流程中被禁用", "nodeActionDisabledSubflow": "子流程中禁用了節點操作", "missing-types": "流程由於缺少節點類型而停止。請檢查日誌的詳細資訊", + "missing-modules": "

流程因缺少模塊而停止。

", "safe-mode": "

流程在安全模式下停止。

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

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

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

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

", @@ -151,7 +205,7 @@ "project_not_found": "

找不到項目的'__project__'

", "git_merge_conflict": "

自動合併更改失敗。

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

" }, - "error": "Error: __message__", + "error": "錯誤: __message__", "errors": { "lostConnection": "丟失與伺服器的連接,重新連接...", "lostConnectionReconnect": "丟失與伺服器的連接,__time__ 秒後重新連接", @@ -208,6 +262,8 @@ "download": "下載", "importUnrecognised": "匯入了無法識別的類型:", "importUnrecognised_plural": "匯入了無法識別的類型:", + "importDuplicate": "導入了重復節點:", + "importDuplicate_plural": "導入了重復節點:", "nodesExported": "節點匯出到了剪貼簿", "nodesImported": "已匯入:", "nodeCopied": "已複製 __count__ 個節點", @@ -259,6 +315,10 @@ "modifiedFlowsDesc": "只部署包含已更改節點的流程", "modifiedNodes": "已更改的節點", "modifiedNodesDesc": "只部署已經更改的節點", + "startFlows": "啟動", + "startFlowsDesc": "啟動流程", + "stopFlows": "停止", + "stopFlowsDesc": "停止流程", "restartFlows": "重新啟動流程", "restartFlowsDesc": "重新啟動當前部署的流程", "successfulDeploy": "部署成功", @@ -337,14 +397,28 @@ "output": "輸出:", "status": "狀態節點", "deleteSubflow": "刪除子流程", + "confirmDelete": "您確定要刪除此子流程?", "info": "詳細描述", "category": "類別", + "module": "模塊", + "license": "許可", + "licenseNone": "無", + "licenseOther": "其它", + "type": "節點類型", + "version": "版本", + "versionPlaceholder": "x.y.z", + "keys": "關鍵字", + "keysPlaceholder": "使用英文逗號分隔關鍵字", + "author": "作者", + "authorPlaceholder": "名字 ", + "desc": "描述", "env": { "restore": "恢復為默認子流程", "remove": "類別刪除環境變量" }, "errors": { "noNodesSelected": "無法創建子流程: 未選擇節點", + "acrossMultipleGroups": "無法跨多個組創建子流", "multipleInputsToSelection": "無法創建子流程: 多個輸入到了選擇" } }, @@ -367,12 +441,12 @@ "editConfig": "編輯 __type__ 配置", "addNewType": "添加新的 __type__ 節點", "nodeProperties": "節點屬性", - "label": "Label", + "label": "標簽", "color": "顏色", "portLabels": "埠標籤", "labelInputs": "輸入", "labelOutputs": "輸出", - "settingIcon": "Icon", + "settingIcon": "圖標", "default": "默認", "noDefaultLabel": "無", "defaultLabel": "使用默認標籤", @@ -385,6 +459,7 @@ "icon": "圖標", "inputType": "輸入類型", "selectType": "選擇類型...", + "loadCredentials": "加載節點憑證", "inputs": { "input": "輸入", "select": "選擇", @@ -419,7 +494,8 @@ }, "errors": { "scopeChange": "更改範圍將使其他流程中的節點無法使用", - "invalidProperties": "無效的屬性:" + "invalidProperties": "無效的屬性:", + "credentialLoadFailed": "無法加載節點憑據" } }, "keyboard": { @@ -431,11 +507,14 @@ "unassigned": "未分配", "global": "全局", "workspace": "工作區", + "editor": "編輯對話框", "selectAll": "選擇所有節點", + "selectNone": "取消所有選擇", "selectAllConnected": "選擇所有連接的節點", "addRemoveNode": "從選擇中添加/刪除節點", "editSelected": "編輯選定節點", "deleteSelected": "刪除選定節點或連結", + "deleteReconnect": "刪除並重新連接", "importNode": "匯入節點", "exportNode": "匯出節點", "nudgeNode": "移動所選節點(1px)", @@ -445,10 +524,14 @@ "copyNode": "複製所選節點", "cutNode": "剪切所選節點", "pasteNode": "粘貼節點", + "copyGroupStyle": "復製組樣式", + "pasteGroupStyle": "粘貼組樣式", "undoChange": "撤銷上次執行的更改", + "redoChange": "重做", "searchBox": "打開搜尋框", "managePalette": "管理面板", - "actionList": "動作列表" + "actionList": "動作列表", + "splitWireWithLinks": "使用Link節點拆分已選項" }, "library": { "library": "庫", @@ -466,12 +549,11 @@ "types": { "local": "本地", "examples": "例子" - }, - "exportToLibrary": "將節點匯出到庫" + } }, "palette": { "noInfo": "無可用資訊", - "filter": "過濾節點", + "filter": "過濾已安裝模組", "search": "搜尋模組", "addCategory": "添加新的...", "label": { @@ -501,11 +583,13 @@ "nodeEnabled_plural": "啟用多個節點:", "nodeDisabled": "禁用節點:", "nodeDisabled_plural": "禁用多個節點:", - "nodeUpgraded": "節點模組__module__升級到__version__版本" + "nodeUpgraded": "節點模組__module__升級到__version__版本", + "unknownNodeRegistered": "加載節點錯誤:
  • __type__
    __error__
" }, "editor": { "title": "面板管理", - "palette": "Palette", + "palette": "控製板", + "allCatalogs": "所有目錄", "times": { "seconds": "秒前", "minutes": "分前", @@ -545,10 +629,12 @@ "tab-nodes": "節點", "tab-install": "安裝", "sort": "排序:", + "sortRelevance": "關聯", "sortAZ": "a-z順序", "sortRecent": "日期順序", "more": "增加 __count__ 個", "upload": "上傳模塊tgz文件", + "refresh": "更新模塊列表", "errors": { "catalogLoadFailed": "無法載入節點目錄。
查看瀏覽器控制臺瞭解更多資訊", "installFailed": "無法安裝: __module__
__message__
查看日誌瞭解更多資訊", @@ -617,7 +703,11 @@ "empty": "空的", "globalConfig": "全局配置節點", "triggerAction": "觸發動作", - "find": "在工作區中查找" + "find": "在工作區中查找", + "copyItemUrl": "復製地址", + "copyURL2Clipboard": "復製地址到剪貼板", + "showFlow": "顯示流程", + "hideFlow": "隱藏流程" }, "help": { "name": "幫助", @@ -627,7 +717,8 @@ "showHelp": "顯示幫助", "showInOutline": "在大綱中顯示", "showTopics": "顯示主題", - "noHelp": "未選擇幫助主題" + "noHelp": "未選擇幫助主題", + "changeLog": "更新日誌" }, "config": { "name": "配置節點", @@ -828,31 +919,37 @@ "json": "JSON", "bin": "二進位流", "date": "時間戳記", - "jsonata": "expression", - "env": "env variable", + "jsonata": "表達式", + "env": "環境變量", "cred": "證書" } }, "editableList": { - "add": "添加" + "add": "添加", + "addTitle": "添加項" }, "search": { - "empty": "找不到匹配", + "history": "搜索歷史", + "clear": "清除所有", + "empty": "找不到匹配項", "addNode": "添加一個節點...", "options": { "configNodes": "配置節點", "unusedConfigNodes": "未使用的配置節點", "invalidNodes": "無效的節點", "uknownNodes": "未知的節點", - "unusedSubflows": "未使用的子流程" + "unusedSubflows": "未使用的子流程", + "hiddenFlows": "隱藏的流程", + "modifiedNodes": "已修改的節點或流程", + "thisFlow": "當前流程" } }, "expressionEditor": { "functions": "功能", - "functionReference": "Function reference", + "functionReference": "功能參考", "insert": "插入", "title": "JSONata運算式編輯器", - "test": "Test", + "test": "測試", "data": "示例消息", "result": "結果", "format": "格式表達方法", @@ -863,20 +960,28 @@ "invalid-expr": "無效的JSONata運算式:\n __message__", "invalid-msg": "無效的示例JSON消息:\n __message__", "context-unsupported": "無法測試上下文函數\n $flowContext 或 $globalContext", + "env-unsupported": "無法測試 $env 函數", + "moment-unsupported": "無法測試 $moment 函數", + "clone-unsupported": "無法測試 $clone 函數", "eval": "評估運算式錯誤:\n __message__" } }, + "monaco": { + "setTheme": "設置主題" + }, "jsEditor": { "title": "JavaScript 編輯器" }, "textEditor": { - "title": "Text 編輯器" + "title": "文本編輯器" }, "jsonEditor": { "title": "JSON編輯器", "format": "格式化JSON", "rawMode": "編輯 JSON", - "uiMode": "Visual編輯器", + "uiMode": "可視化編輯器", + "rawMode-readonly": "原始JSON", + "uiMode-readonly": "可視化", "insertAbove": "在上方插入", "insertBelow": "在下方插入", "addItem": "添加項目", @@ -892,9 +997,9 @@ "title": "Markdown 編輯器", "expand": "展開", "format": "F使用markdown格式化", - "heading1": "Heading 1", - "heading2": "Heading 2", - "heading3": "Heading 3", + "heading1": "標題 1", + "heading2": "標題 2", + "heading3": "標題 3", "bold": "粗體", "italic": "斜體", "code": "程式碼", @@ -903,7 +1008,10 @@ "quote": "引用", "link": "連結", "horizontal-rule": "分隔線", - "toggle-preview": "預覽" + "toggle-preview": "切換預覽", + "mermaid": { + "summary": "美人魚圖" + } }, "bufferEditor": { "title": "緩衝區編輯器", @@ -1038,7 +1146,8 @@ "not-git": "不是git倉庫", "no-resource": "找不到存儲庫", "cant-get-ssh-key-path": "錯誤! 無法獲取所選的SSH密鑰路徑。", - "unexpected_error": "意外的錯誤" + "unexpected_error": "意外的錯誤", + "clearContext": "更改項目時清除上下文" }, "delete": { "confirm": "您確定要刪除此項目嗎?" @@ -1068,7 +1177,7 @@ "create-default-file-set": { "no-active": "沒有活動項目就無法創建默認文件集", "no-empty": "無法在非空項目上創建默認文件集", - "git-error": "git error" + "git-error": "git錯誤" }, "errors": { "no-username-email": "您的Git客戶端未配置用戶名/電子郵件。", @@ -1079,21 +1188,45 @@ "editor-tab": { "properties": "屬性", "envProperties": "環境變量", + "module": "模塊屬性", "description": "描述", "appearance": "外觀", "preview": "UI預覽", - "defaultValue": "默認值", - "env": "環境變量" + "defaultValue": "默認值" }, - "languages": { - "de": "德語", - "en-US": "英語", - "fr": "法語", - "ja": "日語", - "ko": "韓語", - "pt-BR":"葡萄牙语", - "ru":"俄語", - "zh-CN": "簡體中文", - "zh-TW": "繁體中文" + "tourGuide": { + "takeATour": "查看更新內容", + "start": "開始", + "next": "下一個", + "welcomeTours": "歡迎使用 Node-RED" + }, + "diagnostics": { + "title": "系统信息" + }, + "validator": { + "errors": { + "invalid-json": "無效的 JSON 數據: __error__", + "invalid-expr": "無效的 JSONata 表達式: __error__", + "invalid-prop": "無效的屬性表達式", + "invalid-num": "無效的數字", + "invalid-regexp": "輸入格式無效", + "invalid-regex-prop": "__prop__: 輸入格式無效", + "missing-required-prop": "__prop__: 缺少屬性值", + "invalid-config": "__prop__: 無效的配置節點", + "missing-config": "__prop__: 缺少配置節點", + "validation-error": "__prop__: 驗證錯誤: __node__, __id__: __error__" + } + }, + "contextMenu": { + "showActionList":"顯示動作列表", + "insert": "插入", + "node": "節點", + "junction": "連接點", + "linkNodes": "鏈接節點" + }, + "env-var": { + "environment": "環境配置", + "header": "全局環境變量", + "revert": "重置" } } 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 index 29d3b7ed1..2fc36bd27 100644 --- 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 @@ -270,5 +270,9 @@ "$moment": { "args": "[str]", "desc": "使用Moment庫獲取日期對象。" + }, + "$clone": { + "args": "value", + "desc": "安全克隆對象." } } diff --git a/packages/node_modules/@node-red/editor-client/src/js/events.js b/packages/node_modules/@node-red/editor-client/src/js/events.js index bd2abd8d0..943854393 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/events.js +++ b/packages/node_modules/@node-red/editor-client/src/js/events.js @@ -39,15 +39,16 @@ console.warn(evt,args); } if (handlers[evt]) { - for (var i=0;i
  • ")+"
  • "; - RED.notify(RED._("palette.event.nodeRemoved", {count:m.types.length})+typeList,"success"); + pendingNodeRemovedNotifications = pendingNodeRemovedNotifications.concat(m.types.map(RED.utils.sanitize)) + if (pendingNodeRemovedTimeout) { + clearTimeout(pendingNodeRemovedTimeout) + } + pendingNodeRemovedTimeout = setTimeout(function () { + typeList = "
    • "+pendingNodeRemovedNotifications.join("
    • ")+"
    "; + RED.notify(RED._("palette.event.nodeRemoved", {count:pendingNodeRemovedNotifications.length})+typeList,"success"); + pendingNodeRemovedNotifications = [] + }, 200) } } loadIconList(); @@ -702,7 +722,7 @@ var RED = (function() { menuOptions.push({id:"menu-item-config-nodes",label:RED._("menu.label.displayConfig"),onselect:"core:show-config-tab"}); menuOptions.push({id:"menu-item-workspace",label:RED._("menu.label.flows"),options:[ {id:"menu-item-workspace-add",label:RED._("menu.label.add"),onselect:"core:add-flow"}, - {id:"menu-item-workspace-edit",label:RED._("menu.label.rename"),onselect:"core:edit-flow"}, + {id:"menu-item-workspace-edit",label:RED._("menu.label.edit"),onselect:"core:edit-flow"}, {id:"menu-item-workspace-delete",label:RED._("menu.label.delete"),onselect:"core:remove-flow"} ]}); menuOptions.push({id:"menu-item-subflow",label:RED._("menu.label.subflows"), options: [ diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/clipboard.js b/packages/node_modules/@node-red/editor-client/src/js/ui/clipboard.js index 01a993a75..690968338 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/clipboard.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/clipboard.js @@ -819,7 +819,7 @@ RED.clipboard = (function() { flow.forEach(function(node) { if (node.type === "tab") { flows[node.id] = { - element: getFlowLabel(node,false), + element: getFlowLabel(node), deferBuild: type !== "flow", expanded: type === "flow", children: [] @@ -1000,7 +1000,6 @@ RED.clipboard = (function() { try { RED.view.importNodes(newNodes, importOptions); } catch(error) { - console.log(error.importConfig) // Thrown for import_conflict confirmImport(error.importConfig, newNodes, importOptions); } @@ -1170,9 +1169,9 @@ RED.clipboard = (function() { function getNodeElement(n, isConflicted, isSelected, parent) { var element; if (n.type === "tab") { - element = getFlowLabel(n, isSelected); + element = getFlowLabel(n, isConflicted); } else { - element = getNodeLabel(n, isConflicted, isSelected); + element = getNodeLabel(n, isConflicted, isSelected, parent); } var controls = $('
    ',{class:"red-ui-clipboard-dialog-import-conflicts-controls"}).appendTo(element); controls.on("click", function(evt) { evt.stopPropagation(); }); @@ -1222,14 +1221,14 @@ RED.clipboard = (function() { } } - function getFlowLabel(n) { + function getFlowLabel(n, isConflicted) { n = JSON.parse(JSON.stringify(n)); n._def = RED.nodes.getType(n.type) || {}; if (n._def) { n._ = n._def._; } - var div = $('
    ',{class:"red-ui-info-outline-item red-ui-info-outline-item-flow"}); + var div = $('
    ',{class:"red-ui-info-outline-item red-ui-info-outline-item-flow red-ui-node-list-item"}); var contentDiv = $('
    ',{class:"red-ui-search-result-description red-ui-info-outline-item-label"}).appendTo(div); var label = (typeof n === "string")? n : n.label; var newlineIndex = label.indexOf("\\n"); @@ -1237,11 +1236,17 @@ RED.clipboard = (function() { label = label.substring(0,newlineIndex)+"..."; } contentDiv.text(label); + + if (!!isConflicted) { + const conflictIcon = $('').appendTo(div) + RED.popover.tooltip(conflictIcon, RED._('clipboard.import.alreadyExists')) + } + // A conflicted flow should not be imported by default. return div; } - function getNodeLabel(n, isConflicted) { + function getNodeLabel(n, isConflicted, isSelected, parent) { n = JSON.parse(JSON.stringify(n)); n._def = RED.nodes.getType(n.type) || {}; if (n._def) { @@ -1249,6 +1254,11 @@ RED.clipboard = (function() { } var div = $('
    ',{class:"red-ui-node-list-item"}); RED.utils.createNodeIcon(n,true).appendTo(div); + + if (!parent && !!isConflicted) { + const conflictIcon = $('').appendTo(div) + RED.popover.tooltip(conflictIcon, RED._('clipboard.import.alreadyExists')) + } return div; } diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js b/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js index 7440b464e..f301d0768 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js @@ -54,25 +54,26 @@ return icon; } - var autoComplete = function(options) { - function getMatch(value, searchValue) { - const idx = value.toLowerCase().indexOf(searchValue.toLowerCase()); - const len = idx > -1 ? searchValue.length : 0; - return { - index: idx, - found: idx > -1, - pre: value.substring(0,idx), - match: value.substring(idx,idx+len), - post: value.substring(idx+len), - } - } - function generateSpans(match) { - const els = []; - if(match.pre) { els.push($('').text(match.pre)); } - if(match.match) { els.push($('',{style:"font-weight: bold; color: var(--red-ui-text-color-link);"}).text(match.match)); } - if(match.post) { els.push($('').text(match.post)); } - return els; + function getMatch(value, searchValue) { + const idx = value.toLowerCase().indexOf(searchValue.toLowerCase()); + const len = idx > -1 ? searchValue.length : 0; + return { + index: idx, + found: idx > -1, + pre: value.substring(0,idx), + match: value.substring(idx,idx+len), + post: value.substring(idx+len), } + } + function generateSpans(match) { + const els = []; + if(match.pre) { els.push($('').text(match.pre)); } + if(match.match) { els.push($('',{style:"font-weight: bold; color: var(--red-ui-text-color-link);"}).text(match.match)); } + if(match.post) { els.push($('').text(match.post)); } + return els; + } + + const msgAutoComplete = function(options) { return function(val) { var matches = []; options.forEach(opt => { @@ -102,6 +103,197 @@ } } + function getEnvVars (obj, envVars = {}) { + contextKnownKeys.env = contextKnownKeys.env || {} + if (contextKnownKeys.env[obj.id]) { + return contextKnownKeys.env[obj.id] + } + let parent + if (obj.type === 'tab' || obj.type === 'subflow') { + RED.nodes.eachConfig(function (conf) { + if (conf.type === "global-config") { + parent = conf; + } + }) + } else if (obj.g) { + parent = RED.nodes.group(obj.g) + } else if (obj.z) { + parent = RED.nodes.workspace(obj.z) || RED.nodes.subflow(obj.z) + } + if (parent) { + getEnvVars(parent, envVars) + } + if (obj.env) { + obj.env.forEach(env => { + envVars[env.name] = obj + }) + } + contextKnownKeys.env[obj.id] = envVars + return envVars + } + + const envAutoComplete = function (val) { + const editStack = RED.editor.getEditStack() + if (editStack.length === 0) { + done([]) + return + } + const editingNode = editStack.pop() + if (!editingNode) { + return [] + } + const envVarsMap = getEnvVars(editingNode) + const envVars = Object.keys(envVarsMap) + const matches = [] + const i = val.lastIndexOf('${') + let searchKey = val + let isSubkey = false + if (i > -1) { + if (val.lastIndexOf('}') < i) { + searchKey = val.substring(i+2) + isSubkey = true + } + } + envVars.forEach(v => { + let valMatch = getMatch(v, searchKey); + if (valMatch.found) { + const optSrc = envVarsMap[v] + const element = $('
    ',{style: "display: flex"}); + const valEl = $('
    ',{style:"font-family: var(--red-ui-monospace-font); white-space:nowrap; overflow: hidden; flex-grow:1"}); + valEl.append(generateSpans(valMatch)) + valEl.appendTo(element) + + if (optSrc) { + const optEl = $('
    ').css({ "font-size": "0.8em" }); + let label + if (optSrc.type === 'global-config') { + label = RED._('sidebar.context.global') + } else if (optSrc.type === 'group') { + label = RED.utils.getNodeLabel(optSrc) || (RED._('sidebar.info.group') + ': '+optSrc.id) + } else { + label = RED.utils.getNodeLabel(optSrc) || optSrc.id + } + + optEl.append(generateSpans({ match: label })); + optEl.appendTo(element); + } + matches.push({ + value: isSubkey ? val + v + '}' : v, + label: element, + i: valMatch.index + }); + } + }) + matches.sort(function(A,B){return A.i-B.i}) + return matches + } + + let contextKnownKeys = {} + let contextCache = {} + if (RED.events) { + RED.events.on("editor:close", function () { + contextCache = {} + contextKnownKeys = {} + }); + } + + const contextAutoComplete = function() { + const that = this + const getContextKeysFromRuntime = function(scope, store, searchKey, done) { + contextKnownKeys[scope] = contextKnownKeys[scope] || {} + contextKnownKeys[scope][store] = contextKnownKeys[scope][store] || new Set() + if (searchKey.length > 0) { + try { + RED.utils.normalisePropertyExpression(searchKey) + } catch (err) { + // Not a valid context key, so don't try looking up + done() + return + } + } + const url = `context/${scope}/${encodeURIComponent(searchKey)}?store=${store}&keysOnly` + if (contextCache[url]) { + // console.log('CACHED', url) + done() + } else { + // console.log('GET', url) + $.getJSON(url, function(data) { + // console.log(data) + contextCache[url] = true + const result = data[store] || {} + const keys = result.keys || [] + const keyPrefix = searchKey + (searchKey.length > 0 ? '.' : '') + keys.forEach(key => { + if (/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(key)) { + contextKnownKeys[scope][store].add(keyPrefix + key) + } else { + contextKnownKeys[scope][store].add(searchKey + "[\""+key.replace(/"/,"\\\"")+"\"]") + } + }) + done() + }) + } + } + const getContextKeys = function(key, done) { + const keyParts = key.split('.') + const partialKey = keyParts.pop() + let scope = that.propertyType + if (scope === 'flow') { + // Get the flow id of the node we're editing + const editStack = RED.editor.getEditStack() + if (editStack.length === 0) { + done([]) + return + } + const editingNode = editStack.pop() + if (editingNode.z) { + scope = `${scope}/${editingNode.z}` + } else { + done([]) + return + } + } + const store = (contextStoreOptions.length === 1) ? contextStoreOptions[0].value : that.optionValue + const searchKey = keyParts.join('.') + + getContextKeysFromRuntime(scope, store, searchKey, function() { + if (contextKnownKeys[scope][store].has(key) || key.endsWith(']')) { + getContextKeysFromRuntime(scope, store, key, function() { + done(contextKnownKeys[scope][store]) + }) + } + done(contextKnownKeys[scope][store]) + }) + } + + return function(val, done) { + getContextKeys(val, function (keys) { + const matches = [] + keys.forEach(v => { + let optVal = v + let valMatch = getMatch(optVal, val); + if (!valMatch.found && val.length > 0 && val.endsWith('.')) { + // Search key ends in '.' - but doesn't match. Check again + // with [" at the end instead so we match bracket notation + valMatch = getMatch(optVal, val.substring(0, val.length - 1) + '["') + } + if (valMatch.found) { + const element = $('
    ',{style: "display: flex"}); + const valEl = $('
    ',{style:"font-family: var(--red-ui-monospace-font); white-space:nowrap; overflow: hidden; flex-grow:1"}); + valEl.append(generateSpans(valMatch)) + valEl.appendTo(element) + matches.push({ + value: optVal, + label: element, + }); + } + }) + matches.sort(function(a, b) { return a.value.localeCompare(b.value) }); + done(matches); + }) + } + } + // This is a hand-generated list of completions for the core nodes (based on the node help html). var msgCompletions = [ { value: "payload" }, @@ -166,23 +358,27 @@ { value: "_session", source: ["websocket out","tcp out"] }, ] var allOptions = { - msg: {value:"msg",label:"msg.",validate:RED.utils.validatePropertyExpression, autoComplete: autoComplete(msgCompletions)}, + msg: {value:"msg",label:"msg.",validate:RED.utils.validatePropertyExpression, autoComplete: msgAutoComplete(msgCompletions)}, flow: {value:"flow",label:"flow.",hasValue:true, options:[], validate:RED.utils.validatePropertyExpression, parse: contextParse, export: contextExport, - valueLabel: contextLabel + valueLabel: contextLabel, + autoComplete: contextAutoComplete }, global: {value:"global",label:"global.",hasValue:true, options:[], validate:RED.utils.validatePropertyExpression, parse: contextParse, export: contextExport, - valueLabel: contextLabel + valueLabel: contextLabel, + autoComplete: contextAutoComplete }, str: {value:"str",label:"string",icon:"red/images/typedInput/az.svg"}, - num: {value:"num",label:"number",icon:"red/images/typedInput/09.svg",validate:/^[+-]?[0-9]*\.?[0-9]*([eE][-+]?[0-9]+)?$/}, + num: {value:"num",label:"number",icon:"red/images/typedInput/09.svg",validate: function(v) { + return (true === RED.utils.validateTypedProperty(v, "num")); + } }, bool: {value:"bool",label:"boolean",icon:"red/images/typedInput/bool.svg",options:["true","false"]}, json: { value:"json", @@ -212,7 +408,25 @@ } }, re: {value:"re",label:"regular expression",icon:"red/images/typedInput/re.svg"}, - date: {value:"date",label:"timestamp",icon:"fa fa-clock-o",hasValue:false}, + date: { + value:"date", + label:"timestamp", + icon:"fa fa-clock-o", + options:[ + { + label: 'milliseconds since epoch', + value: '' + }, + { + label: 'YYYY-MM-DDTHH:mm:ss.sssZ', + value: 'iso' + }, + { + label: 'JavaScript Date Object', + value: 'object' + } + ] + }, jsonata: { value: "jsonata", label: "expression", @@ -249,7 +463,8 @@ env: { value: "env", label: "env variable", - icon: "red/images/typedInput/env.svg" + icon: "red/images/typedInput/env.svg", + autoComplete: envAutoComplete }, node: { value: "node", @@ -425,6 +640,7 @@ } var nlsd = false; + let contextStoreOptions; $.widget( "nodered.typedInput", { _create: function() { @@ -436,7 +652,7 @@ } } var contextStores = RED.settings.context.stores; - var contextOptions = contextStores.map(function(store) { + contextStoreOptions = contextStores.map(function(store) { return {value:store,label: store, icon:''} }).sort(function(A,B) { if (A.value === RED.settings.context.default) { @@ -447,13 +663,17 @@ return A.value.localeCompare(B.value); } }) - if (contextOptions.length < 2) { + if (contextStoreOptions.length < 2) { allOptions.flow.options = []; allOptions.global.options = []; } else { - allOptions.flow.options = contextOptions; - allOptions.global.options = contextOptions; + allOptions.flow.options = contextStoreOptions; + allOptions.global.options = contextStoreOptions; } + // Translate timestamp options + allOptions.date.options.forEach(opt => { + opt.label = RED._("typedInput.date.format." + (opt.value || 'timestamp'), {defaultValue: opt.label}) + }) } nlsd = true; var that = this; @@ -542,7 +762,7 @@ that.element.trigger('paste',evt); }); this.input.on('keydown', function(evt) { - if (that.typeMap[that.propertyType].autoComplete) { + if (that.typeMap[that.propertyType].autoComplete || that.input.hasClass('red-ui-autoComplete')) { return } if (evt.keyCode >= 37 && evt.keyCode <= 40) { @@ -965,6 +1185,9 @@ // If previousType is !null, then this is a change of the type, rather than the initialisation var previousType = this.typeMap[this.propertyType]; previousValue = this.input.val(); + if (this.input.hasClass('red-ui-autoComplete')) { + this.input.autoComplete("destroy"); + } if (previousType && this.typeChanged) { if (this.options.debug) { console.log(this.identifier,"typeChanged",{previousType,previousValue}) } @@ -1011,7 +1234,9 @@ this.input.val(this.oldValues.hasOwnProperty("_")?this.oldValues["_"]:(opt.default||"")) } if (previousType.autoComplete) { - this.input.autoComplete("destroy"); + if (this.input.hasClass('red-ui-autoComplete')) { + this.input.autoComplete("destroy"); + } } } this.propertyType = type; @@ -1139,6 +1364,16 @@ } else { this.optionSelectTrigger.hide(); } + if (opt.autoComplete) { + let searchFunction = opt.autoComplete + if (searchFunction.length === 0) { + searchFunction = opt.autoComplete.call(this) + } + this.input.autoComplete({ + search: searchFunction, + minLength: 0 + }) + } } this.optionMenu = this._createMenu(opt.options,opt,function(v){ if (!opt.multiple) { @@ -1181,8 +1416,12 @@ this.valueLabelContainer.hide(); this.elementDiv.show(); if (opt.autoComplete) { + let searchFunction = opt.autoComplete + if (searchFunction.length === 0) { + searchFunction = opt.autoComplete.call(this) + } this.input.autoComplete({ - search: opt.autoComplete, + search: searchFunction, minLength: 0 }) } diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/contextMenu.js b/packages/node_modules/@node-red/editor-client/src/js/ui/contextMenu.js index b63cdc1a2..093e7995f 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/contextMenu.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/contextMenu.js @@ -30,8 +30,26 @@ RED.contextMenu = (function () { const isGroup = hasSelection && selection.nodes.length === 1 && selection.nodes[0].type === 'group' const canEdit = !RED.workspaces.isLocked() const canRemoveFromGroup = hasSelection && !!selection.nodes[0].g - const isAllGroups = hasSelection && selection.nodes.filter(n => n.type !== 'group').length === 0 - const hasGroup = hasSelection && selection.nodes.filter(n => n.type === 'group' ).length > 0 + let hasGroup, isAllGroups = true, hasDisabledNode, hasEnabledNode, hasLabeledNode, hasUnlabeledNode; + if (hasSelection) { + selection.nodes.forEach(n => { + if (n.type === 'group') { + hasGroup = true; + } else { + isAllGroups = false; + } + if (n.d) { + hasDisabledNode = true; + } else { + hasEnabledNode = true; + } + if (n.l === undefined || n.l) { + hasLabeledNode = true; + } else { + hasUnlabeledNode = true; + } + }); + } const offset = $("#red-ui-workspace-chart").offset() let addX = options.x - offset.left + $("#red-ui-workspace-chart").scrollLeft() @@ -44,7 +62,7 @@ RED.contextMenu = (function () { } menuItems.push( - { onselect: 'core:show-action-list', onpostselect: function () { } } + { onselect: 'core:show-action-list', label: RED._("contextMenu.showActionList"), onpostselect: function () { } } ) const insertOptions = [] @@ -55,7 +73,7 @@ RED.contextMenu = (function () { onselect: function () { RED.view.showQuickAddDialog({ position: [addX, addY], - touchTrigger: true, + touchTrigger: 'ontouchstart' in window, splice: isSingleLink ? selection.links[0] : undefined, // spliceMultiple: isMultipleLinks }) @@ -108,16 +126,16 @@ RED.contextMenu = (function () { const nodeOptions = [] if (!hasMultipleSelection && !isGroup) { nodeOptions.push( - { onselect: 'core:show-node-help' }, + { onselect: 'core:show-node-help', label: RED._('menu.label.showNodeHelp') }, null ) } nodeOptions.push( - { onselect: 'core:enable-selected-nodes' }, - { onselect: 'core:disable-selected-nodes' }, + { onselect: 'core:enable-selected-nodes', label: RED._('menu.label.enableSelectedNodes'), disabled: !hasDisabledNode }, + { onselect: 'core:disable-selected-nodes', label: RED._('menu.label.disableSelectedNodes'), disabled: !hasEnabledNode }, null, - { onselect: 'core:show-selected-node-labels' }, - { onselect: 'core:hide-selected-node-labels' } + { onselect: 'core:show-selected-node-labels', label: RED._('menu.label.showSelectedNodeLabels'), disabled: !hasUnlabeledNode }, + { onselect: 'core:hide-selected-node-labels', label: RED._('menu.label.hideSelectedNodeLabels'), disabled: !hasLabeledNode } ) menuItems.push({ label: RED._('sidebar.info.node'), @@ -126,8 +144,8 @@ RED.contextMenu = (function () { menuItems.push({ label: RED._('sidebar.info.group'), options: [ - { onselect: 'core:group-selection' }, - { onselect: 'core:ungroup-selection', disabled: !hasGroup }, + { onselect: 'core:group-selection', label: RED._("menu.label.groupSelection") }, + { onselect: 'core:ungroup-selection', label: RED._("menu.label.ungroupSelection"), disabled: !hasGroup }, ] }) if (hasGroup) { @@ -143,8 +161,8 @@ RED.contextMenu = (function () { } menuItems[menuItems.length - 1].options.push( null, - { onselect: 'core:copy-group-style', disabled: !hasGroup }, - { onselect: 'core:paste-group-style', disabled: !hasGroup} + { onselect: 'core:copy-group-style', label: RED._("keyboard.copyGroupStyle"), disabled: !hasGroup }, + { onselect: 'core:paste-group-style', label: RED._("keyboard.pasteGroupStyle"), disabled: !hasGroup} ) } if (canEdit && hasMultipleSelection) { @@ -168,16 +186,16 @@ RED.contextMenu = (function () { menuItems.push( null, - { onselect: 'core:undo', disabled: RED.history.list().length === 0 }, - { onselect: 'core:redo', disabled: RED.history.listRedo().length === 0 }, + { onselect: 'core:undo', label: RED._("keyboard.undoChange"), disabled: RED.history.list().length === 0 }, + { onselect: 'core:redo', label: RED._("keyboard.redoChange"), disabled: RED.history.listRedo().length === 0 }, null, { onselect: 'core:cut-selection-to-internal-clipboard', label: RED._("keyboard.cutNode"), disabled: !canEdit || !hasSelection }, { onselect: 'core:copy-selection-to-internal-clipboard', label: RED._("keyboard.copyNode"), disabled: !hasSelection }, { onselect: 'core:paste-from-internal-clipboard', label: RED._("keyboard.pasteNode"), disabled: !canEdit || !RED.view.clipboard() }, - { onselect: 'core:delete-selection', disabled: !canEdit || !canDelete }, + { onselect: 'core:delete-selection', label: RED._('keyboard.deleteSelected'), disabled: !canEdit || !canDelete }, { onselect: 'core:delete-selection-and-reconnect', label: RED._('keyboard.deleteReconnect'), disabled: !canEdit || !canDelete }, { onselect: 'core:show-export-dialog', label: RED._("menu.label.export") }, - { onselect: 'core:select-all-nodes' }, + { onselect: 'core:select-all-nodes', label: RED._("keyboard.selectAll") }, ) } 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 b6a069ab5..3f73e29aa 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 @@ -989,9 +989,10 @@ RED.diff = (function() { } if (localNode && remoteNode && typeof localNode[d] === "string") { if (/\n/.test(localNode[d]) || /\n/.test(remoteNode[d])) { - $('').on("click", function() { + var textDiff = $('').on("click", function() { showTextDiff(localNode[d],remoteNode[d]); }).appendTo(propertyNameCell); + RED.popover.tooltip(textDiff, RED._("diff.compareChanges")); } } diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/editor.js b/packages/node_modules/@node-red/editor-client/src/js/ui/editor.js index 0ef3892e7..50b2b7b12 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/editor.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/editor.js @@ -115,8 +115,9 @@ RED.editor = (function() { var valid = validateNodeProperty(node, definition, prop, properties[prop]); if ((typeof valid) === "string") { result.push(valid); - } - else if(!valid) { + } else if (Array.isArray(valid)) { + result = result.concat(valid) + } else if(!valid) { result.push(prop); } } @@ -165,7 +166,7 @@ RED.editor = (function() { // If the validator takes two arguments, it is a 3.x validator that // can return a String to mean 'invalid' and provide a reason if ((definition[property].validate.length === 2) && - ((typeof valid) === "string")) { + ((typeof valid) === "string") || Array.isArray(valid)) { return valid; } else { // Otherwise, a 2.x returns a truth-like/false-like value that @@ -181,6 +182,17 @@ RED.editor = (function() { error: err.message }); } + } else if (valid) { + // If the validator is not provided in node property => Check if the input has a validator + if ("category" in node._def) { + const isConfig = node._def.category === "config"; + const prefix = isConfig ? "node-config-input" : "node-input"; + const input = $("#"+prefix+"-"+property); + const isTypedInput = input.length > 0 && input.next(".red-ui-typedInput-container").length > 0; + if (isTypedInput) { + valid = input.typedInput("validate"); + } + } } if (valid && definition[property].type && RED.nodes.getType(definition[property].type) && !("validate" in definition[property])) { if (!value || value == "_ADD_") { @@ -1219,7 +1231,11 @@ RED.editor = (function() { }) if (node_def.hasUsers !== false) { - $(' ').css("margin-left", "10px").appendTo(trayFooterLeft); + // $(' ').css("margin-left", "10px").appendTo(trayFooterLeft); + $('').on('click', function() { + RED.sidebar.info.outliner.search('uses:'+editing_config_node.id) + RED.sidebar.info.show() + }).appendTo(trayFooterLeft); } trayFooter.append(''); @@ -1277,7 +1293,8 @@ RED.editor = (function() { }); } if (node_def.hasUsers !== false) { - $("#red-ui-editor-config-user-count").text(RED._("editor.nodesUse", {count:editing_config_node.users.length})).parent().show(); + $("#red-ui-editor-config-user-count").text(editing_config_node.users.length).parent().show(); + RED.popover.tooltip($("#red-ui-editor-config-user-count").parent(), function() { return RED._('editor.nodesUse',{count:editing_config_node.users.length})}); } trayBody.i18n(); trayFooter.i18n(); @@ -2070,6 +2087,7 @@ RED.editor = (function() { } }, editBuffer: function(options) { showTypeEditor("_buffer", options) }, + getEditStack: function () { return [...editStack] }, buildEditForm: buildEditForm, validateNode: validateNode, updateNodeProperties: updateNodeProperties, diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/editors/buffer.js b/packages/node_modules/@node-red/editor-client/src/js/ui/editors/buffer.js index f47ec508b..03a50e60b 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/editors/buffer.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/editors/buffer.js @@ -121,7 +121,7 @@ var i=0,l=bufferBinValue.length; var c = 0; for(i=0;i 255)) { valid = false; break; diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/editors/code-editors/monaco.js b/packages/node_modules/@node-red/editor-client/src/js/ui/editors/code-editors/monaco.js index b18e01fbb..eedc99c88 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/editors/code-editors/monaco.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/editors/code-editors/monaco.js @@ -966,12 +966,10 @@ RED.editor.codeEditor.monaco = (function() { //Unbind ctrl-Enter (default action is to insert a newline in editor) This permits the shortcut to close the tray. try { - ed._standaloneKeybindingService.addDynamicKeybinding( - '-editor.action.insertLineAfter', // command ID prefixed by '-' - null, // keybinding - () => {} // need to pass an empty handler - ); - } catch (error) { } + monaco.editor.addKeybindingRule({keybinding: 0, command: "-editor.action.insertLineAfter"}); + } catch (error) { + console.warn(error) + } ed.nodered = { refreshModuleLibs: refreshModuleLibs //expose this for function node externalModules refresh diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/editors/markdown.js b/packages/node_modules/@node-red/editor-client/src/js/ui/editors/markdown.js index bd7a11b3f..c4d7bf26d 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/editors/markdown.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/editors/markdown.js @@ -169,7 +169,7 @@ var currentScrollTop = $(".red-ui-editor-type-markdown-panel-preview").scrollTop(); $(".red-ui-editor-type-markdown-panel-preview").html(RED.utils.renderMarkdown(expressionEditor.getValue())); $(".red-ui-editor-type-markdown-panel-preview").scrollTop(currentScrollTop); - mermaid.init(); + RED.editor.mermaid.render() },200); }) if (options.header) { @@ -178,7 +178,7 @@ if (value) { $(".red-ui-editor-type-markdown-panel-preview").html(RED.utils.renderMarkdown(expressionEditor.getValue())); - mermaid.init(); + RED.editor.mermaid.render() } panels = RED.panels.create({ id:"red-ui-editor-type-markdown-panels", diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/editors/mermaid.js b/packages/node_modules/@node-red/editor-client/src/js/ui/editors/mermaid.js new file mode 100644 index 000000000..0c1597919 --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/editors/mermaid.js @@ -0,0 +1,54 @@ +RED.editor.mermaid = (function () { + let initializing = false + let loaded = false + let pendingEvals = [] + let diagramIds = 0 + + function render(selector = '.mermaid') { + // $(selector).hide() + if (!loaded) { + pendingEvals.push(selector) + + if (!initializing) { + initializing = true + $.getScript( + 'vendor/mermaid/mermaid.min.js', + function (data, stat, jqxhr) { + mermaid.initialize({ + startOnLoad: false, + theme: RED.settings.get('mermaid', {}).theme + }) + loaded = true + while(pendingEvals.length > 0) { + const pending = pendingEvals.shift() + render(pending) + } + } + ) + } + } else { + const nodes = document.querySelectorAll(selector) + + nodes.forEach(async node => { + if (!node.getAttribute('mermaid-processed')) { + const mermaidContent = node.innerText + node.setAttribute('mermaid-processed', true) + try { + const { svg } = await mermaid.render('mermaid-render-'+Date.now()+'-'+(diagramIds++), mermaidContent); + node.innerHTML = svg + } catch (err) { + $('
    ').css({ + fontSize: '0.8em', + border: '1px solid var(--red-ui-border-color-error)', + padding: '5px', + marginBottom: '10px', + }).text(err.toString()).prependTo(node) + } + } + }) + } + } + return { + render: render, + }; +})(); diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/editors/panes/appearance.js b/packages/node_modules/@node-red/editor-client/src/js/ui/editors/panes/appearance.js index e1e6b2ba3..d6dd5112d 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/editors/panes/appearance.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/editors/panes/appearance.js @@ -196,7 +196,7 @@ } $('
    '+ - ''+ + ''+ ''+ ''+ '
    ').appendTo(dialogForm); diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/env-var.js b/packages/node_modules/@node-red/editor-client/src/js/ui/env-var.js index 998484858..79c626af4 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/env-var.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/env-var.js @@ -71,7 +71,7 @@ RED.envVar = (function() { }; if (item.name.trim() !== "") { new_env.push(item); - if ((item.type === "cred") && (item.value !== "__PWRD__")) { + if (item.type === "cred") { credentials.map[item.name] = item.value; credentials.map["has_"+item.name] = (item.value !== ""); item.value = "__PWRD__"; diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/mermaid.js b/packages/node_modules/@node-red/editor-client/src/js/ui/mermaid.js deleted file mode 100644 index d126cf188..000000000 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/mermaid.js +++ /dev/null @@ -1,46 +0,0 @@ -// Mermaid diagram stub library for on-demand dynamic loading -// Will be overwritten after script loading by $.getScript -var mermaid = (function () { - var enabled /* = undefined */; - - var initializing = false; - var initCalled = false; - - function initialize(opt) { - if (enabled === undefined) { - if (RED.settings.markdownEditor && - RED.settings.markdownEditor.mermaid) { - enabled = RED.settings.markdownEditor.mermaid.enabled; - } - else { - enabled = true; - } - } - if (enabled) { - initializing = true; - $.getScript("vendor/mermaid/mermaid.min.js", - function (data, stat, jqxhr) { - $(".mermaid").show(); - // invoke loaded mermaid API - initializing = false; - mermaid.initialize(opt); - if (initCalled) { - mermaid.init(); - initCalled = false; - } - }); - } - } - - function init() { - if (initializing) { - $(".mermaid").hide(); - initCalled = true; - } - } - - return { - initialize: initialize, - init: init, - }; -})(); diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/palette.js b/packages/node_modules/@node-red/editor-client/src/js/ui/palette.js index db915fd8b..23f30fc61 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/palette.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/palette.js @@ -484,7 +484,7 @@ RED.palette = (function() { var currentLabel = paletteNode.attr("data-palette-label"); var currentInfo = paletteNode.attr("data-palette-info"); - if (currentLabel !== sf.name || currentInfo !== sf.info) { + if (currentLabel !== sf.name || currentInfo !== sf.info || sf.in.length > 0 || sf.out.length > 0) { paletteNode.attr("data-palette-info",sf.info); setLabel(sf.type+":"+sf.id,paletteNode,sf.name,RED.utils.renderMarkdown(sf.info||"")); } diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/projects/projectSettings.js b/packages/node_modules/@node-red/editor-client/src/js/ui/projects/projectSettings.js index b8f1558a6..37a5ef1a8 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/projects/projectSettings.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/projects/projectSettings.js @@ -166,7 +166,7 @@ RED.projects.settings = (function() { var description = addTargetToExternalLinks($(''+desc+'')).appendTo(container); description.find(".red-ui-text-bidi-aware").contents().filter(function() { return this.nodeType === 3 && this.textContent.trim() !== "" }).wrap( "" ); setTimeout(function () { - mermaid.init(); + RED.editor.mermaid.render() }, 200); } diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/projects/tab-versionControl.js b/packages/node_modules/@node-red/editor-client/src/js/ui/projects/tab-versionControl.js index 5512926be..afdec2273 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/projects/tab-versionControl.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/projects/tab-versionControl.js @@ -647,9 +647,9 @@ RED.sidebar.versionControl = (function() { $.getJSON("projects/"+activeProject.name+"/commits/"+entry.sha,function(result) { result.project = activeProject; result.parents = entry.parents; - result.oldRev = entry.sha+"~1"; + result.oldRev = entry.parents[0].length !== 0 ? entry.sha+"~1" : entry.sha; result.newRev = entry.sha; - result.oldRevTitle = RED._("sidebar.project.versionControl.commitCapital")+" "+entry.sha.substring(0,7)+"~1"; + result.oldRevTitle = entry.parents[0].length !== 0 ? RED._("sidebar.project.versionControl.commitCapital")+" "+entry.sha.substring(0,7)+"~1" : " "; result.newRevTitle = RED._("sidebar.project.versionControl.commitCapital")+" "+entry.sha.substring(0,7); result.date = humanizeSinceDate(parseInt(entry.date)); RED.diff.showCommitDiff(result); diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/tab-config.js b/packages/node_modules/@node-red/editor-client/src/js/ui/tab-config.js index 90ecf6093..e2c8185cb 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/tab-config.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/tab-config.js @@ -158,6 +158,7 @@ RED.sidebar.config = (function() { entry.data('node',node.id); nodeDiv.data('node',node.id); var label = $('
    ').text(labelText).appendTo(nodeDiv); + if (node.d) { nodeDiv.addClass("red-ui-palette-node-config-disabled"); $('').prependTo(label); @@ -179,6 +180,20 @@ RED.sidebar.config = (function() { nodeDiv.addClass("red-ui-palette-node-config-unused"); } } + + if (!node.valid) { + nodeDiv.addClass("red-ui-palette-node-config-invalid") + const nodeDivAnnotations = $('').appendTo(nodeDiv) + const errorBadge = document.createElementNS("http://www.w3.org/2000/svg","path"); + errorBadge.setAttribute("d","M 0,9 l 10,0 -5,-8 z"); + nodeDivAnnotations.append($(errorBadge)) + RED.popover.tooltip(nodeDivAnnotations, function () { + if (node.validationErrors && node.validationErrors.length > 0) { + return RED._("editor.errors.invalidProperties")+"
    - "+node.validationErrors.join("
    - ") + } + }) + } + nodeDiv.on('click',function(e) { e.stopPropagation(); RED.view.select(false); diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/tab-context.js b/packages/node_modules/@node-red/editor-client/src/js/ui/tab-context.js index 0d8ba103f..6cb034ccc 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/tab-context.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/tab-context.js @@ -232,7 +232,7 @@ RED.sidebar.context = (function() { typeHint: data.format, sourceId: id+"."+k, tools: tools, - path: "" + path: k }).appendTo(propRow.children()[1]); } }) @@ -278,7 +278,7 @@ RED.sidebar.context = (function() { typeHint: data.format, sourceId: id+"."+k, tools: tools, - path: "" + path: k }).appendTo(propRow.children()[1]); } }); @@ -299,7 +299,7 @@ RED.sidebar.context = (function() { typeHint: v.format, sourceId: id+"."+k, tools: tools, - path: "" + path: k }).appendTo(propRow.children()[1]); if (contextStores.length > 1) { $("",{class:"red-ui-sidebar-context-property-storename"}).text(v.store).appendTo($(propRow.children()[0])) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/tab-help.js b/packages/node_modules/@node-red/editor-client/src/js/ui/tab-help.js index ee4bad2d8..bf66611b1 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/tab-help.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/tab-help.js @@ -383,6 +383,7 @@ RED.sidebar.help = (function() { $(this).toggleClass('expanded',!isExpanded); }) helpSection.parent().scrollTop(0); + RED.editor.mermaid.render() } function set(html,title) { diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/tab-info.js b/packages/node_modules/@node-red/editor-client/src/js/ui/tab-info.js index e38b0b67e..f72a7b3f2 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/tab-info.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/tab-info.js @@ -464,7 +464,7 @@ RED.sidebar.info = (function() { } $(this).toggleClass('expanded',!isExpanded); }); - mermaid.init(); + RED.editor.mermaid.render() } var tips = (function() { diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/typeSearch.js b/packages/node_modules/@node-red/editor-client/src/js/ui/typeSearch.js index 4f47d4674..3d05fd1c8 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/typeSearch.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/typeSearch.js @@ -186,8 +186,15 @@ RED.typeSearch = (function() { var iconContainer = $('
    ',{class:"red-ui-palette-icon-container"}).appendTo(nodeDiv); RED.utils.createIconElement(icon_url, iconContainer, false); - - if (!/^_action_:/.test(object.type) && object.type !== "junction") { + if (/^subflow:/.test(object.type)) { + var sf = RED.nodes.subflow(object.type.substring(8)); + if (sf.in.length > 0) { + $('
    ',{class:"red-ui-search-result-node-port"}).appendTo(nodeDiv); + } + if (sf.out.length > 0) { + $('
    ',{class:"red-ui-search-result-node-port red-ui-search-result-node-output"}).appendTo(nodeDiv); + } + } else if (!/^_action_:/.test(object.type) && object.type !== "junction") { if (def.inputs > 0) { $('
    ',{class:"red-ui-search-result-node-port"}).appendTo(nodeDiv); } @@ -323,7 +330,7 @@ RED.typeSearch = (function() { } } function applyFilter(filter,type,def) { - return !filter || + return !def || !filter || ( (!filter.spliceMultiple) && (!filter.type || type === filter.type) && diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js b/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js index 4d8ccdd9d..6475b19f5 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js @@ -101,28 +101,8 @@ RED.utils = (function() { renderer.code = function (code, lang) { if(lang === "mermaid") { - // mermaid diagram rendering - if (mermaidIsEnabled === undefined) { - if (RED.settings.markdownEditor && - RED.settings.markdownEditor.mermaid) { - mermaidIsEnabled = RED.settings.markdownEditor.mermaid.enabled; - } - else { - mermaidIsEnabled = true; - } - } - if (mermaidIsEnabled) { - if (!mermaidIsInitialized) { - mermaidIsInitialized = true; - mermaid.initialize({startOnLoad:false}); - } - return `
    ${code}
    `; - } - else { - return `
    ${RED._("markdownEditor.mermaid.summary")}
    ${code}
    `; - } - } - else { + return `
    ${code}
    `; + } else { return "
    " +code +"
    "; } }; @@ -917,6 +897,51 @@ RED.utils = (function() { } } + /** + * Checks a typed property is valid according to the type. + * Returns true if valid. + * Return String error message if invalid + * @param {*} propertyType + * @param {*} propertyValue + * @returns true if valid, String if invalid + */ + function validateTypedProperty(propertyValue, propertyType, opt) { + + let error + if (propertyType === 'json') { + try { + JSON.parse(propertyValue); + } catch(err) { + error = RED._("validator.errors.invalid-json", { + error: err.message + }) + } + } else if (propertyType === 'msg' || propertyType === 'flow' || propertyType === 'global' ) { + if (!RED.utils.validatePropertyExpression(propertyValue)) { + error = RED._("validator.errors.invalid-prop") + } + } else if (propertyType === 'num') { + if (!/^NaN$|^[+-]?[0-9]*\.?[0-9]*([eE][-+]?[0-9]+)?$|^[+-]?(0b|0B)[01]+$|^[+-]?(0o|0O)[0-7]+$|^[+-]?(0x|0X)[0-9a-fA-F]+$/.test(propertyValue)) { + error = RED._("validator.errors.invalid-num") + } + } else if (propertyType === 'jsonata') { + try { + jsonata(propertyValue) + } catch(err) { + error = RED._("validator.errors.invalid-expr", { + error: err.message + }) + } + } + if (error) { + if (opt && opt.label) { + return opt.label+': '+error + } + return error + } + return true + } + function getMessageProperty(msg,expr) { var result = null; var msgPropParts; @@ -1451,6 +1476,7 @@ RED.utils = (function() { getDarkerColor: getDarkerColor, parseModuleList: parseModuleList, checkModuleAllowed: checkModuleAllowed, - getBrowserInfo: getBrowserInfo + getBrowserInfo: getBrowserInfo, + validateTypedProperty: validateTypedProperty } })(); diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js index 66c87b1a9..23385940c 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js @@ -4155,10 +4155,15 @@ RED.view = (function() { scaleFactor = 30/largestEdge; } var width = img.width * scaleFactor; + if (width > 20) { + scalefactor *= 20/width; + width = 20; + } var height = img.height * scaleFactor; icon.attr("width",width); icon.attr("height",height); icon.attr("x",15-width/2); + icon.attr("y",(30-height)/2); } icon.attr("xlink:href",iconUrl); icon.style("display",null); @@ -4187,7 +4192,7 @@ RED.view = (function() { nodeEl.__statusGroup__.style.display = "none"; } else { nodeEl.__statusGroup__.style.display = "inline"; - let backgroundWidth = 12 + let backgroundWidth = 15 var fill = status_colours[d.status.fill]; // Only allow our colours for now if (d.status.shape == null && fill == null) { backgroundWidth = 0 @@ -4207,7 +4212,11 @@ RED.view = (function() { nodeEl.__statusLabel__.textContent = ""; } const textSize = nodeEl.__statusLabel__.getBBox() - nodeEl.__statusBackground__.setAttribute('width', backgroundWidth + textSize.width + 6) + backgroundWidth += textSize.width + if (backgroundWidth > 0 && textSize.width > 0) { + backgroundWidth += 6 + } + nodeEl.__statusBackground__.setAttribute('width', backgroundWidth) } delete d.dirtyStatus; } @@ -4619,8 +4628,8 @@ RED.view = (function() { statusBackground.setAttribute("y",-1); statusBackground.setAttribute("width",200); statusBackground.setAttribute("height",13); - statusBackground.setAttribute("rx",1); - statusBackground.setAttribute("ry",1); + statusBackground.setAttribute("rx",2); + statusBackground.setAttribute("ry",2); statusEl.appendChild(statusBackground); node[0][0].__statusBackground__ = statusBackground; @@ -6243,6 +6252,10 @@ RED.view = (function() { } }) } + if (selection.links) { + selectedLinks.clear(); + selection.links.forEach(selectedLinks.add); + } } } updateSelection(); diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js b/packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js index 1a71577ce..2fa78f679 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js @@ -17,6 +17,8 @@ RED.workspaces = (function() { + const documentTitle = document.title; + var activeWorkspace = 0; var workspaceIndex = 0; @@ -339,12 +341,18 @@ RED.workspaces = (function() { $("#red-ui-workspace-chart").show(); activeWorkspace = tab.id; window.location.hash = 'flow/'+tab.id; + if (tab.label) { + document.title = `${documentTitle} : ${tab.label}` + } else { + document.title = documentTitle + } $("#red-ui-workspace").toggleClass("red-ui-workspace-disabled", !!tab.disabled); $("#red-ui-workspace").toggleClass("red-ui-workspace-locked", !!tab.locked); } else { $("#red-ui-workspace-chart").hide(); activeWorkspace = 0; window.location.hash = ''; + document.title = documentTitle } event.workspace = activeWorkspace; RED.events.emit("workspace:change",event); diff --git a/packages/node_modules/@node-red/editor-client/src/js/validators.js b/packages/node_modules/@node-red/editor-client/src/js/validators.js index 4fb384cbf..1673495aa 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/validators.js +++ b/packages/node_modules/@node-red/editor-client/src/js/validators.js @@ -40,46 +40,32 @@ RED.validators = { return opt ? RED._("validator.errors.invalid-regexp") : false; }; }, - typedInput: function(ptypeName,isConfig,mopt) { + typedInput: function(ptypeName, isConfig, mopt) { + let options = ptypeName + if (typeof ptypeName === 'string' ) { + options = {} + options.typeField = ptypeName + options.isConfig = isConfig + options.allowBlank = false + } return function(v, opt) { - var ptype = $("#node-"+(isConfig?"config-":"")+"input-"+ptypeName).val() || this[ptypeName]; - if (ptype === 'json') { - try { - JSON.parse(v); - return true; - } catch(err) { - if (opt && opt.label) { - return RED._("validator.errors.invalid-json-prop", { - error: err.message, - prop: opt.label, - }); - } - return opt ? RED._("validator.errors.invalid-json", { - error: err.message - }) : false; - } - } else if (ptype === 'msg' || ptype === 'flow' || ptype === 'global' ) { - if (RED.utils.validatePropertyExpression(v)) { - return true; - } - if (opt && opt.label) { - return RED._("validator.errors.invalid-prop-prop", { - prop: opt.label - }); - } - return opt ? RED._("validator.errors.invalid-prop") : false; - } else if (ptype === 'num') { - if (/^[+-]?[0-9]*\.?[0-9]*([eE][-+]?[0-9]+)?$/.test(v)) { - return true; - } - if (opt && opt.label) { - return RED._("validator.errors.invalid-num-prop", { - prop: opt.label - }); - } - return opt ? RED._("validator.errors.invalid-num") : false; + let ptype = options.type + if (!ptype && options.typeField) { + ptype = $("#node-"+(options.isConfig?"config-":"")+"input-"+options.typeField).val() || this[options.typeField]; } - return true; - }; + if (options.allowBlank && v === '') { + return true + } + if (options.allowUndefined && v === undefined) { + return true + } + const result = RED.utils.validateTypedProperty(v, ptype, opt) + if (result === true || opt) { + // Valid, or opt provided - return result as-is + return result + } + // No opt - need to return false for backwards compatibilty + return false + } } -}; +}; \ No newline at end of file diff --git a/packages/node_modules/@node-red/editor-client/src/sass/flow.scss b/packages/node_modules/@node-red/editor-client/src/sass/flow.scss index bd83e3eff..723e8ac79 100644 --- a/packages/node_modules/@node-red/editor-client/src/sass/flow.scss +++ b/packages/node_modules/@node-red/editor-client/src/sass/flow.scss @@ -114,6 +114,7 @@ pointer-events: stroke; } .red-ui-flow-group-outline-select { + cursor: move; fill: none; stroke: var(--red-ui-node-selected-color); pointer-events: none; diff --git a/packages/node_modules/@node-red/editor-client/src/sass/library.scss b/packages/node_modules/@node-red/editor-client/src/sass/library.scss index bb651e4ea..0b6ca55ed 100644 --- a/packages/node_modules/@node-red/editor-client/src/sass/library.scss +++ b/packages/node_modules/@node-red/editor-client/src/sass/library.scss @@ -194,10 +194,6 @@ } } .red-ui-clipboard-dialog-import-conflicts-controls { - position: absolute; - top:0; - bottom: 0; - right: 0px; text-align: center; color: var(--red-ui-form-text-color); .form-row & label { @@ -218,9 +214,21 @@ margin: 0; } } -#red-ui-clipboard-dialog-import-conflicts-list .disabled .red-ui-info-outline-item { - opacity: 0.4; +#red-ui-clipboard-dialog-import-conflicts-list .disabled { + .red-ui-info-outline-item, + .red-ui-node-list-item { + opacity: 0.4; + } } +#red-ui-clipboard-dialog-import-conflicts-list .red-ui-node-list-item { + display: flex; + align-items: center; + + & > :first-child { + flex-grow: 1 + } +} + .form-row label.red-ui-clipboard-dialog-import-conflicts-gutter { box-sizing: border-box; width: 22px; diff --git a/packages/node_modules/@node-red/editor-client/src/sass/projects.scss b/packages/node_modules/@node-red/editor-client/src/sass/projects.scss index a32fd53b4..f6bd57375 100644 --- a/packages/node_modules/@node-red/editor-client/src/sass/projects.scss +++ b/packages/node_modules/@node-red/editor-client/src/sass/projects.scss @@ -825,6 +825,7 @@ div.red-ui-projects-dialog-ssh-public-key { margin-top: 0 !important; padding: 5px 10px; margin-bottom: 10px; + border-radius: 3px 3px 0px 0px; } } diff --git a/packages/node_modules/@node-red/editor-client/src/sass/tab-config.scss b/packages/node_modules/@node-red/editor-client/src/sass/tab-config.scss index c1f151ca6..9d678daa1 100644 --- a/packages/node_modules/@node-red/editor-client/src/sass/tab-config.scss +++ b/packages/node_modules/@node-red/editor-client/src/sass/tab-config.scss @@ -36,7 +36,7 @@ ul.red-ui-sidebar-node-config-list { text-align: center; } .red-ui-palette-node { - overflow: hidden; + // overflow: hidden; cursor: default; &.selected { border-color: transparent; @@ -113,6 +113,15 @@ ul.red-ui-sidebar-node-config-list li.red-ui-palette-node-config-type { margin-right: 5px; } } +.red-ui-palette-node-config-invalid { + border-color: var(--red-ui-form-input-border-error-color) +} +.red-ui-palette-node-annotations { + position: absolute; + left: calc(100% - 15px); + top: -8px; + display: block; +} .red-ui-sidebar-node-config-filter-info { position: absolute; top: 0; diff --git a/packages/node_modules/@node-red/editor-client/templates/index.mst b/packages/node_modules/@node-red/editor-client/templates/index.mst index 01bf06545..cc144c35f 100644 --- a/packages/node_modules/@node-red/editor-client/templates/index.mst +++ b/packages/node_modules/@node-red/editor-client/templates/index.mst @@ -22,26 +22,26 @@ limitations under the License. --> {{ page.title }} - - - - - + + + + + {{#page.css}} {{/page.css}} {{#asset.vendorMonaco}} - + {{/asset.vendorMonaco}}
    - + {{#asset.vendorMonaco}} - + {{/asset.vendorMonaco}} - - + + {{# page.scripts }} {{/ page.scripts }} diff --git a/packages/node_modules/@node-red/nodes/core/common/20-inject.html b/packages/node_modules/@node-red/nodes/core/common/20-inject.html index 0fafa9df0..d50725d51 100644 --- a/packages/node_modules/@node-red/nodes/core/common/20-inject.html +++ b/packages/node_modules/@node-red/nodes/core/common/20-inject.html @@ -320,7 +320,7 @@ } // but replace with repeat one if set to repeat if ((this.repeat && this.repeat != 0) || this.crontab) { - suffix = " ↻"; + suffix = "\t↻"; } if (this.name) { return this.name+suffix; diff --git a/packages/node_modules/@node-red/nodes/core/common/20-inject.js b/packages/node_modules/@node-red/nodes/core/common/20-inject.js index cde9b2141..6973ebf1b 100644 --- a/packages/node_modules/@node-red/nodes/core/common/20-inject.js +++ b/packages/node_modules/@node-red/nodes/core/common/20-inject.js @@ -109,9 +109,8 @@ module.exports = function(RED) { } const p = props.shift() const property = p.p; - const value = p.v ? p.v : ''; - const valueType = p.vt ? p.vt : 'str'; - + const value = p.v !== undefined ? p.v : ''; + const valueType = p.vt !== undefined ? p.vt : 'str'; if (property) { if (valueType === "jsonata") { if (p.v) { 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 88d51b283..1c33ad848 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 @@ -86,7 +86,7 @@ }, label: function() { var suffix = ""; - if (this.console === true || this.console === "true") { suffix = " ⇲"; } + if (this.console === true || this.console === "true") { suffix = "\t⇲"; } if (this.targetType === "jsonata") { return (this.name || "JSONata") + suffix; } @@ -195,6 +195,119 @@ node.dirty = true; }); RED.view.redraw(); + }, + requestDebugNodeList: function(filteredNodes) { + var workspaceOrder = RED.nodes.getWorkspaceOrder(); + var workspaceOrderMap = {}; + workspaceOrder.forEach(function(ws,i) { + workspaceOrderMap[ws] = i; + }); + + var candidateNodes = []; + var candidateSFs = []; + var subflows = {}; + RED.nodes.eachNode(function (n) { + var nt = n.type; + if (nt === "debug") { + if (n.z in workspaceOrderMap) { + candidateNodes.push(n); + } + else { + var sf = RED.nodes.subflow(n.z); + if (sf) { + subflows[sf.id] = { + debug: true, + subflows: {} + }; + } + } + } + else if(nt.substring(0, 8) === "subflow:") { + if (n.z in workspaceOrderMap) { + candidateSFs.push(n); + } + else { + var psf = RED.nodes.subflow(n.z); + if (psf) { + var sid = nt.substring(8); + var item = subflows[psf.id]; + if (!item) { + item = { + debug: undefined, + subflows: {} + }; + subflows[psf.id] = item; + } + item.subflows[sid] = true; + } + } + } + }); + candidateSFs.forEach(function (sf) { + var sid = sf.type.substring(8); + if (containsDebug(sid, subflows)) { + candidateNodes.push(sf); + } + }); + + candidateNodes.sort(function(A,B) { + var wsA = workspaceOrderMap[A.z]; + var wsB = workspaceOrderMap[B.z]; + if (wsA !== wsB) { + return wsA-wsB; + } + var labelA = RED.utils.getNodeLabel(A,A.id); + var labelB = RED.utils.getNodeLabel(B,B.id); + return labelA.localeCompare(labelB); + }); + var currentWs = null; + var data = []; + var currentFlow; + var currentSelectedCount = 0; + candidateNodes.forEach(function(node) { + if (currentWs !== node.z) { + if (currentFlow && currentFlow.checkbox) { + currentFlow.selected = currentSelectedCount === currentFlow.children.length + } + currentSelectedCount = 0; + currentWs = node.z; + var parent = RED.nodes.workspace(currentWs) || RED.nodes.subflow(currentWs); + currentFlow = { + label: RED.utils.getNodeLabel(parent, currentWs), + } + if (!parent.disabled) { + currentFlow.children = []; + currentFlow.checkbox = true; + } else { + currentFlow.class = "disabled" + } + data.push(currentFlow); + } + if (currentFlow.children) { + if (!filteredNodes[node.id]) { + currentSelectedCount++; + } + currentFlow.children.push({ + label: RED.utils.getNodeLabel(node,node.id), + node: { + id: node.id + }, + checkbox: true, + selected: !filteredNodes[node.id] + }); + } + }); + if (currentFlow && currentFlow.checkbox) { + currentFlow.selected = currentSelectedCount === currentFlow.children.length + } + if (subWindow) { + try { + subWindow.postMessage({event:"refreshDebugNodeList", nodes:data},"*"); + } catch(err) { + console.log(err); + } + } + RED.debug.refreshDebugNodeList(data) } }; @@ -396,6 +509,26 @@ } } + function containsDebug(sid, map) { + var item = map[sid]; + if (item) { + if (item.debug === undefined) { + var sfs = Object.keys(item.subflows); + var contain = false; + for (var i = 0; i < sfs.length; i++) { + var sf = sfs[i]; + if (containsDebug(sf, map)) { + contain = true; + break; + } + } + item.debug = contain; + } + return item.debug; + } + return false; + } + $("#red-ui-sidebar-debug-open").on("click", function(e) { e.preventDefault(); subWindow = window.open(document.location.toString().replace(/[?#].*$/,"")+"debug/view/view.html"+document.location.search,"nodeREDDebugView","menubar=no,location=no,toolbar=no,chrome,height=500,width=600"); @@ -427,6 +560,8 @@ options.messageSourceClick(msg.id,msg._alias,msg.path); } else if (msg.event === "clear") { options.clear(); + } else if (msg.event === "requestDebugNodeList") { + options.requestDebugNodeList(msg.filteredNodes) } }; window.addEventListener('message',this.handleWindowMessage); 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 5a22194ad..fe9827fce 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 @@ -5,6 +5,7 @@ module.exports = function(RED) { const fs = require("fs-extra"); const path = require("path"); var debuglength = RED.settings.debugMaxLength || 1000; + var statuslength = RED.settings.debugStatusLength || 32; var useColors = RED.settings.debugUseColors || false; util.inspect.styles.boolean = "red"; const { hasOwnProperty } = Object.prototype; @@ -164,7 +165,7 @@ module.exports = function(RED) { } } - if (st.length > 32) { st = st.substr(0,32) + "..."; } + if (st.length > statuslength) { st = st.substr(0,statuslength) + "..."; } var newStatus = {fill:fill, shape:shape, text:st}; if (JSON.stringify(newStatus) !== node.oldState) { // only send if we have to diff --git a/packages/node_modules/@node-red/nodes/core/common/60-link.html b/packages/node_modules/@node-red/nodes/core/common/60-link.html index c57827149..73ce86ccf 100644 --- a/packages/node_modules/@node-red/nodes/core/common/60-link.html +++ b/packages/node_modules/@node-red/nodes/core/common/60-link.html @@ -275,7 +275,7 @@ value: [], type: "link in[]", validate: function (v, opt) { - if ((this.linkType === "static" && v.length > 0) + if (((this.linkType || "static") === "static" && v.length > 0) || this.linkType === "dynamic") { return true; } diff --git a/packages/node_modules/@node-red/nodes/core/common/lib/debug/debug-utils.js b/packages/node_modules/@node-red/nodes/core/common/lib/debug/debug-utils.js index 70dc33605..a4cd4c68d 100644 --- a/packages/node_modules/@node-red/nodes/core/common/lib/debug/debug-utils.js +++ b/packages/node_modules/@node-red/nodes/core/common/lib/debug/debug-utils.js @@ -167,19 +167,13 @@ RED.debug = (function() { var menu = RED.popover.menu({ options: options, onselect: function(item) { - if (item.value !== filterType) { - filterType = item.value; - $('#red-ui-sidebar-debug-filter span').text(RED._('node-red:debug.sidebar.'+filterType)); - refreshMessageList(); - RED.settings.set("debug.filter",filterType) - } + setFilterType(item.value) if (filterType === 'filterSelected') { - refreshDebugNodeList(); + config.requestDebugNodeList(filteredNodes); filterDialog.slideDown(200); filterDialogShown = true; debugNodeTreeList.focus(); } - } }); menu.show({ @@ -254,131 +248,7 @@ RED.debug = (function() { } - - function containsDebug(sid, map) { - var item = map[sid]; - if (item) { - if (item.debug === undefined) { - var sfs = Object.keys(item.subflows); - var contain = false; - for (var i = 0; i < sfs.length; i++) { - var sf = sfs[i]; - if (containsDebug(sf, map)) { - contain = true; - break; - } - } - item.debug = contain; - } - return item.debug; - } - return false; - } - - - function refreshDebugNodeList() { - var workspaceOrder = RED.nodes.getWorkspaceOrder(); - var workspaceOrderMap = {}; - workspaceOrder.forEach(function(ws,i) { - workspaceOrderMap[ws] = i; - }); - - var candidateNodes = []; - var candidateSFs = []; - var subflows = {}; - RED.nodes.eachNode(function (n) { - var nt = n.type; - if (nt === "debug") { - if (n.z in workspaceOrderMap) { - candidateNodes.push(n); - } - else { - var sf = RED.nodes.subflow(n.z); - if (sf) { - subflows[sf.id] = { - debug: true, - subflows: {} - }; - } - } - } - else if(nt.substring(0, 8) === "subflow:") { - if (n.z in workspaceOrderMap) { - candidateSFs.push(n); - } - else { - var psf = RED.nodes.subflow(n.z); - if (psf) { - var sid = nt.substring(8); - var item = subflows[psf.id]; - if (!item) { - item = { - debug: undefined, - subflows: {} - }; - subflows[psf.id] = item; - } - item.subflows[sid] = true; - } - } - } - }); - candidateSFs.forEach(function (sf) { - var sid = sf.type.substring(8); - if (containsDebug(sid, subflows)) { - candidateNodes.push(sf); - } - }); - - candidateNodes.sort(function(A,B) { - var wsA = workspaceOrderMap[A.z]; - var wsB = workspaceOrderMap[B.z]; - if (wsA !== wsB) { - return wsA-wsB; - } - var labelA = RED.utils.getNodeLabel(A,A.id); - var labelB = RED.utils.getNodeLabel(B,B.id); - return labelA.localeCompare(labelB); - }); - var currentWs = null; - var data = []; - var currentFlow; - var currentSelectedCount = 0; - candidateNodes.forEach(function(node) { - if (currentWs !== node.z) { - if (currentFlow && currentFlow.checkbox) { - currentFlow.selected = currentSelectedCount === currentFlow.children.length - } - currentSelectedCount = 0; - currentWs = node.z; - var parent = RED.nodes.workspace(currentWs) || RED.nodes.subflow(currentWs); - currentFlow = { - label: RED.utils.getNodeLabel(parent, currentWs), - } - if (!parent.disabled) { - currentFlow.children = []; - currentFlow.checkbox = true; - } else { - currentFlow.class = "disabled" - } - data.push(currentFlow); - } - if (currentFlow.children) { - if (!filteredNodes[node.id]) { - currentSelectedCount++; - } - currentFlow.children.push({ - label: RED.utils.getNodeLabel(node,node.id), - node: node, - checkbox: true, - selected: !filteredNodes[node.id] - }); - } - }); - if (currentFlow && currentFlow.checkbox) { - currentFlow.selected = currentSelectedCount === currentFlow.children.length - } - + function refreshDebugNodeList(data) { debugNodeTreeList.treeList("data", data); } @@ -401,7 +271,7 @@ RED.debug = (function() { },200); } function _refreshMessageList(_activeWorkspace) { - if (_activeWorkspace) { + if (typeof _activeWorkspace === 'string') { activeWorkspace = _activeWorkspace.replace(/\./g,"_"); } if (filterType === "filterAll") { @@ -479,12 +349,12 @@ RED.debug = (function() { filteredNodes[n.id] = true; }); delete filteredNodes[sourceId]; - $("#red-ui-sidebar-debug-filterSelected").trigger("click"); RED.settings.set('debug.filteredNodes',Object.keys(filteredNodes)) + setFilterType('filterSelected') refreshMessageList(); }}, {id:"red-ui-debug-msg-menu-item-clear-filter",label:RED._("node-red:debug.messageMenu.clearFilter"),onselect:function(){ - $("#red-ui-sidebar-debug-filterAll").trigger("click"); + clearFilterSettings() refreshMessageList(); }} ); @@ -713,9 +583,17 @@ RED.debug = (function() { if (!!clearFilter) { clearFilterSettings(); } - refreshDebugNodeList(); + config.requestDebugNodeList(filteredNodes); } + function setFilterType(type) { + if (type !== filterType) { + filterType = type; + $('#red-ui-sidebar-debug-filter span').text(RED._('node-red:debug.sidebar.'+filterType)); + refreshMessageList(); + RED.settings.set("debug.filter",filterType) + } + } function clearFilterSettings() { filteredNodes = {}; filterType = 'filterAll'; @@ -728,6 +606,7 @@ RED.debug = (function() { init: init, refreshMessageList:refreshMessageList, handleDebugMessage: handleDebugMessage, - clearMessageList: clearMessageList + clearMessageList: clearMessageList, + refreshDebugNodeList: refreshDebugNodeList } })(); diff --git a/packages/node_modules/@node-red/nodes/core/common/lib/debug/debug.js b/packages/node_modules/@node-red/nodes/core/common/lib/debug/debug.js index 792d9895a..96f31bc81 100644 --- a/packages/node_modules/@node-red/nodes/core/common/lib/debug/debug.js +++ b/packages/node_modules/@node-red/nodes/core/common/lib/debug/debug.js @@ -12,6 +12,9 @@ $(function() { }, clear: function() { window.opener.postMessage({event:"clear"},'*'); + }, + requestDebugNodeList: function(filteredNodes) { + window.opener.postMessage({event: 'requestDebugNodeList', filteredNodes},'*') } } @@ -26,6 +29,8 @@ $(function() { RED.debug.refreshMessageList(evt.data.activeWorkspace); } else if (evt.data.event === "projectChange") { RED.debug.clearMessageList(true); + } else if (evt.data.event === "refreshDebugNodeList") { + RED.debug.refreshDebugNodeList(evt.data.nodes) } },false); } catch(err) { diff --git a/packages/node_modules/@node-red/nodes/core/function/10-function.js b/packages/node_modules/@node-red/nodes/core/function/10-function.js index 7f2250008..a915a1623 100644 --- a/packages/node_modules/@node-red/nodes/core/function/10-function.js +++ b/packages/node_modules/@node-red/nodes/core/function/10-function.js @@ -315,7 +315,7 @@ module.exports = function(RED) { var spec = module.module; if (spec && (spec !== "")) { moduleLoadPromises.push(RED.import(module.module).then(lib => { - sandbox[vname] = lib.default; + sandbox[vname] = lib.default || lib; }).catch(err => { node.error(RED._("function.error.moduleLoadError",{module:module.spec, error:err.toString()})) throw err; diff --git a/packages/node_modules/@node-red/nodes/core/function/10-switch.html b/packages/node_modules/@node-red/nodes/core/function/10-switch.html index c10a53827..10fcf7356 100644 --- a/packages/node_modules/@node-red/nodes/core/function/10-switch.html +++ b/packages/node_modules/@node-red/nodes/core/function/10-switch.html @@ -103,7 +103,6 @@ } else if (type === "istype") { r.v = rule.find(".node-input-rule-type-value").typedInput('type'); r.vt = rule.find(".node-input-rule-type-value").typedInput('type'); - r.vt = (r.vt === "number") ? "num" : "str"; } else if (type === "jsonata_exp") { r.v = rule.find(".node-input-rule-exp-value").typedInput('value'); r.vt = rule.find(".node-input-rule-exp-value").typedInput('type'); @@ -168,7 +167,35 @@ label:RED._("node-red:common.label.payload"), validate: RED.validators.typedInput("propertyType", false)}, propertyType: { value:"msg" }, - rules: {value:[{t:"eq", v:"", vt:"str"}]}, + rules: { + value:[{t:"eq", v:"", vt:"str"}], + validate: function (rules, opt) { + let msg; + const errors = [] + if (!rules || rules.length === 0) { return true } + for (var i=0;i 0) { var lastRule = $("#node-input-rule-container").editableList('getItemAt',i-1); var exportedRule = exportRule(lastRule.element); - opt.r.vt = exportedRule.vt; + if (exportedRule.t === "istype") { + opt.r.vt = (exportedRule.vt === "number") ? "num" : "str"; + } else { + opt.r.vt = exportedRule.vt; + } opt.r.v = ""; // We could copy the value over as well and preselect it (see the 'activeElement' code below) // But not sure that feels right. Is copying over the last value 'expected' behaviour? diff --git a/packages/node_modules/@node-red/nodes/core/function/15-change.html b/packages/node_modules/@node-red/nodes/core/function/15-change.html index e53f522d9..d6106be1c 100644 --- a/packages/node_modules/@node-red/nodes/core/function/15-change.html +++ b/packages/node_modules/@node-red/nodes/core/function/15-change.html @@ -19,71 +19,42 @@ @@ -75,6 +88,7 @@ color:"#DEBD5C", defaults: { name: {value:""}, + spec: {value:"rfc"}, sep: { value:',', required:true, label:RED._("node-red:csv.label.separator"), @@ -83,7 +97,7 @@ hdrin: {value:""}, hdrout: {value:"none"}, multi: {value:"one",required:true}, - ret: {value:'\\n'}, + ret: {value:'\\r\\n'}, // default to CRLF (RFC4180 Sec 2.1: "Each record is located on a separate line, delimited by a line break (CRLF)") temp: {value:""}, skip: {value:"0"}, strings: {value:true}, @@ -123,6 +137,27 @@ $("#node-input-sep").hide(); } }); + + $("#csv-option-spec").on("change", function() { + if ($("#csv-option-spec").val() == "rfc") { + $(".form-tips.csv-lecacy-warning").hide(); + } else { + $(".form-tips.csv-lecacy-warning").show(); + } + }); + // new nodes will have `spec` set to "rfc" (default), but existing nodes will either not have + // a spec value or it will be empty - we need to maintain the legacy behaviour for existing + // flows but default to rfc for new nodes + let spec = !this.spec ? "" : "rfc" + $("#csv-option-spec").val(spec).trigger("change") + }, + oneditsave: function() { + const specFormVal = $("#csv-option-spec").val() || '' // empty === legacy + const spectNodeVal = this.spec || '' // empty === legacy, null/undefined means in-place node upgrade (keep as is) + if (specFormVal !== spectNodeVal) { + // only update the flow value if changed (avoid marking the node dirty unnecessarily) + this.spec = specFormVal + } } }); diff --git a/packages/node_modules/@node-red/nodes/core/parsers/70-CSV.js b/packages/node_modules/@node-red/nodes/core/parsers/70-CSV.js index 31e6505d7..c6a91d61a 100644 --- a/packages/node_modules/@node-red/nodes/core/parsers/70-CSV.js +++ b/packages/node_modules/@node-red/nodes/core/parsers/70-CSV.js @@ -15,319 +15,674 @@ **/ module.exports = function(RED) { + const csv = require('./lib/csv') + "use strict"; function CSVNode(n) { - RED.nodes.createNode(this,n); - this.template = (n.temp || ""); - this.sep = (n.sep || ',').replace(/\\t/g,"\t").replace(/\\n/g,"\n").replace(/\\r/g,"\r"); - this.quo = '"'; - this.ret = (n.ret || "\n").replace(/\\n/g,"\n").replace(/\\r/g,"\r"); - this.winflag = (this.ret === "\r\n"); - this.lineend = "\n"; - this.multi = n.multi || "one"; - this.hdrin = n.hdrin || false; - this.hdrout = n.hdrout || "none"; - this.goodtmpl = true; - this.skip = parseInt(n.skip || 0); - this.store = []; - this.parsestrings = n.strings; - this.include_empty_strings = n.include_empty_strings || false; - this.include_null_values = n.include_null_values || false; - if (this.parsestrings === undefined) { this.parsestrings = true; } - if (this.hdrout === false) { this.hdrout = "none"; } - if (this.hdrout === true) { this.hdrout = "all"; } - var tmpwarn = true; - var node = this; - var re = new RegExp(node.sep.replace(/[-[\]{}()*+!<=:?.\/\\^$|#\s,]/g,'\\$&') + '(?=(?:(?:[^"]*"){2})*[^"]*$)','g'); + RED.nodes.createNode(this,n) + const node = this + const RFC4180Mode = n.spec === 'rfc' + const legacyMode = !RFC4180Mode - // pass in an array of column names to be trimmed, de-quoted and retrimmed - var clean = function(col,sep) { - if (sep) { re = new RegExp(sep.replace(/[-[\]{}()*+!<=:?.\/\\^$|#\s,]/g,'\\$&') +'(?=(?:(?:[^"]*"){2})*[^"]*$)','g'); } - col = col.trim().split(re) || [""]; - col = col.map(x => x.replace(/"/g,'').trim()); - if ((col.length === 1) && (col[0] === "")) { node.goodtmpl = false; } - else { node.goodtmpl = true; } - return col; - } - var template = clean(node.template,','); - var notemplate = template.length === 1 && template[0] === ''; - node.hdrSent = false; + node.status({}) // clear status - this.on("input", function(msg, send, done) { - if (msg.hasOwnProperty("reset")) { - node.hdrSent = false; + if (legacyMode) { + this.template = (n.temp || ""); + this.sep = (n.sep || ',').replace(/\\t/g,"\t").replace(/\\n/g,"\n").replace(/\\r/g,"\r"); + this.quo = '"'; + this.ret = (n.ret || "\n").replace(/\\n/g,"\n").replace(/\\r/g,"\r"); + this.winflag = (this.ret === "\r\n"); + this.lineend = "\n"; + this.multi = n.multi || "one"; + this.hdrin = n.hdrin || false; + this.hdrout = n.hdrout || "none"; + this.goodtmpl = true; + this.skip = parseInt(n.skip || 0); + this.store = []; + this.parsestrings = n.strings; + this.include_empty_strings = n.include_empty_strings || false; + this.include_null_values = n.include_null_values || false; + if (this.parsestrings === undefined) { this.parsestrings = true; } + if (this.hdrout === false) { this.hdrout = "none"; } + if (this.hdrout === true) { this.hdrout = "all"; } + var tmpwarn = true; + // var node = this; + var re = new RegExp(node.sep.replace(/[-[\]{}()*+!<=:?.\/\\^$|#\s,]/g,'\\$&') + '(?=(?:(?:[^"]*"){2})*[^"]*$)','g'); + + // pass in an array of column names to be trimmed, de-quoted and retrimmed + var clean = function(col,sep) { + if (sep) { re = new RegExp(sep.replace(/[-[\]{}()*+!<=:?.\/\\^$|#\s,]/g,'\\$&') +'(?=(?:(?:[^"]*"){2})*[^"]*$)','g'); } + col = col.trim().split(re) || [""]; + col = col.map(x => x.replace(/"/g,'').trim()); + if ((col.length === 1) && (col[0] === "")) { node.goodtmpl = false; } + else { node.goodtmpl = true; } + return col; } - if (msg.hasOwnProperty("payload")) { - if (typeof msg.payload == "object") { // convert object to CSV string - try { - if (!(notemplate && (msg.hasOwnProperty("parts") && msg.parts.hasOwnProperty("index") && msg.parts.index > 0))) { - template = clean(node.template); - } - var ou = ""; - if (!Array.isArray(msg.payload)) { msg.payload = [ msg.payload ]; } - if (node.hdrout !== "none" && node.hdrSent === false) { - if ((template.length === 1) && (template[0] === '')) { - if (msg.hasOwnProperty("columns")) { - template = clean(msg.columns || "",","); - } - else { - template = Object.keys(msg.payload[0]); - } + var template = clean(node.template,','); + var notemplate = template.length === 1 && template[0] === ''; + node.hdrSent = false; + + this.on("input", function(msg, send, done) { + if (msg.hasOwnProperty("reset")) { + node.hdrSent = false; + } + if (msg.hasOwnProperty("payload")) { + if (typeof msg.payload == "object") { // convert object to CSV string + try { + if (!(notemplate && (msg.hasOwnProperty("parts") && msg.parts.hasOwnProperty("index") && msg.parts.index > 0))) { + template = clean(node.template); } - ou += template.map(v => v.indexOf(node.sep)!==-1 ? '"'+v+'"' : v).join(node.sep) + node.ret; - if (node.hdrout === "once") { node.hdrSent = true; } - } - for (var s = 0; s < msg.payload.length; s++) { - if ((Array.isArray(msg.payload[s])) || (typeof msg.payload[s] !== "object")) { - if (typeof msg.payload[s] !== "object") { msg.payload = [ msg.payload ]; } - for (var t = 0; t < msg.payload[s].length; t++) { - if (msg.payload[s][t] === undefined) { msg.payload[s][t] = ""; } - if (msg.payload[s][t].toString().indexOf(node.quo) !== -1) { // add double quotes if any quotes - msg.payload[s][t] = msg.payload[s][t].toString().replace(/"/g, '""'); - msg.payload[s][t] = node.quo + msg.payload[s][t].toString() + node.quo; - } - else if (msg.payload[s][t].toString().indexOf(node.sep) !== -1) { // add quotes if any "commas" - msg.payload[s][t] = node.quo + msg.payload[s][t].toString() + node.quo; - } - else if (msg.payload[s][t].toString().indexOf("\n") !== -1) { // add quotes if any "\n" - msg.payload[s][t] = node.quo + msg.payload[s][t].toString() + node.quo; - } - } - ou += msg.payload[s].join(node.sep) + node.ret; - } - else { - if ((template.length === 1) && (template[0] === '') && (msg.hasOwnProperty("columns"))) { - template = clean(msg.columns || "",","); - } + const ou = []; + if (!Array.isArray(msg.payload)) { msg.payload = [ msg.payload ]; } + if (node.hdrout !== "none" && node.hdrSent === false) { if ((template.length === 1) && (template[0] === '')) { - /* istanbul ignore else */ - if (tmpwarn === true) { // just warn about missing template once - node.warn(RED._("csv.errors.obj_csv")); - tmpwarn = false; + if (msg.hasOwnProperty("columns")) { + template = clean(msg.columns || "",","); } - for (var p in msg.payload[0]) { + else { + template = Object.keys(msg.payload[0]); + } + } + ou.push(template.map(v => v.indexOf(node.sep)!==-1 ? '"'+v+'"' : v).join(node.sep)); + if (node.hdrout === "once") { node.hdrSent = true; } + } + for (var s = 0; s < msg.payload.length; s++) { + if ((Array.isArray(msg.payload[s])) || (typeof msg.payload[s] !== "object")) { + if (typeof msg.payload[s] !== "object") { msg.payload = [ msg.payload ]; } + for (var t = 0; t < msg.payload[s].length; t++) { + if (msg.payload[s][t] === undefined) { msg.payload[s][t] = ""; } + if (msg.payload[s][t].toString().indexOf(node.quo) !== -1) { // add double quotes if any quotes + msg.payload[s][t] = msg.payload[s][t].toString().replace(/"/g, '""'); + msg.payload[s][t] = node.quo + msg.payload[s][t].toString() + node.quo; + } + else if (msg.payload[s][t].toString().indexOf(node.sep) !== -1) { // add quotes if any "commas" + msg.payload[s][t] = node.quo + msg.payload[s][t].toString() + node.quo; + } + else if (msg.payload[s][t].toString().indexOf("\n") !== -1) { // add quotes if any "\n" + msg.payload[s][t] = node.quo + msg.payload[s][t].toString() + node.quo; + } + } + ou.push(msg.payload[s].join(node.sep)); + } + else { + if ((template.length === 1) && (template[0] === '') && (msg.hasOwnProperty("columns"))) { + template = clean(msg.columns || "",","); + } + if ((template.length === 1) && (template[0] === '')) { /* istanbul ignore else */ - if (msg.payload[s].hasOwnProperty(p)) { + if (tmpwarn === true) { // just warn about missing template once + node.warn(RED._("csv.errors.obj_csv")); + tmpwarn = false; + } + const row = []; + for (var p in msg.payload[0]) { /* istanbul ignore else */ - if (typeof msg.payload[s][p] !== "object") { - // Fix to honour include null values flag - //if (typeof msg.payload[s][p] !== "object" || (node.include_null_values === true && msg.payload[s][p] === null)) { - var q = ""; - if (msg.payload[s][p] !== undefined) { - q += msg.payload[s][p]; + if (msg.payload[s].hasOwnProperty(p)) { + /* istanbul ignore else */ + if (typeof msg.payload[s][p] !== "object") { + // Fix to honour include null values flag + //if (typeof msg.payload[s][p] !== "object" || (node.include_null_values === true && msg.payload[s][p] === null)) { + var q = ""; + if (msg.payload[s][p] !== undefined) { + q += msg.payload[s][p]; + } + if (q.indexOf(node.quo) !== -1) { // add double quotes if any quotes + q = q.replace(/"/g, '""'); + row.push(node.quo + q + node.quo); + } + else if (q.indexOf(node.sep) !== -1 || p.indexOf("\n") !== -1) { // add quotes if any "commas" or "\n" + row.push(node.quo + q + node.quo); + } + else { row.push(q); } // otherwise just add } - if (q.indexOf(node.quo) !== -1) { // add double quotes if any quotes - q = q.replace(/"/g, '""'); - ou += node.quo + q + node.quo + node.sep; - } - else if (q.indexOf(node.sep) !== -1 || p.indexOf("\n") !== -1) { // add quotes if any "commas" or "\n" - ou += node.quo + q + node.quo + node.sep; - } - else { ou += q + node.sep; } // otherwise just add } } + ou.push(row.join(node.sep)); // add separator } - ou = ou.slice(0,-1) + node.ret; + else { + const row = []; + for (var t=0; t < template.length; t++) { + if (template[t] === '') { + row.push(''); + } + else { + var tt = template[t]; + if (template[t].indexOf('"') >=0 ) { tt = "'"+tt+"'"; } + else { tt = '"'+tt+'"'; } + var p = RED.util.getMessageProperty(msg,'payload["'+s+'"]['+tt+']'); + /* istanbul ignore else */ + if (p === undefined) { p = ""; } + // fix to honour include null values flag + //if (p === null && node.include_null_values !== true) { p = "";} + p = RED.util.ensureString(p); + if (p.indexOf(node.quo) !== -1) { // add double quotes if any quotes + p = p.replace(/"/g, '""'); + row.push(node.quo + p + node.quo); + } + else if (p.indexOf(node.sep) !== -1 || p.indexOf("\n") !== -1) { // add quotes if any "commas" or "\n" + row.push(node.quo + p + node.quo); + } + else { row.push(p); } // otherwise just add + } + } + ou.push(row.join(node.sep)); // add separator + } + } + } + // join lines, don't forget to add the last new line + msg.payload = ou.join(node.ret) + node.ret; + msg.columns = template.map(v => v.indexOf(',')!==-1 ? '"'+v+'"' : v).join(','); + if (msg.payload !== '') { + send(msg); + } + done(); + } + catch(e) { done(e); } + } + else if (typeof msg.payload == "string") { // convert CSV string to object + try { + var f = true; // flag to indicate if inside or outside a pair of quotes true = outside. + var j = 0; // pointer into array of template items + var k = [""]; // array of data for each of the template items + var o = {}; // output object to build up + var a = []; // output array is needed for multiline option + var first = true; // is this the first line + var last = false; + var line = msg.payload; + var linecount = 0; + var tmp = ""; + var has_parts = msg.hasOwnProperty("parts"); + var reg = /^[-]?(?!E)(?!0\d)\d*\.?\d*(E-?\+?)?\d+$/i; + if (msg.hasOwnProperty("parts")) { + linecount = msg.parts.index; + if (msg.parts.index > node.skip) { first = false; } + if (msg.parts.hasOwnProperty("count") && (msg.parts.index+1 >= msg.parts.count)) { last = true; } + } + + // For now we are just going to assume that any \r or \n means an end of line... + // got to be a weird csv that has singleton \r \n in it for another reason... + + // Now process the whole file/line + var nocr = (line.match(/[\r\n]/g)||[]).length; + if (has_parts && node.multi === "mult" && nocr > 1) { tmp = ""; first = true; } + for (var i = 0; i < line.length; i++) { + if (first && (linecount < node.skip)) { + if (line[i] === "\n") { linecount += 1; } + continue; + } + if ((node.hdrin === true) && first) { // if the template is in the first line + if ((line[i] === "\n")||(line[i] === "\r")||(line.length - i === 1)) { // look for first line break + if (line.length - i === 1) { tmp += line[i]; } + template = clean(tmp,node.sep); + first = false; + } + else { tmp += line[i]; } } else { - for (var t=0; t < template.length; t++) { - if (template[t] === '') { - ou += node.sep; + if (line[i] === node.quo) { // if it's a quote toggle inside or outside + f = !f; + if (line[i-1] === node.quo) { + if (f === false) { k[j] += '\"'; } + } // if it's a quotequote then it's actually a quote + //if ((line[i-1] !== node.sep) && (line[i+1] !== node.sep)) { k[j] += line[i]; } + } + else if ((line[i] === node.sep) && f) { // if it is the end of the line then finish + if (!node.goodtmpl) { template[j] = "col"+(j+1); } + if ( template[j] && (template[j] !== "") ) { + // if no value between separators ('1,,"3"...') or if the line beings with separator (',1,"2"...') treat value as null + if (line[i-1] === node.sep || line[i-1].includes('\n','\r')) k[j] = null; + if ( (k[j] !== null && node.parsestrings === true) && reg.test(k[j].trim()) ) { k[j] = parseFloat(k[j].trim()); } + if (node.include_null_values && k[j] === null) o[template[j]] = k[j]; + if (node.include_empty_strings && k[j] === "") o[template[j]] = k[j]; + if (k[j] !== null && k[j] !== "") o[template[j]] = k[j]; } - else { - var tt = template[t]; - if (template[t].indexOf('"') >=0 ) { tt = "'"+tt+"'"; } - else { tt = '"'+tt+'"'; } - var p = RED.util.getMessageProperty(msg,'payload["'+s+'"]['+tt+']'); - /* istanbul ignore else */ - if (p === undefined) { p = ""; } - // fix to honour include null values flag - //if (p === null && node.include_null_values !== true) { p = "";} - p = RED.util.ensureString(p); - if (p.indexOf(node.quo) !== -1) { // add double quotes if any quotes - p = p.replace(/"/g, '""'); - ou += node.quo + p + node.quo + node.sep; - } - else if (p.indexOf(node.sep) !== -1 || p.indexOf("\n") !== -1) { // add quotes if any "commas" or "\n" - ou += node.quo + p + node.quo + node.sep; - } - else { ou += p + node.sep; } // otherwise just add + j += 1; + // if separator is last char in processing string line (without end of line), add null value at the end - example: '1,2,3\n3,"3",' + k[j] = line.length - 1 === i ? null : ""; + } + else if (((line[i] === "\n") || (line[i] === "\r")) && f) { // handle multiple lines + //console.log(j,k,o,k[j]); + if (!node.goodtmpl) { template[j] = "col"+(j+1); } + if ( template[j] && (template[j] !== "") ) { + // if separator before end of line, set null value ie. '1,2,"3"\n1,2,\n1,2,3' + if (line[i-1] === node.sep) k[j] = null; + if ( (k[j] !== null && node.parsestrings === true) && reg.test(k[j].trim()) ) { k[j] = parseFloat(k[j].trim()); } + else { if (k[j] !== null) k[j].replace(/\r$/,''); } + if (node.include_null_values && k[j] === null) o[template[j]] = k[j]; + if (node.include_empty_strings && k[j] === "") o[template[j]] = k[j]; + if (k[j] !== null && k[j] !== "") o[template[j]] = k[j]; } + if (JSON.stringify(o) !== "{}") { // don't send empty objects + a.push(o); // add to the array + } + j = 0; + k = [""]; + o = {}; + f = true; // reset in/out flag ready for next line. + } + else { // just add to the part of the message + k[j] += line[i]; } - ou = ou.slice(0,-1) + node.ret; // remove final "comma" and add "newline" } } - } - msg.payload = ou; - msg.columns = template.map(v => v.indexOf(',')!==-1 ? '"'+v+'"' : v).join(','); - if (msg.payload !== '') { send(msg); } - done(); - } - catch(e) { done(e); } - } - else if (typeof msg.payload == "string") { // convert CSV string to object - try { - var f = true; // flag to indicate if inside or outside a pair of quotes true = outside. - var j = 0; // pointer into array of template items - var k = [""]; // array of data for each of the template items - var o = {}; // output object to build up - var a = []; // output array is needed for multiline option - var first = true; // is this the first line - var last = false; - var line = msg.payload; - var linecount = 0; - var tmp = ""; - var has_parts = msg.hasOwnProperty("parts"); - var reg = /^[-]?(?!E)(?!0\d)\d*\.?\d*(E-?\+?)?\d+$/i; - if (msg.hasOwnProperty("parts")) { - linecount = msg.parts.index; - if (msg.parts.index > node.skip) { first = false; } - if (msg.parts.hasOwnProperty("count") && (msg.parts.index+1 >= msg.parts.count)) { last = true; } - } + // Finished so finalize and send anything left + if (f === false) { node.warn(RED._("csv.errors.bad_csv")); } + if (!node.goodtmpl) { template[j] = "col"+(j+1); } - // For now we are just going to assume that any \r or \n means an end of line... - // got to be a weird csv that has singleton \r \n in it for another reason... - - // Now process the whole file/line - var nocr = (line.match(/[\r\n]/g)||[]).length; - if (has_parts && node.multi === "mult" && nocr > 1) { tmp = ""; first = true; } - for (var i = 0; i < line.length; i++) { - if (first && (linecount < node.skip)) { - if (line[i] === "\n") { linecount += 1; } - continue; + if ( template[j] && (template[j] !== "") ) { + if ( (k[j] !== null && node.parsestrings === true) && reg.test(k[j].trim()) ) { k[j] = parseFloat(k[j].trim()); } + else { if (k[j] !== null) k[j].replace(/\r$/,''); } + if (node.include_null_values && k[j] === null) o[template[j]] = k[j]; + if (node.include_empty_strings && k[j] === "") o[template[j]] = k[j]; + if (k[j] !== null && k[j] !== "") o[template[j]] = k[j]; } - if ((node.hdrin === true) && first) { // if the template is in the first line - if ((line[i] === "\n")||(line[i] === "\r")||(line.length - i === 1)) { // look for first line break - if (line.length - i === 1) { tmp += line[i]; } - template = clean(tmp,node.sep); - first = false; - } - else { tmp += line[i]; } + + if (JSON.stringify(o) !== "{}") { // don't send empty objects + a.push(o); // add to the array } - else { - if (line[i] === node.quo) { // if it's a quote toggle inside or outside - f = !f; - if (line[i-1] === node.quo) { - if (f === false) { k[j] += '\"'; } - } // if it's a quotequote then it's actually a quote - //if ((line[i-1] !== node.sep) && (line[i+1] !== node.sep)) { k[j] += line[i]; } - } - else if ((line[i] === node.sep) && f) { // if it is the end of the line then finish - if (!node.goodtmpl) { template[j] = "col"+(j+1); } - if ( template[j] && (template[j] !== "") ) { - // if no value between separators ('1,,"3"...') or if the line beings with separator (',1,"2"...') treat value as null - if (line[i-1] === node.sep || line[i-1].includes('\n','\r')) k[j] = null; - if ( (k[j] !== null && node.parsestrings === true) && reg.test(k[j].trim()) ) { k[j] = parseFloat(k[j].trim()); } - if (node.include_null_values && k[j] === null) o[template[j]] = k[j]; - if (node.include_empty_strings && k[j] === "") o[template[j]] = k[j]; - if (k[j] !== null && k[j] !== "") o[template[j]] = k[j]; - } - j += 1; - // if separator is last char in processing string line (without end of line), add null value at the end - example: '1,2,3\n3,"3",' - k[j] = line.length - 1 === i ? null : ""; - } - else if (((line[i] === "\n") || (line[i] === "\r")) && f) { // handle multiple lines - //console.log(j,k,o,k[j]); - if (!node.goodtmpl) { template[j] = "col"+(j+1); } - if ( template[j] && (template[j] !== "") ) { - // if separator before end of line, set null value ie. '1,2,"3"\n1,2,\n1,2,3' - if (line[i-1] === node.sep) k[j] = null; - if ( (k[j] !== null && node.parsestrings === true) && reg.test(k[j].trim()) ) { k[j] = parseFloat(k[j].trim()); } - else { if (k[j] !== null) k[j].replace(/\r$/,''); } - if (node.include_null_values && k[j] === null) o[template[j]] = k[j]; - if (node.include_empty_strings && k[j] === "") o[template[j]] = k[j]; - if (k[j] !== null && k[j] !== "") o[template[j]] = k[j]; - } - if (JSON.stringify(o) !== "{}") { // don't send empty objects - a.push(o); // add to the array - } - j = 0; - k = [""]; - o = {}; - f = true; // reset in/out flag ready for next line. - } - else { // just add to the part of the message - k[j] += line[i]; - } - } - } - // Finished so finalize and send anything left - if (f === false) { node.warn(RED._("csv.errors.bad_csv")); } - if (!node.goodtmpl) { template[j] = "col"+(j+1); } - if ( template[j] && (template[j] !== "") ) { - if ( (k[j] !== null && node.parsestrings === true) && reg.test(k[j].trim()) ) { k[j] = parseFloat(k[j].trim()); } - else { if (k[j] !== null) k[j].replace(/\r$/,''); } - if (node.include_null_values && k[j] === null) o[template[j]] = k[j]; - if (node.include_empty_strings && k[j] === "") o[template[j]] = k[j]; - if (k[j] !== null && k[j] !== "") o[template[j]] = k[j]; - } - - if (JSON.stringify(o) !== "{}") { // don't send empty objects - a.push(o); // add to the array - } - - if (node.multi !== "one") { - msg.payload = a; - if (has_parts && nocr <= 1) { - if (JSON.stringify(o) !== "{}") { - node.store.push(o); + if (node.multi !== "one") { + msg.payload = a; + if (has_parts && nocr <= 1) { + if (JSON.stringify(o) !== "{}") { + node.store.push(o); + } + if (msg.parts.index + 1 === msg.parts.count) { + msg.payload = node.store; + msg.columns = template.map(v => v.indexOf(',')!==-1 ? '"'+v+'"' : v).filter(v => v).join(','); + delete msg.parts; + send(msg); + node.store = []; + } } - if (msg.parts.index + 1 === msg.parts.count) { - msg.payload = node.store; + else { msg.columns = template.map(v => v.indexOf(',')!==-1 ? '"'+v+'"' : v).filter(v => v).join(','); - delete msg.parts; - send(msg); - node.store = []; + send(msg); // finally send the array } } else { - msg.columns = template.map(v => v.indexOf(',')!==-1 ? '"'+v+'"' : v).filter(v => v).join(','); - send(msg); // finally send the array - } - } - else { - var len = a.length; - for (var i = 0; i < len; i++) { - var newMessage = RED.util.cloneMessage(msg); - newMessage.columns = template.map(v => v.indexOf(',')!==-1 ? '"'+v+'"' : v).filter(v => v).join(','); - newMessage.payload = a[i]; - if (!has_parts) { - newMessage.parts = { - id: msg._msgid, - index: i, - count: len - }; + var len = a.length; + for (var i = 0; i < len; i++) { + var newMessage = RED.util.cloneMessage(msg); + newMessage.columns = template.map(v => v.indexOf(',')!==-1 ? '"'+v+'"' : v).filter(v => v).join(','); + newMessage.payload = a[i]; + if (!has_parts) { + newMessage.parts = { + id: msg._msgid, + index: i, + count: len + }; + } + else { + newMessage.parts.index -= node.skip; + newMessage.parts.count -= node.skip; + if (node.hdrin) { // if we removed the header line then shift the counts by 1 + newMessage.parts.index -= 1; + newMessage.parts.count -= 1; + } + } + if (last) { newMessage.complete = true; } + send(newMessage); } - else { - newMessage.parts.index -= node.skip; - newMessage.parts.count -= node.skip; - if (node.hdrin) { // if we removed the header line then shift the counts by 1 - newMessage.parts.index -= 1; - newMessage.parts.count -= 1; + if (has_parts && last && len === 0) { + send({complete:true}); + } + } + node.linecount = 0; + done(); + } + catch(e) { done(e); } + } + else { node.warn(RED._("csv.errors.csv_js")); done(); } + } + else { + if (!msg.hasOwnProperty("reset")) { + node.send(msg); // If no payload and not reset - just pass it on. + } + done(); + } + }); + } + + if(RFC4180Mode) { + node.template = (n.temp || "") + node.sep = (n.sep || ',').replace(/\\t/g, "\t").replace(/\\n/g, "\n").replace(/\\r/g, "\r") + node.quo = '"' + // default to CRLF (RFC4180 Sec 2.1: "Each record is located on a separate line, delimited by a line break (CRLF)") + node.ret = (n.ret || "\r\n").replace(/\\n/g, "\n").replace(/\\r/g, "\r") + node.multi = n.multi || "one" + node.hdrin = n.hdrin || false + node.hdrout = n.hdrout || "none" + node.goodtmpl = true + node.skip = parseInt(n.skip || 0) + node.store = [] + node.parsestrings = n.strings + node.include_empty_strings = n.include_empty_strings || false + node.include_null_values = n.include_null_values || false + if (node.parsestrings === undefined) { node.parsestrings = true } + if (node.hdrout === false) { node.hdrout = "none" } + if (node.hdrout === true) { node.hdrout = "all" } + const dontSendHeaders = node.hdrout === "none" + const sendHeadersOnce = node.hdrout === "once" + const sendHeadersAlways = node.hdrout === "all" + const sendHeaders = !dontSendHeaders && (sendHeadersOnce || sendHeadersAlways) + const quoteables = [node.sep, node.quo, "\n", "\r"] + const templateQuoteables = [',', '"', "\n", "\r"] + let badTemplateWarnOnce = true + + const columnStringToTemplateArray = function (col, sep) { + // NOTE: enforce strict column template parsing in RFC4180 mode + const parsed = csv.parse(col, { separator: sep, quote: node.quo, outputStyle: 'array', strict: true }) + if (parsed.headers.length > 0) { node.goodtmpl = true } else { node.goodtmpl = false } + return parsed.headers.length ? parsed.headers : null + } + const templateArrayToColumnString = function (template, keepEmptyColumns) { + // NOTE: enforce strict column template parsing in RFC4180 mode + const parsed = csv.parse('', {headers: template, headersOnly:true, separator: ',', quote: node.quo, outputStyle: 'array', strict: true }) + return keepEmptyColumns + ? parsed.headers.map(e => addQuotes(e || '', { separator: ',', quoteables: templateQuoteables})) + : parsed.header // exclues empty columns + // TODO: resolve inconsistency between CSV->JSON and JSON->CSV + // CSV->JSON: empty columns are excluded + // JSON->CSV: empty columns are kept in some cases + } + function addQuotes(cell, options) { + options = options || {} + return csv.quoteCell(cell, { + quote: options.quote || node.quo || '"', + separator: options.separator || node.sep || ',', + quoteables: options.quoteables || quoteables + }) + } + const hasTemplate = (t) => t?.length > 0 && !(t.length === 1 && t[0] === '') + let template + try { + template = columnStringToTemplateArray(node.template, ',') || [''] + } catch (e) { + node.warn(RED._("csv.errors.bad_template")) // is warning really necessary now we have status? + node.status({ fill: "red", shape: "dot", text: RED._("csv.errors.bad_template") }) + return // dont hook up the node + } + const noTemplate = hasTemplate(template) === false + node.hdrSent = false + + node.on("input", function (msg, send, done) { + node.status({}) // clear status + if (msg.hasOwnProperty("reset")) { + node.hdrSent = false + } + if (msg.hasOwnProperty("payload")) { + let inputData = msg.payload + if (typeof inputData == "object") { // convert object to CSV string + try { + // first determine the payload kind. Array or objects? Array of primitives? Array of arrays? Just an object? + // then, if necessary, convert to an array of objects/arrays + let isObject = !Array.isArray(inputData) && typeof inputData === 'object' + let isArrayOfObjects = Array.isArray(inputData) && inputData.length > 0 && typeof inputData[0] === 'object' + let isArrayOfArrays = Array.isArray(inputData) && inputData.length > 0 && Array.isArray(inputData[0]) + let isArrayOfPrimitives = Array.isArray(inputData) && inputData.length > 0 && typeof inputData[0] !== 'object' + + if (isObject) { + inputData = [inputData] + isArrayOfObjects = true + isObject = false + } else if (isArrayOfPrimitives) { + inputData = [inputData] + isArrayOfArrays = true + isArrayOfPrimitives = false + } + + const stringBuilder = [] + if (!(noTemplate && (msg.hasOwnProperty("parts") && msg.parts.hasOwnProperty("index") && msg.parts.index > 0))) { + template = columnStringToTemplateArray(node.template) || [''] + } + + // build header line + if (sendHeaders && node.hdrSent === false) { + if (hasTemplate(template) === false) { + if (msg.hasOwnProperty("columns")) { + template = columnStringToTemplateArray(msg.columns || "", ",") || [''] + } + else { + template = Object.keys(inputData[0]) || [''] } } - if (last) { newMessage.complete = true; } - send(newMessage); + stringBuilder.push(templateArrayToColumnString(template, true)) + if (sendHeadersOnce) { node.hdrSent = true } } - if (has_parts && last && len === 0) { - send({complete:true}); + + // build csv lines + for (let s = 0; s < inputData.length; s++) { + let row = inputData[s] + if (isArrayOfArrays) { + /*** row is an array of arrays ***/ + const _hasTemplate = hasTemplate(template) + const len = _hasTemplate ? template.length : row.length + const result = [] + for (let t = 0; t < len; t++) { + let cell = row[t] + if (cell === undefined) { cell = "" } + if(_hasTemplate) { + const header = template[t] + if (header) { + result[t] = addQuotes(RED.util.ensureString(cell)) + } + } else { + result[t] = addQuotes(RED.util.ensureString(cell)) + } + } + stringBuilder.push(result.join(node.sep)) + } else { + /*** row is an object ***/ + if (hasTemplate(template) === false && (msg.hasOwnProperty("columns"))) { + template = columnStringToTemplateArray(msg.columns || "", ",") + } + if (hasTemplate(template) === false) { + /*** row is an object but we still don't have a template ***/ + if (badTemplateWarnOnce === true) { + node.warn(RED._("csv.errors.obj_csv")) + badTemplateWarnOnce = false + } + const rowData = [] + for (let header in inputData[0]) { + if (row.hasOwnProperty(header)) { + const cell = row[header] + if (typeof cell !== "object") { + let cellValue = "" + if (cell !== undefined) { + cellValue += cell + } + rowData.push(addQuotes(cellValue)) + } + } + } + stringBuilder.push(rowData.join(node.sep)) + } else { + /*** row is an object and we have a template ***/ + const rowData = [] + for (let t = 0; t < template.length; t++) { + if (!template[t]) { + rowData.push('') + } + else { + let cellValue = inputData[s][template[t]] + if (cellValue === undefined) { cellValue = "" } + cellValue = RED.util.ensureString(cellValue) + rowData.push(addQuotes(cellValue)) + } + } + stringBuilder.push(rowData.join(node.sep)); // add separator + } + } } + + // join lines, don't forget to add the last new line + msg.payload = stringBuilder.join(node.ret) + node.ret + msg.columns = templateArrayToColumnString(template) + if (msg.payload !== '') { send(msg) } + done() + } + catch (e) { + done(e) } - node.linecount = 0; - done(); } - catch(e) { done(e); } + else if (typeof inputData == "string") { // convert CSV string to object + try { + let firstLine = true; // is this the first line + let last = false + let linecount = 0 + const has_parts = msg.hasOwnProperty("parts") + + // determine if this is a multi part message and if so what part we are processing + if (msg.hasOwnProperty("parts")) { + linecount = msg.parts.index + if (msg.parts.index > node.skip) { firstLine = false } + if (msg.parts.hasOwnProperty("count") && (msg.parts.index + 1 >= msg.parts.count)) { last = true } + } + + // If skip is set, compute the cursor position to start parsing from + let _cursor = 0 + if (node.skip > 0 && linecount < node.skip) { + for (; _cursor < inputData.length; _cursor++) { + if (firstLine && (linecount < node.skip)) { + if (inputData[_cursor] === "\r" || inputData[_cursor] === "\n") { + linecount += 1 + } + continue + } + break + } + if (_cursor >= inputData.length) { + return // skip this line + } + } + + // count the number of line breaks in the string + const noofCR = ((_cursor ? inputData.slice(_cursor) : inputData).match(/[\r\n]/g) || []).length + + // if we have `parts` and we are outputting multiple objects and we have more than one line + // then we need to set firstLine to true so that we process the header line + if (has_parts && node.multi === "mult" && noofCR > 1) { + firstLine = true + } + + // if we are processing the first line and the node has been set to extract the header line + // update the template with the header line + if (firstLine && node.hdrin === true) { + /** @type {import('./lib/csv/index.js').CSVParseOptions} */ + const csvOptionsForHeaderRow = { + cursor: _cursor, + separator: node.sep, + quote: node.quo, + dataHasHeaderRow: true, + headersOnly: true, + outputStyle: 'array', + strict: true // enforce strict parsing of the header row + } + try { + const csvHeader = csv.parse(inputData, csvOptionsForHeaderRow) + template = csvHeader.headers + _cursor = csvHeader.cursor + } catch (e) { + // node.warn(RED._("csv.errors.bad_template")) // add warning? + node.status({ fill: "red", shape: "dot", text: RED._("csv.errors.bad_template") }) + throw e + } + } + + // now we process the data lines + /** @type {import('./lib/csv/index.js').CSVParseOptions} */ + const csvOptions = { + cursor: _cursor, + separator: node.sep, + quote: node.quo, + dataHasHeaderRow: false, + headers: hasTemplate(template) ? template : null, + outputStyle: 'object', + includeNullValues: node.include_null_values, + includeEmptyStrings: node.include_empty_strings, + parseNumeric: node.parsestrings, + strict: false // relax the strictness of the parser for data rows + } + const csvParseResult = csv.parse(inputData, csvOptions) + const data = csvParseResult.data + + // output results + if (node.multi !== "one") { + if (has_parts && noofCR <= 1) { + if (data.length > 0) { + node.store.push(...data) + } + if (msg.parts.index + 1 === msg.parts.count) { + msg.payload = node.store + msg.columns = csvParseResult.header + // msg._mode = 'RFC4180 mode' + delete msg.parts + send(msg) + node.store = [] + } + } + else { + msg.columns = csvParseResult.header + // msg._mode = 'RFC4180 mode' + msg.payload = data + send(msg); // finally send the array + } + } + else { + const len = data.length + for (let row = 0; row < len; row++) { + const newMessage = RED.util.cloneMessage(msg) + newMessage.columns = csvParseResult.header + newMessage.payload = data[row] + if (!has_parts) { + newMessage.parts = { + id: msg._msgid, + index: row, + count: len + } + } + else { + newMessage.parts.index -= node.skip + newMessage.parts.count -= node.skip + if (node.hdrin) { // if we removed the header line then shift the counts by 1 + newMessage.parts.index -= 1 + newMessage.parts.count -= 1 + } + } + if (last) { newMessage.complete = true } + // newMessage._mode = 'RFC4180 mode' + send(newMessage) + } + if (has_parts && last && len === 0) { + // send({complete:true, _mode: 'RFC4180 mode'}) + send({ complete: true }) + } + } + + node.linecount = 0 + done() + } + catch (e) { + done(e) + } + } + else { + // RFC-vs-legacy mode difference: In RFC mode, we throw catchable errors and provide a status message + const err = new Error(RED._("csv.errors.csv_js")) + node.status({ fill: "red", shape: "dot", text: err.message }) + done(err) + } } - else { node.warn(RED._("csv.errors.csv_js")); done(); } - } - else { - if (!msg.hasOwnProperty("reset")) { - node.send(msg); // If no payload and not reset - just pass it on. + else { + if (!msg.hasOwnProperty("reset")) { + node.send(msg); // If no payload and not reset - just pass it on. + } + done() } - done(); - } - }); + }) + } } - RED.nodes.registerType("csv",CSVNode); + + RED.nodes.registerType("csv",CSVNode) } diff --git a/packages/node_modules/@node-red/nodes/core/parsers/70-HTML.html b/packages/node_modules/@node-red/nodes/core/parsers/70-HTML.html index 4509dd054..3357ae011 100644 --- a/packages/node_modules/@node-red/nodes/core/parsers/70-HTML.html +++ b/packages/node_modules/@node-red/nodes/core/parsers/70-HTML.html @@ -41,8 +41,8 @@ color:"#DEBD5C", defaults: { name: {value:""}, - property: {value:"payload"}, - outproperty: {value:"payload"}, + property: {value:"payload", validate: RED.validators.typedInput({ type: 'msg', allowUndefined: true }) }, + outproperty: {value:"payload", validate: RED.validators.typedInput({ type: 'msg', allowUndefined: true }) }, tag: {value:""}, ret: {value:"html"}, as: {value:"single"} diff --git a/packages/node_modules/@node-red/nodes/core/parsers/70-JSON.html b/packages/node_modules/@node-red/nodes/core/parsers/70-JSON.html index 432835d5f..8c210f4ef 100644 --- a/packages/node_modules/@node-red/nodes/core/parsers/70-JSON.html +++ b/packages/node_modules/@node-red/nodes/core/parsers/70-JSON.html @@ -32,6 +32,7 @@ defaults: { name: {value:""}, property: {value:"payload",required:true, + validate: RED.validators.typedInput({ type: 'msg', allowUndefined: true}), label:RED._("node-red:json.label.property")}, action: {value:""}, pretty: {value:false} diff --git a/packages/node_modules/@node-red/nodes/core/parsers/70-XML.html b/packages/node_modules/@node-red/nodes/core/parsers/70-XML.html index 0a6499ccb..27f9795ef 100644 --- a/packages/node_modules/@node-red/nodes/core/parsers/70-XML.html +++ b/packages/node_modules/@node-red/nodes/core/parsers/70-XML.html @@ -27,7 +27,8 @@ defaults: { name: {value:""}, property: {value:"payload",required:true, - label:RED._("node-red:common.label.property")}, + label:RED._("node-red:common.label.property"), + validate: RED.validators.typedInput({ type: 'msg', allowUndefined: true })}, attr: {value:""}, chr: {value:""} }, diff --git a/packages/node_modules/@node-red/nodes/core/parsers/70-YAML.html b/packages/node_modules/@node-red/nodes/core/parsers/70-YAML.html index d456fd7f3..a4c0d4de9 100644 --- a/packages/node_modules/@node-red/nodes/core/parsers/70-YAML.html +++ b/packages/node_modules/@node-red/nodes/core/parsers/70-YAML.html @@ -16,6 +16,7 @@ color:"#DEBD5C", defaults: { property: {value:"payload",required:true, + validate: RED.validators.typedInput({ type: 'msg', allowUndefined: true }), label:RED._("node-red:common.label.property")}, name: {value:""} }, diff --git a/packages/node_modules/@node-red/nodes/core/parsers/lib/csv/index.js b/packages/node_modules/@node-red/nodes/core/parsers/lib/csv/index.js new file mode 100644 index 000000000..73cf4b292 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/core/parsers/lib/csv/index.js @@ -0,0 +1,324 @@ + +/** + * @typedef {Object} CSVParseOptions + * @property {number} [cursor=0] - an index into the CSV to start parsing from + * @property {string} [separator=','] - the separator character + * @property {string} [quote='"'] - the quote character + * @property {boolean} [headersOnly=false] - only parse the headers and return them + * @property {string[]} [headers=[]] - an array of headers to use instead of the first row of the CSV data + * @property {boolean} [dataHasHeaderRow=true] - whether the CSV data to parse has a header row + * @property {boolean} [outputHeader=true] - whether the output data should include a header row (only applies to array output) + * @property {boolean} [parseNumeric=false] - parse numeric values into numbers + * @property {boolean} [includeNullValues=false] - include null values in the output + * @property {boolean} [includeEmptyStrings=true] - include empty strings in the output + * @property {string} [outputStyle='object'] - output an array of arrays or an array of objects + * @property {boolean} [strict=false] - throw an error if the CSV is malformed + */ + +/** + * Parses a CSV string into an array of arrays or an array of objects. + * + * NOTES: + * * Deviations from the RFC4180 spec (for the sake of user fiendliness, system implementations and flexibility), this parser will: + * * accept any separator character, not just `,` + * * accept any quote character, not just `"` + * * parse `\r`, `\n` or `\r\n` as line endings (RRFC4180 2.1 states lines are separated by CRLF) + * * Only single character `quote` is supported + * * `quote` is `"` by default + * * Any cell that contains a `quote` or `separator` will be quoted + * * Any `quote` characters inside a cell will be escaped as per RFC 4180 2.6 + * * Only single character `separator` is supported + * * Only `array` and `object` output styles are supported + * * `array` output style is an array of arrays [[],[],[]] + * * `object` output style is an array of objects [{},{},{}] + * * Only `headers` or `dataHasHeaderRow` are supported, not both + * @param {string} csvIn - the CSV string to parse + * @param {CSVParseOptions} parseOptions - options + * @throws {Error} + */ +function parse(csvIn, parseOptions) { + /* Normalise options */ + parseOptions = parseOptions || {}; + const separator = parseOptions.separator ?? ','; + const quote = parseOptions.quote ?? '"'; + const headersOnly = parseOptions.headersOnly ?? false; + const headers = Array.isArray(parseOptions.headers) ? parseOptions.headers : [] + const dataHasHeaderRow = parseOptions.dataHasHeaderRow ?? true; + const outputHeader = parseOptions.outputHeader ?? true; + const parseNumeric = parseOptions.parseNumeric ?? false; + const includeNullValues = parseOptions.includeNullValues ?? false; + const includeEmptyStrings = parseOptions.includeEmptyStrings ?? true; + const outputStyle = ['array', 'object'].includes(parseOptions.outputStyle) ? parseOptions.outputStyle : 'object'; // 'array [[],[],[]]' or 'object [{},{},{}] + const strict = parseOptions.strict ?? false + + /* Local variables */ + const cursorMax = csvIn.length; + const ouputArrays = outputStyle === 'array'; + const headersSupplied = headers.length > 0 + // The original regex was an "is-a-number" positive logic test. /^ *[-]?(?!E)(?!0\d)\d*\.?\d*(E-?\+?)?\d+ *$/i; + // Below, is less strict and inverted logic but coupled with +cast it is 13%+ faster than original regex+parsefloat + // and has the benefit of understanding hexadecimals, binary and octal numbers. + const skipNumberConversion = /^ *(\+|-0\d|0\d)/ + const cellBuilder = [] + let rowBuilder = [] + let cursor = typeof parseOptions.cursor === 'number' ? parseOptions.cursor : 0; + let newCell = true, inQuote = false, closed = false, output = []; + + /* inline helper functions */ + const finaliseCell = () => { + let cell = cellBuilder.join('') + cellBuilder.length = 0 + // push the cell: + // NOTE: if cell is empty but newCell==true, then this cell had zero chars - push `null` + // otherwise push empty string + return rowBuilder.push(cell || (newCell ? null : '')) + } + const finaliseRow = () => { + if (cellBuilder.length) { + finaliseCell() + } + if (rowBuilder.length) { + output.push(rowBuilder) + rowBuilder = [] + } + } + + /* Main parsing loop */ + while (cursor < cursorMax) { + const char = csvIn[cursor] + if (inQuote) { + if (char === quote && csvIn[cursor + 1] === quote) { + cellBuilder.push(quote) + cursor += 2; + newCell = false; + closed = false; + } else if (char === quote) { + inQuote = false; + cursor += 1; + newCell = false; + closed = true; + } else { + cellBuilder.push(char) + newCell = false; + closed = false; + cursor++; + } + } else { + if (char === separator) { + finaliseCell() + cursor += 1; + newCell = true; + closed = false; + } else if (char === quote) { + if (newCell) { + inQuote = true; + cursor += 1; + newCell = false; + closed = false; + } + else if (strict) { + throw new UnquotedQuoteError(cursor) + } else { + // not strict, keep 1 quote if the next char is not a cell/record separator + cursor++ + if (csvIn[cursor] && csvIn[cursor] !== '\n' && csvIn[cursor] !== '\r' && csvIn[cursor] !== separator) { + cellBuilder.push(char) + if (csvIn[cursor] === quote) { + cursor++ // skip the next quote + } + } + } + } else { + if (char === '\n' || char === '\r') { + finaliseRow() + if (csvIn[cursor + 1] === '\n') { + cursor += 2; + } else { + cursor++ + } + newCell = true; + closed = false; + if (headersOnly) { + break + } + } else { + if (closed) { + if (strict) { + throw new DataAfterCloseError(cursor) + } else { + cursor--; // move back to grab the previously discarded char + closed = false + } + } else { + cellBuilder.push(char) + newCell = false; + cursor++; + } + } + } + } + } + if (strict && inQuote) { + throw new ParseError(`Missing quote, unclosed cell`, cursor) + } + // finalise the last cell/row + finaliseRow() + let firstRowIsHeader = false + // if no headers supplied, generate them + if (output.length >= 1) { + if (headersSupplied) { + // headers already supplied + } else if (dataHasHeaderRow) { + // take the first row as the headers + headers.push(...output[0]) + firstRowIsHeader = true + } else { + // generate headers col1, col2, col3, etc + for (let i = 0; i < output[0].length; i++) { + headers.push("col" + (i + 1)) + } + } + } + + const finalResult = { + /** @type {String[]} headers as an array of string */ + headers: headers, + /** @type {String} headers as a comma-separated string */ + header: null, + /** @type {Any[]} Result Data (may include header row: check `firstRowIsHeader` flag) */ + data: [], + /** @type {Boolean|undefined} flag to indicate if the first row is a header row (only applies when `outputStyle` is 'array') */ + firstRowIsHeader: undefined, + /** @type {'array'|'object'} flag to indicate the output style */ + outputStyle: outputStyle, + /** @type {Number} The current cursor position */ + cursor: cursor, + } + + const quotedHeaders = [] + for (let i = 0; i < headers.length; i++) { + if (!headers[i]) { + continue + } + quotedHeaders.push(quoteCell(headers[i], { quote, separator: ',' })) + } + finalResult.header = quotedHeaders.join(',') // always quote headers and join with comma + + // output is an array of arrays [[],[],[]] + if (ouputArrays || headersOnly) { + if (!firstRowIsHeader && !headersOnly && outputHeader && headers.length > 0) { + if (output.length > 0) { + output.unshift(headers) + } else { + output = [headers] + } + firstRowIsHeader = true + } + if (headersOnly) { + delete finalResult.firstRowIsHeader + return finalResult + } + finalResult.firstRowIsHeader = firstRowIsHeader + finalResult.data = (firstRowIsHeader && !outputHeader) ? output.slice(1) : output + return finalResult + } + + // output is an array of objects [{},{},{}] + const outputObjects = [] + let i = firstRowIsHeader ? 1 : 0 + for (; i < output.length; i++) { + const rowObject = {} + let isEmpty = true + for (let j = 0; j < headers.length; j++) { + if (!headers[j]) { + continue + } + let v = output[i][j] === undefined ? null : output[i][j] + if (v === null && !includeNullValues) { + continue + } else if (v === "" && !includeEmptyStrings) { + continue + } else if (parseNumeric === true && v && !skipNumberConversion.test(v)) { + const vTemp = +v + const isNumber = !isNaN(vTemp) + if(isNumber) { + v = vTemp + } + } + rowObject[headers[j]] = v + isEmpty = false + } + // determine if this row is empty + if (!isEmpty) { + outputObjects.push(rowObject) + } + } + finalResult.data = outputObjects + delete finalResult.firstRowIsHeader + return finalResult +} + +/** + * Quotes a cell in a CSV string if necessary. Addiionally, any double quotes inside the cell will be escaped as per RFC 4180 2.6 (https://datatracker.ietf.org/doc/html/rfc4180#section-2). + * @param {string} cell - the string to quote + * @param {*} options - options + * @param {string} [options.quote='"'] - the quote character + * @param {string} [options.separator=','] - the separator character + * @param {string[]} [options.quoteables] - an array of characters that, when encountered, will trigger the application of outer quotes + * @returns + */ +function quoteCell(cell, { quote = '"', separator = ",", quoteables } = { + quote: '"', + separator: ",", + quoteables: [quote, separator, '\r', '\n'] + }) { + quoteables = quoteables || [quote, separator, '\r', '\n']; + + let doubleUp = false; + if (cell.indexOf(quote) !== -1) { // add double quotes if any quotes + doubleUp = true; + } + const quoteChar = quoteables.some(q => cell.includes(q)) ? quote : ''; + return quoteChar + (doubleUp ? cell.replace(/"/g, '""') : cell) + quoteChar; +} + +// #region Custom Error Classes +class ParseError extends Error { + /** + * @param {string} message - the error message + * @param {number} cursor - the cursor index where the error occurred + */ + constructor(message, cursor) { + super(message) + this.name = 'ParseError' + this.cursor = cursor + } +} + +class UnquotedQuoteError extends ParseError { + /** + * @param {number} cursor - the cursor index where the error occurred + */ + constructor(cursor) { + super('Quote found in the middle of an unquoted field', cursor) + this.name = 'UnquotedQuoteError' + } +} + +class DataAfterCloseError extends ParseError { + /** + * @param {number} cursor - the cursor index where the error occurred + */ + constructor(cursor) { + super('Data found after closing quote', cursor) + this.name = 'DataAfterCloseError' + } +} + +// #endregion + +exports.parse = parse +exports.quoteCell = quoteCell +exports.ParseError = ParseError +exports.UnquotedQuoteError = UnquotedQuoteError +exports.DataAfterCloseError = DataAfterCloseError diff --git a/packages/node_modules/@node-red/nodes/core/sequence/17-split.html b/packages/node_modules/@node-red/nodes/core/sequence/17-split.html index 053c534c4..c71d7ad84 100644 --- a/packages/node_modules/@node-red/nodes/core/sequence/17-split.html +++ b/packages/node_modules/@node-red/nodes/core/sequence/17-split.html @@ -60,7 +60,7 @@ arraySplt: {value:1}, arraySpltType: {value:"len"}, stream: {value:false}, - addname: {value:""}, + addname: {value:"", validate: RED.validators.typedInput({ type: 'msg', allowBlank: true })}, property: {value:"payload",required:true} }, inputs:1, @@ -216,7 +216,22 @@ validate:RED.validators.typedInput("propertyType", false) }, propertyType: { value:"msg"}, - key: {value:"topic"}, + key: {value:"topic", validate: (function () { + const typeValidator = RED.validators.typedInput({ type: 'msg' }) + return function(v, opt) { + const joinMode = $("#node-input-mode").val() || this.mode + if (joinMode !== 'custom') { + return true + } + const buildType = $("#node-input-build").val() || this.build + if (buildType !== 'object') { + return true + } else { + return typeValidator(v, opt) + } + } + })() + }, joiner: { value:"\\n"}, joinerType: { value:"str"}, accumulate: { value:"false" }, diff --git a/packages/node_modules/@node-red/nodes/core/storage/10-file.html b/packages/node_modules/@node-red/nodes/core/storage/10-file.html index 6b19ebaa8..57d028ead 100644 --- a/packages/node_modules/@node-red/nodes/core/storage/10-file.html +++ b/packages/node_modules/@node-red/nodes/core/storage/10-file.html @@ -198,7 +198,7 @@ category: 'storage', defaults: { name: {value:""}, - filename: {value:""}, + filename: {value:"", validate: RED.validators.typedInput({ typeField: 'filenameType' })}, filenameType: {value:"str"}, appendNewline: {value:true}, createDir: {value:false}, @@ -297,7 +297,7 @@ category: 'storage', defaults: { name: {value:""}, - filename: {value:""}, + filename: {value:"", validate: RED.validators.typedInput({ typeField: 'filenameType' }) }, filenameType: {value:"str"}, format: {value:"utf8"}, chunk: {value:false}, diff --git a/packages/node_modules/@node-red/nodes/icons/arduino.png b/packages/node_modules/@node-red/nodes/icons/arduino.png deleted file mode 100644 index 43e7d4be6..000000000 Binary files a/packages/node_modules/@node-red/nodes/icons/arduino.png and /dev/null differ diff --git a/packages/node_modules/@node-red/nodes/icons/arduino.svg b/packages/node_modules/@node-red/nodes/icons/arduino.svg new file mode 100644 index 000000000..f3ca11394 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/icons/arduino.svg @@ -0,0 +1 @@ + diff --git a/packages/node_modules/@node-red/nodes/icons/bluetooth.png b/packages/node_modules/@node-red/nodes/icons/bluetooth.png deleted file mode 100644 index 1967b064f..000000000 Binary files a/packages/node_modules/@node-red/nodes/icons/bluetooth.png and /dev/null differ diff --git a/packages/node_modules/@node-red/nodes/icons/bluetooth.svg b/packages/node_modules/@node-red/nodes/icons/bluetooth.svg new file mode 100644 index 000000000..c94bfb7d1 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/icons/bluetooth.svg @@ -0,0 +1 @@ + diff --git a/packages/node_modules/@node-red/nodes/icons/leveldb.png b/packages/node_modules/@node-red/nodes/icons/leveldb.png deleted file mode 100644 index 55760c7dc..000000000 Binary files a/packages/node_modules/@node-red/nodes/icons/leveldb.png and /dev/null differ diff --git a/packages/node_modules/@node-red/nodes/icons/leveldb.svg b/packages/node_modules/@node-red/nodes/icons/leveldb.svg new file mode 100644 index 000000000..acede633f --- /dev/null +++ b/packages/node_modules/@node-red/nodes/icons/leveldb.svg @@ -0,0 +1 @@ + diff --git a/packages/node_modules/@node-red/nodes/icons/mongodb.png b/packages/node_modules/@node-red/nodes/icons/mongodb.png deleted file mode 100644 index 3a1fc11be..000000000 Binary files a/packages/node_modules/@node-red/nodes/icons/mongodb.png and /dev/null differ diff --git a/packages/node_modules/@node-red/nodes/icons/mongodb.svg b/packages/node_modules/@node-red/nodes/icons/mongodb.svg new file mode 100644 index 000000000..9eb199a0d --- /dev/null +++ b/packages/node_modules/@node-red/nodes/icons/mongodb.svg @@ -0,0 +1 @@ + diff --git a/packages/node_modules/@node-red/nodes/icons/mouse.png b/packages/node_modules/@node-red/nodes/icons/mouse.png deleted file mode 100644 index 5d324d294..000000000 Binary files a/packages/node_modules/@node-red/nodes/icons/mouse.png and /dev/null differ diff --git a/packages/node_modules/@node-red/nodes/icons/mouse.svg b/packages/node_modules/@node-red/nodes/icons/mouse.svg new file mode 100644 index 000000000..153bcb335 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/icons/mouse.svg @@ -0,0 +1 @@ + diff --git a/packages/node_modules/@node-red/nodes/icons/rbe.png b/packages/node_modules/@node-red/nodes/icons/rbe.png deleted file mode 100644 index bc397210a..000000000 Binary files a/packages/node_modules/@node-red/nodes/icons/rbe.png and /dev/null differ diff --git a/packages/node_modules/@node-red/nodes/icons/rbe.svg b/packages/node_modules/@node-red/nodes/icons/rbe.svg new file mode 100644 index 000000000..2620abaa4 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/icons/rbe.svg @@ -0,0 +1 @@ + diff --git a/packages/node_modules/@node-red/nodes/icons/redis.png b/packages/node_modules/@node-red/nodes/icons/redis.png deleted file mode 100644 index 92e82fd26..000000000 Binary files a/packages/node_modules/@node-red/nodes/icons/redis.png and /dev/null differ diff --git a/packages/node_modules/@node-red/nodes/icons/redis.svg b/packages/node_modules/@node-red/nodes/icons/redis.svg new file mode 100644 index 000000000..0ea6d4e00 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/icons/redis.svg @@ -0,0 +1 @@ + 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 634432e37..1f07a868d 100644 --- a/packages/node_modules/@node-red/nodes/locales/en-US/messages.json +++ b/packages/node_modules/@node-red/nodes/locales/en-US/messages.json @@ -849,7 +849,13 @@ "newline": "Newline", "usestrings": "parse numerical values", "include_empty_strings": "include empty strings", - "include_null_values": "include null values" + "include_null_values": "include null values", + "spec": "Parser" + }, + "spec": { + "rfc": "RFC4180", + "legacy": "Legacy", + "legacy_warning": "Legacy mode will be removed in a future release." }, "placeholder": { "columns": "comma-separated column names" @@ -878,6 +884,7 @@ "once": "send headers once, until msg.reset" }, "errors": { + "bad_template": "Malformed columns template.", "csv_js": "This node only handles CSV strings or js objects.", "obj_csv": "No columns template specified for object -> CSV.", "bad_csv": "Malformed CSV data - output probably corrupt." 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 173f003f7..708df0449 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 @@ -30,6 +30,8 @@ before being sent.

    If msg._session is not present the payload is sent to all connected clients.

    +

    In Reply-to mode, setting msg.reset = true will reset the connection + specified by _session.id, or all connections if no _session.id is specified.

    Note: On some systems you may need root or administrator access to access ports below 1024.

    @@ -40,6 +42,8 @@ returned characters into a fixed buffer, match a specified character before returning, wait a fixed timeout from first reply and then return, sit and wait for data, or send then close the connection immediately, without waiting for a reply.

    +

    If in sit and wait mode (remain connected) you can send msg.reset = true or msg.reset = "host:port" to force a break in + the connection and an automatic reconnection.

    The response will be output in msg.payload as a buffer, so you may want to .toString() it.

    If you leave tcp host or port blank they must be set by using the msg.host and msg.port properties in every message sent to the node.

    diff --git a/packages/node_modules/@node-red/nodes/locales/en-US/parsers/70-CSV.html b/packages/node_modules/@node-red/nodes/locales/en-US/parsers/70-CSV.html index baa3b036b..56b6d7cca 100644 --- a/packages/node_modules/@node-red/nodes/locales/en-US/parsers/70-CSV.html +++ b/packages/node_modules/@node-red/nodes/locales/en-US/parsers/70-CSV.html @@ -36,7 +36,9 @@

    Details

    The column template can contain an ordered list of column names. When converting CSV to an object, the column names - will be used as the property names. Alternatively, the column names can be taken from the first row of the CSV.

    + will be used as the property names. Alternatively, the column names can be taken from the first row of the CSV. +

    When the RFC parser is selected, the column template must be compliant with RFC4180.

    +

    When converting to CSV, the columns template is used to identify which properties to extract from the object and in what order.

    If the columns template is blank then you can use a simple comma separated list of properties supplied in msg.columns to determine what to extract and in what order. If neither are present then all the object properties are output in the order @@ -49,4 +51,5 @@

    If outputting multiple messages they will have their parts property set and form a complete message sequence.

    If the node is set to only send column headers once, then setting msg.reset to any value will cause the node to resend the headers.

    Note: the column template must be comma separated - even if a different separator is chosen for the data.

    +

    Note: in RFC mode, catchable errors will be thrown for malformed CSV headers and invalid input payload data

    diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/common/20-inject.html b/packages/node_modules/@node-red/nodes/locales/es-ES/common/20-inject.html new file mode 100644 index 000000000..3a749dce1 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/common/20-inject.html @@ -0,0 +1,37 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/common/21-debug.html b/packages/node_modules/@node-red/nodes/locales/es-ES/common/21-debug.html new file mode 100644 index 000000000..884f292bf --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/common/21-debug.html @@ -0,0 +1,26 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/common/24-complete.html b/packages/node_modules/@node-red/nodes/locales/es-ES/common/24-complete.html new file mode 100644 index 000000000..6a2fb9671 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/common/24-complete.html @@ -0,0 +1,24 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/common/25-catch.html b/packages/node_modules/@node-red/nodes/locales/es-ES/common/25-catch.html new file mode 100644 index 000000000..c575eaa89 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/common/25-catch.html @@ -0,0 +1,36 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/common/25-status.html b/packages/node_modules/@node-red/nodes/locales/es-ES/common/25-status.html new file mode 100644 index 000000000..7f5c2e590 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/common/25-status.html @@ -0,0 +1,34 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/common/60-link.html b/packages/node_modules/@node-red/nodes/locales/es-ES/common/60-link.html new file mode 100644 index 000000000..461ab4299 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/common/60-link.html @@ -0,0 +1,53 @@ + + + + + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/common/90-comment.html b/packages/node_modules/@node-red/nodes/locales/es-ES/common/90-comment.html new file mode 100644 index 000000000..b5e589b90 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/common/90-comment.html @@ -0,0 +1,21 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/common/91-global-config.html b/packages/node_modules/@node-red/nodes/locales/es-ES/common/91-global-config.html new file mode 100644 index 000000000..65917b249 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/common/91-global-config.html @@ -0,0 +1,3 @@ + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/common/98-unknown.html b/packages/node_modules/@node-red/nodes/locales/es-ES/common/98-unknown.html new file mode 100644 index 000000000..ec6fdd1e0 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/common/98-unknown.html @@ -0,0 +1,24 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/function/10-function.html b/packages/node_modules/@node-red/nodes/locales/es-ES/function/10-function.html new file mode 100644 index 000000000..41be86499 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/function/10-function.html @@ -0,0 +1,55 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/function/10-switch.html b/packages/node_modules/@node-red/nodes/locales/es-ES/function/10-switch.html new file mode 100644 index 000000000..5aaf75679 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/function/10-switch.html @@ -0,0 +1,37 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/function/15-change.html b/packages/node_modules/@node-red/nodes/locales/es-ES/function/15-change.html new file mode 100644 index 000000000..268071815 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/function/15-change.html @@ -0,0 +1,33 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/function/16-range.html b/packages/node_modules/@node-red/nodes/locales/es-ES/function/16-range.html new file mode 100644 index 000000000..c8b1b1fae --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/function/16-range.html @@ -0,0 +1,42 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/function/80-template.html b/packages/node_modules/@node-red/nodes/locales/es-ES/function/80-template.html new file mode 100644 index 000000000..a63ebcb1a --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/function/80-template.html @@ -0,0 +1,51 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/function/89-delay.html b/packages/node_modules/@node-red/nodes/locales/es-ES/function/89-delay.html new file mode 100644 index 000000000..63830a09a --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/function/89-delay.html @@ -0,0 +1,39 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/function/89-trigger.html b/packages/node_modules/@node-red/nodes/locales/es-ES/function/89-trigger.html new file mode 100644 index 000000000..97f8da6b4 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/function/89-trigger.html @@ -0,0 +1,37 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/function/90-exec.html b/packages/node_modules/@node-red/nodes/locales/es-ES/function/90-exec.html new file mode 100644 index 000000000..7fffd844e --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/function/90-exec.html @@ -0,0 +1,75 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/function/rbe.html b/packages/node_modules/@node-red/nodes/locales/es-ES/function/rbe.html new file mode 100644 index 000000000..e0aac139e --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/function/rbe.html @@ -0,0 +1,32 @@ + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/messages.json b/packages/node_modules/@node-red/nodes/locales/es-ES/messages.json new file mode 100644 index 000000000..b8ac84f1c --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/messages.json @@ -0,0 +1,1146 @@ +{ + "common": { + "label": { + "payload": "Carga", + "topic": "Tema", + "name": "Nombre", + "username": "Usuario", + "password": "Contraseña", + "property": "Propiedad", + "selectNodes": "Selecciona nodos...", + "expand": "Expandir" + }, + "status": { + "connected": "conectado", + "not-connected": "no conectado", + "disconnected": "desconectado", + "connecting": "conectando", + "error": "error", + "ok": "Vale" + }, + "notification": { + "error": "Error: __message__", + "errors": { + "not-deployed": "nodo no instanciado", + "no-response": "sin respuesta del servidor", + "unexpected": "error inesperado (__status__) __message__" + } + }, + "errors": { + "nooverride": "Advertencia: las propiedades de mensaje ya no pueden anular las propiedades del nodo establecido. Consulta bit.ly/nr-override-msg-props" + } + }, + "inject": { + "inject": "inyectar", + "injectNow": "inyectar ahora", + "repeat": "repetir = __repeat__", + "crontab": "crontab = __crontab__", + "stopped": "detenido", + "failed": "Inyección fallida: __error__", + "label": { + "properties": "Propiedades", + "repeat": "Repetir", + "flow": "contexto de flujo ", + "global": "contexto global", + "str": "texto", + "num": "número", + "bool": "booleano", + "json": "objeto", + "bin": "buffer", + "date": "marca tiempo", + "env": "variable entorno", + "object": "objeto", + "string": "texto", + "boolean": "booleano", + "number": "número", + "Array": "matriz", + "invalid": "Objeto JSON no válido" + }, + "timestamp": "marca tiempo", + "none": "ninguno", + "interval": "intervalo", + "interval-time": "intervalo entre tiempos", + "time": "en un momento determinado", + "seconds": "segundos", + "minutes": "minutos", + "hours": "horas", + "between": "entre", + "previous": "valor anterior", + "at": "en", + "and": "y", + "every": "cada", + "days": [ + "Lunes", + "Martes", + "Miércoles", + "Jueves", + "Viernes", + "Sábado", + "Domingo" + ], + "on": "en", + "onstart": "Inyectar una vez después de", + "onceDelay": "segundos, entonces", + "success": "Inyectado con éxito: __label__", + "errors": { + "failed": "inyección fallida, ver registro para más detalles", + "toolong": "Intervalo demasiado grande", + "invalid-expr": "Expresión JSONata no válida: __error__", + "invalid-jsonata": "__prop__: expresión de propiedad no válida: __error__", + "invalid-prop": "__prop__: expresión de propiedad no válida: __error__", + "invalid-json": "__prop__: datos JSON no válidos: __error__", + "invalid-repeat": "Valor de repetición no válido" + } + }, + "catch": { + "catch": "captura: todos", + "catchGroup": "captura: grupo", + "catchNodes": "captura: __number__", + "catchUncaught": "captura: no capturado", + "label": { + "source": "Capturar errores de", + "selectAll": "selecciona todos", + "uncaught": "Ignorar los errores gestionados por otros nodos capturados" + }, + "scope": { + "all": "todos los nodos", + "group": "en el mismo grupo", + "selected": "nodos seleccionados" + } + }, + "status": { + "status": "estado: todo", + "statusGroup": "estado: grupo", + "statusNodes": "estado: __number__", + "label": { + "source": "Informar estado de", + "sortByType": "ordenar por tipo" + }, + "scope": { + "all": "todos los nodos", + "group": "en el mismo grupo", + "selected": "nodos seleccionados" + } + }, + "complete": { + "completeNodes": "completado: __number__", + "errors": { + "scopeUndefined": "ámbito indefinido" + } + }, + "debug": { + "output": "Salida", + "status": "estado", + "none": "Ninguno", + "invalid-exp": "Expresión JSONata no válida: __error__", + "msgprop": "propiedad del mensaje", + "msgobj": "mensaje completo", + "autostatus": "igual que la salida de depuración", + "messageCount": "recuento de mensajes", + "to": "A", + "debtab": "pestaña depuración", + "tabcon": "pestaña depuración y consola", + "toSidebar": "ventana depuración", + "toConsole": "consola sistema", + "toStatus": "estado nodo (32 caracteres)", + "severity": "Nivel", + "node": "nodo", + "notification": { + "activated": "Activado correctamente: __label__", + "deactivated": "desactivado correctamente: __label__" + }, + "sidebar": { + "label": "depuración", + "name": "Mensajes de depuración", + "filterAll": "todos los nodos", + "filterSelected": "nodos seleccionados", + "filterCurrent": "flujo actual", + "debugNodes": "Nodos depuración", + "clearLog": "Vaciar mensajes", + "clearFilteredLog": "Vaciar mensajes filtrados", + "filterLog": "Filtrar mensajes", + "openWindow": "Abrir en nueva ventana", + "copyPath": "Copiar ruta", + "copyPayload": "Copiar valor", + "pinPath": "Fijos abierto", + "selectAll": "seleccionar todo", + "selectNone": "seleccionar ninguno", + "all": "todo", + "filtered": "filtrado" + }, + "messageMenu": { + "collapseAll": "Colapsar todas las rutas", + "clearPinned": "Colapsar las rutas fijadas", + "filterNode": "Filtrar este nodo", + "clearFilter": "Limpiar filtro" + } + }, + "link": { + "linkIn": "enlace de entrada", + "linkOut": "enlace de salida", + "linkCall": "llamada a enlace", + "linkOutReturn": "resultado enlace", + "outMode": "Modo", + "sendToAll": "Enviar a todos los nodos de enlace conectados", + "returnToCaller": "Volver al nodo de enlace de llamada", + "timeout": "tiempo de espera", + "linkCallType": "Tipo Enlace", + "staticLinkCall": "Destino fijo", + "dynamicLinkCall": "Destino Dinámico (msg.target)", + "dynamicLinkLabel": "Dinámico", + "errors": { + "missingReturn": "Falta información del nodo de retorno", + "linkUndefined": "enlace indefinido" + } + }, + "tls": { + "tls": "Configuración TLS", + "label": { + "use-local-files": "Utilizar claves y certificados de archivos locales", + "upload": "Cargar", + "cert": "Certificado", + "key": "Clave Privada", + "passphrase": "Frase de contraseña", + "ca": "Certificado CA", + "verify-server-cert": "Verificar el certificado del servidor", + "servername": "Nombre del servidor", + "alpnprotocol": "Protocolo ALPN" + }, + "placeholder": { + "cert": "ruta a certificado (formato PEM)", + "key": "ruta a clave privada (formato PEM)", + "ca": "ruta a certificado CA (formato PEM)", + "passphrase": "frase de contraseña de clave privada (opcional)", + "servername": "para uso con SNI", + "alpnprotocol": "para uso con ALPN" + }, + "error": { + "missing-file": "No se ha indicado ningún archivo de certificado/clave", + "invalid-cert": "Certificado no especificado", + "invalid-key": "Clave privada no especificada" + } + }, + "exec": { + "exec": "ejecutar", + "spawn": "generar", + "label": { + "command": "Comando", + "append": "Adjuntar", + "timeout": "Tiempo Espera", + "timeoutplace": "opcional", + "return": "Salida", + "seconds": "segundos", + "stdout": "stdout", + "stderr": "stderr", + "retcode": "código resultado", + "winHide": "Esconder terminal" + }, + "placeholder": { + "extraparams": "parámetros de entrada adicionales" + }, + "opt": { + "exec": "cuando se completa el comando - modo ejecución", + "spawn": "mientras se ejecuta el comando - modo de generación" + }, + "oldrc": "Usar salida de estilo antiguo (modo de compatibilidad)" + }, + "function": { + "function": "", + "label": { + "setup": "Configuración", + "function": "En mensaje", + "initialize": "Al inicio", + "finalize": "Al final", + "outputs": "Salidas", + "modules": "Módulos", + "timeout": "Tiempo Espera" + }, + "text": { + "initialize": "// El código añadido aquí se ejecutará una vez\n// cuando el nodo es iniciado.\n", + "finalize": "// El código añadido aquí se ejecutará cuando el nodo\n// se detenga o se vuelva a instanciar.\n" + }, + "require": { + "var": "variable", + "module": "módulo", + "moduleName": "Nombre módulo", + "importAs": "Importar como" + }, + "error": { + "externalModuleNotAllowed": "El nodo de función no puede cargar módulos externos", + "moduleNotAllowed": "Módulo __module__ no permitido", + "externalModuleLoadError": "El nodo de función no pudo cargar módulos externos", + "moduleLoadError": "No se pudo cargar el módulo __module__: __error__", + "moduleNameError": "Nombre de variable de módulo no válido: __name__", + "moduleNameReserved": "Nombre de variable reservada: __name__", + "inputListener": "No se puede agregar un oyente al evento 'entrada' dentro de la función", + "non-message-returned": "La función intentó enviar un mensaje de tipo __type__", + "invalid-js": "Error en el código JavaScript", + "missing-module": "Falta el módulo __module__" + } + }, + "template": { + "template": "plantilla", + "label": { + "template": "Plantilla", + "property": "Propiedad", + "format": "Resaltado de sintaxis", + "syntax": "Formato", + "output": "Salida como", + "mustache": "Mustache template", + "plain": "Texto normal", + "json": "JSON", + "yaml": "YAML", + "none": "ninguno" + }, + "templatevalue": "Esta es la carga: {{payload}} !" + }, + "delay": { + "action": "Acción", + "for": "Para", + "delaymsg": "Retrasar cada mensaje", + "delayfixed": "Retraso fijo", + "delayvarmsg": "Utilizar el retraso en msg.delay", + "randomdelay": "Retraso aleatorio", + "limitrate": "Límite frequencia", + "limitall": "Todos los mensajes", + "limittopic": "Para cada msg.topic", + "fairqueue": "Envía cada tema por turno", + "timedqueue": "Enviar todos los temas", + "milisecs": "Millisegundos", + "secs": "Segundos", + "sec": "Segundo", + "mins": "Minutos", + "min": "Minuto", + "hours": "Horas", + "hour": "Hora", + "days": "Días", + "day": "Día", + "between": "Entre", + "and": "y", + "rate": "Frecuencia", + "msgper": "msg(s) por", + "queuemsg": "Encolar mensajes intermedios", + "dropmsg": "Eliminar mensajes intermedios", + "sendmsg": "Enviar mensajes intermedios a la segunda salida.", + "allowrate": "permitir que msg.rate (en ms) indique la frecuencia", + "label": { + "delay": "retraso", + "variable": "variable", + "limit": "límite", + "limitTopic": "limitar tema", + "random": "aleatorio", + "rate": "frecuencia", + "random-first": "primer valor aleatorio", + "random-last": "último valor aleatorio", + "units": { + "second": { + "plural": "Segundos", + "singular": "Segundo" + }, + "minute": { + "plural": "Minutos", + "singular": "Minuto" + }, + "hour": { + "plural": "Horas", + "singular": "Hora" + }, + "day": { + "plural": "Días", + "singular": "Día" + } + } + }, + "errors": { + "too-many": "demasiados mensajes pendientes en el nodo de retraso", + "invalid-timeout": "Valor de retraso no válido", + "invalid-rate": "Valor de frecuencia no válido", + "invalid-rate-unit": "Unidad de frecuencia no válido", + "invalid-random-first": "Primer valor aleatorio no válido", + "invalid-random-last": "Ultimo valor aleatorio no válido" + } + }, + "trigger": { + "send": "Enviar", + "then": "entonces", + "then-send": "entonces envía", + "output": { + "string": "el texto", + "number": "el número", + "existing": "el objeto de mensaje existente", + "original": "el objeto de mensaje original", + "latest": "el último objeto de mensaje", + "nothing": "nada" + }, + "wait-reset": "espera a ser reiniciado", + "wait-for": "espera a", + "wait-loop": "reenviarlo cada", + "for": "Manejando", + "bytopics": "cada", + "alltopics": "todos los mensajes", + "duration": { + "ms": "Millisegundos", + "s": "Segundos", + "m": "Minutos", + "h": "Horas" + }, + "extend": " extender el retraso si llega un nuevo mensaje", + "override": "indicar el retraso con msg.delay", + "second": " enviar el segundo mensaje a una salida separada", + "label": { + "trigger": "iniciar", + "trigger-block": "iniciar y bloquear", + "trigger-loop": "reenviar cada", + "reset": "Reinicia el disparador si:", + "resetMessage": "msg.reset es verdadero", + "resetPayload": "msg.payload es igual a", + "resetprompt": "opcional", + "duration": "duración", + "topic": "tema" + } + }, + "comment": { + "comment": "comentario" + }, + "unknown": { + "label": { + "unknown": "desconocido" + }, + "tip": "

    Este nodo es de un tipo desconocido para tu instalación de Node-RED.

    Si instancia con el nodo en este estado, tu configuración se conservará, pero el flujo no comenzará hasta el tipo que falta esté instalado.

    Consulta la barra lateral de información para obtener más ayuda

    " + }, + "mqtt": { + "label": { + "broker": "Servidor", + "example": "e.g. localhost", + "output": "Salida", + "qos": "CdS", + "retain": "Retener", + "clientid": "ID Cliente", + "port": "Puerto", + "keepalive": "Mantener activo", + "cleansession": "Usar sesión limpia", + "autoUnsubscribe": "Darse de baja automáticamente al desconectarse", + "cleanstart": "Usar inicio limpio", + "use-tls": "Utilizar TLS", + "tls-config": "Configuración TLS", + "verify-server-cert": "Verificar el certificado del servidor", + "compatmode": "Utiliza el soporte compatible de MQTT 3.1", + "userProperties": "Propiedades de usuario", + "subscriptionIdentifier": "ID Subscripción", + "flags": "Indicadores", + "nl": "No recibir mensajes publicados por este cliente", + "rap": "Mantener retención de publicación original", + "rh": "Manejo de mensajes retenidos", + "rh0": "Enviar mensajes retenidos", + "rh1": "Enviar solo para nuevas suscripciones", + "rh2": "No enviar", + "responseTopic": "Tema de respuesta", + "contentType": "Tipo de contenido", + "correlationData": "Datos de correlación", + "expiry": "Caducidad (s)", + "sessionExpiry": "Caducidad de la sesión (s)", + "topicAlias": "Alias", + "payloadFormatIndicator": "Formato", + "payloadFormatIndicatorFalse": "bytes no especificados (predeterminado)", + "payloadFormatIndicatorTrue": "Carga codificada en UTF-8", + "protocolVersion": "Protocolo", + "protocolVersion3": "MQTT V3.1 (legacy)", + "protocolVersion4": "MQTT V3.1.1", + "protocolVersion5": "MQTT V5", + "topicAliasMaximum": "Máximo alias", + "maximumPacketSize": "Tamaño máximo de paquete", + "receiveMaximum": "Máximo recepción", + "session": "Sesión", + "delay": "Retraso", + "action": "Acción", + "staticTopic": "Suscríbete a un solo tema", + "dynamicTopic": "Suscripción dinámica", + "auto-connect": "Conectar automáticamente", + "auto-mode-depreciated": "Esta opción está descontinuada. Utiliza el nuevo modo de detección automática.", + "none": "ninguno", + "other": "otro" + }, + "sections-label": { + "birth-message": "Mensaje enviado al conectarse (mensaje de inicio)", + "will-message": "Mensaje enviado ante una desconexión inesperada (mensaje de voluntad)", + "close-message": "Mensaje enviado antes de desconectar (mensaje de cierre)" + }, + "tabs-label": { + "connection": "Conexión", + "security": "Seguridad", + "messages": "Mensajes" + }, + "placeholder": { + "clientid": "Dejar en blanco para auto generado", + "clientid-nonclean": "Debe configurarse para sesiones no limpias", + "will-topic": "Dejar en blanco para desactivar el mensaje de voluntad", + "birth-topic": "Déjelo en blanco para desactivar el mensaje de inicio.", + "close-topic": "Déjelo en blanco para desactivar el mensaje de cierre." + }, + "state": { + "connected": "Conectado al servidor: __broker__", + "disconnected": "Desconectado del servidor: __broker__", + "connect-failed": "Fallo en la conexión al servidor: __broker__", + "broker-disconnected": "Servidor __broker__ desconectado del cliente: __reasonCode__ __reasonString__" + }, + "retain": "Retener", + "output": { + "buffer": "un Buffer", + "string": "un Texto", + "base64": "un texto codificado Base64", + "auto": "auto-detectar (texto o buffer)", + "auto-detect": "auto-detectar (objeto JSON, texto o buffer)", + "json": "un objeto JSON" + }, + "true": "verdadero", + "false": "falso", + "tip": "Consejo: Deja el tema, CdS o manténgalo en blanco si quieres configurarlos a través de las propiedades del mensaje.", + "errors": { + "not-defined": "tema no definido", + "missing-config": "falta configuración del servidor", + "invalid-topic": "Tema especificado no válido", + "nonclean-missingclientid": "No se ha establecido ningún ID de cliente, se utiliza una sesión limpia", + "invalid-json-string": "Cadena JSON no válida", + "invalid-json-parse": "No se pudo analizar la cadena JSON", + "invalid-action-action": "Acción no válida especificada", + "invalid-action-alreadyconnected": "Desconectar del servidor antes de conectar", + "invalid-action-badsubscription": "msg.topic falta o no es válido", + "invalid-client-id": "Falta ID de cliente" + } + }, + "httpin": { + "label": { + "method": "Método", + "url": "URL", + "doc": "Docs", + "return": "Return", + "upload": "Accept file uploads?", + "status": "Status code", + "headers": "Headers", + "other": "otro", + "paytoqs": { + "ignore": "Ignore", + "query": "Append to query-string parameters", + "body": "Send as request body" + }, + "utf8String": "texto UTF8", + "binaryBuffer": "buffer binario", + "jsonObject": "objeto JSON", + "authType": "Tipo", + "bearerToken": "Token" + }, + "setby": "- set by msg.method -", + "basicauth": "Use authentication", + "use-tls": "Enable secure (SSL/TLS) connection", + "tls-config": "TLS Configuration", + "basic": "basic authentication", + "digest": "digest authentication", + "bearer": "bearer authentication", + "use-proxy": "Use proxy", + "persist": "Enable connection keep-alive", + "proxy-config": "Proxy Configuration", + "use-proxyauth": "Use proxy authentication", + "noproxy-hosts": "Ignore hosts", + "senderr": "Only send non-2xx responses to Catch node", + "utf8": "a UTF-8 string", + "binary": "a binary buffer", + "json": "a parsed JSON object", + "tip": { + "in": "The url will be relative to ", + "res": "The messages sent to this node must originate from an http input node", + "req": "Tip: If the JSON parse fails the fetched string is returned as-is." + }, + "httpreq": "http request", + "errors": { + "not-created": "Cannot create http-in node when httpNodeRoot set to false", + "missing-path": "missing path", + "no-response": "No response object", + "json-error": "JSON parse error", + "no-url": "No url specified", + "deprecated-call": "Deprecated call to __method__", + "invalid-transport": "non-http transport requested", + "timeout-isnan": "Timeout value is not a valid number, ignoring", + "timeout-isnegative": "Timeout value is negative, ignoring", + "invalid-payload": "Invalid payload", + "invalid-url": "Invalid url" + }, + "status": { + "requesting": "requesting" + }, + "insecureHTTPParser": "Disable strict HTTP parsing" + }, + "websocket": { + "label": { + "type": "Tipo", + "path": "Ruta", + "url": "URL", + "subprotocol": "Subprotocolo" + }, + "listenon": "Listen on", + "connectto": "Connect to", + "sendrec": "Send/Receive", + "payload": "payload", + "message": "entire message", + "sendheartbeat": "Send heartbeat", + "tip": { + "path1": "By default, payload will contain the data to be sent over, or received from a websocket. The listener can be configured to send or receive the entire message object as a JSON formatted string.", + "path2": "This path will be relative to __path__.", + "url1": "URL should use ws:// or wss:// scheme and point to an existing websocket listener.", + "url2": "By default, payload will contain the data to be sent over, or received from a websocket. The client can be configured to send or receive the entire message object as a JSON formatted string." + }, + "status": { + "connected": "connected __count__", + "connected_plural": "connected __count__" + }, + "errors": { + "connect-error": "An error occurred on the ws connection: ", + "send-error": "An error occurred while sending: ", + "missing-conf": "Missing server configuration", + "duplicate-path": "Cannot have two WebSocket listeners on the same path: __path__", + "missing-server": "Missing server configuration", + "missing-client": "Missing client configuration" + } + }, + "watch": { + "watch": "watch", + "label": { + "files": "File(s)", + "recursive": "Watch sub-directories recursively" + }, + "placeholder": { + "files": "Comma-separated list of files and/or directories" + }, + "tip": "On Windows you must use double back-slashes \\\\ in any directory names." + }, + "tcpin": { + "label": { + "type": "Tipo", + "output": "Salida", + "port": "puerto", + "host": "en servidor", + "payload": "carga(s)", + "delimited": "delimitado por", + "close-connection": "¿Cerrar la conexión después de enviar cada mensaje?", + "decode-base64": "¿Decodificar mensaje Base64?", + "server": "Servidor", + "return": "Devolver", + "ms": "ms", + "chars": "caracteres", + "close": "Cerrar", + "optional": "(opcional)", + "reattach": "volver a adjuntar delimitador" + }, + "type": { + "listen": "Escuchar", + "connect": "Conectar a", + "reply": "Responder a TCP" + }, + "output": { + "stream": "corriente de", + "single": "único", + "buffer": "Buffer", + "string": "Cadena", + "base64": "Cadena Base64" + }, + "return": { + "timeout": "después de un tiempo de espera fijo de", + "character": "cuando el carácter recibido es", + "number": "después de un número fijo de caracteres", + "never": "nunca - mantener la conexión abierta", + "immed": "inmediatamente - no esperar respuesta" + }, + "status": { + "connecting": "conectando a __host__:__port__", + "connected": "conectado a __host__:__port__", + "listening-port": "escuchando en el puerto __port__", + "stopped-listening": "dejó de escuchar en el puerto", + "connection-from": "conexión desde __host__:__port__", + "connection-closed": "conexión cerrada desde __host__:__port__", + "connections": "__count__ conexión", + "connections_plural": "__count__ conexiones" + }, + "errors": { + "connection-lost": "conexión perdida a __host__:__port__", + "timeout": "puerto de socket __port__ cerrado por tiempo de espera", + "cannot-listen": "incapaz de escuchar en el puerto __port__, error: __error__", + "error": "error: __error__", + "socket-error": "error de socket desde __host__:__port__", + "no-host": "Servidor y/o puerto no configurado", + "connect-timeout": "tiempo de espera de conexión", + "connect-fail": "conexión fallida", + "bad-string": "no se pudo convertir a cadena", + "invalid-host": "Servidor no válido", + "invalid-port": "Puerto no válido" + } + }, + "udp": { + "label": { + "listen": "Escuchar", + "onport": "en Puerto", + "using": "utilizando", + "output": "Salida", + "group": "Grupo", + "interface": "SI local", + "send": "Enviar un", + "toport": "al puerto", + "address": "Dirección", + "decode-base64": "¿Decodificar la carga codificada en Base64?", + "port": "puerto" + }, + "placeholder": { + "interface": "(opcional) interfaz local o dirección a la que vincularse", + "interfaceprompt": "(opcional) interfaz local o dirección a la que vincularse", + "address": "IP de destino" + }, + "udpmsgs": "mensajes udp", + "mcmsgs": "mensajes multidifusión", + "udpmsg": "mensajes udp", + "bcmsg": "mensajes transmisión", + "mcmsg": "mensajes multidifusión", + "output": { + "buffer": "un Buffer", + "string": "un Texto", + "base64": "un texto codificado Base64" + }, + "bind": { + "random": "enlazar a puerto local aleatorio", + "local": "enlazar al puerto local", + "target": "enlazar al puerto de destino" + }, + "tip": { + "in": "Consejo: asegúrate de que tu firewall permita la entrada de datos.", + "out": "Consejo: deja la dirección y el puerto en blanco si quieres configurar usando msg.ip y msg.port.", + "port": "Puertos ya en uso: " + }, + "status": { + "listener-at": "udp escuchando en __host__:__port__", + "mc-group": "udp grupo multidifusión __group__", + "listener-stopped": "udp escucha detenida", + "output-stopped": "udp salida detenida", + "mc-ready": "udp multidifusión lista: __iface__:__outport__ -> __host__:__port__", + "bc-ready": "udp transmisión lista: __outport__ -> __host__:__port__", + "ready": "udp lista: __outport__ -> __host__:__port__", + "ready-nolocal": "udp lista: __host__:__port__", + "re-use": "udp reutilizar el socket: __outport__ -> __host__:__port__" + }, + "errors": { + "access-error": "Error de acceso UDP, es posible que necesites acceso de root para puertos inferiores a 1024", + "error": "error: __error__", + "bad-mcaddress": "Dirección de multidifusión incorrecta", + "interface": "Debe ser la dirección IP de la interfaz requerida.", + "ip-notset": "udp: dirección IP no configurada", + "port-notset": "udp: puerto no configurado", + "port-invalid": "udp: número de puerto no válido", + "alreadyused": "udp: puerto __port__ ya en uso", + "ifnotfound": "udp: interfaz __iface__ no encontrada", + "invalid-group": "grupo de multidifusión no válido" + } + }, + "switch": { + "switch": "conmutador", + "label": { + "property": "Propiedad", + "rule": "regla", + "repair": "recrear secuencias de mensajes", + "value-rules": "reglas de valor", + "sequence-rules": "reglas de secuencia" + }, + "previous": "valor anterior", + "and": "y", + "checkall": "revisando todas las reglas", + "stopfirst": "parando después de la primer coincidencia", + "ignorecase": "ignorar capitalización", + "rules": { + "btwn": "está entre", + "cont": "contiene", + "regex": "matches regex", + "true": "es verdadero", + "false": "es falso", + "null": "es nulo", + "nnull": "es no nulo", + "istype": "es de tipo", + "empty": "es vacío", + "nempty": "es no vacío", + "head": "cabeza", + "tail": "cola", + "index": "índice entre", + "exp": "espresión JSONata", + "else": "de lo contrario", + "hask": "tiene índice" + }, + "errors": { + "invalid-expr": "Expresión JSONata no válida: __error__", + "too-many": "Demasiados mensajes pendientes en el nodo de conmutación." + } + }, + "change": { + "label": { + "rules": "Reglas", + "rule": "regla", + "set": "establece __property__", + "change": "cambia __property__", + "delete": "elimina __property__", + "move": "mueve __property__", + "changeCount": "cambia: __count__ reglas", + "regex": "Usa expresiones regulares", + "deepCopy": "Copia profunda" + }, + "action": { + "set": "Establece", + "change": "Cambia", + "delete": "Elimina", + "move": "Mueve", + "toValue": "al valor", + "to": "a", + "search": "Buscar", + "replace": "Reemplazar con" + }, + "errors": { + "invalid-from": "Propiedad 'from' inválida: __error__", + "invalid-json": "Propiedad JSON 'to' inválida", + "invalid-expr": "Expresión JSONata inválida: __error__", + "no-override": "No se puede establecer una propiedad que no sea de tipo objeto: __property__", + "invalid-prop": "Expresión de propiedad inválida: __property__", + "invalid-json-data": "Datos JSON inválidos: __error__" + } + }, + "range": { + "range": "rango", + "label": { + "action": "Acción", + "inputrange": "Mapear el rango de entrada", + "resultrange": "al rango objetivo", + "from": "de", + "to": "a", + "roundresult": "¿Redondear el resultado al número entero más cercano?", + "minin": "entrada de", + "maxin": "entrada a", + "minout": "destino de", + "maxout": "destino a" + }, + "placeholder": { + "min": "e.g. 0", + "maxin": "e.g. 99", + "maxout": "e.g. 255" + }, + "scale": { + "payload": "Escalar la propiedad del mensaje", + "limit": "Escalar y limitar al rango objetivo", + "wrap": "Escalar y ajustar dentro del rango objetivo", + "drop": "Escalar, pero eliminar el mensaje si está fuera del rango de entrada" + }, + "tip": "Consejo: Este nodo SÓLO funciona con números.", + "errors": { + "notnumber": "No es un número" + } + }, + "csv": { + "label": { + "columns": "Columnas", + "separator": "Separador", + "c2o": "Opciones de CSV a objeto", + "o2c": "Opciones de objeto a CSV", + "input": "Entrada", + "skip-s": "Saltar primero", + "skip-e": "líneas", + "firstrow": "la primera fila contiene nombres de columnas", + "output": "Salida", + "includerow": "incluir fila de nombre de columna", + "newline": "Nueva línea", + "usestrings": "analizar valores numéricos", + "include_empty_strings": "incluir cadenas vacías", + "include_null_values": "incluir valores nulos" + }, + "placeholder": { + "columns": "nombres de columnas separados por comas" + }, + "separator": { + "comma": "coma", + "tab": "tabulación", + "space": "espacio", + "semicolon": "semicoma", + "colon": "dos puntos", + "hashtag": "almohadilla", + "other": "otro..." + }, + "output": { + "row": "un mensaje por fila", + "array": "un solo mensaje [array]" + }, + "newline": { + "linux": "Linux (\\n)", + "mac": "Mac (\\r)", + "windows": "Windows (\\r\\n)" + }, + "hdrout": { + "none": "nunca enviar encabezados de columna", + "all": "enviar siempre encabezados de columna", + "once": "enviar encabezados una vez, hasta msg.reset" + }, + "errors": { + "csv_js": "Este nodo solo maneja cadenas CSV u objetos JS.", + "obj_csv": "No se ha especificado ninguna plantilla de columnas para el objeto -> CSV.", + "bad_csv": "Datos CSV con formato incorrecto: la salida probablemente esté corrupta." + } + }, + "html": { + "label": { + "select": "Selector", + "output": "Salida", + "in": "en" + }, + "output": { + "html": "el contenido HTML de los elementos", + "text": "sólo el contenido textual de los elementos", + "attr": "un objeto de cualquier atributo de los elementos" + }, + "format": { + "single": "como un mensaje único que contiene una matriz", + "multi": "como mensajes múltiples, uno para cada elemento" + } + }, + "json": { + "errors": { + "dropped-object": "Carga sin objeto ignorada", + "dropped": "Tipo de carga no compatible ignorado", + "dropped-error": "No se pudo convertir la carga", + "schema-error": "Error de esquema JSON", + "schema-error-compile": "Error de esquema JSON: no se pudo compilar el esquema" + }, + "label": { + "o2j": "Opciones de objeto a JSON", + "pretty": "Formatear cadena JSON", + "action": "Acción", + "property": "Propiedad", + "actions": { + "toggle": "Convertir entre cadena JSON y objeto", + "str": "Convierta siempre a cadena JSON", + "obj": "Convertir siempre a objeto JavaScript" + } + } + }, + "yaml": { + "errors": { + "dropped-object": "Carga sin objeto ignorada", + "dropped": "Tipo de carga no admitida ignorada", + "dropped-error": "No se pudo convertir la carga" + } + }, + "xml": { + "label": { + "represent": "Propiedad para atributos XML", + "prefix": "Propiedad para el contenido de la etiqueta", + "advanced": "Opciones avanzadas", + "x2o": "Opciones de XML a objeto" + }, + "errors": { + "xml_js": "Este nodo solo maneja cadenas XML u objetos JS." + } + }, + "file": { + "label": { + "write": "escribir archivo", + "read": "leer archivo", + "filename": "Nombre del archivo", + "path": "ruta", + "action": "Acción", + "addnewline": "Añadir nueva línea (\\n) a cada carga?", + "createdir": "¿Crear directorio si no existe?", + "outputas": "Salida", + "breakchunks": "Romper en trozos", + "breaklines": "Romper en filas", + "sendError": "Enviar mensaje en caso de error (modo compatible)", + "encoding": "Codificación", + "deletelabel": "eliminar __file__", + "utf8String": "texto UTF8", + "utf8String_plural": "textos UTF8", + "binaryBuffer": "buffer binario", + "binaryBuffer_plural": "buffers binarios", + "allProps": "incluir todas las propiedades existentes en cada mensaje" + }, + "action": { + "append": "adjuntar al archivo", + "overwrite": "sobrescribir archivo", + "delete": "borrar archivo" + }, + "output": { + "utf8": "una sola cadena UTF8", + "buffer": "un único objeto Buffer", + "lines": "un mensaje por línea", + "stream": "una corriente de buffers" + }, + "status": { + "wrotefile": "escrito al archivo: __file__", + "deletedfile": "archivo eliminado: __file__", + "appendedfile": "adjuntado al archivo: __file__" + }, + "encoding": { + "none": "predeterminado", + "setbymsg": "definido por msg.encoding", + "native": "Nativo", + "unicode": "Unicode", + "japanese": "Japanese", + "chinese": "Chinese", + "korean": "Korean", + "taiwan": "Taiwan/Hong Kong", + "windows": "Windows codepages", + "iso": "ISO codepages", + "ibm": "IBM codepages", + "mac": "Mac codepages", + "koi8": "KOI8 codepages", + "misc": "Misceláneas" + }, + "errors": { + "nofilename": "No se ha especificado ningún nombre de archivo", + "invaliddelete": "Advertencia: eliminación no válida. Utiliza la opción de eliminación específica en el cuadro de diálogo de configuración.", + "deletefail": "no se pudo eliminar el archivo: __error__", + "writefail": "no se pudo escribir en el archivo: __error__", + "appendfail": "no se pudo adjuntar al archivo: __error__", + "createfail": "no se pudo crear el archivo: __error__" + }, + "tip": "Consejo: El nombre del archivo debe ser una ruta absoluta; de lo contrario, será relativo al directorio de trabajo del proceso Node-RED." + }, + "split": { + "split": "dividir", + "intro": "Dividir msg.payload basado en tipo:", + "object": "Objeto", + "objectSend": "Enviar un mensaje para cada par clave/valor", + "strBuff": "Texto / Buffer", + "array": "Array", + "splitUsing": "Dividir usando", + "splitLength": "Longitud fija de", + "stream": "Manejar como un flujo de mensajes", + "addname": " Copiar clave a " + }, + "join": { + "join": "unir", + "mode": { + "mode": "Modo", + "auto": "automático", + "merge": "fusionar secuencias", + "reduce": "reducir secuencia", + "custom": "manual" + }, + "combine": "Combinar cada", + "completeMessage": "mensaje completo", + "create": "a crear", + "type": { + "string": "un Texto", + "array": "un Array", + "buffer": "un Buffer", + "object": "un Objeto clave/valor", + "merged": "un Objeto combinado" + }, + "using": "usando el valor de", + "key": "como la clave", + "joinedUsing": "se unió usando", + "send": "Enviar el mensaje:", + "afterCount": "Después de varias partes del mensaje", + "count": "contar", + "subsequent": "y cada mensaje posterior.", + "afterTimeout": "Después de un tiempo de espera trás el primer mensaje", + "seconds": "segundos", + "complete": "Después de un mensaje con la propiedad msg.complete establecida", + "tip": "Este modo supone que este nodo está emparejado con un nodo dividir o que los mensajes recibidos tendrán una propiedad msg.parts configurada correctamente.", + "too-many": "demasiados mensajes pendientes en el nodo de unión.", + "message-prop": "propiedad de mensaje", + "merge": { + "topics-label": "Temas Fusionados", + "topics": "temas", + "topic": "tema", + "on-change": "Enviar mensaje combinado al llegar un nuevo tema" + }, + "reduce": { + "exp": "Expresión de reducción", + "exp-value": "expresión", + "init": "Valor inicial", + "right": "Evaluar en orden inverso (último a primero)", + "fixup": "Expresión de reparación" + }, + "errors": { + "invalid-expr": "Expresión JSONata no válida: __error__", + "invalid-type": "No se puede juntar __error__ al buffer" + } + }, + "sort": { + "sort": "ordenar", + "target": "Ordenar", + "seq": "secuencia de mensajes", + "key": "Clave", + "elem": "valor del elemento", + "order": "Orden", + "ascending": "ascendente", + "descending": "descendente", + "as-number": "como número", + "invalid-exp": "Expresión JSONata no válida en nodo de ordenación: __message__", + "too-many": "Demasiados mensajes pendientes en el nodo de clasificación", + "clear": "borrar mensaje pendiente en nodo de clasificación" + }, + "batch": { + "batch": "lote", + "mode": { + "label": "Modo", + "num-msgs": "Agrupar por número de mensajes", + "interval": "Agrupar por intervalo de tiempo", + "concat": "Concatenar secuencias" + }, + "count": { + "label": "Número de mensajes", + "overlap": "Solapamiento", + "count": "Contar", + "invalid": "Recuento y solapamiento no válidos" + }, + "interval": { + "label": "Intervalo", + "seconds": "segundos", + "empty": "enviar mensaje vacío cuando no llega ningún mensaje" + }, + "concat": { + "topics-label": "Temas", + "topic": "tema" + }, + "too-many": "demasiados mensajes pendientes en el nodo de lotes", + "unexpected": "modo inesperado", + "no-parts": "ninguna propiedad 'parte' en el mensaje", + "error": { + "invalid-count": "Recuento no válido", + "invalid-overlap": "Solapamiento no válido", + "invalid-interval": "Intervalo no válido" + } + }, + "rbe": { + "rbe": "filtrar", + "label": { + "func": "Modo", + "init": "Enviar valor inicial", + "start": "Valor inicial", + "name": "Nombre", + "septopics": "Aplicar el modo por separado para cada ", + "gap": "cambio de valor", + "property": "propiedad", + "topic": "tema" + }, + "placeholder": { + "bandgap": "e.g. 10 ó 5%", + "start": "dejar en blanco para utilizar el primer dato recibido" + }, + "opts": { + "rbe": "bloquear a menos que cambie el valor", + "rbei": "bloquear a menos que cambie el valor (ignorar el valor inicial)", + "deadband": "bloquear a menos que el cambio de valor sea mayor que", + "deadbandEq": "bloquear a menos que el cambio de valor sea mayor o igual que", + "narrowband": "bloquear si el cambio de valor es mayor que", + "narrowbandEq": "bloquear si el cambio de valor es mayor o igual que", + "in": "comparado con el último valor introducido", + "out": "comparado con el último valor de salida válido" + }, + "warn": { + "nonumber": "no hay un número en la carga" + } + }, + "global-config": { + "label": { + "open-conf": "Abrir Ajustes" + } + } +} diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/network/05-tls.html b/packages/node_modules/@node-red/nodes/locales/es-ES/network/05-tls.html new file mode 100644 index 000000000..715977ee8 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/network/05-tls.html @@ -0,0 +1,19 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/network/06-httpproxy.html b/packages/node_modules/@node-red/nodes/locales/es-ES/network/06-httpproxy.html new file mode 100644 index 000000000..8f830c29d --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/network/06-httpproxy.html @@ -0,0 +1,22 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/network/10-mqtt.html b/packages/node_modules/@node-red/nodes/locales/es-ES/network/10-mqtt.html new file mode 100644 index 000000000..dbfbff291 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/network/10-mqtt.html @@ -0,0 +1,135 @@ + + + + + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/network/21-httpin.html b/packages/node_modules/@node-red/nodes/locales/es-ES/network/21-httpin.html new file mode 100644 index 000000000..2da3f7116 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/network/21-httpin.html @@ -0,0 +1,83 @@ + + + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/network/21-httprequest.html b/packages/node_modules/@node-red/nodes/locales/es-ES/network/21-httprequest.html new file mode 100644 index 000000000..9cf82938f --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/network/21-httprequest.html @@ -0,0 +1,81 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/network/22-websocket.html b/packages/node_modules/@node-red/nodes/locales/es-ES/network/22-websocket.html new file mode 100644 index 000000000..ccb929227 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/network/22-websocket.html @@ -0,0 +1,36 @@ + + + + + + + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/network/31-tcpin.html b/packages/node_modules/@node-red/nodes/locales/es-ES/network/31-tcpin.html new file mode 100644 index 000000000..0d25594b4 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/network/31-tcpin.html @@ -0,0 +1,35 @@ + + + + + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/network/32-udp.html b/packages/node_modules/@node-red/nodes/locales/es-ES/network/32-udp.html new file mode 100644 index 000000000..d87354621 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/network/32-udp.html @@ -0,0 +1,28 @@ + + + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/parsers/70-CSV.html b/packages/node_modules/@node-red/nodes/locales/es-ES/parsers/70-CSV.html new file mode 100644 index 000000000..5dbbb88f0 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/parsers/70-CSV.html @@ -0,0 +1,49 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/parsers/70-HTML.html b/packages/node_modules/@node-red/nodes/locales/es-ES/parsers/70-HTML.html new file mode 100644 index 000000000..29491bb61 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/parsers/70-HTML.html @@ -0,0 +1,33 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/parsers/70-JSON.html b/packages/node_modules/@node-red/nodes/locales/es-ES/parsers/70-JSON.html new file mode 100644 index 000000000..36358ee9d --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/parsers/70-JSON.html @@ -0,0 +1,44 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/parsers/70-XML.html b/packages/node_modules/@node-red/nodes/locales/es-ES/parsers/70-XML.html new file mode 100644 index 000000000..95e7d83a4 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/parsers/70-XML.html @@ -0,0 +1,49 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/parsers/70-YAML.html b/packages/node_modules/@node-red/nodes/locales/es-ES/parsers/70-YAML.html new file mode 100644 index 000000000..2edce51e3 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/parsers/70-YAML.html @@ -0,0 +1,34 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/sequence/17-split.html b/packages/node_modules/@node-red/nodes/locales/es-ES/sequence/17-split.html new file mode 100644 index 000000000..2537abad5 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/sequence/17-split.html @@ -0,0 +1,146 @@ + + + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/sequence/18-sort.html b/packages/node_modules/@node-red/nodes/locales/es-ES/sequence/18-sort.html new file mode 100644 index 000000000..5999947a9 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/sequence/18-sort.html @@ -0,0 +1,41 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/sequence/19-batch.html b/packages/node_modules/@node-red/nodes/locales/es-ES/sequence/19-batch.html new file mode 100644 index 000000000..7fd81c89b --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/sequence/19-batch.html @@ -0,0 +1,35 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/storage/10-file.html b/packages/node_modules/@node-red/nodes/locales/es-ES/storage/10-file.html new file mode 100644 index 000000000..0e8750d14 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/storage/10-file.html @@ -0,0 +1,62 @@ + + + + + diff --git a/packages/node_modules/@node-red/nodes/locales/es-ES/storage/23-watch.html b/packages/node_modules/@node-red/nodes/locales/es-ES/storage/23-watch.html new file mode 100644 index 000000000..cfaf604a2 --- /dev/null +++ b/packages/node_modules/@node-red/nodes/locales/es-ES/storage/23-watch.html @@ -0,0 +1,30 @@ + + + diff --git a/packages/node_modules/@node-red/nodes/locales/fr/common/20-inject.html b/packages/node_modules/@node-red/nodes/locales/fr/common/20-inject.html index 94f3d4ec1..7a4b3fb1f 100644 --- a/packages/node_modules/@node-red/nodes/locales/fr/common/20-inject.html +++ b/packages/node_modules/@node-red/nodes/locales/fr/common/20-inject.html @@ -36,5 +36,5 @@

    Remarque : Les options "Intervalle entre les heures" et "à une heure précise" utilisent le système cron standard. Cela signifie que pour la première option, vous pouvez envoyer un message à intervalle régulier entre les heures voulues. Si vous voulez envoyer un message toutes les minutes à partir de maintenant, utiliser l'option "intervalle".

    -

    Remarque : Pour inclure une nouvelle ligne dans une chaîne, vous devez utiliser un noeud de fonction pour créer la charge utile.

    +

    Remarque : Pour inclure une nouvelle ligne dans une chaîne, vous devez utiliser soit un noeud de fonction soit le noeud template pour créer la charge utile.

    diff --git a/packages/node_modules/@node-red/nodes/locales/fr/messages.json b/packages/node_modules/@node-red/nodes/locales/fr/messages.json index 7890ce9a2..c56cc28f1 100644 --- a/packages/node_modules/@node-red/nodes/locales/fr/messages.json +++ b/packages/node_modules/@node-red/nodes/locales/fr/messages.json @@ -11,11 +11,11 @@ "expand": "Développer" }, "status": { - "connected": "connecté", - "not-connected": "pas connecté", - "disconnected": "déconnecté", - "connecting": "connexion", - "error": "erreur", + "connected": "Connecté", + "not-connected": "Pas connecté", + "disconnected": "Déconnecté", + "connecting": "Connexion", + "error": "Erreur", "ok": "OK" }, "notification": { @@ -32,7 +32,7 @@ }, "inject": { "inject": "Injecter", - "injectNow": "injecter maintenant", + "injectNow": "Injecter maintenant", "repeat": "répéter = __repeat__", "crontab": "crontab = __crontab__", "stopped": "arrêté", @@ -98,7 +98,7 @@ "catchUncaught": "catch : non capturé", "label": { "source": "Détecter les erreurs de", - "selectAll": "tout sélectionner", + "selectAll": "Tout sélectionner", "uncaught": "Ignorer les erreurs gérées par les autres noeuds Catch" }, "scope": { @@ -112,7 +112,7 @@ "statusNodes": "statut : __number__", "label": { "source": "Signaler l'état de", - "sortByType": "trier par type" + "sortByType": "Trier par type" }, "scope": { "all": "tous les noeuds", @@ -148,23 +148,23 @@ "deactivated": "Désactivé avec succès : __label__" }, "sidebar": { - "label": "débogage", + "label": "Débogage", "name": "Messages de débogage", - "filterAll": "tous les noeuds", - "filterSelected": "noeuds sélectionnés", - "filterCurrent": "flux actuel", + "filterAll": "Tous les noeuds", + "filterSelected": "Noeuds sélectionnés", + "filterCurrent": "Flux actuel", "debugNodes": "noeuds de débogage", - "clearLog": "Effacer les messages", - "clearFilteredLog": "Effacer les messages filtrés", + "clearLog": "Tous les messages", + "clearFilteredLog": "Les messages filtrés", "filterLog": "Filtrer les messages", "openWindow": "Ouvrir dans une nouvelle fenêtre", "copyPath": "Copier le chemin", "copyPayload": "Copier la valeur", "pinPath": "Épingler le chemin", - "selectAll": "tout sélectionner", - "selectNone": "ne rien sélectionner", - "all": "tout", - "filtered": "filtré" + "selectAll": "Tout sélectionner", + "selectNone": "Ne rien sélectionner", + "all": "Tout", + "filtered": "Filtrés" }, "messageMenu": { "collapseAll": "Réduire tous les chemins", @@ -177,11 +177,11 @@ "linkIn": "Lien entrant", "linkOut": "Lien sortant", "linkCall": "Appel de lien", - "linkOutReturn": "retour de lien", + "linkOutReturn": "Retour de lien", "outMode": "Mode", "sendToAll": "Envoyer à tous les noeuds de liaison connectés", "returnToCaller": "Retour au noeud de liaison appelant", - "timeout": "temps mort", + "timeout": "Temps mort", "linkCallType": "Type de liaison", "staticLinkCall": "Lien fixe", "dynamicLinkCall": "Lien dynamique (msg.target)", @@ -225,7 +225,7 @@ "command": "Commande", "append": "Joindre", "timeout": "Temps mort", - "timeoutplace": "facultatif", + "timeoutplace": "Facultatif", "return": "Sortie", "seconds": "secondes", "stdout": "stdout", @@ -234,7 +234,7 @@ "winHide": "Masquer la console" }, "placeholder": { - "extraparams": "paramètres d'entrée supplémentaires" + "extraparams": "Paramètres d'entrée supplémentaires" }, "opt": { "exec": "lorsque la commande est terminée - mode exec", @@ -319,7 +319,7 @@ "queuemsg": "Mettre en file d'attente les messages intermédiaires", "dropmsg": "Supprimer les messages intermédiaires", "sendmsg": "Envoyer les messages intermédiaires sur la 2ème sortie", - "allowrate": "autoriser msg.rate (en ms) à remplacer le débit", + "allowrate": "Autoriser msg.rate (en ms) à remplacer le débit", "label": { "delay": "retard", "variable": "variable", @@ -349,7 +349,7 @@ } }, "errors": { - "too-many": "trop de messages en attente dans le noeud 'Delay'", + "too-many": "Trop de messages en attente dans le noeud 'Delay'", "invalid-timeout": "Valeur de délai invalide", "invalid-rate": "Valeur de taux invalide", "invalid-rate-unit": "Valeur de débit invalide", @@ -359,8 +359,8 @@ }, "trigger": { "send": "Envoyer", - "then": "puis", - "then-send": "puis envoyer", + "then": "Puis", + "then-send": "Puis envoyer", "output": { "string": "la chaîne", "number": "le nombre", @@ -381,9 +381,9 @@ "m": "Minutes", "h": "Heures" }, - "extend": " prolonger le délai si un nouveau message arrive", - "override": "remplacer le délai avec msg.delay", - "second": " envoyer un deuxième message à une sortie séparée", + "extend": " Prolonger le délai si un nouveau message arrive", + "override": "Remplacer le délai avec msg.delay", + "second": " Envoyer un deuxième message à une sortie séparée", "label": { "trigger": "déclencher", "trigger-block": "déclencher et bloquer", @@ -408,7 +408,7 @@ "mqtt": { "label": { "broker": "Serveur", - "example": "par exemple. localhost", + "example": "expl. localhost", "output": "Sortie", "qos": "QoS", "retain": "Conserver", @@ -438,7 +438,7 @@ "sessionExpiry": "Expiration de la session (secondes)", "topicAlias": "Alias", "payloadFormatIndicator": "Formater", - "payloadFormatIndicatorFalse": "octets non spécifiés (par défaut)", + "payloadFormatIndicatorFalse": "Octets non spécifiés (par défaut)", "payloadFormatIndicatorTrue": "Charge utile encodée en UTF-8", "protocolVersion": "Protocole", "protocolVersion3": "MQTT V3.1 (hérité)", @@ -493,8 +493,8 @@ "false": "faux", "tip": "Conseil : laisser le sujet, le qos ou le contenu vide si vous souhaitez les définir via les propriétés du msg.", "errors": { - "not-defined": "sujet non défini", - "missing-config": "configuration du courtier manquante", + "not-defined": "Sujet non défini", + "missing-config": "Configuration du courtier manquante", "invalid-topic": "Sujet invalide spécifié", "nonclean-missingclientid": "Aucun ID client défini, utilisation d'une session propre", "invalid-json-string": "Chaîne JSON invalide", @@ -514,7 +514,7 @@ "upload": "Accepter les téléchargements de fichiers ?", "status": "Code d'état", "headers": "En-têtes", - "other": "autre", + "other": "Autre", "paytoqs": { "ignore": "Ignorer", "query": "Joindre aux paramètres de chaîne de requête", @@ -625,7 +625,7 @@ "chars": "caractères", "close": "Fermer", "optional": "(facultatif)", - "reattach": "rattacher le délimiteur" + "reattach": "Rattacher le délimiteur" }, "type": { "listen": "Écoute sur", @@ -633,8 +633,8 @@ "reply": "Répondre sur TCP" }, "output": { - "stream": "flux de", - "single": "unique", + "stream": "Flux de", + "single": "Unique", "buffer": "Tampon", "string": "Chaîne", "base64": "Chaîne en Base64" @@ -657,15 +657,15 @@ "connections_plural": "__count__ connexions" }, "errors": { - "connection-lost": "connexion perdue avec __host__:__port__", - "timeout": "délai d'expiration du port __port__ du socket fermé", - "cannot-listen": "impossible d'écouter sur le port __port__, erreur : __error__", - "error": "erreur : __error__", - "socket-error": "erreur de courtier depuis __host__:__port__", + "connection-lost": "Connexion perdue avec __host__:__port__", + "timeout": "Délai d'expiration du port __port__ du socket fermé", + "cannot-listen": "Impossible d'écouter sur le port __port__, erreur : __error__", + "error": "Erreur : __error__", + "socket-error": "Erreur de courtier depuis __host__:__port__", "no-host": "Hôte et/ou port non défini", - "connect-timeout": "délai de connexion", - "connect-fail": "la connexion a échoué", - "bad-string": "échec de la conversion en chaîne", + "connect-timeout": "Délai de connexion", + "connect-fail": "La connexion a échoué", + "bad-string": "Échec de la conversion en chaîne", "invalid-host": "Hôte invalide", "invalid-port": "Port invalide" } @@ -722,7 +722,7 @@ }, "errors": { "access-error": "Erreur d'accès UDP, vous aurez peut-être besoin d'un accès root pour les ports inférieurs à 1024", - "error": "erreur : __erreur__", + "error": "Erreur : __erreur__", "bad-mcaddress": "Mauvaise adresse de multidiffusion", "interface": "Doit être l'adresse IP de l'interface requise", "ip-notset": "udp : adresse IP non définie", @@ -730,7 +730,7 @@ "port-invalid": "udp : numéro de port non valide", "alreadyused": "udp : port __port__ déjà utilisé", "ifnotfound": "udp : interface __iface__ introuvable", - "invalid-group": "groupe de multidiffusion invalide" + "invalid-group": "Groupe de multidiffusion invalide" } }, "switch": { @@ -738,15 +738,15 @@ "label": { "property": "Propriété", "rule": "règle", - "repair": "recréer des séquences du messages", - "value-rules": "règles de valeur", - "sequence-rules": "règles de séquence" + "repair": "Recréer des séquences du messages", + "value-rules": "Règles de valeur", + "sequence-rules": "Règles de séquence" }, "previous": "valeur précédente", "and": "et", - "checkall": "vérifier toutes les règles", - "stopfirst": "arrêter après la première concordance", - "ignorecase": "ignorer la casse", + "checkall": "Vérifier toutes les règles", + "stopfirst": "Arrêter après la première concordance", + "ignorecase": "Ignorer la casse", "rules": { "btwn": "est entre", "cont": "contient", @@ -767,7 +767,7 @@ }, "errors": { "invalid-expr": "Expression JSONata non valide : __error__", - "too-many": "trop de messages en attente dans le noeud de commutation" + "too-many": "Trop de messages en attente dans le noeud de commutation" } }, "change": { @@ -840,13 +840,13 @@ "entrée": "Entrée", "skip-s": "Passer en premier", "skip-e": "lignes", - "firstrow": "la première ligne contient les noms des colonnes", + "firstrow": "La première ligne contient les noms des colonnes", "output": "Sortie", - "includerow": "inclure la ligne du nom de la colonne", + "includerow": "Inclure la ligne du nom de la colonne", "newline": "Nouvelle ligne", - "usestrings": "analyser les valeurs numériques", - "include_empty_strings": "inclure les chaînes vides", - "include_null_values": "inclure les valeurs nulles" + "usestrings": "Analyser les valeurs numériques", + "include_empty_strings": "Inclure les chaînes vides", + "include_null_values": "Inclure les valeurs nulles" }, "placeholder": { "columns": "noms de colonnes séparés par des virgules" @@ -936,8 +936,8 @@ }, "file": { "label": { - "write": "écrire le fichier", - "read": "lire le fichier", + "write": "Écrire le fichier", + "read": "Lire le fichier", "filename": "Nom du fichier", "path": "chemin", "action": "Action", @@ -972,8 +972,8 @@ "appendedfile": "ajouté au fichier : __file__" }, "encoding": { - "none": "par défaut", - "setbymsg": "défini par msg.encoding", + "none": "Par défaut", + "setbymsg": "Défini par msg.encoding", "native": "Natif", "unicode": "Unicode", "japanese": "Japonais", @@ -990,10 +990,10 @@ "errors": { "nofilename": "Aucun nom de fichier spécifié", "invaliddelete": "Attention : suppression non valide. Veuiller utiliser une option de suppression spécifique dans la boîte de dialogue de configuration.", - "deletefail": "échec de la suppression du fichier : __error__", - "writefail": "échec de l'écriture dans le fichier : __error__", - "appendfail": "échec de l'ajout au fichier : __error__", - "createfail": "échec de la création du fichier : __error__" + "deletefail": "Échec de la suppression du fichier : __error__", + "writefail": "Échec de l'écriture dans le fichier : __error__", + "appendfail": "Échec de l'ajout au fichier : __error__", + "createfail": "Échec de la création du fichier : __error__" }, "tip": "Astuce : Le nom du fichier doit être un chemin absolu, sinon il sera relatif au répertoire de travail du processus Node-RED." }, @@ -1018,9 +1018,9 @@ "reduce": "réduire la séquence", "custom": "manuel" }, - "combine": "Combine each", + "combine": "Combiner chaque", "completeMessage": "message complet", - "create": "créer", + "create": "Créer", "type": { "string": "une Chaîne", "array": "un Tableau", @@ -1028,13 +1028,13 @@ "object": "un Objet clé/valeur", "merged": "un Objet fusionné" }, - "using": "en utilisant la valeur de", - "key": "comme la clé", + "using": "En utilisant la valeur du", + "key": "comme clé", "joinedUsing": "joint en utilisant", "send": "Envoyer le message :", - "afterCount": "Après un certain nombre de parties du message", - "count": "compter", - "subsequent": "et tous les messages suivants.", + "afterCount": "Après un nombre de parties du message", + "count": "nombre", + "subsequent": "Et tous les messages suivants.", "afterTimeout": "Après un délai d'attente après le premier message", "seconds": "secondes", "complete": "Après un message avec la propriété msg.complete définie", @@ -1068,10 +1068,10 @@ "order": "Sens", "ascending": "croissant", "descending": "descendant", - "as-number": "comme nombre", + "as-number": "Comme nombre", "invalid-exp": "Expression JSONata invalide dans le noeud sort: __message__", "too-many": "Trop de messages en attente dans le noeud sort", - "clear": "effacer le message en attente dans le noeud sort" + "clear": "Effacer le message en attente dans le noeud sort" }, "batch": { "batch": "Regrouper", @@ -1084,21 +1084,21 @@ "count": { "label": "Nombre de messages", "overlap": "Chevauchement", - "count": "compter", + "count": "nombre", "invalid": "Comptage et chevauchement invalides" }, "interval": { "label": "Intervalle", "seconds": "secondes", - "empty": "envoyer un message vide lorsqu'aucun message n'arrive" + "empty": "Envoyer un message vide lorsqu'aucun message n'arrive" }, "concat": { "topics-label": "Sujets", "topic": "sujet" }, - "too-many": "trop de messages en attente dans le noeud batch", - "unexpected": "mode inattendu", - "no-parts": "aucune propriété de pièces dans le message", + "too-many": "Trop de messages en attente dans le noeud batch", + "unexpected": "Mode inattendu", + "no-parts": "Aucune propriété de pièces dans le message", "error": { "invalid-count": "Compte invalide", "invalid-overlap": "Recouvrement invalide", @@ -1132,7 +1132,7 @@ "out": "par rapport à la dernière valeur de sortie valide" }, "warn": { - "nonumber": "aucun numéro trouvé dans la charge utile" + "nonumber": "Aucun numéro trouvé dans la charge utile" } }, "global-config": { diff --git a/packages/node_modules/@node-red/registry/lib/externalModules.js b/packages/node_modules/@node-red/registry/lib/externalModules.js index b76f748a4..7cedadb05 100644 --- a/packages/node_modules/@node-red/registry/lib/externalModules.js +++ b/packages/node_modules/@node-red/registry/lib/externalModules.js @@ -98,7 +98,7 @@ function requireModule(module) { const parsedModule = parseModuleName(module); if (BUILTIN_MODULES.indexOf(parsedModule.module) !== -1) { - return require(parsedModule.module); + return require(parsedModule.module + parsedModule.subpath); } if (!knownExternalModules[parsedModule.module]) { const e = new Error("Module not allowed"); @@ -131,7 +131,7 @@ function importModule(module) { const parsedModule = parseModuleName(module); if (BUILTIN_MODULES.indexOf(parsedModule.module) !== -1) { - return import(parsedModule.module); + return import(parsedModule.module + parsedModule.subpath); } if (!knownExternalModules[parsedModule.module]) { const e = new Error("Module not allowed"); @@ -152,12 +152,13 @@ function importModule(module) { } function parseModuleName(module) { - var match = /((?:@[^/]+\/)?[^/@]+)(?:@([\s\S]+))?/.exec(module); + var match = /((?:@[^/]+\/)?[^/@]+)(\/[^/@]+)?(?:@([\s\S]+))?/.exec(module); if (match) { return { spec: module, module: match[1], - version: match[2], + subpath: match[2] || '', + version: match[3], builtin: BUILTIN_MODULES.indexOf(match[1]) !== -1, known: !!knownExternalModules[match[1]] } @@ -263,7 +264,7 @@ async function installModule(moduleDetails) { "module": moduleDetails.module, "version": moduleDetails.version, "dir": installDir, - "args": ["--production","--engine-strict"] + "args": ["--omit=dev","--engine-strict"] } return hooks.trigger("preInstall", triggerPayload).then((result) => { // preInstall passed @@ -283,6 +284,7 @@ async function installModule(moduleDetails) { const runtimeInstalledModules = settings.get("modules") || {}; runtimeInstalledModules[moduleDetails.module] = moduleDetails; settings.set("modules",runtimeInstalledModules) + log.audit({event: "modules.install",module:moduleDetails.module, version:moduleDetails.version}); }).catch(result => { var output = result.stderr || result.toString(); var e; diff --git a/packages/node_modules/@node-red/registry/lib/installer.js b/packages/node_modules/@node-red/registry/lib/installer.js index 95022fbb1..aeb22be3d 100644 --- a/packages/node_modules/@node-red/registry/lib/installer.js +++ b/packages/node_modules/@node-red/registry/lib/installer.js @@ -215,7 +215,7 @@ async function installModule(module,version,url) { "dir": installDir, "isExisting": isExisting, "isUpgrade": isUpgrade, - "args": ['--no-audit','--no-update-notifier','--no-fund','--save','--save-prefix=~','--production','--engine-strict'] + "args": ['--no-audit','--no-update-notifier','--no-fund','--save','--save-prefix=~','--omit=dev','--engine-strict'] } return hooks.trigger("preInstall", triggerPayload).then((result) => { diff --git a/packages/node_modules/@node-red/registry/lib/loader.js b/packages/node_modules/@node-red/registry/lib/loader.js index d125156ab..27783be7f 100644 --- a/packages/node_modules/@node-red/registry/lib/loader.js +++ b/packages/node_modules/@node-red/registry/lib/loader.js @@ -143,6 +143,12 @@ function loadModuleFiles(modules) { return loadNodeSetList(pluginList); }).then(function() { return loadNodeSetList(nodeList); + }).then(function () { + if (settings.available()) { + return registry.saveNodeList(); + } else { + return + } }) } @@ -436,7 +442,7 @@ async function loadPlugin(plugin) { return plugin; } } - +let invocation = 0 function loadNodeSetList(nodes) { var promises = []; nodes.forEach(function(node) { @@ -451,13 +457,7 @@ function loadNodeSetList(nodes) { } }); - return Promise.all(promises).then(function() { - if (settings.available()) { - return registry.saveNodeList(); - } else { - return; - } - }); + return Promise.all(promises) } function addModule(module) { diff --git a/packages/node_modules/@node-red/runtime/lib/api/context.js b/packages/node_modules/@node-red/runtime/lib/api/context.js index 6716b6831..f27075577 100644 --- a/packages/node_modules/@node-red/runtime/lib/api/context.js +++ b/packages/node_modules/@node-red/runtime/lib/api/context.js @@ -68,6 +68,7 @@ var api = module.exports = { * @param {String} opts.store - the context store * @param {String} opts.key - the context key * @param {Object} opts.req - the request to log (optional) + * @param {Boolean} opts.keysOnly - whether to return keys only * @return {Promise} - the node information * @memberof @node-red/runtime_context */ @@ -102,6 +103,15 @@ var api = module.exports = { if (key) { store = store || availableStores.default; ctx.get(key,store,function(err, v) { + if (opts.keysOnly) { + if (Array.isArray(v)) { + resolve({ [store]: { format: `array[${v.length}]`}}) + } else if (typeof v === 'object') { + resolve({ [store]: { keys: Object.keys(v), format: 'Object' } }) + } else { + resolve({ [store]: { keys: [] }}) + } + } var encoded = util.encodeObject({msg:v}); if (store !== availableStores.default) { encoded.store = store; @@ -118,32 +128,58 @@ var api = module.exports = { stores = [store]; } + var result = {}; var c = stores.length; var errorReported = false; stores.forEach(function(store) { - exportContextStore(scope,ctx,store,result,function(err) { - if (err) { - // TODO: proper error reporting - if (!errorReported) { - errorReported = true; - runtime.log.audit({event: "context.get",scope:scope,id:id,store:store,key:key,error:"unexpected_error"}, opts.req); - var err = new Error(); - err.code = "unexpected_error"; - err.status = 400; - return reject(err); + if (opts.keysOnly) { + ctx.keys(store,function(err, keys) { + if (err) { + // TODO: proper error reporting + if (!errorReported) { + errorReported = true; + runtime.log.audit({event: "context.get",scope:scope,id:id,store:store,key:key,error:"unexpected_error"}, opts.req); + var err = new Error(); + err.code = "unexpected_error"; + err.status = 400; + return reject(err); + } + return } + result[store] = { keys } + c--; + if (c === 0) { + if (!errorReported) { + runtime.log.audit({event: "context.get",scope:scope,id:id,store:store,key:key},opts.req); + resolve(result); + } + } + }) + } else { + exportContextStore(scope,ctx,store,result,function(err) { + if (err) { + // TODO: proper error reporting + if (!errorReported) { + errorReported = true; + runtime.log.audit({event: "context.get",scope:scope,id:id,store:store,key:key,error:"unexpected_error"}, opts.req); + var err = new Error(); + err.code = "unexpected_error"; + err.status = 400; + return reject(err); + } - return; - } - c--; - if (c === 0) { - if (!errorReported) { - runtime.log.audit({event: "context.get",scope:scope,id:id,store:store,key:key},opts.req); - resolve(result); + return; } - } - }); + c--; + if (c === 0) { + if (!errorReported) { + runtime.log.audit({event: "context.get",scope:scope,id:id,store:store,key:key},opts.req); + resolve(result); + } + } + }); + } }) } } else { diff --git a/packages/node_modules/@node-red/runtime/lib/api/settings.js b/packages/node_modules/@node-red/runtime/lib/api/settings.js index 2399a3152..13f2cec4e 100644 --- a/packages/node_modules/@node-red/runtime/lib/api/settings.js +++ b/packages/node_modules/@node-red/runtime/lib/api/settings.js @@ -99,6 +99,9 @@ var api = module.exports = { safeSettings.markdownEditor = runtime.settings.editorTheme.markdownEditor || {}; safeSettings.markdownEditor.mermaid = safeSettings.markdownEditor.mermaid || { enabled: true }; } + if (runtime.settings.editorTheme.mermaid) { + safeSettings.mermaid = runtime.settings.editorTheme.mermaid + } } safeSettings.libraries = runtime.library.getLibraries(); if (util.isArray(runtime.settings.paletteCategories)) { diff --git a/packages/node_modules/@node-red/runtime/lib/flows/Flow.js b/packages/node_modules/@node-red/runtime/lib/flows/Flow.js index ce2dab9ef..b541a9d95 100644 --- a/packages/node_modules/@node-red/runtime/lib/flows/Flow.js +++ b/packages/node_modules/@node-red/runtime/lib/flows/Flow.js @@ -161,7 +161,8 @@ class Flow { for (let i = 0; i < configNodes.length; i++) { const node = this.flow.configs[configNodes[i]] if (node.type === 'global-config' && node.env) { - const nodeEnv = await flowUtil.evaluateEnvProperties(this, node.env, credentials.get(node.id)) + const globalCreds = credentials.get(node.id)?.map || {} + const nodeEnv = await flowUtil.evaluateEnvProperties(this, node.env, globalCreds) this._env = { ...this._env, ...nodeEnv } } } @@ -484,7 +485,7 @@ class Flow { } if (!key.startsWith("$parent.")) { if (this._env.hasOwnProperty(key)) { - return this._env[key] + return (Object.hasOwn(this._env[key], 'value') && this._env[key].__clone__) ? clone(this._env[key].value) : this._env[key] } } else { key = key.substring(8); diff --git a/packages/node_modules/@node-red/runtime/lib/flows/Group.js b/packages/node_modules/@node-red/runtime/lib/flows/Group.js index dc05211a1..521b6ceda 100644 --- a/packages/node_modules/@node-red/runtime/lib/flows/Group.js +++ b/packages/node_modules/@node-red/runtime/lib/flows/Group.js @@ -41,7 +41,7 @@ class Group { } if (!key.startsWith("$parent.")) { if (this._env.hasOwnProperty(key)) { - return this._env[key] + return (Object.hasOwn(this._env[key], 'value') && this._env[key].__clone__) ? clone(this._env[key].value) : this._env[key] } } else { key = key.substring(8); diff --git a/packages/node_modules/@node-red/runtime/lib/flows/Subflow.js b/packages/node_modules/@node-red/runtime/lib/flows/Subflow.js index 5d52beeb7..62948d203 100644 --- a/packages/node_modules/@node-red/runtime/lib/flows/Subflow.js +++ b/packages/node_modules/@node-red/runtime/lib/flows/Subflow.js @@ -73,9 +73,20 @@ class Subflow extends Flow { id: subflowInstance.id, configs: {}, nodes: {}, + groups: {}, subflows: {} } + if (subflowDef.groups) { + // Clone all of the subflow group definitions and give them new IDs + for (i in subflowDef.groups) { + if (subflowDef.groups.hasOwnProperty(i)) { + node = createNodeInSubflow(subflowInstance.id,subflowDef.groups[i]); + node_map[node._alias] = node; + subflowInternalFlowConfig.groups[node.id] = node; + } + } + } if (subflowDef.configs) { // Clone all of the subflow config node definitions and give them new IDs for (i in subflowDef.configs) { @@ -101,6 +112,7 @@ class Subflow extends Flow { remapSubflowNodes(subflowInternalFlowConfig.configs,node_map); remapSubflowNodes(subflowInternalFlowConfig.nodes,node_map); + remapSubflowNodes(subflowInternalFlowConfig.groups,node_map); // console.log("Instance config\n",JSON.stringify(subflowInternalFlowConfig,"",2)); @@ -200,6 +212,7 @@ class Subflow extends Flow { var subflowInstanceConfig = { id: this.subflowInstance.id, type: this.subflowInstance.type, + g: this.subflowInstance.g, z: this.subflowInstance.z, name: this.subflowInstance.name, wires: [], @@ -237,7 +250,7 @@ class Subflow extends Flow { for (j=0;j { redUtil.evaluateNodeProperty(value, 'jsonata', {_flow: flow}, null, (err, result) => { if (!err) { + if (typeof result === 'object') { + result = { value: result, __clone__: true} + } evaluatedEnv[name] = result } resolve() @@ -106,12 +112,16 @@ async function evaluateEnvProperties(flow, env, credentials) { })) } else { value = redUtil.evaluateNodeProperty(value, type, {_flow: flow}, null, null); + if (typeof value === 'object') { + value = { value: value, __clone__: true} + } } evaluatedEnv[name] = value } if (pendingEvaluations.length > 0) { await Promise.all(pendingEvaluations) } + // Now loop over the env types and evaluate them properly for (let i = 0; i < envTypes.length; i++) { let { name, value, type } = envTypes[i] // If an env-var wants to lookup itself, delegate straight to the parent @@ -122,10 +132,25 @@ async function evaluateEnvProperties(flow, env, credentials) { if (evaluatedEnv.hasOwnProperty(value)) { value = evaluatedEnv[value] } else { - value = redUtil.evaluateNodeProperty(value, type, {_flow: flow}, null, null); + value = redUtil.evaluateNodeProperty(value, type, {_flow: { + // Provide a hook so when it tries to look up a flow setting, + // we can insert the just-evaluated value which hasn't yet + // been set on the flow object - otherwise delegate up to the flow + getSetting: function(name) { + if (evaluatedEnv.hasOwnProperty(name)){ + return evaluatedEnv[name] + } + return flow.getSetting(name) + } + }}, null, null); + } + if (typeof value === 'object' && !value.__clone__) { + value = { value: value, __clone__: true} } evaluatedEnv[name] = value + } + // console.log(evaluatedEnv) return evaluatedEnv } diff --git a/packages/node_modules/@node-red/runtime/lib/index.js b/packages/node_modules/@node-red/runtime/lib/index.js index 74f03c55c..7fc9af041 100644 --- a/packages/node_modules/@node-red/runtime/lib/index.js +++ b/packages/node_modules/@node-red/runtime/lib/index.js @@ -27,6 +27,7 @@ var express = require("express"); var path = require('path'); var fs = require("fs"); var os = require("os"); +const crypto = require("crypto") const {log,i18n,events,exec,util,hooks} = require("@node-red/util"); @@ -51,7 +52,7 @@ var adminApi = { var nodeApp; var adminApp; var server; - +let userSettings; /** * Initialise the runtime module. @@ -61,8 +62,9 @@ var server; * better abstracted. * @memberof @node-red/runtime */ -function init(userSettings,httpServer,_adminApi) { +function init(_userSettings,httpServer,_adminApi) { server = httpServer; + userSettings = _userSettings if (server && server.on) { // Add a listener to the upgrade event so that we can properly timeout connection @@ -134,7 +136,12 @@ function start() { .then(function() { return settings.load(storage)}) .then(function() { return library.init(runtime)}) .then(function() { - + if (settings.available()) { + if (settings.get('instanceId') === undefined) { + settings.set('instanceId', crypto.randomBytes(8).toString('hex')) + } + userSettings.instanceId = settings.get('instanceId') || '' + } if (log.metric()) { runtimeMetricInterval = setInterval(function() { reportMetrics(); @@ -147,7 +154,7 @@ function start() { log.info(log._("runtime.version",{component:"Node.js ",version:process.version})); if (settings.UNSUPPORTED_VERSION) { log.error("*****************************************************************"); - log.error("* "+log._("runtime.unsupported_version",{component:"Node.js",version:process.version,requires: ">=8.9.0"})+" *"); + log.error("* "+log._("runtime.unsupported_version",{component:"Node.js",version:process.version,requires: ">=18"})+" *"); log.error("*****************************************************************"); events.emit("runtime-event",{id:"runtime-unsupported-version",payload:{type:"error",text:"notification.errors.unsupportedVersion"},retain:true}); } 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 7a7445a92..5a60cf6a0 100644 --- a/packages/node_modules/@node-red/runtime/lib/nodes/Node.js +++ b/packages/node_modules/@node-red/runtime/lib/nodes/Node.js @@ -42,6 +42,7 @@ function Node(n) { this._closeCallbacks = []; this._inputCallback = null; this._inputCallbacks = null; + this._expectedDoneCount = 0; if (n.name) { this.name = n.name; @@ -159,6 +160,9 @@ Node.prototype.on = function(event, callback) { if (event == "close") { this._closeCallbacks.push(callback); } else if (event === "input") { + if (callback.length === 3) { + this._expectedDoneCount++ + } if (this._inputCallback) { this._inputCallbacks = [this._inputCallback, callback]; this._inputCallback = null; @@ -218,19 +222,17 @@ Node.prototype._emitInput = function(arg) { } else if (node._inputCallbacks) { // Multiple callbacks registered. Call each one, tracking eventual completion var c = node._inputCallbacks.length; + let doneCount = 0 for (var i=0;i { + if (!newCreds.map?.[key]) { + // This key doesn't exist in the new credentials list - remove + delete savedCredentials.map[key] + delete savedCredentials.map[`has_${key}`] + dirty = true + } + }) + newCredentialKeys.forEach(key => { + if (!/^has_/.test(key)) { + if (!savedCredentials.map[key] || newCreds.map[key] !== '__PWRD__') { + // This key either doesn't exist in current saved, or the + // value has been changed + savedCredentials.map[key] = newCreds.map[key] + savedCredentials.map[`has_${key}`] = newCreds.map[`has_${key}`] + dirty = true + } + } + }) } else { var dashedType = nodeType.replace(/\s+/g, '-'); var definition = credentialsDef[dashedType]; diff --git a/packages/node_modules/@node-red/runtime/locales/es-ES/runtime.json b/packages/node_modules/@node-red/runtime/locales/es-ES/runtime.json new file mode 100644 index 000000000..8f63cb01e --- /dev/null +++ b/packages/node_modules/@node-red/runtime/locales/es-ES/runtime.json @@ -0,0 +1,195 @@ +{ + "runtime": { + "welcome": "Bienvenid@ a Node-RED", + "version": "__component__ versión: __version__", + "unsupported_version": "Versión no soportada de __component__. Requiere: __requires__ Encontrado: __version__", + "paths": { + "settings": "Fichero de Ajustes : __path__", + "httpStatic": "HTTP Estático : __path__" + } + }, + "server": { + "loading": "Cargando paleta de nodos", + "palette-editor": { + "disabled": "Editor de paletas desactivado : ajustes de usuario", + "npm-not-found": "Editor de paletas desactivado : comando npm no encontrado", + "npm-too-old": "Editor de paletas desactivado : versión npm demasiado vieja. Requiere npm >= 3.x" + }, + "errors": "Fallo al registrar __count__ tipo de nodo.", + "errors_plural": "Fallo al registrar __count__ tipos de nodo.", + "errors-help": "Ejecutar con -v para más detalles", + "missing-modules": "Faltan módulos de nodos:", + "node-version-mismatch": "El nodo de módulo no puede cargarse en esta versión. Requiere: __version__ ", + "set-has-no-types": "Establece no tiene ningún tipo. nombre: '__name__', módulo: '__module__', fichero: '__file__'", + "type-already-registered": "'__type__' ya registrado por módulo __module__", + "removing-modules": "Eliminando módulos de la configuración", + "added-types": "Tipos de nodos añadidos:", + "removed-types": "Tipos de nodos eliminados:", + "install": { + "invalid": "Nombre de módulo no válido", + "installing": "Instalando módulo: __name__, versión: __version__", + "installed": "Módulo instalado: __name__", + "install-failed": "Error de instalación", + "install-failed-long": "Fallo en la instalación del módulo __name__:", + "install-failed-not-found": "$t(server.install.install-failed-long) módulo no encontrado", + "install-failed-name": "$t(server.install.install-failed-long) nombre de módulo inválido: __name__", + "install-failed-url": "$t(server.install.install-failed-long) URL inválida: __url__", + "post-install-error": "Error ejecutando código 'postInstall':", + "upgrading": "Actualizando módulo: __name__ a la versión: __version__", + "upgraded": "Módulo actualizado: __name__. Reinicia Node-RED para utilizar la nueva versión", + "upgrade-failed-not-found": "$t(server.install.install-failed-long) versión no encontrada", + "uninstalling": "Desinstalando el módulo: __name__", + "uninstall-failed": "Error de desinstalación", + "uninstall-failed-long": "Error en la desinstalación del módulo __name__:", + "uninstalled": "Desinstalando módulo: __name__", + "old-ext-mod-dir-warning": "\n\n---------------------------------------------------------------------\nDirectorio de módulos externos Node-RED 1.3 detectado:\n __oldDir__\nEste directorio ya no se utiliza. Los módulos externos serán reinstalado en tu directorio de usuario Node-RED:__newDir__\nBorra el antiguo directorio externalModules para eliminar este mensaje.\n---------------------------------------------------------------------\n" + }, + "deprecatedOption": "__old__ está en DESUSO. Utiliza __new__", + "unable-to-listen": "No se puede escuchar __listenpath__", + "port-in-use": "Error: puerto en uso", + "uncaught-exception": "Excepción no detectada:", + "admin-ui-disabled": "IU de administrador deshabilitado", + "now-running": "El servidor está funcionando en __listenpath__", + "failed-to-start": "No se pudo iniciar el servidor:", + "headless-mode": "Ejecutando en modo sin interfaz", + "httpadminauth-deprecated": "httpAdminAuth está en DESUSO. Utiliza adminAuth", + "https": { + "refresh-interval": "Actualizando la configuración HTTPS cada __interval__ horas", + "settings-refreshed": "La configuración HTTPS del servidor se ha actualizado", + "refresh-failed": "No se pudo actualizar la configuración HTTPS: __message__", + "nodejs-version": "httpsRefreshInterval requiere Node.js 11 o superior", + "function-required": "httpsRefreshInterval requiere que la propiedad HTTPS sea una función" + } + }, + "api": { + "flows": { + "error-save": "Error al guardar flujos: __message__", + "error-reload": "Error al recargar flujos: __message__" + }, + "library": { + "error-load-entry": "Error al cargar la entrada de la librería '__path__': __message__", + "error-save-entry": "Error al guardar la entrada de la librería '__path__': __message__", + "error-load-flow": "Error al cargar el flujo '__path__': __message__", + "error-save-flow": "Error al guardar el flujo '__path__': __message__" + }, + "nodes": { + "enabled": "Tipos de nodo habilitados:", + "disabled": "Tipos de nodo deshabilitados:", + "error-enable": "Fallo al habilitar nodo:" + } + }, + "comms": { + "error": "Error del canal de comunicación: __message__", + "error-server": "Error del servidor de comunicación: __message__", + "error-send": "Error de envío de comunicación: __message__" + }, + "settings": { + "user-not-available": "No se puede guardar la configuración del usuario: __message__", + "not-available": "Ajustes no disponibles", + "property-read-only": "La propiedad '__prop__' es de sólo lectura", + "readonly-mode": "Ejecución en modo de sólo lectura. Los cambios no se guardarán." + }, + "library": { + "unknownLibrary": "Librería desconocida: __library__", + "unknownType": "Tipo de librería desconocida: __type__", + "readOnly": "La librería __library__ es de sólo lectura", + "failedToInit": "Error al inicializar la librería __library__: __error__", + "invalidProperty": "Propiedad inválida __prop__: '__value__'" + }, + "nodes": { + "credentials": { + "error": "Error al cargar las credenciales: __message__", + "error-saving": "Error al guardar credenciales: __message__", + "not-registered": "El tipo de credencial '__type__' no está registrado", + "system-key-warning": "\n\n---------------------------------------------------------------------\nTu archivo de credenciales de flujo se cifra utilizando una clave generada por el sistema. Si la clave generada por el sistema se pierde por cualquier motivo, tu archivo de credenciales no será recuperable, tendrás que borrarlo y volver a introducir tus credenciales. Node-RED volverá a cifrar tu archivo de credenciales utilizando la clave elegida la próxima vez que instancias un cambio.\n---------------------------------------------------------------------\n", + "unencrypted": "Usando credenciales no encriptadas", + "encryptedNotFound": "Credenciales encriptadas no encontradas" + }, + "flows": { + "safe-mode": "Flujos detenidos en modo seguro. Instancia para iniciar", + "registered-missing": "Falta tipo registrado: __type__", + "error": "Error al cargar flujos: __message__", + "starting-modified-nodes": "Iniciando nodos modificados", + "starting-modified-flows": "Iniciando flujos modificados", + "starting-flows": "Iniciando flujos", + "started-modified-nodes": "Nodos modificados iniciados", + "started-modified-flows": "Flujos modificados iniciados", + "started-flows": "Flujos iniciados", + "stopping-modified-nodes": "Detención de nodos modificados", + "stopping-modified-flows": "Detención de flujos modificados", + "stopping-flows": "Flujos detenidos", + "stopped-modified-nodes": "Nodos modificados detenidos", + "stopped-modified-flows": "Flujos modificados detenidos", + "stopped-flows": "Flujos detenidos", + "stopped": "Detenido", + "stopping-error": "Error al detener el nodo: __message__", + "updated-flows": "Flujos actualizados", + "added-flow": "Añadiendo flujo: __label__", + "updated-flow": "Flujo actualizado: __label__", + "removed-flow": "Flujo eliminado: __label__", + "missing-types": "Esperando a que se registren los tipos que faltan:", + "missing-type-provided": " - __type__ (proporcionado por el módulo npm __module__)", + "missing-type-install-1": "Para instalar cualquiera de estos módulos que faltan, ejecuta:", + "missing-type-install-2": "en el directorio:" + }, + "flow": { + "unknown-type": "Tipo desconocido: __type__", + "missing-types": "tipos que faltan", + "error-loop": "El mensaje superó el número máximo de capturas", + "non-message-returned": "El nodo intentó enviar un mensaje del tipo __type__" + }, + "index": { + "unrecognised-id": "id no reconocido: __id__", + "type-in-use": "Tipo en uso: __msg__", + "unrecognised-module": "Módulo no reconocido: __module__" + }, + "registry": { + "localfilesystem": { + "module-not-found": "No se puede encontrar el módulo '__module__'" + } + } + }, + "storage": { + "index": { + "forbidden-flow-name": "nombre de flujo prohibido" + }, + "localfilesystem": { + "user-dir": "Directorio de usuario : __path__", + "flows-file": "Archivo de flujos : __path__", + "create": "Creando nuevo archivo __type__", + "empty": "El archivo __type__ existente está vacío", + "invalid": "El archivo __type__ existente no es un JSON válido", + "restore": "Restaurando copia de seguridad de archivo __type__ : __path__", + "restore-fail": "Error al restaurar la copia de seguridad del archivo __type__ : __message__", + "fsync-fail": "Fallo en el volcado del archivo __path__ al disco : __message__", + "warn_name": "Nombre de archivo de flujos indefinido. Generando usando nombre de servidor", + "projects": { + "changing-project": "Configuración del proyecto activo : __project__", + "active-project": "Proyecto activo : __project__", + "projects-directory": "Directorio de proyectos: __projectsDirectory__", + "project-not-found": "Proyecto no encontrado : __project__", + "no-active-project": "No hay proyecto activo: se utiliza el archivo de flujos por defecto", + "disabled": "Proyectos desactivados : editorTheme.projects.enabled=false", + "disabledNoFlag": "Proyectos desactivados : establece editorTheme.projects.enabled=true a habilitado", + "git-not-found": "Proyectos desactivados : comando git no encontrado", + "git-version-old": "Proyectos desactivados : git __version__ no soportada. Requiere 2.x", + "summary": "Un Proyecto Node-RED", + "readme": "### Acerca de\n\nEste es el archivo README.md de tu proyecto. Ayuda a los usuarios a entender qué hace tu proyecto, cómo usarlo y cualquier otra cosa que necesiten saber." + } + } + }, + "context": { + "log-store-init": "Almacén de contexto : '__name__' [__info__]", + "error-loading-module": "Error al cargar el almacén de contexto: __message__", + "error-loading-module2": "Error al cargar el almacén de contexto '__module__': __message__", + "error-module-not-defined": "Falta la opción 'module' en el almacén de contexto '__storage__'.", + "error-invalid-module-name": "Nombre de almacén de contexto no válido: '__name__'", + "error-invalid-default-module": "Almacén de contexto por defecto desconocido: '__storage__'", + "unknown-store": "Se ha especificado un almacén de contexto desconocido '__name__'. Usando almacén por defecto.", + "localfilesystem": { + "invalid-json": "JSON no válido en el archivo de contexto '__file__'", + "error-circular": "El contexto __scope__ contiene una referencia circular que no se puede mantener", + "error-write": "Error al escribir el contexto: __message__" + } + } +} diff --git a/packages/node_modules/@node-red/runtime/locales/fr/runtime.json b/packages/node_modules/@node-red/runtime/locales/fr/runtime.json index dc91e7b4d..0f5be3054 100644 --- a/packages/node_modules/@node-red/runtime/locales/fr/runtime.json +++ b/packages/node_modules/@node-red/runtime/locales/fr/runtime.json @@ -26,8 +26,8 @@ "removed-types": "Types de noeuds supprimés :", "install": { "invalid": "Nom de module invalide", - "installing": "Installation du module : __nom__, version : __version__", - "installed": "Module installé : __nom__", + "installing": "Installation du module : __name__, version : __version__", + "installed": "Module installé : __name__", "install-failed": "L'installation a échoué", "install-failed-long": "L'installation du module __name__ a échoué :", "install-failed-not-found": "Module $t(server.install.install-failed-long) introuvable", @@ -48,7 +48,7 @@ "port-in-use": "Erreur : port utilisé", "uncaught-exception": "Exception non reconnue :", "admin-ui-disabled": "Interface d'administration désactivée", - "now-running": "Le serveur tourne maintenant sur __listenpath__", + "now-running": "Le serveur est disponible à l'adresse __listenpath__", "failed-to-start": "Échec lors du démarrage du serveur :", "headless-mode": "Fonctionne en mode sans interface graphique (headless)", "httpadminauth-deprecated": "L'utilisation de httpAdminAuth est DÉCONSEILLÉE. Utiliser adminAuth à la place", @@ -100,7 +100,7 @@ "error": "Erreur lors du chargement des identifiants : __message__", "error-saving": "Erreur lors de l'enregistrement des identifiants : __message__", "not-registered": "Le type d'identifiant '__type__' n'a pas été enregistré", - "system-key-warning": "\n\n---------------------------------------------------------------------\nVotre fichier contenant les identifiants de flux est chiffré à l'aide d'une clé générée par le système.\n\nSi la clé générée par le système est perdue pour une raison quelconque, votre fichier contenant\nles identifiants ne sera pas récupérable, vous devrez le supprimer et ressaisir vos identifiants.\n\nVous pouvez définir votre propre clé en utilisant l'option 'credentialSecret' dans\nvotre fichier de paramètres. Node-RED rechiffrera alors votre fichier contenant les identifiants\nà l'aide de la clé que vous avez choisie la prochaine fois que vous déploierez une modification.\n---------------------------------------------------------------------\n", + "system-key-warning": "\n\n--------------------------------------------------------------------------------------------------------\nVotre fichier contenant les identifiants de flux est chiffré à l'aide d'une clé générée par le système.\n\nSi la clé générée par le système est perdue pour une raison quelconque, votre fichier contenant\nles identifiants ne sera pas récupérable, vous devrez le supprimer et ressaisir vos identifiants.\n\nVous pouvez définir votre propre clé en utilisant l'option 'credentialSecret' dans\nvotre fichier de paramètres. Node-RED rechiffrera alors votre fichier contenant les identifiants\nà l'aide de la clé que vous avez choisie la prochaine fois que vous déploierez une modification.\n--------------------------------------------------------------------------------------------------------\n", "unencrypted": "Utilisation d'identifiants non chiffrés", "encryptedNotFound": "Identifiants chiffrés introuvables" }, diff --git a/packages/node_modules/@node-red/util/lib/util.js b/packages/node_modules/@node-red/util/lib/util.js index ea5ffbbe3..4896789b6 100644 --- a/packages/node_modules/@node-red/util/lib/util.js +++ b/packages/node_modules/@node-red/util/lib/util.js @@ -636,7 +636,15 @@ function evaluateNodeProperty(value, type, node, msg, callback) { } else if (type === 're') { result = new RegExp(value); } else if (type === 'date') { - result = Date.now(); + if (!value) { + result = Date.now(); + } else if (value === 'object') { + result = new Date() + } else if (value === 'iso') { + result = (new Date()).toISOString() + } else { + result = moment().format(value) + } } else if (type === 'bin') { var data = JSON.parse(value); if (Array.isArray(data) || (typeof(data) === "string")) { @@ -769,12 +777,15 @@ function evaluateJSONataExpression(expr,msg,callback) { }); } } else { - log.warn('Deprecated API warning: Calls to RED.util.evaluateJSONataExpression must include a callback. '+ - 'This will not be optional in Node-RED 4.0. Please identify the node from the following stack '+ - 'and check for an update on npm. If none is available, please notify the node author.') - log.warn(new Error().stack) + const error = new Error('Calls to RED.util.evaluateJSONataExpression must include a callback.') + throw error } - return expr.evaluate(context, bindings, callback); + + expr.evaluate(context, bindings).then(result => { + callback(null, result) + }).catch(err => { + callback(err) + }) } /** diff --git a/packages/node_modules/@node-red/util/package.json b/packages/node_modules/@node-red/util/package.json index 7b8e87129..be92977de 100644 --- a/packages/node_modules/@node-red/util/package.json +++ b/packages/node_modules/@node-red/util/package.json @@ -18,7 +18,7 @@ "fs-extra": "11.1.1", "i18next": "21.10.0", "json-stringify-safe": "5.0.1", - "jsonata": "1.8.6", + "jsonata": "2.0.4", "lodash.clonedeep": "^4.5.0", "moment": "2.29.4", "moment-timezone": "0.5.43" diff --git a/packages/node_modules/node-red/lib/red.js b/packages/node_modules/node-red/lib/red.js index a61adf1c2..93c983ce3 100644 --- a/packages/node_modules/node-red/lib/red.js +++ b/packages/node_modules/node-red/lib/red.js @@ -26,15 +26,14 @@ var server = null; var apiEnabled = false; const NODE_MAJOR_VERSION = process.versions.node.split('.')[0]; -if (NODE_MAJOR_VERSION > 14) { - const dns = require('node:dns'); +if (NODE_MAJOR_VERSION >= 16) { + const dns = require('dns'); dns.setDefaultResultOrder('ipv4first'); } function checkVersion(userSettings) { var semver = require('semver'); - if (!semver.satisfies(process.version,">=14.0.0")) { - // TODO: in the future, make this a hard error. + if (!semver.satisfies(process.version,">=18.0.0")) { // var e = new Error("Unsupported version of Node.js"); // e.code = "unsupported_version"; // throw e; diff --git a/packages/node_modules/node-red/package.json b/packages/node_modules/node-red/package.json index ebe133b51..9e54ad381 100644 --- a/packages/node_modules/node-red/package.json +++ b/packages/node_modules/node-red/package.json @@ -39,7 +39,7 @@ "bcryptjs": "2.4.3", "express": "4.18.2", "fs-extra": "11.1.1", - "node-red-admin": "^3.1.0", + "node-red-admin": "^3.1.2", "nopt": "5.0.0", "semver": "7.5.4" }, @@ -47,6 +47,6 @@ "bcrypt": "5.1.0" }, "engines": { - "node": ">=14" + "node": ">=18" } } diff --git a/packages/node_modules/node-red/red.js b/packages/node_modules/node-red/red.js index 63c0188bd..85b5aec48 100755 --- a/packages/node_modules/node-red/red.js +++ b/packages/node_modules/node-red/red.js @@ -26,6 +26,13 @@ if (process.argv[2] === 'admin') { return; } +var semver = require('semver'); +if (!semver.satisfies(process.version, ">=18.0.0")) { + console.log("Unsupported version of Node.js:", process.version); + console.log("Node-RED requires Node.js v18 or later"); + process.exit(1) +} + var http = require('http'); var https = require('https'); var util = require("util"); @@ -346,7 +353,7 @@ httpsPromise.then(function(startupHttps) { } catch(err) { if (err.code == "unsupported_version") { console.log("Unsupported version of Node.js:",process.version); - console.log("Node-RED requires Node.js v8.9.0 or later"); + console.log("Node-RED requires Node.js v18 or later"); } else { console.log("Failed to start server:"); if (err.stack) { diff --git a/packages/node_modules/node-red/settings.js b/packages/node_modules/node-red/settings.js index 80b559030..864707538 100644 --- a/packages/node_modules/node-red/settings.js +++ b/packages/node_modules/node-red/settings.js @@ -449,6 +449,7 @@ module.exports = { * - ui (for use with Node-RED Dashboard) * - debugUseColors * - debugMaxLength + * - debugStatusLength * - execMaxBufferSize * - httpRequestTimeout * - mqttReconnectTime @@ -504,6 +505,9 @@ module.exports = { /** The maximum length, in characters, of any message sent to the debug sidebar tab */ debugMaxLength: 1000, + /** The maximum length, in characters, of status messages under the debug node */ + //debugStatusLength: 32, + /** Maximum buffer size for the exec node. Defaults to 10Mb */ //execMaxBufferSize: 10000000, diff --git a/test/nodes/core/network/21-httprequest_spec.js b/test/nodes/core/network/21-httprequest_spec.js index bace012b5..4d159e402 100644 --- a/test/nodes/core/network/21-httprequest_spec.js +++ b/test/nodes/core/network/21-httprequest_spec.js @@ -2538,38 +2538,4 @@ describe('HTTP Request Node', function() { }); } }); - - describe('multipart form posts', function() { - it('should send arrays as multiple entries', function (done) { - const flow = [ - { - id: 'n1', type: 'http request', wires: [['n2']], method: 'POST', ret: 'obj', url: getTestURL('/file-upload'), headers: [ - ] - }, - { id: "n2", type: "helper" } - ]; - helper.load(httpRequestNode, flow, function() { - var n1 = helper.getNode("n1"); - var n2 = helper.getNode("n2"); - n2.on('input', function(msg){ - try { - msg.payload.body.should.have.property('foo') - msg.payload.body.list.should.deepEqual(['a','b','c']) - done() - } catch (e) { - done(e) - } - }); - n1.receive({ - headers: { - 'content-type': 'multipart/form-data' - }, - payload: { - foo: 'bar', - list: [ 'a', 'b', 'c' ] - } - }); - }) - }); - }) }); diff --git a/test/nodes/core/parsers/70-CSV_spec.js b/test/nodes/core/parsers/70-CSV_spec.js index 681711b3b..f362ecdbf 100644 --- a/test/nodes/core/parsers/70-CSV_spec.js +++ b/test/nodes/core/parsers/70-CSV_spec.js @@ -15,12 +15,15 @@ * limitations under the License. **/ -// var should = require("should"); -var csvNode = require("nr-test-utils").require("@node-red/nodes/core/parsers/70-CSV.js"); -var helper = require("node-red-node-test-helper"); +// const should = require("should"); +const csvNode = require("nr-test-utils").require("@node-red/nodes/core/parsers/70-CSV.js"); +const statusNode = require("nr-test-utils").require("@node-red/nodes/core/common/25-status.js"); +const functionNode = require("nr-test-utils").require("@node-red/nodes/core/function/10-function.js"); +const delayNode = require("nr-test-utils").require("@node-red/nodes/core/function/89-delay.js"); +const helper = require("node-red-node-test-helper"); // const { neq } = require("semver"); -describe('CSV node', function() { +describe('CSV node (Legacy Mode)', function() { before(function(done) { helper.startServer(done); @@ -38,16 +41,20 @@ describe('CSV node', function() { var flow = [{id:"csvNode1", type:"csv", name: "csvNode" }]; helper.load(csvNode, flow, function() { var n1 = helper.getNode("csvNode1"); - n1.should.have.property('name', 'csvNode'); - n1.should.have.property('template',''); - n1.should.have.property('sep', ','); - n1.should.have.property('quo', '"'); - n1.should.have.property('ret', '\n'); - n1.should.have.property('winflag', false); - n1.should.have.property('lineend', '\n'); - n1.should.have.property('multi', 'one'); - n1.should.have.property('hdrin', false); - done(); + try { + n1.should.have.property('name', 'csvNode'); + n1.should.have.property('template',''); + n1.should.have.property('sep', ','); + n1.should.have.property('quo', '"'); + n1.should.have.property('ret', '\n'); + // n1.should.have.property('winflag', false); + // n1.should.have.property('lineend', '\n'); + n1.should.have.property('multi', 'one'); + n1.should.have.property('hdrin', false); + done(); + } catch (error) { + done(error); + } }); }); @@ -77,10 +84,13 @@ describe('CSV node', function() { var n1 = helper.getNode("n1"); var n2 = helper.getNode("n2"); n2.on("input", function(msg) { - msg.should.have.property('payload', { a: 1, b: 2, c: 3, d: 4 }); - msg.should.have.property('columns', "a,b,c,d"); - check_parts(msg, 0, 1); - done(); + try { + msg.should.have.property('payload', { a: 1, b: 2, c: 3, d: 4 }); + msg.should.have.property('columns', "a,b,c,d"); + check_parts(msg, 0, 1); + done(); + } + catch(e) { done(e); } }); var testString = "1,2,3,4"+String.fromCharCode(10); n1.emit("input", {payload:testString}); @@ -94,10 +104,13 @@ describe('CSV node', function() { var n1 = helper.getNode("n1"); var n2 = helper.getNode("n2"); n2.on("input", function(msg) { - msg.should.have.property('payload', { col1: 1, col2: 2, col3: 3, col4: 4 }); - msg.should.have.property('columns', "col1,col2,col3,col4"); - check_parts(msg, 0, 1); - done(); + try { + msg.should.have.property('payload', { col1: 1, col2: 2, col3: 3, col4: 4 }); + msg.should.have.property('columns', "col1,col2,col3,col4"); + check_parts(msg, 0, 1); + done(); + } + catch(e) { done(e); } }); var testString = "1|2|3|4"+String.fromCharCode(10); n1.emit("input", {payload:testString}); @@ -111,10 +124,13 @@ describe('CSV node', function() { var n1 = helper.getNode("n1"); var n2 = helper.getNode("n2"); n2.on("input", function(msg) { - msg.should.have.property('payload', { A: 1, B: 2, D: 4 }); - msg.should.have.property('columns', "A,B,D"); - check_parts(msg, 0, 1); - done(); + try { + msg.should.have.property('payload', { A: 1, B: 2, D: 4 }); + msg.should.have.property('columns', "A,B,D"); + check_parts(msg, 0, 1); + done(); + } + catch(e) { done(e); } }); var testString = "1\t2\t3\t4"+String.fromCharCode(10); n1.emit("input", {payload:testString}); @@ -128,10 +144,12 @@ describe('CSV node', function() { var n1 = helper.getNode("n1"); var n2 = helper.getNode("n2"); n2.on("input", function(msg) { - msg.should.have.property('payload', { A: 1, B: 2, D: 4 }); - msg.should.have.property('columns', "A,B,D"); - check_parts(msg, 0, 1); - done(); + try { + msg.should.have.property('payload', { A: 1, B: 2, D: 4 }); + msg.should.have.property('columns', "A,B,D"); + check_parts(msg, 0, 1); + done(); + } catch (e) { done(e); } }); var testString = "1 2 3 4"+String.fromCharCode(10); n1.emit("input", {payload:testString}); @@ -145,9 +163,11 @@ describe('CSV node', function() { var n1 = helper.getNode("n1"); var n2 = helper.getNode("n2"); n2.on("input", function(msg) { - msg.should.have.property('payload', { a: 1, b: 2, c: 3, d: 4 }); - check_parts(msg, 0, 1); - done(); + try { + msg.should.have.property('payload', { a: 1, b: 2, c: 3, d: 4 }); + check_parts(msg, 0, 1); + done(); + } catch (e) { done(e); } }); var testString = "1,2,3,4"+String.fromCharCode(10); n1.emit("input", {payload:testString}); @@ -161,10 +181,13 @@ describe('CSV node', function() { var n1 = helper.getNode("n1"); var n2 = helper.getNode("n2"); n2.on("input", function(msg) { - msg.should.have.property('payload', { col1: 1, col2: 2, col3: 3, col4: 4 }); - msg.should.have.property('columns', "col1,col2,col3,col4"); - check_parts(msg, 0, 1); - done(); + try { + msg.should.have.property('payload', { col1: 1, col2: 2, col3: 3, col4: 4 }); + msg.should.have.property('columns', "col1,col2,col3,col4"); + check_parts(msg, 0, 1); + done(); + } + catch(e) { done(e); } }); var testString = "1,2,3,4"+String.fromCharCode(10); n1.emit("input", {payload:testString}); @@ -178,10 +201,13 @@ describe('CSV node', function() { var n1 = helper.getNode("n1"); var n2 = helper.getNode("n2"); n2.on("input", function(msg) { - msg.should.have.property('payload', { a: 1, d: 4 }); - msg.should.have.property('columns', 'a,d'); - check_parts(msg, 0, 1); - done(); + try { + msg.should.have.property('payload', { a: 1, d: 4 }); + msg.should.have.property('columns', 'a,d'); + check_parts(msg, 0, 1); + done(); + } + catch(e) { done(e); } }); var testString = "1,2,3,4"+String.fromCharCode(10); n1.emit("input", {payload:testString}); @@ -195,10 +221,12 @@ describe('CSV node', function() { var n1 = helper.getNode("n1"); var n2 = helper.getNode("n2"); n2.on("input", function(msg) { - msg.should.have.property('payload', { a: 1, "b b":2, "c,c":3, "d, d": 4 }); - msg.should.have.property('columns', 'a,b b,"c,c","d, d"'); - check_parts(msg, 0, 1); - done(); + try { + msg.should.have.property('payload', { a: 1, "b b":2, "c,c":3, "d, d": 4 }); + msg.should.have.property('columns', 'a,b b,"c,c","d, d"'); + check_parts(msg, 0, 1); + done(); + } catch (e) { done(e); } }); var testString = "1,2,3,4"+String.fromCharCode(10); n1.emit("input", {payload:testString}); @@ -212,10 +240,12 @@ describe('CSV node', function() { var n1 = helper.getNode("n1"); var n2 = helper.getNode("n2"); n2.on("input", function(msg) { - msg.should.have.property('payload', { a: 1, "b b":2, "c,c":3, "d, d": 4 }); - msg.should.have.property('columns', 'a,b b,"c,c","d, d"'); - check_parts(msg, 0, 1); - done(); + try { + msg.should.have.property('payload', { a: 1, "b b":2, "c,c":3, "d, d": 4 }); + msg.should.have.property('columns', 'a,b b,"c,c","d, d"'); + check_parts(msg, 0, 1); + done(); + } catch (e) { done(e); } }); var testString = 'a,b b,"c,c"," d, d "'+"\n"+"1,2,3,4"+String.fromCharCode(10); n1.emit("input", {payload:testString}); @@ -229,10 +259,12 @@ describe('CSV node', function() { var n1 = helper.getNode("n1"); var n2 = helper.getNode("n2"); n2.on("input", function(msg) { - msg.should.have.property('payload', { a: 1, "b b":2, "c;c":3, "d, d": 4 }); - msg.should.have.property('columns', 'a,b b,c;c,"d, d"'); - check_parts(msg, 0, 1); - done(); + try { + msg.should.have.property('payload', { a: 1, "b b":2, "c;c":3, "d, d": 4 }); + msg.should.have.property('columns', 'a,b b,c;c,"d, d"'); + check_parts(msg, 0, 1); + done(); + } catch (e) { done(e); } }); var testString = 'a;b b;"c;c";" d, d "'+"\n"+"1;2;3;4"+String.fromCharCode(10); n1.emit("input", {payload:testString}); @@ -246,10 +278,12 @@ describe('CSV node', function() { var n1 = helper.getNode("n1"); var n2 = helper.getNode("n2"); n2.on("input", function(msg) { - msg.should.have.property('payload', { a: 1, "b b":2, "c/c":3, "d, d": 4 }); - msg.should.have.property('columns', 'a,b b,c/c,"d, d"'); - check_parts(msg, 0, 1); - done(); + try { + msg.should.have.property('payload', { a: 1, "b b":2, "c/c":3, "d, d": 4 }); + msg.should.have.property('columns', 'a,b b,c/c,"d, d"'); + check_parts(msg, 0, 1); + done(); + } catch (e) { done(e); } }); var testString = 'a/b b/"c/c"/" d, d "'+"\n"+"1/2/3/4"+String.fromCharCode(10); n1.emit("input", {payload:testString}); @@ -263,10 +297,12 @@ describe('CSV node', function() { var n1 = helper.getNode("n1"); var n2 = helper.getNode("n2"); n2.on("input", function(msg) { - msg.should.have.property('payload', { a: 1, "b b":2, "c\\c":3, "d, d": 4 }); - msg.should.have.property('columns', 'a,b b,c\\c,"d, d"'); - check_parts(msg, 0, 1); - done(); + try { + msg.should.have.property('payload', { a: 1, "b b":2, "c\\c":3, "d, d": 4 }); + msg.should.have.property('columns', 'a,b b,c\\c,"d, d"'); + check_parts(msg, 0, 1); + done(); + } catch (e) { done(e); } }); var testString = 'a\\b b\\"c\\c"\\" d, d "'+"\n"+"1\\2\\3\\4"+String.fromCharCode(10); n1.emit("input", {payload:testString}); @@ -280,9 +316,12 @@ describe('CSV node', function() { var n1 = helper.getNode("n1"); var n2 = helper.getNode("n2"); n2.on("input", function(msg) { - msg.should.have.property('payload', { a: 123, b: "0123", c: '+123', d: 'e123', e: 'E123', f: -123 }); - check_parts(msg, 0, 1); - done(); + try { + msg.should.have.property('payload', { a: 123, b: "0123", c: '+123', d: 'e123', e: 'E123', f: -123 }); + check_parts(msg, 0, 1); + done(); + } + catch(e) { done(e); } }); var testString = '123,0123,+123,e123,E123,-123'+String.fromCharCode(10); n1.emit("input", {payload:testString}); @@ -296,9 +335,12 @@ describe('CSV node', function() { var n1 = helper.getNode("n1"); var n2 = helper.getNode("n2"); n2.on("input", function(msg) { - msg.should.have.property('payload', { a: "1.23", b: "0123", c: "+123", d: "e123", e: "0", f: "-123", g: "1e3" }); - check_parts(msg, 0, 1); - done(); + try { + msg.should.have.property('payload', { a: "1.23", b: "0123", c: "+123", d: "e123", e: "0", f: "-123", g: "1e3" }); + check_parts(msg, 0, 1); + done(); + } + catch(e) { done(e); } }); var testString = '1.23,0123,+123,e123,0,-123,1e3'+String.fromCharCode(10); n1.emit("input", {payload:testString}); @@ -312,9 +354,12 @@ describe('CSV node', function() { var n1 = helper.getNode("n1"); var n2 = helper.getNode("n2"); n2.on("input", function(msg) { - msg.should.have.property('payload', { a: 1.23, b: -123, c: 1000, d: 0 }); - check_parts(msg, 0, 1); - done(); + try { + msg.should.have.property('payload', { a: 1.23, b: -123, c: 1000, d: 0 }); + check_parts(msg, 0, 1); + done(); + } + catch(e) { done(e); } }); var testString = ' 1.23 , -123,1e3 , 0 '+String.fromCharCode(10); n1.emit("input", {payload:testString}); @@ -328,9 +373,12 @@ describe('CSV node', function() { var n1 = helper.getNode("n1"); var n2 = helper.getNode("n2"); n2.on("input", function(msg) { - msg.should.have.property('payload', { a: 12000, b: 0.012, c: -12000, d: -0.012 }); - check_parts(msg, 0, 1); - done(); + try { + msg.should.have.property('payload', { a: 12000, b: 0.012, c: -12000, d: -0.012 }); + check_parts(msg, 0, 1); + done(); + } + catch(e) { done(e); } }); var testString = '12E3,12e-3,-12e3,-12E-3'+String.fromCharCode(10); n1.emit("input", {payload:testString}); @@ -345,29 +393,36 @@ describe('CSV node', function() { var n1 = helper.getNode("n1"); var n2 = helper.getNode("n2"); n2.on("input", function(msg) { - //console.log(msg); - msg.should.have.property('payload', { a:1, b:-2, c:'+3', d:'04', f:'-05', g:'ab"cd', h:'with,a,comma' }); - check_parts(msg, 0, 1); - done(); + try { + //console.log(msg); + msg.should.have.property('payload', { a:1, b:-2, c:'+3', d:'04', f:'-05', g:'ab"cd', h:'with,a,comma' }); + check_parts(msg, 0, 1); + done(); + } + catch(e) { done(e); } }); var testString = '"1","-2","+3","04","","-05","ab""cd","with,a,comma"'+String.fromCharCode(10); n1.emit("input", {payload:testString}); }); }); - it('should allow blank strings in the input if selected', function(done) { - var flow = [ { id:"n1", type:"csv", temp:"a,b,c,d,e,f,g", include_empty_strings:true, wires:[["n2"]] }, + it('should allow blank strings in the input if selected', async function() { + const flow = [ { id:"n1", type:"csv", temp:"a,b,c,d,e,f,g", include_empty_strings:true, wires:[["n2"]] }, {id:"n2", type:"helper"} ]; - helper.load(csvNode, flow, function() { - var n1 = helper.getNode("n1"); - var n2 = helper.getNode("n2"); - n2.on("input", function(msg) { - //console.log(msg); - msg.should.have.property('payload', { a: 1, b: '', c: '', d: '', e: '-05', f: 'ab"cd', g: 'with,a,comma' }); - //check_parts(msg, 0, 1); - done(); + await helper.load(csvNode, flow) + var n1 = helper.getNode("n1"); + var n2 = helper.getNode("n2"); + await new Promise((resolve, reject) => { + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', { a: 1, b: '', c: '', d: '', e: '-05', f: 'ab"cd', g: 'with,a,comma' }); + //check_parts(msg, 0, 1); + resolve() + } catch (err) { + reject(err); + } }); - var testString = '"1","","","","-05","ab""cd","with,a,comma"'+String.fromCharCode(10); + const testString = '"1","","","","-05","ab""cd","with,a,comma"'+String.fromCharCode(10); n1.emit("input", {payload:testString}); }); }); @@ -379,10 +434,13 @@ describe('CSV node', function() { var n1 = helper.getNode("n1"); var n2 = helper.getNode("n2"); n2.on("input", function(msg) { - //console.log(msg); - msg.should.have.property('payload', { a: 1, b: null, c: '+3', d: null, e: '-05', f: 'ab"cd', g: 'with,a,comma' }); - //check_parts(msg, 0, 1); - done(); + try { + //console.log(msg); + msg.should.have.property('payload', { a: 1, b: null, c: '+3', d: null, e: '-05', f: 'ab"cd', g: 'with,a,comma' }); + // check_parts(msg, 0, 1); + done(); + } + catch(e) { done(e); } }); var testString = '"1",,"+3",,"-05","ab""cd","with,a,comma"'+String.fromCharCode(10); n1.emit("input", {payload:testString}); @@ -396,10 +454,13 @@ describe('CSV node', function() { var n1 = helper.getNode("n1"); var n2 = helper.getNode("n2"); n2.on("input", function(msg) { - //console.log(msg); - msg.should.have.property('payload', { a: "with a\nnew line", b: "and a\rcarriage return", c: "and why\r\nnot both"}); - check_parts(msg, 0, 1); - done(); + try { + //console.log(msg); + msg.should.have.property('payload', { a: "with a\nnew line", b: "and a\rcarriage return", c: "and why\r\nnot both"}); + check_parts(msg, 0, 1); + done(); + } + catch(e) { done(e); } }); var testString = '"with a'+String.fromCharCode(10)+'new line","and a'+String.fromCharCode(13)+'carriage return","and why\r\nnot both"'+String.fromCharCode(10); n1.emit("input", {payload:testString}); @@ -414,16 +475,19 @@ describe('CSV node', function() { var n2 = helper.getNode("n2"); var c = 0; n2.on("input", function(msg) { - if (c == 0) { - c = 1; - msg.should.have.property('payload', { a: "with,an", b: "odd,number", c: "ofquotes\n" }); - check_parts(msg, 0, 1); - } - else { - msg.should.have.property('payload', { a: "this is", b: "a normal", c: "line" }); - check_parts(msg, 0, 1); - done(); + try { + if (c == 0) { + c = 1; + msg.should.have.property('payload', { a: "with,an", b: "odd,number", c: "ofquotes\n" }); + check_parts(msg, 0, 1); + } + else { + msg.should.have.property('payload', { a: "this is", b: "a normal", c: "line" }); + check_parts(msg, 0, 1); + done(); + } } + catch(e) { done(e); } }); var testString = '"with,a"n,odd","num"ber","of"qu"ot"es"'+String.fromCharCode(10); n1.emit("input", {payload:testString}); @@ -439,17 +503,20 @@ describe('CSV node', function() { var n2 = helper.getNode("n2"); var c = 0; n2.on("input", function(msg) { - //console.log(msg) - if (c == 0) { - c = 1; - msg.should.have.property('payload', { a: "with,an", b: "odd,number", c: "ofquotes\nthis is,a normal,line" }); - check_parts(msg, 0, 1); - } - else { - msg.should.have.property('payload', { a: "this is", b: "another", c: "line" }); - check_parts(msg, 0, 1); - done(); + try { + //console.log(msg) + if (c == 0) { + c = 1; + msg.should.have.property('payload', { a: "with,an", b: "odd,number", c: "ofquotes\nthis is,a normal,line\n" }); + check_parts(msg, 0, 1); + } + else { + msg.should.have.property('payload', { a: "this is", b: "another", c: "line" }); + check_parts(msg, 0, 1); + done(); + } } + catch(e) { done(e); } }); var testString = '"with,a"n,odd","num"ber","of"qu"ot"es"'+String.fromCharCode(10)+'"this is","a normal","line"'+String.fromCharCode(10); n1.emit("input", {payload:testString}); @@ -465,17 +532,20 @@ describe('CSV node', function() { var n2 = helper.getNode("n2"); var c = 0; n2.on("input", function(msg) { - //console.log(msg); - if (c === 0) { - msg.should.have.property('payload', { w: 1, x: 2, y: 3, z: 4 }); - check_parts(msg, 0, 2); - c += 1; - } - else { - msg.should.have.property('payload', { w: 5, x: 6, y: 7, z: 8 }); - check_parts(msg, 1, 2); - done(); + try { + //console.log(msg); + if (c === 0) { + msg.should.have.property('payload', { w: 1, x: 2, y: 3, z: 4 }); + check_parts(msg, 0, 2); + c += 1; + } + else { + msg.should.have.property('payload', { w: 5, x: 6, y: 7, z: 8 }); + check_parts(msg, 1, 2); + done(); + } } + catch(e) { done(e); } }); var testString = "w,x,y,z\n1,2,3,4\n\n5,6,7,8"; n1.emit("input", {payload:testString}); @@ -489,10 +559,13 @@ describe('CSV node', function() { var n1 = helper.getNode("n1"); var n2 = helper.getNode("n2"); n2.on("input", function(msg) { - msg.should.have.property('payload', [ { a: 1, b: 2, c: 3, d: 4 },{ a: 5, b: -6, c: '07', d: '+8' },{ a: 9, b: 0, c: 'a', d: 'b' },{ a: 'c', b: 'd', c: 'e', d: 'f' } ]); - msg.should.have.property('columns','a,b,c,d'); - msg.should.not.have.property('parts'); - done(); + try { + msg.should.have.property('payload', [ { a: 1, b: 2, c: 3, d: 4 },{ a: 5, b: -6, c: '07', d: '+8' },{ a: 9, b: 0, c: 'a', d: 'b' },{ a: 'c', b: 'd', c: 'e', d: 'f' } ]); + msg.should.have.property('columns','a,b,c,d'); + msg.should.not.have.property('parts'); + done(); + } + catch(e) { done(e); } }); var testString = "1,2,3,4\n5,-6,07,+8\n9,0,a,b\nc,d,e,f"; n1.emit("input", {payload:testString}); @@ -506,10 +579,13 @@ describe('CSV node', function() { var n1 = helper.getNode("n1"); var n2 = helper.getNode("n2"); n2.on("input", function(msg) { - msg.should.have.property('payload', [{"a":1,"b":2,"c":3},{"a":4,"b":5,"c":6},{"a":7,"b":8,"c":9}]); - msg.should.have.property('columns','a,b,c'); - msg.should.not.have.property('parts'); - done(); + try { + msg.should.have.property('payload', [{"a":1,"b":2,"c":3},{"a":4,"b":5,"c":6},{"a":7,"b":8,"c":9}]); + msg.should.have.property('columns','a,b,c'); + msg.should.not.have.property('parts'); + done(); + } + catch(e) { done(e); } }); n1.emit("input", {"payload":"a,b,c","parts":{"index":0,"ch":"\n","type":"string","id":"1"}}); @@ -526,10 +602,13 @@ describe('CSV node', function() { var n1 = helper.getNode("n1"); var n2 = helper.getNode("n2"); n2.on("input", function(msg) { - msg.should.have.property('payload', [{"Col1":"V1","Col2":"V2"},{"Col1":"V3","Col2":"V4"},{"Col1":"V5","Col2":"V6"}]); - msg.should.have.property('columns','Col1,Col2'); - msg.should.have.property('parts'); - done(); + try { + msg.should.have.property('payload', [{"Col1":"V1","Col2":"V2"},{"Col1":"V3","Col2":"V4"},{"Col1":"V5","Col2":"V6"}]); + msg.should.have.property('columns','Col1,Col2'); + msg.should.have.property('parts'); + done(); + } + catch(e) { done(e); } }); //var testString = "1,2,3,4\n5,-6,07,+8\n9,0,a,b\nc,d,e,f"; // n1.emit("input", {payload:testString}); @@ -545,9 +624,12 @@ describe('CSV node', function() { var n1 = helper.getNode("n1"); var n2 = helper.getNode("n2"); n2.on("input", function(msg) { - msg.should.have.property('payload', { a: "a", b: "127.0.0.1", c: 56.7, d: -32.8, e: "+76.22C" }); - check_parts(msg, 0, 1); - done(); + try { + msg.should.have.property('payload', { a: "a", b: "127.0.0.1", c: 56.7, d: -32.8, e: "+76.22C" }); + check_parts(msg, 0, 1); + done(); + } + catch(e) { done(e); } }); var testString = "a,127.0.0.1,56.7,-32.8,+76.22C"; n1.emit("input", {payload:testString}); @@ -561,9 +643,12 @@ describe('CSV node', function() { var n1 = helper.getNode("n1"); var n2 = helper.getNode("n2"); n2.on("input", function(msg) { - msg.should.have.property('payload', { a: 1, b: 2, c: 3, d: 4 }); - check_parts(msg, 3, 4); - done(); + try { + msg.should.have.property('payload', { a: 1, b: 2, c: 3, d: 4 }); + check_parts(msg, 3, 4); + done(); + } + catch(e) { done(e); } }); var testString = "1,2,3,4"+String.fromCharCode(10); n1.emit("input", {payload:testString, parts: {id:"X", index:3, count:4} }); @@ -578,16 +663,19 @@ describe('CSV node', function() { var n2 = helper.getNode("n2"); var c = 0; n2.on("input", function(msg) { - if (c === 0) { - msg.should.have.property('payload', { w: 1, x: 2, y: 3, z: 4 }); - check_parts(msg, 0, 2); - c += 1; - } - else { - msg.should.have.property('payload', { w: 5, x: 6, y: 7, z: 8 }); - check_parts(msg, 1, 2); - done(); + try { + if (c === 0) { + msg.should.have.property('payload', { w: 1, x: 2, y: 3, z: 4 }); + check_parts(msg, 0, 2); + c += 1; + } + else { + msg.should.have.property('payload', { w: 5, x: 6, y: 7, z: 8 }); + check_parts(msg, 1, 2); + done(); + } } + catch(e) { done(e); } }); var testString1 = "w,x,y,z\n"; var testString2 = "1,2,3,4\n"; @@ -605,9 +693,12 @@ describe('CSV node', function() { var n1 = helper.getNode("n1"); var n2 = helper.getNode("n2"); n2.on("input", function(msg) { - msg.should.have.property('payload', { a: 9, b: 0, c: "A", d: "B" }); - check_parts(msg, 0, 1); - done(); + try { + msg.should.have.property('payload', { a: 9, b: 0, c: "A", d: "B" }); + check_parts(msg, 0, 1); + done(); + } + catch(e) { done(e); } }); var testString = "1,2,3,4"+String.fromCharCode(10)+"5,6,7,8"+String.fromCharCode(10)+"9,0,A,B"+String.fromCharCode(10); n1.emit("input", {payload:testString}); @@ -621,9 +712,12 @@ describe('CSV node', function() { var n1 = helper.getNode("n1"); var n2 = helper.getNode("n2"); n2.on("input", function(msg) { - msg.should.have.property('payload', { "9": "C", "0": "D", "A": "E", "B": "F" }); - check_parts(msg, 0, 1); - done(); + try { + msg.should.have.property('payload', { "9": "C", "0": "D", "A": "E", "B": "F" }); + check_parts(msg, 0, 1); + done(); + } + catch(e) { done(e); } }); var testString = "1,2,3,4"+String.fromCharCode(10)+"5,6,7,8"+String.fromCharCode(10)+"9,0,A,B"+String.fromCharCode(10)+"C,D,E,F"+String.fromCharCode(10); n1.emit("input", {payload:testString}); @@ -638,16 +732,19 @@ describe('CSV node', function() { var n2 = helper.getNode("n2"); var c = 0; n2.on("input", function(msg) { - if (c===0) { - msg.should.have.property('payload', { a: 9, b: 0, c: "A", d: "B" }); - check_parts(msg, 0, 2); - c = c+1; - } - else { - msg.should.have.property('payload', { a: "C", b: "D", c: "E", d: "F" }); - check_parts(msg, 1, 2); - done(); + try { + if (c===0) { + msg.should.have.property('payload', { a: 9, b: 0, c: "A", d: "B" }); + check_parts(msg, 0, 2); + c = c+1; + } + else { + msg.should.have.property('payload', { a: "C", b: "D", c: "E", d: "F" }); + check_parts(msg, 1, 2); + done(); + } } + catch(e) { done(e); } }); var testString = "1,2,3,4"+String.fromCharCode(10)+"5,6,7,8"+String.fromCharCode(10)+"9,0,A,B"+String.fromCharCode(10)+"C,D,E,F"+String.fromCharCode(10); n1.emit("input", {payload:testString}); @@ -662,18 +759,21 @@ describe('CSV node', function() { var n2 = helper.getNode("n2"); var c = 0; n2.on("input", function(msg) { - if (c === 0) { - msg.should.have.property('payload', { w: 1, x: 2, y: 3, z: 4 }); - msg.should.have.property('columns', 'w,x,y,z'); - check_parts(msg, 0, 2); - c += 1; - } - else { - msg.should.have.property('payload', { w: 5, x: 6, y: 7, z: 8 }); - msg.should.have.property('columns', 'w,x,y,z'); - check_parts(msg, 1, 2); - done(); + try { + if (c === 0) { + msg.should.have.property('payload', { w: 1, x: 2, y: 3, z: 4 }); + msg.should.have.property('columns', 'w,x,y,z'); + check_parts(msg, 0, 2); + c += 1; + } + else { + msg.should.have.property('payload', { w: 5, x: 6, y: 7, z: 8 }); + msg.should.have.property('columns', 'w,x,y,z'); + check_parts(msg, 1, 2); + done(); + } } + catch(e) { done(e); } }); var testStringA = "foo\n"; var testStringB = "bar\n"; @@ -1089,3 +1189,1257 @@ describe('CSV node', function() { }); }); }); + +describe('CSV node (RFC Mode)', function () { + + before(function (done) { + helper.startServer(done); + }); + + after(function (done) { + helper.stopServer(done); + }); + + afterEach(function () { + helper.unload(); + }); + + it('should be loaded with defaults', function (done) { + // RFC-Legacy difference + // In RFC mode, the default line separator is \r\n (RFC4180 Section 2.1) + // In Legacy mode, the line separator is set to \n + const flow = [{ id: "n1", type: "csv", spec: "rfc", name: "csvNode" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + try { + n1.should.have.property('name', 'csvNode'); + n1.should.have.property('template', ''); + n1.should.have.property('sep', ','); + n1.should.have.property('quo', '"'); + n1.should.have.property('ret', '\r\n'); // RFC-Legacy difference + n1.should.have.property('multi', 'one'); + n1.should.have.property('hdrin', false); + done(); + } catch (error) { + done(error); + } + }); + }); + + describe('csv to json', function () { + let parts_id = undefined; + + afterEach(function () { + parts_id = undefined; + }); + + function check_parts(msg, index, count) { + msg.should.have.property('parts'); + if (parts_id === undefined) { + parts_id = msg.parts.id; + } + else { + msg.parts.should.have.property('id', parts_id); + } + msg.parts.should.have.property('index', index); + msg.parts.should.have.property('count', count); + } + + it('should convert a simple csv string to a javascript object', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,b,c,d", wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', { a: 1, b: 2, c: 3, d: 4 }); + msg.should.have.property('columns', "a,b,c,d"); + check_parts(msg, 0, 1); + done(); + } + catch (e) { done(e); } + }); + const testString = "1,2,3,4" + String.fromCharCode(10); + n1.emit("input", { payload: testString }); + }); + }); + + it('should convert a simple string to a javascript object with | separator (no template)', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", sep: "|", wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', { col1: 1, col2: 2, col3: 3, col4: 4 }); + msg.should.have.property('columns', "col1,col2,col3,col4"); + check_parts(msg, 0, 1); + done(); + } + catch (e) { done(e); } + }); + const testString = "1|2|3|4" + String.fromCharCode(10); + n1.emit("input", { payload: testString }); + }); + }); + + it('should convert a simple string to a javascript object with tab separator (with template)', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", sep: "\t", temp: "A,B,,D", wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', { A: 1, B: 2, D: 4 }); + msg.should.have.property('columns', "A,B,D"); + check_parts(msg, 0, 1); + done(); + } + catch (e) { done(e); } + }); + const testString = "1\t2\t3\t4" + String.fromCharCode(10); + n1.emit("input", { payload: testString }); + }); + }); + + it('should convert a simple string to a javascript object with space separator (with spaced template)', function (done) { + // RFC-vs-Legacy difference + // In RFC mode, spaces are respected in the template (RFC4180 Section 2.4) + // In legacy mode, the template "A, B, , D" is trimmed to "A,B,D" + const flow = [{ id: "n1", type: "csv", spec: "rfc", sep: " ", temp: "A, B, , D", wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + // 'payload', { A: 1, B: 2, D: 4 } // Legacy + msg.should.have.property('payload', { A: 1, ' B': 2, ' ': 3, ' D': 4 }); // RFC + // 'columns', "A,B,D" // Legacy + msg.should.have.property('columns', "A, B, , D"); // RFC + check_parts(msg, 0, 1); + done(); + } catch (e) { done(e); } + }); + const testString = "1 2 3 4" + String.fromCharCode(10); + n1.emit("input", { payload: testString }); + }); + }); + + it('should not remove quotes and whitespace from template - should set status and send warning', async function () { + // RFC-vs-Legacy difference + // In RFC mode, the column template is parsed in strict mode + // meaning this template is invalid because: + // * it encounters a quote in an unquoted field (the "b" in the 2nd column) + // * The 2nd column starts with a space but then a single quote is encountered. RFC4180 Section 2.6 + // says Fields containing line breaks (CRLF), double quotes, and commas should be enclosed in double-quotes + // * it contains a data between the closing quote and separator (4th column starts ok but then has a space after the closing quote) + // * Since we adhere to RFC4180 Section 2.4, "Spaces are considered part of a field and should not be ignored" + // we must treat the space as part of the data meaning field is not correctly close with a quote + const flow = [ + { id: "n1", type: "csv", spec: "rfc", temp: '', ret: '\n', wires: [["n2"]] }, + { id: "n2", type: "helper" } + ]; + await helper.load(csvNode, flow) + + const n1 = helper.getNode("n1") + const n2 = helper.getNode("n2") + + //modify the flow and deploy change that sets the csv node to a bad template - thus updating the nodes status and logging a warning + const newConfig = flow.map(n => ({ ...n })); + newConfig[0].temp = '"a", "b" , " c "," d " '; + await helper.setFlows(newConfig, "nodes") // deploy "nodes" only + + // small sleep for msg flow and logging to complete + await new Promise(resolve => setTimeout(resolve, 50)); + + // check that status message was sent + n1.status.called.should.be.true(); + n1.status.lastCall.args[0].should.deepEqual({ fill: 'red', shape: 'dot', text: 'csv.errors.bad_template' }); + + // warn message should be logged + n1.warn.called.should.be.true(); + n1.warn.lastCall.args[0].should.equal('csv.errors.bad_template'); + const logs = helper.log().args.filter(function (evt) { + return evt[0].type == "csv"; + }); + logs.should.have.length(1); + logs[0][0].should.have.a.property('msg'); + logs[0][0].msg.should.equal('csv.errors.bad_template'); + }); + + it('should create column names if no template provided', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: '', wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', { col1: 1, col2: 2, col3: 3, col4: 4 }); + msg.should.have.property('columns', "col1,col2,col3,col4"); + check_parts(msg, 0, 1); + done(); + } + catch (e) { done(e); } + }); + const testString = "1,2,3,4" + String.fromCharCode(10); + n1.emit("input", { payload: testString }); + }); + }); + + it('should allow dropping of fields from the template', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,,,d", wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', { a: 1, d: 4 }); + msg.should.have.property('columns', 'a,d'); + check_parts(msg, 0, 1); + done(); + } + catch (e) { done(e); } + }); + const testString = "1,2,3,4" + String.fromCharCode(10); + n1.emit("input", { payload: testString }); + }); + }); + + it('should allow commas and spaces in the template', function (done) { + // RFC-vs-Legacy difference + // In RFC mode, spaces are respected in the template (RFC4180 Section 2.4) + // In legacy mode, the template `a,b b,\"c,c\",\" d, d \"` is trimmed to `a,b b,"c,c","d, d"` + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,b b,\"c,c\",\" d, d \"", wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + // 'payload', { a: 1, "b b":2, "c,c":3, "d, d": 4 } // Legacy + msg.should.have.property('payload', { a: 1, "b b": 2, "c,c": 3, " d, d ": 4 }); // RFC-vs-Legacy difference + // 'columns', 'a,b b,"c,c","d, d"' // Legacy + msg.should.have.property('columns', 'a,b b,"c,c"," d, d "'); // RFC-vs-Legacy difference + check_parts(msg, 0, 1); + done(); + } catch (e) { done(e); } + }); + const testString = "1,2,3,4" + String.fromCharCode(10); + n1.emit("input", { payload: testString }); + }); + }); + + it('should allow passing in a template as first line of CSV', function (done) { + // RFC-vs-Legacy difference + // In RFC mode, spaces are respected in the template (RFC4180 Section 2.4) + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "", hdrin: true, wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', { a: 1, "b b": 2, "c,c": 3, " d, d ": 4 }); // RFC-vs-Legacy difference + msg.should.have.property('columns', 'a,b b,"c,c"," d, d "'); // RFC-vs-Legacy difference + check_parts(msg, 0, 1); + done(); + } catch (e) { done(e); } + }); + const testString = 'a,b b,"c,c"," d, d "' + "\n" + "1,2,3,4" + String.fromCharCode(10); + n1.emit("input", { payload: testString }); + }); + }); + + it('should allow passing in a template as first line of CSV (not comma)', function (done) { + // RFC-vs-Legacy difference + // In RFC mode, spaces are respected in the template (RFC4180 Section 2.4) + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "", hdrin: true, sep: ";", wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', { a: 1, "b b": 2, "c;c": 3, " d, d ": 4 }); // RFC-vs-Legacy difference + msg.should.have.property('columns', 'a,b b,c;c," d, d "'); // RFC-vs-Legacy difference + check_parts(msg, 0, 1); + done(); + } catch (e) { done(e); } + }); + const testString = 'a;b b;"c;c";" d, d "' + "\n" + "1;2;3;4" + String.fromCharCode(10); + n1.emit("input", { payload: testString }); + }); + }); + + it('should allow passing in a template as first line of CSV (special char /)', function (done) { + // RFC-vs-Legacy difference + // In RFC mode, spaces are respected in the template (RFC4180 Section 2.4) + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "", hdrin: true, sep: "/", wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', { a: 1, "b b": 2, "c/c": 3, " d, d ": 4 }); // RFC-vs-Legacy difference + msg.should.have.property('columns', 'a,b b,c/c," d, d "'); // RFC-vs-Legacy difference + check_parts(msg, 0, 1); + done(); + } catch (e) { done(e); } + }); + const testString = 'a/b b/"c/c"/" d, d "' + "\n" + "1/2/3/4" + String.fromCharCode(10); + n1.emit("input", { payload: testString }); + }); + }); + + it('should allow passing in a template as first line of CSV (special char \\)', function (done) { + // RFC-vs-Legacy difference + // In RFC mode, spaces are respected in the template (RFC4180 Section 2.4) + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "", hdrin: true, sep: "\\", wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', { a: 1, "b b": 2, "c\\c": 3, " d, d ": 4 }); // RFC-vs-Legacy difference + msg.should.have.property('columns', 'a,b b,c\\c," d, d "'); // RFC-vs-Legacy difference + check_parts(msg, 0, 1); + done(); + } catch (e) { done(e); } + }); + const testString = 'a\\b b\\"c\\c"\\" d, d "' + "\n" + "1\\2\\3\\4" + String.fromCharCode(10); + n1.emit("input", { payload: testString }); + }); + }); + + it('should leave numbers starting with 0, e and + as strings (except 0.)', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,b,c,d,e,f,g", wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', { a: 123, b: "0123", c: '+123', d: 'e123', e: 'E123', f: -123 }); + check_parts(msg, 0, 1); + done(); + } + catch (e) { done(e); } + }); + const testString = '123,0123,+123,e123,E123,-123' + String.fromCharCode(10); + n1.emit("input", { payload: testString }); + }); + }); + + it('should not parse numbers when told not to do so', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,b,c,d,e,f,g", strings: false, wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', { a: "1.23", b: "0123", c: "+123", d: "e123", e: "0", f: "-123", g: "1e3" }); + check_parts(msg, 0, 1); + done(); + } + catch (e) { done(e); } + }); + const testString = '1.23,0123,+123,e123,0,-123,1e3' + String.fromCharCode(10); + n1.emit("input", { payload: testString }); + }); + }); + + it('should parse numbers when told to do so', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,b,c,d,e,f,g", wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', { a: 1.23, b: -123, c: 1000, d: 0 }); + check_parts(msg, 0, 1); + done(); + } + catch (e) { done(e); } + }); + const testString = ' 1.23 , -123,1e3 , 0 ' + String.fromCharCode(10); + n1.emit("input", { payload: testString }); + }); + }); + + it('should leave handle strings with scientific notation as numbers', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,b,c,d,e,f,g", wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', { a: 12000, b: 0.012, c: -12000, d: -0.012 }); + check_parts(msg, 0, 1); + done(); + } + catch (e) { done(e); } + }); + const testString = '12E3,12e-3,-12e3,-12E-3' + String.fromCharCode(10); + n1.emit("input", { payload: testString }); + }); + }); + + + it('should allow quotes in the input (but drop blank strings)', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,b,c,d,e,f,g,h", wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + //console.log(msg); + msg.should.have.property('payload', { a: 1, b: -2, c: '+3', d: '04', f: '-05', g: 'ab"cd', h: 'with,a,comma' }); + check_parts(msg, 0, 1); + done(); + } + catch (e) { done(e); } + }); + const testString = '"1","-2","+3","04","","-05","ab""cd","with,a,comma"' + String.fromCharCode(10); + n1.emit("input", { payload: testString }); + }); + }); + + it('should allow blank strings in the input if selected', async function () { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,b,c,d,e,f,g", include_empty_strings: true, wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + await helper.load(csvNode, flow) + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + await new Promise((resolve, reject) => { + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', { a: 1, b: '', c: '', d: '', e: '-05', f: 'ab"cd', g: 'with,a,comma' }); + resolve() + } catch (err) { + reject(err); + } + }); + const testString = '"1","","","","-05","ab""cd","with,a,comma"' + String.fromCharCode(10); + n1.emit("input", { payload: testString }); + }); + }); + + it('should allow missing columns (nulls) in the input if selected', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,b,c,d,e,f,g", include_null_values: true, wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + //console.log(msg); + msg.should.have.property('payload', { a: 1, b: null, c: '+3', d: null, e: '-05', f: 'ab"cd', g: 'with,a,comma' }); + check_parts(msg, 0, 1); + done(); + } + catch (e) { done(e); } + }); + const testString = '"1",,"+3",,"-05","ab""cd","with,a,comma"' + String.fromCharCode(10); + n1.emit("input", { payload: testString }); + }); + }); + + it('should handle cr and lf in the input', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,b,c,d,e,f,g", wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + //console.log(msg); + msg.should.have.property('payload', { a: "with a\nnew line", b: "and a\rcarriage return", c: "and why\r\nnot both" }); + check_parts(msg, 0, 1); + done(); + } + catch (e) { done(e); } + }); + const testString = '"with a' + String.fromCharCode(10) + 'new line","and a' + String.fromCharCode(13) + 'carriage return","and why\r\nnot both"' + String.fromCharCode(10); + n1.emit("input", { payload: testString }); + }); + }); + + it('should recover from an odd number of quotes in the input', function (done) { + // RFC-vs-Legacy difference + // In RFC mode, the column template is parsed in strict mode + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,b,c,d,e,f,g", wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + let c = 0; + n2.on("input", function (msg) { + try { + if (c == 0) { + c = 1; + // 'payload', { a: "with,an", b: "odd,number", c: "ofquotes\n" } // Legacy + msg.should.have.property('payload', { a: 'with,a"n', b: 'odd', c: 'num"ber', d: 'of"qu"ot"es' }); // RFC-vs-Legacy difference + // the result in this bad input data case as defined in RFC4180 would be to fail the parse (strict mode does this, but we don't enforce it in the data) + // However, to better parse _acceptably_ bad data like a,b"b,c'c,"d,d" (which the newer RFC mode parser correctly parses as a,b"b,c'c,"d,d") we would + // need specific code to handle this case and that code would be on the hot path for all data. + // This feels like an acceptable trade-off especially as the legacy mode parser is to be kept for backwards compatibility (until we can remove it) + check_parts(msg, 0, 1); + } + else { + msg.should.have.property('payload', { a: "this is", b: "a normal", c: "line" }); + check_parts(msg, 0, 1); + done(); + } + } + catch (e) { done(e); } + }); + const testString = '"with,a"n,odd","num"ber","of"qu"ot"es"' + String.fromCharCode(10); + n1.emit("input", { payload: testString }); + n1.emit("input", { payload: '"this is","a normal","line"' }); + }); + }); + + it('should handle newlines in the input data', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,b,c,d,e,f,g", wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + + n2.on("input", function (msg) { + try { + //console.log(msg) + // input => 'ay,be,"c has 2\nnew\nlines",dee,eee,eff,gee' + msg.should.have.property('payload', { a: 'ay', b: 'be', c: 'c has 2\nnew\nlines', d: 'dee', e: 'eee', f: 'eff', g: 'gee' }); + check_parts(msg, 0, 1); + done(); + } + catch (e) { done(e); } + }); + + n1.emit("input", { payload: 'ay,be,"c has 2\nnew\nlines",dee,eee,eff,gee' }); + }); + }); + + it('should be able to use the first line as a template', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,b,c,d", hdrin: true, wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + let c = 0; + n2.on("input", function (msg) { + try { + //console.log(msg); + if (c === 0) { + msg.should.have.property('payload', { w: 1, x: 2, y: 3, z: 4 }); + check_parts(msg, 0, 2); + c += 1; + } + else { + msg.should.have.property('payload', { w: 5, x: 6, y: 7, z: 8 }); + check_parts(msg, 1, 2); + done(); + } + } + catch (e) { done(e); } + }); + const testString = "w,x,y,z\n1,2,3,4\n\n5,6,7,8"; + n1.emit("input", { payload: testString }); + }); + }); + + it('should be able to output multiple lines as one array', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,b,c,d", multi: "yes", wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', [{ a: 1, b: 2, c: 3, d: 4 }, { a: 5, b: -6, c: '07', d: '+8' }, { a: 9, b: 0, c: 'a', d: 'b' }, { a: 'c', b: 'd', c: 'e', d: 'f' }]); + msg.should.have.property('columns', 'a,b,c,d'); + msg.should.not.have.property('parts'); + done(); + } + catch (e) { done(e); } + }); + const testString = "1,2,3,4\n5,-6,07,+8\n9,0,a,b\nc,d,e,f"; + n1.emit("input", { payload: testString }); + }); + }); + + it('should be able to create an array from multiple parts', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "", hdrin: true, multi: "mult", wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', [{ "a": 1, "b": 2, "c": 3 }, { "a": 4, "b": 5, "c": 6 }, { "a": 7, "b": 8, "c": 9 }]); + msg.should.have.property('columns', 'a,b,c'); + msg.should.not.have.property('parts'); + done(); + } + catch (e) { done(e); } + }); + + n1.emit("input", { "payload": "a,b,c", "parts": { "index": 0, "ch": "\n", "type": "string", "id": "1" } }); + n1.emit("input", { "payload": "1,2,3", "parts": { "index": 1, "ch": "\n", "type": "string", "id": "1" } }); + n1.emit("input", { "payload": "4,5,6", "parts": { "index": 2, "ch": "\n", "type": "string", "id": "1" } }); + n1.emit("input", { "payload": "7,8,9", "parts": { "index": 3, count: 4, "ch": "\n", "type": "string", "id": "1" } }); + }); + }); + + it('should be able to output multiple objects as an array from an input of parts', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "", hdrin: true, multi: "yes", wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', [{ "Col1": "V1", "Col2": "V2" }, { "Col1": "V3", "Col2": "V4" }, { "Col1": "V5", "Col2": "V6" }]); + msg.should.have.property('columns', 'Col1,Col2'); + msg.should.have.property('parts'); + done(); + } + catch (e) { done(e); } + }); + //var testString = "1,2,3,4\n5,-6,07,+8\n9,0,a,b\nc,d,e,f"; + // n1.emit("input", {payload:testString}); + n1.emit("input", { "payload": "Col1,Col2\nV1,V2\nV3,V4\nV5,V6", "topic": "", "parts": { "id": "3af07e18.865652", "type": "array", "count": 2, "len": 1, "index": 0 } }); + //n1.emit("input", {"payload":"Var1,Var2\nW1,W2\nW3,W4\nW5,W6","topic":"","parts":{"id":"3af07e18.865652","type":"array","count":2,"len":1,"index":1}}); + }); + }); + + it('should handle numbers in strings but not IP addresses', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,b,c,d,e", wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', { a: "a", b: "127.0.0.1", c: 56.7, d: -32.8, e: "+76.22C" }); + check_parts(msg, 0, 1); + done(); + } + catch (e) { done(e); } + }); + const testString = "a,127.0.0.1,56.7,-32.8,+76.22C"; + n1.emit("input", { payload: testString }); + }); + }); + + it('should preserve parts property', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,b,c,d", wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', { a: 1, b: 2, c: 3, d: 4 }); + check_parts(msg, 3, 4); + done(); + } + catch (e) { done(e); } + }); + const testString = "1,2,3,4" + String.fromCharCode(10); + n1.emit("input", { payload: testString, parts: { id: "X", index: 3, count: 4 } }); + }); + }); + + it('should be able to use the first of multiple parts as a template if parts are present', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "", hdrin: true, wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + let c = 0; + n2.on("input", function (msg) { + try { + if (c === 0) { + msg.should.have.property('payload', { w: 1, x: 2, y: 3, z: 4 }); + check_parts(msg, 0, 2); + c += 1; + } + else { + msg.should.have.property('payload', { w: 5, x: 6, y: 7, z: 8 }); + check_parts(msg, 1, 2); + done(); + } + } + catch (e) { done(e); } + }); + const testString1 = "w,x,y,z\n"; + const testString2 = "1,2,3,4\n"; + const testString3 = "5,6,7,8\n"; + n1.emit("input", { payload: testString1, parts: { id: "X", index: 0, count: 3 } }); + n1.emit("input", { payload: testString2, parts: { id: "X", index: 1, count: 3 } }); + n1.emit("input", { payload: testString3, parts: { id: "X", index: 2, count: 3 } }); + }); + }); + + it('should skip several lines from start if requested', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,b,c,d", skip: 2, wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', { a: 9, b: 0, c: "A", d: "B" }); + check_parts(msg, 0, 1); + done(); + } + catch (e) { done(e); } + }); + const testString = "1,2,3,4" + String.fromCharCode(10) + "5,6,7,8" + String.fromCharCode(10) + "9,0,A,B" + String.fromCharCode(10); + n1.emit("input", { payload: testString }); + }); + }); + + it('should skip several lines from start then use next line as a template', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,b,c,d", hdrin: true, skip: 2, wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', { "9": "C", "0": "D", "A": "E", "B": "F" }); + check_parts(msg, 0, 1); + done(); + } + catch (e) { done(e); } + }); + const testString = "1,2,3,4" + String.fromCharCode(10) + "5,6,7,8" + String.fromCharCode(10) + "9,0,A,B" + String.fromCharCode(10) + "C,D,E,F" + String.fromCharCode(10); + n1.emit("input", { payload: testString }); + }); + }); + + it('should skip several lines from start and correct parts', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,b,c,d", skip: 2, wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + let c = 0; + n2.on("input", function (msg) { + try { + if (c === 0) { + msg.should.have.property('payload', { a: 9, b: 0, c: "A", d: "B" }); + check_parts(msg, 0, 2); + c = c + 1; + } + else { + msg.should.have.property('payload', { a: "C", b: "D", c: "E", d: "F" }); + check_parts(msg, 1, 2); + done(); + } + } + catch (e) { done(e); } + }); + const testString = "1,2,3,4" + String.fromCharCode(10) + "5,6,7,8" + String.fromCharCode(10) + "9,0,A,B" + String.fromCharCode(10) + "C,D,E,F" + String.fromCharCode(10); + n1.emit("input", { payload: testString }); + }); + }); + + it('should be able to skip and then use the first of multiple parts as a template if parts are present', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "", hdrin: true, skip: 2, wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + let c = 0; + n2.on("input", function (msg) { + try { + if (c === 0) { + msg.should.have.property('payload', { w: 1, x: 2, y: 3, z: 4 }); + msg.should.have.property('columns', 'w,x,y,z'); + check_parts(msg, 0, 2); + c += 1; + } + else { + msg.should.have.property('payload', { w: 5, x: 6, y: 7, z: 8 }); + msg.should.have.property('columns', 'w,x,y,z'); + check_parts(msg, 1, 2); + done(); + } + } + catch (e) { done(e); } + }); + const testStringA = "foo\n"; + const testStringB = "bar\n"; + const testString1 = "w,x,y,z\n"; + const testString2 = "1,2,3,4\n"; + const testString3 = "5,6,7,8\n"; + n1.emit("input", { payload: testStringA, parts: { id: "X", index: 0, count: 5 } }); + n1.emit("input", { payload: testStringB, parts: { id: "X", index: 1, count: 5 } }); + n1.emit("input", { payload: testString1, parts: { id: "X", index: 2, count: 5 } }); + n1.emit("input", { payload: testString2, parts: { id: "X", index: 3, count: 5 } }); + n1.emit("input", { payload: testString3, parts: { id: "X", index: 4, count: 5 } }); + }); + }); + + }); + + describe('json object to csv', function () { + + it('should convert a simple object back to a csv', function (done) { + // RFC-vs-Legacy difference + // By default, the legacy mode parser will use \n as the line separator + // The RFC mode parser will use \r\n as the line separator as per RFC4180 Section 2.1 + // This is configurable in both modes meaning that the legacy mode parser can be made to use \r\n and the RFC mode parser can be made to use \n + // Any existing flows will still use the line ending that they were created with as it will be stored in the flow file + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,b,c,,e,f,g,h,i,j,k", wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + // console.log("GOT",msg) + try { + // 'payload', '4,foo,true,,0,"Hello\nWorld",,,undefined,null,null\n'); // Legacy + msg.should.have.property('payload', '4,foo,true,,0,"Hello\nWorld",,,undefined,null,null\r\n'); // RFC-vs-Legacy difference + done(); + } catch (e) { + done(e); + } + }); + const testJson = { e: 0, d: 1, b: "foo", c: true, a: 4, f: "Hello\nWorld", h: undefined, i: "undefined", j: null, k: "null" }; + n1.emit("input", { payload: testJson }); + }); + }); + + it('should convert a simple object back to a csv with no template', function (done) { + // RFC-vs-Legacy differences + // line separator handling: + // By default, the legacy mode parser will use \n as the line separator + // The RFC mode parser will use \r\n as the line separator as per RFC4180 Section 2.1 + // spaces: + // By default, the legacy mode parser will trim spaces from the start and end template columns + // The RFC mode parser will not trim spaces from the start and end template columns (RFC4180 Section 2.4) + // This means the original test flow, when ran in RFC mode, was expecting to find a prop name of " " in the input data object + // To make this test work, we need to change the column template to not be a space! + + // flow = [ { id:"n1", type:"csv", spec: "rfc", temp:" ", wires:[["n2"]] }, // Legacy + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "", wires: [["n2"]] }, // RFC-vs-Legacy difference - legacy mode trims spaces, RFC mode respects them. + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + // console.log("GOT",msg) + try { + msg.should.have.property('payload', '1,foo,"ba""r","di,ng",,undefined,null\r\n'); + done(); + } catch (e) { + done(e); + } + }); + const testJson = { d: 1, b: "foo", c: "ba\"r", a: "di,ng", e: undefined, f: "undefined", g: null, h: "null" }; + n1.emit("input", { payload: testJson }); + }); + }); + + it('should convert a simple object back to a tsv using a tab as a separator', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "", sep: "\t", ret: '\n', wires: [["n2"]] }, // RFC-vs-Legacy difference - use line separator \n to satisfy original test + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', '1\tfoo\t"ba""r"\tdi,ng\n'); + done(); + } catch (e) { + done(e); + } + }); + const testJson = { d: 1, b: "foo", c: "ba\"r", a: "di,ng" }; + n1.emit("input", { payload: testJson }); + }); + }); + + it('should handle a template with spaces in the property names', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,b o,c p,,e", ret: '\n', wires: [["n2"]] }, // RFC-vs-Legacy difference - use line separator \n to satisfy original test + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', '4,foo,true,,0\n'); + done(); + } catch (e) { + done(e); + } + }); + const testJson = { e: 0, d: 1, "b o": "foo", "c p": true, a: 4 }; + n1.emit("input", { payload: testJson }); + }); + }); + + it('should handle a template with quotes in the property names', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "", hdrout: "all", ret: '\n', wires: [["n2"]] }, // RFC-vs-Legacy difference - use line separator \n to satisfy original test + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + // 'payload', 'a"a,b\'b\nA1,B1\nA2,B2\n'); // Legacy + msg.should.have.property('payload', '"a""a",b\'b\nA1,B1\nA2,B2\n'); // RFC-vs-Legacy difference - RFC4180 Section 2.6, 2.7 quote handling + done(); + } catch (e) { + done(e); + } + }); + const testJson = [ + { + "a\"a": "A1", + "b'b": "B1" + }, + { + "a\"a": "A2", + "b'b": "B2" + } + ] + n1.emit("input", { payload: testJson }); + }); + }); + + it('should convert an array of objects to a multi-line csv', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,d,c,b", ret: '\n', wires: [["n2"]] }, // RFC-vs-Legacy difference - use line separator \n to satisfy original test + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', '4,1,2,3\n1,4,3,2\n'); + done(); + } catch (e) { + done(e); + } + }); + const testJson = [{ d: 1, b: 3, c: 2, a: 4 }, { d: 4, a: 1, c: 3, b: 2 }]; + n1.emit("input", { payload: testJson }); + }); + }); + + it('should convert an array of objects to a multi-line csv and add a header', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,b,c,d", hdrout: "all", ret: '\n', wires: [["n2"]] }, // RFC-vs-Legacy difference - use line separator \n to satisfy original test + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', 'a,b,c,d\n4,3,2,1\n1,2,3,"a\nb"\n'); + done(); + } + catch (e) { done(e); } + }); + const testJson = [{ d: 1, b: 3, c: 2, a: 4 }, { d: "a\nb", a: 1, c: 3, b: 2 }]; + n1.emit("input", { payload: testJson }); + }); + }); + + it('should convert an array of objects to a multi-line csv without a template', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "", ret: '\n', wires: [["n2"]] }, // RFC-vs-Legacy difference - use line separator \n to satisfy original test + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', '1,3,2,4\n4,2,3,1\n'); + done(); + } + catch (e) { done(e); } + }); + const testJson = [{ d: 1, b: 3, c: 2, a: 4 }, { d: 4, a: 1, c: 3, b: 2 }]; + n1.emit("input", { payload: testJson }); + }); + }); + + it('should convert an array of objects to a multi-line csv without a template and with a header', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "", hdrout: "all", ret: '\n', wires: [["n2"]] }, // RFC-vs-Legacy difference - use line separator \n to satisfy original test + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', 'd,b,c,a\n1,3,2,4\n4,"f\ng",3,1\n'); + done(); + } + catch (e) { done(e); } + }); + const testJson = [{ d: 1, b: 3, c: 2, a: 4 }, { d: 4, a: 1, c: 3, b: "f\ng" }]; + n1.emit("input", { payload: testJson }); + }); + }); + + it('should convert a simple array back to a csv', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,b,c,d", ret: '\n', wires: [["n2"]] }, // RFC-vs-Legacy difference - use line separator \n to satisfy original test + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + // 'payload', ',0,1,foo,"ba""r","di,ng","fa\nba"\n'); + msg.should.have.property('payload', ',0,1,foo\n'); // RFC-vs-Legacy difference - respect that user has specified a template with 4 columns + done(); + } + catch (e) { done(e); } + }); + const testJson = ["", 0, 1, "foo", 'ba"r', 'di,ng', "fa\nba"]; + n1.emit("input", { payload: testJson }); + }); + }); + + it('should convert an array of arrays back to a multi-line csv', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,b,c,d", ret: '\n', wires: [["n2"]] }, // RFC-vs-Legacy difference - use line separator \n to satisfy original test + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + // 'payload', '0,1,2,3,4\n4,3,2,1,0\n'); // Legacy + msg.should.have.property('payload', '0,1,2,3\n4,3,2,1\n'); // RFC-vs-Legacy difference - respect that user has specified a template with 4 columns + done(); + } + catch (e) { done(e); } + }); + const testJson = [[0, 1, 2, 3, 4], [4, 3, 2, 1, 0]]; + n1.emit("input", { payload: testJson }); + }); + }); + + it('should be able to include column names as first row', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,b,c,d", hdrout: true, ret: "\r\n", wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', 'a,b,c,d\r\n4,3,2,1\r\n'); + done(); + } + catch (e) { done(e); } + }); + const testJson = [{ d: 1, b: 3, c: 2, a: 4 }]; + n1.emit("input", { payload: testJson }); + }); + }); + + it('should be able to include column names as first row, and missing properties', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", hdrout: true, ret: "\r\n", wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', 'col1,col2,col3,col4\r\nH1,H2,H3,H4\r\nA,B,,\r\nA,,C,\r\nA,,,"D\nE"\r\n'); + done(); + } + catch (e) { done(e); } + }); + const testJson = [{ "col1": "H1", "col2": "H2", "col3": "H3", "col4": "H4" }, { "col1": "A", "col2": "B" }, { "col1": "A", "col3": "C" }, { "col1": "A", "col4": "D\nE" }]; + n1.emit("input", { payload: testJson }); + }); + }); + + + it('should be able to pass in column names', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "", hdrout: "once", ret: "\r\n", wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + let count = 0; + n2.on("input", function (msg) { + count += 1; + try { + if (count === 1) { + msg.should.have.property('payload', 'a,,b,a\r\n4,,3,4\r\n'); + } + if (count === 3) { + msg.should.have.property('payload', '4,,3,4\r\n'); + done() + } + } + catch (e) { done(e); } + }); + const testJson = [{ d: 1, b: 3, c: 2, a: 4 }]; + n1.emit("input", { payload: testJson, columns: "a,,b,a", parts: { index: 0 } }); + n1.emit("input", { payload: testJson, parts: { index: 1 } }); + n1.emit("input", { payload: testJson, parts: { index: 2 } }); + }); + }); + + it('should be able to pass in column names - with payload as an array', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", hdrout: "once", ret: "\r\n", wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', 'a,,b,a\r\n4,,3,4\r\n4,,3,4\r\n4,,3,4\r\n'); + done() + } + catch (e) { done(e); } + }); + const testJson = { d: 1, b: 3, c: 2, a: 4 }; + n1.emit("input", { payload: [testJson, testJson, testJson], columns: "a,,b,a" }); + }); + }); + + it('should handle quotes and sub-properties', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,b,c,d", ret: '\n', wires: [["n2"]] }, // RFC-vs-Legacy difference - use line separator \n to satisfy original test + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + msg.should.have.property('payload', '{},"text,with,commas","This ""is"" a banana","{""sub"":""object""}"\n'); + done(); + } + catch (e) { done(e); } + }); + const testJson = { d: { sub: "object" }, b: "text,with,commas", c: 'This "is" a banana', a: { sub2: undefined } }; + n1.emit("input", { payload: testJson }); + }); + }); + + }); + + it('should just pass through if no payload provided', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,b,c,d", wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + n2.on("input", function (msg) { + try { + msg.should.have.property('topic', { a: 4, b: 3, c: 2, d: 1 }); + msg.should.not.have.property('payload'); + + done(); + } + catch (e) { done(e); } + }); + const testJson = { d: 1, b: 3, c: 2, a: 4 }; + n1.emit("input", { topic: testJson }); + }); + }); + + it('should warn if provided a number or boolean', function (done) { + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,b,c,d", wires: [["n2"]] }, + { id: "n2", type: "helper" }]; + helper.load(csvNode, flow, function () { + const n1 = helper.getNode("n1"); + const n2 = helper.getNode("n2"); + setTimeout(function () { + try { + const logEvents = helper.log().args.filter(function (evt) { + return evt[0].type == "csv"; + }); + logEvents.should.have.length(2); + logEvents[0][0].should.have.a.property('msg'); + logEvents[0][0].msg.toString().should.endWith('csv.errors.csv_js'); + logEvents[1][0].should.have.a.property('msg'); + logEvents[1][0].msg.toString().should.endWith('csv.errors.csv_js'); + done(); + } catch (err) { + done(err); + } + }, 150); + n1.emit("input", { payload: 1 }); + n1.emit("input", { payload: true }); + }); + }); + + it('should call done when message processing is completed', function (done) { + const completeNode = require("nr-test-utils").require("@node-red/nodes/core/common/24-complete.js"); + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,b,c,d", wires: [[]] }, + { id: "c1", type: "complete", scope: ["n1"], uncaught: false, wires: [["h1"]] }, + { id: "h1", type: "helper", wires: [[]] }]; + helper.load([csvNode, completeNode], flow, function () { + const n1 = helper.getNode("n1"); + const h1 = helper.getNode("h1"); + h1.on("input", function (msg) { + try { + msg.should.have.a.property('payload', "1,2,3,4"); + done(); + } catch (e) { + done(e); + } + }); + n1.receive({ payload: "1,2,3,4" }); + }); + }); + + it('should not call done or pass the bad msg through when input causes an error - should throw error and set status', function (done) { + // RFC-vs-Legacy difference + // In RFC mode, instead of passing the bad data through, the node will throw an error and set the status to indicate the error + const completeNode = require("nr-test-utils").require("@node-red/nodes/core/common/24-complete.js"); + const flow = [{ id: "n1", type: "csv", spec: "rfc", temp: "a,b,c,d", wires: [[]] }, + { id: "c1", type: "complete", scope: ["n1"], uncaught: false, wires: [["h1"]] }, + { id: "h1", type: "helper", wires: [[]] }]; + helper.load([csvNode, completeNode], flow, function () { + const n1 = helper.getNode("n1"); + const h1 = helper.getNode("h1"); + const c1 = helper.getNode("c1"); + n1.receive({ payload: 1 }); // neither object nor string + setTimeout(function () { + try { + c1.send.should.not.be.called(); + const logEvents = helper.log().args.filter(function (evt) { + return evt[0].type == "csv"; + }); + logEvents.should.have.length(1); + logEvents[0][0].should.have.a.property('msg'); + logEvents[0][0].msg.should.be.an.Error() + logEvents[0][0].msg.toString().should.endWith('csv.errors.csv_js'); + // check status was set + n1.status.called.should.be.true(); + n1.status.lastCall.args[0].should.have.property('fill', 'red'); + n1.status.lastCall.args[0].should.have.property('shape', 'dot'); + n1.status.lastCall.args[0].should.have.property('text', 'csv.errors.csv_js'); + // check error was thrown + n1.error.called.should.be.true(); + n1.error.lastCall.args[0].should.have.property('message', 'csv.errors.csv_js'); + done(); + } catch (err) { + done(err); + } + }, 150); + + }); + }); +}); diff --git a/test/unit/@node-red/editor-api/lib/editor/ui_spec.js b/test/unit/@node-red/editor-api/lib/editor/ui_spec.js index 0380adcde..beb562650 100644 --- a/test/unit/@node-red/editor-api/lib/editor/ui_spec.js +++ b/test/unit/@node-red/editor-api/lib/editor/ui_spec.js @@ -29,7 +29,7 @@ describe("api/editor/ui", function() { var app; before(function() { - ui.init({ + ui.init({}, { nodes: { getIcon: function(opts) { return new Promise(function(resolve,reject) { diff --git a/test/unit/@node-red/runtime/lib/flows/Flow_spec.js b/test/unit/@node-red/runtime/lib/flows/Flow_spec.js index 167691074..8406a01b7 100644 --- a/test/unit/@node-red/runtime/lib/flows/Flow_spec.js +++ b/test/unit/@node-red/runtime/lib/flows/Flow_spec.js @@ -26,6 +26,7 @@ var flowUtils = NR_TEST_UTILS.require("@node-red/runtime/lib/flows/util"); var Flow = NR_TEST_UTILS.require("@node-red/runtime/lib/flows/Flow"); var flows = NR_TEST_UTILS.require("@node-red/runtime/lib/flows"); var Node = NR_TEST_UTILS.require("@node-red/runtime/lib/nodes/Node"); +var credentials = NR_TEST_UTILS.require("@node-red/runtime/lib/nodes/credentials"); var hooks = NR_TEST_UTILS.require("@node-red/util/lib/hooks"); var typeRegistry = NR_TEST_UTILS.require("@node-red/registry"); @@ -61,6 +62,7 @@ describe('Flow', function() { this.scope = n.scope; var node = this; this.foo = n.foo; + this.bar = n.bar; this.handled = 0; this.stopped = false; currentNodes[node.id] = node; @@ -1235,11 +1237,12 @@ describe('Flow', function() { }) describe("#env", function () { + afterEach(() => { + delete process.env.V0; + delete process.env.V1; + credentials.get.restore?.() + }) it("can instantiate a node with environment variable property values of group and tab", async function () { - after(function() { - delete process.env.V0; - delete process.env.V1; - }) process.env.V0 = "gv0"; process.env.V1 = "gv1"; process.env.V3 = "gv3"; @@ -1283,10 +1286,6 @@ describe('Flow', function() { }); it("can access environment variable property using $parent", async function () { - after(function() { - delete process.env.V0; - delete process.env.V1; - }) process.env.V0 = "gv0"; process.env.V1 = "gv1"; var config = flowUtils.parseConfig([ @@ -1321,9 +1320,6 @@ describe('Flow', function() { }); it("can define environment variable using JSONata", async function () { - after(function() { - delete process.env.V0; - }) var config = flowUtils.parseConfig([ {id:"t1",type:"tab",env:[ {"name": "V0", value: "1+2", type: "jsonata"} @@ -1346,9 +1342,6 @@ describe('Flow', function() { }); it("can access global environment variables defined as JSONata values", async function () { - after(function() { - delete process.env.V0; - }) var config = flowUtils.parseConfig([ {id:"t1",type:"tab",env:[ {"name": "V0", value: "1+2", type: "jsonata"} @@ -1370,15 +1363,21 @@ describe('Flow', function() { await flow.stop() }); it("global flow can access global-config defined environment variables", async function () { - after(function() { - delete process.env.V0; + sinon.stub(credentials,"get").callsFake(function(id) { + if (id === 'gc') { + return { map: { GC_CRED: 'gc_cred' }} + } + return null }) + const config = flowUtils.parseConfig([ {id:"gc", type:"global-config", env:[ - {"name": "GC0", value: "3+4", type: "jsonata"} + {"name": "GC0", value: "3+4", type: "jsonata"}, + {"name": "GC_CRED", type: "cred"}, + ]}, {id:"t1",type:"tab" }, - {id:"1",x:10,y:10,z:"t1",type:"test",foo:"${GC0}",wires:[]}, + {id:"1",x:10,y:10,z:"t1",type:"test",foo:"${GC0}", bar:"${GC_CRED}", wires:[]}, ]); // Two-arg call - makes this the global flow that handles global-config nodes const globalFlow = Flow.create({getSetting:v=>process.env[v]},config); @@ -1390,6 +1389,7 @@ describe('Flow', function() { var activeNodes = flow.getActiveNodes(); activeNodes["1"].foo.should.equal(7); + activeNodes["1"].bar.should.equal('gc_cred'); await flow.stop() await globalFlow.stop() 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 3fe676f1e..8aa9e6e28 100644 --- a/test/unit/@node-red/runtime/lib/nodes/Node_spec.js +++ b/test/unit/@node-red/runtime/lib/nodes/Node_spec.js @@ -183,6 +183,35 @@ describe('Node', function() { n.receive(message); }); + + it('calls parent flow handleComplete when multiple callbacks provided', function(done) { + var n = new RedNode({id:'123',type:'abc', _flow: { + handleComplete: function(node,msg) { + try { + doneCount.should.equal(2) + msg.should.deepEqual(message); + done(); + } catch(err) { + done(err); + } + } + }}); + + var message = {payload:"hello world"}; + let doneCount = 0 + n.on('input',function(msg, nodeSend, nodeDone) { + doneCount++ + nodeDone(); + }); + // Include a callback without explicit done signature + n.on('input',function(msg) { }); + n.on('input',function(msg, nodeSend, nodeDone) { + doneCount++ + nodeDone(); + }); + n.receive(message); + }); + it('triggers onComplete hook when done callback provided', function(done) { var handleCompleteCalled = false; var hookCalled = false; diff --git a/test/unit/@node-red/util/lib/util_spec.js b/test/unit/@node-red/util/lib/util_spec.js index 3bab2739a..e48e9fc84 100644 --- a/test/unit/@node-red/util/lib/util_spec.js +++ b/test/unit/@node-red/util/lib/util_spec.js @@ -379,10 +379,17 @@ describe("@node-red/util/util", function() { result = util.evaluateNodeProperty('','bool'); result.should.be.false(); }); - it('returns date',function() { + it('returns date - default format',function() { var result = util.evaluateNodeProperty('','date'); (Date.now() - result).should.be.approximately(0,50); }); + + it('returns date - iso format',function() { + var result = util.evaluateNodeProperty('iso','date'); + // 2023-12-04T16:51:04.429Z + /^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d\.\d+Z$/.test(result).should.be.true() + }); + it('returns bin', function () { var result = util.evaluateNodeProperty('[1, 2]','bin'); result[0].should.eql(1); @@ -441,9 +448,16 @@ describe("@node-red/util/util", function() { },{}); result.should.eql("123"); }); - it('returns jsonata result', function () { - var result = util.evaluateNodeProperty('$abs(-1)','jsonata',{},{}); - result.should.eql(1); + it('returns jsonata result', function (done) { + util.evaluateNodeProperty('$abs(-1)','jsonata',{},{}, (err, result) => { + try { + result.should.eql(1); + done() + } catch (error) { + done(error) + } + + }); }); it('returns null', function() { var result = util.evaluateNodeProperty(null,'null'); @@ -601,51 +615,105 @@ describe("@node-red/util/util", function() { }); }); describe('evaluateJSONataExpression', function() { - it('evaluates an expression', function() { + it('evaluates an expression', function(done) { var expr = util.prepareJSONataExpression('payload',{}); - var result = util.evaluateJSONataExpression(expr,{payload:"hello"}); - result.should.eql("hello"); + util.evaluateJSONataExpression(expr,{payload:"hello"}, (err, result) => { + try { + result.should.eql("hello"); + done() + } catch (error) { + done(error) + } + }); }); it('evaluates a legacyMode expression', function() { var expr = util.prepareJSONataExpression('msg.payload',{}); - var result = util.evaluateJSONataExpression(expr,{payload:"hello"}); - result.should.eql("hello"); + util.evaluateJSONataExpression(expr,{payload:"hello"}, (err, result) => { + try { + result.should.eql("hello"); + done() + } catch (error) { + done(error) + } + }); }); it('accesses flow context from an expression', function() { var expr = util.prepareJSONataExpression('$flowContext("foo")',{context:function() { return {flow:{get: function(key) { return {'foo':'bar'}[key]}}}}}); - var result = util.evaluateJSONataExpression(expr,{payload:"hello"}); - result.should.eql("bar"); + util.evaluateJSONataExpression(expr,{payload:"hello"}, (err, result) => { + try { + result.should.eql("bar"); + done() + } catch (error) { + done(error) + } + }); }); it('accesses undefined environment variable from an expression', function() { var expr = util.prepareJSONataExpression('$env("UTIL_ENV")',{}); - var result = util.evaluateJSONataExpression(expr,{}); - result.should.eql(''); - }); + util.evaluateJSONataExpression(expr,{}, (err, result) => { + try { + result.should.eql(""); + done() + } catch (error) { + done(error) + } + }); + }); it('accesses environment variable from an expression', function() { process.env.UTIL_ENV = 'foo'; var expr = util.prepareJSONataExpression('$env("UTIL_ENV")',{}); - var result = util.evaluateJSONataExpression(expr,{}); - result.should.eql('foo'); - }); + util.evaluateJSONataExpression(expr,{}, (err, result) => { + try { + result.should.eql("foo"); + done() + } catch (error) { + done(error) + } + }); + }); it('accesses moment from an expression', function() { var expr = util.prepareJSONataExpression('$moment("2020-05-27", "YYYY-MM-DD").add(7, "days").add(1, "months").format("YYYY-MM-DD")',{}); - var result = util.evaluateJSONataExpression(expr,{}); - result.should.eql('2020-07-03'); + util.evaluateJSONataExpression(expr,{}, (err, result) => { + try { + result.should.eql("2020-07-03"); + done() + } catch (error) { + done(error) + } + }); }); it('accesses moment-timezone from an expression', function() { var expr = util.prepareJSONataExpression('$moment("2013-11-18 11:55Z").tz("Asia/Taipei").format()',{}); - var result = util.evaluateJSONataExpression(expr,{}); - result.should.eql('2013-11-18T19:55:00+08:00'); + util.evaluateJSONataExpression(expr,{}, (err, result) => { + try { + result.should.eql("2013-11-18T19:55:00+08:00"); + done() + } catch (error) { + done(error) + } + }); }); it('handles non-existant flow context variable', function() { var expr = util.prepareJSONataExpression('$flowContext("nonExistant")',{context:function() { return {flow:{get: function(key) { return {'foo':'bar'}[key]}}}}}); - var result = util.evaluateJSONataExpression(expr,{payload:"hello"}); - should.not.exist(result); - }); + util.evaluateJSONataExpression(expr,{payload:"hello"}, (err, result) => { + try { + should.not.exist(result); + done() + } catch (error) { + done(error) + } + }); + }); it('handles non-existant global context variable', function() { var expr = util.prepareJSONataExpression('$globalContext("nonExistant")',{context:function() { return {global:{get: function(key) { return {'foo':'bar'}[key]}}}}}); - var result = util.evaluateJSONataExpression(expr,{payload:"hello"}); - should.not.exist(result); + util.evaluateJSONataExpression(expr,{payload:"hello"}, (err, result) => { + try { + should.not.exist(result); + done() + } catch (error) { + done(error) + } + }); }); it('handles async flow context access', function(done) { var expr = util.prepareJSONataExpression('$flowContext("foo")',{context:function() { return {flow:{get: function(key,store,callback) { setTimeout(()=>{callback(null,{'foo':'bar'}[key])},10)}}}}});