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
package/lib/support/kuzzle.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.KuzzleSDK = exports.kuzzleFlags = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const http_1 =
|
|
6
|
-
const https_1 =
|
|
5
|
+
const http_1 = tslib_1.__importDefault(require("http"));
|
|
6
|
+
const https_1 = tslib_1.__importDefault(require("https"));
|
|
7
7
|
const command_1 = require("@oclif/command");
|
|
8
8
|
const kuzzle_sdk_1 = require("kuzzle-sdk");
|
|
9
9
|
const SECOND = 1000;
|
|
@@ -13,7 +13,7 @@ class Elasticsearch7 {
|
|
|
13
13
|
this.options = options;
|
|
14
14
|
}
|
|
15
15
|
extractCredentials(url) {
|
|
16
|
-
let auth
|
|
16
|
+
let auth;
|
|
17
17
|
if (url.includes("@")) {
|
|
18
18
|
const urlCleaned = url.replace(/https?:\/\//, "");
|
|
19
19
|
const [credentials] = urlCleaned.split("@");
|
|
@@ -85,13 +85,11 @@ class Elasticsearch7 {
|
|
|
85
85
|
scrollId: body._scroll_id,
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
return hits.hits;
|
|
94
|
-
}
|
|
88
|
+
const { body: { hits }, } = await this.client.scroll({
|
|
89
|
+
scroll_id: args.scrollId,
|
|
90
|
+
scroll: this.options.scrollDuration,
|
|
91
|
+
});
|
|
92
|
+
return hits.hits;
|
|
95
93
|
}
|
|
96
94
|
async writeData(index, docs) {
|
|
97
95
|
let count = 0;
|
|
@@ -13,7 +13,7 @@ class Elasticsearch8 {
|
|
|
13
13
|
this.options = options;
|
|
14
14
|
}
|
|
15
15
|
extractCredentials(url) {
|
|
16
|
-
let auth
|
|
16
|
+
let auth;
|
|
17
17
|
if (url.includes("@")) {
|
|
18
18
|
const urlCleaned = url.replace(/https?:\/\//, "");
|
|
19
19
|
const [credentials] = urlCleaned.split("@");
|
|
@@ -87,13 +87,11 @@ class Elasticsearch8 {
|
|
|
87
87
|
scrollId: body._scroll_id,
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
return hits.hits;
|
|
96
|
-
}
|
|
90
|
+
const { hits } = await this.client.scroll({
|
|
91
|
+
scroll_id: args.scrollId,
|
|
92
|
+
scroll: this.options.scrollDuration,
|
|
93
|
+
});
|
|
94
|
+
return hits.hits;
|
|
97
95
|
}
|
|
98
96
|
async writeData(index, docs) {
|
|
99
97
|
let count = 0;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.fileExists = exports.File = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const fs_1 = require("fs");
|
|
6
|
-
const fs_2 =
|
|
6
|
+
const fs_2 = tslib_1.__importDefault(require("fs"));
|
|
7
7
|
class File {
|
|
8
8
|
constructor(path) {
|
|
9
9
|
this.path = path;
|
|
@@ -35,10 +35,9 @@ class File {
|
|
|
35
35
|
const content = await fs_1.promises.readFile(this.getIndexDataFile(index));
|
|
36
36
|
const data = content
|
|
37
37
|
.toString()
|
|
38
|
-
.replace(/\r\n/g,
|
|
39
|
-
.split(
|
|
40
|
-
.map((line) => line
|
|
41
|
-
.trim()) // Remove trailing spaces
|
|
38
|
+
.replace(/\r\n/g, "\n") // Normalize line endings Windows -> Unix
|
|
39
|
+
.split("\n")
|
|
40
|
+
.map((line) => line.trim()) // Remove trailing spaces
|
|
42
41
|
.filter((line) => line.length > 0) // Remove empty lines
|
|
43
42
|
.map((line) => JSON.parse(line));
|
|
44
43
|
return {
|
|
@@ -2,17 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isURL = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
tslib_1.__exportStar(require("./bulk"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./elasticsearch7"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./elasticsearch8"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./file"), exports);
|
|
9
9
|
function isURL(str) {
|
|
10
|
-
|
|
11
|
-
new URL(str);
|
|
12
|
-
return true;
|
|
13
|
-
}
|
|
14
|
-
catch (error) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
10
|
+
return URL.canParse(str);
|
|
17
11
|
}
|
|
18
12
|
exports.isURL = isURL;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.restoreCollectionMappings = exports.restoreCollectionData = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const fs_1 =
|
|
6
|
-
const chalk_1 =
|
|
7
|
-
const ndjson_1 =
|
|
5
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
6
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
|
+
const ndjson_1 = tslib_1.__importDefault(require("ndjson"));
|
|
8
8
|
function handleError(log, dumpFile, error) {
|
|
9
9
|
if (error.errors) {
|
|
10
10
|
const errorFile = `${dumpFile
|
|
@@ -13,7 +13,7 @@ function handleError(log, dumpFile, error) {
|
|
|
13
13
|
.join(".")}-errors.jsonl`;
|
|
14
14
|
const writeStream = fs_1.default.createWriteStream(errorFile, { flags: "a" });
|
|
15
15
|
for (const partialError of error.errors) {
|
|
16
|
-
writeStream.write(JSON.stringify(partialError) +
|
|
16
|
+
writeStream.write(JSON.stringify(partialError) + "\n");
|
|
17
17
|
}
|
|
18
18
|
writeStream.end();
|
|
19
19
|
log(chalk_1.default.red(`[X] Error importing ${dumpFile}. See errors in ${errorFile}`));
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.restoreUsers = exports.restoreProfiles = exports.restoreRoles = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const lodash_1 =
|
|
6
|
-
const bluebird_1 =
|
|
5
|
+
const lodash_1 = tslib_1.__importDefault(require("lodash"));
|
|
6
|
+
const bluebird_1 = tslib_1.__importDefault(require("bluebird"));
|
|
7
7
|
const sleep = (seconds) => new Promise((resolve) => setTimeout(resolve, seconds * 1000));
|
|
8
8
|
async function restoreRoles(kommand, dump, preserveAnonymous = false) {
|
|
9
9
|
if (dump.type !== "roles") {
|
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.0-dev.
|
|
4
|
+
"version": "1.4.0-dev.3",
|
|
5
5
|
"author": "The Kuzzle Team <support@kuzzle.io>",
|
|
6
6
|
"bin": {
|
|
7
7
|
"kourou": "./bin/run"
|
|
@@ -19,64 +19,61 @@
|
|
|
19
19
|
"test:functional:cucumber": "./node_modules/.bin/cucumber-js --fail-fast"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"sdk-es7": "npm:@elastic/elasticsearch@7.
|
|
23
|
-
"sdk-es8": "npm:@elastic/elasticsearch@8.
|
|
22
|
+
"sdk-es7": "npm:@elastic/elasticsearch@7.17.14",
|
|
23
|
+
"sdk-es8": "npm:@elastic/elasticsearch@8.19.2",
|
|
24
24
|
"@oclif/command": "1.8.*",
|
|
25
25
|
"@oclif/config": "1.18.*",
|
|
26
26
|
"@oclif/plugin-autocomplete": "1.3.*",
|
|
27
27
|
"@oclif/plugin-help": "3.2.2",
|
|
28
28
|
"bluebird": "3.7.2",
|
|
29
|
-
"chalk": "4.1.
|
|
30
|
-
"chrono-node": "2.4.2",
|
|
29
|
+
"chalk": "4.1.2",
|
|
31
30
|
"cli-ux": "5.5.1",
|
|
32
|
-
"inquirer": "8.
|
|
33
|
-
"kepler-companion": "1.1.
|
|
34
|
-
"kuzzle-sdk": "7.
|
|
35
|
-
"kuzzle-vault": "2.0
|
|
31
|
+
"inquirer": "8.2.7",
|
|
32
|
+
"kepler-companion": "1.1.6",
|
|
33
|
+
"kuzzle-sdk": "7.17.1",
|
|
34
|
+
"kuzzle-vault": "2.1.0",
|
|
36
35
|
"listr": "0.14.3",
|
|
37
|
-
"lodash": "4.
|
|
36
|
+
"lodash": "4.18.1",
|
|
38
37
|
"ndjson": "2.0.0",
|
|
39
|
-
"node-emoji": "1.
|
|
40
|
-
"node-fetch": "2.
|
|
41
|
-
"production": "0.0.2",
|
|
38
|
+
"node-emoji": "1.11.0",
|
|
39
|
+
"node-fetch": "2.7.0",
|
|
42
40
|
"strip-json-comments": "3.1.1",
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"typescript": "4.4.*"
|
|
41
|
+
"tmp": "0.2.7",
|
|
42
|
+
"tslib": "2.8.1",
|
|
43
|
+
"ws": "8.21.1",
|
|
44
|
+
"typescript": "5.4.*"
|
|
48
45
|
},
|
|
49
46
|
"devDependencies": {
|
|
50
|
-
"@istanbuljs/nyc-config-typescript": "1.0.
|
|
51
|
-
"@oclif/dev-cli": "1.26.
|
|
47
|
+
"@istanbuljs/nyc-config-typescript": "1.0.2",
|
|
48
|
+
"@oclif/dev-cli": "1.26.10",
|
|
52
49
|
"@oclif/test": "1.2.8",
|
|
53
|
-
"@types/bluebird": "3.5.
|
|
54
|
-
"@types/chai": "4.
|
|
55
|
-
"@types/compare-version": "0.1.
|
|
56
|
-
"@types/inquirer": "
|
|
57
|
-
"@types/listr": "0.14.
|
|
58
|
-
"@types/mocha": "8.2.
|
|
59
|
-
"@types/ndjson": "2.0.
|
|
50
|
+
"@types/bluebird": "3.5.42",
|
|
51
|
+
"@types/chai": "4.3.20",
|
|
52
|
+
"@types/compare-version": "0.1.34",
|
|
53
|
+
"@types/inquirer": "8.2.13",
|
|
54
|
+
"@types/listr": "0.14.10",
|
|
55
|
+
"@types/mocha": "8.2.3",
|
|
56
|
+
"@types/ndjson": "2.0.4",
|
|
60
57
|
"@types/node": "20.14.15",
|
|
61
|
-
"@types/node-emoji": "1.8.
|
|
62
|
-
"@types/node-fetch": "2.6.
|
|
63
|
-
"@types/
|
|
64
|
-
"@types/
|
|
65
|
-
"@
|
|
66
|
-
"@typescript-eslint/
|
|
67
|
-
"
|
|
68
|
-
"chai": "4.3.4",
|
|
58
|
+
"@types/node-emoji": "1.8.2",
|
|
59
|
+
"@types/node-fetch": "2.6.13",
|
|
60
|
+
"@types/tmp": "0.2.6",
|
|
61
|
+
"@types/ws": "8.18.1",
|
|
62
|
+
"@typescript-eslint/eslint-plugin": "7.18.0",
|
|
63
|
+
"@typescript-eslint/parser": "7.18.0",
|
|
64
|
+
"chai": "4.5.0",
|
|
69
65
|
"cucumber": "6.0.7",
|
|
70
|
-
"eslint": "
|
|
71
|
-
"
|
|
72
|
-
"
|
|
66
|
+
"eslint": "8.57.1",
|
|
67
|
+
"eslint-plugin-kuzzle": "0.0.15",
|
|
68
|
+
"eslint-plugin-prettier": "5.1.3",
|
|
69
|
+
"globby": "11.1.0",
|
|
70
|
+
"mocha": "8.4.0",
|
|
73
71
|
"nyc": "15.1.0",
|
|
74
|
-
"prettier-eslint": "12.0.0",
|
|
75
|
-
"should": "13.2.3",
|
|
76
|
-
"source-map-support": "0.5.19",
|
|
77
|
-
"ts-node": "10.9.*",
|
|
78
72
|
"semantic-release": "25.0.8",
|
|
79
|
-
"semantic-release-config-kuzzle": "1.7.0"
|
|
73
|
+
"semantic-release-config-kuzzle": "1.7.0",
|
|
74
|
+
"should": "13.2.3",
|
|
75
|
+
"source-map-support": "0.5.21",
|
|
76
|
+
"ts-node": "10.9.*"
|
|
80
77
|
},
|
|
81
78
|
"engines": {
|
|
82
79
|
"node": ">=20.0.0"
|
|
@@ -142,5 +139,13 @@
|
|
|
142
139
|
}
|
|
143
140
|
},
|
|
144
141
|
"repository": "kuzzleio/kourou",
|
|
145
|
-
"types": "lib/index.d.ts"
|
|
142
|
+
"types": "lib/index.d.ts",
|
|
143
|
+
"overrides": {
|
|
144
|
+
"ws@8": "8.21.1",
|
|
145
|
+
"cross-spawn@6": "6.0.6",
|
|
146
|
+
"semver@5": "5.7.2",
|
|
147
|
+
"picomatch@2": "2.3.2",
|
|
148
|
+
"js-yaml@3": "3.15.0",
|
|
149
|
+
"minimatch@3": "3.1.5"
|
|
150
|
+
}
|
|
146
151
|
}
|