/** * State object * @typedef {Object} HttpState * @property data - the parsed response body * @property response - the response from the HTTP server, including headers, statusCode, body, etc * @property references - an array of all previous data objects used in the Job **/ /** * Options provided to the HTTP request * @typedef {Object} RequestOptions * @public * @property {object} query - An object of query parameters to be encoded into the URL. */ /** * Make a GET request * @example * http.get("consulta"); * @function * @public * @param {string} path - Path to resource * @param {RequestOptions} options - Optional request options * @returns {Operation} * @state {HttpState} */ export function get(path: string, options: RequestOptions): Operation; /** * Make a general HTTP request * @example * http.request("GET", "consulta", query: { nombre: 'felipe' },); * @function * @public * @param {string} method - HTTP method to use * @param {string} path - Path to resource * @param {object} body - Object which will be attached to the request body * @param {RequestOptions} options - Optional request options * @returns {Operation} * @state {HttpState} */ export function request(method: string, path: string, body: object, options?: RequestOptions): Operation; /** * State object */ export type HttpState = { /** * - the parsed response body */ data: any; /** * - the response from the HTTP server, including headers, statusCode, body, etc */ response: any; /** * - an array of all previous data objects used in the Job */ references: any; }; /** * Options provided to the HTTP request */ export type RequestOptions = any;