Socket
Socket
Sign inDemoInstall

kourou

Package Overview
Dependencies
170
Maintainers
2
Versions
53
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.14.0 to 0.15.0

lib/commands/app/scaffold.d.ts

1

lib/commands/api-key/check.d.ts

@@ -13,2 +13,3 @@ import { flags } from '@oclif/command';

as: flags.IOptionFlag<string | undefined>;
'api-key': flags.IOptionFlag<string | undefined>;
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;

@@ -15,0 +16,0 @@ };

3

lib/commands/api-key/check.js

@@ -8,4 +8,3 @@ "use strict";

async runSafe() {
var _a;
const { valid } = await ((_a = this.sdk) === null || _a === void 0 ? void 0 : _a.auth.checkToken(this.args.token));
const { valid } = await this.sdk.auth.checkToken(this.args.token);
if (valid) {

@@ -12,0 +11,0 @@ this.logOk('API key is still valid');

@@ -13,2 +13,3 @@ import { flags } from '@oclif/command';

as: flags.IOptionFlag<string | undefined>;
'api-key': flags.IOptionFlag<string | undefined>;
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;

@@ -15,0 +16,0 @@ description: flags.IOptionFlag<string>;

@@ -8,7 +8,6 @@ "use strict";

async runSafe() {
var _a;
const apiKey = await ((_a = this.sdk) === null || _a === void 0 ? void 0 : _a.security.createApiKey(this.args.user, this.flags.description, {
const apiKey = await this.sdk.security.createApiKey(this.args.user, this.flags.description, {
_id: this.flags.id,
expiresIn: this.flags.expire
}));
});
this.logOk(`Successfully created API Key "${apiKey._id}" for user "${this.args.user}"`);

@@ -15,0 +14,0 @@ this.log(apiKey._source.token);

@@ -13,2 +13,3 @@ import { flags } from '@oclif/command';

as: flags.IOptionFlag<string | undefined>;
'api-key': flags.IOptionFlag<string | undefined>;
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;

@@ -15,0 +16,0 @@ };

@@ -8,4 +8,3 @@ "use strict";

async runSafe() {
var _a;
await ((_a = this.sdk) === null || _a === void 0 ? void 0 : _a.security.deleteApiKey(this.args.user, this.args.id));
await this.sdk.security.deleteApiKey(this.args.user, this.args.id);
this.logOk(`Successfully deleted API Key "${this.args.id}" of user "${this.args.user}"`);

@@ -12,0 +11,0 @@ }

@@ -13,2 +13,3 @@ import { flags } from '@oclif/command';

as: flags.IOptionFlag<string | undefined>;
'api-key': flags.IOptionFlag<string | undefined>;
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;

@@ -15,0 +16,0 @@ filter: flags.IOptionFlag<string | undefined>;

@@ -8,3 +8,2 @@ "use strict";

async runSafe() {
var _a;
let query = {};

@@ -18,6 +17,6 @@ if (this.flags.filter) {

}
const result = await ((_a = this.sdk) === null || _a === void 0 ? void 0 : _a.security.searchApiKeys(this.args.user, query, {
const result = await this.sdk.security.searchApiKeys(this.args.user, query, {
from: 0,
size: 100
}));
});
this.logOk(`${result.total} API Keys found for user ${this.args.user}`);

@@ -29,2 +28,3 @@ if (result.total !== 0) {

this.log(` Description: ${_source.description}`);
this.log(` Fingerprint: ${_source.fingerprint}`);
this.log(` Expires at: ${_source.expiresAt}`);

@@ -31,0 +31,0 @@ }

@@ -13,2 +13,3 @@ import { flags } from '@oclif/command';

as: flags.IOptionFlag<string | undefined>;
'api-key': flags.IOptionFlag<string | undefined>;
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;

@@ -15,0 +16,0 @@ };

@@ -8,9 +8,8 @@ "use strict";

async runSafe() {
var _a, _b, _c;
const body = this.stdin ? this.stdin : this.args.body || '{}';
if (!await ((_a = this.sdk) === null || _a === void 0 ? void 0 : _a.index.exists(this.args.index))) {
await ((_b = this.sdk) === null || _b === void 0 ? void 0 : _b.index.create(this.args.index));
if (!await this.sdk.index.exists(this.args.index)) {
await this.sdk.index.create(this.args.index);
this.logInfo(`Index "${this.args.index}" created`);
}
await ((_c = this.sdk) === null || _c === void 0 ? void 0 : _c.collection.create(this.args.index, this.args.collection, this.parseJs(body)));
await this.sdk.collection.create(this.args.index, this.args.collection, this.parseJs(body));
this.logOk(`Collection "${this.args.index}":"${this.args.collection}" created`);

@@ -17,0 +16,0 @@ }

@@ -13,2 +13,3 @@ import { flags } from '@oclif/command';

as: flags.IOptionFlag<string | undefined>;
'api-key': flags.IOptionFlag<string | undefined>;
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;

@@ -15,0 +16,0 @@ path: flags.IOptionFlag<string | undefined>;

@@ -12,3 +12,2 @@ "use strict";

async runSafe() {
var _a, _b;
const exportPath = this.flags.path

@@ -21,5 +20,5 @@ ? path_1.default.join(this.flags.path, this.args.index)

}
const countAll = await ((_a = this.sdk) === null || _a === void 0 ? void 0 : _a.document.count(this.args.index, this.args.collection));
const count = await ((_b = this.sdk) === null || _b === void 0 ? void 0 : _b.document.count(this.args.index, this.args.collection, { query }));
this.logInfo(`Dumping ${count} of ${countAll} documents from collection "${this.args.index}:${this.args.collection}" in ${path_1.default}/ ...`);
const countAll = await this.sdk.document.count(this.args.index, this.args.collection);
const count = await this.sdk.document.count(this.args.index, this.args.collection, { query });
this.logInfo(`Dumping ${count} of ${countAll} documents from collection "${this.args.index}:${this.args.collection}" in ${path_1.default} ...`);
fs_1.default.mkdirSync(exportPath, { recursive: true });

@@ -26,0 +25,0 @@ await dump_collection_1.dumpCollectionMappings(this.sdk, this.args.index, this.args.collection, exportPath);

@@ -13,2 +13,3 @@ import { flags } from '@oclif/command';

as: flags.IOptionFlag<string | undefined>;
'api-key': flags.IOptionFlag<string | undefined>;
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;

@@ -15,0 +16,0 @@ 'batch-size': flags.IOptionFlag<string>;

@@ -14,3 +14,3 @@ import { flags } from '@oclif/command';

as: flags.IOptionFlag<string | undefined>;
query: flags.IOptionFlag<string>;
'api-key': flags.IOptionFlag<string | undefined>;
sort: flags.IOptionFlag<string>;

@@ -23,8 +23,12 @@ from: flags.IOptionFlag<string | undefined>;

};
static args: {
static args: ({
name: string;
description: string;
required: boolean;
}[];
} | {
name: string;
description: string;
required?: undefined;
})[];
runSafe(): Promise<void>;
}

@@ -8,3 +8,2 @@ "use strict";

async runSafe() {
var _a;
let request = {

@@ -19,3 +18,3 @@ controller: 'document',

body: {
query: this.parseJs(this.flags.query),
query: this.parseJs(this.args.query || '{}'),
sort: this.parseJs(this.flags.sort)

@@ -28,8 +27,8 @@ }

}
const { result } = await ((_a = this.sdk) === null || _a === void 0 ? void 0 : _a.query(request));
for (const document of result.hits) {
const { result } = await this.sdk.query(request);
for (const document of result === null || result === void 0 ? void 0 : result.hits) {
this.logInfo(`Document ID: ${document._id}`);
this.log(`Content: ${JSON.stringify(document._source, null, 2)}`);
}
this.logOk(`${result.hits.length} documents fetched on a total of ${result.total}`);
this.logOk(`${result === null || result === void 0 ? void 0 : result.hits.length} documents fetched on a total of ${result === null || result === void 0 ? void 0 : result.total}`);
}

@@ -40,9 +39,6 @@ }

DocumentSearch.examples = [
'kourou document:search iot sensors --query \'{ term: { name: "corona" } }\'',
'kourou document:search iot sensors \'{ term: { name: "corona" } }\'',
'kourou document:search iot sensors --editor',
];
DocumentSearch.flags = Object.assign({ query: command_1.flags.string({
description: 'Query in JS or JSON format.',
default: '{}'
}), sort: command_1.flags.string({
DocumentSearch.flags = Object.assign({ sort: command_1.flags.string({
description: 'Sort in JS or JSON format.',

@@ -61,3 +57,4 @@ default: '{}'

{ name: 'index', description: 'Index name', required: true },
{ name: 'collection', description: 'Collection name', required: true }
{ name: 'collection', description: 'Collection name', required: true },
{ name: 'query', description: 'Query in JS or JSON format.' },
];

@@ -13,2 +13,3 @@ import { flags } from '@oclif/command';

as: flags.IOptionFlag<string | undefined>;
'api-key': flags.IOptionFlag<string | undefined>;
'preserve-anonymous': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;

@@ -15,0 +16,0 @@ help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;

@@ -13,3 +13,2 @@ "use strict";

async runSafe() {
var _a;
const files = await this.walkDirectories(this.args.path);

@@ -64,3 +63,3 @@ for (const file of files.mappings) {

const mapping = dump.content.mapping;
await ((_a = this.sdk) === null || _a === void 0 ? void 0 : _a.security.updateUserMapping({ properties: mapping }));
await this.sdk.security.updateUserMapping({ properties: mapping });
this.logOk('[users] collection mappings imported');

@@ -67,0 +66,0 @@ }

@@ -13,2 +13,3 @@ import { flags } from '@oclif/command';

as: flags.IOptionFlag<string | undefined>;
'api-key': flags.IOptionFlag<string | undefined>;
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;

@@ -15,0 +16,0 @@ path: flags.IOptionFlag<string | undefined>;

@@ -13,9 +13,8 @@ "use strict";

async runSafe() {
var _a;
const exportPath = this.flags.path
? path_1.default.join(this.flags.path, this.args.index)
: this.args.index;
this.logInfo(`Dumping index "${this.args.index}" in ${exportPath}/ ...`);
this.logInfo(`Dumping index "${this.args.index}" in ${exportPath}${path_1.default.sep} ...`);
fs_1.default.mkdirSync(exportPath, { recursive: true });
const { collections } = await ((_a = this.sdk) === null || _a === void 0 ? void 0 : _a.collection.list(this.args.index));
const { collections } = await this.sdk.collection.list(this.args.index);
for (const collection of collections) {

@@ -22,0 +21,0 @@ try {

@@ -14,2 +14,3 @@ import { flags } from '@oclif/command';

as: flags.IOptionFlag<string | undefined>;
'api-key': flags.IOptionFlag<string | undefined>;
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;

@@ -16,0 +17,0 @@ 'batch-size': flags.IOptionFlag<string>;

@@ -7,3 +7,2 @@ "use strict";

const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
const execa_1 = tslib_1.__importDefault(require("execa"));
const cli_ux_1 = tslib_1.__importDefault(require("cli-ux"));

@@ -14,2 +13,3 @@ const child_process_1 = require("child_process");

const common_1 = require("../../common");
const execute_1 = require("../../support/execute");
class InstanceLogs extends common_1.Kommand {

@@ -70,10 +70,6 @@ async runSafe() {

try {
containersListProcess = await execa_1.default('docker', [
'ps',
'--format',
'"{{.Names}}"'
]);
containersListProcess = await execute_1.execute('docker', 'ps', '--format', '"{{.Names}}"');
}
catch (_a) {
this.warn('Something went wrong while getting kuzzle running instances list');
catch (error) {
this.warn(`Something went wrong while getting kuzzle running instances list: ${error.message}`);
return [];

@@ -80,0 +76,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InstanceList = void 0;
const tslib_1 = require("tslib");
const execa_1 = tslib_1.__importDefault(require("execa"));
const common_1 = require("../../common");
const execute_1 = require("../../support/execute");
class InstanceList extends common_1.Kommand {

@@ -25,3 +24,3 @@ async runSafe() {

try {
containersListProcess = await execa_1.default('docker', ['ps', '--format', '"{{.Names}}%{{.Image}}%{{.Status}}%{{.Ports}}"']);
containersListProcess = await execute_1.execute('docker', 'ps', '--format', '"{{.Names}}%{{.Image}}%{{.Status}}%{{.Ports}}"');
}

@@ -28,0 +27,0 @@ catch (_a) {

@@ -7,4 +7,4 @@ "use strict";

const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
const execa_1 = tslib_1.__importDefault(require("execa"));
const common_1 = require("../../common");
const execute_1 = require("../../support/execute");
class InstanceLogs extends common_1.Kommand {

@@ -34,5 +34,5 @@ async runSafe() {

}
const instanceLogs = execa_1.default('docker', args);
instanceLogs.stdout.pipe(process.stdout);
instanceLogs.stderr.pipe(process.stderr);
const instanceLogs = execute_1.execute('docker', ...args);
instanceLogs.process.stdout.pipe(process.stdout);
instanceLogs.process.stderr.pipe(process.stderr);
await instanceLogs;

@@ -43,3 +43,3 @@ }

try {
containersListProcess = await execa_1.default('docker', ['ps', '--format', '"{{.Names}}"']);
containersListProcess = await execute_1.execute('docker', 'ps', '--format', '"{{.Names}}"');
}

@@ -46,0 +46,0 @@ catch (_a) {

@@ -8,3 +8,2 @@ "use strict";

const cli_ux_1 = tslib_1.__importDefault(require("cli-ux"));
const execa_1 = tslib_1.__importDefault(require("execa"));
const fs_1 = require("fs");

@@ -15,2 +14,3 @@ const listr_1 = tslib_1.__importDefault(require("listr"));

const common_1 = require("../../common");
const execute_1 = require("../../support/execute");
const MIN_MAX_MAP_COUNT = 262144;

@@ -104,3 +104,3 @@ const MIN_DOCO_VERSION = '1.12.0';

// clean up
await execa_1.default('docker-compose', ['-f', docoFilename, '-p', `stack-${portIndex}`, 'down']);
await execute_1.execute('docker-compose', '-f', docoFilename, '-p', `stack-${portIndex}`, 'down');
const doco = child_process_1.spawn('docker-compose', ['-f', docoFilename, '-p', `stack-${portIndex}`, 'up', '-d']);

@@ -136,3 +136,3 @@ cli_ux_1.default.action.start(` ${node_emoji_1.default.get('rocket')} Kuzzle version ${this.flags.version} is launching`, undefined, {

try {
const docov = await execa_1.default('docker-compose', ['-v']);
const docov = await execute_1.execute('docker-compose', '-v');
const matches = docov.stdout.match(/[^0-9.]*([0-9.]*).*/);

@@ -164,6 +164,3 @@ if (matches === null) {

try {
const sysctl = await execa_1.default('/sbin/sysctl', [
'-n',
'vm.max_map_count',
]);
const sysctl = await execute_1.execute('/sbin/sysctl', '-n', 'vm.max_map_count');
if (sysctl.exitCode !== 0) {

@@ -178,3 +175,3 @@ throw new Error('Something went wrong checking vm.max_map_count');

catch (error) {
throw new Error('Something went wrong checking vm.max_map_count');
throw new Error(`Something went wrong checking vm.max_map_count: ${error.message}`);
}

@@ -181,0 +178,0 @@ },

@@ -13,2 +13,3 @@ import { flags } from '@oclif/command';

as: flags.IOptionFlag<string | undefined>;
'api-key': flags.IOptionFlag<string | undefined>;
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;

@@ -15,0 +16,0 @@ path: flags.IOptionFlag<string>;

@@ -23,3 +23,2 @@ "use strict";

async _dumpProfiles() {
var _a;
const options = {

@@ -29,3 +28,3 @@ scroll: '3s',

};
let result = await ((_a = this.sdk) === null || _a === void 0 ? void 0 : _a.security.searchProfiles({}, options));
let result = await this.sdk.security.searchProfiles({}, options);
const profiles = {};

@@ -32,0 +31,0 @@ while (result) {

@@ -13,2 +13,3 @@ import { flags } from '@oclif/command';

as: flags.IOptionFlag<string | undefined>;
'api-key': flags.IOptionFlag<string | undefined>;
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;

@@ -15,0 +16,0 @@ };

@@ -13,2 +13,3 @@ import { flags } from '@oclif/command';

as: flags.IOptionFlag<string | undefined>;
'api-key': flags.IOptionFlag<string | undefined>;
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;

@@ -15,0 +16,0 @@ path: flags.IOptionFlag<string>;

@@ -23,3 +23,2 @@ "use strict";

async _dumpRoles() {
var _a;
const options = {

@@ -29,3 +28,3 @@ scroll: '3s',

};
let result = await ((_a = this.sdk) === null || _a === void 0 ? void 0 : _a.security.searchRoles({}, options));
let result = await this.sdk.security.searchRoles({}, options);
const roles = {};

@@ -32,0 +31,0 @@ while (result) {

@@ -13,2 +13,3 @@ import { flags } from '@oclif/command';

as: flags.IOptionFlag<string | undefined>;
'api-key': flags.IOptionFlag<string | undefined>;
'preserve-anonymous': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;

@@ -15,0 +16,0 @@ help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;

@@ -13,2 +13,3 @@ import { flags } from '@oclif/command';

as: flags.IOptionFlag<string | undefined>;
'api-key': flags.IOptionFlag<string | undefined>;
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;

@@ -15,0 +16,0 @@ code: flags.IOptionFlag<string | undefined>;

@@ -20,3 +20,2 @@ "use strict";

async runSafe() {
var _a;
if (lodash_1.isEmpty(this.code)) {

@@ -50,3 +49,3 @@ throw new Error('No code provided.');

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const sdk = (_a = this.sdk) === null || _a === void 0 ? void 0 : _a.sdk;
const sdk = this.sdk.sdk;
let result;

@@ -53,0 +52,0 @@ try {

@@ -13,2 +13,3 @@ import { flags } from '@oclif/command';

as: flags.IOptionFlag<string | undefined>;
'api-key': flags.IOptionFlag<string | undefined>;
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;

@@ -18,2 +19,3 @@ arg: flags.IOptionFlag<string[]>;

editor: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
'body-editor': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
index: flags.IOptionFlag<string | undefined>;

@@ -20,0 +22,0 @@ collection: flags.IOptionFlag<string | undefined>;

@@ -10,7 +10,3 @@ "use strict";

async runSafe() {
var _a;
const [controller, action] = this.args['controller:action'].split(':');
if (controller === 'realtime' && action === 'subscribe') {
throw new Error('Use the "subscribe" command to listen to realtime notifications');
}
const requestArgs = {};

@@ -28,6 +24,12 @@ requestArgs.index = this.flags.index;

// content from user editor
if (this.flags.editor) {
if (this.flags.editor && this.flags['body-editor']) {
throw new Error('You cannot specify --editor and --body-editor at the same time');
}
else if (this.flags.editor) {
request = this.fromEditor(request, { json: true });
}
const response = await ((_a = this.sdk) === null || _a === void 0 ? void 0 : _a.query(request));
else if (this.flags['body-editor']) {
request.body = this.fromEditor(request.body, { json: true });
}
const response = await this.sdk.query(request);
const display = this.flags.display === ''

@@ -77,2 +79,3 @@ ? response

- <command> <index>
- <command> <body>
- <command> <index> <collection>

@@ -87,2 +90,3 @@ - <command> <index> <collection> <id>

- kourou collection:list iot
- kourou security:createUser '{"content":{"profileIds":["default"]}}' --id yagmur
- kourou collection:delete iot sensors

@@ -102,2 +106,4 @@ - kourou document:createOrReplace iot sensors sigfox-1 '{}'

description: 'Open an editor (EDITOR env variable) to edit the request before sending.'
}), 'body-editor': command_1.flags.boolean({
description: 'Open an editor (EDITOR env variable) to edit the body before sending.'
}), index: command_1.flags.string({

@@ -104,0 +110,0 @@ char: 'i',

@@ -13,2 +13,3 @@ import { flags } from '@oclif/command';

as: flags.IOptionFlag<string | undefined>;
'api-key': flags.IOptionFlag<string | undefined>;
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;

@@ -15,0 +16,0 @@ path: flags.IOptionFlag<string>;

@@ -11,7 +11,6 @@ "use strict";

async runSafe() {
var _a;
const filename = path_1.default.join(this.flags.path, 'users-collection-mappings.json');
this.logInfo(`Exporting users collection mappings in ${filename} ...`);
fs_1.default.mkdirSync(this.flags.path, { recursive: true });
const mapping = await ((_a = this.sdk) === null || _a === void 0 ? void 0 : _a.security.getUserMapping());
const mapping = await this.sdk.security.getUserMapping();
const dump = {

@@ -18,0 +17,0 @@ type: 'usersMappings',

@@ -13,2 +13,3 @@ import { flags } from '@oclif/command';

as: flags.IOptionFlag<string | undefined>;
'api-key': flags.IOptionFlag<string | undefined>;
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;

@@ -15,0 +16,0 @@ path: flags.IOptionFlag<string>;

@@ -41,5 +41,4 @@ "use strict";

async _dumpUsers() {
var _a;
const users = {};
let results = await ((_a = this.sdk) === null || _a === void 0 ? void 0 : _a.security.searchUsers({}, { scroll: '5s', size: this.flags['batch-size'] }));
let results = await this.sdk.security.searchUsers({}, { scroll: '5s', size: this.flags['batch-size'] });
while (results) {

@@ -46,0 +45,0 @@ for (const user of results.hits) {

@@ -13,2 +13,3 @@ import { flags } from '@oclif/command';

as: flags.IOptionFlag<string | undefined>;
'api-key': flags.IOptionFlag<string | undefined>;
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;

@@ -15,0 +16,0 @@ };

@@ -10,7 +10,6 @@ "use strict";

async runSafe() {
var _a;
this.logInfo(`Importing users collection mappings from ${this.args.path} ...`);
const dump = JSON.parse(fs_1.default.readFileSync(this.args.path, 'utf-8'));
const mapping = dump.content.mapping;
await ((_a = this.sdk) === null || _a === void 0 ? void 0 : _a.security.updateUserMapping({ properties: mapping }));
await this.sdk.security.updateUserMapping({ properties: mapping });
this.logOk('Users collecction mappings restored');

@@ -17,0 +16,0 @@ }

@@ -13,2 +13,3 @@ import { flags } from '@oclif/command';

as: flags.IOptionFlag<string | undefined>;
'api-key': flags.IOptionFlag<string | undefined>;
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;

@@ -15,0 +16,0 @@ };

@@ -5,3 +5,4 @@ import { Command } from '@oclif/command';

export declare abstract class Kommand extends Command {
protected sdk?: KuzzleSDK;
protected sdk: KuzzleSDK;
private exitCode;
args: any;

@@ -8,0 +9,0 @@ flags: any;

@@ -14,2 +14,5 @@ "use strict";

super(...arguments);
// Instantiate a dummy SDK to avoid the this.sdk notation everywhere -_-
this.sdk = new kuzzle_1.KuzzleSDK({ host: 'nowhere' });
this.exitCode = 0;
this.stdin = undefined;

@@ -37,7 +40,6 @@ this.sdkOptions = {};

logKo(message) {
process.exitCode = 1;
this.exitCode = 1;
this.log(chalk_1.default.red(`[X] ${message}`));
}
async run() {
var _a, _b;
this.printCommand();

@@ -63,5 +65,5 @@ const kommand = this.constructor;

this.logInfo(`Impersonate user "${this.flags.as}"`);
await ((_a = this.sdk) === null || _a === void 0 ? void 0 : _a.impersonate(this.flags.as, async () => {
await this.sdk.impersonate(this.flags.as, async () => {
await this.runSafe();
}));
});
}

@@ -76,3 +78,5 @@ else {

finally {
(_b = this.sdk) === null || _b === void 0 ? void 0 : _b.disconnect();
this.sdk.disconnect();
// eslint-disable-next-line
process.exit(this.exitCode);
}

@@ -79,0 +83,0 @@ }

@@ -19,2 +19,3 @@ "use strict";

* - <index>
* - <body>
*

@@ -50,10 +51,14 @@ * This is mainly to match easily methods from the document, bulk, realtime

const commandArgs = [opts.id];
// first positional argument (index)
if (args[0]
&& args[0].charAt(0) !== '-'
&& !args.includes('-i')
&& !args.includes('--index')) {
commandArgs.push('-i');
commandArgs.push(args[0]);
args.splice(0, 1);
// first positional argument (index or body)
if (args[0] && args[0].charAt(0) !== '-') {
if (args[0].includes('{') && !args.includes('--body')) {
commandArgs.push('--body');
commandArgs.push(args[0]);
args.splice(0, 1);
}
else if (!args.includes('--index') && !args.includes('-i')) {
commandArgs.push('-i');
commandArgs.push(args[0]);
args.splice(0, 1);
}
}

@@ -60,0 +65,0 @@ else {

@@ -1,2 +0,2 @@

export declare function dumpCollectionData(sdk: any, index: string, collection: string, batchSize: number, path: string, query?: any): Promise<unknown>;
export declare function dumpCollectionMappings(sdk: any, index: string, collection: string, path: string): Promise<void>;
export declare function dumpCollectionData(sdk: any, index: string, collection: string, batchSize: number, destPath: string, query?: any): Promise<unknown>;
export declare function dumpCollectionMappings(sdk: any, index: string, collection: string, destPath: string): Promise<void>;

@@ -6,8 +6,9 @@ "use strict";

const fs_1 = tslib_1.__importDefault(require("fs"));
const path_1 = tslib_1.__importDefault(require("path"));
const cli_ux_1 = tslib_1.__importDefault(require("cli-ux"));
// tslint:disable-next-line
const ndjson = require('ndjson');
async function dumpCollectionData(sdk, index, collection, batchSize, path, query = {}) {
const collectionDir = `${path}/${collection}`;
const filename = `${collectionDir}/documents.jsonl`;
async function dumpCollectionData(sdk, index, collection, batchSize, destPath, query = {}) {
const collectionDir = path_1.default.join(destPath, collection);
const filename = path_1.default.join(collectionDir, 'documents.jsonl');
const writeStream = fs_1.default.createWriteStream(filename);

@@ -57,5 +58,5 @@ const waitWrite = new Promise(resolve => writeStream.on('finish', resolve));

exports.dumpCollectionData = dumpCollectionData;
async function dumpCollectionMappings(sdk, index, collection, path) {
const collectionDir = `${path}/${collection}`;
const filename = `${collectionDir}/mappings.json`;
async function dumpCollectionMappings(sdk, index, collection, destPath) {
const collectionDir = path_1.default.join(destPath, collection);
const filename = path_1.default.join(collectionDir, 'mappings.json');
fs_1.default.mkdirSync(collectionDir, { recursive: true });

@@ -62,0 +63,0 @@ const mappings = await sdk.collection.getMapping(index, collection);

import { flags } from '@oclif/command';
import { Kuzzle } from 'kuzzle-sdk';
export declare const kuzzleFlags: {

@@ -10,5 +11,6 @@ host: flags.IOptionFlag<string>;

as: flags.IOptionFlag<string | undefined>;
'api-key': flags.IOptionFlag<string | undefined>;
};
export declare class KuzzleSDK {
sdk: any;
sdk: Kuzzle;
private host;

@@ -20,2 +22,3 @@ private port;

private protocol;
private apikey;
private refreshTimer?;

@@ -33,10 +36,10 @@ constructor(options: any);

disconnect(): void;
query(request: any): any;
get document(): any;
get collection(): any;
get index(): any;
query(request: any): Promise<import("kuzzle-sdk/src/utils/interfaces").KuzzleResponse>;
get document(): import("kuzzle-sdk/src/controllers/Document").DocumentController;
get collection(): import("kuzzle-sdk/src/controllers/Collection").CollectionController;
get index(): import("kuzzle-sdk/src/controllers/Index").IndexController;
get security(): any;
get auth(): any;
get auth(): import("kuzzle-sdk/src/controllers/Auth").AuthController;
get server(): any;
get realtime(): any;
get realtime(): import("kuzzle-sdk/src/controllers/Realtime").RealtimeController;
}

@@ -5,4 +5,3 @@ "use strict";

const command_1 = require("@oclif/command");
// tslint:disable-next-line
const { Http, WebSocket, Kuzzle } = require('kuzzle-sdk');
const kuzzle_sdk_1 = require("kuzzle-sdk");
const SECOND = 1000;

@@ -36,2 +35,6 @@ exports.kuzzleFlags = {

description: 'Impersonate a user',
}),
'api-key': command_1.flags.string({
description: 'Kuzzle user api-key',
default: process.env.KUZZLE_API_KEY || undefined,
})

@@ -47,2 +50,5 @@ };

this.protocol = options.protocol;
this.apikey = options['api-key'];
// Instantiate a fake SDK in the constructor to please TS
this.sdk = new kuzzle_sdk_1.Kuzzle(new kuzzle_sdk_1.WebSocket('nowhere'));
}

@@ -56,6 +62,6 @@ async init(logger) {

if (this.protocol === 'ws') {
ProtocolClass = WebSocket;
ProtocolClass = kuzzle_sdk_1.WebSocket;
}
else if (this.protocol === 'http') {
ProtocolClass = Http;
ProtocolClass = kuzzle_sdk_1.Http;
}

@@ -65,3 +71,3 @@ else {

}
this.sdk = new Kuzzle(new ProtocolClass(this.host, {
this.sdk = new kuzzle_sdk_1.Kuzzle(new ProtocolClass(this.host, {
port: this.port,

@@ -73,3 +79,6 @@ sslConnection: this.ssl,

await this.sdk.connect();
if (this.username !== 'anonymous') {
if (this.apikey) {
this.sdk.jwt = this.apikey;
}
else if (this.username !== 'anonymous') {
const credentials = {

@@ -121,4 +130,3 @@ username: this.username,

disconnect() {
var _a;
(_a = this.sdk) === null || _a === void 0 ? void 0 : _a.disconnect();
this.sdk.disconnect();
if (this.refreshTimer) {

@@ -125,0 +133,0 @@ clearInterval(this.refreshTimer);

@@ -1,1 +0,1 @@

{"version":"0.14.0","commands":{"import":{"id":"import","description":"Recursively imports dump files from a root directory","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"preserve-anonymous":{"name":"preserve-anonymous","type":"boolean","description":"Preserve anonymous rights","allowNo":false},"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"batch-size":{"name":"batch-size","type":"option","description":"Maximum batch size (see limits.documentsWriteCount config)","default":"200"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"path","description":"Root directory containing dumps","required":true}]},"subscribe":{"id":"subscribe","description":"Subscribes to realtime notifications","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou subscribe iot-data sensors","kourou subscribe iot-data sensors --filters '{ range: { temperature: { gt: 0 } } }'","kourou subscribe iot-data sensors --filters '{ exists: \"position\" }' --scope out","kourou subscribe iot-data sensors --users all --volatile '{ clientId: \"citizen-kane\" }'","kourou subscribe iot-data sensors --display result._source.temperature"],"flags":{"filters":{"name":"filters","type":"option","description":"Set of Koncorde filters","default":"{}"},"scope":{"name":"scope","type":"option","description":"Subscribe to document entering or leaving the scope (all, in, out, none)","default":"all"},"users":{"name":"users","type":"option","description":"Subscribe to users entering or leaving the room (all, in, out, none)","default":"all"},"volatile":{"name":"volatile","type":"option","description":"Additional subscription information used in user join/leave notifications","default":"{}"},"display":{"name":"display","type":"option","description":"Path of the property to display from the notification (empty string to display everything)","default":"result"},"editor":{"name":"editor","type":"boolean","description":"Open an editor (EDITOR env variable) to edit the filters before subscribing.","allowNo":false},"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (only websocket for realtime)","default":"websocket"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"index","description":"Index name","required":true},{"name":"collection","description":"Collection name","required":true}]},"api-key:check":{"id":"api-key:check","description":"Checks an API key validity","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou api-key:check eyJhbG...QxfQrc"],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"token","description":"API key token","required":true}]},"api-key:create":{"id":"api-key:create","description":"Creates a new API Key for a user","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"description":{"name":"description","type":"option","char":"d","description":"API Key description","required":true},"id":{"name":"id","type":"option","description":"API Key unique ID"},"expire":{"name":"expire","type":"option","description":"API Key validity","default":"-1"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"user","description":"User kuid","required":true}]},"api-key:delete":{"id":"api-key:delete","description":"Deletes an API key.","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou vault:delete sigfox-gateway 1k-BF3EBjsXdvA2PR8x"],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"user","description":"User kuid","required":true},{"name":"id","description":"API Key unique ID","required":true}]},"api-key:search":{"id":"api-key:search","description":"Lists a user's API Keys.","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"filter":{"name":"filter","type":"option","description":"Filter to match the API Key descriptions"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"user","description":"User kuid","required":true}]},"collection:create":{"id":"collection:create","description":"Creates a collection","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"index","description":"Index name","required":true},{"name":"collection","description":"Collection name","required":true},{"name":"body","description":"Collection mappings and settings in JS or JSON format. Will be read from STDIN if available"}]},"collection:export":{"id":"collection:export","description":"Exports a collection (JSONL format)","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou collection:export nyc-open-data yellow-taxi","kourou collection:export nyc-open-data yellow-taxi --query '{ term: { city: \"Saigon\" } }'"],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"path":{"name":"path","type":"option","description":"Dump root directory"},"batch-size":{"name":"batch-size","type":"option","description":"Maximum batch size (see limits.documentsFetchCount config)","default":"2000"},"query":{"name":"query","type":"option","description":"Only dump documents matching the query (JS or JSON format)","default":"{}"},"editor":{"name":"editor","type":"boolean","description":"Open an editor (EDITOR env variable) to edit the query before sending","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"index","description":"Index name","required":true},{"name":"collection","description":"Collection name","required":true}]},"collection:import":{"id":"collection:import","description":"Imports a collection","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"batch-size":{"name":"batch-size","type":"option","description":"Maximum batch size (see limits.documentsWriteCount config)","default":"200"},"index":{"name":"index","type":"option","description":"If set, override the index destination name"},"collection":{"name":"collection","type":"option","description":"If set, override the collection destination name"},"no-mappings":{"name":"no-mappings","type":"boolean","description":"Skip collection mappings","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"path","description":"Dump directory path","required":true}]},"config:diff":{"id":"config:diff","description":"Returns differences between two Kuzzle configuration files (kuzzlerc)","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou config:diff config/local/kuzzlerc config/production/kuzzlerc"],"flags":{"strict":{"name":"strict","type":"boolean","description":"Exit with an error if differences are found","allowNo":false},"values":{"name":"values","type":"boolean","description":"Also displays value changes","allowNo":false}},"args":[{"name":"first","description":"First configuration file","required":true},{"name":"second","description":"Second configuration file","required":true}]},"document:search":{"id":"document:search","description":"Searches for documents","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou document:search iot sensors --query '{ term: { name: \"corona\" } }'","kourou document:search iot sensors --editor"],"flags":{"query":{"name":"query","type":"option","description":"Query in JS or JSON format.","default":"{}"},"sort":{"name":"sort","type":"option","description":"Sort in JS or JSON format.","default":"{}"},"from":{"name":"from","type":"option","description":"Optional offset"},"size":{"name":"size","type":"option","description":"Optional page size"},"scroll":{"name":"scroll","type":"option","description":"Optional scroll TTL"},"editor":{"name":"editor","type":"boolean","description":"Open an editor (EDITOR env variable) to edit the request before sending","allowNo":false},"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"index","description":"Index name","required":true},{"name":"collection","description":"Collection name","required":true}]},"es:get":{"id":"es:get","description":"Gets a document from ES","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","char":"h","description":"Elasticsearch server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","description":"Elasticsearch server port","default":"9200"}},"args":[{"name":"index","description":"ES Index name","required":true},{"name":"id","description":"Document ID","required":true}]},"es:insert":{"id":"es:insert","description":"Inserts a document directly into ES (will replace if exists)","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"body":{"name":"body","type":"option","description":"Document body in JSON","default":"{}"},"id":{"name":"id","type":"option","description":"Document ID"},"host":{"name":"host","type":"option","char":"h","description":"Elasticsearch server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","description":"Elasticsearch server port","default":"9200"},"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false}},"args":[{"name":"index","description":"ES Index name","required":true}]},"es:list-index":{"id":"es:list-index","description":"Lists available ES indexes","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","char":"h","description":"Elasticsearch server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","description":"Elasticsearch server port","default":"9200"},"grep":{"name":"grep","type":"option","char":"g","description":"Match output with pattern"}},"args":[]},"file:decrypt":{"id":"file:decrypt","description":"Decrypts an encrypted file.","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou file:decrypt books/cryptonomicon.txt.enc --vault-key <vault-key>","kourou file:decrypt books/cryptonomicon.txt.enc -o books/cryptonomicon.txt --vault-key <vault-key>"],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"Overwrite the output file if it already exists","allowNo":false},"output-file":{"name":"output-file","type":"option","char":"o","description":"Output file (default: remove \".enc\")"},"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"file","description":"Encrypted file","required":true}]},"file:encrypt":{"id":"file:encrypt","description":"Encrypts an entire file.","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou file:encrypt books/cryptonomicon.txt --vault-key <vault-key>","kourou file:encrypt books/cryptonomicon.txt -o books/cryptonomicon.txt.enc --vault-key <vault-key>"],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"Overwrite the output file if it already exists","allowNo":false},"output-file":{"name":"output-file","type":"option","char":"o","description":"Output file (default: <filename>.enc)"},"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"file","description":"Filename","required":true}]},"file:test":{"id":"file:test","description":"Tests if an encrypted file can be decrypted.","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou file:test books/cryptonomicon.txt.enc --vault-key <vault-key>"],"flags":{"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"file","description":"Encrypted file","required":true}]},"index:export":{"id":"index:export","description":"Exports an index (JSONL format)","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"path":{"name":"path","type":"option","description":"Dump root directory"},"batch-size":{"name":"batch-size","type":"option","description":"Maximum batch size (see limits.documentsFetchCount config)","default":"2000"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"index","description":"Index name","required":true}]},"index:import":{"id":"index:import","description":"Imports an index (JSONL format)","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou index:import ./dump/iot-data","kourou index:import ./dump/iot-data --index iot-data-production --no-mappings"],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"batch-size":{"name":"batch-size","type":"option","description":"Maximum batch size (see limits.documentsWriteCount config)","default":"200"},"index":{"name":"index","type":"option","description":"If set, override the index destination name"},"no-mappings":{"name":"no-mappings","type":"boolean","description":"Skip collections mappings","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"path","description":"Dump directory or file","required":true}]},"instance:kill":{"id":"instance:kill","description":"Stop and remove all the containers of a running kuzzle instance","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"instance":{"name":"instance","type":"option","char":"i","description":"Kuzzle instance name [ex: stack-0]"},"all":{"name":"all","type":"boolean","char":"a","description":"Kill all instances","allowNo":false}},"args":[]},"instance:list":{"id":"instance:list","description":"Lists the Kuzzle running instances","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{},"args":[]},"instance:logs":{"id":"instance:logs","description":"Displays the logs of a running Kuzzle","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"instance":{"name":"instance","type":"option","char":"i","description":"Kuzzle instance name"},"follow":{"name":"follow","type":"boolean","char":"f","description":"Follow log output","allowNo":false}},"args":[]},"instance:spawn":{"id":"instance:spawn","description":"Spawn a new Kuzzle instance","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"check":{"name":"check","type":"boolean","description":"Check prerequisite before running Kuzzle","allowNo":false},"version":{"name":"version","type":"option","char":"v","description":"Core-version of the instance to spawn","default":"2"}},"args":[]},"profile:export":{"id":"profile:export","description":"Exports profiles","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"path":{"name":"path","type":"option","description":"Dump directory","default":"profiles"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[]},"profile:import":{"id":"profile:import","description":"Imports profiles","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"path","description":"Dump file","required":true}]},"role:export":{"id":"role:export","description":"Exports roles","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"path":{"name":"path","type":"option","description":"Dump directory","default":"roles"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[]},"role:import":{"id":"role:import","description":"Import roles","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"preserve-anonymous":{"name":"preserve-anonymous","type":"boolean","description":"Preserve anonymous rights","allowNo":false},"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"path","description":"Dump file","required":true}]},"sdk:execute":{"id":"sdk:execute","description":"\nExecutes arbitrary code.\n\nCode Execution\n\n Provided code will be executed in an async method.\n You can access a connected and authenticated SDK with the \"sdk\" variable.\n Templated variable passed as the command arguments are also accessible within the same name.\n Returned value will be printed on the standard output (e.g. 'return await sdk.server.now();').\n Errors will be caught and printed on the error output (e.g. 'throw new Error(\"failure\");').\n\nProvide code\n\n code can be passed with the --code flag\n code will be read from STDIN if available\n\n Examples:\n - kourou sdk:execute --code 'return await sdk.server.now()'\n - kourou sdk:execute --code 'return await sdk.index.exists(index)' --var 'index=\"iot-data\"'\n - kourou sdk:execute < snippet.js\n - echo 'return await sdk.server.now()' | kourou sdk:execute\n\nOther\n\n use the --editor flag to modify the code before executing it\n\n Examples:\n - kourou sdk:execute --code 'return await sdk.server.now()' --editor\n","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"code":{"name":"code","type":"option","description":"Code to execute. Will be read from STDIN if available."},"var":{"name":"var","type":"option","char":"v","description":"Additional arguments injected into the code. (eg: --var 'index=\"iot-data\"'"},"editor":{"name":"editor","type":"boolean","description":"Open an editor (EDITOR env variable) to edit the code before executing it.","allowNo":false},"keep-alive":{"name":"keep-alive","type":"boolean","description":"Keep the connection running (websocket only)","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[]},"sdk:query":{"id":"sdk:query","description":"\nExecutes an API query.\n\nQuery arguments\n\n Arguments can be passed and repeated using the --arg or -a flag.\n Index and collection names can be passed with --index (-i) and --collection (-c) flags\n ID can be passed with the --id flag.\n\n Examples:\n - kourou sdk:query document:delete -i iot -c sensors -a refresh=wait_for\n\nQuery body\n\n Body can be passed with the --body flag with either a JSON or JS string.\n Body will be read from STDIN if available\n\n Examples:\n - kourou sdk:query document:create -i iot -c sensors --body '{creation: Date.now())}'\n - kourou sdk:query admin:loadMappings < mappings.json\n - echo '{dynamic: \"strict\"}' | kourou sdk:query collection:create -i iot -c sensors\n\nOther\n\n Use the --editor flag to modify the query before sending it to Kuzzle\n Use the --display flag to display a specific property of the response\n\n Examples:\n - kourou sdk:query document:create -i iot -c sensors --editor\n - kourou sdk:query server:now --display 'result.now'\n\nDefault fallback to API method\n\n It's possible to use this command by only specifying the corresponding controller\n and action as first argument.\n Kourou will try to infer the first arguments to one the following pattern:\n - <command> <index>\n - <command> <index> <collection>\n - <command> <index> <collection> <id>\n - <command> <index> <collection> <body>\n - <command> <index> <collection> <id> <body>\n If a flag is given (-i, -c, --body or --id), then the flag value has prior to\n argument infering.\n\n Examples:\n - kourou collection:list iot\n - kourou collection:delete iot sensors\n - kourou document:createOrReplace iot sensors sigfox-1 '{}'\n - kourou bulk:import iot sensors '{bulkData: [...]}'\n - kourou admin:loadMappings < mappings.json\n","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"arg":{"name":"arg","type":"option","char":"a","description":"Additional argument. Repeatable. (e.g. \"-a refresh=wait_for\")"},"body":{"name":"body","type":"option","description":"Request body in JS or JSON format. Will be read from STDIN if available.","default":"{}"},"editor":{"name":"editor","type":"boolean","description":"Open an editor (EDITOR env variable) to edit the request before sending.","allowNo":false},"index":{"name":"index","type":"option","char":"i","description":"Index argument"},"collection":{"name":"collection","type":"option","char":"c","description":"Collection argument"},"id":{"name":"id","type":"option","description":"ID argument (_id)"},"display":{"name":"display","type":"option","description":"Path of the property to display from the response (empty string to display everything)","default":"result"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"controller:action","description":"Controller and action (eg: \"server:now\")","required":true}]},"user:export-mappings":{"id":"user:export-mappings","description":"Exports users collection mappings to JSON.","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"path":{"name":"path","type":"option","description":"Dump directory","default":"users"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[]},"user:export":{"id":"user:export","description":"\nExports users to JSON.\n\nThe users will be exported WITHOUT their credentials since Kuzzzle can't access them.\n\nYou can either:\n - Manually re-create credentials for your users\n - Use the \"mustChangePasswordIfSetByAdmin\" option Kuzzle password policies (see https://github.com/kuzzleio/kuzzle-plugin-auth-passport-local/#optional-properties)\n - Use the \"--generate-credentials\" flag to auto-generate credentials for your users\n\nAuto-generation of credentials\n\n With the \"--generate-credentials\" flag, Kourou will add credentials for the \"local\" strategy.\n By default, the username will be the user ID.\n Use the \"generated-username\" flag to use an other property than the user ID for the generated username\n The password will be a strong random 40 characters string\n\nExamples:\n\n - kourou user:export\n - kourou user:export --exclude '.*admin.*' --exclude 'supervisor.*'\n - kourou user:export --generate-credentials\n - kourou user:export --generate-credentials --generated-username content.email\n","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"path":{"name":"path","type":"option","description":"Dump directory","default":"users"},"exclude":{"name":"exclude","type":"option","description":"Exclude users by matching their IDs with a regexp"},"generate-credentials":{"name":"generate-credentials","type":"boolean","description":"Generate credentials with a random password for users","allowNo":false},"generated-username":{"name":"generated-username","type":"option","description":"User content property used as a username for local credentials","default":"_id"},"batch-size":{"name":"batch-size","type":"option","description":"Maximum batch size (see limits.documentsFetchCount config)","default":"2000"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[]},"user:import-mappings":{"id":"user:import-mappings","description":"Imports users collection mappings","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"path","description":"Dump file","required":true}]},"user:import":{"id":"user:import","description":"Imports users","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"}},"args":[{"name":"path","description":"Dump file","required":true}]},"vault:add":{"id":"vault:add","description":"\nAdds an encrypted key to an encrypted secrets file.\n\nA new secrets file is created if it does not yet exist.\n\nEncrypted secrets are meant to be loaded inside an application with Kuzzle Vault.\n\nSee https://github.com/kuzzleio/kuzzle-vault/ for more information.\n","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou vault:add config/secrets.enc.json aws.s3.keyId b61e267676660c314b006b06 --vault-key <vault-key>"],"flags":{"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"secrets-file","description":"Encrypted secrets file","required":true},{"name":"key","description":"Path to the key (lodash style)","required":true},{"name":"value","description":"Value to encrypt","required":true}]},"vault:decrypt":{"id":"vault:decrypt","description":"\nDecrypts an entire secrets file.\n\nDecrypted secrets file must NEVER be committed into the repository.\n\nSee https://github.com/kuzzleio/kuzzle-vault/ for more information.\n","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou vault:decrypt config/secrets.enc.json --vault-key <vault-key>","kourou vault:decrypt config/secrets.enc.json -o config/secrets.json --vault-key <vault-key>"],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"Overwrite the output file if it already exists","allowNo":false},"output-file":{"name":"output-file","type":"option","char":"o","description":"Output file (default: remove \".enc\")"},"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"file","description":"File containing encrypted secrets","required":true}]},"vault:encrypt":{"id":"vault:encrypt","description":"\nEncrypts an entire secrets file.\n\nThe secrets file must be in JSON format and it must contain only strings or objects.\n\nExample:\n{\n aws: {\n s3: {\n keyId: 'b61e267676660c314b006b06'\n }\n }\n}\n\nEncrypted secrets are meant to be loaded inside an application with Kuzzle Vault.\n\nSee https://github.com/kuzzleio/kuzzle-vault/ for more information.\n","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou vault:encrypt config/secrets.json --vault-key <vault-key>","kourou vault:encrypt config/secrets.json -o config/secrets_prod.enc.json --vault-key <vault-key>"],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"Overwrite the output file if it already exists","allowNo":false},"output-file":{"name":"output-file","type":"option","char":"o","description":"Output file (default: <file>.enc.json)"},"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"file","description":"File containing unencrypted secrets","required":true}]},"vault:show":{"id":"vault:show","description":"\nPrints an encrypted secrets file content.\n\nThis method can display either:\n - the entire content of the secrets file\n - a single key value\n\nSee https://github.com/kuzzleio/kuzzle-vault/ for more information.\n","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou vault:show config/secrets.enc.json --vault-key <vault-key>","kourou vault:show config/secrets.enc.json aws.s3.secretKey --vault-key <vault-key>"],"flags":{"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"secrets-file","description":"Encrypted secrets file","required":true},{"name":"key","description":"Path to a key (lodash style)"}]},"vault:test":{"id":"vault:test","description":"\nTests if an encrypted secrets file can be decrypted.\n\nSee https://github.com/kuzzleio/kuzzle-vault/ for more information.\n","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou vault:test config/secrets.enc.json --vault-key <vault-key>"],"flags":{"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"secrets-file","description":"Encrypted secrets file","required":true}]}}}
{"version":"0.15.0","commands":{"import":{"id":"import","description":"Recursively imports dump files from a root directory","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"preserve-anonymous":{"name":"preserve-anonymous","type":"boolean","description":"Preserve anonymous rights","allowNo":false},"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"batch-size":{"name":"batch-size","type":"option","description":"Maximum batch size (see limits.documentsWriteCount config)","default":"200"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"},"api-key":{"name":"api-key","type":"option","description":"Kuzzle user api-key"}},"args":[{"name":"path","description":"Root directory containing dumps","required":true}]},"api-key:check":{"id":"api-key:check","description":"Checks an API key validity","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou api-key:check eyJhbG...QxfQrc"],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"},"api-key":{"name":"api-key","type":"option","description":"Kuzzle user api-key"}},"args":[{"name":"token","description":"API key token","required":true}]},"api-key:create":{"id":"api-key:create","description":"Creates a new API Key for a user","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"description":{"name":"description","type":"option","char":"d","description":"API Key description","required":true},"id":{"name":"id","type":"option","description":"API Key unique ID"},"expire":{"name":"expire","type":"option","description":"API Key validity","default":"-1"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"},"api-key":{"name":"api-key","type":"option","description":"Kuzzle user api-key"}},"args":[{"name":"user","description":"User kuid","required":true}]},"api-key:delete":{"id":"api-key:delete","description":"Deletes an API key.","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou vault:delete sigfox-gateway 1k-BF3EBjsXdvA2PR8x"],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"},"api-key":{"name":"api-key","type":"option","description":"Kuzzle user api-key"}},"args":[{"name":"user","description":"User kuid","required":true},{"name":"id","description":"API Key unique ID","required":true}]},"api-key:search":{"id":"api-key:search","description":"Lists a user's API Keys.","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"filter":{"name":"filter","type":"option","description":"Filter to match the API Key descriptions"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"},"api-key":{"name":"api-key","type":"option","description":"Kuzzle user api-key"}},"args":[{"name":"user","description":"User kuid","required":true}]},"app:scaffold":{"id":"app:scaffold","description":"Scaffolds a new Kuzzle application","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false}},"args":[{"name":"name","description":"Application name","required":true}]},"app:start-services":{"id":"app:start-services","description":"Starts Kuzzle services (Elasticsearch and Redis)","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"check":{"name":"check","type":"boolean","description":"Check prerequisite before running services","allowNo":false}},"args":[]},"collection:create":{"id":"collection:create","description":"Creates a collection","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"},"api-key":{"name":"api-key","type":"option","description":"Kuzzle user api-key"}},"args":[{"name":"index","description":"Index name","required":true},{"name":"collection","description":"Collection name","required":true},{"name":"body","description":"Collection mappings and settings in JS or JSON format. Will be read from STDIN if available"}]},"collection:export":{"id":"collection:export","description":"Exports a collection (JSONL format)","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou collection:export nyc-open-data yellow-taxi","kourou collection:export nyc-open-data yellow-taxi --query '{ term: { city: \"Saigon\" } }'"],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"path":{"name":"path","type":"option","description":"Dump root directory"},"batch-size":{"name":"batch-size","type":"option","description":"Maximum batch size (see limits.documentsFetchCount config)","default":"2000"},"query":{"name":"query","type":"option","description":"Only dump documents matching the query (JS or JSON format)","default":"{}"},"editor":{"name":"editor","type":"boolean","description":"Open an editor (EDITOR env variable) to edit the query before sending","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"},"api-key":{"name":"api-key","type":"option","description":"Kuzzle user api-key"}},"args":[{"name":"index","description":"Index name","required":true},{"name":"collection","description":"Collection name","required":true}]},"collection:import":{"id":"collection:import","description":"Imports a collection","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"batch-size":{"name":"batch-size","type":"option","description":"Maximum batch size (see limits.documentsWriteCount config)","default":"200"},"index":{"name":"index","type":"option","description":"If set, override the index destination name"},"collection":{"name":"collection","type":"option","description":"If set, override the collection destination name"},"no-mappings":{"name":"no-mappings","type":"boolean","description":"Skip collection mappings","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"},"api-key":{"name":"api-key","type":"option","description":"Kuzzle user api-key"}},"args":[{"name":"path","description":"Dump directory path","required":true}]},"config:diff":{"id":"config:diff","description":"Returns differences between two Kuzzle configuration files (kuzzlerc)","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou config:diff config/local/kuzzlerc config/production/kuzzlerc"],"flags":{"strict":{"name":"strict","type":"boolean","description":"Exit with an error if differences are found","allowNo":false},"values":{"name":"values","type":"boolean","description":"Also displays value changes","allowNo":false}},"args":[{"name":"first","description":"First configuration file","required":true},{"name":"second","description":"Second configuration file","required":true}]},"document:search":{"id":"document:search","description":"Searches for documents","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou document:search iot sensors '{ term: { name: \"corona\" } }'","kourou document:search iot sensors --editor"],"flags":{"sort":{"name":"sort","type":"option","description":"Sort in JS or JSON format.","default":"{}"},"from":{"name":"from","type":"option","description":"Optional offset"},"size":{"name":"size","type":"option","description":"Optional page size"},"scroll":{"name":"scroll","type":"option","description":"Optional scroll TTL"},"editor":{"name":"editor","type":"boolean","description":"Open an editor (EDITOR env variable) to edit the request before sending","allowNo":false},"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"},"api-key":{"name":"api-key","type":"option","description":"Kuzzle user api-key"}},"args":[{"name":"index","description":"Index name","required":true},{"name":"collection","description":"Collection name","required":true},{"name":"query","description":"Query in JS or JSON format."}]},"es:get":{"id":"es:get","description":"Gets a document from ES","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","char":"h","description":"Elasticsearch server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","description":"Elasticsearch server port","default":"9200"}},"args":[{"name":"index","description":"ES Index name","required":true},{"name":"id","description":"Document ID","required":true}]},"es:insert":{"id":"es:insert","description":"Inserts a document directly into ES (will replace if exists)","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"body":{"name":"body","type":"option","description":"Document body in JSON","default":"{}"},"id":{"name":"id","type":"option","description":"Document ID"},"host":{"name":"host","type":"option","char":"h","description":"Elasticsearch server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","description":"Elasticsearch server port","default":"9200"},"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false}},"args":[{"name":"index","description":"ES Index name","required":true}]},"es:list-index":{"id":"es:list-index","description":"Lists available ES indexes","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","char":"h","description":"Elasticsearch server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","description":"Elasticsearch server port","default":"9200"},"grep":{"name":"grep","type":"option","char":"g","description":"Match output with pattern"}},"args":[]},"file:decrypt":{"id":"file:decrypt","description":"Decrypts an encrypted file.","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou file:decrypt books/cryptonomicon.txt.enc --vault-key <vault-key>","kourou file:decrypt books/cryptonomicon.txt.enc -o books/cryptonomicon.txt --vault-key <vault-key>"],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"Overwrite the output file if it already exists","allowNo":false},"output-file":{"name":"output-file","type":"option","char":"o","description":"Output file (default: remove \".enc\")"},"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"file","description":"Encrypted file","required":true}]},"file:encrypt":{"id":"file:encrypt","description":"Encrypts an entire file.","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou file:encrypt books/cryptonomicon.txt --vault-key <vault-key>","kourou file:encrypt books/cryptonomicon.txt -o books/cryptonomicon.txt.enc --vault-key <vault-key>"],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"Overwrite the output file if it already exists","allowNo":false},"output-file":{"name":"output-file","type":"option","char":"o","description":"Output file (default: <filename>.enc)"},"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"file","description":"Filename","required":true}]},"file:test":{"id":"file:test","description":"Tests if an encrypted file can be decrypted.","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou file:test books/cryptonomicon.txt.enc --vault-key <vault-key>"],"flags":{"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"file","description":"Encrypted file","required":true}]},"index:export":{"id":"index:export","description":"Exports an index (JSONL format)","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"path":{"name":"path","type":"option","description":"Dump root directory"},"batch-size":{"name":"batch-size","type":"option","description":"Maximum batch size (see limits.documentsFetchCount config)","default":"2000"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"},"api-key":{"name":"api-key","type":"option","description":"Kuzzle user api-key"}},"args":[{"name":"index","description":"Index name","required":true}]},"index:import":{"id":"index:import","description":"Imports an index (JSONL format)","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou index:import ./dump/iot-data","kourou index:import ./dump/iot-data --index iot-data-production --no-mappings"],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"batch-size":{"name":"batch-size","type":"option","description":"Maximum batch size (see limits.documentsWriteCount config)","default":"200"},"index":{"name":"index","type":"option","description":"If set, override the index destination name"},"no-mappings":{"name":"no-mappings","type":"boolean","description":"Skip collections mappings","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"},"api-key":{"name":"api-key","type":"option","description":"Kuzzle user api-key"}},"args":[{"name":"path","description":"Dump directory or file","required":true}]},"instance:kill":{"id":"instance:kill","description":"Stop and remove all the containers of a running kuzzle instance","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"instance":{"name":"instance","type":"option","char":"i","description":"Kuzzle instance name [ex: stack-0]"},"all":{"name":"all","type":"boolean","char":"a","description":"Kill all instances","allowNo":false}},"args":[]},"instance:list":{"id":"instance:list","description":"Lists the Kuzzle running instances","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{},"args":[]},"instance:logs":{"id":"instance:logs","description":"Displays the logs of a running Kuzzle","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"instance":{"name":"instance","type":"option","char":"i","description":"Kuzzle instance name"},"follow":{"name":"follow","type":"boolean","char":"f","description":"Follow log output","allowNo":false}},"args":[]},"instance:spawn":{"id":"instance:spawn","description":"Spawn a new Kuzzle instance","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"check":{"name":"check","type":"boolean","description":"Check prerequisite before running Kuzzle","allowNo":false},"version":{"name":"version","type":"option","char":"v","description":"Core-version of the instance to spawn","default":"2"}},"args":[]},"profile:export":{"id":"profile:export","description":"Exports profiles","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"path":{"name":"path","type":"option","description":"Dump directory","default":"profiles"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"},"api-key":{"name":"api-key","type":"option","description":"Kuzzle user api-key"}},"args":[]},"profile:import":{"id":"profile:import","description":"Imports profiles","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"},"api-key":{"name":"api-key","type":"option","description":"Kuzzle user api-key"}},"args":[{"name":"path","description":"Dump file","required":true}]},"realtime:subscribe":{"id":"realtime:subscribe","description":"Subscribes to realtime notifications","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou realtime:subscribe iot-data sensors","kourou realtime:subscribe iot-data sensors '{ range: { temperature: { gt: 0 } } }'","kourou realtime:subscribe iot-data sensors '{ exists: \"position\" }' --scope out","kourou realtime:subscribe iot-data sensors --users all --volatile '{ clientId: \"citizen-kane\" }'","kourou realtime:subscribe iot-data sensors --display result._source.temperature"],"flags":{"scope":{"name":"scope","type":"option","description":"Subscribe to document entering or leaving the scope (all, in, out, none)","default":"all"},"users":{"name":"users","type":"option","description":"Subscribe to users entering or leaving the room (all, in, out, none)","default":"all"},"volatile":{"name":"volatile","type":"option","description":"Additional subscription information used in user join/leave notifications","default":"{}"},"display":{"name":"display","type":"option","description":"Path of the property to display from the notification (empty string to display everything)","default":"result"},"editor":{"name":"editor","type":"boolean","description":"Open an editor (EDITOR env variable) to edit the filters before subscribing.","allowNo":false},"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (only websocket for realtime)","default":"websocket"},"as":{"name":"as","type":"option","description":"Impersonate a user"},"api-key":{"name":"api-key","type":"option","description":"Kuzzle user api-key"}},"args":[{"name":"index","description":"Index name","required":true},{"name":"collection","description":"Collection name","required":true},{"name":"filters","description":"Set of Koncorde filters"}]},"role:export":{"id":"role:export","description":"Exports roles","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"path":{"name":"path","type":"option","description":"Dump directory","default":"roles"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"},"api-key":{"name":"api-key","type":"option","description":"Kuzzle user api-key"}},"args":[]},"role:import":{"id":"role:import","description":"Import roles","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"preserve-anonymous":{"name":"preserve-anonymous","type":"boolean","description":"Preserve anonymous rights","allowNo":false},"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"},"api-key":{"name":"api-key","type":"option","description":"Kuzzle user api-key"}},"args":[{"name":"path","description":"Dump file","required":true}]},"sdk:execute":{"id":"sdk:execute","description":"\nExecutes arbitrary code.\n\nCode Execution\n\n Provided code will be executed in an async method.\n You can access a connected and authenticated SDK with the \"sdk\" variable.\n Templated variable passed as the command arguments are also accessible within the same name.\n Returned value will be printed on the standard output (e.g. 'return await sdk.server.now();').\n Errors will be caught and printed on the error output (e.g. 'throw new Error(\"failure\");').\n\nProvide code\n\n code can be passed with the --code flag\n code will be read from STDIN if available\n\n Examples:\n - kourou sdk:execute --code 'return await sdk.server.now()'\n - kourou sdk:execute --code 'return await sdk.index.exists(index)' --var 'index=\"iot-data\"'\n - kourou sdk:execute < snippet.js\n - echo 'return await sdk.server.now()' | kourou sdk:execute\n\nOther\n\n use the --editor flag to modify the code before executing it\n\n Examples:\n - kourou sdk:execute --code 'return await sdk.server.now()' --editor\n","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"code":{"name":"code","type":"option","description":"Code to execute. Will be read from STDIN if available."},"var":{"name":"var","type":"option","char":"v","description":"Additional arguments injected into the code. (eg: --var 'index=\"iot-data\"'"},"editor":{"name":"editor","type":"boolean","description":"Open an editor (EDITOR env variable) to edit the code before executing it.","allowNo":false},"keep-alive":{"name":"keep-alive","type":"boolean","description":"Keep the connection running (websocket only)","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"},"api-key":{"name":"api-key","type":"option","description":"Kuzzle user api-key"}},"args":[]},"sdk:query":{"id":"sdk:query","description":"\nExecutes an API query.\n\nQuery arguments\n\n Arguments can be passed and repeated using the --arg or -a flag.\n Index and collection names can be passed with --index (-i) and --collection (-c) flags\n ID can be passed with the --id flag.\n\n Examples:\n - kourou sdk:query document:delete -i iot -c sensors -a refresh=wait_for\n\nQuery body\n\n Body can be passed with the --body flag with either a JSON or JS string.\n Body will be read from STDIN if available\n\n Examples:\n - kourou sdk:query document:create -i iot -c sensors --body '{creation: Date.now())}'\n - kourou sdk:query admin:loadMappings < mappings.json\n - echo '{dynamic: \"strict\"}' | kourou sdk:query collection:create -i iot -c sensors\n\nOther\n\n Use the --editor flag to modify the query before sending it to Kuzzle\n Use the --display flag to display a specific property of the response\n\n Examples:\n - kourou sdk:query document:create -i iot -c sensors --editor\n - kourou sdk:query server:now --display 'result.now'\n\nDefault fallback to API method\n\n It's possible to use this command by only specifying the corresponding controller\n and action as first argument.\n Kourou will try to infer the first arguments to one the following pattern:\n - <command> <index>\n - <command> <body>\n - <command> <index> <collection>\n - <command> <index> <collection> <id>\n - <command> <index> <collection> <body>\n - <command> <index> <collection> <id> <body>\n If a flag is given (-i, -c, --body or --id), then the flag value has prior to\n argument infering.\n\n Examples:\n - kourou collection:list iot\n - kourou security:createUser '{\"content\":{\"profileIds\":[\"default\"]}}' --id yagmur\n - kourou collection:delete iot sensors\n - kourou document:createOrReplace iot sensors sigfox-1 '{}'\n - kourou bulk:import iot sensors '{bulkData: [...]}'\n - kourou admin:loadMappings < mappings.json\n","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"arg":{"name":"arg","type":"option","char":"a","description":"Additional argument. Repeatable. (e.g. \"-a refresh=wait_for\")"},"body":{"name":"body","type":"option","description":"Request body in JS or JSON format. Will be read from STDIN if available.","default":"{}"},"editor":{"name":"editor","type":"boolean","description":"Open an editor (EDITOR env variable) to edit the request before sending.","allowNo":false},"body-editor":{"name":"body-editor","type":"boolean","description":"Open an editor (EDITOR env variable) to edit the body before sending.","allowNo":false},"index":{"name":"index","type":"option","char":"i","description":"Index argument"},"collection":{"name":"collection","type":"option","char":"c","description":"Collection argument"},"id":{"name":"id","type":"option","description":"ID argument (_id)"},"display":{"name":"display","type":"option","description":"Path of the property to display from the response (empty string to display everything)","default":"result"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or ws)","default":"http"},"as":{"name":"as","type":"option","description":"Impersonate a user"},"api-key":{"name":"api-key","type":"option","description":"Kuzzle user api-key"}},"args":[{"name":"controller:action","description":"Controller and action (eg: \"server:now\")","required":true}]},"user:export-mappings":{"id":"user:export-mappings","description":"Exports users collection mappings to JSON.","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"path":{"name":"path","type":"option","description":"Dump directory","default":"users"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"},"api-key":{"name":"api-key","type":"option","description":"Kuzzle user api-key"}},"args":[]},"user:export":{"id":"user:export","description":"\nExports users to JSON.\n\nThe users will be exported WITHOUT their credentials since Kuzzzle can't access them.\n\nYou can either:\n - Manually re-create credentials for your users\n - Use the \"mustChangePasswordIfSetByAdmin\" option Kuzzle password policies (see https://github.com/kuzzleio/kuzzle-plugin-auth-passport-local/#optional-properties)\n - Use the \"--generate-credentials\" flag to auto-generate credentials for your users\n\nAuto-generation of credentials\n\n With the \"--generate-credentials\" flag, Kourou will add credentials for the \"local\" strategy.\n By default, the username will be the user ID.\n Use the \"generated-username\" flag to use an other property than the user ID for the generated username\n The password will be a strong random 40 characters string\n\nExamples:\n\n - kourou user:export\n - kourou user:export --exclude '.*admin.*' --exclude 'supervisor.*'\n - kourou user:export --generate-credentials\n - kourou user:export --generate-credentials --generated-username content.email\n","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"path":{"name":"path","type":"option","description":"Dump directory","default":"users"},"exclude":{"name":"exclude","type":"option","description":"Exclude users by matching their IDs with a regexp"},"generate-credentials":{"name":"generate-credentials","type":"boolean","description":"Generate credentials with a random password for users","allowNo":false},"generated-username":{"name":"generated-username","type":"option","description":"User content property used as a username for local credentials","default":"_id"},"batch-size":{"name":"batch-size","type":"option","description":"Maximum batch size (see limits.documentsFetchCount config)","default":"2000"},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"},"api-key":{"name":"api-key","type":"option","description":"Kuzzle user api-key"}},"args":[]},"user:import-mappings":{"id":"user:import-mappings","description":"Imports users collection mappings","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"},"api-key":{"name":"api-key","type":"option","description":"Kuzzle user api-key"}},"args":[{"name":"path","description":"Dump file","required":true}]},"user:import":{"id":"user:import","description":"Imports users","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","description":"Kuzzle server port","default":"7512"},"ssl":{"name":"ssl","type":"boolean","description":"Use SSL to connect to Kuzzle","allowNo":false},"username":{"name":"username","type":"option","description":"Kuzzle username (local strategy)","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"},"protocol":{"name":"protocol","type":"option","description":"Kuzzle protocol (http or websocket)","default":"ws"},"as":{"name":"as","type":"option","description":"Impersonate a user"},"api-key":{"name":"api-key","type":"option","description":"Kuzzle user api-key"}},"args":[{"name":"path","description":"Dump file","required":true}]},"vault:add":{"id":"vault:add","description":"\nAdds an encrypted key to an encrypted secrets file.\n\nA new secrets file is created if it does not yet exist.\n\nEncrypted secrets are meant to be loaded inside an application with Kuzzle Vault.\n\nSee https://github.com/kuzzleio/kuzzle-vault/ for more information.\n","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou vault:add config/secrets.enc.json aws.s3.keyId b61e267676660c314b006b06 --vault-key <vault-key>"],"flags":{"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"secrets-file","description":"Encrypted secrets file","required":true},{"name":"key","description":"Path to the key (lodash style)","required":true},{"name":"value","description":"Value to encrypt","required":true}]},"vault:decrypt":{"id":"vault:decrypt","description":"\nDecrypts an entire secrets file.\n\nDecrypted secrets file must NEVER be committed into the repository.\n\nSee https://github.com/kuzzleio/kuzzle-vault/ for more information.\n","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou vault:decrypt config/secrets.enc.json --vault-key <vault-key>","kourou vault:decrypt config/secrets.enc.json -o config/secrets.json --vault-key <vault-key>"],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"Overwrite the output file if it already exists","allowNo":false},"output-file":{"name":"output-file","type":"option","char":"o","description":"Output file (default: remove \".enc\")"},"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"file","description":"File containing encrypted secrets","required":true}]},"vault:encrypt":{"id":"vault:encrypt","description":"\nEncrypts an entire secrets file.\n\nThe secrets file must be in JSON format and it must contain only strings or objects.\n\nExample:\n{\n aws: {\n s3: {\n keyId: 'b61e267676660c314b006b06'\n }\n }\n}\n\nEncrypted secrets are meant to be loaded inside an application with Kuzzle Vault.\n\nSee https://github.com/kuzzleio/kuzzle-vault/ for more information.\n","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou vault:encrypt config/secrets.json --vault-key <vault-key>","kourou vault:encrypt config/secrets.json -o config/secrets_prod.enc.json --vault-key <vault-key>"],"flags":{"force":{"name":"force","type":"boolean","char":"f","description":"Overwrite the output file if it already exists","allowNo":false},"output-file":{"name":"output-file","type":"option","char":"o","description":"Output file (default: <file>.enc.json)"},"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"file","description":"File containing unencrypted secrets","required":true}]},"vault:show":{"id":"vault:show","description":"\nPrints an encrypted secrets file content.\n\nThis method can display either:\n - the entire content of the secrets file\n - a single key value\n\nSee https://github.com/kuzzleio/kuzzle-vault/ for more information.\n","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou vault:show config/secrets.enc.json --vault-key <vault-key>","kourou vault:show config/secrets.enc.json aws.s3.secretKey --vault-key <vault-key>"],"flags":{"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"secrets-file","description":"Encrypted secrets file","required":true},{"name":"key","description":"Path to a key (lodash style)"}]},"vault:test":{"id":"vault:test","description":"\nTests if an encrypted secrets file can be decrypted.\n\nSee https://github.com/kuzzleio/kuzzle-vault/ for more information.\n","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou vault:test config/secrets.enc.json --vault-key <vault-key>"],"flags":{"vault-key":{"name":"vault-key","type":"option","description":"Kuzzle Vault Key (or KUZZLE_VAULT_KEY)"}},"args":[{"name":"secrets-file","description":"Encrypted secrets file","required":true}]}}}
{
"name": "kourou",
"description": "The CLI that helps you manage your Kuzzle instances",
"version": "0.14.0",
"version": "0.15.0",
"author": "The Kuzzle Team <support@kuzzle.io>",

@@ -20,5 +20,4 @@ "bin": {

"cli-ux": "^5.4.6",
"execa": "^3.4.0",
"inquirer": "^7.1.0",
"kuzzle-sdk": "^7.2.0",
"kuzzle-sdk": "^7.4.0",
"kuzzle-vault": "^2.0.0",

@@ -81,2 +80,5 @@ "listr": "^0.14.3",

},
"app": {
"description": "create, manage and run applications"
},
"collection": {

@@ -116,6 +118,9 @@ "description": "dump or restore an entire data collection"

"scripts": {
"build": "tsc -b",
"dev": "./bin/run",
"postpack": "rm -f oclif.manifest.json",
"prepack": "rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme",
"version": "oclif-dev readme && git add README.md",
"test:lint": "eslint . --ext .ts --config .eslintrc",
"test:lint": "eslint src/ test/ --ext .ts --config .eslintrc",
"test:lint:fix": "eslint src/ test/ --ext .ts --fix --config .eslintrc",
"test:functional": "npm run test:functional:stdout && npm run test:functional:cucumber",

@@ -122,0 +127,0 @@ "test:functional:stdout": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",

@@ -27,3 +27,3 @@ # kourou

$ kourou (-v|--version|version)
kourou/0.14.0 linux-x64 node-v12.18.2
kourou/0.15.0 linux-x64 node-v12.19.0
$ kourou --help [COMMAND]

@@ -42,2 +42,3 @@ USAGE

```
--host=host [default: localhost] Kuzzle server host

@@ -47,8 +48,11 @@ --port=port [default: 7512] Kuzzle server port

--password=password Kuzzle user password
--api-key=api-key Kuzzle user api-key
--ssl [default: true for port 443] Use SSL to connect to Kuzzle
--protocol [default: http] Protocol used to connect to Kuzzle (`http` or `ws`)
```
--protocol [default: http] Protocol used to connect to Kuzzle ( `http` or `ws` )
```
By environment variables:
```
KUZZLE_HOST [default: localhost] Kuzzle server host

@@ -58,12 +62,13 @@ KUZZLE_PORT [default: 7512] Kuzzle server port

KUZZLE_PASSWORD Kuzzle user password
KUZZLE_API_KEY Kuzzle user api-key
KUZZLE_SSL Use SSL to connect to Kuzzle
KUZZLE_PROTOCOL Protocol used to connect to Kuzzle (`http` or `ws`)
```
KUZZLE_PROTOCOL Protocol used to connect to Kuzzle ( `http` or `ws` )
```
## User impersonation
You can impersonate a user before executing a command with the `--as` flag and a user `kuid`.
You can impersonate a user before executing a command with the `--as` flag and a user `kuid` .
User impersonation require the following rights for the authenticated user: `security:createApiKey`, `security:deleteApiKey`
User impersonation require the following rights for the authenticated user: `security:createApiKey` , `security:deleteApiKey`
```bash

@@ -84,29 +89,34 @@ $ kourou sdk:query auth:getCurrentUser --as gordon --username admin --password admin

The first argument has to be the name of the controller and the action separated by a semicolon (eg `document:create`)
The first argument has to be the name of the controller and the action separated by a semicolon (eg `document:create` )
Kourou will try to infer common arguments like `index`, `collection`, `_id` or `body`.
Kourou will try to infer common arguments like `index` , `collection` , `_id` or `body` .
It will automatically infer and accept the following lists of arguments:
- `<command> <index>`
* _eg: `kourou collection:list iot`_
- _eg: `kourou collection:list iot` _
.
- `<command> <body>`
- _eg: `kourou security:createUser '{"content":{"profileIds":["default"]}}' --id yagmur` _
.
- `<command> <index> <collection>`
* _eg: `kourou collection:truncate iot sensors`_
- _eg: `kourou collection:truncate iot sensors` _
.
- `<command> <index> <collection> <body>`
- _eg: `kourou bulk:import iot sensors '{bulkData: []}'` _
- `<command> <index> <collection> <body>`
* _eg: `kourou bulk:import iot sensors '{bulkData: []}'`_
.
- `<command> <index> <collection> <id>`
- _eg: `kourou document:delete iot sensors sigfox-123` _
- `<command> <index> <collection> <id>`
* _eg: `kourou document:delete iot sensors sigfox-123`_
.
- `<command> <index> <collection> <id> <body>`
* _eg: `kourou document:create iot sensors sigfox-123 '{temperature: 42}'`_
- _eg: `kourou document:create iot sensors sigfox-123 '{temperature: 42}'` _

@@ -122,2 +132,4 @@ Then any argument will be passed as-is to the `sdk:query` method.

* [`kourou api-key:search USER`](#kourou-api-keysearch-user)
* [`kourou app:scaffold NAME`](#kourou-appscaffold-name)
* [`kourou app:start-services`](#kourou-appstart-services)
* [`kourou collection:create INDEX COLLECTION [BODY]`](#kourou-collectioncreate-index-collection-body)

@@ -127,3 +139,3 @@ * [`kourou collection:export INDEX COLLECTION`](#kourou-collectionexport-index-collection)

* [`kourou config:diff FIRST SECOND`](#kourou-configdiff-first-second)
* [`kourou document:search INDEX COLLECTION`](#kourou-documentsearch-index-collection)
* [`kourou document:search INDEX COLLECTION [QUERY]`](#kourou-documentsearch-index-collection-query)
* [`kourou es:get INDEX ID`](#kourou-esget-index-id)

@@ -145,2 +157,3 @@ * [`kourou es:insert INDEX`](#kourou-esinsert-index)

* [`kourou profile:import PATH`](#kourou-profileimport-path)
* [`kourou realtime:subscribe INDEX COLLECTION [FILTERS]`](#kourou-realtimesubscribe-index-collection-filters)
* [`kourou role:export`](#kourou-roleexport)

@@ -150,3 +163,2 @@ * [`kourou role:import PATH`](#kourou-roleimport-path)

* [`kourou sdk:query CONTROLLER:ACTION`](#kourou-sdkquery-controlleraction)
* [`kourou subscribe INDEX COLLECTION`](#kourou-subscribe-index-collection)
* [`kourou user:export`](#kourou-userexport)

@@ -174,2 +186,3 @@ * [`kourou user:export-mappings`](#kourou-userexport-mappings)

OPTIONS
--api-key=api-key Kuzzle user api-key
--as=as Impersonate a user

@@ -203,2 +216,3 @@ --help show CLI help

-d, --description=description (required) API Key description
--api-key=api-key Kuzzle user api-key
--as=as Impersonate a user

@@ -231,2 +245,3 @@ --expire=expire [default: -1] API Key validity

OPTIONS
--api-key=api-key Kuzzle user api-key
--as=as Impersonate a user

@@ -259,2 +274,3 @@ --help show CLI help

OPTIONS
--api-key=api-key Kuzzle user api-key
--as=as Impersonate a user

@@ -273,2 +289,34 @@ --filter=filter Filter to match the API Key descriptions

## `kourou app:scaffold NAME`
Scaffolds a new Kuzzle application
```
USAGE
$ kourou app:scaffold NAME
ARGUMENTS
NAME Application name
OPTIONS
--help show CLI help
```
_See code: [src/commands/app/scaffold.ts](src/commands/app/scaffold.ts)_
## `kourou app:start-services`
Starts Kuzzle services (Elasticsearch and Redis)
```
USAGE
$ kourou app:start-services
OPTIONS
--check Check prerequisite before running services
--help show CLI help
```
_See code: [src/commands/app/start-services.ts](src/commands/app/start-services.ts)_
## `kourou collection:create INDEX COLLECTION [BODY]`

@@ -288,2 +336,3 @@

OPTIONS
--api-key=api-key Kuzzle user api-key
--as=as Impersonate a user

@@ -314,2 +363,3 @@ --help show CLI help

OPTIONS
--api-key=api-key Kuzzle user api-key
--as=as Impersonate a user

@@ -347,2 +397,3 @@ --batch-size=batch-size [default: 2000] Maximum batch size (see limits.documentsFetchCount config)

OPTIONS
--api-key=api-key Kuzzle user api-key
--as=as Impersonate a user

@@ -386,3 +437,3 @@ --batch-size=batch-size [default: 200] Maximum batch size (see limits.documentsWriteCount config)

## `kourou document:search INDEX COLLECTION`
## `kourou document:search INDEX COLLECTION [QUERY]`

@@ -393,3 +444,3 @@ Searches for documents

USAGE
$ kourou document:search INDEX COLLECTION
$ kourou document:search INDEX COLLECTION [QUERY]

@@ -399,4 +450,6 @@ ARGUMENTS

COLLECTION Collection name
QUERY Query in JS or JSON format.
OPTIONS
--api-key=api-key Kuzzle user api-key
--as=as Impersonate a user

@@ -410,3 +463,2 @@ --editor Open an editor (EDITOR env variable) to edit the request before sending

--protocol=protocol [default: http] Kuzzle protocol (http or ws)
--query=query [default: {}] Query in JS or JSON format.
--scroll=scroll Optional scroll TTL

@@ -419,3 +471,3 @@ --size=size Optional page size

EXAMPLES
kourou document:search iot sensors --query '{ term: { name: "corona" } }'
kourou document:search iot sensors '{ term: { name: "corona" } }'
kourou document:search iot sensors --editor

@@ -579,2 +631,3 @@ ```

OPTIONS
--api-key=api-key Kuzzle user api-key
--as=as Impersonate a user

@@ -606,2 +659,3 @@ --batch-size=batch-size [default: 200] Maximum batch size (see limits.documentsWriteCount config)

OPTIONS
--api-key=api-key Kuzzle user api-key
--as=as Impersonate a user

@@ -633,2 +687,3 @@ --batch-size=batch-size [default: 2000] Maximum batch size (see limits.documentsFetchCount config)

OPTIONS
--api-key=api-key Kuzzle user api-key
--as=as Impersonate a user

@@ -719,2 +774,3 @@ --batch-size=batch-size [default: 200] Maximum batch size (see limits.documentsWriteCount config)

OPTIONS
--api-key=api-key Kuzzle user api-key
--as=as Impersonate a user

@@ -745,2 +801,3 @@ --help show CLI help

OPTIONS
--api-key=api-key Kuzzle user api-key
--as=as Impersonate a user

@@ -758,2 +815,54 @@ --help show CLI help

## `kourou realtime:subscribe INDEX COLLECTION [FILTERS]`
Subscribes to realtime notifications
```
USAGE
$ kourou realtime:subscribe INDEX COLLECTION [FILTERS]
ARGUMENTS
INDEX Index name
COLLECTION Collection name
FILTERS Set of Koncorde filters
OPTIONS
--api-key=api-key Kuzzle user api-key
--as=as Impersonate a user
--display=display [default: result] Path of the property to display from the notification (empty string to display
everything)
--editor Open an editor (EDITOR env variable) to edit the filters before subscribing.
--help show CLI help
--host=host [default: localhost] Kuzzle server host
--password=password Kuzzle user password
--port=port [default: 7512] Kuzzle server port
--protocol=protocol [default: websocket] Kuzzle protocol (only websocket for realtime)
--scope=scope [default: all] Subscribe to document entering or leaving the scope (all, in, out, none)
--ssl Use SSL to connect to Kuzzle
--username=username [default: anonymous] Kuzzle username (local strategy)
--users=users [default: all] Subscribe to users entering or leaving the room (all, in, out, none)
--volatile=volatile [default: {}] Additional subscription information used in user join/leave notifications
EXAMPLES
kourou realtime:subscribe iot-data sensors
kourou realtime:subscribe iot-data sensors '{ range: { temperature: { gt: 0 } } }'
kourou realtime:subscribe iot-data sensors '{ exists: "position" }' --scope out
kourou realtime:subscribe iot-data sensors --users all --volatile '{ clientId: "citizen-kane" }'
kourou realtime:subscribe iot-data sensors --display result._source.temperature
```
_See code: [src/commands/realtime/subscribe.ts](src/commands/realtime/subscribe.ts)_
## `kourou role:export`

@@ -768,2 +877,3 @@

OPTIONS
--api-key=api-key Kuzzle user api-key
--as=as Impersonate a user

@@ -794,2 +904,3 @@ --help show CLI help

OPTIONS
--api-key=api-key Kuzzle user api-key
--as=as Impersonate a user

@@ -818,2 +929,3 @@ --help show CLI help

-v, --var=var Additional arguments injected into the code. (eg: --var 'index="iot-data"'
--api-key=api-key Kuzzle user api-key
--as=as Impersonate a user

@@ -878,4 +990,6 @@ --code=code Code to execute. Will be read from STDIN if available.

-i, --index=index Index argument
--api-key=api-key Kuzzle user api-key
--as=as Impersonate a user
--body=body [default: {}] Request body in JS or JSON format. Will be read from STDIN if available.
--body-editor Open an editor (EDITOR env variable) to edit the body before sending.

@@ -940,2 +1054,3 @@ --display=display [default: result] Path of the property to display from the response (empty string to

- <command> <index>
- <command> <body>
- <command> <index> <collection>

@@ -950,2 +1065,3 @@ - <command> <index> <collection> <id>

- kourou collection:list iot
- kourou security:createUser '{"content":{"profileIds":["default"]}}' --id yagmur
- kourou collection:delete iot sensors

@@ -959,54 +1075,2 @@ - kourou document:createOrReplace iot sensors sigfox-1 '{}'

## `kourou subscribe INDEX COLLECTION`
Subscribes to realtime notifications
```
USAGE
$ kourou subscribe INDEX COLLECTION
ARGUMENTS
INDEX Index name
COLLECTION Collection name
OPTIONS
--as=as Impersonate a user
--display=display [default: result] Path of the property to display from the notification (empty string to display
everything)
--editor Open an editor (EDITOR env variable) to edit the filters before subscribing.
--filters=filters [default: {}] Set of Koncorde filters
--help show CLI help
--host=host [default: localhost] Kuzzle server host
--password=password Kuzzle user password
--port=port [default: 7512] Kuzzle server port
--protocol=protocol [default: websocket] Kuzzle protocol (only websocket for realtime)
--scope=scope [default: all] Subscribe to document entering or leaving the scope (all, in, out, none)
--ssl Use SSL to connect to Kuzzle
--username=username [default: anonymous] Kuzzle username (local strategy)
--users=users [default: all] Subscribe to users entering or leaving the room (all, in, out, none)
--volatile=volatile [default: {}] Additional subscription information used in user join/leave notifications
EXAMPLES
kourou subscribe iot-data sensors
kourou subscribe iot-data sensors --filters '{ range: { temperature: { gt: 0 } } }'
kourou subscribe iot-data sensors --filters '{ exists: "position" }' --scope out
kourou subscribe iot-data sensors --users all --volatile '{ clientId: "citizen-kane" }'
kourou subscribe iot-data sensors --display result._source.temperature
```
_See code: [src/commands/subscribe.ts](src/commands/subscribe.ts)_
## `kourou user:export`

@@ -1021,2 +1085,3 @@

OPTIONS
--api-key=api-key Kuzzle user api-key
--as=as Impersonate a user

@@ -1073,2 +1138,3 @@ --batch-size=batch-size [default: 2000] Maximum batch size (see limits.documentsFetchCount config)

OPTIONS
--api-key=api-key Kuzzle user api-key
--as=as Impersonate a user

@@ -1099,2 +1165,3 @@ --help show CLI help

OPTIONS
--api-key=api-key Kuzzle user api-key
--as=as Impersonate a user

@@ -1124,2 +1191,3 @@ --help show CLI help

OPTIONS
--api-key=api-key Kuzzle user api-key
--as=as Impersonate a user

@@ -1126,0 +1194,0 @@ --help show CLI help

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc