The global variables available in code blocks can be found here.
JS Engine provides an API that can be used to do a lot of useful things. Documentation for the API can be found here.