rqlite-js 2.5.7 → 3.0.0
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/README.md +354 -157
- package/dist/index.cjs +904 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +329 -0
- package/dist/index.d.ts +329 -0
- package/dist/index.js +865 -0
- package/dist/index.js.map +1 -0
- package/docs/MIGRATION-v2-to-v3.md +71 -0
- package/package.json +73 -42
- package/src/api/backup/index.ts +69 -0
- package/src/api/backup-formats.ts +8 -0
- package/src/api/client/index.ts +97 -0
- package/src/api/consistency-levels.ts +10 -0
- package/src/api/data/index.ts +87 -0
- package/src/api/paths.ts +13 -0
- package/src/api/query-params.ts +15 -0
- package/src/api/results/data-result-error.ts +41 -0
- package/src/api/results/data-result.ts +91 -0
- package/src/api/results/data-results.ts +91 -0
- package/src/api/results/index.ts +7 -0
- package/src/api/results/result-fields.ts +14 -0
- package/src/api/status/index.ts +53 -0
- package/src/http-request/auth-keys.ts +14 -0
- package/{es6/http-request/errors.js → src/http-request/errors.ts} +4 -3
- package/src/http-request/http-headers.ts +19 -0
- package/{es6/http-request/http-methods.js → src/http-request/http-methods.ts} +0 -27
- package/src/http-request/index.ts +676 -0
- package/{es6/http-request/retryable.js → src/http-request/retryable.ts} +1 -1
- package/src/index.ts +38 -0
- package/.eslintrc +0 -20
- package/.travis.yml +0 -24
- package/es6/api/backup/index.js +0 -71
- package/es6/api/client/index.js +0 -83
- package/es6/api/data/index.js +0 -129
- package/es6/api/results/data-result-error.js +0 -32
- package/es6/api/results/data-result.js +0 -134
- package/es6/api/results/data-results.js +0 -121
- package/es6/api/results/index.js +0 -7
- package/es6/api/status/index.js +0 -54
- package/es6/http-request/index.js +0 -743
- package/es6/index.js +0 -19
- package/jsconfig.json +0 -19
- package/lib/api/backup/index.js +0 -72
- package/lib/api/backup/index.js.map +0 -1
- package/lib/api/client/index.js +0 -84
- package/lib/api/client/index.js.map +0 -1
- package/lib/api/data/index.js +0 -130
- package/lib/api/data/index.js.map +0 -1
- package/lib/api/results/data-result-error.js +0 -33
- package/lib/api/results/data-result-error.js.map +0 -1
- package/lib/api/results/data-result.js +0 -135
- package/lib/api/results/data-result.js.map +0 -1
- package/lib/api/results/data-results.js +0 -122
- package/lib/api/results/data-results.js.map +0 -1
- package/lib/api/results/index.js +0 -8
- package/lib/api/results/index.js.map +0 -1
- package/lib/api/status/index.js +0 -55
- package/lib/api/status/index.js.map +0 -1
- package/lib/http-request/content-types.js +0 -5
- package/lib/http-request/content-types.js.map +0 -1
- package/lib/http-request/errors.js +0 -17
- package/lib/http-request/errors.js.map +0 -1
- package/lib/http-request/http-methods.js +0 -40
- package/lib/http-request/http-methods.js.map +0 -1
- package/lib/http-request/index.js +0 -744
- package/lib/http-request/index.js.map +0 -1
- package/lib/http-request/retryable.js +0 -42
- package/lib/http-request/retryable.js.map +0 -1
- package/lib/index.js +0 -20
- package/lib/index.js.map +0 -1
- /package/{es6/http-request/content-types.js → src/http-request/content-types.ts} +0 -0
package/es6/api/status/index.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Status api client to perform RQLite status and diagnostics operations
|
|
3
|
-
* @module api/status
|
|
4
|
-
*/
|
|
5
|
-
import ApiClient from '../client'
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @typedef {Object} HttpResponse
|
|
9
|
-
* @property {Object} Body The HTTP response body parsed by JSON.parse()
|
|
10
|
-
* @property {Number} statusCode The HTTP response code
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @typedef {Object} StatusAllHostsResponse
|
|
15
|
-
* @property {HttpResponse} response An HTTP response
|
|
16
|
-
* @property {String} host The host name
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* The RQLite status api path
|
|
21
|
-
*/
|
|
22
|
-
export const PATH_STATUS = '/status'
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Data api client to perform RQLite queries
|
|
26
|
-
*/
|
|
27
|
-
export default class StatusApiClient extends ApiClient {
|
|
28
|
-
/**
|
|
29
|
-
* Get the RQLite server status which defaults to the master host
|
|
30
|
-
* @param {Object} [options={}] RQLite api options
|
|
31
|
-
* @returns {HttpResponse} An HTTP response object
|
|
32
|
-
*/
|
|
33
|
-
async status (options = {}) {
|
|
34
|
-
return super.get(PATH_STATUS, { useLeader: true, ...options })
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Get the RQLite server status for all hosts as an array of object with
|
|
39
|
-
* the host and their status
|
|
40
|
-
* @param {Object} [options={}] RQLite api options
|
|
41
|
-
* @param {Object} [options.raw] If true return the raw http response from
|
|
42
|
-
* RQLite response
|
|
43
|
-
* @returns {StatusAllHostsResponse[]} An array of http response for the provide hosts
|
|
44
|
-
*/
|
|
45
|
-
async statusAllHosts (options = {}) {
|
|
46
|
-
const hosts = this.getHosts()
|
|
47
|
-
// Get the status for all of the hosts
|
|
48
|
-
const promises = hosts.map(async (_host, activeHostIndex) => {
|
|
49
|
-
const response = await this.status({ ...options, activeHostIndex })
|
|
50
|
-
return { response, host: hosts[activeHostIndex] }
|
|
51
|
-
})
|
|
52
|
-
return Promise.all(promises)
|
|
53
|
-
}
|
|
54
|
-
}
|