{
  "$schema" : "https://json-schema.org/draft/2020-12/schema",
  "$id" : "https://voltdb.com/voltsp/schemas/processor/javascript",
  "title" : "Javascript Processor Configuration",
  "description" : "This plugin allows execution of JavaScript code on streamed data using the GraalVM JavaScript engine.\n\n## Features\n\n- Execute JavaScript code on input data\n- Load JavaScript code from a file or provide it inline\n- Access input data from JavaScript\n- Emit output data from JavaScript\n\nThe JavaScript processor can also be configured to limit script execution time.\n\n## JavaScript API\n\nThe JavaScript code can access the `input` data passed to the processor.\n\nThe JavaScript code should define a `process` function that takes the input data and returns the output data:\n\n```javascript\nfunction process(input) {\n  // Process the input data\n  return output;\n}\n```\n\nAlternatively, for stash-aware processing:\n\n```javascript\nfunction processWithContext(input, context) {\n  context.stash(\"key\", \"value\");\n  return input;\n}\n```\n\n## Security Considerations\n\nThe JavaScript processor runs with limited permissions by default. It cannot access the file system, network, or other system resources unless explicitly allowed.\n",
  "type" : "object",
  "properties" : {
    "javascript" : {
      "type" : "object",
      "properties" : {
        "script" : {
          "type" : "string",
          "description" : "JavaScript code to execute"
        },
        "scriptUrl" : {
          "type" : "string",
          "format" : "uri",
          "description" : "URL to a JavaScript file to execute"
        }
      },
      "additionalProperties" : false
    }
  },
  "required" : [ "javascript" ],
  "additionalProperties" : false
}
