12-01-2021 04:39 AM
In a javascript script pack is how do I load/read a file that is available in the manager?
I cant find an example showing how to read in external files inside a Script snap, or how to pass both an incoming doc and a configuration to the Script snap.
Background
I have a generic validation script, that is going to be a child pipeline to many parents, so need to apply different criteria to validate incoming documents differently; eg. there may be a “loose” configuration, where an email just needs to contain @ and be length >1 and <1000, or a “strict” configuration, where a complex reg exp is applied, so the generic script remains the same, but reads in and applies validation via a configuration file.
12-02-2021 01:25 AM
Can you give me a sample input that contains both data and config docs?