Nick O'Leary
51a0b68d8e
Revert "Add callback to getSetting to support async jsonata access"
2023-06-22 10:17:48 +01:00
Nick O'Leary
ce679f90ee
Merge pull request #4177 from k1ln/adding-timeout-to-functio-node
...
adding timeout attribute to function node
2023-06-21 15:57:44 +01:00
Nick O'Leary
aa0225f59f
Apply suggestions from code review
2023-06-21 14:27:32 +01:00
Nick O'Leary
3f604e9d93
Adds optional callback to env.get in function node
2023-06-21 14:20:23 +01:00
Kilian Hertel
2253417459
adding timeout attribute to function node
...
- [x] New feature (non-breaking change which adds functionality)
Discussion here:
https://discourse.nodered.org/t/function-node-doesnt-have-timeout-feature/78483
## Proposed changes
Adding a timeout attribute to the function node, so an endless funciton doesnt break the node red server.
## Checklist
- [x] I have read the [contribution guidelines](https://github.com/node-red/node-red/blob/master/CONTRIBUTING.md )
- [x] For non-bugfix PRs, I have discussed this change on the forum/slack team.
- [x] I have run `grunt` to verify the unit tests pass
- [x] I have added suitable unit tests to cover the new/changed functionality
2023-05-22 10:16:37 +02:00
Nick O'Leary
703c5adba7
Add _path property to nodes and expose as node.path in Function node
2022-01-25 21:32:28 +00:00
Nick O'Leary
0dbc35c252
Update Function to use correct api to access env vars
...
Fixes #3299
2021-12-27 11:55:10 +00:00
Nick O'Leary
b2dc1d8b23
Ensure default module export is exposed in Function node
2021-07-20 14:42:43 +01:00
Nick O'Leary
66a704af55
Fallback to 'require' if on node < 12.17
2021-07-15 15:38:07 +01:00
Nick O'Leary
2cc1973f62
Enable functionExternalModules by default
2021-07-15 10:07:52 +01:00
Nick O'Leary
395b499856
Fix async loading of modules in function node
2021-07-14 21:10:59 +01:00
Nick O'Leary
7fd17b4ec0
Add RED.import to support importing ES6 modules
2021-07-14 19:18:39 +01:00
Nick O'Leary
12698dc347
Add full ast parsing in Function node to spot node.done calls
...
Fixes #2998
2021-06-02 12:32:44 +01:00
Nick O'Leary
90761fd840
Fix 'SyntaxError' in Function node when last line of on-stop is a comment
2021-05-13 17:23:25 +01:00
Kazuhito Yokoi
39274b0c5d
Add Japanese translations for Node-RED v1.3.1 ( #2930 )
2021-04-12 14:15:07 +01:00
Kristian Heljas
7b8ed487e9
Function node: add node.outputCount
property to sandbox ( #2918 )
...
* Function node: add `node.outputs` property to sandbox
https://discourse.nodered.org/t/expose-configured-output-count-to-function-node-i-can-pr/43848
* style: indetation for function node sanbox code
I guess this was unintentionally unindented in d51aefa156 (diff-24cd715c3b7405ea194bfdc0dc2a350ceb2f5d18696b8163c3e40105b981a666)
* Function node: tests for accessing node properties
consistently tests that `node.id`, `node.name` and `node.outputs`
are available in `init()`, `func()` and `finalize()` methods.
* Function node: rename `node.outputs` to `node.outputCount`
https://discourse.nodered.org/t/expose-configured-output-count-to-function-node-i-can-pr/43848/9?u=kristian
2021-04-08 14:52:02 +01:00
Kazuhito Yokoi
a157580b22
Add Japanese translations for Node-RED v1.3
2021-04-08 20:06:35 +09:00
Nick O'Leary
c9c5f7f088
Fix functionExternalModules tests
2021-03-01 21:34:37 +00:00
Nick O'Leary
c3adc956d7
Add functionExternalModules to settings and default to false
2021-03-01 18:24:16 +00:00
Nick O'Leary
d5f4f987f2
Add 'node' object to Function close scope
2021-02-17 14:41:50 +00:00
Nick O'Leary
785c349adc
Prevent function module overwriting built-in sandbox properties
2021-02-16 13:58:59 +00:00
Nick O'Leary
a94c19a6cf
Fix up loading of freshly installed modules in Function node
2021-02-12 22:40:30 +00:00
Nick O'Leary
9c09ee3b71
Rework Function node module integration
2021-02-12 18:14:13 +00:00
Hiroyasu Nishiyama
4a1d66f210
update UI, Runtime API, metadata handling, and others
2021-01-27 22:27:54 +09:00
Hiroyasu Nishiyama
d51aefa156
initial support for npm module installation
2021-01-11 19:32:16 +09:00
Nick O'Leary
6ea978d83d
Prevent needless retention of node status messages
2020-11-16 21:05:13 +00:00
Nick O'Leary
2db3a4f1ef
Add unit tests for function node init code
2020-09-25 17:11:10 +01:00
cinhcet
0601833387
msgid added in vm to avoid unneccesary if statement
2020-07-08 19:09:07 +02:00
cinhcet
5d7a625883
expose send, status, log, warn, error, debug, trace, name, id in setup code of function node
2020-07-08 01:30:29 +02:00
Nick O'Leary
20daebd965
Ignore whitespace when checking function setup/close code
2020-06-05 10:36:49 +01:00
Nick O'Leary
7969dd431f
[function] Make the function node top-level async
...
This allows you to use 'await' in a function node without
having to wrap it in another promise/async function.
2020-05-22 20:49:18 +01:00
Hiroyasu Nishiyama
5b197adf33
update according to comments
2020-05-11 14:37:14 +09:00
Hiroyasu Nishiyama
c649e1b4a2
update promise & message handling
2020-04-10 23:06:43 +09:00
Hiroyasu Nishiyama
161f6090c1
update initialize & finalize processing of function node
2020-04-06 16:34:41 +09:00
Hiroyasu Nishiyama
84d2b8ad6d
add support of initialization & finalization to function node
2020-03-07 01:55:45 +09:00
Nick O'Leary
f0839571d0
Clone the first message passed to node.send in Function
...
Also introduces an optional second arg to node.send in the Function
node that can disable that cloning
2019-09-12 22:09:35 +01:00
Nick O'Leary
da6db24f9e
Reorganise nodes into new categories
2019-08-21 14:23:23 +01:00