n8n-nodes-toon-format-parser 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +46 -0
- package/bun.lock +205 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5 -0
- package/dist/nodes/ToonParser/ToonParser.node.d.ts +5 -0
- package/dist/nodes/ToonParser/ToonParser.node.js +135 -0
- package/index.ts +1 -0
- package/nodes/ToonParser/ToonParser.node.ts +143 -0
- package/package.json +31 -0
- package/test_io.txt +1 -0
- package/tsconfig.json +32 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 John Paez
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# n8n-nodes-toon-format-parser
|
|
2
|
+
|
|
3
|
+
Este es un nodo comunitario para [n8n](https://n8n.io/) que permite manipular el formato de datos **TOON**. Proporciona funcionalidades para decodificar cadenas en formato TOON a objetos JSON y viceversa.
|
|
4
|
+
|
|
5
|
+
## ¿Qué es el formato TOON?
|
|
6
|
+
El formato TOON es una estructura de datos optimizada para ser legible tanto por humanos como por máquinas, ofreciendo una alternativa ligera y flexible al JSON tradicional para ciertos casos de uso de intercambio de datos.
|
|
7
|
+
|
|
8
|
+
## Características
|
|
9
|
+
- **Decodificación (Decode)**: Convierte una cadena TOON en un objeto JSON estructurado.
|
|
10
|
+
- **Codificación (Encode)**: Transforma un objeto JSON a formato TOON.
|
|
11
|
+
- **Opciones Personalizables**:
|
|
12
|
+
- Control de indentación.
|
|
13
|
+
- Soporte para delimitadores personalizados (Comas, Tabs, Pipes) en estructuras tabulares.
|
|
14
|
+
- **Paired Items**: Soporte completo para el seguimiento de ítems en n8n.
|
|
15
|
+
|
|
16
|
+
## Instalación
|
|
17
|
+
Para instalar este nodo en tu instancia de n8n, sigue estos pasos:
|
|
18
|
+
|
|
19
|
+
1. Ve a **Settings > Community Nodes**.
|
|
20
|
+
2. Haz clic en **Install a community node**.
|
|
21
|
+
3. Ingresa el nombre del paquete: `n8n-nodes-toon-format-parser`.
|
|
22
|
+
4. Acepta los términos y haz clic en **Install**.
|
|
23
|
+
|
|
24
|
+
Si usas n8n en Docker, asegúrate de que el contenedor tenga permisos para instalar paquetes de npm.
|
|
25
|
+
|
|
26
|
+
## Operaciones
|
|
27
|
+
|
|
28
|
+
### Decode TOON
|
|
29
|
+
Convierte datos TOON en JSON. Útil cuando recibes respuestas de APIs o archivos que utilizan este formato.
|
|
30
|
+
|
|
31
|
+
* **TOON String**: El texto en formato TOON que deseas procesar.
|
|
32
|
+
* **Opciones**: Configura la indentación o el delimitador si el formato TOON lo requiere.
|
|
33
|
+
|
|
34
|
+
### Encode TOON
|
|
35
|
+
Convierte un objeto JSON a TOON. Ideal para preparar datos antes de enviarlos a servicios que esperan este formato.
|
|
36
|
+
|
|
37
|
+
* **JSON Object**: El objeto o dato que deseas convertir.
|
|
38
|
+
* **Opciones**: Configura la estructura visual del TOON resultante.
|
|
39
|
+
|
|
40
|
+
## Compatibilidad
|
|
41
|
+
Este nodo ha sido desarrollado y probado con:
|
|
42
|
+
- n8n versión 1.0.0 o superior.
|
|
43
|
+
- Node.js versión 18 o superior.
|
|
44
|
+
|
|
45
|
+
## Licencia
|
|
46
|
+
[MIT](LICENSE)
|
package/bun.lock
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
{
|
|
2
|
+
"lockfileVersion": 1,
|
|
3
|
+
"configVersion": 1,
|
|
4
|
+
"workspaces": {
|
|
5
|
+
"": {
|
|
6
|
+
"name": "n8n-nodes-toon-parser",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"toon-format-parser": "^1.1.0",
|
|
9
|
+
},
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@types/node": "^18.11.9",
|
|
12
|
+
"n8n-workflow": "^2.2.1",
|
|
13
|
+
"typescript": "^4.8.4",
|
|
14
|
+
},
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"n8n-workflow": "*",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
"packages": {
|
|
21
|
+
"@n8n/errors": ["@n8n/errors@0.5.0", "", { "dependencies": { "callsites": "3.1.0" } }, "sha512-0Vk1Eb3Uor+zeF/WVnuhFgJc51wEBTZNBlVQy3mvyr3sGmW86bP1jA7wmRsd0DZbswPwN0vNOl/TmkDTEopOtQ=="],
|
|
22
|
+
|
|
23
|
+
"@n8n/tournament": ["@n8n/tournament@1.0.6", "", { "dependencies": { "@n8n_io/riot-tmpl": "^4.0.1", "ast-types": "^0.16.1", "esprima-next": "^5.8.4", "recast": "^0.22.0" } }, "sha512-UGSxYXXVuOX0yL6HTLBStKYwLIa0+JmRKiSZSCMcM2s2Wax984KWT6XIA1TR/27i7yYpDk1MY14KsTPnuEp27A=="],
|
|
24
|
+
|
|
25
|
+
"@n8n_io/riot-tmpl": ["@n8n_io/riot-tmpl@4.0.1", "", { "dependencies": { "eslint-config-riot": "^1.0.0" } }, "sha512-/zdRbEfTFjsm1NqnpPQHgZTkTdbp5v3VUxGeMA9098sps8jRCTraQkc3AQstJgHUm7ylBXJcIVhnVeLUMWAfwQ=="],
|
|
26
|
+
|
|
27
|
+
"@types/node": ["@types/node@18.19.130", "", { "dependencies": { "undici-types": "~5.26.4" } }, "sha512-GRaXQx6jGfL8sKfaIDD6OupbIHBr9jv7Jnaml9tB7l4v068PAOXqfcujMMo5PhbIs6ggR1XODELqahT2R8v0fg=="],
|
|
28
|
+
|
|
29
|
+
"ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="],
|
|
30
|
+
|
|
31
|
+
"ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="],
|
|
32
|
+
|
|
33
|
+
"assert": ["assert@2.1.0", "", { "dependencies": { "call-bind": "^1.0.2", "is-nan": "^1.3.2", "object-is": "^1.1.5", "object.assign": "^4.1.4", "util": "^0.12.5" } }, "sha512-eLHpSK/Y4nhMJ07gDaAzoX/XAKS8PSaojml3M0DM4JpV1LAi5JOJ/p6H/XWrl8L+DzVEvVCW1z3vWAaB9oTsQw=="],
|
|
34
|
+
|
|
35
|
+
"ast-types": ["ast-types@0.16.1", "", { "dependencies": { "tslib": "^2.0.1" } }, "sha512-6t10qk83GOG8p0vKmaCr8eiilZwO171AvbROMtvvNiwrTly62t+7XkA8RdIIVbpMhCASAsxgAzdRSwh6nw/5Dg=="],
|
|
36
|
+
|
|
37
|
+
"asynckit": ["asynckit@0.4.0", "", {}, "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="],
|
|
38
|
+
|
|
39
|
+
"available-typed-arrays": ["available-typed-arrays@1.0.7", "", { "dependencies": { "possible-typed-array-names": "^1.0.0" } }, "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ=="],
|
|
40
|
+
|
|
41
|
+
"call-bind": ["call-bind@1.0.8", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", "get-intrinsic": "^1.2.4", "set-function-length": "^1.2.2" } }, "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww=="],
|
|
42
|
+
|
|
43
|
+
"call-bind-apply-helpers": ["call-bind-apply-helpers@1.0.2", "", { "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" } }, "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ=="],
|
|
44
|
+
|
|
45
|
+
"call-bound": ["call-bound@1.0.4", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "get-intrinsic": "^1.3.0" } }, "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg=="],
|
|
46
|
+
|
|
47
|
+
"callsites": ["callsites@3.1.0", "", {}, "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="],
|
|
48
|
+
|
|
49
|
+
"charenc": ["charenc@0.0.2", "", {}, "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA=="],
|
|
50
|
+
|
|
51
|
+
"cliui": ["cliui@8.0.1", "", { "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", "wrap-ansi": "^7.0.0" } }, "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ=="],
|
|
52
|
+
|
|
53
|
+
"color-convert": ["color-convert@2.0.1", "", { "dependencies": { "color-name": "~1.1.4" } }, "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="],
|
|
54
|
+
|
|
55
|
+
"color-name": ["color-name@1.1.4", "", {}, "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="],
|
|
56
|
+
|
|
57
|
+
"combined-stream": ["combined-stream@1.0.8", "", { "dependencies": { "delayed-stream": "~1.0.0" } }, "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg=="],
|
|
58
|
+
|
|
59
|
+
"crypt": ["crypt@0.0.2", "", {}, "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow=="],
|
|
60
|
+
|
|
61
|
+
"define-data-property": ["define-data-property@1.1.4", "", { "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", "gopd": "^1.0.1" } }, "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A=="],
|
|
62
|
+
|
|
63
|
+
"define-properties": ["define-properties@1.2.1", "", { "dependencies": { "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" } }, "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg=="],
|
|
64
|
+
|
|
65
|
+
"delayed-stream": ["delayed-stream@1.0.0", "", {}, "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ=="],
|
|
66
|
+
|
|
67
|
+
"dunder-proto": ["dunder-proto@1.0.1", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", "gopd": "^1.2.0" } }, "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A=="],
|
|
68
|
+
|
|
69
|
+
"emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="],
|
|
70
|
+
|
|
71
|
+
"es-define-property": ["es-define-property@1.0.1", "", {}, "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g=="],
|
|
72
|
+
|
|
73
|
+
"es-errors": ["es-errors@1.3.0", "", {}, "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="],
|
|
74
|
+
|
|
75
|
+
"es-object-atoms": ["es-object-atoms@1.1.1", "", { "dependencies": { "es-errors": "^1.3.0" } }, "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA=="],
|
|
76
|
+
|
|
77
|
+
"escalade": ["escalade@3.2.0", "", {}, "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA=="],
|
|
78
|
+
|
|
79
|
+
"eslint-config-riot": ["eslint-config-riot@1.0.0", "", {}, "sha512-NB/L/1Y30qyJcG5xZxCJKW/+bqyj+llbcCwo9DEz8bESIP0SLTOQ8T1DWCCFc+wJ61AMEstj4511PSScqMMfCw=="],
|
|
80
|
+
|
|
81
|
+
"esprima": ["esprima@4.0.1", "", { "bin": { "esparse": "./bin/esparse.js", "esvalidate": "./bin/esvalidate.js" } }, "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="],
|
|
82
|
+
|
|
83
|
+
"esprima-next": ["esprima-next@5.8.4", "", { "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" } }, "sha512-8nYVZ4ioIH4Msjb/XmhnBdz5WRRBaYqevKa1cv9nGJdCehMbzZCPNEEnqfLCZVetUVrUPEcb5IYyu1GG4hFqgg=="],
|
|
84
|
+
|
|
85
|
+
"for-each": ["for-each@0.3.5", "", { "dependencies": { "is-callable": "^1.2.7" } }, "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg=="],
|
|
86
|
+
|
|
87
|
+
"form-data": ["form-data@4.0.0", "", { "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "mime-types": "^2.1.12" } }, "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww=="],
|
|
88
|
+
|
|
89
|
+
"function-bind": ["function-bind@1.1.2", "", {}, "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="],
|
|
90
|
+
|
|
91
|
+
"generator-function": ["generator-function@2.0.1", "", {}, "sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g=="],
|
|
92
|
+
|
|
93
|
+
"get-caller-file": ["get-caller-file@2.0.5", "", {}, "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg=="],
|
|
94
|
+
|
|
95
|
+
"get-intrinsic": ["get-intrinsic@1.3.0", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "math-intrinsics": "^1.1.0" } }, "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ=="],
|
|
96
|
+
|
|
97
|
+
"get-proto": ["get-proto@1.0.1", "", { "dependencies": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" } }, "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g=="],
|
|
98
|
+
|
|
99
|
+
"gopd": ["gopd@1.2.0", "", {}, "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="],
|
|
100
|
+
|
|
101
|
+
"has-property-descriptors": ["has-property-descriptors@1.0.2", "", { "dependencies": { "es-define-property": "^1.0.0" } }, "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg=="],
|
|
102
|
+
|
|
103
|
+
"has-symbols": ["has-symbols@1.1.0", "", {}, "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ=="],
|
|
104
|
+
|
|
105
|
+
"has-tostringtag": ["has-tostringtag@1.0.2", "", { "dependencies": { "has-symbols": "^1.0.3" } }, "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw=="],
|
|
106
|
+
|
|
107
|
+
"hasown": ["hasown@2.0.2", "", { "dependencies": { "function-bind": "^1.1.2" } }, "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ=="],
|
|
108
|
+
|
|
109
|
+
"inherits": ["inherits@2.0.4", "", {}, "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="],
|
|
110
|
+
|
|
111
|
+
"is-arguments": ["is-arguments@1.2.0", "", { "dependencies": { "call-bound": "^1.0.2", "has-tostringtag": "^1.0.2" } }, "sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA=="],
|
|
112
|
+
|
|
113
|
+
"is-buffer": ["is-buffer@1.1.6", "", {}, "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="],
|
|
114
|
+
|
|
115
|
+
"is-callable": ["is-callable@1.2.7", "", {}, "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA=="],
|
|
116
|
+
|
|
117
|
+
"is-fullwidth-code-point": ["is-fullwidth-code-point@3.0.0", "", {}, "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="],
|
|
118
|
+
|
|
119
|
+
"is-generator-function": ["is-generator-function@1.1.2", "", { "dependencies": { "call-bound": "^1.0.4", "generator-function": "^2.0.0", "get-proto": "^1.0.1", "has-tostringtag": "^1.0.2", "safe-regex-test": "^1.1.0" } }, "sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA=="],
|
|
120
|
+
|
|
121
|
+
"is-nan": ["is-nan@1.3.2", "", { "dependencies": { "call-bind": "^1.0.0", "define-properties": "^1.1.3" } }, "sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w=="],
|
|
122
|
+
|
|
123
|
+
"is-regex": ["is-regex@1.2.1", "", { "dependencies": { "call-bound": "^1.0.2", "gopd": "^1.2.0", "has-tostringtag": "^1.0.2", "hasown": "^2.0.2" } }, "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g=="],
|
|
124
|
+
|
|
125
|
+
"is-typed-array": ["is-typed-array@1.1.15", "", { "dependencies": { "which-typed-array": "^1.1.16" } }, "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ=="],
|
|
126
|
+
|
|
127
|
+
"jmespath": ["jmespath@0.16.0", "", {}, "sha512-9FzQjJ7MATs1tSpnco1K6ayiYE3figslrXA72G2HQ/n76RzvYlofyi5QM+iX4YRs/pu3yzxlVQSST23+dMDknw=="],
|
|
128
|
+
|
|
129
|
+
"js-base64": ["js-base64@3.7.2", "", {}, "sha512-NnRs6dsyqUXejqk/yv2aiXlAvOs56sLkX6nUdeaNezI5LFFLlsZjOThmwnrcwh5ZZRwZlCMnVAY3CvhIhoVEKQ=="],
|
|
130
|
+
|
|
131
|
+
"jsonrepair": ["jsonrepair@3.13.1", "", { "bin": { "jsonrepair": "bin/cli.js" } }, "sha512-WJeiE0jGfxYmtLwBTEk8+y/mYcaleyLXWaqp5bJu0/ZTSeG0KQq/wWQ8pmnkKenEdN6pdnn6QtcoSUkbqDHWNw=="],
|
|
132
|
+
|
|
133
|
+
"jssha": ["jssha@3.3.1", "", {}, "sha512-VCMZj12FCFMQYcFLPRm/0lOBbLi8uM2BhXPTqw3U4YAfs4AZfiApOoBLoN8cQE60Z50m1MYMTQVCfgF/KaCVhQ=="],
|
|
134
|
+
|
|
135
|
+
"lodash": ["lodash@4.17.21", "", {}, "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="],
|
|
136
|
+
|
|
137
|
+
"luxon": ["luxon@3.4.4", "", {}, "sha512-zobTr7akeGHnv7eBOXcRgMeCP6+uyYsczwmeRCauvpvaAltgNyTbLH/+VaEAPUeWBT+1GuNmz4wC/6jtQzbbVA=="],
|
|
138
|
+
|
|
139
|
+
"math-intrinsics": ["math-intrinsics@1.1.0", "", {}, "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g=="],
|
|
140
|
+
|
|
141
|
+
"md5": ["md5@2.3.0", "", { "dependencies": { "charenc": "0.0.2", "crypt": "0.0.2", "is-buffer": "~1.1.6" } }, "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g=="],
|
|
142
|
+
|
|
143
|
+
"mime-db": ["mime-db@1.52.0", "", {}, "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="],
|
|
144
|
+
|
|
145
|
+
"mime-types": ["mime-types@2.1.35", "", { "dependencies": { "mime-db": "1.52.0" } }, "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw=="],
|
|
146
|
+
|
|
147
|
+
"n8n-workflow": ["n8n-workflow@2.2.1", "", { "dependencies": { "@n8n/errors": "0.5.0", "@n8n/tournament": "1.0.6", "ast-types": "0.16.1", "callsites": "3.1.0", "esprima-next": "5.8.4", "form-data": "4.0.0", "jmespath": "0.16.0", "js-base64": "3.7.2", "jsonrepair": "3.13.1", "jssha": "3.3.1", "lodash": "4.17.21", "luxon": "3.4.4", "md5": "2.3.0", "recast": "0.22.0", "title-case": "3.0.3", "transliteration": "2.3.5", "xml2js": "0.6.2", "zod": "3.25.67" } }, "sha512-AelcyENXuLIf2i5M8f1BaUU+twRgsjy4U0Tyf9JW157KP7iq3UP0c40YJ3IZICsNggy1DgWLAtjIF2LnvUCpUg=="],
|
|
148
|
+
|
|
149
|
+
"object-is": ["object-is@1.1.6", "", { "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1" } }, "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q=="],
|
|
150
|
+
|
|
151
|
+
"object-keys": ["object-keys@1.1.1", "", {}, "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA=="],
|
|
152
|
+
|
|
153
|
+
"object.assign": ["object.assign@4.1.7", "", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", "define-properties": "^1.2.1", "es-object-atoms": "^1.0.0", "has-symbols": "^1.1.0", "object-keys": "^1.1.1" } }, "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw=="],
|
|
154
|
+
|
|
155
|
+
"possible-typed-array-names": ["possible-typed-array-names@1.1.0", "", {}, "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg=="],
|
|
156
|
+
|
|
157
|
+
"recast": ["recast@0.22.0", "", { "dependencies": { "assert": "^2.0.0", "ast-types": "0.15.2", "esprima": "~4.0.0", "source-map": "~0.6.1", "tslib": "^2.0.1" } }, "sha512-5AAx+mujtXijsEavc5lWXBPQqrM4+Dl5qNH96N2aNeuJFUzpiiToKPsxQD/zAIJHspz7zz0maX0PCtCTFVlixQ=="],
|
|
158
|
+
|
|
159
|
+
"require-directory": ["require-directory@2.1.1", "", {}, "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q=="],
|
|
160
|
+
|
|
161
|
+
"safe-regex-test": ["safe-regex-test@1.1.0", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "is-regex": "^1.2.1" } }, "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw=="],
|
|
162
|
+
|
|
163
|
+
"sax": ["sax@1.4.3", "", {}, "sha512-yqYn1JhPczigF94DMS+shiDMjDowYO6y9+wB/4WgO0Y19jWYk0lQ4tuG5KI7kj4FTp1wxPj5IFfcrz/s1c3jjQ=="],
|
|
164
|
+
|
|
165
|
+
"set-function-length": ["set-function-length@1.2.2", "", { "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", "function-bind": "^1.1.2", "get-intrinsic": "^1.2.4", "gopd": "^1.0.1", "has-property-descriptors": "^1.0.2" } }, "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg=="],
|
|
166
|
+
|
|
167
|
+
"source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="],
|
|
168
|
+
|
|
169
|
+
"string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="],
|
|
170
|
+
|
|
171
|
+
"strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="],
|
|
172
|
+
|
|
173
|
+
"title-case": ["title-case@3.0.3", "", { "dependencies": { "tslib": "^2.0.3" } }, "sha512-e1zGYRvbffpcHIrnuqT0Dh+gEJtDaxDSoG4JAIpq4oDFyooziLBIiYQv0GBT4FUAnUop5uZ1hiIAj7oAF6sOCA=="],
|
|
174
|
+
|
|
175
|
+
"toon-format-parser": ["toon-format-parser@1.1.0", "", {}, "sha512-iP276xJuCycs/v8C/IPUhaaS5bHWaoJ2NNZOSzi1rhZ+jaJ4wlls43kSkgSMz6iyZb7AD6C7ItFQr9fSS/71Ww=="],
|
|
176
|
+
|
|
177
|
+
"transliteration": ["transliteration@2.3.5", "", { "dependencies": { "yargs": "^17.5.1" }, "bin": { "slugify": "dist/bin/slugify", "transliterate": "dist/bin/transliterate" } }, "sha512-HAGI4Lq4Q9dZ3Utu2phaWgtm3vB6PkLUFqWAScg/UW+1eZ/Tg6Exo4oC0/3VUol/w4BlefLhUUSVBr/9/ZGQOw=="],
|
|
178
|
+
|
|
179
|
+
"tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
|
|
180
|
+
|
|
181
|
+
"typescript": ["typescript@4.9.5", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g=="],
|
|
182
|
+
|
|
183
|
+
"undici-types": ["undici-types@5.26.5", "", {}, "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="],
|
|
184
|
+
|
|
185
|
+
"util": ["util@0.12.5", "", { "dependencies": { "inherits": "^2.0.3", "is-arguments": "^1.0.4", "is-generator-function": "^1.0.7", "is-typed-array": "^1.1.3", "which-typed-array": "^1.1.2" } }, "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA=="],
|
|
186
|
+
|
|
187
|
+
"which-typed-array": ["which-typed-array@1.1.19", "", { "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.8", "call-bound": "^1.0.4", "for-each": "^0.3.5", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-tostringtag": "^1.0.2" } }, "sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw=="],
|
|
188
|
+
|
|
189
|
+
"wrap-ansi": ["wrap-ansi@7.0.0", "", { "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } }, "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q=="],
|
|
190
|
+
|
|
191
|
+
"xml2js": ["xml2js@0.6.2", "", { "dependencies": { "sax": ">=0.6.0", "xmlbuilder": "~11.0.0" } }, "sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA=="],
|
|
192
|
+
|
|
193
|
+
"xmlbuilder": ["xmlbuilder@11.0.1", "", {}, "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA=="],
|
|
194
|
+
|
|
195
|
+
"y18n": ["y18n@5.0.8", "", {}, "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA=="],
|
|
196
|
+
|
|
197
|
+
"yargs": ["yargs@17.7.2", "", { "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.3", "y18n": "^5.0.5", "yargs-parser": "^21.1.1" } }, "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w=="],
|
|
198
|
+
|
|
199
|
+
"yargs-parser": ["yargs-parser@21.1.1", "", {}, "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw=="],
|
|
200
|
+
|
|
201
|
+
"zod": ["zod@3.25.67", "", {}, "sha512-idA2YXwpCdqUSKRCACDE6ItZD9TZzy3OZMtpfLoh6oPR47lipysRrJfjzMqFxQ3uJuUPyUeWe1r9vLH33xO/Qw=="],
|
|
202
|
+
|
|
203
|
+
"recast/ast-types": ["ast-types@0.15.2", "", { "dependencies": { "tslib": "^2.0.1" } }, "sha512-c27loCv9QkZinsa5ProX751khO9DJl/AcB5c2KNtA6NRvHKS0PgLfcftz72KVq504vB0Gku5s2kUZzDBvQWvHg=="],
|
|
204
|
+
}
|
|
205
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ToonParser } from './nodes/ToonParser/ToonParser.node';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ToonParser = void 0;
|
|
4
|
+
var ToonParser_node_1 = require("./nodes/ToonParser/ToonParser.node");
|
|
5
|
+
Object.defineProperty(exports, "ToonParser", { enumerable: true, get: function () { return ToonParser_node_1.ToonParser; } });
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ToonParser = void 0;
|
|
4
|
+
const toon_format_parser_1 = require("toon-format-parser");
|
|
5
|
+
class ToonParser {
|
|
6
|
+
description = {
|
|
7
|
+
displayName: 'TOON Parser',
|
|
8
|
+
name: 'toonParser',
|
|
9
|
+
icon: 'fa:exchange-alt',
|
|
10
|
+
group: ['transform'],
|
|
11
|
+
version: 1,
|
|
12
|
+
description: 'Parse and Encode TOON format data',
|
|
13
|
+
defaults: {
|
|
14
|
+
name: 'TOON Parser',
|
|
15
|
+
},
|
|
16
|
+
inputs: ['main'],
|
|
17
|
+
outputs: ['main'],
|
|
18
|
+
properties: [
|
|
19
|
+
{
|
|
20
|
+
displayName: 'Operation',
|
|
21
|
+
name: 'operation',
|
|
22
|
+
type: 'options',
|
|
23
|
+
noDataExpression: true,
|
|
24
|
+
options: [
|
|
25
|
+
{
|
|
26
|
+
name: 'Decode TOON',
|
|
27
|
+
value: 'decode',
|
|
28
|
+
description: 'Convert TOON string to JSON object',
|
|
29
|
+
action: 'Decode TOON to JSON',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'Encode TOON',
|
|
33
|
+
value: 'encode',
|
|
34
|
+
description: 'Convert JSON object to TOON string',
|
|
35
|
+
action: 'Encode JSON to TOON',
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
default: 'decode',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
displayName: 'TOON String',
|
|
42
|
+
name: 'toonString',
|
|
43
|
+
type: 'string',
|
|
44
|
+
displayOptions: {
|
|
45
|
+
show: {
|
|
46
|
+
operation: ['decode'],
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
default: '',
|
|
50
|
+
required: true,
|
|
51
|
+
description: 'The TOON format string to decode',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
displayName: 'JSON Object',
|
|
55
|
+
name: 'jsonObject',
|
|
56
|
+
type: 'json',
|
|
57
|
+
displayOptions: {
|
|
58
|
+
show: {
|
|
59
|
+
operation: ['encode'],
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
default: '',
|
|
63
|
+
required: true,
|
|
64
|
+
description: 'The JSON object to encode into TOON format',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
displayName: 'Options',
|
|
68
|
+
name: 'options',
|
|
69
|
+
type: 'collection',
|
|
70
|
+
placeholder: 'Add Option',
|
|
71
|
+
default: {},
|
|
72
|
+
options: [
|
|
73
|
+
{
|
|
74
|
+
displayName: 'Indent',
|
|
75
|
+
name: 'indent',
|
|
76
|
+
type: 'number',
|
|
77
|
+
default: 2,
|
|
78
|
+
description: 'Number of spaces for indentation',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
displayName: 'Delimiter',
|
|
82
|
+
name: 'delimiter',
|
|
83
|
+
type: 'options',
|
|
84
|
+
options: [
|
|
85
|
+
{ name: 'Comma (,)', value: ',' },
|
|
86
|
+
{ name: 'Tab (\\t)', value: '\t' },
|
|
87
|
+
{ name: 'Pipe (|)', value: '|' },
|
|
88
|
+
],
|
|
89
|
+
default: ',',
|
|
90
|
+
description: 'Delimiter for tabular arrays',
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
};
|
|
96
|
+
async execute() {
|
|
97
|
+
const items = this.getInputData();
|
|
98
|
+
const returnData = [];
|
|
99
|
+
const operation = this.getNodeParameter('operation', 0);
|
|
100
|
+
for (let i = 0; i < items.length; i++) {
|
|
101
|
+
try {
|
|
102
|
+
if (operation === 'decode') {
|
|
103
|
+
const toonString = this.getNodeParameter('toonString', i);
|
|
104
|
+
const options = this.getNodeParameter('options', i, {});
|
|
105
|
+
const parsed = (0, toon_format_parser_1.decode)(toonString, options);
|
|
106
|
+
returnData.push({
|
|
107
|
+
json: parsed,
|
|
108
|
+
pairedItem: { item: i },
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
const jsonObject = this.getNodeParameter('jsonObject', i);
|
|
113
|
+
const options = this.getNodeParameter('options', i, {});
|
|
114
|
+
const encoded = (0, toon_format_parser_1.encode)(jsonObject, options);
|
|
115
|
+
returnData.push({
|
|
116
|
+
json: { toon: encoded },
|
|
117
|
+
pairedItem: { item: i },
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
if (this.continueOnFail()) {
|
|
123
|
+
returnData.push({
|
|
124
|
+
json: { error: error.message },
|
|
125
|
+
pairedItem: { item: i },
|
|
126
|
+
});
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
throw error;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return [returnData];
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
exports.ToonParser = ToonParser;
|
package/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ToonParser } from './nodes/ToonParser/ToonParser.node';
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IExecuteFunctions,
|
|
3
|
+
INodeExecutionData,
|
|
4
|
+
INodeType,
|
|
5
|
+
INodeTypeDescription,
|
|
6
|
+
} from 'n8n-workflow';
|
|
7
|
+
import { decode, encode } from 'toon-format-parser';
|
|
8
|
+
|
|
9
|
+
export class ToonParser implements INodeType {
|
|
10
|
+
description: INodeTypeDescription = {
|
|
11
|
+
displayName: 'TOON Parser',
|
|
12
|
+
name: 'toonParser',
|
|
13
|
+
icon: 'fa:exchange-alt',
|
|
14
|
+
group: ['transform'],
|
|
15
|
+
version: 1,
|
|
16
|
+
description: 'Parse and Encode TOON format data',
|
|
17
|
+
defaults: {
|
|
18
|
+
name: 'TOON Parser',
|
|
19
|
+
},
|
|
20
|
+
inputs: ['main'],
|
|
21
|
+
outputs: ['main'],
|
|
22
|
+
properties: [
|
|
23
|
+
{
|
|
24
|
+
displayName: 'Operation',
|
|
25
|
+
name: 'operation',
|
|
26
|
+
type: 'options',
|
|
27
|
+
noDataExpression: true,
|
|
28
|
+
options: [
|
|
29
|
+
{
|
|
30
|
+
name: 'Decode TOON',
|
|
31
|
+
value: 'decode',
|
|
32
|
+
description: 'Convert TOON string to JSON object',
|
|
33
|
+
action: 'Decode TOON to JSON',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'Encode TOON',
|
|
37
|
+
value: 'encode',
|
|
38
|
+
description: 'Convert JSON object to TOON string',
|
|
39
|
+
action: 'Encode JSON to TOON',
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
default: 'decode',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
displayName: 'TOON String',
|
|
46
|
+
name: 'toonString',
|
|
47
|
+
type: 'string',
|
|
48
|
+
displayOptions: {
|
|
49
|
+
show: {
|
|
50
|
+
operation: ['decode'],
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
default: '',
|
|
54
|
+
required: true,
|
|
55
|
+
description: 'The TOON format string to decode',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
displayName: 'JSON Object',
|
|
59
|
+
name: 'jsonObject',
|
|
60
|
+
type: 'json',
|
|
61
|
+
displayOptions: {
|
|
62
|
+
show: {
|
|
63
|
+
operation: ['encode'],
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
default: '',
|
|
67
|
+
required: true,
|
|
68
|
+
description: 'The JSON object to encode into TOON format',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
displayName: 'Options',
|
|
72
|
+
name: 'options',
|
|
73
|
+
type: 'collection',
|
|
74
|
+
placeholder: 'Add Option',
|
|
75
|
+
default: {},
|
|
76
|
+
options: [
|
|
77
|
+
{
|
|
78
|
+
displayName: 'Indent',
|
|
79
|
+
name: 'indent',
|
|
80
|
+
type: 'number',
|
|
81
|
+
default: 2,
|
|
82
|
+
description: 'Number of spaces for indentation',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
displayName: 'Delimiter',
|
|
86
|
+
name: 'delimiter',
|
|
87
|
+
type: 'options',
|
|
88
|
+
options: [
|
|
89
|
+
{ name: 'Comma (,)', value: ',' },
|
|
90
|
+
{ name: 'Tab (\\t)', value: '\t' },
|
|
91
|
+
{ name: 'Pipe (|)', value: '|' },
|
|
92
|
+
],
|
|
93
|
+
default: ',',
|
|
94
|
+
description: 'Delimiter for tabular arrays',
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
|
102
|
+
const items = this.getInputData();
|
|
103
|
+
const returnData: INodeExecutionData[] = [];
|
|
104
|
+
const operation = this.getNodeParameter('operation', 0) as string;
|
|
105
|
+
|
|
106
|
+
for (let i = 0; i < items.length; i++) {
|
|
107
|
+
try {
|
|
108
|
+
if (operation === 'decode') {
|
|
109
|
+
const toonString = this.getNodeParameter('toonString', i) as string;
|
|
110
|
+
const options = this.getNodeParameter('options', i, {}) as any;
|
|
111
|
+
|
|
112
|
+
const parsed = decode(toonString, options);
|
|
113
|
+
|
|
114
|
+
returnData.push({
|
|
115
|
+
json: parsed,
|
|
116
|
+
pairedItem: { item: i },
|
|
117
|
+
});
|
|
118
|
+
} else {
|
|
119
|
+
const jsonObject = this.getNodeParameter('jsonObject', i) as any;
|
|
120
|
+
const options = this.getNodeParameter('options', i, {}) as any;
|
|
121
|
+
|
|
122
|
+
const encoded = encode(jsonObject, options);
|
|
123
|
+
|
|
124
|
+
returnData.push({
|
|
125
|
+
json: { toon: encoded },
|
|
126
|
+
pairedItem: { item: i },
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
} catch (error) {
|
|
130
|
+
if (this.continueOnFail()) {
|
|
131
|
+
returnData.push({
|
|
132
|
+
json: { error: error.message },
|
|
133
|
+
pairedItem: { item: i },
|
|
134
|
+
});
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
throw error;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return [returnData];
|
|
142
|
+
}
|
|
143
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "n8n-nodes-toon-format-parser",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "n8n node for TOON format parsing and encoding",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "tsc",
|
|
8
|
+
"prepublishOnly": "npm run build"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [
|
|
11
|
+
"n8n-community-node-package",
|
|
12
|
+
"toon",
|
|
13
|
+
"parser"
|
|
14
|
+
],
|
|
15
|
+
"n8n": {
|
|
16
|
+
"nodes": [
|
|
17
|
+
"dist/nodes/ToonParser/ToonParser.node.js"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"toon-format-parser": "^1.1.0"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/node": "^18.16.0",
|
|
25
|
+
"n8n-workflow": "^1.17.0",
|
|
26
|
+
"typescript": "^5.3.3"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"n8n-workflow": "*"
|
|
30
|
+
}
|
|
31
|
+
}
|
package/test_io.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
test
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "commonjs",
|
|
4
|
+
"target": "ES2022",
|
|
5
|
+
"lib": [
|
|
6
|
+
"ES2022"
|
|
7
|
+
],
|
|
8
|
+
"declaration": true,
|
|
9
|
+
"removeComments": true,
|
|
10
|
+
"noImplicitAny": true,
|
|
11
|
+
"outDir": "dist",
|
|
12
|
+
"baseUrl": ".",
|
|
13
|
+
"esModuleInterop": true,
|
|
14
|
+
"skipLibCheck": true,
|
|
15
|
+
"forceConsistentCasingInFileNames": true,
|
|
16
|
+
"typeRoots": [
|
|
17
|
+
"./node_modules/@types"
|
|
18
|
+
],
|
|
19
|
+
"types": [
|
|
20
|
+
"node"
|
|
21
|
+
],
|
|
22
|
+
"rootDir": "."
|
|
23
|
+
},
|
|
24
|
+
"include": [
|
|
25
|
+
"nodes/**/*.ts",
|
|
26
|
+
"index.ts"
|
|
27
|
+
],
|
|
28
|
+
"exclude": [
|
|
29
|
+
"**/node_modules",
|
|
30
|
+
"../node_modules"
|
|
31
|
+
]
|
|
32
|
+
}
|