kourou 1.4.0-dev.4 → 1.5.0-dev.1
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 +892 -707
- package/bin/run +10 -24
- package/lib/commands/api-key/check.d.ts +11 -14
- package/lib/commands/api-key/check.js +5 -5
- package/lib/commands/api-key/create.d.ts +14 -17
- package/lib/commands/api-key/create.js +7 -5
- package/lib/commands/api-key/delete.d.ts +12 -14
- package/lib/commands/api-key/delete.js +6 -6
- package/lib/commands/api-key/search.d.ts +12 -15
- package/lib/commands/api-key/search.js +5 -3
- package/lib/commands/app/debug-proxy.d.ts +15 -16
- package/lib/commands/app/debug-proxy.js +7 -7
- package/lib/commands/app/doctor.d.ts +11 -12
- package/lib/commands/app/doctor.js +3 -3
- package/lib/commands/app/scaffold.d.ts +5 -8
- package/lib/commands/app/scaffold.js +8 -9
- package/lib/commands/app/start-services.d.ts +2 -2
- package/lib/commands/app/start-services.js +3 -3
- package/lib/commands/collection/create.d.ts +14 -19
- package/lib/commands/collection/create.js +8 -9
- package/lib/commands/collection/export.d.ts +20 -22
- package/lib/commands/collection/export.js +14 -14
- package/lib/commands/collection/import.d.ts +15 -18
- package/lib/commands/collection/import.js +9 -9
- package/lib/commands/collection/migrate.d.ts +15 -17
- package/lib/commands/collection/migrate.js +12 -9
- package/lib/commands/config/diff.d.ts +5 -6
- package/lib/commands/config/diff.js +11 -9
- package/lib/commands/document/search.d.ts +20 -25
- package/lib/commands/document/search.js +13 -13
- package/lib/commands/es/aliases/cat.d.ts +3 -4
- package/lib/commands/es/aliases/cat.js +4 -4
- package/lib/commands/es/indices/cat.d.ts +3 -4
- package/lib/commands/es/indices/cat.js +4 -4
- package/lib/commands/es/indices/get.d.ts +5 -7
- package/lib/commands/es/indices/get.js +7 -7
- package/lib/commands/es/indices/insert.d.ts +6 -9
- package/lib/commands/es/indices/insert.js +8 -8
- package/lib/commands/es/migrate.d.ts +11 -12
- package/lib/commands/es/migrate.js +26 -15
- package/lib/commands/es/snapshot/create-repository.d.ts +6 -8
- package/lib/commands/es/snapshot/create-repository.js +12 -10
- package/lib/commands/es/snapshot/create.d.ts +6 -8
- package/lib/commands/es/snapshot/create.js +11 -8
- package/lib/commands/es/snapshot/list.d.ts +4 -7
- package/lib/commands/es/snapshot/list.js +7 -8
- package/lib/commands/es/snapshot/restore.d.ts +6 -8
- package/lib/commands/es/snapshot/restore.js +11 -8
- package/lib/commands/file/decrypt.d.ts +5 -8
- package/lib/commands/file/decrypt.js +7 -7
- package/lib/commands/file/encrypt.d.ts +5 -8
- package/lib/commands/file/encrypt.js +7 -5
- package/lib/commands/file/test.d.ts +3 -6
- package/lib/commands/file/test.js +5 -5
- package/lib/commands/import.d.ts +13 -16
- package/lib/commands/import.js +8 -9
- package/lib/commands/index/export.d.ts +17 -20
- package/lib/commands/index/export.js +12 -11
- package/lib/commands/index/import.d.ts +14 -17
- package/lib/commands/index/import.js +11 -8
- package/lib/commands/instance/kill.d.ts +2 -3
- package/lib/commands/instance/kill.js +6 -7
- package/lib/commands/instance/logs.d.ts +2 -3
- package/lib/commands/instance/logs.js +3 -3
- package/lib/commands/instance/spawn.d.ts +3 -4
- package/lib/commands/instance/spawn.js +7 -8
- package/lib/commands/paas/login.d.ts +4 -5
- package/lib/commands/paas/login.js +13 -8
- package/lib/commands/profile/export.d.ts +10 -11
- package/lib/commands/profile/export.js +3 -3
- package/lib/commands/profile/import.d.ts +11 -14
- package/lib/commands/profile/import.js +5 -3
- package/lib/commands/realtime/subscribe.d.ts +19 -24
- package/lib/commands/realtime/subscribe.js +12 -12
- package/lib/commands/redis/list-keys.d.ts +14 -17
- package/lib/commands/redis/list-keys.js +8 -9
- package/lib/commands/role/export.d.ts +10 -11
- package/lib/commands/role/export.js +3 -3
- package/lib/commands/role/import.d.ts +12 -15
- package/lib/commands/role/import.js +6 -4
- package/lib/commands/sdk/execute.d.ts +15 -18
- package/lib/commands/sdk/execute.js +9 -10
- package/lib/commands/sdk/query.d.ts +20 -23
- package/lib/commands/sdk/query.js +14 -15
- package/lib/commands/user/export-mappings.d.ts +10 -11
- package/lib/commands/user/export-mappings.js +3 -3
- package/lib/commands/user/export.d.ts +14 -15
- package/lib/commands/user/export.js +7 -7
- package/lib/commands/user/import-mappings.d.ts +11 -14
- package/lib/commands/user/import-mappings.js +5 -3
- package/lib/commands/user/import.d.ts +11 -14
- package/lib/commands/user/import.js +5 -3
- package/lib/commands/vault/add.d.ts +5 -6
- package/lib/commands/vault/add.js +9 -11
- package/lib/commands/vault/decrypt.d.ts +5 -8
- package/lib/commands/vault/decrypt.js +8 -9
- package/lib/commands/vault/encrypt.d.ts +5 -8
- package/lib/commands/vault/encrypt.js +8 -9
- package/lib/commands/vault/show.d.ts +5 -11
- package/lib/commands/vault/show.js +7 -8
- package/lib/commands/vault/test.d.ts +3 -6
- package/lib/commands/vault/test.js +6 -7
- package/lib/common.d.ts +1 -1
- package/lib/common.js +3 -3
- package/lib/help.d.ts +16 -0
- package/lib/help.js +31 -0
- package/lib/hooks/command_not_found/api-action.d.ts +1 -1
- package/lib/hooks/command_not_found/api-action.js +8 -8
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -2
- package/lib/support/dump-collection.js +2 -2
- package/lib/support/kuzzle.d.ts +8 -9
- package/lib/support/kuzzle.js +9 -9
- package/lib/support/progressBar.d.ts +10 -0
- package/lib/support/progressBar.js +15 -0
- package/package.json +13 -12
package/lib/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { run } from "@oclif/
|
|
1
|
+
export { run } from "@oclif/core";
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var
|
|
4
|
-
Object.defineProperty(exports, "run", { enumerable: true, get: function () { return
|
|
3
|
+
var core_1 = require("@oclif/core");
|
|
4
|
+
Object.defineProperty(exports, "run", { enumerable: true, get: function () { return core_1.run; } });
|
|
@@ -5,8 +5,8 @@ exports.dumpCollectionMappings = dumpCollectionMappings;
|
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
7
7
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
8
|
-
const cli_ux_1 = tslib_1.__importDefault(require("cli-ux"));
|
|
9
8
|
const ndjson_1 = tslib_1.__importDefault(require("ndjson"));
|
|
9
|
+
const progressBar_1 = require("./progressBar");
|
|
10
10
|
const common_1 = require("../common");
|
|
11
11
|
/**
|
|
12
12
|
* Flatten an object transform:
|
|
@@ -89,7 +89,7 @@ class AbstractDumper {
|
|
|
89
89
|
await this.setup();
|
|
90
90
|
await this.writeHeader();
|
|
91
91
|
let results = await this.sdk.document.search(this.index, this.collection, { query: this.query }, this.options);
|
|
92
|
-
const progressBar =
|
|
92
|
+
const progressBar = (0, progressBar_1.createProgressBar)({
|
|
93
93
|
format: `Dumping ${this.collection} |{bar}| {percentage}% || {value}/{total} documents`,
|
|
94
94
|
});
|
|
95
95
|
progressBar.start(results.total, 0);
|
package/lib/support/kuzzle.d.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import http from "http";
|
|
2
|
-
import { flags } from "@oclif/command";
|
|
3
2
|
import { Kuzzle, JSONObject } from "kuzzle-sdk";
|
|
4
3
|
export declare const kuzzleFlags: {
|
|
5
|
-
host:
|
|
6
|
-
port:
|
|
7
|
-
ssl: import("@oclif/
|
|
8
|
-
username:
|
|
9
|
-
password:
|
|
10
|
-
protocol:
|
|
11
|
-
as:
|
|
12
|
-
"api-key":
|
|
4
|
+
host: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
5
|
+
port: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
6
|
+
ssl: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
username: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
password: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
protocol: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
as: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
"api-key": import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
12
|
};
|
|
14
13
|
export declare class KuzzleSDK {
|
|
15
14
|
sdk: Kuzzle;
|
package/lib/support/kuzzle.js
CHANGED
|
@@ -4,38 +4,38 @@ exports.KuzzleSDK = exports.kuzzleFlags = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const http_1 = tslib_1.__importDefault(require("http"));
|
|
6
6
|
const https_1 = tslib_1.__importDefault(require("https"));
|
|
7
|
-
const
|
|
7
|
+
const core_1 = require("@oclif/core");
|
|
8
8
|
const kuzzle_sdk_1 = require("kuzzle-sdk");
|
|
9
9
|
const SECOND = 1000;
|
|
10
10
|
exports.kuzzleFlags = {
|
|
11
|
-
host:
|
|
11
|
+
host: core_1.Flags.string({
|
|
12
12
|
description: "Kuzzle server host",
|
|
13
13
|
default: process.env.KUZZLE_HOST || "localhost",
|
|
14
14
|
}),
|
|
15
|
-
port:
|
|
15
|
+
port: core_1.Flags.string({
|
|
16
16
|
description: "Kuzzle server port",
|
|
17
17
|
default: process.env.KUZZLE_PORT || "7512",
|
|
18
18
|
}),
|
|
19
|
-
ssl:
|
|
19
|
+
ssl: core_1.Flags.boolean({
|
|
20
20
|
description: "Use SSL to connect to Kuzzle",
|
|
21
21
|
default: Boolean(process.env.KUZZLE_SSL) || undefined,
|
|
22
22
|
}),
|
|
23
|
-
username:
|
|
23
|
+
username: core_1.Flags.string({
|
|
24
24
|
description: "Kuzzle username (local strategy)",
|
|
25
25
|
default: process.env.KUZZLE_USERNAME || "anonymous",
|
|
26
26
|
}),
|
|
27
|
-
password:
|
|
27
|
+
password: core_1.Flags.string({
|
|
28
28
|
description: "Kuzzle user password",
|
|
29
29
|
default: process.env.KUZZLE_PASSWORD || undefined,
|
|
30
30
|
}),
|
|
31
|
-
protocol:
|
|
31
|
+
protocol: core_1.Flags.string({
|
|
32
32
|
description: "Kuzzle protocol (http or ws)",
|
|
33
33
|
default: process.env.KUZZLE_PROTOCOL || "ws",
|
|
34
34
|
}),
|
|
35
|
-
as:
|
|
35
|
+
as: core_1.Flags.string({
|
|
36
36
|
description: "Impersonate a user",
|
|
37
37
|
}),
|
|
38
|
-
"api-key":
|
|
38
|
+
"api-key": core_1.Flags.string({
|
|
39
39
|
description: "Kuzzle user api-key",
|
|
40
40
|
default: process.env.KUZZLE_API_KEY || undefined,
|
|
41
41
|
}),
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SingleBar, Options } from "cli-progress";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a progress bar behaving like the one cli-ux used to provide.
|
|
4
|
+
*
|
|
5
|
+
* cli-ux wrapped cli-progress and forced `noTTYOutput` whenever the terminal
|
|
6
|
+
* is dumb or stdin is not a TTY, which is what keeps the output readable when
|
|
7
|
+
* it is piped or captured, as the functional tests do. Reproduced here so the
|
|
8
|
+
* output stays identical now that cli-ux is gone.
|
|
9
|
+
*/
|
|
10
|
+
export declare function createProgressBar(options?: Options): SingleBar;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createProgressBar = createProgressBar;
|
|
4
|
+
const cli_progress_1 = require("cli-progress");
|
|
5
|
+
/**
|
|
6
|
+
* Creates a progress bar behaving like the one cli-ux used to provide.
|
|
7
|
+
*
|
|
8
|
+
* cli-ux wrapped cli-progress and forced `noTTYOutput` whenever the terminal
|
|
9
|
+
* is dumb or stdin is not a TTY, which is what keeps the output readable when
|
|
10
|
+
* it is piped or captured, as the functional tests do. Reproduced here so the
|
|
11
|
+
* output stays identical now that cli-ux is gone.
|
|
12
|
+
*/
|
|
13
|
+
function createProgressBar(options = {}) {
|
|
14
|
+
return new cli_progress_1.SingleBar(Object.assign(Object.assign({}, options), { noTTYOutput: Boolean(process.env.TERM === "dumb" || !process.stdin.isTTY) }));
|
|
15
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kourou",
|
|
3
3
|
"description": "The CLI that helps you manage your Kuzzle instances",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.5.0-dev.1",
|
|
5
5
|
"author": "The Kuzzle Team <support@kuzzle.io>",
|
|
6
6
|
"bin": {
|
|
7
7
|
"kourou": "./bin/run"
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"build": "tsc --build tsconfig.json",
|
|
12
12
|
"dev": "./bin/run",
|
|
13
13
|
"postpack": "rm -f oclif.manifest.json",
|
|
14
|
-
"version": "oclif
|
|
14
|
+
"version": "oclif readme && git add README.md",
|
|
15
15
|
"test:lint": "eslint src/ test/",
|
|
16
16
|
"test:lint:fix": "eslint src/ test/ --fix",
|
|
17
17
|
"test:functional": "npm run build && npm run test:functional:stdout && npm run test:functional:cucumber",
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"sdk-es7": "npm:@elastic/elasticsearch@7.17.14",
|
|
23
23
|
"sdk-es8": "npm:@elastic/elasticsearch@8.19.2",
|
|
24
|
-
"@oclif/
|
|
25
|
-
"@oclif/
|
|
26
|
-
"@oclif/plugin-
|
|
27
|
-
"@oclif/plugin-
|
|
24
|
+
"@oclif/core": "5.0.0",
|
|
25
|
+
"@oclif/plugin-autocomplete": "4.0.0",
|
|
26
|
+
"@oclif/plugin-help": "7.0.0",
|
|
27
|
+
"@oclif/plugin-version": "3.0.0",
|
|
28
28
|
"chalk": "4.1.2",
|
|
29
|
-
"cli-
|
|
29
|
+
"cli-progress": "3.12.0",
|
|
30
30
|
"inquirer": "8.2.7",
|
|
31
31
|
"kepler-companion": "1.1.6",
|
|
32
32
|
"kuzzle-sdk": "7.17.1",
|
|
@@ -43,23 +43,22 @@
|
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@cucumber/cucumber": "13.2.1",
|
|
45
45
|
"@istanbuljs/nyc-config-typescript": "1.0.2",
|
|
46
|
-
"@
|
|
47
|
-
"@oclif/test": "1.2.8",
|
|
48
|
-
"@types/chai": "4.3.20",
|
|
46
|
+
"@types/cli-progress": "3.11.6",
|
|
49
47
|
"@types/compare-version": "0.1.34",
|
|
50
48
|
"@types/inquirer": "8.2.13",
|
|
51
49
|
"@types/listr": "0.14.10",
|
|
50
|
+
"@types/lodash": "4.17.25",
|
|
52
51
|
"@types/mocha": "10.0.10",
|
|
53
52
|
"@types/ndjson": "2.0.4",
|
|
54
53
|
"@types/node": "22.20.1",
|
|
55
54
|
"@types/tmp": "0.2.6",
|
|
56
55
|
"@types/ws": "8.18.1",
|
|
57
|
-
"chai": "4.5.0",
|
|
58
56
|
"eslint": "9.32.0",
|
|
59
57
|
"eslint-plugin-kuzzle": "1.0.0",
|
|
60
58
|
"globby": "11.1.0",
|
|
61
59
|
"mocha": "12.0.0",
|
|
62
60
|
"nyc": "15.1.0",
|
|
61
|
+
"oclif": "5.0.1",
|
|
63
62
|
"semantic-release": "25.0.8",
|
|
64
63
|
"semantic-release-config-kuzzle": "1.7.0",
|
|
65
64
|
"should": "13.2.3",
|
|
@@ -85,9 +84,11 @@
|
|
|
85
84
|
"oclif": {
|
|
86
85
|
"commands": "./lib/commands",
|
|
87
86
|
"bin": "kourou",
|
|
87
|
+
"helpClass": "./lib/help",
|
|
88
88
|
"plugins": [
|
|
89
89
|
"@oclif/plugin-help",
|
|
90
|
-
"@oclif/plugin-autocomplete"
|
|
90
|
+
"@oclif/plugin-autocomplete",
|
|
91
|
+
"@oclif/plugin-version"
|
|
91
92
|
],
|
|
92
93
|
"repositoryPrefix": "<%- commandPath %>",
|
|
93
94
|
"topics": {
|