{
  "contexts" : {
    "AgentControlContext" : {
      "description" : "Allows workflows to request lifecycle actions on the running agent.",
      "longDescription" : "Allows workflows to request lifecycle actions on the running agent. This is currently in beta and not supported",
      "functions" : [ {
        "name" : "shutdownAgent",
        "description" : "Request that the agent begins shutting down. Workflows must enable bootstrap.agentControl.workflowCanShutdownAgent or this will throw an error.",
        "returns" : "null"
      } ]
    },
    "AuthenticationJavascriptContext" : {
      "description" : "This is a specialised Javascript Context for authentication steps.",
      "longDescription" : "This is a specialised Javascript Context for authentication steps. Most of the methods on Javascript Context are still available, the methods listed below are specialisations. sendMetric and",
      "functions" : [ {
        "name" : "addSplitReturnItem",
        "description" : "When the current step is a \"scripted-split-aggregate\" type (see Step) the processed item must be added to the returned aggregate using this method.",
        "returns" : "null"
      }, {
        "name" : "addSystemError",
        "description" : "Adds an error not intended for a user outside the agent. It will also mark the context as in an error state. System errors would generally be thrown or handled.",
        "returns" : "null"
      }, {
        "name" : "addUserError",
        "description" : "Adds an error intended for a user outside the agent. It will also mark the context as in an error state. User errors would generally make their way to a human.",
        "returns" : "null"
      }, {
        "name" : "bytes",
        "description" : "Obtain a Byte context for working with bytes",
        "returns" : "ByteContext"
      }, {
        "name" : "counter",
        "description" : "Atomically add to (or subtract from) a thread safe atomic counter and return the updated value To just get the value pass 0 for the add parameter add",
        "returns" : "number"
      }, {
        "name" : "crypto",
        "description" : "Obtain a Cryptography context for working with cryptography",
        "returns" : "CryptoContext"
      }, {
        "name" : "delta",
        "description" : "Returns the differences between the current value and the last value stored for given key",
        "returns" : "number"
      }, {
        "name" : "diagnosticLog",
        "description" : "Write a diagnostic log. This will only be emitted in development mode, or in Production mode if the step is enabled via a \"enableDiagnostics\" message",
        "returns" : "null"
      }, {
        "name" : "end",
        "description" : "Terminates the running flow and returns immediately.",
        "returns" : "null"
      }, {
        "name" : "getAllErrors",
        "description" : "Retrieves a list of all error messages associated with the current context.",
        "returns" : "array"
      }, {
        "name" : "getAuthenticationPropertiesFromStep",
        "description" : "Gets the authentication properties from another step. These properties can expire.",
        "returns" : "string"
      }, {
        "name" : "getBody",
        "description" : "A shorthand for: check getMessageBodyAsString()then check getPassedMessageAsString() @return the contents eiter passed into the step or set by the step.",
        "returns" : "string"
      }, {
        "name" : "getData",
        "description" : "",
        "returns" : "string"
      }, {
        "name" : "getFirstError",
        "description" : "Retrieves the first error message from a given list of errors, if available.",
        "returns" : "string"
      }, {
        "name" : "getHeader",
        "description" : "Get a header from the previous request/response - note: it always returns an array string",
        "returns" : "string"
      }, {
        "name" : "getMessageBodyAsString",
        "description" : "Get the current message body, this could be the response from an http call for example",
        "returns" : "string"
      }, {
        "name" : "getPassedMessageAsString",
        "description" : "Get the message body that was passed to this step.",
        "returns" : "string"
      }, {
        "name" : "getPersistedItem",
        "description" : "Gets an item from the step persistence",
        "returns" : "string"
      }, {
        "name" : "getProperty",
        "description" : "Gets a property from this running context",
        "returns" : "object"
      }, {
        "name" : "getRestrictedDataFromHost",
        "description" : "Gets the json string of restricted data for a host name",
        "returns" : "string"
      }, {
        "name" : "getStepProperties",
        "description" : "Returns the set properties for the Step. These properties will persist after requests but not over config reloads/restarts",
        "returns" : "object"
      }, {
        "name" : "getSystemErrors",
        "description" : "Retrieves a list of system-specific error messages associated with the current context.",
        "returns" : "array"
      }, {
        "name" : "getTimestamp",
        "description" : "Get the current UTC timestamp (note that the timestamp might be set by a test or other mechanism) in milliseconds since 1970-01-01T00:00:00Z (UTC)",
        "returns" : "integer"
      }, {
        "name" : "getTimestampManager",
        "description" : "The timestamp manager allows for persistence of timestamps",
        "returns" : "TimestampManager"
      }, {
        "name" : "getUserErrors",
        "description" : "Retrieves a list of user-specific error messages associated with the current context.",
        "returns" : "array"
      }, {
        "name" : "hasSystemErrors",
        "description" : "Checks if there are any system-specific errors in the current context.",
        "returns" : "boolean"
      }, {
        "name" : "hasUserErrors",
        "description" : "Checks if there are any user-specific errors in the current context.",
        "returns" : "boolean"
      }, {
        "name" : "hash",
        "description" : "Note : This is a non-cryptographic hash and is intended to be used for obfuscation. When hashing a value, the original and the hash are emitted to the log to be referred to at a later date. The hash can be used in metrics etc so that the original value is not transmitted. The intention is that the raw value can remain in the originating network and the hash value can be transmitted out of network.",
        "returns" : "string"
      }, {
        "name" : "isErrored",
        "description" : "Indicates whether the current context is in an errored state.",
        "returns" : "boolean"
      }, {
        "name" : "jsonPath",
        "description" : "Returns the result from a JSONPath expression",
        "returns" : "string"
      }, {
        "name" : "licensing",
        "description" : "Obtain licensing information. This is currently a BETA feature and is unsupported.",
        "returns" : "LicensingContext"
      }, {
        "name" : "mergeJsonStrings",
        "description" : "Returns a merged json string",
        "returns" : "string"
      }, {
        "name" : "queue",
        "description" : "Returns the high performance persistent queue",
        "returns" : "PersistentQueueContext"
      }, {
        "name" : "regexMatch",
        "description" : "Returns the regex matches",
        "returns" : "array"
      }, {
        "name" : "removeAllHeaders",
        "description" : "Remove all headers from the current state",
        "returns" : "null"
      }, {
        "name" : "removeHeader",
        "description" : "Remove a header from the current state",
        "returns" : "null"
      }, {
        "name" : "sendToStep",
        "description" : "Send a message to another step and return a completed context upon completion",
        "returns" : "JavascriptStateContext"
      }, {
        "name" : "sendToStepAndForget",
        "description" : "Send a message to another step and returns immediately. The step called will be processed in another thread, and you will not be able to access to the result.",
        "returns" : "null"
      }, {
        "name" : "setAuthenticationPropertiesOnStep",
        "description" : "Sets the authentication properties from another step. These properties can expire.",
        "returns" : "null"
      }, {
        "name" : "setBody",
        "description" : "An alias for setMessage(...)",
        "returns" : "null"
      }, {
        "name" : "setCounter",
        "description" : "Atomically set the counter to an absolute value",
        "returns" : "null"
      }, {
        "name" : "setData",
        "description" : "Set the JSON data for this step",
        "returns" : "null"
      }, {
        "name" : "setHeader",
        "description" : "Add a header to the next http request",
        "returns" : "null"
      }, {
        "name" : "setHttpMethod",
        "description" : "Set the HTTP method for the next http action This is generally used when a method other than the default is required. The HTTP method will default to GET unless there is a payload body then it will default to POST",
        "returns" : "null"
      }, {
        "name" : "setMessage",
        "description" : "Sets the message body for this running exchange",
        "returns" : "null"
      }, {
        "name" : "setPersistedItem",
        "description" : "Sets an item to the step persistence",
        "returns" : "null"
      }, {
        "name" : "setProperty",
        "description" : "Sets a property onto this running context to be available in downstream step execution This differs from setPersistedItem in that setPersistedItem sets onto the STEP to be available on THIS STEP in future runs, while setProperty makes an item available to OTHER steps",
        "returns" : "null"
      }, {
        "name" : "setUrl",
        "description" : "Set the url for the next http action with reference to a named host The path can start with a / even if the named host ends in a / - the result will be a single '/'",
        "returns" : "null"
      }, {
        "name" : "sleep",
        "description" : "Force the currently running script to sleep for the given milliseconds",
        "returns" : "null"
      }, {
        "name" : "xmlToJson",
        "description" : "Returns a json string from an xml string",
        "returns" : "string"
      } ]
    },
    "ByteContext" : {
      "description" : "A low-level byte buffer manipulation interface providing minimal primitives for binary data operations.",
      "longDescription" : "A low-level byte buffer manipulation interface providing minimal primitives for binary data operations. Most operations either take or return a ByteBufferHandle. The byte buffer handle is a reference to a byte buffer in the agent - you will never interact with the buffer itself, rather you delegate the functionality to the agent. The ByteContext offers the following categories of functionality: - conversion to and from text encoded bytes (base64, hex) - creating new byte arrays (create, createFromByteArray, createFromString) - byte array manipulation (concat, copy, getSize, resize, slice, release) - byte compression (gzip, gunzip, zip, unzip) - writing to byte buffer (writeByte, writeBytes) - reading from byte buffer (readByte, reader.available, reader.read, reader.readAll) All high-level operations (multi-byte integers, strings, etc.) should be implemented in JavaScript using these primitives. References: - (Blog) - (Blog)",
      "functions" : [ {
        "name" : "base64ToBinary",
        "description" : "Converts a Base64 encoded String into a binary buffer.",
        "returns" : "ByteBufferHandle"
      }, {
        "name" : "binaryToBase64",
        "description" : "Converts buffer contents to a Base64 encoded string.",
        "returns" : "string"
      }, {
        "name" : "binaryToHex",
        "description" : "Converts buffer contents to a hexadecimal string representation.",
        "returns" : "string"
      }, {
        "name" : "concat",
        "description" : "Combines two buffers into a new buffer containing all bytes from both.",
        "returns" : "ByteBufferHandle"
      }, {
        "name" : "copy",
        "description" : "Creates a deep copy of an existing buffer.",
        "returns" : "ByteBufferHandle"
      }, {
        "name" : "create",
        "description" : "Creates a new buffer of the specified size, initialized with zeros.",
        "returns" : "ByteBufferHandle"
      }, {
        "name" : "createFromByteArray",
        "description" : "Creates a new buffer from a byte array.",
        "returns" : "ByteBufferHandle"
      }, {
        "name" : "createFromString",
        "description" : "Creates a new buffer from a string.",
        "returns" : "ByteBufferHandle"
      }, {
        "name" : "getSize",
        "description" : "Returns the current size of a buffer in bytes.",
        "returns" : "integer"
      }, {
        "name" : "gunzip",
        "description" : "Decompresses GZIP-compressed buffer contents.",
        "returns" : "ByteBufferHandle"
      }, {
        "name" : "gzip",
        "description" : "Compresses buffer contents using GZIP compression.",
        "returns" : "ByteBufferHandle"
      }, {
        "name" : "hash",
        "description" : "Computes a CRC32 hash of the buffer contents.",
        "returns" : "integer"
      }, {
        "name" : "hexToBinary",
        "description" : "Converts a hexadecimal string to binary buffer data.",
        "returns" : "ByteBufferHandle"
      }, {
        "name" : "readByte",
        "description" : "Reads a single byte from the buffer at the specified offset.",
        "returns" : "integer"
      }, {
        "name" : "reader",
        "description" : "Creates a sequential reader for efficient forward-only reading of buffer data. This is more efficient than random access for sequential operations.",
        "returns" : "ByteReader"
      }, {
        "name" : "release",
        "description" : "Securely releases (erase) buffers from memory.",
        "returns" : "null"
      }, {
        "name" : "resize",
        "description" : "Changes the size of a buffer. If enlarged, new bytes are zero-filled. If shrunk, excess bytes are discarded.",
        "returns" : "ByteBufferHandle"
      }, {
        "name" : "sha256",
        "description" : "Computes a SHA-256 digest of the buffer contents.",
        "returns" : "ByteBufferHandle"
      }, {
        "name" : "slice",
        "description" : "Extracts a portion of a buffer without modifying the original.",
        "returns" : "ByteBufferHandle"
      }, {
        "name" : "split",
        "description" : "Splits a buffer by a delimiter buffer.",
        "returns" : "array"
      }, {
        "name" : "toString",
        "description" : "",
        "returns" : "string"
      }, {
        "name" : "unzip",
        "description" : "Decompresses ZIP-compressed buffer contents.",
        "returns" : "ByteBufferHandle"
      }, {
        "name" : "writeByte",
        "description" : "Writes a single byte to the buffer at the specified offset.",
        "returns" : "null"
      }, {
        "name" : "writeBytes",
        "description" : "Copies bytes from one buffer to another. This is the most efficient way to move large amounts of data between buffers.",
        "returns" : "null"
      }, {
        "name" : "zip",
        "description" : "Compresses buffer contents using ZIP compression.",
        "returns" : "ByteBufferHandle"
      } ]
    },
    "CryptoContext" : {
      "description" : "The Crypto context provides cryptographic operations for signing, encryption and random byte generation.",
      "longDescription" : "The Crypto context provides cryptographic operations for signing, encryption and random byte generation. It works with the byte context, and all parameters and returns are byte buffer handles. The opscotch cryptography functions use the libsodium implementation, which is a high-grade industry standard. Some notes about keys: - Keys need to be a specific kind and size for each function and must be registered (either in the bootstrap or during a workflow) before used - see registerKey. - You can generate a key for a specific function using generateKeyPair - You can validate a key for a given function using validateKey - For key requirements see Key References: - (Blog) The following cryptographic functions are provided for use within workflows: - Public key signatures - Used to create and verify digital signatures that ensure message authenticity and integrity. A private key is used to generate a unique signature for a message, while the corresponding public key allows anyone to verify the signature. A verified signature proves it was created by the owner of the private key, and the message hasn't been tampered with. - methods: - sign - verifySignature - Algorithm used: Ed25519 - You can provide your own Ed25519 keys - Authenticated public key encryption - Used to encrypt messages that can only be decrypted by a specific intended recipient and authenticates the sender's identity. The recipient can verify the message came from the claimed sender, while ensuring message confidentiality. This provides both encryption and authentication in a single operation. - methods: - encryptPublicKey - decryptPublicKey - Algorithms used: - Key exchange: X25519 - Encryption: XSalsa20 - Authentication: Poly1305 - You can provide your own X25519 keys - Anonymous public key encryption - Used for one-way encryption where only the recipient can decrypt the message using their private key. The sender remains anonymous as no authentication is performed. This provides message confidentiality without revealing the sender's identity. - methods: - encryptAnonymous - decryptAnonymous - Algorithms used: - Key exchange: X25519 - Encryption: XSalsa20 stream cipher - You can provide your own X25519 keys - Symmetric secret key encryption - Used when both parties share a single secret key that is used for both encryption and decryption. The same key must be securely shared between parties beforehand. This provides fast and secure encryption for parties who have already established a shared secret key. - methods: - encryptSymmetric - decryptSymmetric - Algorithm used: XSalsa20 stream cipher - You can provide your own 32-byte secret key - Random byte generation - Generate cryptographically random byte array - methods: - randomBytes - Hahsing - Generate cryptographically secure hash values - methods: - hash - hmacSha256 - Key management - Various functions for working with keys: - methods: - generateKeyPair - registerKey - validateKey",
      "functions" : [ {
        "name" : "decryptAnonymous",
        "description" : "Decrypts a payload using anonymous public-key encryption.",
        "returns" : "ByteBufferHandle"
      }, {
        "name" : "decryptPublicKey",
        "description" : "Decrypts a payload using authenticated public-key encryption.",
        "returns" : "ByteBufferHandle"
      }, {
        "name" : "decryptSymmetric",
        "description" : "Decrypts a payload using symmetric decryption.",
        "returns" : "ByteBufferHandle"
      }, {
        "name" : "encryptAnonymous",
        "description" : "Encrypts a payload using anonymous public-key encryption. This will be used when the sender uses the recipient public key to encrypt and the payload is only openable by the holder of the secret key. There is no sender identity or verification.",
        "returns" : "ByteBufferHandle"
      }, {
        "name" : "encryptPublicKey",
        "description" : "Encrypts a payload using authenticated public-key encryption. This is used when the recipient knows the sender and vice versa. The payload will only be openable by the intended recipient and will only be openable if verified from the sender.",
        "returns" : "ByteBufferHandle"
      }, {
        "name" : "encryptSymmetric",
        "description" : "Encrypts a payload using symmetric encryption.",
        "returns" : "ByteBufferHandle"
      }, {
        "name" : "generateKeyPair",
        "description" : "Generate a new public/private key pair for the given type",
        "returns" : "array"
      }, {
        "name" : "hash",
        "description" : "Generates a consistent hash for the same input",
        "returns" : "ByteBufferHandle"
      }, {
        "name" : "hmacSha256",
        "description" : "Generates an HMAC using SHA-256.",
        "returns" : "ByteBufferHandle"
      }, {
        "name" : "passwordHash",
        "description" : "Given a user-provided password, create a safe, high-entropy key/hash you can use for encryption or password verification This version of the function uses the minimum safe parameters for the lowest memory and CPU usage. Using higher resource settings will make the calculation take longer, which means any attacks on a password will also take longer. See notes on the other passwordHash function.",
        "returns" : "array"
      }, {
        "name" : "randomBytes",
        "description" : "Generates random bytes that are cryptographically secure.",
        "returns" : "ByteBufferHandle"
      }, {
        "name" : "registerKey",
        "description" : "Registers a cryptographic key and returns a registered key id for use in the current context. WARNING: THE INPUT KEY BYTES ARE ZEROED OUT - THIS DESTROYS THE INPUT. If you need the input key you must make a copy with context.bytes().copy(KEY) Public and secret keys need to be registered separately. The purpose is important and can be one of the following cryptographic primitives: - sign - used for sign and verifySignature using public/secret keys - authenticated - used for encryptPublicKey and decryptPublicKey for mutually authenticated public-key encryption - symmetric - used for encryptSymmetric and decryptSymmetric - this only uses a secret key - anonymous - used for encryptAnonymous and decryptAnonymous - this is the classic public/private key encryption The type will either be public or secret depending on the key being registered. Each permutation of purpose and type will have a specific required key length in bytes and an error will be thrown if the byte length (not the hex character length) does not match.",
        "returns" : "string"
      }, {
        "name" : "sign",
        "description" : "Signs a payload using a secret key and returns the signature.",
        "returns" : "ByteBufferHandle"
      }, {
        "name" : "validateKey",
        "description" : "Determines if a given key id matches a registered key with the given purpose and type",
        "returns" : "boolean"
      }, {
        "name" : "verifySignature",
        "description" : "Verifies that a signature matches a message using a public key.",
        "returns" : "boolean"
      } ]
    },
    "DiagnosticsContext" : {
      "description" : "An interface for interacting with OpenTelemetry",
      "longDescription" : "An interface for interacting with OpenTelemetry",
      "functions" : [ {
        "name" : "errored",
        "description" : "Mark the trace as errored and records the error message",
        "returns" : "null"
      }, {
        "name" : "event",
        "description" : "Add an event to a trace",
        "returns" : "null"
      }, {
        "name" : "setAttribute",
        "description" : "Set an attribute onto the trace",
        "returns" : "null"
      } ]
    },
    "Doc" : {
      "description" : "Documentation and schema validation for a JavaScript step.",
      "longDescription" : "Documentation and schema validation for a JavaScript step. The Doc model allows JavaScript steps to declare input/output/data schemas for validation, describe their purpose, and define execution logic. The doc model is available in the JavaScript resource as doc Usage in JavaScript:",
      "functions" : [ {
        "name" : "asUserErrors",
        "description" : "Marks errors as user error when the user is expected to resolve the error. When enabled, validation errors will be added the user error context rather than the system error context",
        "returns" : "Doc"
      }, {
        "name" : "dataSchema",
        "description" : "Defines the JSON Schema for the data object validation. The schema is used to validate the data object (passed via JavaScriptSource.data) before the step executes. If validation fails, a user-friendly error is returned.",
        "returns" : "Doc"
      }, {
        "name" : "description",
        "description" : "Provides a human-readable description of what the step does. This description is used for documentation and may be displayed in error messages or API documentation.",
        "returns" : "Doc"
      }, {
        "name" : "inSchema",
        "description" : "Defines the JSON Schema for input validation. The schema is used to validate the incoming request body before the step executes. If validation fails, a user-friendly error is returned.",
        "returns" : "Doc"
      }, {
        "name" : "outSchema",
        "description" : "Defines the JSON Schema for output validation. The schema is used to validate the step's output before it's returned. If validation fails, a user-friendly error is returned.",
        "returns" : "Doc"
      }, {
        "name" : "run",
        "description" : "Sets the execution function for the step. This function is called when the step executes. It should contain the main logic for the step.",
        "returns" : "Doc"
      } ]
    },
    "FilesContext" : {
      "description" : "The FileContext provides workflow access to files.",
      "longDescription" : "The FileContext provides workflow access to files. Only files defined in the bootstrap allowFileAccess property can be accessed.",
      "functions" : [ {
        "name" : "copy",
        "description" : "Copies a file from one location to another",
        "returns" : "null"
      }, {
        "name" : "delete",
        "description" : "Delete a file",
        "returns" : "null"
      }, {
        "name" : "list",
        "description" : "Lists the directory",
        "returns" : "string"
      }, {
        "name" : "move",
        "description" : "Moves a file from one location to another",
        "returns" : "null"
      }, {
        "name" : "read",
        "description" : "Read the contents of the file as a string",
        "returns" : "string"
      }, {
        "name" : "reader",
        "description" : "Creates a byte reader on the contents of the file",
        "returns" : "ByteReader"
      }, {
        "name" : "write",
        "description" : "Write the string contents to a file",
        "returns" : "null"
      }, {
        "name" : "writeBinary",
        "description" : "Write the binary contents from the byte buffer to a file",
        "returns" : "null"
      } ]
    },
    "JavascriptContext" : {
      "description" : "This is the entry point to the agent functionality from javascript.",
      "longDescription" : "This is the entry point to the agent functionality from javascript.",
      "functions" : [ {
        "name" : "addSplitReturnItem",
        "description" : "When the current step is a \"scripted-split-aggregate\" type (see Step) the processed item must be added to the returned aggregate using this method.",
        "returns" : "null"
      }, {
        "name" : "addSystemError",
        "description" : "Adds an error not intended for a user outside the agent. It will also mark the context as in an error state. System errors would generally be thrown or handled.",
        "returns" : "null"
      }, {
        "name" : "addUserError",
        "description" : "Adds an error intended for a user outside the agent. It will also mark the context as in an error state. User errors would generally make their way to a human.",
        "returns" : "null"
      }, {
        "name" : "agentControl",
        "description" : "Obtain an Agent Control context for influencing the agent lifecycle. This is currently in beta and not supported",
        "returns" : "AgentControlContext"
      }, {
        "name" : "bytes",
        "description" : "Obtain a Byte context for working with bytes",
        "returns" : "ByteContext"
      }, {
        "name" : "counter",
        "description" : "Atomically add to (or subtract from) a thread safe atomic counter and return the updated value To just get the value pass 0 for the add parameter add",
        "returns" : "number"
      }, {
        "name" : "crypto",
        "description" : "Obtain a Cryptography context for working with cryptography",
        "returns" : "CryptoContext"
      }, {
        "name" : "delta",
        "description" : "Returns the differences between the current value and the last value stored for given key",
        "returns" : "number"
      }, {
        "name" : "diagnostic",
        "description" : "Obtain a Trace context for adding data to sent traces",
        "returns" : "DiagnosticsContext"
      }, {
        "name" : "diagnosticLog",
        "description" : "Write a diagnostic log. This will only be emitted in development mode, or in Production mode if the step is enabled via a \"enableDiagnostics\" message",
        "returns" : "null"
      }, {
        "name" : "end",
        "description" : "Terminates the running flow and returns immediately.",
        "returns" : "null"
      }, {
        "name" : "files",
        "description" : "Request access to the bootstrap file permission",
        "returns" : "FilesContext"
      }, {
        "name" : "getAllErrors",
        "description" : "Retrieves a list of all error messages associated with the current context.",
        "returns" : "array"
      }, {
        "name" : "getBody",
        "description" : "A shorthand for: check getMessageBodyAsString()then check getPassedMessageAsString() @return the contents eiter passed into the step or set by the step.",
        "returns" : "string"
      }, {
        "name" : "getData",
        "description" : "",
        "returns" : "string"
      }, {
        "name" : "getFirstError",
        "description" : "Retrieves the first error message from a given list of errors, if available.",
        "returns" : "string"
      }, {
        "name" : "getHeader",
        "description" : "Get a header from the previous request/response - note: it always returns an array string",
        "returns" : "string"
      }, {
        "name" : "getMessageBodyAsString",
        "description" : "Get the current message body, this could be the response from an http call for example",
        "returns" : "string"
      }, {
        "name" : "getPassedMessageAsString",
        "description" : "Get the message body that was passed to this step.",
        "returns" : "string"
      }, {
        "name" : "getPersistedItem",
        "description" : "Gets an item from the step persistence",
        "returns" : "string"
      }, {
        "name" : "getProperty",
        "description" : "Gets a property from this running context",
        "returns" : "object"
      }, {
        "name" : "getStepProperties",
        "description" : "Returns the set properties for the Step. These properties will persist after requests but not over config reloads/restarts",
        "returns" : "object"
      }, {
        "name" : "getStream",
        "description" : "Get the stream on the context.",
        "returns" : "ByteReader"
      }, {
        "name" : "getSystemErrors",
        "description" : "Retrieves a list of system-specific error messages associated with the current context.",
        "returns" : "array"
      }, {
        "name" : "getTimestamp",
        "description" : "Get the current UTC timestamp (note that the timestamp might be set by a test or other mechanism) in milliseconds since 1970-01-01T00:00:00Z (UTC)",
        "returns" : "integer"
      }, {
        "name" : "getTimestampManager",
        "description" : "The timestamp manager allows for persistence of timestamps",
        "returns" : "TimestampManager"
      }, {
        "name" : "getUserErrors",
        "description" : "Retrieves a list of user-specific error messages associated with the current context.",
        "returns" : "array"
      }, {
        "name" : "hasSystemErrors",
        "description" : "Checks if there are any system-specific errors in the current context.",
        "returns" : "boolean"
      }, {
        "name" : "hasUserErrors",
        "description" : "Checks if there are any user-specific errors in the current context.",
        "returns" : "boolean"
      }, {
        "name" : "hash",
        "description" : "Note : This is a non-cryptographic hash and is intended to be used for obfuscation. When hashing a value, the original and the hash are emitted to the log to be referred to at a later date. The hash can be used in metrics etc so that the original value is not transmitted. The intention is that the raw value can remain in the originating network and the hash value can be transmitted out of network.",
        "returns" : "string"
      }, {
        "name" : "isErrored",
        "description" : "Indicates whether the current context is in an errored state.",
        "returns" : "boolean"
      }, {
        "name" : "jsonPath",
        "description" : "Returns the result from a JSONPath expression",
        "returns" : "string"
      }, {
        "name" : "licensing",
        "description" : "Obtain licensing information. This is currently a BETA feature and is unsupported.",
        "returns" : "LicensingContext"
      }, {
        "name" : "mergeJsonStrings",
        "description" : "Returns a merged json string",
        "returns" : "string"
      }, {
        "name" : "queue",
        "description" : "Returns the high performance persistent queue",
        "returns" : "PersistentQueueContext"
      }, {
        "name" : "regexMatch",
        "description" : "Returns the regex matches",
        "returns" : "array"
      }, {
        "name" : "removeAllHeaders",
        "description" : "Remove all headers from the current state",
        "returns" : "null"
      }, {
        "name" : "removeHeader",
        "description" : "Remove a header from the current state",
        "returns" : "null"
      }, {
        "name" : "sendMetric",
        "description" : "Send a metric",
        "returns" : "null"
      }, {
        "name" : "sendToStep",
        "description" : "Send a message to another step and return a completed context upon completion",
        "returns" : "JavascriptStateContext"
      }, {
        "name" : "sendToStepAndForget",
        "description" : "Send a message to another step and returns immediately. The step called will be processed in another thread, and you will not be able to access to the result.",
        "returns" : "null"
      }, {
        "name" : "setBody",
        "description" : "An alias for setMessage(...)",
        "returns" : "null"
      }, {
        "name" : "setCounter",
        "description" : "Atomically set the counter to an absolute value",
        "returns" : "null"
      }, {
        "name" : "setData",
        "description" : "Set the JSON data for this step",
        "returns" : "null"
      }, {
        "name" : "setHeader",
        "description" : "Add a header to the next http request",
        "returns" : "null"
      }, {
        "name" : "setHttpMethod",
        "description" : "Set the HTTP method for the next http action This is generally used when a method other than the default is required. The HTTP method will default to GET unless there is a payload body then it will default to POST",
        "returns" : "null"
      }, {
        "name" : "setHttpMultipartType",
        "description" : "Enables multipart HTTP requests and sets the content type and part names.",
        "returns" : "null"
      }, {
        "name" : "setMessage",
        "description" : "Sets the message body for this running exchange",
        "returns" : "null"
      }, {
        "name" : "setPersistedItem",
        "description" : "Sets an item to the step persistence",
        "returns" : "null"
      }, {
        "name" : "setProperty",
        "description" : "Sets a property onto this running context to be available in downstream step execution This differs from setPersistedItem in that setPersistedItem sets onto the STEP to be available on THIS STEP in future runs, while setProperty makes an item available to OTHER steps",
        "returns" : "null"
      }, {
        "name" : "setStream",
        "description" : "Sets the body content from the provided byte buffer. @param reader name containing the body content to be set",
        "returns" : "null"
      }, {
        "name" : "setStreamFromString",
        "description" : "Sets a stream from a string",
        "returns" : "null"
      }, {
        "name" : "setUrl",
        "description" : "Set the url for the next http action with reference to a named host The path can start with a / even if the named host ends in a / - the result will be a single '/'",
        "returns" : "null"
      }, {
        "name" : "sleep",
        "description" : "Force the currently running script to sleep for the given milliseconds",
        "returns" : "null"
      }, {
        "name" : "xmlToJson",
        "description" : "Returns a json string from an xml string",
        "returns" : "string"
      } ]
    },
    "JavascriptStateContext" : {
      "description" : "The Javascript State Context is a reduced version of the JavascriptContext containing readonly functions.",
      "longDescription" : "The Javascript State Context is a reduced version of the JavascriptContext containing readonly functions. This context is returned from context.sendToStep(..) and contains the completed context of the step that was sent to.",
      "functions" : [ {
        "name" : "getAllErrors",
        "description" : "Retrieves a list of all error messages associated with the current context.",
        "returns" : "array"
      }, {
        "name" : "getBody",
        "description" : "A shorthand for: check getMessageBodyAsString()then check getPassedMessageAsString() @return the contents eiter passed into the step or set by the step.",
        "returns" : "string"
      }, {
        "name" : "getFirstError",
        "description" : "Retrieves the first error message from a given list of errors, if available.",
        "returns" : "string"
      }, {
        "name" : "getMessageBodyAsString",
        "description" : "Get the current message body, this could be the response from an http call for example",
        "returns" : "string"
      }, {
        "name" : "getProperty",
        "description" : "Gets a property from this running context",
        "returns" : "object"
      }, {
        "name" : "getStepProperties",
        "description" : "Returns the set properties for the Step. These properties will persist after requests but not over config reloads/restarts",
        "returns" : "object"
      }, {
        "name" : "getSystemErrors",
        "description" : "Retrieves a list of system-specific error messages associated with the current context.",
        "returns" : "array"
      }, {
        "name" : "getUserErrors",
        "description" : "Retrieves a list of user-specific error messages associated with the current context.",
        "returns" : "array"
      }, {
        "name" : "hasSystemErrors",
        "description" : "Checks if there are any system-specific errors in the current context.",
        "returns" : "boolean"
      }, {
        "name" : "hasUserErrors",
        "description" : "Checks if there are any user-specific errors in the current context.",
        "returns" : "boolean"
      }, {
        "name" : "isErrored",
        "description" : "Indicates whether the current context is in an errored state.",
        "returns" : "boolean"
      } ]
    },
    "LicensingContext" : {
      "description" : "Obtain licensing information.",
      "longDescription" : "Obtain licensing information. This is currently a BETA feature and is unsupported.",
      "functions" : [ {
        "name" : "isRegistered",
        "description" : "",
        "returns" : "boolean"
      } ]
    },
    "PersistentQueueContext" : {
      "description" : "A high performance implementation of persistent FIFO queue.",
      "longDescription" : "A high performance implementation of persistent FIFO queue. The persistence context is got via context.queue(). Once the queue is obtained, items can be added and removed over multiple runs. The queue will store a small amount of items in memory and overflow to disk. Queue items will persist over agent restarts.",
      "functions" : [ {
        "name" : "push",
        "description" : "Add an item to the end of the persistent queue.",
        "returns" : "null"
      }, {
        "name" : "pushArray",
        "description" : "Add the contents of an array of item to the end of the persistent queue.",
        "returns" : "null"
      }, {
        "name" : "returnArray",
        "description" : "Return the array items to the head of the queue",
        "returns" : "null"
      }, {
        "name" : "returnItem",
        "description" : "Return the item to the head of the queue",
        "returns" : "null"
      }, {
        "name" : "take",
        "description" : "Request the given amount of items from the queue or an empty array when no items available. NOTE: the returned amount may not be the entire available items. The method should be called repeatedly until the desired amount is collected. This function waits for a short period for data to be loaded from file and may not load all the data.",
        "returns" : "array"
      } ]
    }
  }
}