kourou 0.20.6 → 0.21.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 +74 -10
- package/lib/commands/app/scaffold.d.ts +3 -3
- package/lib/commands/app/scaffold.js +16 -69
- package/lib/commands/app/start-services.js +6 -4
- package/lib/commands/collection/export.d.ts +2 -0
- package/lib/commands/collection/export.js +7 -3
- package/lib/commands/collection/import.d.ts +1 -0
- package/lib/commands/collection/import.js +3 -2
- package/lib/commands/config/diff.js +3 -3
- package/lib/commands/es/migrate.js +3 -3
- 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.d.ts +1 -0
- package/lib/commands/import.js +3 -2
- package/lib/commands/index/export.d.ts +1 -0
- package/lib/commands/index/export.js +4 -3
- package/lib/commands/index/import.d.ts +1 -0
- package/lib/commands/index/import.js +3 -2
- package/lib/commands/instance/kill.js +7 -5
- package/lib/commands/instance/logs.js +1 -1
- package/lib/commands/instance/spawn.js +8 -7
- package/lib/commands/paas/init.d.ts +14 -0
- package/lib/commands/paas/init.js +41 -0
- package/lib/commands/paas/login.d.ts +14 -0
- package/lib/commands/paas/login.js +42 -0
- package/lib/commands/paas/publish.d.ts +18 -0
- package/lib/commands/paas/publish.js +62 -0
- package/lib/commands/profile/export.js +2 -2
- package/lib/commands/profile/import.js +1 -1
- package/lib/commands/realtime/subscribe.js +1 -1
- package/lib/commands/role/export.js +2 -2
- package/lib/commands/role/import.js +1 -1
- package/lib/commands/sdk/query.js +1 -1
- package/lib/commands/user/export-mappings.js +2 -2
- package/lib/commands/user/export.js +4 -4
- package/lib/commands/user/import-mappings.js +1 -1
- package/lib/commands/user/import.js +1 -1
- package/lib/commands/vault/add.js +2 -2
- package/lib/commands/vault/decrypt.js +2 -2
- package/lib/commands/vault/encrypt.js +2 -2
- package/lib/commands/vault/show.js +3 -3
- package/lib/commands/vault/test.js +1 -1
- package/lib/common.d.ts +6 -1
- package/lib/common.js +25 -13
- package/lib/hooks/command_not_found/api-action.js +10 -6
- package/lib/support/PaasKommand.d.ts +22 -0
- package/lib/support/PaasKommand.js +52 -0
- package/lib/support/dump-collection.d.ts +1 -1
- package/lib/support/dump-collection.js +14 -12
- package/lib/support/editor.js +2 -2
- package/lib/support/kuzzle.d.ts +2 -0
- package/lib/support/kuzzle.js +14 -10
- package/lib/support/restore-collection.js +3 -3
- package/lib/support/restore-securities.js +2 -2
- package/package.json +8 -11
- package/oclif.manifest.json +0 -1
- package/scripts/postinstall.sh +0 -10
- package/templates.tgz +0 -0
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ The CLI that helps you manage your Kuzzle instances.
|
|
|
13
13
|
* [Commands](#commands)
|
|
14
14
|
* [Where does this weird name come from?](#where-does-this-weird-name-come-from)
|
|
15
15
|
* [Have fun with a quine](#have-fun-with-a-quine)
|
|
16
|
-
* [
|
|
16
|
+
* [Telemetry](#telemetry)
|
|
17
17
|
<!-- tocstop -->
|
|
18
18
|
|
|
19
19
|
:warning: This project is currently in beta and breaking changes may occur until the 1.0.0
|
|
@@ -26,7 +26,7 @@ $ npm install -g kourou
|
|
|
26
26
|
$ kourou COMMAND
|
|
27
27
|
running command...
|
|
28
28
|
$ kourou (-v|--version|version)
|
|
29
|
-
kourou/0.
|
|
29
|
+
kourou/0.21.1 linux-x64 node-v16.13.2
|
|
30
30
|
$ kourou --help [COMMAND]
|
|
31
31
|
USAGE
|
|
32
32
|
$ kourou COMMAND
|
|
@@ -129,7 +129,7 @@ All other arguments and options will be passed as-is to the `sdk:query` method.
|
|
|
129
129
|
* [`kourou api-key:create USER`](#kourou-api-keycreate-user)
|
|
130
130
|
* [`kourou api-key:delete USER ID`](#kourou-api-keydelete-user-id)
|
|
131
131
|
* [`kourou api-key:search USER`](#kourou-api-keysearch-user)
|
|
132
|
-
* [`kourou app:scaffold
|
|
132
|
+
* [`kourou app:scaffold DESTINATION`](#kourou-appscaffold-destination)
|
|
133
133
|
* [`kourou app:start-services`](#kourou-appstart-services)
|
|
134
134
|
* [`kourou autocomplete [SHELL]`](#kourou-autocomplete-shell)
|
|
135
135
|
* [`kourou collection:create INDEX COLLECTION [BODY]`](#kourou-collectioncreate-index-collection-body)
|
|
@@ -155,6 +155,9 @@ All other arguments and options will be passed as-is to the `sdk:query` method.
|
|
|
155
155
|
* [`kourou instance:list`](#kourou-instancelist)
|
|
156
156
|
* [`kourou instance:logs`](#kourou-instancelogs)
|
|
157
157
|
* [`kourou instance:spawn`](#kourou-instancespawn)
|
|
158
|
+
* [`kourou paas:init USERNAME NAMESPACE`](#kourou-paasinit-username-namespace)
|
|
159
|
+
* [`kourou paas:login`](#kourou-paaslogin)
|
|
160
|
+
* [`kourou paas:publish PROJECT IMAGE`](#kourou-paaspublish-project-image)
|
|
158
161
|
* [`kourou profile:export`](#kourou-profileexport)
|
|
159
162
|
* [`kourou profile:import PATH`](#kourou-profileimport-path)
|
|
160
163
|
* [`kourou realtime:subscribe INDEX COLLECTION [FILTERS]`](#kourou-realtimesubscribe-index-collection-filters)
|
|
@@ -284,19 +287,20 @@ OPTIONS
|
|
|
284
287
|
|
|
285
288
|
_See code: [src/commands/api-key/search.ts](src/commands/api-key/search.ts)_
|
|
286
289
|
|
|
287
|
-
## `kourou app:scaffold
|
|
290
|
+
## `kourou app:scaffold DESTINATION`
|
|
288
291
|
|
|
289
292
|
Scaffolds a new Kuzzle application
|
|
290
293
|
|
|
291
294
|
```
|
|
292
295
|
USAGE
|
|
293
|
-
$ kourou app:scaffold
|
|
296
|
+
$ kourou app:scaffold DESTINATION
|
|
294
297
|
|
|
295
298
|
ARGUMENTS
|
|
296
|
-
|
|
299
|
+
DESTINATION Directory to scaffold the app
|
|
297
300
|
|
|
298
301
|
OPTIONS
|
|
299
|
-
--
|
|
302
|
+
--flavor=flavor [default: generic] Template flavor ("generic", "iot-platform")
|
|
303
|
+
--help show CLI help
|
|
300
304
|
```
|
|
301
305
|
|
|
302
306
|
_See code: [src/commands/app/scaffold.ts](src/commands/app/scaffold.ts)_
|
|
@@ -337,7 +341,7 @@ EXAMPLES
|
|
|
337
341
|
$ kourou autocomplete --refresh-cache
|
|
338
342
|
```
|
|
339
343
|
|
|
340
|
-
_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/
|
|
344
|
+
_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v1.2.0/src/commands/autocomplete/index.ts)_
|
|
341
345
|
|
|
342
346
|
## `kourou collection:create INDEX COLLECTION [BODY]`
|
|
343
347
|
|
|
@@ -426,6 +430,10 @@ OPTIONS
|
|
|
426
430
|
--query=query
|
|
427
431
|
[default: {}] Only dump documents matching the query (JS or JSON format)
|
|
428
432
|
|
|
433
|
+
--scrollTTL=scrollTTL
|
|
434
|
+
The scroll TTL option to pass to the dump operation (which performs a document.search under the hood),
|
|
435
|
+
expressed in ms format, e.g. '2s', '1m', '3h'.
|
|
436
|
+
|
|
429
437
|
--ssl
|
|
430
438
|
Use SSL to connect to Kuzzle
|
|
431
439
|
|
|
@@ -907,6 +915,60 @@ OPTIONS
|
|
|
907
915
|
|
|
908
916
|
_See code: [src/commands/instance/spawn.ts](src/commands/instance/spawn.ts)_
|
|
909
917
|
|
|
918
|
+
## `kourou paas:init USERNAME NAMESPACE`
|
|
919
|
+
|
|
920
|
+
Initialize a PaaS namespace in current directory
|
|
921
|
+
|
|
922
|
+
```
|
|
923
|
+
USAGE
|
|
924
|
+
$ kourou paas:init USERNAME NAMESPACE
|
|
925
|
+
|
|
926
|
+
ARGUMENTS
|
|
927
|
+
USERNAME Username
|
|
928
|
+
NAMESPACE Namespace
|
|
929
|
+
|
|
930
|
+
OPTIONS
|
|
931
|
+
--help show CLI help
|
|
932
|
+
```
|
|
933
|
+
|
|
934
|
+
_See code: [src/commands/paas/init.ts](src/commands/paas/init.ts)_
|
|
935
|
+
|
|
936
|
+
## `kourou paas:login`
|
|
937
|
+
|
|
938
|
+
Login for a PaaS namespace
|
|
939
|
+
|
|
940
|
+
```
|
|
941
|
+
USAGE
|
|
942
|
+
$ kourou paas:login
|
|
943
|
+
|
|
944
|
+
OPTIONS
|
|
945
|
+
--help show CLI help
|
|
946
|
+
--namespace=namespace Current PaaS namespace
|
|
947
|
+
--username=username PaaS username
|
|
948
|
+
```
|
|
949
|
+
|
|
950
|
+
_See code: [src/commands/paas/login.ts](src/commands/paas/login.ts)_
|
|
951
|
+
|
|
952
|
+
## `kourou paas:publish PROJECT IMAGE`
|
|
953
|
+
|
|
954
|
+
Deploy a new version of the application in the PaaS
|
|
955
|
+
|
|
956
|
+
```
|
|
957
|
+
USAGE
|
|
958
|
+
$ kourou paas:publish PROJECT IMAGE
|
|
959
|
+
|
|
960
|
+
ARGUMENTS
|
|
961
|
+
PROJECT Project name
|
|
962
|
+
IMAGE Image name and hash
|
|
963
|
+
|
|
964
|
+
OPTIONS
|
|
965
|
+
--help show CLI help
|
|
966
|
+
--namespace=namespace Current PaaS namespace
|
|
967
|
+
--token=token Authentication token
|
|
968
|
+
```
|
|
969
|
+
|
|
970
|
+
_See code: [src/commands/paas/publish.ts](src/commands/paas/publish.ts)_
|
|
971
|
+
|
|
910
972
|
## `kourou profile:export`
|
|
911
973
|
|
|
912
974
|
Exports profiles
|
|
@@ -1551,8 +1613,10 @@ $ kourou sdk:execute --print-raw '(
|
|
|
1551
1613
|
|
|
1552
1614
|
(Kuzzle must be accessible and running in local)
|
|
1553
1615
|
|
|
1554
|
-
#
|
|
1616
|
+
# Telemetry
|
|
1617
|
+
|
|
1618
|
+
We use a custom Open Source analytics backend (you can check the code [here](https://gihtub.com/kuzzleio/kepler)) to record the use of Kourou by users.
|
|
1555
1619
|
|
|
1556
|
-
We use a custom Open Source analytics backend (you can check the code [here](https://gihtub.com/kuzzleio/kepler)) to record the use of Kourou by users.
|
|
1557
1620
|
Collected metrics will allow us to study the use of our products in order to improve them. We do not collect any personal data about users.
|
|
1621
|
+
|
|
1558
1622
|
You can disable usage metrics collection by setting the `KOUROU_USAGE` environment variable to `false`.
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import { flags } from '@oclif/command';
|
|
1
2
|
import { Kommand } from '../../common';
|
|
2
3
|
export default class AppScaffold extends Kommand {
|
|
3
4
|
static initSdk: boolean;
|
|
4
5
|
static description: string;
|
|
5
6
|
static flags: {
|
|
6
7
|
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
|
|
8
|
+
flavor: flags.IOptionFlag<string>;
|
|
7
9
|
};
|
|
8
10
|
static args: {
|
|
9
11
|
name: string;
|
|
10
12
|
description: string;
|
|
11
13
|
required: boolean;
|
|
12
14
|
}[];
|
|
13
|
-
checkKebabCase(name: string): boolean;
|
|
14
|
-
convertToKebabCase(name: string): string;
|
|
15
15
|
runSafe(): Promise<void>;
|
|
16
|
-
|
|
16
|
+
cloneTemplate(flavor: string, destination: string): Promise<void>;
|
|
17
17
|
}
|
|
@@ -1,86 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const path_1 = (0, tslib_1.__importDefault)(require("path"));
|
|
5
|
-
const fs_1 = (0, tslib_1.__importDefault)(require("fs"));
|
|
6
4
|
const command_1 = require("@oclif/command");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const listr_1 = (0, tslib_1.__importDefault)(require("listr"));
|
|
10
|
-
const inquirer_1 = (0, tslib_1.__importDefault)(require("inquirer"));
|
|
5
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
|
+
const listr_1 = tslib_1.__importDefault(require("listr"));
|
|
11
7
|
const common_1 = require("../../common");
|
|
12
8
|
const execute_1 = require("../../support/execute");
|
|
13
|
-
const templatesDir = path_1.default.join(__dirname, '..', '..', '..', 'templates');
|
|
14
|
-
const TEMPLATED_ENTRIES = [
|
|
15
|
-
'package.json',
|
|
16
|
-
'app.ts',
|
|
17
|
-
'README.md'
|
|
18
|
-
];
|
|
19
|
-
const KEBAB_CASE_REGEX = /^[a-z-\d]+$/;
|
|
20
9
|
class AppScaffold extends common_1.Kommand {
|
|
21
|
-
checkKebabCase(name) {
|
|
22
|
-
return KEBAB_CASE_REGEX.test(name);
|
|
23
|
-
}
|
|
24
|
-
convertToKebabCase(name) {
|
|
25
|
-
return name.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
|
26
|
-
}
|
|
27
10
|
async runSafe() {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const kebabCasedName = this.convertToKebabCase(this.args.name);
|
|
31
|
-
const response = await inquirer_1.default.prompt([
|
|
32
|
-
{
|
|
33
|
-
name: 'kebabCaseConversion',
|
|
34
|
-
type: 'confirm',
|
|
35
|
-
message: `Would you like to convert "${this.args.name}" to "${kebabCasedName}"`
|
|
36
|
-
}
|
|
37
|
-
]);
|
|
38
|
-
if (!response.kebabCaseConversion) {
|
|
39
|
-
process.exit(0);
|
|
40
|
-
}
|
|
41
|
-
this.args.name = kebabCasedName;
|
|
42
|
-
}
|
|
43
|
-
const templatePath = path_1.default.join(templatesDir, 'app-scaffold', 'ts');
|
|
11
|
+
const destination = this.args.destination;
|
|
12
|
+
const flavor = this.flags.flavor;
|
|
44
13
|
const tasks = new listr_1.default([
|
|
45
|
-
{
|
|
46
|
-
title: `Creating directory: ${chalk_1.default.gray(this.args.name + path_1.default.sep)}`,
|
|
47
|
-
task: () => (0, execute_1.execute)('mkdir', this.args.name)
|
|
48
|
-
},
|
|
49
14
|
{
|
|
50
15
|
title: 'Creating and rendering application files',
|
|
51
|
-
task: () => this.
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
title: 'Installing dependencies (this can take some time)',
|
|
55
|
-
task: () => (0, execute_1.execute)('npm', 'run', 'install:docker', { cwd: this.args.name })
|
|
16
|
+
task: async () => this.cloneTemplate(flavor, destination)
|
|
56
17
|
},
|
|
57
18
|
]);
|
|
58
19
|
await tasks.run();
|
|
59
|
-
this.
|
|
20
|
+
this.log('');
|
|
21
|
+
this.logOk(`Scaffolding complete! Use ${chalk_1.default.grey(`cd ${destination} && npm run docker npm install`)} install dependencies and then ${chalk_1.default.grey(`npm run docker:dev`)} to run your application!`);
|
|
60
22
|
}
|
|
61
|
-
async
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const entryDir = path_1.default.dirname(path_1.default.join(this.args.name, entryPath));
|
|
66
|
-
const entryInfo = fs_1.default.statSync(entryPath);
|
|
67
|
-
if (entryInfo.isDirectory()) {
|
|
68
|
-
fs_1.default.mkdirSync(entryDir.replace(templatePath, ''), { recursive: true });
|
|
69
|
-
await this.renderTemplates(entryPath, templatePath);
|
|
70
|
-
}
|
|
71
|
-
else if (entryInfo.isFile() || entryInfo.isSymbolicLink()) {
|
|
72
|
-
const content = fs_1.default.readFileSync(entryPath, 'utf8');
|
|
73
|
-
// Only render a whitelist a files who need it
|
|
74
|
-
const rendered = TEMPLATED_ENTRIES.includes(entry)
|
|
75
|
-
? lodash_1.default.template(content)({ appName: this.args.name })
|
|
76
|
-
: content;
|
|
77
|
-
fs_1.default.mkdirSync(entryDir.replace(templatePath, ''), { recursive: true });
|
|
78
|
-
fs_1.default.writeFileSync(path_1.default.join(this.args.name, entryPath.replace(templatePath, '')), rendered);
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
this.logInfo(`Skipped ${entryPath} because it's not a regular file`);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
23
|
+
async cloneTemplate(flavor, destination) {
|
|
24
|
+
await (0, execute_1.execute)('git', 'clone', '--depth=1', 'https://github.com/kuzzleio/project-templates', '--branch', flavor, '--single-branch');
|
|
25
|
+
await (0, execute_1.execute)('mv', `project-templates/${flavor}`, `${destination}/`);
|
|
26
|
+
await (0, execute_1.execute)('rm', '-rf', 'project-templates/');
|
|
84
27
|
}
|
|
85
28
|
}
|
|
86
29
|
exports.default = AppScaffold;
|
|
@@ -88,7 +31,11 @@ AppScaffold.initSdk = false;
|
|
|
88
31
|
AppScaffold.description = 'Scaffolds a new Kuzzle application';
|
|
89
32
|
AppScaffold.flags = {
|
|
90
33
|
help: command_1.flags.help(),
|
|
34
|
+
flavor: command_1.flags.string({
|
|
35
|
+
default: 'generic',
|
|
36
|
+
description: 'Template flavor ("generic", "iot-platform")'
|
|
37
|
+
})
|
|
91
38
|
};
|
|
92
39
|
AppScaffold.args = [
|
|
93
|
-
{ name: '
|
|
40
|
+
{ name: 'destination', description: 'Directory to scaffold the app', required: true },
|
|
94
41
|
];
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const fs_1 = require("fs");
|
|
5
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
5
6
|
const command_1 = require("@oclif/command");
|
|
6
|
-
const chalk_1 =
|
|
7
|
-
const listr_1 =
|
|
8
|
-
const node_emoji_1 =
|
|
7
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
8
|
+
const listr_1 = tslib_1.__importDefault(require("listr"));
|
|
9
|
+
const node_emoji_1 = tslib_1.__importDefault(require("node-emoji"));
|
|
9
10
|
const common_1 = require("../../common");
|
|
10
11
|
const execute_1 = require("../../support/execute");
|
|
11
12
|
const MIN_DOCO_VERSION = '1.12.0';
|
|
@@ -27,7 +28,8 @@ services:
|
|
|
27
28
|
`;
|
|
28
29
|
class AppStartServices extends common_1.Kommand {
|
|
29
30
|
async runSafe() {
|
|
30
|
-
|
|
31
|
+
this.createKourouDir();
|
|
32
|
+
const docoFilename = path_1.default.join(this.kourouDir, 'kuzzle-services.yml');
|
|
31
33
|
const successfullCheck = this.flags.check ?
|
|
32
34
|
await this.checkPrerequisites() :
|
|
33
35
|
true;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { flags } from '@oclif/command';
|
|
2
2
|
import { Kommand } from '../../common';
|
|
3
3
|
export default class CollectionExport extends Kommand {
|
|
4
|
+
static keepAuth: boolean;
|
|
4
5
|
static description: string;
|
|
5
6
|
static flags: {
|
|
6
7
|
protocol: flags.IOptionFlag<string>;
|
|
@@ -18,6 +19,7 @@ export default class CollectionExport extends Kommand {
|
|
|
18
19
|
editor: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
19
20
|
format: flags.IOptionFlag<string>;
|
|
20
21
|
fields: flags.IOptionFlag<string | undefined>;
|
|
22
|
+
scrollTTL: flags.IOptionFlag<string | undefined>;
|
|
21
23
|
};
|
|
22
24
|
static args: {
|
|
23
25
|
name: string;
|
|
@@ -2,8 +2,8 @@
|
|
|
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 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("../../support/kuzzle");
|
|
9
9
|
const dump_collection_1 = require("../../support/dump-collection");
|
|
@@ -27,11 +27,12 @@ class CollectionExport extends common_1.Kommand {
|
|
|
27
27
|
this.logInfo(`Dumping ${count} of ${countAll} documents from collection "${this.args.index}:${this.args.collection}" in ${exportPath} ...`);
|
|
28
28
|
fs_1.default.mkdirSync(exportPath, { recursive: true });
|
|
29
29
|
await (0, dump_collection_1.dumpCollectionMappings)(this.sdk, this.args.index, this.args.collection, exportPath, this.flags.format);
|
|
30
|
-
await (0, dump_collection_1.dumpCollectionData)(this.sdk, this.args.index, this.args.collection, Number(this.flags['batch-size']), exportPath, query, this.flags.format, fields);
|
|
30
|
+
await (0, dump_collection_1.dumpCollectionData)(this.sdk, this.args.index, this.args.collection, Number(this.flags['batch-size']), exportPath, query, this.flags.format, fields, this.flags.scrollTTL);
|
|
31
31
|
this.logOk(`Collection ${this.args.index}:${this.args.collection} dumped`);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
exports.default = CollectionExport;
|
|
35
|
+
CollectionExport.keepAuth = true;
|
|
35
36
|
CollectionExport.description = 'Exports a collection (JSONL format)';
|
|
36
37
|
CollectionExport.flags = Object.assign(Object.assign({ help: command_1.flags.help({}), path: command_1.flags.string({
|
|
37
38
|
description: 'Dump root directory',
|
|
@@ -57,6 +58,9 @@ Example:
|
|
|
57
58
|
|
|
58
59
|
Note that the '_id' field is always included in the CSV export. Leaving this option empty implies that all
|
|
59
60
|
exportable fields in the mapping will be exported.`
|
|
61
|
+
}), scrollTTL: command_1.flags.string({
|
|
62
|
+
description: `The scroll TTL option to pass to the dump operation (which performs a document.search under the hood),
|
|
63
|
+
expressed in ms format, e.g. '2s', '1m', '3h'.`
|
|
60
64
|
}) }, kuzzle_1.kuzzleFlags), { protocol: command_1.flags.string({
|
|
61
65
|
description: 'Kuzzle protocol (http or websocket)',
|
|
62
66
|
default: 'ws',
|
|
@@ -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");
|
|
@@ -20,6 +20,7 @@ class CollectionImport extends common_1.Kommand {
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
exports.default = CollectionImport;
|
|
23
|
+
CollectionImport.keepAuth = true;
|
|
23
24
|
CollectionImport.description = 'Imports a collection';
|
|
24
25
|
CollectionImport.flags = Object.assign(Object.assign({ help: command_1.flags.help({}), 'batch-size': command_1.flags.string({
|
|
25
26
|
description: 'Maximum batch size (see limits.documentsWriteCount config)',
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ConfigKeyDiff = 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 strip_json_comments_1 =
|
|
6
|
+
const lodash_1 = tslib_1.__importDefault(require("lodash"));
|
|
7
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
8
|
+
const strip_json_comments_1 = tslib_1.__importDefault(require("strip-json-comments"));
|
|
9
9
|
const common_1 = require("../../common");
|
|
10
10
|
class ConfigKeyDiff extends common_1.Kommand {
|
|
11
11
|
async runSafe() {
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const command_1 = require("@oclif/command");
|
|
5
5
|
const elasticsearch_1 = require("@elastic/elasticsearch");
|
|
6
|
-
const cli_ux_1 =
|
|
7
|
-
const chalk_1 =
|
|
8
|
-
const node_emoji_1 =
|
|
6
|
+
const cli_ux_1 = tslib_1.__importDefault(require("cli-ux"));
|
|
7
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
8
|
+
const node_emoji_1 = tslib_1.__importDefault(require("node-emoji"));
|
|
9
9
|
const common_1 = require("../../common");
|
|
10
10
|
class EsMigrate extends common_1.Kommand {
|
|
11
11
|
async migrateMappings(index) {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FileDecrypt = 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,8 +2,8 @@
|
|
|
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 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,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FileTest = 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");
|
package/lib/commands/import.d.ts
CHANGED
package/lib/commands/import.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
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 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("../support/kuzzle");
|
|
9
9
|
const restore_collection_1 = require("../support/restore-collection");
|
|
@@ -116,6 +116,7 @@ class Import extends common_1.Kommand {
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
exports.default = Import;
|
|
119
|
+
Import.keepAuth = true;
|
|
119
120
|
Import.description = 'Recursively imports dump files from a root directory';
|
|
120
121
|
Import.flags = Object.assign(Object.assign({ 'preserve-anonymous': command_1.flags.boolean({
|
|
121
122
|
description: 'Preserve anonymous rights',
|
|
@@ -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");
|
|
@@ -33,6 +33,7 @@ class IndexExport extends common_1.Kommand {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
exports.default = IndexExport;
|
|
36
|
+
IndexExport.keepAuth = true;
|
|
36
37
|
IndexExport.description = 'Exports an index (JSONL or Kuzzle format)';
|
|
37
38
|
IndexExport.flags = Object.assign(Object.assign({ help: command_1.flags.help({}), path: command_1.flags.string({
|
|
38
39
|
description: 'Dump root directory',
|
|
@@ -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");
|
|
@@ -33,6 +33,7 @@ class IndexImport extends common_1.Kommand {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
exports.default = IndexImport;
|
|
36
|
+
IndexImport.keepAuth = true;
|
|
36
37
|
IndexImport.description = 'Imports an index (JSONL format)';
|
|
37
38
|
IndexImport.examples = [
|
|
38
39
|
'kourou index:import ./dump/iot-data',
|
|
@@ -2,16 +2,18 @@
|
|
|
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 = tslib_1.__importDefault(require("path"));
|
|
5
6
|
const command_1 = require("@oclif/command");
|
|
6
|
-
const inquirer_1 =
|
|
7
|
-
const cli_ux_1 =
|
|
7
|
+
const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
|
|
8
|
+
const cli_ux_1 = tslib_1.__importDefault(require("cli-ux"));
|
|
8
9
|
const child_process_1 = require("child_process");
|
|
9
|
-
const chalk_1 =
|
|
10
|
-
const node_emoji_1 =
|
|
10
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
11
|
+
const node_emoji_1 = tslib_1.__importDefault(require("node-emoji"));
|
|
11
12
|
const common_1 = require("../../common");
|
|
12
13
|
const execute_1 = require("../../support/execute");
|
|
13
14
|
class InstanceLogs extends common_1.Kommand {
|
|
14
15
|
async runSafe() {
|
|
16
|
+
this.createKourouDir();
|
|
15
17
|
let instance = this.flags.instance;
|
|
16
18
|
const all = this.flags.all;
|
|
17
19
|
const instancesList = await this.getInstancesList();
|
|
@@ -44,7 +46,7 @@ class InstanceLogs extends common_1.Kommand {
|
|
|
44
46
|
await this.killInstance(instance);
|
|
45
47
|
}
|
|
46
48
|
async killInstance(instanceName) {
|
|
47
|
-
const docoFilename =
|
|
49
|
+
const docoFilename = path_1.default.join(this.kourouDir, `kuzzle-${instanceName}.yml`);
|
|
48
50
|
cli_ux_1.default.action.start(`${node_emoji_1.default.get('boom')} Killing Kuzzle instance ${instanceName}`, undefined, {
|
|
49
51
|
stdout: true
|
|
50
52
|
});
|
|
@@ -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,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
5
|
+
const fs_1 = require("fs");
|
|
6
|
+
const net_1 = tslib_1.__importDefault(require("net"));
|
|
4
7
|
const command_1 = require("@oclif/command");
|
|
5
|
-
const chalk_1 =
|
|
8
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
9
|
const child_process_1 = require("child_process");
|
|
7
|
-
const cli_ux_1 =
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const net_1 = (0, tslib_1.__importDefault)(require("net"));
|
|
11
|
-
const node_emoji_1 = (0, tslib_1.__importDefault)(require("node-emoji"));
|
|
10
|
+
const cli_ux_1 = tslib_1.__importDefault(require("cli-ux"));
|
|
11
|
+
const listr_1 = tslib_1.__importDefault(require("listr"));
|
|
12
|
+
const node_emoji_1 = tslib_1.__importDefault(require("node-emoji"));
|
|
12
13
|
const common_1 = require("../../common");
|
|
13
14
|
const execute_1 = require("../../support/execute");
|
|
14
15
|
const MIN_MAX_MAP_COUNT = 262144;
|
|
@@ -86,7 +87,7 @@ services:
|
|
|
86
87
|
class InstanceSpawn extends common_1.Kommand {
|
|
87
88
|
async runSafe() {
|
|
88
89
|
const portIndex = await this.findAvailablePort();
|
|
89
|
-
const docoFilename =
|
|
90
|
+
const docoFilename = path_1.default.join(this.kourouDir, `kuzzle-stack-${portIndex}.yml`);
|
|
90
91
|
const successfullCheck = this.flags.check ?
|
|
91
92
|
await this.checkPrerequisites() :
|
|
92
93
|
true;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PaasKommand } from '../../support/PaasKommand';
|
|
2
|
+
declare class PaasInit extends PaasKommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
|
|
6
|
+
};
|
|
7
|
+
static args: {
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
required: boolean;
|
|
11
|
+
}[];
|
|
12
|
+
runSafe(): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export default PaasInit;
|