kourou 1.4.0-dev.1 → 1.4.0-dev.3
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 +7 -1
- package/lib/commands/app/debug-proxy.js +3 -3
- package/lib/commands/app/doctor.js +8 -5
- package/lib/commands/app/scaffold.js +3 -3
- package/lib/commands/app/start-services.js +4 -4
- package/lib/commands/collection/create.js +1 -1
- package/lib/commands/collection/export.js +3 -3
- package/lib/commands/collection/import.js +3 -3
- package/lib/commands/collection/migrate.js +7 -8
- package/lib/commands/config/diff.js +5 -4
- package/lib/commands/document/search.js +1 -1
- package/lib/commands/es/aliases/cat.d.ts +2 -2
- package/lib/commands/es/aliases/cat.js +10 -10
- package/lib/commands/es/indices/cat.js +2 -2
- package/lib/commands/es/indices/get.js +1 -1
- package/lib/commands/es/indices/insert.js +1 -1
- package/lib/commands/es/migrate.js +6 -8
- package/lib/commands/es/snapshot/create-repository.js +1 -1
- package/lib/commands/es/snapshot/create.d.ts +1 -0
- package/lib/commands/es/snapshot/create.js +14 -2
- package/lib/commands/es/snapshot/list.js +1 -1
- package/lib/commands/es/snapshot/restore.d.ts +1 -0
- package/lib/commands/es/snapshot/restore.js +14 -2
- package/lib/commands/file/decrypt.js +2 -2
- package/lib/commands/file/encrypt.js +2 -2
- package/lib/commands/file/test.js +2 -2
- package/lib/commands/import.js +3 -3
- package/lib/commands/index/export.js +4 -4
- package/lib/commands/index/import.js +3 -3
- package/lib/commands/instance/kill.js +5 -5
- package/lib/commands/instance/list.js +6 -1
- package/lib/commands/instance/logs.js +1 -1
- package/lib/commands/instance/spawn.js +6 -6
- package/lib/commands/paas/login.js +4 -9
- package/lib/commands/profile/export.js +3 -3
- package/lib/commands/profile/import.js +2 -2
- package/lib/commands/realtime/subscribe.js +2 -2
- package/lib/commands/redis/list-keys.js +1 -1
- package/lib/commands/role/export.js +3 -3
- package/lib/commands/role/import.js +2 -2
- package/lib/commands/sdk/execute.js +5 -3
- package/lib/commands/sdk/query.js +2 -2
- package/lib/commands/user/export-mappings.js +3 -3
- package/lib/commands/user/export.js +5 -5
- package/lib/commands/user/import-mappings.js +2 -2
- package/lib/commands/user/import.js +2 -2
- package/lib/commands/vault/add.js +2 -2
- package/lib/commands/vault/decrypt.js +2 -2
- package/lib/commands/vault/encrypt.js +3 -3
- package/lib/commands/vault/show.js +3 -3
- package/lib/commands/vault/test.js +1 -1
- package/lib/common.js +8 -8
- package/lib/hooks/command_not_found/api-action.js +5 -3
- package/lib/support/PaasKommand.d.ts +1 -1
- package/lib/support/PaasKommand.js +2 -2
- package/lib/support/docker/checkPrerequisites.js +1 -1
- package/lib/support/dump-collection.js +5 -5
- package/lib/support/editor.js +2 -2
- package/lib/support/execute.d.ts +1 -1
- package/lib/support/kuzzle.d.ts +1 -1
- package/lib/support/kuzzle.js +2 -2
- package/lib/support/migrate/providers/elasticsearch7.js +6 -8
- package/lib/support/migrate/providers/elasticsearch8.js +6 -8
- package/lib/support/migrate/providers/elasticsearchTypes.d.ts +1 -1
- package/lib/support/migrate/providers/file.js +4 -5
- package/lib/support/migrate/providers/index.js +5 -11
- package/lib/support/migrate/types.d.ts +1 -1
- package/lib/support/restore-collection.js +4 -4
- package/lib/support/restore-securities.js +2 -2
- package/package.json +49 -44
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const command_1 = require("@oclif/command");
|
|
5
|
-
const fs_1 =
|
|
6
|
-
const cli_ux_1 =
|
|
7
|
-
const path_1 =
|
|
5
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
6
|
+
const cli_ux_1 = tslib_1.__importDefault(require("cli-ux"));
|
|
7
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
8
8
|
const common_1 = require("../../common");
|
|
9
9
|
const kuzzle_1 = require("../../support/kuzzle");
|
|
10
10
|
const dump_collection_1 = require("../../support/dump-collection");
|
|
@@ -39,7 +39,6 @@ class IndexExport extends common_1.Kommand {
|
|
|
39
39
|
this.logOk(`Index ${this.args.index} dumped`);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
exports.default = IndexExport;
|
|
43
42
|
IndexExport.keepAuth = true;
|
|
44
43
|
IndexExport.description = "Exports an index (JSONL or Kuzzle format)";
|
|
45
44
|
IndexExport.flags = Object.assign(Object.assign({ help: command_1.flags.help({}), path: command_1.flags.string({
|
|
@@ -69,3 +68,4 @@ IndexExport.examples = [
|
|
|
69
68
|
"kourou index:export nyc-open-data",
|
|
70
69
|
'kourou index:export nyc-open-data --query \'{"range":{"_kuzzle_info.createdAt":{"gt":1632935638866}}}\'',
|
|
71
70
|
];
|
|
71
|
+
exports.default = IndexExport;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const path_1 =
|
|
5
|
-
const fs_1 =
|
|
4
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
5
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
6
6
|
const command_1 = require("@oclif/command");
|
|
7
7
|
const common_1 = require("../../common");
|
|
8
8
|
const kuzzle_1 = require("../../support/kuzzle");
|
|
@@ -34,7 +34,6 @@ class IndexImport extends common_1.Kommand {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
exports.default = IndexImport;
|
|
38
37
|
IndexImport.keepAuth = true;
|
|
39
38
|
IndexImport.description = "Imports an index (JSONL format)";
|
|
40
39
|
IndexImport.examples = [
|
|
@@ -55,3 +54,4 @@ IndexImport.flags = Object.assign(Object.assign({ help: command_1.flags.help({})
|
|
|
55
54
|
IndexImport.args = [
|
|
56
55
|
{ name: "path", description: "Dump directory or file", required: true },
|
|
57
56
|
];
|
|
57
|
+
exports.default = IndexImport;
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.InstanceLogs = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const path_1 =
|
|
5
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
6
6
|
const command_1 = require("@oclif/command");
|
|
7
|
-
const inquirer_1 =
|
|
8
|
-
const cli_ux_1 =
|
|
7
|
+
const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
|
|
8
|
+
const cli_ux_1 = tslib_1.__importDefault(require("cli-ux"));
|
|
9
9
|
const child_process_1 = require("child_process");
|
|
10
|
-
const chalk_1 =
|
|
11
|
-
const node_emoji_1 =
|
|
10
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
11
|
+
const node_emoji_1 = tslib_1.__importDefault(require("node-emoji"));
|
|
12
12
|
const common_1 = require("../../common");
|
|
13
13
|
const execute_1 = require("../../support/execute");
|
|
14
14
|
class InstanceLogs extends common_1.Kommand {
|
|
@@ -35,7 +35,12 @@ class InstanceList extends common_1.Kommand {
|
|
|
35
35
|
c.match(/stack-\d{0,3}_redis_1/));
|
|
36
36
|
const stacks = [
|
|
37
37
|
...new Set(containersList.map((container) => container.split("_")[0])),
|
|
38
|
-
].sort((stackA, stackB) =>
|
|
38
|
+
].sort((stackA, stackB) => {
|
|
39
|
+
if (stackA > stackB) {
|
|
40
|
+
return 1;
|
|
41
|
+
}
|
|
42
|
+
return stackA < stackB ? -1 : 0;
|
|
43
|
+
});
|
|
39
44
|
const formatedStacks = stacks.map((stack) => ({
|
|
40
45
|
name: stack,
|
|
41
46
|
status: "",
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.InstanceLogs = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const command_1 = require("@oclif/command");
|
|
6
|
-
const inquirer_1 =
|
|
6
|
+
const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
|
|
7
7
|
const common_1 = require("../../common");
|
|
8
8
|
const execute_1 = require("../../support/execute");
|
|
9
9
|
class InstanceLogs extends common_1.Kommand {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const path_1 =
|
|
4
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
5
5
|
const fs_1 = require("fs");
|
|
6
|
-
const net_1 =
|
|
6
|
+
const net_1 = tslib_1.__importDefault(require("net"));
|
|
7
7
|
const command_1 = require("@oclif/command");
|
|
8
|
-
const chalk_1 =
|
|
8
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
9
9
|
const child_process_1 = require("child_process");
|
|
10
|
-
const cli_ux_1 =
|
|
11
|
-
const node_emoji_1 =
|
|
10
|
+
const cli_ux_1 = tslib_1.__importDefault(require("cli-ux"));
|
|
11
|
+
const node_emoji_1 = tslib_1.__importDefault(require("node-emoji"));
|
|
12
12
|
const common_1 = require("../../common");
|
|
13
13
|
const execute_1 = require("../../support/execute");
|
|
14
14
|
const checkPrerequisites_1 = require("../../support/docker/checkPrerequisites");
|
|
@@ -159,7 +159,6 @@ class InstanceSpawn extends common_1.Kommand {
|
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
|
-
exports.default = InstanceSpawn;
|
|
163
162
|
InstanceSpawn.initSdk = false;
|
|
164
163
|
InstanceSpawn.description = "Spawn a new Kuzzle instance";
|
|
165
164
|
InstanceSpawn.flags = {
|
|
@@ -174,3 +173,4 @@ InstanceSpawn.flags = {
|
|
|
174
173
|
default: "2",
|
|
175
174
|
}),
|
|
176
175
|
};
|
|
176
|
+
exports.default = InstanceSpawn;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const fs_1 =
|
|
5
|
-
const node_fetch_1 =
|
|
4
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
5
|
+
const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
|
|
6
6
|
const command_1 = require("@oclif/command");
|
|
7
|
-
const cli_ux_1 =
|
|
7
|
+
const cli_ux_1 = tslib_1.__importDefault(require("cli-ux"));
|
|
8
8
|
const PaasKommand_1 = require("../../support/PaasKommand");
|
|
9
9
|
const child_process_1 = require("child_process");
|
|
10
10
|
class PaasLogin extends PaasKommand_1.PaasKommand {
|
|
@@ -56,12 +56,7 @@ class PaasLogin extends PaasKommand_1.PaasKommand {
|
|
|
56
56
|
throw new Error(json.error);
|
|
57
57
|
}
|
|
58
58
|
const { token } = json;
|
|
59
|
-
(0, child_process_1.spawnSync)("npm", [
|
|
60
|
-
"config",
|
|
61
|
-
"set",
|
|
62
|
-
"@kuzzleio:registry",
|
|
63
|
-
`https://${this.packagesHost}`,
|
|
64
|
-
], { stdio: "inherit" });
|
|
59
|
+
(0, child_process_1.spawnSync)("npm", ["config", "set", "@kuzzleio:registry", `https://${this.packagesHost}`], { stdio: "inherit" });
|
|
65
60
|
(0, child_process_1.spawnSync)("npm", ["set", `//${this.packagesHost}/:_authToken`, token], {
|
|
66
61
|
stdio: "inherit",
|
|
67
62
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const fs_1 =
|
|
5
|
-
const path_1 =
|
|
4
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
5
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
6
6
|
const command_1 = require("@oclif/command");
|
|
7
7
|
const common_1 = require("../../common");
|
|
8
8
|
const kuzzle_1 = require("../../support/kuzzle");
|
|
@@ -35,7 +35,6 @@ class ProfileExport extends common_1.Kommand {
|
|
|
35
35
|
return profiles;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
exports.default = ProfileExport;
|
|
39
38
|
ProfileExport.description = "Exports profiles";
|
|
40
39
|
ProfileExport.flags = Object.assign(Object.assign({ help: command_1.flags.help({}), path: command_1.flags.string({
|
|
41
40
|
description: "Dump directory",
|
|
@@ -44,3 +43,4 @@ ProfileExport.flags = Object.assign(Object.assign({ help: command_1.flags.help({
|
|
|
44
43
|
description: "Kuzzle protocol (http or websocket)",
|
|
45
44
|
default: "ws",
|
|
46
45
|
}) });
|
|
46
|
+
exports.default = ProfileExport;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const command_1 = require("@oclif/command");
|
|
5
|
-
const fs_1 =
|
|
5
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
6
6
|
const common_1 = require("../../common");
|
|
7
7
|
const kuzzle_1 = require("../../support/kuzzle");
|
|
8
8
|
const restore_securities_1 = require("../../support/restore-securities");
|
|
@@ -14,10 +14,10 @@ class ProfileImport extends common_1.Kommand {
|
|
|
14
14
|
this.logOk(`${count} profiles restored`);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
exports.default = ProfileImport;
|
|
18
17
|
ProfileImport.description = "Imports profiles";
|
|
19
18
|
ProfileImport.flags = Object.assign(Object.assign({ help: command_1.flags.help({}) }, kuzzle_1.kuzzleFlags), { protocol: command_1.flags.string({
|
|
20
19
|
description: "Kuzzle protocol (http or websocket)",
|
|
21
20
|
default: "ws",
|
|
22
21
|
}) });
|
|
23
22
|
ProfileImport.args = [{ name: "path", description: "Dump file", required: true }];
|
|
23
|
+
exports.default = ProfileImport;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const command_1 = require("@oclif/command");
|
|
5
|
-
const lodash_1 =
|
|
5
|
+
const lodash_1 = tslib_1.__importDefault(require("lodash"));
|
|
6
6
|
const common_1 = require("../../common");
|
|
7
7
|
const kuzzle_1 = require("../../support/kuzzle");
|
|
8
8
|
class RealtimeSubscribe extends common_1.Kommand {
|
|
@@ -33,7 +33,6 @@ class RealtimeSubscribe extends common_1.Kommand {
|
|
|
33
33
|
await new Promise(() => { });
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
exports.default = RealtimeSubscribe;
|
|
37
36
|
RealtimeSubscribe.description = "Subscribes to realtime notifications";
|
|
38
37
|
RealtimeSubscribe.examples = [
|
|
39
38
|
"kourou realtime:subscribe iot-data sensors",
|
|
@@ -66,3 +65,4 @@ RealtimeSubscribe.args = [
|
|
|
66
65
|
{ name: "filters", description: "Set of Koncorde filters" },
|
|
67
66
|
];
|
|
68
67
|
RealtimeSubscribe.readStdin = true;
|
|
68
|
+
exports.default = RealtimeSubscribe;
|
|
@@ -39,7 +39,6 @@ class RedisListKeys extends common_1.Kommand {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
exports.default = RedisListKeys;
|
|
43
42
|
RedisListKeys.description = "Lists keys stored in Redis";
|
|
44
43
|
RedisListKeys.flags = Object.assign({ help: command_1.flags.help(), remove: command_1.flags.boolean({
|
|
45
44
|
description: "Remove matching keys",
|
|
@@ -63,3 +62,4 @@ RedisListKeys.examples = [
|
|
|
63
62
|
'kourou redis:list-keys "counters/*" --remove',
|
|
64
63
|
];
|
|
65
64
|
RedisListKeys.readStdin = true;
|
|
65
|
+
exports.default = RedisListKeys;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const fs_1 =
|
|
5
|
-
const path_1 =
|
|
4
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
5
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
6
6
|
const command_1 = require("@oclif/command");
|
|
7
7
|
const common_1 = require("../../common");
|
|
8
8
|
const kuzzle_1 = require("../../support/kuzzle");
|
|
@@ -34,7 +34,6 @@ class RoleDump extends common_1.Kommand {
|
|
|
34
34
|
return roles;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
exports.default = RoleDump;
|
|
38
37
|
RoleDump.description = "Exports roles";
|
|
39
38
|
RoleDump.flags = Object.assign(Object.assign({ help: command_1.flags.help({}), path: command_1.flags.string({
|
|
40
39
|
description: "Dump directory",
|
|
@@ -43,3 +42,4 @@ RoleDump.flags = Object.assign(Object.assign({ help: command_1.flags.help({}), p
|
|
|
43
42
|
description: "Kuzzle protocol (http or websocket)",
|
|
44
43
|
default: "ws",
|
|
45
44
|
}) });
|
|
45
|
+
exports.default = RoleDump;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const fs_1 =
|
|
4
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
5
5
|
const command_1 = require("@oclif/command");
|
|
6
6
|
const common_1 = require("../../common");
|
|
7
7
|
const kuzzle_1 = require("../../support/kuzzle");
|
|
@@ -14,7 +14,6 @@ class RoleImport extends common_1.Kommand {
|
|
|
14
14
|
this.logOk(`${count} roles restored`);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
exports.default = RoleImport;
|
|
18
17
|
RoleImport.description = "Import roles";
|
|
19
18
|
RoleImport.flags = Object.assign(Object.assign({ "preserve-anonymous": command_1.flags.boolean({
|
|
20
19
|
description: "Preserve anonymous rights",
|
|
@@ -24,3 +23,4 @@ RoleImport.flags = Object.assign(Object.assign({ "preserve-anonymous": command_1
|
|
|
24
23
|
default: "ws",
|
|
25
24
|
}) });
|
|
26
25
|
RoleImport.args = [{ name: "path", description: "Dump file", required: true }];
|
|
26
|
+
exports.default = RoleImport;
|
|
@@ -6,8 +6,8 @@ const lodash_1 = require("lodash");
|
|
|
6
6
|
const editor_1 = require("../../support/editor");
|
|
7
7
|
const common_1 = require("../../common");
|
|
8
8
|
const kuzzle_1 = require("../../support/kuzzle");
|
|
9
|
-
const typescript_1 =
|
|
10
|
-
const node_vm_1 =
|
|
9
|
+
const typescript_1 = tslib_1.__importDefault(require("typescript"));
|
|
10
|
+
const node_vm_1 = tslib_1.__importDefault(require("node:vm"));
|
|
11
11
|
class SdkExecute extends common_1.Kommand {
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments);
|
|
@@ -20,7 +20,9 @@ class SdkExecute extends common_1.Kommand {
|
|
|
20
20
|
}
|
|
21
21
|
catch (e) {
|
|
22
22
|
if (e.name === "SyntaxError") {
|
|
23
|
-
const result = typescript_1.default.transpileModule(this.code, {
|
|
23
|
+
const result = typescript_1.default.transpileModule(this.code, {
|
|
24
|
+
compilerOptions: { module: typescript_1.default.ModuleKind.CommonJS },
|
|
25
|
+
});
|
|
24
26
|
this.code = result.outputText;
|
|
25
27
|
}
|
|
26
28
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const command_1 = require("@oclif/command");
|
|
5
|
-
const lodash_1 =
|
|
5
|
+
const lodash_1 = tslib_1.__importDefault(require("lodash"));
|
|
6
6
|
const common_1 = require("../../common");
|
|
7
7
|
const kuzzle_1 = require("../../support/kuzzle");
|
|
8
8
|
class SdkQuery extends common_1.Kommand {
|
|
@@ -34,7 +34,7 @@ class SdkQuery extends common_1.Kommand {
|
|
|
34
34
|
const display = this.flags.display === ""
|
|
35
35
|
? response
|
|
36
36
|
: lodash_1.default.get(response, this.flags.display);
|
|
37
|
-
|
|
37
|
+
this.log(JSON.stringify(display, null, 2));
|
|
38
38
|
this.logOk(`Successfully executed "${controller}:${action}"`);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const fs_1 =
|
|
5
|
-
const path_1 =
|
|
4
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
5
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
6
6
|
const command_1 = require("@oclif/command");
|
|
7
7
|
const common_1 = require("../../common");
|
|
8
8
|
const kuzzle_1 = require("../../support/kuzzle");
|
|
@@ -20,7 +20,6 @@ class UserExportMappings extends common_1.Kommand {
|
|
|
20
20
|
this.logOk("Users collection mappings dumped");
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
exports.default = UserExportMappings;
|
|
24
23
|
UserExportMappings.description = "Exports users collection mappings to JSON.";
|
|
25
24
|
UserExportMappings.flags = Object.assign(Object.assign({ help: command_1.flags.help({}), path: command_1.flags.string({
|
|
26
25
|
description: "Dump directory",
|
|
@@ -29,3 +28,4 @@ UserExportMappings.flags = Object.assign(Object.assign({ help: command_1.flags.h
|
|
|
29
28
|
description: "Kuzzle protocol (http or websocket)",
|
|
30
29
|
default: "ws",
|
|
31
30
|
}) });
|
|
31
|
+
exports.default = UserExportMappings;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const fs_1 =
|
|
5
|
-
const lodash_1 =
|
|
6
|
-
const crypto_1 =
|
|
7
|
-
const path_1 =
|
|
4
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
5
|
+
const lodash_1 = tslib_1.__importDefault(require("lodash"));
|
|
6
|
+
const crypto_1 = tslib_1.__importDefault(require("crypto"));
|
|
7
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
8
8
|
const command_1 = require("@oclif/command");
|
|
9
9
|
const common_1 = require("../../common");
|
|
10
10
|
const kuzzle_1 = require("../../support/kuzzle");
|
|
@@ -67,7 +67,6 @@ class UserExport extends common_1.Kommand {
|
|
|
67
67
|
return users;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
exports.default = UserExport;
|
|
71
70
|
UserExport.description = `
|
|
72
71
|
Exports users to JSON.
|
|
73
72
|
|
|
@@ -110,3 +109,4 @@ UserExport.flags = Object.assign(Object.assign({ help: command_1.flags.help({}),
|
|
|
110
109
|
description: "Kuzzle protocol (http or websocket)",
|
|
111
110
|
default: "ws",
|
|
112
111
|
}) });
|
|
112
|
+
exports.default = UserExport;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const command_1 = require("@oclif/command");
|
|
5
|
-
const fs_1 =
|
|
5
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
6
6
|
const common_1 = require("../../common");
|
|
7
7
|
const kuzzle_1 = require("../../support/kuzzle");
|
|
8
8
|
class UserImportMappings extends common_1.Kommand {
|
|
@@ -14,10 +14,10 @@ class UserImportMappings extends common_1.Kommand {
|
|
|
14
14
|
this.logOk("Users collecction mappings restored");
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
exports.default = UserImportMappings;
|
|
18
17
|
UserImportMappings.description = "Imports users collection mappings";
|
|
19
18
|
UserImportMappings.flags = Object.assign(Object.assign({ help: command_1.flags.help({}) }, kuzzle_1.kuzzleFlags), { protocol: command_1.flags.string({
|
|
20
19
|
description: "Kuzzle protocol (http or websocket)",
|
|
21
20
|
default: "ws",
|
|
22
21
|
}) });
|
|
23
22
|
UserImportMappings.args = [{ name: "path", description: "Dump file", required: true }];
|
|
23
|
+
exports.default = UserImportMappings;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const command_1 = require("@oclif/command");
|
|
5
|
-
const fs_1 =
|
|
5
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
6
6
|
const common_1 = require("../../common");
|
|
7
7
|
const kuzzle_1 = require("../../support/kuzzle");
|
|
8
8
|
const restore_securities_1 = require("../../support/restore-securities");
|
|
@@ -14,10 +14,10 @@ class UserImport extends common_1.Kommand {
|
|
|
14
14
|
this.logOk(`${count} users restored`);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
exports.default = UserImport;
|
|
18
17
|
UserImport.description = "Imports users";
|
|
19
18
|
UserImport.flags = Object.assign(Object.assign({ help: command_1.flags.help({}) }, kuzzle_1.kuzzleFlags), { protocol: command_1.flags.string({
|
|
20
19
|
description: "Kuzzle protocol (http or websocket)",
|
|
21
20
|
default: "ws",
|
|
22
21
|
}) });
|
|
23
22
|
UserImport.args = [{ name: "path", description: "Dump file", required: true }];
|
|
23
|
+
exports.default = UserImport;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VaultAdd = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const fs_1 =
|
|
5
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
6
6
|
const command_1 = require("@oclif/command");
|
|
7
|
-
const lodash_1 =
|
|
7
|
+
const lodash_1 = tslib_1.__importDefault(require("lodash"));
|
|
8
8
|
const kuzzle_vault_1 = require("kuzzle-vault");
|
|
9
9
|
const common_1 = require("../../common");
|
|
10
10
|
class VaultAdd extends common_1.Kommand {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VaultDecrypt = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const fs_1 =
|
|
6
|
-
const lodash_1 =
|
|
5
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
6
|
+
const lodash_1 = tslib_1.__importDefault(require("lodash"));
|
|
7
7
|
const command_1 = require("@oclif/command");
|
|
8
8
|
const kuzzle_vault_1 = require("kuzzle-vault");
|
|
9
9
|
const common_1 = require("../../common");
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VaultEncrypt = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const fs_1 =
|
|
6
|
-
const path_1 =
|
|
7
|
-
const lodash_1 =
|
|
5
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
6
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
7
|
+
const lodash_1 = tslib_1.__importDefault(require("lodash"));
|
|
8
8
|
const command_1 = require("@oclif/command");
|
|
9
9
|
const kuzzle_vault_1 = require("kuzzle-vault");
|
|
10
10
|
const common_1 = require("../../common");
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.VaultShow = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const command_1 = require("@oclif/command");
|
|
6
|
-
const lodash_1 =
|
|
7
|
-
const fs_1 =
|
|
8
|
-
const chalk_1 =
|
|
6
|
+
const lodash_1 = tslib_1.__importDefault(require("lodash"));
|
|
7
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
8
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
9
9
|
const kuzzle_vault_1 = require("kuzzle-vault");
|
|
10
10
|
const common_1 = require("../../common");
|
|
11
11
|
class VaultShow extends common_1.Kommand {
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.VaultTest = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const command_1 = require("@oclif/command");
|
|
6
|
-
const lodash_1 =
|
|
6
|
+
const lodash_1 = tslib_1.__importDefault(require("lodash"));
|
|
7
7
|
const kuzzle_vault_1 = require("kuzzle-vault");
|
|
8
8
|
const common_1 = require("../../common");
|
|
9
9
|
class VaultTest extends common_1.Kommand {
|
package/lib/common.js
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.formatValueForCSV = exports.pickValues = exports.Kommand = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const os_1 =
|
|
6
|
-
const fs_1 =
|
|
7
|
-
const path_1 =
|
|
5
|
+
const os_1 = tslib_1.__importDefault(require("os"));
|
|
6
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
7
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
8
8
|
const command_1 = require("@oclif/command");
|
|
9
|
-
const chalk_1 =
|
|
10
|
-
const node_emoji_1 =
|
|
11
|
-
const get_1 =
|
|
12
|
-
const isObject_1 =
|
|
13
|
-
const kepler_companion_1 =
|
|
9
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
10
|
+
const node_emoji_1 = tslib_1.__importDefault(require("node-emoji"));
|
|
11
|
+
const get_1 = tslib_1.__importDefault(require("lodash/get"));
|
|
12
|
+
const isObject_1 = tslib_1.__importDefault(require("lodash/isObject"));
|
|
13
|
+
const kepler_companion_1 = tslib_1.__importDefault(require("kepler-companion"));
|
|
14
14
|
const kuzzle_1 = require("./support/kuzzle");
|
|
15
15
|
const editor_1 = require("./support/editor");
|
|
16
16
|
class Kommand extends command_1.Command {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const chalk_1 =
|
|
5
|
-
const query_1 =
|
|
4
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
5
|
+
const query_1 = tslib_1.__importDefault(require("../../commands/sdk/query"));
|
|
6
6
|
/**
|
|
7
7
|
* Hooks that run the corresponding API action with sdk:query.
|
|
8
8
|
*
|
|
@@ -28,11 +28,13 @@ const query_1 = (0, tslib_1.__importDefault)(require("../../commands/sdk/query")
|
|
|
28
28
|
* - kourou document:create index collection foobar-1 '{}'
|
|
29
29
|
* - kourou bulk:import index collection '{bulkData: []}'
|
|
30
30
|
*/
|
|
31
|
-
const hook = async function (opts) {
|
|
31
|
+
const hook = async function apiActionHook(opts) {
|
|
32
32
|
const [controller, action] = opts.id.split(":");
|
|
33
33
|
if (!controller || !action) {
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
|
+
// oclif binds the hook to its own context before calling it
|
|
37
|
+
// eslint-disable-next-line no-invalid-this
|
|
36
38
|
this.log(chalk_1.default.yellow(`[ℹ] Unknown command "${opts.id}", fallback to API action`));
|
|
37
39
|
const args = process.argv.slice(3);
|
|
38
40
|
const commandArgs = [opts.id];
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PaasKommand = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const fs_1 =
|
|
6
|
-
const path_1 =
|
|
5
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
6
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
7
7
|
const common_1 = require("../common");
|
|
8
8
|
const kuzzle_1 = require("./kuzzle");
|
|
9
9
|
class PaasKommand extends common_1.Kommand {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.checkPrerequisites = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const listr_1 =
|
|
5
|
+
const listr_1 = tslib_1.__importDefault(require("listr"));
|
|
6
6
|
const execute_1 = require("../execute");
|
|
7
7
|
async function checkPrerequisites(ctx) {
|
|
8
8
|
const checks = new listr_1.default([
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.dumpCollectionMappings = exports.dumpCollectionData = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const fs_1 =
|
|
6
|
-
const path_1 =
|
|
7
|
-
const cli_ux_1 =
|
|
8
|
-
const ndjson_1 =
|
|
5
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
6
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
7
|
+
const cli_ux_1 = tslib_1.__importDefault(require("cli-ux"));
|
|
8
|
+
const ndjson_1 = tslib_1.__importDefault(require("ndjson"));
|
|
9
9
|
const common_1 = require("../common");
|
|
10
10
|
/**
|
|
11
11
|
* Flatten an object transform:
|
|
@@ -246,7 +246,7 @@ async function dumpCollectionMappings(sdk, index, collection, destPath, format =
|
|
|
246
246
|
content: {
|
|
247
247
|
[index]: {
|
|
248
248
|
[collection]: {
|
|
249
|
-
mappings
|
|
249
|
+
mappings,
|
|
250
250
|
// For later use, we could add the settings here
|
|
251
251
|
// eg: "settings": { "index.mapping.total_fields.limit": 10000 }
|
|
252
252
|
// This can be added after the dump and it will work with kourou:import command
|
package/lib/support/editor.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Editor = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const fs_1 =
|
|
5
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
6
6
|
const child_process_1 = require("child_process");
|
|
7
|
-
const tmp_1 =
|
|
7
|
+
const tmp_1 = tslib_1.__importDefault(require("tmp"));
|
|
8
8
|
class Editor {
|
|
9
9
|
constructor(content = "", options = {}) {
|
|
10
10
|
this._content = content;
|
package/lib/support/execute.d.ts
CHANGED
package/lib/support/kuzzle.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ export declare class KuzzleSDK {
|
|
|
50
50
|
get document(): import("kuzzle-sdk").DocumentController;
|
|
51
51
|
get collection(): import("kuzzle-sdk").CollectionController;
|
|
52
52
|
get index(): import("kuzzle-sdk").IndexController;
|
|
53
|
-
get security(): import("kuzzle-sdk/src/controllers/Security").SecurityController;
|
|
53
|
+
get security(): import("kuzzle-sdk/out/src/controllers/Security").SecurityController;
|
|
54
54
|
get auth(): import("kuzzle-sdk").AuthController;
|
|
55
55
|
get server(): import("kuzzle-sdk").ServerController;
|
|
56
56
|
get realtime(): import("kuzzle-sdk").RealtimeController;
|