rqlite-js 2.5.5 → 2.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es6/http-request/index.js +39 -7
- package/lib/api/backup/index.js +10 -9
- package/lib/api/backup/index.js.map +1 -1
- package/lib/api/client/index.js +10 -9
- package/lib/api/client/index.js.map +1 -1
- package/lib/api/data/index.js +8 -7
- package/lib/api/data/index.js.map +1 -1
- package/lib/api/results/data-result-error.js +2 -1
- package/lib/api/results/data-result-error.js.map +1 -1
- package/lib/api/results/data-result.js +42 -41
- package/lib/api/results/data-result.js.map +1 -1
- package/lib/api/results/data-results.js +20 -19
- package/lib/api/results/data-results.js.map +1 -1
- package/lib/api/results/index.js.map +1 -1
- package/lib/api/status/index.js +6 -5
- package/lib/api/status/index.js.map +1 -1
- package/lib/http-request/content-types.js.map +1 -1
- package/lib/http-request/errors.js +2 -1
- package/lib/http-request/errors.js.map +1 -1
- package/lib/http-request/http-methods.js.map +1 -1
- package/lib/http-request/index.js +156 -123
- package/lib/http-request/index.js.map +1 -1
- package/lib/http-request/retryable.js +4 -3
- package/lib/http-request/retryable.js.map +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/package.json +17 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["DEAULT_TIMEOUT","DEAULT_RETRY_DELAY","createDefaultHeaders","headers","Accept","CONTENT_TYPE_APPLICATION_JSON","cleanPath","path","String","replace","getWaitTimeExponential","attempt","base","pow","HttpRequest","constructor","hosts","options","RETRYABLE_ERROR_CODES","RETRYABLE_STATUS_CODES","RETRYABLE_HTTP_METHODS","Map","setHosts","getTotalHosts","Error","activeHostRoundRobin","httpAgent","httpsAgent","retryableErrorCodes","retryableStatusCodes","retryableHttpMethods","exponentailBackoffBase","authentication","username","password","set","setActiveHostRoundRobin","setHttpAgent","setHttpsAgent","Set","Array","isArray","setRetryableErrorCodes","setRetryableStatusCodes","setRetryableHttpMethods","Number","isFinite","setExponentailBackoffBase","setAuthentication","getExponentailBackoffBase","getRetryableErrorCodes","getRetryableStatusCodes","getRetryableHttpMethods","getHttpAgent","getHttpsAgent","split","reduce","acc","v","host","trim","concat","getHosts","findHostIndex","parsedHostToFind","findIndex","parsedHost","every","field","getActiveHost","useLeader","activeHostIndex","getLeaderHostIndex","getActiveHostIndex","setActiveHostIndex","totalHosts","leaderHostIndex","setLeaderHostIndex","getActiveHostRoundRobin","getNextActiveHostIndex","nextIndex","setNextActiveHostIndex","length","uriIsAbsolute","uri","absoluteUriPattern","test","requestIsRetryable","statusCode","errorCode","httpMethod","has","fetch","body","HTTP_METHOD_GET","query","stream","timeout","retries","maxRedirects","retryAttempt","redirectAttempt","attemptHostIndex","activeHost","auth","size","get","response","url","data","responseType","method","params","paramsSerializer","arrayFormat","status","e","code","responseStatus","responseHeaders","retryable","nextAttemptHostIndex","location","undefined","newLeaderHostIndex","waitTime","delayPromise","Promise","resolve","setTimeout","post","HTTP_METHOD_POST"],"sources":["../../es6/http-request/index.js"],"sourcesContent":["/**\n * Plain HTTP client to be used when creating RQLite specific API HTTP clients\n * @module http-request\n */\nimport axios from 'axios'\nimport { stringify as stringifyQuery } from 'qs'\nimport { parse as parseUrl } from 'url'\nimport {\n HTTP_METHOD_GET,\n HTTP_METHOD_POST,\n} from './http-methods'\nimport {\n CONTENT_TYPE_APPLICATION_JSON,\n // CONTENT_TYPE_APPLICATION_OCTET_STREAM,\n} from './content-types'\nimport { ERROR_HTTP_REQUEST_MAX_REDIRECTS } from './errors'\nimport {\n RETRYABLE_ERROR_CODES,\n RETRYABLE_HTTP_METHODS,\n RETRYABLE_STATUS_CODES,\n} from './retryable'\n\n/**\n * RQliteJS HTTP Request options\n * @typedef HttpRequestOptions\n * @type {Object}\n * @property {Object} [auth] A object for user authentication\n * @property {String} [auth.username] The username for authentication\n * @property {String} [auth.password] The username for authentication\n * @property {Object} [body] The body of the HTTP request\n * @property {Object} [headers={}] HTTP headers to send with the request\n * @property {String} [httpMethod=HTTP_METHOD_GET] The HTTP method for the request\n * i.e. GET or POST\n * @property {Object} [query] An object with the query to send with the HTTP request\n * @property {Boolean} [stream=false] When true the returned value is a request object with\n * stream support instead of a request-promise result\n * @property {Number} [timeout=DEAULT_TIMEOUT] Optional timeout to override default\n * @property {String} uri The uri for the request which can be a relative path to use\n * the currently active host or a full i.e. http://localhost:4001/db/query which is used\n * literally\n * @property {Boolean} [useLeader=false] When true the request will use the master host, the\n * first host in this.hosts, this is ideal for write operations to skip the redirect\n * @property {Number} [retries] The number of retries, defaults to the number of\n * hosts times 3\n * @property {Number} [maxRedirects=10] The maximum number of HTTP redirects to follow before\n * throwing an error\n * @property {Number} [attempt=0] The current attempt count when retrying or redirecting\n * @property {Number} [retryAttempt=0] The current attempt based on retry logic\n * @property {Number} [redirectAttempt=0] The current attempt based on redirect logic\n * @property {Number} [attemptHostIndex] When in a retry state the host index of the last\n * attempt which is used to get the next host index\n * @property {import('http').Agent} [httpAgent] An option http agent, useful for\n * keepalive pools using plain HTTP\n * @property {import('https').Agent} [httpsAgent] An option http agent, useful\n * for keepalive pools using SSL\n */\n\n/**\n * The default timeout value\n */\nexport const DEAULT_TIMEOUT = 30000\n\n/**\n * The default to retry a request using the next host in the chain\n */\nexport const DEAULT_RETRY_DELAY = 30000\n\n/**\n * Create default header for all HTTP requests\n * @param {Object} [headers={}] HTTP headers to send with the request\n * @returns {Object} The headers with defaults applied\n */\nexport function createDefaultHeaders (headers = {}) {\n const { Accept = CONTENT_TYPE_APPLICATION_JSON } = headers\n return { ...headers, Accept }\n}\n\n/**\n * Clean the request path remove / from the beginning\n * @param {String} path The path to clean\n * @returns {String} The clean path\n */\nfunction cleanPath (path) {\n return String(path).replace(/^\\//, '')\n}\n\n/**\n * Returns the next wait interval, in milliseconds, using an exponential\n * backoff algorithm.\n * @param {Number} attempt The retry attempt\n * @param {Number} base The base of the exponential backoff\n * @param {Number} pow The exponential power\n * @returns {Number} The time to wait in milliseconds\n */\nexport function getWaitTimeExponential (attempt = 0, base = 100, pow = 2) {\n if (attempt === 0) {\n return 0\n }\n return (pow ** attempt) * base\n}\n\n/**\n * Generic HTTP Request class which all RQLiteJS client\n * should extend for consistent communitication with an RQLite\n * server\n */\nexport default class HttpRequest {\n /**\n * The index of the host in this.hosts which will be tried\n * first before attempting other hosts\n * @type {Number}\n */\n activeHostIndex = 0\n\n /**\n * Whether or not the setNextActiveHostIndex() should\n * perform a round robin strategy\n */\n activeHostRoundRobin = true\n\n /**\n * The regex pattern to check if a uri is absolute or relative,\n * if it is absolute the host is not appended\n */\n absoluteUriPattern = /^https?:\\/\\//\n\n /**\n * A list of hosts that are tried in round robin fashion\n * when certain HTTP responses are received\n * @type {String[]}\n */\n hosts = []\n\n /**\n * @type {import('http').Agent} The http agent if it is set\n */\n httpAgent\n\n /**\n * @type {import('https').Agent} The https agent if it is set\n */\n httpsAgent\n\n /**\n * The host list index of the leader node defaults\n * to the first host\n * @type {Number}\n */\n leaderHostIndex = 0\n\n /**\n * Http error codes which are considered retryable\n * @type {Set}\n */\n retryableErrorCodes = RETRYABLE_ERROR_CODES\n\n /**\n * Http status codes which are considered retryable\n * @type {Set}\n */\n retryableStatusCodes = RETRYABLE_STATUS_CODES\n\n /**\n * Http methods which are considered retryable\n * @type {Set}\n */\n retryableHttpMethods = RETRYABLE_HTTP_METHODS\n\n /**\n * The exponential backoff base for retries\n */\n exponentailBackoffBase = 100\n\n /**\n * Authentication Map\n * @type {Map}\n * @property {String} username\n * @property {String} password\n */\n authentication = new Map()\n\n /**\n * Construtor for HttpRequest\n * @param {String[]|String} hosts An array of RQLite hosts or a string\n * that will be split on \",\" to create an array of hosts, the first\n * host will be tried first when there are multiple hosts\n * @param {Object} [options={}] Additional options\n * @param {Object} [options.authentication] Authentication options\n * @param {String} [options.authentication.username] The host authentication username\n * @param {String} [options.authentication.password] The host authentication password\n * @param {Boolean} [options.activeHostRoundRobin=true] If true this.setNextActiveHostIndex()\n * will perform a round robin when called\n * @param {import('http').Agent} [options.httpAgent] An option http agent, useful for\n * keepalive pools using plain HTTP\n * @param {import('https').Agent} [options.httpsAgent] An option http agent, useful\n * for keepalive pools using SSL\n * @param {Set|String[]} [options.retryableErrorCodes] The list of retryable error codes\n * @param {Set|Number[]} [options.retryableStatusCodes] The list of retryable http status codes\n * @param {Set|String[]} [options.retryableHttpMethods] The list of retryable http methods\n * @param {Number} [options.exponentailBackoffBase] The value for exponentail backoff base\n * for retry exponential backoff\n */\n constructor (hosts, options = {}) {\n this.setHosts(hosts)\n if (this.getTotalHosts() === 0) {\n throw new Error('At least one host must be provided')\n }\n const {\n activeHostRoundRobin = true,\n httpAgent,\n httpsAgent,\n retryableErrorCodes,\n retryableStatusCodes,\n retryableHttpMethods,\n exponentailBackoffBase,\n authentication,\n } = options\n if (typeof authentication === 'object') {\n const { username, password } = authentication\n if (username) {\n this.authentication.set('username', username)\n }\n if (password) {\n this.authentication.set('password', password)\n }\n }\n if (typeof activeHostRoundRobin !== 'undefined') {\n this.setActiveHostRoundRobin(activeHostRoundRobin)\n }\n if (typeof httpAgent !== 'undefined') {\n this.setHttpAgent(httpAgent)\n }\n if (typeof httpsAgent !== 'undefined') {\n this.setHttpsAgent(httpsAgent)\n }\n if (retryableErrorCodes instanceof Set || Array.isArray(retryableErrorCodes)) {\n this.setRetryableErrorCodes(\n Array.isArray(retryableErrorCodes) ? Set(retryableErrorCodes) : retryableErrorCodes,\n )\n }\n if (retryableStatusCodes instanceof Set || Array.isArray(retryableStatusCodes)) {\n this.setRetryableStatusCodes(\n Array.isArray(retryableStatusCodes) ? Set(retryableStatusCodes) : retryableStatusCodes,\n )\n }\n if (retryableHttpMethods instanceof Set || Array.isArray(retryableHttpMethods)) {\n this.setRetryableHttpMethods(\n Array.isArray(retryableHttpMethods) ? Set(retryableHttpMethods) : retryableHttpMethods,\n )\n }\n if (Number.isFinite(exponentailBackoffBase)) {\n this.setExponentailBackoffBase(exponentailBackoffBase)\n }\n }\n\n /**\n * Set authentication information\n * @param {Object} [authentication] Authentication data\n * @param {String} [authentication.username] The host authentication username\n * @param {String} [authentication.password] The host authentication password\n */\n setAuthentication (authentication = {}) {\n const { username, password } = authentication\n if (username) {\n this.authentication.set('username', username)\n }\n if (password) {\n this.authentication.set('password', password)\n }\n }\n\n /**\n * Set the exponentail backoff base\n * @param {Number} exponentailBackoffBase\n */\n setExponentailBackoffBase (exponentailBackoffBase) {\n this.exponentailBackoffBase = exponentailBackoffBase\n }\n\n /**\n * Get the exponentail backoff base\n * @return {Number} The exponentail backoff base\n */\n getExponentailBackoffBase () {\n return this.exponentailBackoffBase\n }\n\n /**\n * Set the retryable error codes\n * @param {Set} retryableErrorCodes\n */\n setRetryableErrorCodes (retryableErrorCodes) {\n this.retryableErrorCodes = retryableErrorCodes\n }\n\n /**\n * Get the retryable error codes\n * @returns {Set}\n */\n getRetryableErrorCodes () {\n return this.retryableErrorCodes\n }\n\n /**\n * Set the retryable status codes\n * @param {Set} retryableStatusCodes\n */\n setRetryableStatusCodes (retryableStatusCodes) {\n this.retryableStatusCodes = retryableStatusCodes\n }\n\n /**\n * Get the retryable status codes\n * @returns {Set}\n */\n getRetryableStatusCodes () {\n return this.retryableStatusCodes\n }\n\n /**\n * Set the retryable http methods\n * @param {Set} retryableHttpMethods\n */\n setRetryableHttpMethods (retryableHttpMethods) {\n this.retryableHttpMethods = retryableHttpMethods\n }\n\n /**\n * Get the retryable http methods\n * @returns {Set}\n */\n getRetryableHttpMethods () {\n return this.retryableHttpMethods\n }\n\n /**\n * Set an http agent which is useful for http keepalive requests\n * @param {import('http').Agent} httpAgent An http agent\n */\n setHttpAgent (httpAgent) {\n this.httpAgent = httpAgent\n }\n\n /**\n * Get the set http agent\n * @returns {import('http').Agent|undefined} The https agent if it is set\n */\n getHttpAgent () {\n return this.httpAgent\n }\n\n /**\n * Set an https agent which is useful for https keepalive requests\n * @param {import('https').Agent} httpsAgent An https agent\n */\n setHttpsAgent (httpsAgent) {\n this.httpsAgent = httpsAgent\n }\n\n /**\n * Get the set https agent\n * @returns {import('https').Agent|undefined} The https agent if it is set\n */\n getHttpsAgent () {\n return this.httpsAgent\n }\n\n /**\n * Set the list of hosts\n * @param {String[]|String} hosts An array of RQLite hosts or a string\n * that will be split on \",\" to create an array of hosts, the first\n * host will be tried first when there are multiple hosts\n */\n setHosts (hosts) {\n this.hosts = !Array.isArray(hosts) ? String(hosts).split(',') : hosts\n this.hosts = this.hosts.reduce((acc, v) => {\n // Remove trailing slashed from hosts\n const host = String(v).trim().replace(/\\/$/, '')\n if (!host) {\n return acc\n }\n return acc.concat(host)\n }, [])\n }\n\n /**\n * Get the list of hosts\n * @returns {String[]} The list of hosts\n */\n getHosts () {\n return this.hosts\n }\n\n /**\n * Given a host string find the index of that host in the hosts\n * @param {String} host A host to find in hosts\n * @returns {Number} The found host index or -1 if not found\n */\n findHostIndex (host) {\n const parsedHostToFind = parseUrl(host)\n return this.getHosts().findIndex((v) => {\n const parsedHost = parseUrl(v)\n // Find a host where all the parsed fields match the requested host\n return ['hostname', 'protocol', 'port', 'path'].every((field) => parsedHostToFind[field] === parsedHost[field])\n })\n }\n\n /**\n * Get the current active host from the hosts array\n * @param {Boolean} useLeader If true use the first host which is always\n * the master, this is prefered for write operations\n * @returns {String} The active host\n */\n getActiveHost (useLeader) {\n // When useLeader is true we should just use the first host\n const activeHostIndex = useLeader ? this.getLeaderHostIndex() : this.getActiveHostIndex()\n return this.getHosts()[activeHostIndex]\n }\n\n /**\n * Set the active host index with check based on this.hosts\n * @param {Number} activeHostIndex The index\n * @returns {Number} The active host index\n */\n setActiveHostIndex (activeHostIndex) {\n if (!Number.isFinite(activeHostIndex)) {\n throw new Error('The activeHostIndex should be a finite number')\n }\n const totalHosts = this.getTotalHosts()\n if (activeHostIndex < 0) {\n // Don't allow an index less then zero\n this.activeHostIndex = 0\n } else if (activeHostIndex >= totalHosts) {\n // Don't allow an index greater then the length of the hosts\n this.activeHostIndex = totalHosts - 1\n } else {\n this.activeHostIndex = activeHostIndex\n }\n return this.activeHostIndex\n }\n\n /**\n * Get the host index for the leader node\n * @returns {Number} The host index for the leader node\n */\n getLeaderHostIndex () {\n return this.leaderHostIndex\n }\n\n /**\n * Set the index in the host array for the leader node\n * @param {Number} leaderHostIndex The index of the host that is the leader node\n * @returns {Number} The host index for the leader node\n */\n setLeaderHostIndex (leaderHostIndex) {\n if (!Number.isFinite(leaderHostIndex)) {\n throw new Error('The leaderHostIndex should be a finite number')\n }\n const totalHosts = this.getTotalHosts()\n if (leaderHostIndex < 0) {\n this.leaderHostIndex = 0\n } else if (leaderHostIndex > totalHosts) {\n this.leaderHostIndex = totalHosts - 1\n } else {\n this.leaderHostIndex = leaderHostIndex\n }\n return this.leaderHostIndex\n }\n\n /**\n * Get the active host index\n * @returns {Number} The active host index\n */\n getActiveHostIndex () {\n return this.activeHostIndex\n }\n\n /**\n * Set active host round robin value\n * @param {Boolean} activeHostRoundRobin If true setActiveHostIndex() will\n * perform a round robin\n */\n setActiveHostRoundRobin (activeHostRoundRobin) {\n if (typeof activeHostRoundRobin !== 'boolean') {\n throw new Error('The activeHostRoundRobin argument must be boolean')\n }\n this.activeHostRoundRobin = activeHostRoundRobin\n }\n\n /**\n * Get active host round robin value\n * @returns {Boolean} The value of activeHostRoundRobin\n */\n getActiveHostRoundRobin () {\n return this.activeHostRoundRobin\n }\n\n /**\n * Get the next active host index\n * @param {Number} [activeHostIndex] An optional paramater to provide the active host index\n * @returns {Number} The next active host index which will wrap around to zero\n */\n getNextActiveHostIndex (activeHostIndex = this.getActiveHostIndex()) {\n const totalHosts = this.getTotalHosts()\n const nextIndex = activeHostIndex + 1\n // If we are past the last index start back over at 1\n if (totalHosts === nextIndex) {\n return 0\n }\n return nextIndex\n }\n\n /**\n * Set the active host index to the next host using a\n * round robin strategy\n */\n setNextActiveHostIndex () {\n // Don't bother if we only have one host\n if (!this.getActiveHostRoundRobin()) {\n return\n }\n const totalHosts = this.getTotalHosts()\n if (this.getActiveHostRoundRobin() && totalHosts <= 1) {\n return\n }\n this.setActiveHostIndex(this.getNextActiveHostIndex())\n }\n\n /**\n * Get the total number of hosts\n * @returns {Number} The total number of hosts\n */\n getTotalHosts () {\n return this.getHosts().length\n }\n\n /**\n * Returns whether or not the uri passes a test for this.absoluteUriPattern\n * @returns {Boolean} True if the path is absolute\n */\n uriIsAbsolute (uri) {\n return this.absoluteUriPattern.test(uri)\n }\n\n /**\n * Returns true when the HTTP request is retryable\n * @param {Object} options The options\n * @param {Number} options.statusCode The HTTP status code\n * @param {String} options.errorCode The error code\n * @param {String} options.httpMethod The http method\n * @returns {Boolean} True if the request is retry able\n */\n requestIsRetryable (options = {}) {\n const {\n statusCode,\n errorCode,\n httpMethod,\n } = options\n // Honor strictly the http method\n if (!this.getRetryableHttpMethods().has(httpMethod)) {\n return false\n }\n if (statusCode && this.getRetryableStatusCodes().has(statusCode)) {\n return true\n }\n if (errorCode && this.getRetryableErrorCodes().has(errorCode)) {\n return true\n }\n return false\n }\n\n /**\n * Perform an HTTP request using the provided options\n * @param {HttpRequestOptions} [options={}] Options for the HTTP client\n * @returns {Promise<{status: Number, body: Object|String}>} An object with a status and body\n * property when stream is false and a stream when the stream option is true\n * @throws {ERROR_HTTP_REQUEST_MAX_REDIRECTS} When the maximum number of redirect has been reached\n */\n async fetch (options = {}) {\n const {\n body,\n headers = {},\n httpMethod = HTTP_METHOD_GET,\n query,\n stream = false,\n timeout = DEAULT_TIMEOUT,\n useLeader = false,\n retries = this.getTotalHosts() * 3,\n maxRedirects = 10,\n attempt = 0,\n retryAttempt = 0,\n redirectAttempt = 0,\n attemptHostIndex,\n exponentailBackoffBase = this.getExponentailBackoffBase(),\n httpAgent = this.getHttpAgent(),\n httpsAgent = this.getHttpsAgent(),\n } = options\n // Honor the supplied attemptHostIndex or get the active host\n const activeHost = Number.isFinite(attemptHostIndex) ? this.getHosts()[attemptHostIndex]\n : this.getActiveHost(useLeader)\n let { uri } = options\n if (!uri) {\n throw new Error('The uri option is required')\n }\n uri = this.uriIsAbsolute(uri) ? uri : `${activeHost}/${cleanPath(uri)}`\n try {\n let auth\n if (this.authentication.size) {\n auth = {\n username: this.authentication.get('username'),\n password: this.authentication.get('password'),\n }\n }\n const response = await axios({\n url: uri,\n auth,\n data: body,\n maxRedirects: 0, // Handle redirects manually to allow reposting data\n headers: createDefaultHeaders(headers),\n responseType: stream ? 'stream' : 'json',\n method: httpMethod,\n params: query,\n timeout,\n httpsAgent,\n httpAgent,\n paramsSerializer (params) {\n return stringifyQuery(params, { arrayFormat: 'brackets' })\n },\n })\n if (stream) {\n return response.data\n }\n return {\n body: response.data,\n status: response.status,\n }\n } catch (e) {\n const { response = {}, code: errorCode } = e\n const { status: responseStatus, headers: responseHeaders = {} } = response\n // Check if the error was a redirect\n const retryable = this.requestIsRetryable({\n statusCode: responseStatus,\n errorCode,\n httpMethod,\n })\n // Save the next active host index and pass it to retry manually\n let nextAttemptHostIndex = Number.isFinite(attemptHostIndex) ? attemptHostIndex\n : this.getActiveHostIndex()\n nextAttemptHostIndex += 1\n // We go past the last index start from zero\n if (nextAttemptHostIndex === this.getTotalHosts()) {\n nextAttemptHostIndex = 0\n }\n // First check if this is a redirect error\n if (responseStatus === 301 || responseStatus === 302) {\n // We maxed out on redirect attempts\n if (redirectAttempt >= maxRedirects) {\n throw ERROR_HTTP_REQUEST_MAX_REDIRECTS(`The maximum number of redirects ${maxRedirects} has been reached`)\n }\n const location = typeof responseHeaders === 'object' ? responseHeaders.location : undefined\n // If we were asked to use the leader, but got redirect the leader moved so remember it\n if (useLeader) {\n const newLeaderHostIndex = this.findHostIndex(location)\n // If the redirect exists in the hosts list remember it for next time\n if (newLeaderHostIndex > -1) {\n this.setLeaderHostIndex(newLeaderHostIndex)\n }\n }\n return this.fetch({\n ...options,\n uri: location,\n attempt: attempt + 1,\n redirectAttempt: redirectAttempt + 1,\n attemptHostIndex: nextAttemptHostIndex,\n })\n }\n if (retryable && retryAttempt < retries) {\n const waitTime = getWaitTimeExponential(retryAttempt, exponentailBackoffBase)\n const delayPromise = new Promise((resolve) => {\n setTimeout(resolve, waitTime)\n })\n await delayPromise\n return this.fetch({\n ...options,\n attempt: attempt + 1,\n retryAttempt: retryAttempt + 1,\n attemptHostIndex: nextAttemptHostIndex,\n })\n }\n throw e\n }\n }\n\n /**\n * Perform an HTTP GET request\n * @param {HttpRequestOptions} [options={}] The options\n * @see this.fetch() for options\n */\n async get (options = {}) {\n return this.fetch({ ...options, httpMethod: HTTP_METHOD_GET })\n }\n\n /**\n * Perform an HTTP POST request\n * @param {HttpRequestOptions} [options={}] The options\n * @see this.fetch() for options\n */\n async post (options = {}) {\n return this.fetch({ ...options, httpMethod: HTTP_METHOD_POST })\n }\n}\n"],"mappings":";;;;AAIA;AACA;AACA;AACA;;;;AAIA;;;;AAIA;AACA,wC;;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACO,MAAMA,cAAc,GAAG,KAAvB;;AAEP;AACA;AACA,G;AACO,MAAMC,kBAAkB,GAAG,KAA3B;;AAEP;AACA;AACA;AACA;AACA,G;AACO,SAASC,oBAAT,CAA+BC,OAAO,GAAG,EAAzC,EAA6C;EAClD,wBAAmDA,OAAnD,CAAQC,MAAR,CAAQA,MAAR,gCAAiBC,2CAAjB;EACA,uCAAYF,OAAZ,SAAqBC,MAArB;AACD;;AAED;AACA;AACA;AACA;AACA;AACA,SAASE,SAAT,CAAoBC,IAApB,EAA0B;EACxB,OAAOC,MAAM,CAACD,IAAD,CAAN,CAAaE,OAAb,CAAqB,KAArB,EAA4B,EAA5B,CAAP;AACD;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,sBAAT,CAAiCC,OAAO,GAAG,CAA3C,EAA8CC,IAAI,GAAG,GAArD,EAA0DC,GAAG,GA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,OAAO,MAAI,CAAC2E,KAAL,iCAAgB3E,OAAhB,SAAyByE,UAAU,EAAEI,4BAArC,IAAP,CADuB;EAExB;;EAED;AACF;AACA;AACA;AACA;EACQoC,IAAI,CAAEjH,OAAO,GAAG,EAAZ,EAAgB;MACxB,OAAO,MAAI,CAAC2E,KAAL,iCAAgB3E,OAAhB,SAAyByE,UAAU,EAAEyC,6BAArC,IAAP,CADwB;EAEzB,CA3lB8B,C"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_axios","_interopRequireDefault","require","_qs","_url","_httpMethods","_contentTypes","_errors","_retryable","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty2","default","getOwnPropertyDescriptors","defineProperties","defineProperty","DEAULT_TIMEOUT","exports","DEAULT_RETRY_DELAY","createDefaultHeaders","headers","_headers$Accept","Accept","CONTENT_TYPE_APPLICATION_JSON","cleanPath","path","String","replace","getWaitTimeExponential","attempt","base","exponent","Math","pow","HttpRequest","constructor","hosts","options","RETRYABLE_ERROR_CODES","RETRYABLE_STATUS_CODES","RETRYABLE_HTTP_METHODS","Map","setHosts","getTotalHosts","Error","_options$activeHostRo","activeHostRoundRobin","httpAgent","httpsAgent","retryableErrorCodes","retryableStatusCodes","retryableHttpMethods","exponentailBackoffExponent","exponentailBackoffBase","authentication","username","password","set","setActiveHostRoundRobin","setHttpAgent","setHttpsAgent","Set","Array","isArray","setRetryableErrorCodes","setRetryableStatusCodes","setRetryableHttpMethods","Number","isFinite","setExponentailBackoffBase","setExponentailBackoffExponent","setAuthentication","getExponentailBackoffBase","getExponentailBackoffExponent","getRetryableErrorCodes","getRetryableStatusCodes","getRetryableHttpMethods","getHttpAgent","getHttpsAgent","split","reduce","acc","v","host","trim","concat","getHosts","findHostIndex","parsedHostToFind","parseUrl","findIndex","parsedHost","every","field","getActiveHost","useLeader","activeHostIndex","getLeaderHostIndex","getActiveHostIndex","setActiveHostIndex","totalHosts","leaderHostIndex","setLeaderHostIndex","getActiveHostRoundRobin","getNextActiveHostIndex","nextIndex","setNextActiveHostIndex","uriIsAbsolute","uri","absoluteUriPattern","test","requestIsRetryable","statusCode","errorCode","httpMethod","has","fetch","_this","_asyncToGenerator2","body","_options$headers","_options$httpMethod","HTTP_METHOD_GET","query","_options$stream","stream","_options$timeout","timeout","_options$useLeader","_options$retries","retries","_options$maxRedirects","maxRedirects","_options$attempt","_options$retryAttempt","retryAttempt","_options$redirectAtte","redirectAttempt","attemptHostIndex","_options$exponentailB","_options$exponentailB2","_options$httpAgent","_options$httpsAgent","activeHost","auth","size","get","response","axios","url","data","responseType","method","params","paramsSerializer","stringifyQuery","arrayFormat","status","e","_e$response","code","responseStatus","_response$headers","responseHeaders","retryable","nextAttemptHostIndex","ERROR_HTTP_REQUEST_MAX_REDIRECTS","location","undefined","newLeaderHostIndex","waitTime","Promise","resolve","setTimeout","_this2","post","_this3","HTTP_METHOD_POST"],"sources":["../../es6/http-request/index.js"],"sourcesContent":["/**\n * Plain HTTP client to be used when creating RQLite specific API HTTP clients\n * @module http-request\n */\nimport axios from 'axios'\nimport { stringify as stringifyQuery } from 'qs'\nimport { parse as parseUrl } from 'url'\nimport {\n HTTP_METHOD_GET,\n HTTP_METHOD_POST,\n} from './http-methods'\nimport {\n CONTENT_TYPE_APPLICATION_JSON,\n // CONTENT_TYPE_APPLICATION_OCTET_STREAM,\n} from './content-types'\nimport { ERROR_HTTP_REQUEST_MAX_REDIRECTS } from './errors'\nimport {\n RETRYABLE_ERROR_CODES,\n RETRYABLE_HTTP_METHODS,\n RETRYABLE_STATUS_CODES,\n} from './retryable'\n\n/**\n * RQliteJS HTTP Request options\n * @typedef HttpRequestOptions\n * @type {Object}\n * @property {Object} [auth] A object for user authentication\n * @property {String} [auth.username] The username for authentication\n * @property {String} [auth.password] The username for authentication\n * @property {Object} [body] The body of the HTTP request\n * @property {Object} [headers={}] HTTP headers to send with the request\n * @property {String} [httpMethod=HTTP_METHOD_GET] The HTTP method for the request\n * i.e. GET or POST\n * @property {Object} [query] An object with the query to send with the HTTP request\n * @property {Boolean} [stream=false] When true the returned value is a request object with\n * stream support instead of a request-promise result\n * @property {Number} [timeout=DEAULT_TIMEOUT] Optional timeout to override default\n * @property {String} uri The uri for the request which can be a relative path to use\n * the currently active host or a full i.e. http://localhost:4001/db/query which is used\n * literally\n * @property {Boolean} [useLeader=false] When true the request will use the master host, the\n * first host in this.hosts, this is ideal for write operations to skip the redirect\n * @property {Number} [retries] The number of retries, defaults to the number of\n * hosts times 3\n * @property {Number} [maxRedirects=10] The maximum number of HTTP redirects to follow before\n * throwing an error\n * @property {Number} [attempt=0] The current attempt count when retrying or redirecting\n * @property {Number} [retryAttempt=0] The current attempt based on retry logic\n * @property {Number} [redirectAttempt=0] The current attempt based on redirect logic\n * @property {Number} [attemptHostIndex] When in a retry state the host index of the last\n * attempt which is used to get the next host index\n * @property {import('http').Agent} [httpAgent] An option http agent, useful for\n * keepalive pools using plain HTTP\n * @property {import('https').Agent} [httpsAgent] An option http agent, useful\n * for keepalive pools using SSL\n */\n\n/**\n * The default timeout value\n */\nexport const DEAULT_TIMEOUT = 30000\n\n/**\n * The default to retry a request using the next host in the chain\n */\nexport const DEAULT_RETRY_DELAY = 30000\n\n/**\n * Create default header for all HTTP requests\n * @param {Object} [headers={}] HTTP headers to send with the request\n * @returns {Object} The headers with defaults applied\n */\nexport function createDefaultHeaders (headers = {}) {\n const { Accept = CONTENT_TYPE_APPLICATION_JSON } = headers\n return { ...headers, Accept }\n}\n\n/**\n * Clean the request path remove / from the beginning\n * @param {String} path The path to clean\n * @returns {String} The clean path\n */\nfunction cleanPath (path) {\n return String(path).replace(/^\\//, '')\n}\n\n/**\n * Returns the next wait interval, in milliseconds, using an exponential\n * backoff algorithm.\n * @param {Number} attempt The retry attempt\n * @param {Number} base The base of the exponential backoff\n * @param {Number} exponent The exponential power\n * @returns {Number} The time to wait in milliseconds\n */\nexport function getWaitTimeExponential (attempt = 0, base = 100, exponent = 2) {\n if (attempt === 0) {\n return 0\n }\n return (exponent ** attempt) * base\n}\n\n/**\n * Generic HTTP Request class which all RQLiteJS client\n * should extend for consistent communitication with an RQLite\n * server\n */\nexport default class HttpRequest {\n /**\n * The index of the host in this.hosts which will be tried\n * first before attempting other hosts\n * @type {Number}\n */\n activeHostIndex = 0\n\n /**\n * Whether or not the setNextActiveHostIndex() should\n * perform a round robin strategy\n */\n activeHostRoundRobin = true\n\n /**\n * The regex pattern to check if a uri is absolute or relative,\n * if it is absolute the host is not appended\n */\n absoluteUriPattern = /^https?:\\/\\//\n\n /**\n * A list of hosts that are tried in round robin fashion\n * when certain HTTP responses are received\n * @type {String[]}\n */\n hosts = []\n\n /**\n * @type {import('http').Agent} The http agent if it is set\n */\n httpAgent\n\n /**\n * @type {import('https').Agent} The https agent if it is set\n */\n httpsAgent\n\n /**\n * The host list index of the leader node defaults\n * to the first host\n * @type {Number}\n */\n leaderHostIndex = 0\n\n /**\n * Http error codes which are considered retryable\n * @type {Set}\n */\n retryableErrorCodes = RETRYABLE_ERROR_CODES\n\n /**\n * Http status codes which are considered retryable\n * @type {Set}\n */\n retryableStatusCodes = RETRYABLE_STATUS_CODES\n\n /**\n * Http methods which are considered retryable\n * @type {Set}\n */\n retryableHttpMethods = RETRYABLE_HTTP_METHODS\n\n /**\n * The exponential backoff base for retries\n */\n exponentailBackoffBase = 100\n\n /**\n * The exponent to increase backoff each try\n */\n exponentailBackoffExponent = 1.1\n\n /**\n * Authentication Map\n * @type {Map}\n * @property {String} username\n * @property {String} password\n */\n authentication = new Map()\n\n /**\n * Construtor for HttpRequest\n * @param {String[]|String} hosts An array of RQLite hosts or a string\n * that will be split on \",\" to create an array of hosts, the first\n * host will be tried first when there are multiple hosts\n * @param {Object} [options={}] Additional options\n * @param {Object} [options.authentication] Authentication options\n * @param {String} [options.authentication.username] The host authentication username\n * @param {String} [options.authentication.password] The host authentication password\n * @param {Boolean} [options.activeHostRoundRobin=true] If true this.setNextActiveHostIndex()\n * will perform a round robin when called\n * @param {import('http').Agent} [options.httpAgent] An option http agent, useful for\n * keepalive pools using plain HTTP\n * @param {import('https').Agent} [options.httpsAgent] An option http agent, useful\n * for keepalive pools using SSL\n * @param {Set|String[]} [options.retryableErrorCodes] The list of retryable error codes\n * @param {Set|Number[]} [options.retryableStatusCodes] The list of retryable http status codes\n * @param {Set|String[]} [options.retryableHttpMethods] The list of retryable http methods\n * @param {Number} [options.exponentailBackoffBase] The value for exponentail backoff base\n * for retry exponential backoff\n * @param {Number} [options.exponentailBackoffExponent] Exponent to increase backoff each try\n */\n constructor (hosts, options = {}) {\n this.setHosts(hosts)\n if (this.getTotalHosts() === 0) {\n throw new Error('At least one host must be provided')\n }\n const {\n activeHostRoundRobin = true,\n httpAgent,\n httpsAgent,\n retryableErrorCodes,\n retryableStatusCodes,\n retryableHttpMethods,\n exponentailBackoffExponent,\n exponentailBackoffBase,\n authentication,\n } = options\n if (typeof authentication === 'object') {\n const { username, password } = authentication\n if (username) {\n this.authentication.set('username', username)\n }\n if (password) {\n this.authentication.set('password', password)\n }\n }\n if (typeof activeHostRoundRobin !== 'undefined') {\n this.setActiveHostRoundRobin(activeHostRoundRobin)\n }\n if (typeof httpAgent !== 'undefined') {\n this.setHttpAgent(httpAgent)\n }\n if (typeof httpsAgent !== 'undefined') {\n this.setHttpsAgent(httpsAgent)\n }\n if (retryableErrorCodes instanceof Set || Array.isArray(retryableErrorCodes)) {\n this.setRetryableErrorCodes(\n Array.isArray(retryableErrorCodes) ? Set(retryableErrorCodes) : retryableErrorCodes,\n )\n }\n if (retryableStatusCodes instanceof Set || Array.isArray(retryableStatusCodes)) {\n this.setRetryableStatusCodes(\n Array.isArray(retryableStatusCodes) ? Set(retryableStatusCodes) : retryableStatusCodes,\n )\n }\n if (retryableHttpMethods instanceof Set || Array.isArray(retryableHttpMethods)) {\n this.setRetryableHttpMethods(\n Array.isArray(retryableHttpMethods) ? Set(retryableHttpMethods) : retryableHttpMethods,\n )\n }\n if (Number.isFinite(exponentailBackoffBase)) {\n this.setExponentailBackoffBase(exponentailBackoffBase)\n }\n if (Number.isFinite(exponentailBackoffExponent)) {\n this.setExponentailBackoffExponent(exponentailBackoffExponent)\n }\n }\n\n /**\n * Set authentication information\n * @param {Object} [authentication] Authentication data\n * @param {String} [authentication.username] The host authentication username\n * @param {String} [authentication.password] The host authentication password\n */\n setAuthentication (authentication = {}) {\n const { username, password } = authentication\n if (username) {\n this.authentication.set('username', username)\n }\n if (password) {\n this.authentication.set('password', password)\n }\n }\n\n /**\n * Set the exponentail backoff base\n * @param {Number} exponentailBackoffBase\n */\n setExponentailBackoffBase (exponentailBackoffBase) {\n this.exponentailBackoffBase = exponentailBackoffBase\n }\n\n /**\n * Get the exponentail backoff base\n * @return {Number} The exponentail backoff base\n */\n getExponentailBackoffBase () {\n return this.exponentailBackoffBase\n }\n\n /**\n * Set the exponentail backoff exponent\n * @param {Number} exponentailBackoffExponent\n */\n setExponentailBackoffExponent (exponentailBackoffExponent) {\n this.exponentailBackoffExponent = exponentailBackoffExponent\n }\n\n /**\n * Get the exponentail backoff exponent\n * @return {Number} The exponentail backoff exponent\n */\n getExponentailBackoffExponent () {\n return this.exponentailBackoffExponent\n }\n\n /**\n * Set the retryable error codes\n * @param {Set} retryableErrorCodes\n */\n setRetryableErrorCodes (retryableErrorCodes) {\n this.retryableErrorCodes = retryableErrorCodes\n }\n\n /**\n * Get the retryable error codes\n * @returns {Set}\n */\n getRetryableErrorCodes () {\n return this.retryableErrorCodes\n }\n\n /**\n * Set the retryable status codes\n * @param {Set} retryableStatusCodes\n */\n setRetryableStatusCodes (retryableStatusCodes) {\n this.retryableStatusCodes = retryableStatusCodes\n }\n\n /**\n * Get the retryable status codes\n * @returns {Set}\n */\n getRetryableStatusCodes () {\n return this.retryableStatusCodes\n }\n\n /**\n * Set the retryable http methods\n * @param {Set} retryableHttpMethods\n */\n setRetryableHttpMethods (retryableHttpMethods) {\n this.retryableHttpMethods = retryableHttpMethods\n }\n\n /**\n * Get the retryable http methods\n * @returns {Set}\n */\n getRetryableHttpMethods () {\n return this.retryableHttpMethods\n }\n\n /**\n * Set an http agent which is useful for http keepalive requests\n * @param {import('http').Agent} httpAgent An http agent\n */\n setHttpAgent (httpAgent) {\n this.httpAgent = httpAgent\n }\n\n /**\n * Get the set http agent\n * @returns {import('http').Agent|undefined} The https agent if it is set\n */\n getHttpAgent () {\n return this.httpAgent\n }\n\n /**\n * Set an https agent which is useful for https keepalive requests\n * @param {import('https').Agent} httpsAgent An https agent\n */\n setHttpsAgent (httpsAgent) {\n this.httpsAgent = httpsAgent\n }\n\n /**\n * Get the set https agent\n * @returns {import('https').Agent|undefined} The https agent if it is set\n */\n getHttpsAgent () {\n return this.httpsAgent\n }\n\n /**\n * Set the list of hosts\n * @param {String[]|String} hosts An array of RQLite hosts or a string\n * that will be split on \",\" to create an array of hosts, the first\n * host will be tried first when there are multiple hosts\n */\n setHosts (hosts) {\n this.hosts = !Array.isArray(hosts) ? String(hosts).split(',') : hosts\n this.hosts = this.hosts.reduce((acc, v) => {\n // Remove trailing slashed from hosts\n const host = String(v).trim().replace(/\\/$/, '')\n if (!host) {\n return acc\n }\n return acc.concat(host)\n }, [])\n }\n\n /**\n * Get the list of hosts\n * @returns {String[]} The list of hosts\n */\n getHosts () {\n return this.hosts\n }\n\n /**\n * Given a host string find the index of that host in the hosts\n * @param {String} host A host to find in hosts\n * @returns {Number} The found host index or -1 if not found\n */\n findHostIndex (host) {\n const parsedHostToFind = parseUrl(host)\n return this.getHosts().findIndex((v) => {\n const parsedHost = parseUrl(v)\n // Find a host where all the parsed fields match the requested host\n return ['hostname', 'protocol', 'port', 'path'].every((field) => parsedHostToFind[field] === parsedHost[field])\n })\n }\n\n /**\n * Get the current active host from the hosts array\n * @param {Boolean} useLeader If true use the first host which is always\n * the master, this is prefered for write operations\n * @returns {String} The active host\n */\n getActiveHost (useLeader) {\n // When useLeader is true we should just use the first host\n const activeHostIndex = useLeader ? this.getLeaderHostIndex() : this.getActiveHostIndex()\n return this.getHosts()[activeHostIndex]\n }\n\n /**\n * Set the active host index with check based on this.hosts\n * @param {Number} activeHostIndex The index\n * @returns {Number} The active host index\n */\n setActiveHostIndex (activeHostIndex) {\n if (!Number.isFinite(activeHostIndex)) {\n throw new Error('The activeHostIndex should be a finite number')\n }\n const totalHosts = this.getTotalHosts()\n if (activeHostIndex < 0) {\n // Don't allow an index less then zero\n this.activeHostIndex = 0\n } else if (activeHostIndex >= totalHosts) {\n // Don't allow an index greater then the length of the hosts\n this.activeHostIndex = totalHosts - 1\n } else {\n this.activeHostIndex = activeHostIndex\n }\n return this.activeHostIndex\n }\n\n /**\n * Get the host index for the leader node\n * @returns {Number} The host index for the leader node\n */\n getLeaderHostIndex () {\n return this.leaderHostIndex\n }\n\n /**\n * Set the index in the host array for the leader node\n * @param {Number} leaderHostIndex The index of the host that is the leader node\n * @returns {Number} The host index for the leader node\n */\n setLeaderHostIndex (leaderHostIndex) {\n if (!Number.isFinite(leaderHostIndex)) {\n throw new Error('The leaderHostIndex should be a finite number')\n }\n const totalHosts = this.getTotalHosts()\n if (leaderHostIndex < 0) {\n this.leaderHostIndex = 0\n } else if (leaderHostIndex > totalHosts) {\n this.leaderHostIndex = totalHosts - 1\n } else {\n this.leaderHostIndex = leaderHostIndex\n }\n return this.leaderHostIndex\n }\n\n /**\n * Get the active host index\n * @returns {Number} The active host index\n */\n getActiveHostIndex () {\n return this.activeHostIndex\n }\n\n /**\n * Set active host round robin value\n * @param {Boolean} activeHostRoundRobin If true setActiveHostIndex() will\n * perform a round robin\n */\n setActiveHostRoundRobin (activeHostRoundRobin) {\n if (typeof activeHostRoundRobin !== 'boolean') {\n throw new Error('The activeHostRoundRobin argument must be boolean')\n }\n this.activeHostRoundRobin = activeHostRoundRobin\n }\n\n /**\n * Get active host round robin value\n * @returns {Boolean} The value of activeHostRoundRobin\n */\n getActiveHostRoundRobin () {\n return this.activeHostRoundRobin\n }\n\n /**\n * Get the next active host index\n * @param {Number} [activeHostIndex] An optional paramater to provide the active host index\n * @returns {Number} The next active host index which will wrap around to zero\n */\n getNextActiveHostIndex (activeHostIndex = this.getActiveHostIndex()) {\n const totalHosts = this.getTotalHosts()\n const nextIndex = activeHostIndex + 1\n // If we are past the last index start back over at 1\n if (totalHosts === nextIndex) {\n return 0\n }\n return nextIndex\n }\n\n /**\n * Set the active host index to the next host using a\n * round robin strategy\n */\n setNextActiveHostIndex () {\n // Don't bother if we only have one host\n if (!this.getActiveHostRoundRobin()) {\n return\n }\n const totalHosts = this.getTotalHosts()\n if (this.getActiveHostRoundRobin() && totalHosts <= 1) {\n return\n }\n this.setActiveHostIndex(this.getNextActiveHostIndex())\n }\n\n /**\n * Get the total number of hosts\n * @returns {Number} The total number of hosts\n */\n getTotalHosts () {\n return this.getHosts().length\n }\n\n /**\n * Returns whether or not the uri passes a test for this.absoluteUriPattern\n * @returns {Boolean} True if the path is absolute\n */\n uriIsAbsolute (uri) {\n return this.absoluteUriPattern.test(uri)\n }\n\n /**\n * Returns true when the HTTP request is retryable\n * @param {Object} options The options\n * @param {Number} options.statusCode The HTTP status code\n * @param {String} options.errorCode The error code\n * @param {String} options.httpMethod The http method\n * @returns {Boolean} True if the request is retry able\n */\n requestIsRetryable (options = {}) {\n const {\n statusCode,\n errorCode,\n httpMethod,\n } = options\n // Honor strictly the http method\n if (!this.getRetryableHttpMethods().has(httpMethod)) {\n return false\n }\n if (statusCode && this.getRetryableStatusCodes().has(statusCode)) {\n return true\n }\n if (errorCode && this.getRetryableErrorCodes().has(errorCode)) {\n return true\n }\n return false\n }\n\n /**\n * Perform an HTTP request using the provided options\n * @param {HttpRequestOptions} [options={}] Options for the HTTP client\n * @returns {Promise<{status: Number, body: Object|String}>} An object with a status and body\n * property when stream is false and a stream when the stream option is true\n * @throws {ERROR_HTTP_REQUEST_MAX_REDIRECTS} When the maximum number of redirect has been reached\n */\n async fetch (options = {}) {\n const {\n body,\n headers = {},\n httpMethod = HTTP_METHOD_GET,\n query,\n stream = false,\n timeout = DEAULT_TIMEOUT,\n useLeader = false,\n retries = this.getTotalHosts() * 3,\n maxRedirects = 10,\n attempt = 0,\n retryAttempt = 0,\n redirectAttempt = 0,\n attemptHostIndex,\n exponentailBackoffExponent = this.getExponentailBackoffExponent(),\n exponentailBackoffBase = this.getExponentailBackoffBase(),\n httpAgent = this.getHttpAgent(),\n httpsAgent = this.getHttpsAgent(),\n } = options\n // Honor the supplied attemptHostIndex or get the active host\n const activeHost = Number.isFinite(attemptHostIndex) ? this.getHosts()[attemptHostIndex]\n : this.getActiveHost(useLeader)\n let { uri } = options\n if (!uri) {\n throw new Error('The uri option is required')\n }\n uri = this.uriIsAbsolute(uri) ? uri : `${activeHost}/${cleanPath(uri)}`\n try {\n let auth\n if (this.authentication.size) {\n auth = {\n username: this.authentication.get('username'),\n password: this.authentication.get('password'),\n }\n }\n const response = await axios({\n url: uri,\n auth,\n data: body,\n maxRedirects: 0, // Handle redirects manually to allow reposting data\n headers: createDefaultHeaders(headers),\n responseType: stream ? 'stream' : 'json',\n method: httpMethod,\n params: query,\n timeout,\n httpsAgent,\n httpAgent,\n paramsSerializer (params) {\n return stringifyQuery(params, { arrayFormat: 'brackets' })\n },\n })\n if (stream) {\n return response.data\n }\n return {\n body: response.data,\n status: response.status,\n }\n } catch (e) {\n const { response = {}, code: errorCode } = e\n const { status: responseStatus, headers: responseHeaders = {} } = response\n // Check if the error was a redirect\n const retryable = this.requestIsRetryable({\n statusCode: responseStatus,\n errorCode,\n httpMethod,\n })\n // Save the next active host index and pass it to retry manually\n let nextAttemptHostIndex = Number.isFinite(attemptHostIndex) ? attemptHostIndex\n : this.getActiveHostIndex()\n nextAttemptHostIndex += 1\n // We go past the last index start from zero\n if (nextAttemptHostIndex === this.getTotalHosts()) {\n nextAttemptHostIndex = 0\n }\n // First check if this is a redirect error\n if (responseStatus === 301 || responseStatus === 302) {\n // We maxed out on redirect attempts\n if (redirectAttempt >= maxRedirects) {\n throw ERROR_HTTP_REQUEST_MAX_REDIRECTS(`The maximum number of redirects ${maxRedirects} has been reached`)\n }\n const location = typeof responseHeaders === 'object' ? responseHeaders.location : undefined\n // If we were asked to use the leader, but got redirect the leader moved so remember it\n if (useLeader) {\n const newLeaderHostIndex = this.findHostIndex(location)\n // If the redirect exists in the hosts list remember it for next time\n if (newLeaderHostIndex > -1) {\n this.setLeaderHostIndex(newLeaderHostIndex)\n }\n }\n return this.fetch({\n ...options,\n uri: location,\n attempt: attempt + 1,\n redirectAttempt: redirectAttempt + 1,\n attemptHostIndex: nextAttemptHostIndex,\n })\n }\n if (retryable && retryAttempt < retries) {\n const waitTime = getWaitTimeExponential(\n retryAttempt,\n exponentailBackoffBase,\n exponentailBackoffExponent,\n )\n await new Promise((resolve) => {\n setTimeout(() => {\n resolve(undefined)\n }, waitTime)\n })\n return this.fetch({\n ...options,\n attempt: attempt + 1,\n retryAttempt: retryAttempt + 1,\n attemptHostIndex: nextAttemptHostIndex,\n })\n }\n throw e\n }\n }\n\n /**\n * Perform an HTTP GET request\n * @param {HttpRequestOptions} [options={}] The options\n * @see this.fetch() for options\n */\n async get (options = {}) {\n return this.fetch({ ...options, httpMethod: HTTP_METHOD_GET })\n }\n\n /**\n * Perform an HTTP POST request\n * @param {HttpRequestOptions} [options={}] The options\n * @see this.fetch() for options\n */\n async post (options = {}) {\n return this.fetch({ ...options, httpMethod: HTTP_METHOD_POST })\n }\n}\n"],"mappings":";;;;AAIA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,GAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;;;;AAIA,IAAAI,aAAA,GAAAJ,OAAA;;;;AAIA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA,gBAIoB,SAAAO,QAAAC,MAAA,EAAAC,cAAA,OAAAC,IAAA,GAAAC,MAAA,CAAAD,IAAA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_CODES = new Set([
|
|
|
19
19
|
'ENETUNREACH',
|
|
20
20
|
'ENOTFOUND',
|
|
21
21
|
'EPIPE',
|
|
22
|
-
'ETIMEDOUT']
|
|
23
|
-
|
|
22
|
+
'ETIMEDOUT']
|
|
23
|
+
);
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* HTTP status codes which can be retried
|
|
@@ -37,5 +37,6 @@ _httpMethods.HTTP_METHOD_HEAD,
|
|
|
37
37
|
_httpMethods.HTTP_METHOD_OPTIONS,
|
|
38
38
|
_httpMethods.HTTP_METHOD_PATCH,
|
|
39
39
|
_httpMethods.HTTP_METHOD_POST,
|
|
40
|
-
_httpMethods.HTTP_METHOD_PUT]
|
|
40
|
+
_httpMethods.HTTP_METHOD_PUT]
|
|
41
|
+
);exports.RETRYABLE_HTTP_METHODS = RETRYABLE_HTTP_METHODS;
|
|
41
42
|
//# sourceMappingURL=retryable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retryable.js","names":["RETRYABLE_ERROR_CODES","Set","RETRYABLE_STATUS_CODES","RETRYABLE_HTTP_METHODS","HTTP_METHOD_DELETE","HTTP_METHOD_GET","HTTP_METHOD_HEAD","HTTP_METHOD_OPTIONS","HTTP_METHOD_PATCH","HTTP_METHOD_POST","HTTP_METHOD_PUT"],"sources":["../../es6/http-request/retryable.js"],"sourcesContent":["import {\n HTTP_METHOD_DELETE,\n HTTP_METHOD_GET,\n HTTP_METHOD_HEAD,\n HTTP_METHOD_OPTIONS,\n HTTP_METHOD_PATCH,\n HTTP_METHOD_POST,\n HTTP_METHOD_PUT,\n} from './http-methods'\n\n/**\n * Error codes which can be retried\n */\nexport const RETRYABLE_ERROR_CODES = new Set([\n 'EADDRINUSE',\n 'EAI_AGAIN',\n 'ECONNREFUSED',\n 'ECONNRESET',\n 'ENETUNREACH',\n 'ENOTFOUND',\n 'EPIPE',\n 'ETIMEDOUT',\n])\n\n/**\n * HTTP status codes which can be retried\n */\nexport const RETRYABLE_STATUS_CODES = new Set([408, 413, 429, 500, 502, 503, 504, 521, 522, 524])\n\n/**\n * HTTP methods which can be retried\n */\nexport const RETRYABLE_HTTP_METHODS = new Set([\n HTTP_METHOD_DELETE,\n HTTP_METHOD_GET,\n HTTP_METHOD_HEAD,\n HTTP_METHOD_OPTIONS,\n HTTP_METHOD_PATCH,\n HTTP_METHOD_POST,\n HTTP_METHOD_PUT,\n])\n"],"mappings":"oLAAA;;;;;;;;;;AAUA;AACA;AACA;AACO,
|
|
1
|
+
{"version":3,"file":"retryable.js","names":["_httpMethods","require","RETRYABLE_ERROR_CODES","Set","exports","RETRYABLE_STATUS_CODES","RETRYABLE_HTTP_METHODS","HTTP_METHOD_DELETE","HTTP_METHOD_GET","HTTP_METHOD_HEAD","HTTP_METHOD_OPTIONS","HTTP_METHOD_PATCH","HTTP_METHOD_POST","HTTP_METHOD_PUT"],"sources":["../../es6/http-request/retryable.js"],"sourcesContent":["import {\n HTTP_METHOD_DELETE,\n HTTP_METHOD_GET,\n HTTP_METHOD_HEAD,\n HTTP_METHOD_OPTIONS,\n HTTP_METHOD_PATCH,\n HTTP_METHOD_POST,\n HTTP_METHOD_PUT,\n} from './http-methods'\n\n/**\n * Error codes which can be retried\n */\nexport const RETRYABLE_ERROR_CODES = new Set([\n 'EADDRINUSE',\n 'EAI_AGAIN',\n 'ECONNREFUSED',\n 'ECONNRESET',\n 'ENETUNREACH',\n 'ENOTFOUND',\n 'EPIPE',\n 'ETIMEDOUT',\n])\n\n/**\n * HTTP status codes which can be retried\n */\nexport const RETRYABLE_STATUS_CODES = new Set([408, 413, 429, 500, 502, 503, 504, 521, 522, 524])\n\n/**\n * HTTP methods which can be retried\n */\nexport const RETRYABLE_HTTP_METHODS = new Set([\n HTTP_METHOD_DELETE,\n HTTP_METHOD_GET,\n HTTP_METHOD_HEAD,\n HTTP_METHOD_OPTIONS,\n HTTP_METHOD_PATCH,\n HTTP_METHOD_POST,\n HTTP_METHOD_PUT,\n])\n"],"mappings":"oLAAA,IAAAA,YAAA,GAAAC,OAAA;;;;;;;;;;AAUA;AACA;AACA;AACO,MAAMC,qBAAqB,GAAG,IAAIC,GAAG,CAAC;AAC3C,YAAY;AACZ,WAAW;AACX,cAAc;AACd,YAAY;AACZ,aAAa;AACb,WAAW;AACX,OAAO;AACP,WAAW;AACZ,CAAC;;AAEF;AACA;AACA,GAFAC,OAAA,CAAAF,qBAAA,GAAAA,qBAAA;AAGO,MAAMG,sBAAsB,GAAG,IAAIF,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;;AAEjG;AACA;AACA,GAFAC,OAAA,CAAAC,sBAAA,GAAAA,sBAAA;AAGO,MAAMC,sBAAsB,GAAG,IAAIH,GAAG,CAAC;AAC5CI,+BAAkB;AAClBC,4BAAe;AACfC,6BAAgB;AAChBC,gCAAmB;AACnBC,8BAAiB;AACjBC,6BAAgB;AAChBC,4BAAe;AAChB,CAAC,CAAAT,OAAA,CAAAE,sBAAA,GAAAA,sBAAA"}
|
package/lib/index.js
CHANGED
|
@@ -9,5 +9,6 @@ var _status = _interopRequireDefault(require("./api/status")); /**
|
|
|
9
9
|
* @module rqlite-js
|
|
10
10
|
*/var _default = { DataApiClient: _data.default,
|
|
11
11
|
BackupApiClient: _backup.default,
|
|
12
|
-
StatusApiClient: _status.default
|
|
12
|
+
StatusApiClient: _status.default
|
|
13
|
+
};exports.default = _default;module.exports = exports.default;
|
|
13
14
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["DataApiClient","BackupApiClient","StatusApiClient"],"sources":["../es6/index.js"],"sourcesContent":["/**\n * RQLite JS client which export all of the api clients\n * @module rqlite-js\n */\nimport DataApiClient from './api/data'\nimport BackupApiClient from './api/backup'\nimport StatusApiClient from './api/status'\n\nexport default {\n DataApiClient,\n BackupApiClient,\n StatusApiClient,\n}\n"],"mappings":";;;;AAIA;AACA;AACA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["_data","_interopRequireDefault","require","_backup","_status","_default","DataApiClient","BackupApiClient","StatusApiClient","exports","default","module"],"sources":["../es6/index.js"],"sourcesContent":["/**\n * RQLite JS client which export all of the api clients\n * @module rqlite-js\n */\nimport DataApiClient from './api/data'\nimport BackupApiClient from './api/backup'\nimport StatusApiClient from './api/status'\n\nexport default {\n DataApiClient,\n BackupApiClient,\n StatusApiClient,\n}\n"],"mappings":";;;;AAIA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAH,sBAAA,CAAAC,OAAA,kBAA0C,CAN1C;AACA;AACA;AACA,GAHA,IAAAG,QAAA,GAQe,EACbC,aAAa,EAAbA,aAAa;EACbC,eAAe,EAAfA,eAAe;EACfC,eAAe,EAAfA;AACF,CAAC,CAAAC,OAAA,CAAAC,OAAA,GAAAL,QAAA,CAAAM,MAAA,CAAAF,OAAA,GAAAA,OAAA,CAAAC,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rqlite-js",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.6",
|
|
4
4
|
"description": "A client library for RQLite written in Javascript that works in NodeJS or the browser.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -37,28 +37,28 @@
|
|
|
37
37
|
},
|
|
38
38
|
"homepage": "https://github.com/rqlite/rqlite-js#readme",
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@babel/cli": "^7.
|
|
41
|
-
"@babel/core": "^7.
|
|
42
|
-
"@babel/eslint-parser": "^7.
|
|
43
|
-
"@babel/plugin-proposal-class-properties": "^7.
|
|
44
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
45
|
-
"@babel/preset-env": "^7.
|
|
46
|
-
"@babel/register": "^7.
|
|
40
|
+
"@babel/cli": "^7.22.5",
|
|
41
|
+
"@babel/core": "^7.22.5",
|
|
42
|
+
"@babel/eslint-parser": "^7.22.5",
|
|
43
|
+
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
44
|
+
"@babel/plugin-transform-runtime": "^7.22.5",
|
|
45
|
+
"@babel/preset-env": "^7.22.5",
|
|
46
|
+
"@babel/register": "^7.22.5",
|
|
47
|
+
"@babel/runtime": "^7.22.5",
|
|
47
48
|
"babel-plugin-add-module-exports": "^1.0.4",
|
|
48
|
-
"chai": "^4.3.
|
|
49
|
+
"chai": "^4.3.7",
|
|
49
50
|
"chai-as-promised": "^7.1.1",
|
|
50
|
-
"eslint": "^8.
|
|
51
|
+
"eslint": "^8.43.0",
|
|
51
52
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
52
53
|
"eslint-plugin-babel": "^5.3.1",
|
|
53
54
|
"eslint-plugin-import": "^2.22.1",
|
|
54
|
-
"eslint-plugin-mocha": "^10.0
|
|
55
|
-
"mocha": "^10.
|
|
56
|
-
"nock": "^13.
|
|
57
|
-
"standard-version": "^9.3.
|
|
55
|
+
"eslint-plugin-mocha": "^10.1.0",
|
|
56
|
+
"mocha": "^10.2.0",
|
|
57
|
+
"nock": "^13.3.1",
|
|
58
|
+
"standard-version": "^9.3.0"
|
|
58
59
|
},
|
|
59
60
|
"dependencies": {
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"qs": "^6.10.3"
|
|
61
|
+
"axios": "^1.4.0",
|
|
62
|
+
"qs": "^6.11.2"
|
|
63
63
|
}
|
|
64
64
|
}
|