cyberchef 10.22.1 → 10.24.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/CHANGELOG.md +182 -0
- package/CONTRIBUTING.md +40 -0
- package/Dockerfile +2 -0
- package/Gruntfile.js +2 -28
- package/README.md +1 -1
- package/babel.config.js +0 -6
- package/package.json +64 -63
- package/src/core/Chef.mjs +8 -1
- package/src/core/Ingredient.mjs +5 -2
- package/src/core/Operation.mjs +6 -1
- package/src/core/Recipe.mjs +10 -5
- package/src/core/config/Categories.json +20 -4
- package/src/core/config/OperationConfig.json +550 -26
- package/src/core/config/modules/Ciphers.mjs +6 -0
- package/src/core/config/modules/Crypto.mjs +6 -0
- package/src/core/config/modules/Default.mjs +8 -0
- package/src/core/config/modules/Shellcode.mjs +2 -0
- package/src/core/config/scripts/fixCryptoApiImports.mjs +54 -0
- package/src/core/config/scripts/fixSnackBarMarkup.mjs +28 -0
- package/src/core/lib/AudioBytes.mjs +103 -0
- package/src/core/lib/AudioMetaSchema.mjs +82 -0
- package/src/core/lib/AudioParsers.mjs +630 -0
- package/src/core/lib/BigIntUtils.mjs +73 -0
- package/src/core/lib/Extract.mjs +5 -0
- package/src/core/lib/Modhex.mjs +2 -0
- package/src/core/lib/ParityBit.mjs +50 -0
- package/src/core/lib/QRCode.mjs +30 -10
- package/src/core/lib/RC6.mjs +625 -0
- package/src/core/operations/A1Z26CipherDecode.mjs +1 -1
- package/src/core/operations/AddTextToImage.mjs +116 -64
- package/src/core/operations/AnalyseUUID.mjs +109 -6
- package/src/core/operations/BlurImage.mjs +10 -12
- package/src/core/operations/ContainImage.mjs +50 -40
- package/src/core/operations/ConvertImageFormat.mjs +33 -39
- package/src/core/operations/CoverImage.mjs +39 -37
- package/src/core/operations/CropImage.mjs +35 -21
- package/src/core/operations/DisassembleARM.mjs +193 -0
- package/src/core/operations/DitherImage.mjs +8 -8
- package/src/core/operations/EscapeUnicodeCharacters.mjs +0 -17
- package/src/core/operations/ExtractAudioMetadata.mjs +175 -0
- package/src/core/operations/ExtractEmailAddresses.mjs +2 -3
- package/src/core/operations/ExtractLSB.mjs +17 -11
- package/src/core/operations/ExtractRGBA.mjs +12 -10
- package/src/core/operations/FlaskSessionDecode.mjs +80 -0
- package/src/core/operations/FlaskSessionSign.mjs +89 -0
- package/src/core/operations/FlaskSessionVerify.mjs +136 -0
- package/src/core/operations/FlipImage.mjs +14 -10
- package/src/core/operations/GenerateImage.mjs +39 -32
- package/src/core/operations/ImageBrightnessContrast.mjs +10 -10
- package/src/core/operations/ImageFilter.mjs +14 -13
- package/src/core/operations/ImageHueSaturationLightness.mjs +22 -20
- package/src/core/operations/ImageOpacity.mjs +6 -8
- package/src/core/operations/InvertImage.mjs +4 -6
- package/src/core/operations/Jq.mjs +12 -4
- package/src/core/operations/NormaliseImage.mjs +5 -7
- package/src/core/operations/OffsetChecker.mjs +1 -1
- package/src/core/operations/ParityBit.mjs +128 -0
- package/src/core/operations/ParseEthernetFrame.mjs +112 -0
- package/src/core/operations/ParseIPv4Header.mjs +23 -6
- package/src/core/operations/ParseQRCode.mjs +13 -13
- package/src/core/operations/PseudoRandomIntegerGenerator.mjs +164 -0
- package/src/core/operations/RC6Decrypt.mjs +119 -0
- package/src/core/operations/RC6Encrypt.mjs +119 -0
- package/src/core/operations/RandomizeColourPalette.mjs +11 -11
- package/src/core/operations/RegularExpression.mjs +2 -1
- package/src/core/operations/RenderMarkdown.mjs +35 -4
- package/src/core/operations/ResizeImage.mjs +30 -23
- package/src/core/operations/RotateImage.mjs +8 -9
- package/src/core/operations/SQLBeautify.mjs +21 -3
- package/src/core/operations/SharpenImage.mjs +94 -62
- package/src/core/operations/SplitColourChannels.mjs +47 -21
- package/src/core/operations/TextIntegerConverter.mjs +123 -0
- package/src/core/operations/UnescapeUnicodeCharacters.mjs +17 -0
- package/src/core/operations/ViewBitPlane.mjs +16 -20
- package/src/core/operations/index.mjs +22 -0
- package/src/node/index.mjs +55 -0
- package/src/web/HTMLIngredient.mjs +24 -43
- package/src/web/HTMLOperation.mjs +8 -2
- package/src/web/Manager.mjs +1 -0
- package/src/web/html/index.html +6 -6
- package/src/web/static/fonts/bmfonts/Roboto72White.fnt +491 -485
- package/src/web/static/fonts/bmfonts/RobotoBlack72White.fnt +494 -488
- package/src/web/static/fonts/bmfonts/RobotoMono72White.fnt +110 -103
- package/src/web/static/fonts/bmfonts/RobotoSlab72White.fnt +498 -492
- package/src/web/stylesheets/layout/_banner.css +30 -0
- package/src/web/stylesheets/layout/_modals.css +5 -0
- package/src/web/stylesheets/utils/_overrides.css +7 -0
- package/src/web/waiters/ControlsWaiter.mjs +82 -0
- package/src/web/waiters/InputWaiter.mjs +12 -6
- package/src/web/waiters/OperationsWaiter.mjs +30 -13
- package/src/web/waiters/RecipeWaiter.mjs +2 -2
- package/tests/browser/02_ops.js +23 -3
- package/tests/node/index.mjs +1 -0
- package/tests/node/tests/lib/BigIntUtils.mjs +150 -0
- package/tests/node/tests/operations.mjs +11 -10
- package/tests/operations/index.mjs +13 -0
- package/tests/operations/tests/A1Z26CipherDecode.mjs +33 -0
- package/tests/operations/tests/AnalyseUUID.mjs +66 -0
- package/tests/operations/tests/DisassembleARM.mjs +377 -0
- package/tests/operations/tests/ExtractAudioMetadata.mjs +287 -0
- package/tests/operations/tests/ExtractEmailAddresses.mjs +38 -12
- package/tests/operations/tests/Fernet.mjs +18 -3
- package/tests/operations/tests/FlaskSession.mjs +246 -0
- package/tests/operations/tests/GenerateQRCode.mjs +67 -0
- package/tests/operations/tests/JWTSign.mjs +83 -8
- package/tests/operations/tests/Jq.mjs +32 -0
- package/tests/operations/tests/Modhex.mjs +20 -0
- package/tests/operations/tests/ParityBit.mjs +147 -0
- package/tests/operations/tests/ParseEthernetFrame.mjs +45 -0
- package/tests/operations/tests/RC6.mjs +487 -0
- package/tests/operations/tests/RegularExpression.mjs +75 -0
- package/tests/operations/tests/RenderMarkdown.mjs +110 -0
- package/tests/operations/tests/SQLBeautify.mjs +54 -0
- package/tests/operations/tests/TextIntegerConverter.mjs +199 -0
- package/tests/samples/Audio.mjs +73 -0
- package/tests/samples/Images.mjs +0 -12
- package/webpack.config.js +10 -7
- package/src/core/lib/ImageManipulation.mjs +0 -251
package/CHANGELOG.md
CHANGED
|
@@ -13,6 +13,88 @@ All major and minor version changes will be documented in this file. Details of
|
|
|
13
13
|
|
|
14
14
|
## Details
|
|
15
15
|
|
|
16
|
+
### [10.24.0] - 2026-04-27
|
|
17
|
+
- Update CONTRIBUTING.md [@GCHQDeveloper581] | [#2333]
|
|
18
|
+
- Fix, and link, Fernet tests [@GCHQDeveloper581] | [#2335]
|
|
19
|
+
- [#927] added parity bit operation [@j83305] | [#1036]
|
|
20
|
+
- Feature md link blanks [@BjoernAkAManf] [@GCHQDeveloper581] | [#660]
|
|
21
|
+
- Accessibility - Add support for screenreaders in operations search [@mattnotmitt] | [#1862]
|
|
22
|
+
- Added metadata extraction for UUID strings. [@ko80240] | [#2322]
|
|
23
|
+
- chore (deps): bump the patch-updates group with 6 updates | [#2330]
|
|
24
|
+
- chore (deps): bump @codemirror/search from 6.6.0 to 6.7.0 | [#2331]
|
|
25
|
+
- (Feature) Improve CI [@GCHQDeveloper581] | [#2328]
|
|
26
|
+
- Update dependabot.yml [@GCHQDeveloper581] | [#2326]
|
|
27
|
+
- chore (deps): bump lodash, grunt-legacy-log and grunt-legacy-util | [#2327]
|
|
28
|
+
- chore (deps): bump the patch-updates group with 6 updates [@GCHQDeveloper581] | [#2323]
|
|
29
|
+
- chore (deps): bump autoprefixer from 10.4.27 to 10.5.0 | [#2324]
|
|
30
|
+
- chore (deps): bump dompurify from 3.3.3 to 3.4.0 | [#2321]
|
|
31
|
+
- chore (deps): bump follow-redirects from 1.15.11 to 1.16.0 | [#2320]
|
|
32
|
+
- Regular Expression operation email address regex: Support IPv4 domains [@C85297] [@GCHQDeveloper581] | [#2167]
|
|
33
|
+
- Rewriting fixCryptoApiImports and fixSnackbarMarkup to js to make it OS agnostic [@BigYellowHammer] | [#2298]
|
|
34
|
+
- chore (deps): bump basic-ftp from 5.2.1 to 5.2.2 | [#2317]
|
|
35
|
+
- chore (deps): bump axios from 1.13.6 to 1.15.0 | [#2316]
|
|
36
|
+
- chore (deps): bump webpack from 5.105.4 to 5.106.0 | [#2315]
|
|
37
|
+
- chore (deps): bump basic-ftp from 5.2.0 to 5.2.1 | [#2313]
|
|
38
|
+
- Update vulnerable dependencies [@GCHQDeveloper581] | [#2311]
|
|
39
|
+
|
|
40
|
+
### [10.23.0] - 2026-04-06
|
|
41
|
+
- Properly escape HTML entities in sampleDelim to avoid XSS issue [@GCHQDeveloper581] | [#2307]
|
|
42
|
+
- chore (deps): bump lodash from 4.17.23 to 4.18.1 | [#2304]
|
|
43
|
+
- chore (deps): bump @codemirror/view from 6.40.0 to 6.41.0 | [#2305]
|
|
44
|
+
- chore (deps): bump the patch-updates group with 2 updates | [#2303]
|
|
45
|
+
- chore (deps): bump @xmldom/xmldom from 0.8.11 to 0.8.12 | [#2302]
|
|
46
|
+
- chore (deps): bump picomatch | [#2299]
|
|
47
|
+
- chore (deps): bump node-forge from 1.3.3 to 1.4.0 | [#2297]
|
|
48
|
+
- chore (deps): bump the patch-updates group with 3 updates | [#2296]
|
|
49
|
+
- chore (deps) bump chromedriver from 130.0.4 to 146.0.6 [@GCHQDeveloper581] | [#2292]
|
|
50
|
+
- ParseEthernetFrame - Fix vlan calculation [@Kalkran] | [#2295]
|
|
51
|
+
- Add pull request template with AI usage disclosure [@C85297] | [#2279]
|
|
52
|
+
- fix: return empty output for zero-length To Modhex input [@saschabuehrle] | [#2249]
|
|
53
|
+
- Added tab focus to top banner and navigation to About/Support Modal [@j264415] | [#1733]
|
|
54
|
+
- Add Parse Ethernet frame Operation, allow Parse IPv4 Header to cascade [@Kalkran] | [#1722]
|
|
55
|
+
- Selection and Deselection of autobake checkbox using keyboard [@j264415] | [#1727]
|
|
56
|
+
- chore (deps): bump @babel/runtime from 7.28.6 to 7.29.2 | [#2263]
|
|
57
|
+
- Add more helpful error for when numerical ingredient is left empty [@Lamby777] [@C85297] | [#1540]
|
|
58
|
+
- chore (deps): bump @codemirror/view from 6.39.17 to 6.40.0 | [#2262]
|
|
59
|
+
- Bump flatted from 3.3.2 to 3.4.2 [@GCHQDeveloper581] | [#2266]
|
|
60
|
+
- feat: add Raw option for Jq operation [@rtpt-romankarwacik] | [#2237]
|
|
61
|
+
- chore (deps): bump core-js from 3.48.0 to 3.49.0 | [#2261]
|
|
62
|
+
- chore (deps): bump the patch-updates group with 6 updates | [#2260]
|
|
63
|
+
- Add Extract Audio Metadata operation [@d0s1nt] [@GCHQDeveloper581] | [#2170]
|
|
64
|
+
- Fix Jq issue [@GCHQDeveloper581] | [#2210]
|
|
65
|
+
- Configure dependabot updates [@GCHQDeveloper581] | [#2259]
|
|
66
|
+
- fix(A1Z26): return empty string instead of empty array for empty input [@brick-pixel] | [#2257]
|
|
67
|
+
- Fix broken Docker link in README [@am-periphery] | [#2250]
|
|
68
|
+
- Update some dependencies, including a number causing npm audit warnings [@GCHQDeveloper581] | [#2236]
|
|
69
|
+
- Bump axios from 1.7.9 to 1.13.6 | [#2234]
|
|
70
|
+
- Bump jws from 3.2.2 to 3.2.3 | [#2235]
|
|
71
|
+
- Bump pbkdf2 from 3.1.2 to 3.1.5 | [#2229]
|
|
72
|
+
- Bump form-data from 4.0.1 to 4.0.5 | [#2228]
|
|
73
|
+
- Bump basic-ftp from 5.0.5 to 5.2.0 | [#2231]
|
|
74
|
+
- feat: add ARM disassembler operation [@thomasxm] | [#2156]
|
|
75
|
+
- Add Text/Integer Converter operation [@p-leriche] [@GCHQDeveloper581] | [#2213]
|
|
76
|
+
- Feat/rc6 add RC6 Encrypt/Decrypt operations [@thomasxm] | [#2163]
|
|
77
|
+
- [bugfix] Add Bootstrap form style for CodeMirror editor [@Swonkie] | [#2161]
|
|
78
|
+
- Add Flask Session operations (Decode, Sign, Verify) [@ThePlayer372-FR] | [#2208]
|
|
79
|
+
- fix: `jq-web` -> `jq-wasm`, includes `jq` version `1.8.1` [@W-Floyd] [@GCHQDeveloper581] | [#2223]
|
|
80
|
+
- Bump jsonwebtoken from 8.5.1 to 9.0.0 [@GCHQDeveloper581] | [#2219]
|
|
81
|
+
- Bump basic-ftp from 5.0.5 to 5.2.0 | [#2218]
|
|
82
|
+
- feat: add random integer generation operation [@cktgh] | [#2151]
|
|
83
|
+
- Add BigInt utility functions for number theory operations [@p-leriche] [@GCHQDeveloper581] | [#2205]
|
|
84
|
+
- Improve SQL Beautify: use sql-formatter and support bind variables [@aby-jo] [@GCHQDeveloper581] | [#2071]
|
|
85
|
+
- update tesseract.js to 6.0.1 [@atsiv1] | [#2133]
|
|
86
|
+
- Fix hint tooltip display issues [@bartvanandel] | [#2017]
|
|
87
|
+
- Simplify babel dependencies [@GCHQDeveloper581] | [#2204]
|
|
88
|
+
- Dependency updates [@GCHQDeveloper581] | [#2201]
|
|
89
|
+
- Fix: Move Magic checks from Escape to Unescape Unicode Characters [@fjh1997] | [#2195]
|
|
90
|
+
- Paste spreadsheets as text [@C85297] | [#2200]
|
|
91
|
+
- Fix Roboto Mono font [@C85297] | [#2199]
|
|
92
|
+
- Fix return of buffer for PNG QR image generation [@GCHQDeveloper581] [@C85297] | [#2125]
|
|
93
|
+
- Update JIMP [@C85297] | [#2171]
|
|
94
|
+
- Overwrite NGINX maintainer label [@C85297] | [#2194]
|
|
95
|
+
- Bump v10.22.1 [@GCHQDeveloper581] | [#2193]
|
|
96
|
+
- Fix npm publish - Run "npm ci" and "npm run node" under node 18 then switch to node 24.5 [@GCHQDeveloper581] | [#2192]
|
|
97
|
+
|
|
16
98
|
### [10.22.0] - 2026-02-11
|
|
17
99
|
- Separate npm publish out into separate job and run with Node 24.5 [@GCHQDeveloper581] | [#2188]
|
|
18
100
|
- Fixed Percent delimiter for hex encoding [@beneri] [@C85297] | [#2137]
|
|
@@ -538,6 +620,8 @@ All major and minor version changes will be documented in this file. Details of
|
|
|
538
620
|
## [4.0.0] - 2016-11-28
|
|
539
621
|
- Initial open source commit [@n1474335] | [b1d73a72](https://github.com/gchq/CyberChef/commit/b1d73a725dc7ab9fb7eb789296efd2b7e4b08306)
|
|
540
622
|
|
|
623
|
+
[10.24.0]: https://github.com/gchq/CyberChef/releases/tag/v10.24.0
|
|
624
|
+
[10.23.0]: https://github.com/gchq/CyberChef/releases/tag/v10.23.0
|
|
541
625
|
[10.22.0]: https://github.com/gchq/CyberChef/releases/tag/v10.22.0
|
|
542
626
|
[10.21.0]: https://github.com/gchq/CyberChef/releases/tag/v10.21.0
|
|
543
627
|
[10.20.0]: https://github.com/gchq/CyberChef/releases/tag/v10.20.0
|
|
@@ -797,6 +881,26 @@ All major and minor version changes will be documented in this file. Details of
|
|
|
797
881
|
[@t-martine]: https://github.com/t-martine
|
|
798
882
|
[@wesinator]: https://github.com/wesinator
|
|
799
883
|
[@Raka-loah]: https://github.com/Raka-loah
|
|
884
|
+
[@Kalkran]: https://github.com/Kalkran
|
|
885
|
+
[@saschabuehrle]: https://github.com/saschabuehrle
|
|
886
|
+
[@j264415]: https://github.com/j264415
|
|
887
|
+
[@Lamby777]: https://github.com/Lamby777
|
|
888
|
+
[@rtpt-romankarwacik]: https://github.com/rtpt-romankarwacik
|
|
889
|
+
[@d0s1nt]: https://github.com/d0s1nt
|
|
890
|
+
[@brick-pixel]: https://github.com/brick-pixel
|
|
891
|
+
[@am-periphery]: https://github.com/am-periphery
|
|
892
|
+
[@p-leriche]: https://github.com/p-leriche
|
|
893
|
+
[@Swonkie]: https://github.com/Swonkie
|
|
894
|
+
[@ThePlayer372-FR]: https://github.com/ThePlayer372-FR
|
|
895
|
+
[@W-Floyd]: https://github.com/W-Floyd
|
|
896
|
+
[@cktgh]: https://github.com/cktgh
|
|
897
|
+
[@aby-jo]: https://github.com/aby-jo
|
|
898
|
+
[@atsiv1]: https://github.com/atsiv1
|
|
899
|
+
[@fjh1997]: https://github.com/fjh1997
|
|
900
|
+
[@j83305]: https://github.com/j83305
|
|
901
|
+
[@BjoernAkAManf]: https://github.com/BjoernAkAManf
|
|
902
|
+
[@ko80240]: https://github.com/ko80240
|
|
903
|
+
[@BigYellowHammer]: https://github.com/BigYellowHammer
|
|
800
904
|
|
|
801
905
|
|
|
802
906
|
[8ad18b]: https://github.com/gchq/CyberChef/commit/8ad18bc7db6d9ff184ba3518686293a7685bf7b7
|
|
@@ -1010,4 +1114,82 @@ All major and minor version changes will be documented in this file. Details of
|
|
|
1010
1114
|
[#2183]: https://github.com/gchq/CyberChef/pull/2183
|
|
1011
1115
|
[#2182]: https://github.com/gchq/CyberChef/pull/2182
|
|
1012
1116
|
[#2181]: https://github.com/gchq/CyberChef/pull/2181
|
|
1117
|
+
[#2307]: https://github.com/gchq/CyberChef/pull/2307
|
|
1118
|
+
[#2304]: https://github.com/gchq/CyberChef/pull/2304
|
|
1119
|
+
[#2305]: https://github.com/gchq/CyberChef/pull/2305
|
|
1120
|
+
[#2303]: https://github.com/gchq/CyberChef/pull/2303
|
|
1121
|
+
[#2302]: https://github.com/gchq/CyberChef/pull/2302
|
|
1122
|
+
[#2299]: https://github.com/gchq/CyberChef/pull/2299
|
|
1123
|
+
[#2297]: https://github.com/gchq/CyberChef/pull/2297
|
|
1124
|
+
[#2296]: https://github.com/gchq/CyberChef/pull/2296
|
|
1125
|
+
[#2292]: https://github.com/gchq/CyberChef/pull/2292
|
|
1126
|
+
[#2295]: https://github.com/gchq/CyberChef/pull/2295
|
|
1127
|
+
[#2279]: https://github.com/gchq/CyberChef/pull/2279
|
|
1128
|
+
[#2249]: https://github.com/gchq/CyberChef/pull/2249
|
|
1129
|
+
[#1733]: https://github.com/gchq/CyberChef/pull/1733
|
|
1130
|
+
[#1722]: https://github.com/gchq/CyberChef/pull/1722
|
|
1131
|
+
[#1727]: https://github.com/gchq/CyberChef/pull/1727
|
|
1132
|
+
[#2263]: https://github.com/gchq/CyberChef/pull/2263
|
|
1133
|
+
[#1540]: https://github.com/gchq/CyberChef/pull/1540
|
|
1134
|
+
[#2262]: https://github.com/gchq/CyberChef/pull/2262
|
|
1135
|
+
[#2266]: https://github.com/gchq/CyberChef/pull/2266
|
|
1136
|
+
[#2237]: https://github.com/gchq/CyberChef/pull/2237
|
|
1137
|
+
[#2261]: https://github.com/gchq/CyberChef/pull/2261
|
|
1138
|
+
[#2260]: https://github.com/gchq/CyberChef/pull/2260
|
|
1139
|
+
[#2170]: https://github.com/gchq/CyberChef/pull/2170
|
|
1140
|
+
[#2210]: https://github.com/gchq/CyberChef/pull/2210
|
|
1141
|
+
[#2259]: https://github.com/gchq/CyberChef/pull/2259
|
|
1142
|
+
[#2257]: https://github.com/gchq/CyberChef/pull/2257
|
|
1143
|
+
[#2250]: https://github.com/gchq/CyberChef/pull/2250
|
|
1144
|
+
[#2236]: https://github.com/gchq/CyberChef/pull/2236
|
|
1145
|
+
[#2234]: https://github.com/gchq/CyberChef/pull/2234
|
|
1146
|
+
[#2235]: https://github.com/gchq/CyberChef/pull/2235
|
|
1147
|
+
[#2229]: https://github.com/gchq/CyberChef/pull/2229
|
|
1148
|
+
[#2228]: https://github.com/gchq/CyberChef/pull/2228
|
|
1149
|
+
[#2231]: https://github.com/gchq/CyberChef/pull/2231
|
|
1150
|
+
[#2156]: https://github.com/gchq/CyberChef/pull/2156
|
|
1151
|
+
[#2213]: https://github.com/gchq/CyberChef/pull/2213
|
|
1152
|
+
[#2163]: https://github.com/gchq/CyberChef/pull/2163
|
|
1153
|
+
[#2161]: https://github.com/gchq/CyberChef/pull/2161
|
|
1154
|
+
[#2208]: https://github.com/gchq/CyberChef/pull/2208
|
|
1155
|
+
[#2223]: https://github.com/gchq/CyberChef/pull/2223
|
|
1156
|
+
[#2219]: https://github.com/gchq/CyberChef/pull/2219
|
|
1157
|
+
[#2218]: https://github.com/gchq/CyberChef/pull/2218
|
|
1158
|
+
[#2151]: https://github.com/gchq/CyberChef/pull/2151
|
|
1159
|
+
[#2205]: https://github.com/gchq/CyberChef/pull/2205
|
|
1160
|
+
[#2071]: https://github.com/gchq/CyberChef/pull/2071
|
|
1161
|
+
[#2133]: https://github.com/gchq/CyberChef/pull/2133
|
|
1162
|
+
[#2017]: https://github.com/gchq/CyberChef/pull/2017
|
|
1163
|
+
[#2204]: https://github.com/gchq/CyberChef/pull/2204
|
|
1164
|
+
[#2201]: https://github.com/gchq/CyberChef/pull/2201
|
|
1165
|
+
[#2195]: https://github.com/gchq/CyberChef/pull/2195
|
|
1166
|
+
[#2200]: https://github.com/gchq/CyberChef/pull/2200
|
|
1167
|
+
[#2199]: https://github.com/gchq/CyberChef/pull/2199
|
|
1168
|
+
[#2125]: https://github.com/gchq/CyberChef/pull/2125
|
|
1169
|
+
[#2171]: https://github.com/gchq/CyberChef/pull/2171
|
|
1170
|
+
[#2194]: https://github.com/gchq/CyberChef/pull/2194
|
|
1171
|
+
[#2193]: https://github.com/gchq/CyberChef/pull/2193
|
|
1172
|
+
[#2192]: https://github.com/gchq/CyberChef/pull/2192
|
|
1173
|
+
[#2333]: https://github.com/gchq/CyberChef/pull/2333
|
|
1174
|
+
[#2335]: https://github.com/gchq/CyberChef/pull/2335
|
|
1175
|
+
[#1036]: https://github.com/gchq/CyberChef/pull/1036
|
|
1176
|
+
[#660]: https://github.com/gchq/CyberChef/pull/660
|
|
1177
|
+
[#1862]: https://github.com/gchq/CyberChef/pull/1862
|
|
1178
|
+
[#2322]: https://github.com/gchq/CyberChef/pull/2322
|
|
1179
|
+
[#2330]: https://github.com/gchq/CyberChef/pull/2330
|
|
1180
|
+
[#2331]: https://github.com/gchq/CyberChef/pull/2331
|
|
1181
|
+
[#2328]: https://github.com/gchq/CyberChef/pull/2328
|
|
1182
|
+
[#2326]: https://github.com/gchq/CyberChef/pull/2326
|
|
1183
|
+
[#2327]: https://github.com/gchq/CyberChef/pull/2327
|
|
1184
|
+
[#2323]: https://github.com/gchq/CyberChef/pull/2323
|
|
1185
|
+
[#2324]: https://github.com/gchq/CyberChef/pull/2324
|
|
1186
|
+
[#2321]: https://github.com/gchq/CyberChef/pull/2321
|
|
1187
|
+
[#2320]: https://github.com/gchq/CyberChef/pull/2320
|
|
1188
|
+
[#2167]: https://github.com/gchq/CyberChef/pull/2167
|
|
1189
|
+
[#2298]: https://github.com/gchq/CyberChef/pull/2298
|
|
1190
|
+
[#2317]: https://github.com/gchq/CyberChef/pull/2317
|
|
1191
|
+
[#2316]: https://github.com/gchq/CyberChef/pull/2316
|
|
1192
|
+
[#2315]: https://github.com/gchq/CyberChef/pull/2315
|
|
1193
|
+
[#2313]: https://github.com/gchq/CyberChef/pull/2313
|
|
1194
|
+
[#2311]: https://github.com/gchq/CyberChef/pull/2311
|
|
1013
1195
|
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Take a look through the [Wiki pages](https://github.com/gchq/CyberChef/wiki) for guides on [compiling CyberChef](https://github.com/gchq/CyberChef/wiki/Getting-started) and [adding new operations](https://github.com/gchq/CyberChef/wiki/Adding-a-new-operation).
|
|
4
|
+
|
|
5
|
+
There are lots of opportunities to contribute to CyberChef. If you want ideas, take a look at any [Issues](https://github.com/gchq/CyberChef/issues) tagged with '[help wanted](https://github.com/gchq/CyberChef/labels/help%20wanted)'.
|
|
6
|
+
|
|
7
|
+
Before your contributions can be accepted, you must:
|
|
8
|
+
|
|
9
|
+
- Fork the CyberChef repo
|
|
10
|
+
- Create a new branch within your fork for the changes
|
|
11
|
+
- Push your changes to your fork.
|
|
12
|
+
- Sign the [GCHQ Contributor Licence Agreement](https://cla-assistant.io/gchq/CyberChef)
|
|
13
|
+
- Submit a pull request.
|
|
14
|
+
|
|
15
|
+
Please note that we will ***reject*** pull requests from the master branch of your fork owing to the mess it makes of our own working repositories and the extra work entailed.
|
|
16
|
+
|
|
17
|
+
## Coding conventions
|
|
18
|
+
|
|
19
|
+
* Indentation: Each block should consist of 4 spaces
|
|
20
|
+
* Object/namespace identifiers: CamelCase
|
|
21
|
+
* Function/variable names: camelCase
|
|
22
|
+
* Constants: UNDERSCORE_UPPER_CASE
|
|
23
|
+
* Source code encoding: UTF-8 (without BOM)
|
|
24
|
+
* All source files must end with a newline
|
|
25
|
+
* Line endings: UNIX style (\n)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## Design Principles
|
|
29
|
+
|
|
30
|
+
1. If at all possible, all operations and features should be client-side and not rely on connections to an external server. This increases the utility of CyberChef on closed networks and in virtual machines that are not connected to the Internet. Calls to external APIs may be accepted if there is no other option, but not for critical components.
|
|
31
|
+
2. Latency should be kept to a minimum to enhance the user experience. This means that operation code should sit on the client and be executed there. However, as a trade-off between latency and bandwidth, operation code with large dependencies can be loaded in discrete modules in order to reduce the size of the initial download. The downloading of additional modules must remain entirely transparent so that the user is not inconvenienced.
|
|
32
|
+
3. Large libraries should be kept in separate modules so that they are not downloaded by everyone who uses the app, just those who specifically require the relevant operations.
|
|
33
|
+
4. Use Vanilla JS if at all possible to reduce the number of libraries required and relied upon. Frameworks like jQuery, although included, should not be used unless absolutely necessary.
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
With these principles in mind, any changes or additions to CyberChef should keep it:
|
|
37
|
+
|
|
38
|
+
- Standalone
|
|
39
|
+
- Efficient
|
|
40
|
+
- As small as possible
|
package/Dockerfile
CHANGED
package/Gruntfile.js
CHANGED
|
@@ -411,39 +411,13 @@ module.exports = function (grunt) {
|
|
|
411
411
|
stdout: false,
|
|
412
412
|
},
|
|
413
413
|
fixCryptoApiImports: {
|
|
414
|
-
command:
|
|
415
|
-
switch (process.platform) {
|
|
416
|
-
case "darwin":
|
|
417
|
-
return `find ./node_modules/crypto-api/src/ \\( -type d -name .git -prune \\) -o -type f -print0 | xargs -0 sed -i '' -e '/\\.mjs/!s/\\(from "\\.[^"]*\\)";/\\1.mjs";/g'`;
|
|
418
|
-
default:
|
|
419
|
-
return `find ./node_modules/crypto-api/src/ \\( -type d -name .git -prune \\) -o -type f -print0 | xargs -0 sed -i -e '/\\.mjs/!s/\\(from "\\.[^"]*\\)";/\\1.mjs";/g'`;
|
|
420
|
-
}
|
|
421
|
-
},
|
|
414
|
+
command: `node ${nodeFlags} src/core/config/scripts/fixCryptoApiImports.mjs`,
|
|
422
415
|
stdout: false
|
|
423
416
|
},
|
|
424
417
|
fixSnackbarMarkup: {
|
|
425
|
-
command:
|
|
426
|
-
switch (process.platform) {
|
|
427
|
-
case "darwin":
|
|
428
|
-
return `sed -i '' 's/<div id=snackbar-container\\/>/<div id=snackbar-container>/g' ./node_modules/snackbarjs/src/snackbar.js`;
|
|
429
|
-
default:
|
|
430
|
-
return `sed -i 's/<div id=snackbar-container\\/>/<div id=snackbar-container>/g' ./node_modules/snackbarjs/src/snackbar.js`;
|
|
431
|
-
}
|
|
432
|
-
},
|
|
418
|
+
command: `node ${nodeFlags} src/core/config/scripts/fixSnackBarMarkup.mjs`,
|
|
433
419
|
stdout: false
|
|
434
420
|
},
|
|
435
|
-
fixJimpModule: {
|
|
436
|
-
command: function () {
|
|
437
|
-
switch (process.platform) {
|
|
438
|
-
case "darwin":
|
|
439
|
-
// Space added before comma to prevent multiple modifications
|
|
440
|
-
return `sed -i '' 's/"es\\/index.js",/"es\\/index.js" ,\\n "type": "module",/' ./node_modules/jimp/package.json`;
|
|
441
|
-
default:
|
|
442
|
-
return `sed -i 's/"es\\/index.js",/"es\\/index.js" ,\\n "type": "module",/' ./node_modules/jimp/package.json`;
|
|
443
|
-
}
|
|
444
|
-
},
|
|
445
|
-
stdout: false
|
|
446
|
-
}
|
|
447
421
|
},
|
|
448
422
|
});
|
|
449
423
|
};
|
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ Cryptographic operations in CyberChef should not be relied upon to provide secur
|
|
|
24
24
|
|
|
25
25
|
**Prerequisites**
|
|
26
26
|
|
|
27
|
-
- [Docker](
|
|
27
|
+
- [Docker](https://www.docker.com/products/docker-desktop/)
|
|
28
28
|
- Docker Desktop must be open and running on your machine
|
|
29
29
|
|
|
30
30
|
|
package/babel.config.js
CHANGED
|
@@ -10,13 +10,7 @@ module.exports = function(api) {
|
|
|
10
10
|
}]
|
|
11
11
|
],
|
|
12
12
|
"plugins": [
|
|
13
|
-
"dynamic-import-node",
|
|
14
13
|
"@babel/plugin-syntax-import-assertions",
|
|
15
|
-
[
|
|
16
|
-
"babel-plugin-transform-builtin-extend", {
|
|
17
|
-
"globals": ["Error"]
|
|
18
|
-
}
|
|
19
|
-
],
|
|
20
14
|
[
|
|
21
15
|
"@babel/plugin-transform-runtime", {
|
|
22
16
|
"regenerator": true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cyberchef",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.24.0",
|
|
4
4
|
"description": "The Cyber Swiss Army Knife for encryption, encoding, compression and data analysis.",
|
|
5
5
|
"author": "n1474335 <n1474335@gmail.com>",
|
|
6
6
|
"homepage": "https://gchq.github.io/CyberChef",
|
|
@@ -39,73 +39,71 @@
|
|
|
39
39
|
"node >= 16"
|
|
40
40
|
],
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@babel/
|
|
43
|
-
"@babel/
|
|
44
|
-
"@babel/plugin-
|
|
45
|
-
"@babel/
|
|
46
|
-
"@babel/
|
|
47
|
-
"@
|
|
48
|
-
"@codemirror/
|
|
49
|
-
"@codemirror/
|
|
50
|
-
"@codemirror/
|
|
51
|
-
"@codemirror/
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"babel-loader": "^9.1.3",
|
|
55
|
-
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
56
|
-
"babel-plugin-transform-builtin-extend": "1.1.2",
|
|
42
|
+
"@babel/eslint-parser": "^7.28.6",
|
|
43
|
+
"@babel/plugin-syntax-import-assertions": "^7.28.6",
|
|
44
|
+
"@babel/plugin-transform-runtime": "^7.29.0",
|
|
45
|
+
"@babel/preset-env": "^7.29.2",
|
|
46
|
+
"@babel/runtime": "^7.29.2",
|
|
47
|
+
"@codemirror/commands": "^6.10.3",
|
|
48
|
+
"@codemirror/language": "^6.12.3",
|
|
49
|
+
"@codemirror/search": "^6.7.0",
|
|
50
|
+
"@codemirror/state": "^6.5.4",
|
|
51
|
+
"@codemirror/view": "^6.41.1",
|
|
52
|
+
"autoprefixer": "^10.5.0",
|
|
53
|
+
"babel-loader": "^10.1.1",
|
|
57
54
|
"base64-loader": "^1.0.0",
|
|
58
|
-
"chromedriver": "^
|
|
55
|
+
"chromedriver": "^146.0.6",
|
|
59
56
|
"cli-progress": "^3.12.0",
|
|
60
57
|
"colors": "^1.4.0",
|
|
61
58
|
"compression-webpack-plugin": "^11.1.0",
|
|
62
|
-
"copy-webpack-plugin": "^
|
|
63
|
-
"core-js": "^3.
|
|
64
|
-
"cspell": "^8.
|
|
65
|
-
"css-loader": "7.1.
|
|
66
|
-
"eslint": "^9.4
|
|
67
|
-
"eslint-plugin-jsdoc": "^
|
|
68
|
-
"globals": "^15.
|
|
69
|
-
"grunt": "^1.6.
|
|
59
|
+
"copy-webpack-plugin": "^13.0.1",
|
|
60
|
+
"core-js": "^3.49.0",
|
|
61
|
+
"cspell": "^8.19.4",
|
|
62
|
+
"css-loader": "7.1.4",
|
|
63
|
+
"eslint": "^9.39.4",
|
|
64
|
+
"eslint-plugin-jsdoc": "^50.8.0",
|
|
65
|
+
"globals": "^15.15.0",
|
|
66
|
+
"grunt": "^1.6.2",
|
|
70
67
|
"grunt-chmod": "~1.1.1",
|
|
71
68
|
"grunt-concurrent": "^3.0.0",
|
|
72
69
|
"grunt-contrib-clean": "~2.0.1",
|
|
73
|
-
"grunt-contrib-connect": "^
|
|
70
|
+
"grunt-contrib-connect": "^5.0.1",
|
|
74
71
|
"grunt-contrib-copy": "~1.0.0",
|
|
75
72
|
"grunt-contrib-watch": "^1.1.0",
|
|
76
73
|
"grunt-eslint": "^25.0.0",
|
|
77
74
|
"grunt-exec": "~3.0.0",
|
|
78
75
|
"grunt-webpack": "^6.0.0",
|
|
79
76
|
"grunt-zip": "^1.0.0",
|
|
80
|
-
"html-webpack-plugin": "^5.6.
|
|
77
|
+
"html-webpack-plugin": "^5.6.7",
|
|
81
78
|
"imports-loader": "^5.0.0",
|
|
82
|
-
"mini-css-extract-plugin": "2.
|
|
79
|
+
"mini-css-extract-plugin": "2.10.2",
|
|
83
80
|
"modify-source-webpack-plugin": "^4.1.0",
|
|
84
|
-
"nightwatch": "^3.
|
|
85
|
-
"postcss": "^8.
|
|
81
|
+
"nightwatch": "^3.15.0",
|
|
82
|
+
"postcss": "^8.5.10",
|
|
86
83
|
"postcss-css-variables": "^0.19.0",
|
|
87
|
-
"postcss-import": "^16.1.
|
|
88
|
-
"postcss-loader": "^8.
|
|
84
|
+
"postcss-import": "^16.1.1",
|
|
85
|
+
"postcss-loader": "^8.2.1",
|
|
89
86
|
"prompt": "^1.3.0",
|
|
90
|
-
"sitemap": "^8.0.
|
|
91
|
-
"terser": "^5.
|
|
92
|
-
"webpack": "^5.
|
|
87
|
+
"sitemap": "^8.0.3",
|
|
88
|
+
"terser": "^5.46.2",
|
|
89
|
+
"webpack": "^5.106.2",
|
|
93
90
|
"webpack-bundle-analyzer": "^4.10.2",
|
|
94
91
|
"webpack-dev-server": "5.0.4",
|
|
95
92
|
"webpack-node-externals": "^3.0.0",
|
|
96
93
|
"worker-loader": "^3.0.8"
|
|
97
94
|
},
|
|
98
95
|
"dependencies": {
|
|
96
|
+
"@alexaltea/capstone-js": "^3.0.5",
|
|
99
97
|
"@astronautlabs/amf": "^0.0.6",
|
|
100
|
-
"@babel/polyfill": "^7.12.1",
|
|
101
98
|
"@blu3r4y/lzma": "^2.3.3",
|
|
102
99
|
"@wavesenterprise/crypto-gost-js": "^2.1.0-RC1",
|
|
103
|
-
"@xmldom/xmldom": "^0.8.
|
|
100
|
+
"@xmldom/xmldom": "^0.8.13",
|
|
104
101
|
"argon2-browser": "^1.18.0",
|
|
105
|
-
"arrive": "^2.
|
|
106
|
-
"
|
|
102
|
+
"arrive": "^2.5.3",
|
|
103
|
+
"assert": "^2.1.0",
|
|
104
|
+
"avsc": "^5.7.9",
|
|
107
105
|
"bcryptjs": "^2.4.3",
|
|
108
|
-
"bignumber.js": "^9.1
|
|
106
|
+
"bignumber.js": "^9.3.1",
|
|
109
107
|
"blakejs": "^1.2.1",
|
|
110
108
|
"bootstrap": "4.6.2",
|
|
111
109
|
"bootstrap-colorpicker": "^3.4.0",
|
|
@@ -122,44 +120,45 @@
|
|
|
122
120
|
"ctph.js": "0.0.5",
|
|
123
121
|
"d3": "7.9.0",
|
|
124
122
|
"d3-hexbin": "^0.2.2",
|
|
125
|
-
"diff": "^5.2.
|
|
126
|
-
"dompurify": "^3.
|
|
123
|
+
"diff": "^5.2.2",
|
|
124
|
+
"dompurify": "^3.4.1",
|
|
127
125
|
"es6-promisify": "^7.0.0",
|
|
128
126
|
"escodegen": "^2.1.0",
|
|
129
127
|
"esprima": "^4.0.1",
|
|
128
|
+
"events": "^3.3.0",
|
|
130
129
|
"exif-parser": "^0.1.12",
|
|
131
|
-
"fernet": "^0.
|
|
130
|
+
"fernet": "^0.3.3",
|
|
132
131
|
"file-saver": "^2.0.5",
|
|
133
132
|
"flat": "^6.0.1",
|
|
134
133
|
"geodesy": "1.1.3",
|
|
135
|
-
"handlebars": "^4.7.
|
|
134
|
+
"handlebars": "^4.7.9",
|
|
136
135
|
"hash-wasm": "^4.12.0",
|
|
137
|
-
"highlight.js": "^11.
|
|
136
|
+
"highlight.js": "^11.11.1",
|
|
138
137
|
"ieee754": "^1.2.1",
|
|
139
|
-
"jimp": "
|
|
138
|
+
"jimp": "1.6.0",
|
|
140
139
|
"jq-web": "^0.5.1",
|
|
141
140
|
"jquery": "3.7.1",
|
|
142
141
|
"js-sha3": "^0.9.3",
|
|
143
|
-
"jsesc": "^3.0
|
|
142
|
+
"jsesc": "^3.1.0",
|
|
144
143
|
"json5": "^2.2.3",
|
|
145
|
-
"jsonata": "^2.0
|
|
146
|
-
"jsonpath-plus": "^10.
|
|
147
|
-
"jsonwebtoken": "
|
|
144
|
+
"jsonata": "^2.1.0",
|
|
145
|
+
"jsonpath-plus": "^10.4.0",
|
|
146
|
+
"jsonwebtoken": "9.0.3",
|
|
148
147
|
"jsqr": "^1.4.0",
|
|
149
|
-
"jsrsasign": "^11.1.
|
|
148
|
+
"jsrsasign": "^11.1.3",
|
|
150
149
|
"kbpgp": "^2.1.17",
|
|
151
150
|
"libbzip2-wasm": "0.0.4",
|
|
152
151
|
"libyara-wasm": "^1.2.1",
|
|
153
|
-
"lodash": "^4.
|
|
154
|
-
"loglevel": "^1.9.
|
|
152
|
+
"lodash": "^4.18.1",
|
|
153
|
+
"loglevel": "^1.9.2",
|
|
155
154
|
"loglevel-message-prefix": "^3.0.0",
|
|
156
155
|
"lz-string": "^1.5.0",
|
|
157
156
|
"lz4js": "^0.2.0",
|
|
158
|
-
"markdown-it": "^14.1.
|
|
157
|
+
"markdown-it": "^14.1.1",
|
|
159
158
|
"moment": "^2.30.1",
|
|
160
|
-
"moment-timezone": "^0.
|
|
159
|
+
"moment-timezone": "^0.6.1",
|
|
161
160
|
"ngeohash": "^0.6.3",
|
|
162
|
-
"node-forge": "^1.
|
|
161
|
+
"node-forge": "^1.4.0",
|
|
163
162
|
"node-md6": "^0.1.0",
|
|
164
163
|
"nodom": "^2.4.0",
|
|
165
164
|
"notepack.io": "^3.0.1",
|
|
@@ -169,24 +168,26 @@
|
|
|
169
168
|
"path": "^0.12.7",
|
|
170
169
|
"popper.js": "^1.16.1",
|
|
171
170
|
"process": "^0.11.10",
|
|
172
|
-
"protobufjs": "^7.
|
|
171
|
+
"protobufjs": "^7.5.5",
|
|
173
172
|
"qr-image": "^3.2.0",
|
|
174
173
|
"reflect-metadata": "^0.2.2",
|
|
175
174
|
"rison": "^0.1.1",
|
|
176
175
|
"scryptsy": "^2.1.0",
|
|
177
176
|
"snackbarjs": "^1.1.0",
|
|
178
|
-
"sortablejs": "^1.15.
|
|
177
|
+
"sortablejs": "^1.15.7",
|
|
179
178
|
"split.js": "^1.6.5",
|
|
179
|
+
"sql-formatter": "^15.7.3",
|
|
180
180
|
"ssdeep.js": "0.0.3",
|
|
181
181
|
"stream-browserify": "^3.0.0",
|
|
182
|
-
"tesseract.js": "
|
|
183
|
-
"ua-parser-js": "^1.0.
|
|
182
|
+
"tesseract.js": "^6.0.1",
|
|
183
|
+
"ua-parser-js": "^1.0.41",
|
|
184
184
|
"unorm": "^1.6.0",
|
|
185
|
+
"url": "^0.11.4",
|
|
185
186
|
"utf8": "^3.0.0",
|
|
186
|
-
"uuid": "^
|
|
187
|
+
"uuid": "^13.0.0",
|
|
187
188
|
"vkbeautify": "^0.99.3",
|
|
188
189
|
"xpath": "0.0.34",
|
|
189
|
-
"xregexp": "^5.1.
|
|
190
|
+
"xregexp": "^5.1.2",
|
|
190
191
|
"zlibjs": "^0.3.1"
|
|
191
192
|
},
|
|
192
193
|
"scripts": {
|
|
@@ -200,7 +201,7 @@
|
|
|
200
201
|
"testuidev": "npx nightwatch --env=dev",
|
|
201
202
|
"lint": "npx grunt lint",
|
|
202
203
|
"lint:grammar": "cspell ./src",
|
|
203
|
-
"postinstall": "npx grunt exec:fixCryptoApiImports && npx grunt exec:fixSnackbarMarkup
|
|
204
|
+
"postinstall": "npx grunt exec:fixCryptoApiImports && npx grunt exec:fixSnackbarMarkup",
|
|
204
205
|
"newop": "node --experimental-modules --experimental-json-modules src/core/config/scripts/newOperation.mjs",
|
|
205
206
|
"minor": "node --experimental-modules --experimental-json-modules src/core/config/scripts/newMinorVersion.mjs && npm version minor --git-tag-version=false && echo \"Updated to version v$(npm pkg get version | xargs), please create a pull request and once merged use 'npm run tag'\"",
|
|
206
207
|
"tag": "git tag -s \"v$(npm pkg get version | xargs)\" -m \"$(npm pkg get version | xargs)\" && echo \"Created v$(npm pkg get version | xargs), now check and push the tag\"",
|
package/src/core/Chef.mjs
CHANGED
|
@@ -55,8 +55,15 @@ class Chef {
|
|
|
55
55
|
progress = await recipe.execute(this.dish, progress);
|
|
56
56
|
} catch (err) {
|
|
57
57
|
log.error(err);
|
|
58
|
+
|
|
59
|
+
let displayStr;
|
|
60
|
+
if ("displayStr" in err) {
|
|
61
|
+
displayStr = err.displayStr;
|
|
62
|
+
} else {
|
|
63
|
+
displayStr = err.toString();
|
|
64
|
+
}
|
|
58
65
|
error = {
|
|
59
|
-
displayStr:
|
|
66
|
+
displayStr: displayStr,
|
|
60
67
|
};
|
|
61
68
|
progress = err.progress;
|
|
62
69
|
}
|
package/src/core/Ingredient.mjs
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import Utils from "./Utils.mjs";
|
|
8
|
-
import {fromHex} from "./lib/Hex.mjs";
|
|
8
|
+
import { fromHex } from "./lib/Hex.mjs";
|
|
9
|
+
import OperationError from "./errors/OperationError.mjs";
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* The arguments to operations.
|
|
@@ -119,7 +120,9 @@ class Ingredient {
|
|
|
119
120
|
number = parseFloat(data);
|
|
120
121
|
if (isNaN(number)) {
|
|
121
122
|
const sample = Utils.truncate(data.toString(), 10);
|
|
122
|
-
throw
|
|
123
|
+
throw new OperationError(
|
|
124
|
+
"Invalid ingredient value. Not a number: " + sample,
|
|
125
|
+
);
|
|
123
126
|
}
|
|
124
127
|
return number;
|
|
125
128
|
default:
|
package/src/core/Operation.mjs
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import Dish from "./Dish.mjs";
|
|
8
|
+
import OperationError from "./errors/OperationError.mjs";
|
|
8
9
|
import Ingredient from "./Ingredient.mjs";
|
|
9
10
|
|
|
10
11
|
/**
|
|
@@ -223,7 +224,11 @@ class Operation {
|
|
|
223
224
|
*/
|
|
224
225
|
set ingValues(ingValues) {
|
|
225
226
|
ingValues.forEach((val, i) => {
|
|
226
|
-
|
|
227
|
+
try {
|
|
228
|
+
this._ingList[i].value = val;
|
|
229
|
+
} catch (err) {
|
|
230
|
+
throw new OperationError(`Failed to set value of ingredient '${this._ingList[i].name}': ${err}`);
|
|
231
|
+
}
|
|
227
232
|
});
|
|
228
233
|
}
|
|
229
234
|
|
package/src/core/Recipe.mjs
CHANGED
|
@@ -70,11 +70,15 @@ class Recipe {
|
|
|
70
70
|
if (o instanceof Operation) {
|
|
71
71
|
return o;
|
|
72
72
|
} else {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
try {
|
|
74
|
+
const op = new modules[o.module][o.name]();
|
|
75
|
+
op.ingValues = o.ingValues;
|
|
76
|
+
op.breakpoint = o.breakpoint;
|
|
77
|
+
op.disabled = o.disabled;
|
|
78
|
+
return op;
|
|
79
|
+
} catch (err) {
|
|
80
|
+
throw new Error(`Failed to hydrate operation '${o.name}': ${err}`);
|
|
81
|
+
}
|
|
78
82
|
}
|
|
79
83
|
});
|
|
80
84
|
}
|
|
@@ -229,6 +233,7 @@ class Recipe {
|
|
|
229
233
|
}
|
|
230
234
|
this.lastRunOp = op;
|
|
231
235
|
} catch (err) {
|
|
236
|
+
log.error(err);
|
|
232
237
|
// Return expected errors as output
|
|
233
238
|
if (err instanceof OperationError || err?.type === "OperationError") {
|
|
234
239
|
// Cannot rely on `err instanceof OperationError` here as extending
|