Comparing version 0.9.0 to 0.10.0
@@ -21,5 +21,4 @@ import { flags } from '@oclif/command'; | ||
}[]; | ||
run(): Promise<void>; | ||
runSafe(): Promise<void>; | ||
} | ||
export default ApiKeyCreate; |
@@ -7,26 +7,13 @@ "use strict"; | ||
class ApiKeyCreate extends common_1.Kommand { | ||
async run() { | ||
try { | ||
await this.runSafe(); | ||
} | ||
catch (error) { | ||
this.logError(error); | ||
} | ||
} | ||
async runSafe() { | ||
this.printCommand(); | ||
const { args, flags: userFlags } = this.parse(ApiKeyCreate); | ||
const sdk = new kuzzle_1.KuzzleSDK(userFlags); | ||
await sdk.init(this.log); | ||
try { | ||
const apiKey = await sdk.security.createApiKey(args.user, userFlags.description, { | ||
_id: userFlags.id, | ||
expiresIn: userFlags.expire | ||
}); | ||
this.log(`Successfully created API Key "${apiKey._id}" for user "${args.user}"`); | ||
this.log(apiKey._source.token); | ||
} | ||
catch (error) { | ||
this.logError(error.message); | ||
} | ||
this.sdk = new kuzzle_1.KuzzleSDK(userFlags); | ||
await this.sdk.init(this.log); | ||
const apiKey = await this.sdk.security.createApiKey(args.user, userFlags.description, { | ||
_id: userFlags.id, | ||
expiresIn: userFlags.expire | ||
}); | ||
this.log(`Successfully created API Key "${apiKey._id}" for user "${args.user}"`); | ||
this.log(apiKey._source.token); | ||
} | ||
@@ -33,0 +20,0 @@ } |
@@ -12,3 +12,2 @@ import { flags } from '@oclif/command'; | ||
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>; | ||
id: flags.IOptionFlag<string | undefined>; | ||
}; | ||
@@ -20,5 +19,5 @@ static args: { | ||
}[]; | ||
run(): Promise<void>; | ||
static examples: string[]; | ||
runSafe(): Promise<void>; | ||
} | ||
export default ApiKeyDelete; |
@@ -7,31 +7,20 @@ "use strict"; | ||
class ApiKeyDelete extends common_1.Kommand { | ||
async run() { | ||
try { | ||
await this.runSafe(); | ||
} | ||
catch (error) { | ||
this.logError(error); | ||
} | ||
} | ||
async runSafe() { | ||
this.printCommand(); | ||
const { flags: userFlags, args } = this.parse(ApiKeyDelete); | ||
const sdk = new kuzzle_1.KuzzleSDK(userFlags); | ||
await sdk.init(this.log); | ||
try { | ||
await sdk.security.deleteApiKey(args.user, userFlags.id); | ||
this.log(`Successfully deleted API Key "${userFlags.id}" of user "${args.user}"`); | ||
} | ||
catch (error) { | ||
this.logError(error.message); | ||
} | ||
this.sdk = new kuzzle_1.KuzzleSDK(userFlags); | ||
await this.sdk.init(this.log); | ||
await this.sdk.security.deleteApiKey(args.user, args.id); | ||
this.log(`Successfully deleted API Key "${args.id}" of user "${args.user}"`); | ||
} | ||
} | ||
ApiKeyDelete.description = 'Deletes an API key.'; | ||
ApiKeyDelete.flags = Object.assign({ help: command_1.flags.help(), id: command_1.flags.string({ | ||
description: 'API Key unique ID', | ||
}) }, kuzzle_1.kuzzleFlags); | ||
ApiKeyDelete.flags = Object.assign({ help: command_1.flags.help() }, kuzzle_1.kuzzleFlags); | ||
ApiKeyDelete.args = [ | ||
{ name: 'user', description: 'User kuid', required: true }, | ||
{ name: 'id', description: 'API Key unique ID', required: true }, | ||
]; | ||
ApiKeyDelete.examples = [ | ||
'kourou vault:delete sigfox-gateway 1k-BF3EBjsXdvA2PR8x' | ||
]; | ||
exports.default = ApiKeyDelete; |
@@ -19,5 +19,4 @@ import { flags } from '@oclif/command'; | ||
}[]; | ||
run(): Promise<void>; | ||
runSafe(): Promise<void>; | ||
} | ||
export default ApiKeySearch; |
@@ -7,15 +7,7 @@ "use strict"; | ||
class ApiKeySearch extends common_1.Kommand { | ||
async run() { | ||
try { | ||
await this.runSafe(); | ||
} | ||
catch (error) { | ||
this.logError(error); | ||
} | ||
} | ||
async runSafe() { | ||
this.printCommand(); | ||
const { flags: userFlags, args } = this.parse(ApiKeySearch); | ||
const sdk = new kuzzle_1.KuzzleSDK(userFlags); | ||
await sdk.init(this.log); | ||
this.sdk = new kuzzle_1.KuzzleSDK(userFlags); | ||
await this.sdk.init(this.log); | ||
let query = {}; | ||
@@ -29,20 +21,15 @@ if (userFlags.filter) { | ||
} | ||
try { | ||
const result = await sdk.security.searchApiKeys(args.user, query, { | ||
from: 0, | ||
size: 100 | ||
}); | ||
this.log(`${result.total} API Keys found for user ${args.user}`); | ||
if (result.total !== 0) { | ||
this.log(''); | ||
for (const { _id, _source } of result.hits) { | ||
this.log(` - Key "${_id}"`); | ||
this.log(` Description: ${_source.description}`); | ||
this.log(` Expires at: ${_source.expiresAt}`); | ||
} | ||
const result = await this.sdk.security.searchApiKeys(args.user, query, { | ||
from: 0, | ||
size: 100 | ||
}); | ||
this.log(`${result.total} API Keys found for user ${args.user}`); | ||
if (result.total !== 0) { | ||
this.log(''); | ||
for (const { _id, _source } of result.hits) { | ||
this.log(` - Key "${_id}"`); | ||
this.log(` Description: ${_source.description}`); | ||
this.log(` Expires at: ${_source.expiresAt}`); | ||
} | ||
} | ||
catch (error) { | ||
this.logError(error.message); | ||
} | ||
} | ||
@@ -49,0 +36,0 @@ } |
@@ -22,4 +22,3 @@ import { flags } from '@oclif/command'; | ||
}[]; | ||
run(): Promise<void>; | ||
runSafe(): Promise<void>; | ||
} |
@@ -7,29 +7,19 @@ "use strict"; | ||
class DocumentCreate extends common_1.Kommand { | ||
async run() { | ||
try { | ||
await this.runSafe(); | ||
} | ||
catch (error) { | ||
this.logError(error); | ||
} | ||
} | ||
async runSafe() { | ||
this.printCommand(); | ||
const { args, flags: userFlags } = this.parse(DocumentCreate); | ||
const sdk = new kuzzle_1.KuzzleSDK(userFlags); | ||
await sdk.init(this.log); | ||
const body = await this.fromStdin(userFlags.body); | ||
try { | ||
let document; | ||
if (userFlags.replace) { | ||
document = await sdk.document.replace(args.index, args.collection, userFlags.id, body, { refresh: 'wait_for' }); | ||
} | ||
else { | ||
document = await sdk.document.create(args.index, args.collection, body, userFlags.id, { refresh: 'wait_for' }); | ||
} | ||
this.log(JSON.stringify(document, null, 2)); | ||
this.sdk = new kuzzle_1.KuzzleSDK(userFlags); | ||
await this.sdk.init(this.log); | ||
const stdin = await this.fromStdin(); | ||
const body = stdin | ||
? stdin | ||
: userFlags.body; | ||
let document; | ||
if (userFlags.replace) { | ||
document = await this.sdk.document.replace(args.index, args.collection, userFlags.id, this.parseJs(body), { refresh: 'wait_for' }); | ||
} | ||
catch (error) { | ||
this.logError(error.message); | ||
else { | ||
document = await this.sdk.document.create(args.index, args.collection, this.parseJs(body), userFlags.id, { refresh: 'wait_for' }); | ||
} | ||
this.log(JSON.stringify(document, null, 2)); | ||
} | ||
@@ -36,0 +26,0 @@ } |
@@ -18,4 +18,3 @@ import { flags } from '@oclif/command'; | ||
}[]; | ||
run(): Promise<void>; | ||
runSafe(): Promise<void>; | ||
} |
@@ -7,22 +7,9 @@ "use strict"; | ||
class DocumentGet extends common_1.Kommand { | ||
async run() { | ||
try { | ||
await this.runSafe(); | ||
} | ||
catch (error) { | ||
this.logError(error); | ||
} | ||
} | ||
async runSafe() { | ||
this.printCommand(); | ||
const { args, flags: userFlags } = this.parse(DocumentGet); | ||
const sdk = new kuzzle_1.KuzzleSDK(userFlags); | ||
await sdk.init(this.log); | ||
try { | ||
const document = await sdk.document.get(args.index, args.collection, args.id); | ||
this.log(JSON.stringify(document, null, 2)); | ||
} | ||
catch (error) { | ||
this.log(error.message); | ||
} | ||
this.sdk = new kuzzle_1.KuzzleSDK(userFlags); | ||
await this.sdk.init(this.log); | ||
const document = await this.sdk.document.get(args.index, args.collection, args.id); | ||
this.log(JSON.stringify(document, null, 2)); | ||
} | ||
@@ -29,0 +16,0 @@ } |
@@ -15,4 +15,3 @@ import { flags } from '@oclif/command'; | ||
}[]; | ||
run(): Promise<void>; | ||
runSafe(): Promise<void>; | ||
} |
@@ -7,10 +7,2 @@ "use strict"; | ||
class EsGet extends common_1.Kommand { | ||
async run() { | ||
try { | ||
await this.runSafe(); | ||
} | ||
catch (error) { | ||
this.logError(error); | ||
} | ||
} | ||
async runSafe() { | ||
@@ -30,4 +22,4 @@ this.printCommand(); | ||
catch (error) { | ||
this.log(JSON.stringify(error, null, 2)); | ||
this.log(error.message); | ||
this.logError(JSON.stringify(error, null, 2)); | ||
throw error; | ||
} | ||
@@ -34,0 +26,0 @@ } |
@@ -17,4 +17,3 @@ import { flags } from '@oclif/command'; | ||
}[]; | ||
run(): Promise<void>; | ||
runSafe(): Promise<void>; | ||
} |
@@ -7,10 +7,2 @@ "use strict"; | ||
class EsInsert extends common_1.Kommand { | ||
async run() { | ||
try { | ||
await this.runSafe(); | ||
} | ||
catch (error) { | ||
this.logError(error); | ||
} | ||
} | ||
async runSafe() { | ||
@@ -31,4 +23,4 @@ this.printCommand(); | ||
catch (error) { | ||
this.log(JSON.stringify(error, null, 2)); | ||
this.log(error.message); | ||
this.logError(JSON.stringify(error, null, 2)); | ||
throw error; | ||
} | ||
@@ -35,0 +27,0 @@ } |
@@ -11,4 +11,3 @@ import { flags } from '@oclif/command'; | ||
}; | ||
run(): Promise<void>; | ||
runSafe(): Promise<void>; | ||
} |
@@ -7,10 +7,2 @@ "use strict"; | ||
class EsListIndex extends common_1.Kommand { | ||
async run() { | ||
try { | ||
await this.runSafe(); | ||
} | ||
catch (error) { | ||
this.logError(error); | ||
} | ||
} | ||
async runSafe() { | ||
@@ -31,4 +23,4 @@ this.printCommand(); | ||
catch (error) { | ||
this.log(JSON.stringify(error, null, 2)); | ||
this.log(error.message); | ||
this.logError(JSON.stringify(error, null, 2)); | ||
throw error; | ||
} | ||
@@ -35,0 +27,0 @@ } |
@@ -9,3 +9,2 @@ import { Kommand } from '../../common'; | ||
}; | ||
run(): Promise<void>; | ||
runSafe(): Promise<void>; | ||
@@ -12,0 +11,0 @@ private showInstanceLogs; |
@@ -9,10 +9,2 @@ "use strict"; | ||
class InstanceLogs extends common_1.Kommand { | ||
async run() { | ||
try { | ||
await this.runSafe(); | ||
} | ||
catch (error) { | ||
this.warn(error); | ||
} | ||
} | ||
async runSafe() { | ||
@@ -33,8 +25,3 @@ this.printCommand(); | ||
} | ||
try { | ||
await this.showInstanceLogs(instance, followOption); | ||
} | ||
catch (_a) { | ||
this.warn('Something went wrong while showing your kuzzle instance logs'); | ||
} | ||
await this.showInstanceLogs(instance, followOption); | ||
} | ||
@@ -41,0 +28,0 @@ async showInstanceLogs(instanceName, followOption) { |
@@ -10,6 +10,2 @@ import { flags } from '@oclif/command'; | ||
}; | ||
/** | ||
* @override | ||
*/ | ||
run(): Promise<void>; | ||
runSafe(): Promise<void>; | ||
@@ -16,0 +12,0 @@ checkPrerequisites(): Promise<boolean>; |
@@ -87,13 +87,2 @@ "use strict"; | ||
class InstanceSpawn extends common_1.Kommand { | ||
/** | ||
* @override | ||
*/ | ||
async run() { | ||
try { | ||
await this.runSafe(); | ||
} | ||
catch (error) { | ||
this.logError(error); | ||
} | ||
} | ||
async runSafe() { | ||
@@ -100,0 +89,0 @@ this.printCommand(); |
@@ -15,2 +15,3 @@ import { flags } from '@oclif/command'; | ||
body: flags.IOptionFlag<string>; | ||
editor: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>; | ||
}; | ||
@@ -22,5 +23,4 @@ static args: { | ||
}[]; | ||
run(): Promise<void>; | ||
runSafe(): Promise<void>; | ||
} | ||
export default Query; |
@@ -9,15 +9,7 @@ "use strict"; | ||
class Query extends common_1.Kommand { | ||
async run() { | ||
try { | ||
await this.runSafe(); | ||
} | ||
catch (error) { | ||
this.logError(error); | ||
} | ||
} | ||
async runSafe() { | ||
this.printCommand(); | ||
const { args, flags: userFlags } = this.parse(Query); | ||
const sdk = new kuzzle_1.KuzzleSDK(userFlags); | ||
await sdk.init(this.log); | ||
this.sdk = new kuzzle_1.KuzzleSDK(userFlags); | ||
await this.sdk.init(this.log); | ||
const [controller, action] = args['controller:action'].split(':'); | ||
@@ -29,14 +21,19 @@ const requestArgs = {}; | ||
} | ||
// try to read stdin, otherwise use the "body" flag | ||
const body = await this.fromStdin(userFlags.body); | ||
const request = Object.assign(Object.assign({ controller, | ||
action }, requestArgs), { body }); | ||
try { | ||
const response = await sdk.query(request); | ||
this.log(chalk_1.default.green(`Successfully executed "${controller}:${action}"`)); | ||
this.log(JSON.stringify(response, null, 2)); | ||
// try to read stdin | ||
const stdin = await this.fromStdin(); | ||
if (stdin && userFlags.editor) { | ||
throw new Error('Unable to use flag --editor when reading from STDIN'); | ||
} | ||
catch (error) { | ||
this.logError(`${error.stack || error.message}\n\tstatus: ${error.status}\n\tid: ${error.id}`); | ||
const body = stdin | ||
? stdin | ||
: userFlags.body; | ||
let request = Object.assign(Object.assign({ controller, | ||
action }, requestArgs), { body: this.parseJs(body) }); | ||
// content from user editor | ||
if (userFlags.editor) { | ||
request = this.fromEditor(request, { json: true }); | ||
} | ||
const response = await this.sdk.query(request); | ||
this.log(chalk_1.default.green(`Successfully executed "${controller}:${action}"`)); | ||
this.log(JSON.stringify(response, null, 2)); | ||
} | ||
@@ -58,2 +55,4 @@ } | ||
default: '{}' | ||
}), editor: command_1.flags.boolean({ | ||
description: 'Open an editor (EDITOR env variable) to edit the request before sending' | ||
}) }, kuzzle_1.kuzzleFlags); | ||
@@ -60,0 +59,0 @@ Query.args = [ |
@@ -13,3 +13,3 @@ import { Kommand } from '../../common'; | ||
}[]; | ||
run(): Promise<void>; | ||
runSafe(): Promise<void>; | ||
} |
@@ -10,3 +10,3 @@ "use strict"; | ||
class VaultAdd extends common_1.Kommand { | ||
async run() { | ||
async runSafe() { | ||
this.printCommand(); | ||
@@ -13,0 +13,0 @@ const { args, flags: userFlags } = this.parse(VaultAdd); |
@@ -15,3 +15,3 @@ import { Kommand } from '../../common'; | ||
}[]; | ||
run(): Promise<void>; | ||
runSafe(): Promise<void>; | ||
} |
@@ -10,3 +10,3 @@ "use strict"; | ||
class VaultEncrypt extends common_1.Kommand { | ||
async run() { | ||
async runSafe() { | ||
this.printCommand(); | ||
@@ -13,0 +13,0 @@ const { args, flags: userFlags } = this.parse(VaultEncrypt); |
@@ -13,3 +13,3 @@ import { Kommand } from '../../common'; | ||
}[]; | ||
run(): Promise<void>; | ||
runSafe(): Promise<void>; | ||
} |
@@ -10,3 +10,3 @@ "use strict"; | ||
class VaultShow extends common_1.Kommand { | ||
async run() { | ||
async runSafe() { | ||
this.printCommand(); | ||
@@ -13,0 +13,0 @@ const { args, flags: userFlags } = this.parse(VaultShow); |
@@ -13,3 +13,3 @@ import { Kommand } from '../../common'; | ||
}[]; | ||
run(): Promise<void>; | ||
runSafe(): Promise<void>; | ||
} |
@@ -10,3 +10,3 @@ "use strict"; | ||
class VaultTest extends common_1.Kommand { | ||
async run() { | ||
async runSafe() { | ||
this.printCommand(); | ||
@@ -28,3 +28,4 @@ const { args, flags: userFlags } = this.parse(VaultTest); | ||
catch (error) { | ||
this.log(chalk_1.default.red('[X] Secrets file cannot be decrypted')); | ||
this.logError('Secrets file cannot be decrypted'); | ||
throw error; | ||
} | ||
@@ -31,0 +32,0 @@ } |
import { Command } from '@oclif/command'; | ||
import { KuzzleSDK } from './support/kuzzle'; | ||
import { EditorParams } from './support/editor'; | ||
export declare abstract class Kommand extends Command { | ||
protected sdk?: KuzzleSDK; | ||
printCommand(): void; | ||
log(message?: string | undefined, ...args: any[]): void; | ||
logError(message?: string | undefined, ...args: any[]): void; | ||
run(): Promise<void>; | ||
runSafe(): Promise<void>; | ||
/** | ||
* Reads a value from STDIN or return the default value. | ||
* This method can parse both JSON string and JS string | ||
* Reads a value from STDIN. | ||
* | ||
* @param {String} defaultValue - Default value if nothing is written on STDIN | ||
* | ||
* @returns {Promise<String>} Parsed input | ||
*/ | ||
fromStdin(defaultValue: string): Promise<unknown>; | ||
_parseInput(input: string): any; | ||
fromStdin(): Promise<string | undefined>; | ||
fromEditor(defaultContent: object | string, options?: EditorParams): object; | ||
parseJs(input?: string): any; | ||
} |
@@ -8,2 +8,3 @@ "use strict"; | ||
const fs_1 = tslib_1.__importDefault(require("fs")); | ||
const editor_1 = require("./support/editor"); | ||
class Kommand extends command_1.Command { | ||
@@ -20,28 +21,54 @@ printCommand() { | ||
logError(message, ...args) { | ||
return this.error(chalk_1.default.red(message), ...args); | ||
process.exitCode = 1; | ||
return this.error(chalk_1.default.red(`[X] ${message}`), ...args); | ||
} | ||
async run() { | ||
try { | ||
await this.runSafe(); | ||
} | ||
catch (error) { | ||
this.logError(`${error.stack || error.message}\n\tstatus: ${error.status}\n\tid: ${error.id}`); | ||
} | ||
finally { | ||
if (this.sdk) { | ||
this.sdk.disconnect(); | ||
} | ||
} | ||
} | ||
async runSafe() { | ||
throw new Error('You must implement runSafe() method'); | ||
} | ||
/** | ||
* Reads a value from STDIN or return the default value. | ||
* This method can parse both JSON string and JS string | ||
* Reads a value from STDIN. | ||
* | ||
* @param {String} defaultValue - Default value if nothing is written on STDIN | ||
* | ||
* @returns {Promise<String>} Parsed input | ||
*/ | ||
fromStdin(defaultValue) { | ||
fromStdin() { | ||
return new Promise(resolve => { | ||
// cucumber mess with stdin so I have to do this trick | ||
if (process.env.NODE_ENV === 'test' || process.stdin.isTTY) { | ||
resolve(this._parseInput(defaultValue)); | ||
resolve(); | ||
return; | ||
} | ||
const input = fs_1.default.readFileSync(0, 'utf8'); | ||
resolve(this._parseInput(input)); | ||
resolve(input); | ||
}); | ||
} | ||
_parseInput(input) { | ||
fromEditor(defaultContent, options) { | ||
let content = defaultContent; | ||
if (typeof content !== 'string') { | ||
content = JSON.stringify(content); | ||
} | ||
const editor = new editor_1.Editor(content, options); | ||
editor.run(); | ||
return this.parseJs(editor.content); | ||
} | ||
parseJs(input) { | ||
if (!input) { | ||
return {}; | ||
} | ||
// eslint-disable-next-line no-eval | ||
return eval(`var o = ${input}; o`); | ||
return (eval(`var o = ${input}; o`)); | ||
} | ||
} | ||
exports.Kommand = Kommand; |
@@ -1,2 +0,2 @@ | ||
export declare function dumpCollectionData(sdk: any, index: string, collection: string, batchSize: number, path: string): Promise<unknown>; | ||
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>; |
@@ -8,3 +8,3 @@ "use strict"; | ||
const ndjson = require('ndjson'); | ||
async function dumpCollectionData(sdk, index, collection, batchSize, path) { | ||
async function dumpCollectionData(sdk, index, collection, batchSize, path, query = {}) { | ||
const collectionDir = `${path}/${collection}`; | ||
@@ -16,3 +16,3 @@ const filename = `${collectionDir}/documents.jsonl`; | ||
const options = { | ||
scroll: '10m', | ||
scroll: '1m', | ||
size: batchSize | ||
@@ -33,3 +33,3 @@ }; | ||
}); | ||
let results = await sdk.document.search(index, collection, {}, options); | ||
let results = await sdk.document.search(index, collection, { query }, options); | ||
const progressBar = cli_ux_1.default.progress({ | ||
@@ -36,0 +36,0 @@ format: `Dumping ${collection} |{bar}| {percentage}% || {value}/{total} documents` |
@@ -16,5 +16,7 @@ import { flags } from '@oclif/command'; | ||
private password; | ||
private loginTTL; | ||
private protocol; | ||
private refreshTimer?; | ||
constructor(options: any); | ||
init(log: any): Promise<void>; | ||
disconnect(): void; | ||
query(request: any): any; | ||
@@ -21,0 +23,0 @@ get document(): any; |
@@ -7,3 +7,4 @@ "use strict"; | ||
// tslint:disable-next-line | ||
const { Http, Kuzzle } = require('kuzzle-sdk'); | ||
const { Http, WebSocket, Kuzzle } = require('kuzzle-sdk'); | ||
const SECOND = 60 * 1000; | ||
exports.kuzzleFlags = { | ||
@@ -40,10 +41,13 @@ host: command_1.flags.string({ | ||
this.password = options.password; | ||
this.loginTTL = options.loginTTL || '10s'; | ||
this.protocol = options.protocol || 'http'; | ||
} | ||
async init(log) { | ||
this.sdk = new Kuzzle(new Http(this.host, { | ||
const ProtocolClass = this.protocol === 'ws' | ||
? WebSocket | ||
: Http; | ||
this.sdk = new Kuzzle(new ProtocolClass(this.host, { | ||
port: this.port, | ||
sslConnection: this.ssl, | ||
})); | ||
log(`[ℹ] Connecting to http${this.ssl ? 's' : ''}://${this.host}:${this.port} ...`); | ||
log(`[ℹ] Connecting to ${this.protocol}${this.ssl ? 's' : ''}://${this.host}:${this.port} ...`); | ||
await this.sdk.connect(); | ||
@@ -55,6 +59,20 @@ if (this.username !== 'anonymous') { | ||
}; | ||
await this.sdk.auth.login('local', credentials, this.loginTTL); | ||
log(chalk_1.default.green(`[ℹ] Loggued as ${this.username} for ${this.loginTTL}.`)); | ||
await this.sdk.auth.login('local', credentials, '90s'); | ||
this.refreshTimer = setInterval(async () => { | ||
try { | ||
await this.sdk.auth.refreshToken(); | ||
} | ||
catch (error) { | ||
log(`Cannot refresh token: ${error}`); | ||
} | ||
}, 80 * SECOND); | ||
log(chalk_1.default.green(`[ℹ] Loggued as ${this.username}.`)); | ||
} | ||
} | ||
disconnect() { | ||
this.sdk.disconnect(); | ||
if (this.refreshTimer) { | ||
clearInterval(this.refreshTimer); | ||
} | ||
} | ||
query(request) { | ||
@@ -61,0 +79,0 @@ return this.sdk.query(request); |
@@ -1,1 +0,1 @@ | ||
{"version":"0.9.0","commands":{"query":{"id":"query","description":"Executes an API query","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou query document:get --arg index=iot --arg collection=sensors --arg _id=sigfox-42","kourou query collection:create --arg index=iot --arg collection=sensors --body '{dynamic: \"strict\"}'","kourou query admin:loadMappings < mappings.json","echo '{name: \"Aschen\"}' | kourou query document:create --arg index=iot --arg collection=sensors"],"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":"{}"},"host":{"name":"host","type":"option","char":"h","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","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"}},"args":[{"name":"controller:action","description":"Controller and action (eg: \"server:now\")","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","char":"h","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","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"}},"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":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"id":{"name":"id","type":"option","description":"API Key unique ID"},"host":{"name":"host","type":"option","char":"h","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","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"}},"args":[{"name":"user","description":"User kuid","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","char":"h","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","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"}},"args":[{"name":"user","description":"User kuid","required":true}]},"collection:dump":{"id":"collection:dump","description":"Dump an entire collection content (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 (default: index name)"},"batch-size":{"name":"batch-size","type":"option","description":"Maximum batch size (see limits.documentsFetchCount config)","default":"2000"},"host":{"name":"host","type":"option","char":"h","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","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"}},"args":[{"name":"index","description":"Index name","required":true},{"name":"collection","description":"Collection name","required":true}]},"collection:restore":{"id":"collection:restore","description":"Restore the content of a previously dumped 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","char":"h","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","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"}},"args":[{"name":"path","description":"Dump directory path","required":true}]},"document:create":{"id":"document:create","description":"Creates a document","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou document:create iot sensors --body '{network: \"sigfox\"}'","kourou document:create iot sensors < document.json"],"flags":{"body":{"name":"body","type":"option","description":"Document body in JS or JSON format. Will be read from STDIN if available","default":"{}"},"id":{"name":"id","type":"option","description":"Optional document ID"},"replace":{"name":"replace","type":"boolean","description":"Replaces the document if it already exists","allowNo":false},"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","char":"h","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","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"}},"args":[{"name":"index","description":"Index name","required":true},{"name":"collection","description":"Collection name","required":true}]},"document:get":{"id":"document:get","description":"Gets a document","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":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","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"}},"args":[{"name":"index","description":"Index name","required":true},{"name":"collection","description":"Collection name","required":true},{"name":"id","description":"Document ID","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":[]},"index:dump":{"id":"index:dump","description":"Dump an entire index content (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 directory (default: index name)"},"batch-size":{"name":"batch-size","type":"option","description":"Maximum batch size (see limits.documentsFetchCount config)","default":"2000"},"host":{"name":"host","type":"option","char":"h","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","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"}},"args":[{"name":"index","description":"Index name","required":true}]},"index:restore":{"id":"index:restore","description":"Restore the content of a previously dumped index","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"},"no-mappings":{"name":"no-mappings","type":"boolean","description":"Skip collections mappings","allowNo":false},"host":{"name":"host","type":"option","char":"h","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","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"}},"args":[{"name":"path","description":"Dump directory or file","required":true}]},"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:dump":{"id":"profile:dump","description":"Dumps Kuzzle 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"},"batch-size":{"name":"batch-size","type":"option","description":"Maximum batch size (see limits.documentsFetchCount config)","default":"2000"},"host":{"name":"host","type":"option","char":"h","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","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"}},"args":[]},"profile:restore":{"id":"profile:restore","description":"Restores previously dumped Kuzzle profiles","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"},"host":{"name":"host","type":"option","char":"h","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","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"}},"args":[{"name":"path","description":"Dump file","required":true}]},"role:dump":{"id":"role:dump","description":"Dumps Kuzzle 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"},"batch-size":{"name":"batch-size","type":"option","description":"Maximum batch size (see limits.documentsFetchCount config)","default":"2000"},"host":{"name":"host","type":"option","char":"h","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","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"}},"args":[]},"role:restore":{"id":"role:restore","description":"Restores previously dumped Kuzzle roles","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"},"host":{"name":"host","type":"option","char":"h","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","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"}},"args":[{"name":"path","description":"Dump file","required":true}]},"vault:add":{"id":"vault:add","description":"Adds an encrypted key to a secrets file","pluginName":"kourou","pluginType":"core","aliases":[],"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:encrypt":{"id":"vault:encrypt","description":"Encrypts an entire file.","pluginName":"kourou","pluginType":"core","aliases":[],"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":"Prints an encrypted key.","pluginName":"kourou","pluginType":"core","aliases":[],"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}]},"vault:test":{"id":"vault:test","description":"Tests if an encrypted secrets file can be decrypted.","pluginName":"kourou","pluginType":"core","aliases":[],"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.10.0","commands":{"query":{"id":"query","description":"Executes an API query","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou query document:get --arg index=iot --arg collection=sensors --arg _id=sigfox-42","kourou query collection:create --arg index=iot --arg collection=sensors --body '{dynamic: \"strict\"}'","kourou query admin:loadMappings < mappings.json","echo '{name: \"Aschen\"}' | kourou query document:create --arg index=iot --arg collection=sensors"],"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},"host":{"name":"host","type":"option","char":"h","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","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"}},"args":[{"name":"controller:action","description":"Controller and action (eg: \"server:now\")","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","char":"h","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","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"}},"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","char":"h","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","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"}},"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","char":"h","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","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"}},"args":[{"name":"user","description":"User kuid","required":true}]},"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 (default: index name)"},"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","char":"h","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","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"}},"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","char":"h","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","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"}},"args":[{"name":"path","description":"Dump directory path","required":true}]},"document:create":{"id":"document:create","description":"Creates a document","pluginName":"kourou","pluginType":"core","aliases":[],"examples":["kourou document:create iot sensors --body '{network: \"sigfox\"}'","kourou document:create iot sensors < document.json"],"flags":{"body":{"name":"body","type":"option","description":"Document body in JS or JSON format. Will be read from STDIN if available","default":"{}"},"id":{"name":"id","type":"option","description":"Optional document ID"},"replace":{"name":"replace","type":"boolean","description":"Replaces the document if it already exists","allowNo":false},"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"host":{"name":"host","type":"option","char":"h","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","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"}},"args":[{"name":"index","description":"Index name","required":true},{"name":"collection","description":"Collection name","required":true}]},"document:get":{"id":"document:get","description":"Gets a document","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":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","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"}},"args":[{"name":"index","description":"Index name","required":true},{"name":"collection","description":"Collection name","required":true},{"name":"id","description":"Document ID","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","char":"h","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","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"}},"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":[]},"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 directory (default: index name)"},"batch-size":{"name":"batch-size","type":"option","description":"Maximum batch size (see limits.documentsFetchCount config)","default":"2000"},"host":{"name":"host","type":"option","char":"h","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","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"}},"args":[{"name":"index","description":"Index name","required":true}]},"index:import":{"id":"index:import","description":"Imports an index","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"},"no-mappings":{"name":"no-mappings","type":"boolean","description":"Skip collections mappings","allowNo":false},"host":{"name":"host","type":"option","char":"h","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","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"}},"args":[{"name":"path","description":"Dump directory or file","required":true}]},"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","char":"h","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","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"}},"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","char":"h","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","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"}},"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","char":"h","description":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","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"}},"args":[]},"role:import":{"id":"role:import","description":"Import roles","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":"Kuzzle server host","default":"localhost"},"port":{"name":"port","type":"option","char":"p","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"}},"args":[{"name":"path","description":"Dump file","required":true}]},"vault:add":{"id":"vault:add","description":"Adds an encrypted key to a secrets file","pluginName":"kourou","pluginType":"core","aliases":[],"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:encrypt":{"id":"vault:encrypt","description":"Encrypts an entire file.","pluginName":"kourou","pluginType":"core","aliases":[],"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":"Prints an encrypted key.","pluginName":"kourou","pluginType":"core","aliases":[],"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}]},"vault:test":{"id":"vault:test","description":"Tests if an encrypted secrets file can be decrypted.","pluginName":"kourou","pluginType":"core","aliases":[],"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.9.0", | ||
"version": "0.10.0", | ||
"author": "The Kuzzle Team <support@kuzzle.io>", | ||
@@ -25,2 +25,3 @@ "bin": { | ||
"node-emoji": "^1.10.0", | ||
"tmp": "^0.1.0", | ||
"tslib": "^1.10.0" | ||
@@ -27,0 +28,0 @@ }, |
220
README.md
@@ -27,3 +27,3 @@ # kourou | ||
$ kourou (-v|--version|version) | ||
kourou/0.9.0 linux-x64 node-v12.16.1 | ||
kourou/0.10.0 linux-x64 node-v12.16.1 | ||
$ kourou --help [COMMAND] | ||
@@ -62,8 +62,9 @@ USAGE | ||
* [`kourou api-key:create USER`](#kourou-api-keycreate-user) | ||
* [`kourou api-key:delete USER`](#kourou-api-keydelete-user) | ||
* [`kourou api-key:delete USER ID`](#kourou-api-keydelete-user-id) | ||
* [`kourou api-key:search USER`](#kourou-api-keysearch-user) | ||
* [`kourou collection:dump INDEX COLLECTION`](#kourou-collectiondump-index-collection) | ||
* [`kourou collection:restore PATH`](#kourou-collectionrestore-path) | ||
* [`kourou collection:export INDEX COLLECTION`](#kourou-collectionexport-index-collection) | ||
* [`kourou collection:import PATH`](#kourou-collectionimport-path) | ||
* [`kourou document:create INDEX COLLECTION`](#kourou-documentcreate-index-collection) | ||
* [`kourou document:get INDEX COLLECTION ID`](#kourou-documentget-index-collection-id) | ||
* [`kourou document:search INDEX COLLECTION`](#kourou-documentsearch-index-collection) | ||
* [`kourou es:get INDEX ID`](#kourou-esget-index-id) | ||
@@ -73,11 +74,11 @@ * [`kourou es:insert INDEX`](#kourou-esinsert-index) | ||
* [`kourou help [COMMAND]`](#kourou-help-command) | ||
* [`kourou index:dump INDEX`](#kourou-indexdump-index) | ||
* [`kourou index:restore PATH`](#kourou-indexrestore-path) | ||
* [`kourou index:export INDEX`](#kourou-indexexport-index) | ||
* [`kourou index:import PATH`](#kourou-indeximport-path) | ||
* [`kourou instance:logs`](#kourou-instancelogs) | ||
* [`kourou instance:spawn`](#kourou-instancespawn) | ||
* [`kourou profile:dump`](#kourou-profiledump) | ||
* [`kourou profile:restore PATH`](#kourou-profilerestore-path) | ||
* [`kourou profile:export`](#kourou-profileexport) | ||
* [`kourou profile:import PATH`](#kourou-profileimport-path) | ||
* [`kourou query CONTROLLER:ACTION`](#kourou-query-controlleraction) | ||
* [`kourou role:dump`](#kourou-roledump) | ||
* [`kourou role:restore PATH`](#kourou-rolerestore-path) | ||
* [`kourou role:export`](#kourou-roleexport) | ||
* [`kourou role:import PATH`](#kourou-roleimport-path) | ||
* [`kourou vault:add SECRETS-FILE KEY VALUE`](#kourou-vaultadd-secrets-file-key-value) | ||
@@ -111,5 +112,5 @@ * [`kourou vault:encrypt FILE`](#kourou-vaultencrypt-file) | ||
_See code: [src/commands/api-key/create.ts](https://github.com/kuzzleio/kourou/blob/v0.9.0/src/commands/api-key/create.ts)_ | ||
_See code: [src/commands/api-key/create.ts](https://github.com/kuzzleio/kourou/blob/v0.10.0/src/commands/api-key/create.ts)_ | ||
## `kourou api-key:delete USER` | ||
## `kourou api-key:delete USER ID` | ||
@@ -120,6 +121,7 @@ Deletes an API key. | ||
USAGE | ||
$ kourou api-key:delete USER | ||
$ kourou api-key:delete USER ID | ||
ARGUMENTS | ||
USER User kuid | ||
ID API Key unique ID | ||
@@ -130,9 +132,11 @@ OPTIONS | ||
--help show CLI help | ||
--id=id API Key unique ID | ||
--password=password Kuzzle user password | ||
--ssl Use SSL to connect to Kuzzle | ||
--username=username [default: anonymous] Kuzzle username (local strategy) | ||
EXAMPLE | ||
kourou vault:delete sigfox-gateway 1k-BF3EBjsXdvA2PR8x | ||
``` | ||
_See code: [src/commands/api-key/delete.ts](https://github.com/kuzzleio/kourou/blob/v0.9.0/src/commands/api-key/delete.ts)_ | ||
_See code: [src/commands/api-key/delete.ts](https://github.com/kuzzleio/kourou/blob/v0.10.0/src/commands/api-key/delete.ts)_ | ||
@@ -160,11 +164,11 @@ ## `kourou api-key:search USER` | ||
_See code: [src/commands/api-key/search.ts](https://github.com/kuzzleio/kourou/blob/v0.9.0/src/commands/api-key/search.ts)_ | ||
_See code: [src/commands/api-key/search.ts](https://github.com/kuzzleio/kourou/blob/v0.10.0/src/commands/api-key/search.ts)_ | ||
## `kourou collection:dump INDEX COLLECTION` | ||
## `kourou collection:export INDEX COLLECTION` | ||
Dump an entire collection content (JSONL format) | ||
Exports a collection (JSONL format) | ||
``` | ||
USAGE | ||
$ kourou collection:dump INDEX COLLECTION | ||
$ kourou collection:export INDEX COLLECTION | ||
@@ -179,18 +183,24 @@ ARGUMENTS | ||
--batch-size=batch-size [default: 2000] Maximum batch size (see limits.documentsFetchCount config) | ||
--editor Open an editor (EDITOR env variable) to edit the query before sending | ||
--help show CLI help | ||
--password=password Kuzzle user password | ||
--path=path Dump root directory (default: index name) | ||
--query=query [default: {}] Only dump documents matching the query (JS or JSON format) | ||
--ssl Use SSL to connect to Kuzzle | ||
--username=username [default: anonymous] Kuzzle username (local strategy) | ||
EXAMPLES | ||
kourou collection:export nyc-open-data yellow-taxi | ||
kourou collection:export nyc-open-data yellow-taxi --query '{ term: { city: "Saigon" } }' | ||
``` | ||
_See code: [src/commands/collection/dump.ts](https://github.com/kuzzleio/kourou/blob/v0.9.0/src/commands/collection/dump.ts)_ | ||
_See code: [src/commands/collection/export.ts](https://github.com/kuzzleio/kourou/blob/v0.10.0/src/commands/collection/export.ts)_ | ||
## `kourou collection:restore PATH` | ||
## `kourou collection:import PATH` | ||
Restore the content of a previously dumped collection | ||
Imports a collection | ||
``` | ||
USAGE | ||
$ kourou collection:restore PATH | ||
$ kourou collection:import PATH | ||
@@ -213,3 +223,3 @@ ARGUMENTS | ||
_See code: [src/commands/collection/restore.ts](https://github.com/kuzzleio/kourou/blob/v0.9.0/src/commands/collection/restore.ts)_ | ||
_See code: [src/commands/collection/import.ts](https://github.com/kuzzleio/kourou/blob/v0.10.0/src/commands/collection/import.ts)_ | ||
@@ -244,3 +254,3 @@ ## `kourou document:create INDEX COLLECTION` | ||
_See code: [src/commands/document/create.ts](https://github.com/kuzzleio/kourou/blob/v0.9.0/src/commands/document/create.ts)_ | ||
_See code: [src/commands/document/create.ts](https://github.com/kuzzleio/kourou/blob/v0.10.0/src/commands/document/create.ts)_ | ||
@@ -269,4 +279,37 @@ ## `kourou document:get INDEX COLLECTION ID` | ||
_See code: [src/commands/document/get.ts](https://github.com/kuzzleio/kourou/blob/v0.9.0/src/commands/document/get.ts)_ | ||
_See code: [src/commands/document/get.ts](https://github.com/kuzzleio/kourou/blob/v0.10.0/src/commands/document/get.ts)_ | ||
## `kourou document:search INDEX COLLECTION` | ||
Searches for documents | ||
``` | ||
USAGE | ||
$ kourou document:search INDEX COLLECTION | ||
ARGUMENTS | ||
INDEX Index name | ||
COLLECTION Collection name | ||
OPTIONS | ||
-h, --host=host [default: localhost] Kuzzle server host | ||
-p, --port=port [default: 7512] Kuzzle server port | ||
--editor Open an editor (EDITOR env variable) to edit the request before sending | ||
--from=from Optional offset | ||
--help show CLI help | ||
--password=password Kuzzle user password | ||
--query=query [default: {}] Query in JS or JSON format. | ||
--scroll=scroll Optional scroll TTL | ||
--size=size Optional page size | ||
--sort=sort [default: {}] Sort in JS or JSON format. | ||
--ssl Use SSL to connect to Kuzzle | ||
--username=username [default: anonymous] Kuzzle username (local strategy) | ||
EXAMPLES | ||
kourou document:search iot sensors --query '{ term: { name: "corona" } }' | ||
kourou document:search iot sensors --editor | ||
``` | ||
_See code: [src/commands/document/search.ts](https://github.com/kuzzleio/kourou/blob/v0.10.0/src/commands/document/search.ts)_ | ||
## `kourou es:get INDEX ID` | ||
@@ -290,3 +333,3 @@ | ||
_See code: [src/commands/es/get.ts](https://github.com/kuzzleio/kourou/blob/v0.9.0/src/commands/es/get.ts)_ | ||
_See code: [src/commands/es/get.ts](https://github.com/kuzzleio/kourou/blob/v0.10.0/src/commands/es/get.ts)_ | ||
@@ -312,3 +355,3 @@ ## `kourou es:insert INDEX` | ||
_See code: [src/commands/es/insert.ts](https://github.com/kuzzleio/kourou/blob/v0.9.0/src/commands/es/insert.ts)_ | ||
_See code: [src/commands/es/insert.ts](https://github.com/kuzzleio/kourou/blob/v0.10.0/src/commands/es/insert.ts)_ | ||
@@ -330,3 +373,3 @@ ## `kourou es:list-index` | ||
_See code: [src/commands/es/list-index.ts](https://github.com/kuzzleio/kourou/blob/v0.9.0/src/commands/es/list-index.ts)_ | ||
_See code: [src/commands/es/list-index.ts](https://github.com/kuzzleio/kourou/blob/v0.10.0/src/commands/es/list-index.ts)_ | ||
@@ -350,9 +393,9 @@ ## `kourou help [COMMAND]` | ||
## `kourou index:dump INDEX` | ||
## `kourou index:export INDEX` | ||
Dump an entire index content (JSONL format) | ||
Exports an index (JSONL format) | ||
``` | ||
USAGE | ||
$ kourou index:dump INDEX | ||
$ kourou index:export INDEX | ||
@@ -373,11 +416,11 @@ ARGUMENTS | ||
_See code: [src/commands/index/dump.ts](https://github.com/kuzzleio/kourou/blob/v0.9.0/src/commands/index/dump.ts)_ | ||
_See code: [src/commands/index/export.ts](https://github.com/kuzzleio/kourou/blob/v0.10.0/src/commands/index/export.ts)_ | ||
## `kourou index:restore PATH` | ||
## `kourou index:import PATH` | ||
Restore the content of a previously dumped index | ||
Imports an index | ||
``` | ||
USAGE | ||
$ kourou index:restore PATH | ||
$ kourou index:import PATH | ||
@@ -399,3 +442,3 @@ ARGUMENTS | ||
_See code: [src/commands/index/restore.ts](https://github.com/kuzzleio/kourou/blob/v0.9.0/src/commands/index/restore.ts)_ | ||
_See code: [src/commands/index/import.ts](https://github.com/kuzzleio/kourou/blob/v0.10.0/src/commands/index/import.ts)_ | ||
@@ -415,3 +458,3 @@ ## `kourou instance:logs` | ||
_See code: [src/commands/instance/logs.ts](https://github.com/kuzzleio/kourou/blob/v0.9.0/src/commands/instance/logs.ts)_ | ||
_See code: [src/commands/instance/logs.ts](https://github.com/kuzzleio/kourou/blob/v0.10.0/src/commands/instance/logs.ts)_ | ||
@@ -432,32 +475,31 @@ ## `kourou instance:spawn` | ||
_See code: [src/commands/instance/spawn.ts](https://github.com/kuzzleio/kourou/blob/v0.9.0/src/commands/instance/spawn.ts)_ | ||
_See code: [src/commands/instance/spawn.ts](https://github.com/kuzzleio/kourou/blob/v0.10.0/src/commands/instance/spawn.ts)_ | ||
## `kourou profile:dump` | ||
## `kourou profile:export` | ||
Dumps Kuzzle profiles | ||
Exports profiles | ||
``` | ||
USAGE | ||
$ kourou profile:dump | ||
$ kourou profile:export | ||
OPTIONS | ||
-h, --host=host [default: localhost] Kuzzle server host | ||
-p, --port=port [default: 7512] Kuzzle server port | ||
--batch-size=batch-size [default: 2000] Maximum batch size (see limits.documentsFetchCount config) | ||
--help show CLI help | ||
--password=password Kuzzle user password | ||
--path=path [default: profiles] Dump directory | ||
--ssl Use SSL to connect to Kuzzle | ||
--username=username [default: anonymous] Kuzzle username (local strategy) | ||
-h, --host=host [default: localhost] Kuzzle server host | ||
-p, --port=port [default: 7512] Kuzzle server port | ||
--help show CLI help | ||
--password=password Kuzzle user password | ||
--path=path [default: profiles] Dump directory | ||
--ssl Use SSL to connect to Kuzzle | ||
--username=username [default: anonymous] Kuzzle username (local strategy) | ||
``` | ||
_See code: [src/commands/profile/dump.ts](https://github.com/kuzzleio/kourou/blob/v0.9.0/src/commands/profile/dump.ts)_ | ||
_See code: [src/commands/profile/export.ts](https://github.com/kuzzleio/kourou/blob/v0.10.0/src/commands/profile/export.ts)_ | ||
## `kourou profile:restore PATH` | ||
## `kourou profile:import PATH` | ||
Restores previously dumped Kuzzle profiles | ||
Imports profiles | ||
``` | ||
USAGE | ||
$ kourou profile:restore PATH | ||
$ kourou profile:import PATH | ||
@@ -468,12 +510,11 @@ ARGUMENTS | ||
OPTIONS | ||
-h, --host=host [default: localhost] Kuzzle server host | ||
-p, --port=port [default: 7512] Kuzzle server port | ||
--batch-size=batch-size [default: 200] Maximum batch size (see limits.documentsWriteCount config) | ||
--help show CLI help | ||
--password=password Kuzzle user password | ||
--ssl Use SSL to connect to Kuzzle | ||
--username=username [default: anonymous] Kuzzle username (local strategy) | ||
-h, --host=host [default: localhost] Kuzzle server host | ||
-p, --port=port [default: 7512] Kuzzle server port | ||
--help show CLI help | ||
--password=password Kuzzle user password | ||
--ssl Use SSL to connect to Kuzzle | ||
--username=username [default: anonymous] Kuzzle username (local strategy) | ||
``` | ||
_See code: [src/commands/profile/restore.ts](https://github.com/kuzzleio/kourou/blob/v0.9.0/src/commands/profile/restore.ts)_ | ||
_See code: [src/commands/profile/import.ts](https://github.com/kuzzleio/kourou/blob/v0.10.0/src/commands/profile/import.ts)_ | ||
@@ -496,2 +537,3 @@ ## `kourou query CONTROLLER:ACTION` | ||
--body=body [default: {}] Request body in JS or JSON format. Will be read from STDIN if available. | ||
--editor Open an editor (EDITOR env variable) to edit the request before sending | ||
--help show CLI help | ||
@@ -509,32 +551,31 @@ --password=password Kuzzle user password | ||
_See code: [src/commands/query.ts](https://github.com/kuzzleio/kourou/blob/v0.9.0/src/commands/query.ts)_ | ||
_See code: [src/commands/query.ts](https://github.com/kuzzleio/kourou/blob/v0.10.0/src/commands/query.ts)_ | ||
## `kourou role:dump` | ||
## `kourou role:export` | ||
Dumps Kuzzle roles | ||
Exports roles | ||
``` | ||
USAGE | ||
$ kourou role:dump | ||
$ kourou role:export | ||
OPTIONS | ||
-h, --host=host [default: localhost] Kuzzle server host | ||
-p, --port=port [default: 7512] Kuzzle server port | ||
--batch-size=batch-size [default: 2000] Maximum batch size (see limits.documentsFetchCount config) | ||
--help show CLI help | ||
--password=password Kuzzle user password | ||
--path=path [default: roles] Dump directory | ||
--ssl Use SSL to connect to Kuzzle | ||
--username=username [default: anonymous] Kuzzle username (local strategy) | ||
-h, --host=host [default: localhost] Kuzzle server host | ||
-p, --port=port [default: 7512] Kuzzle server port | ||
--help show CLI help | ||
--password=password Kuzzle user password | ||
--path=path [default: roles] Dump directory | ||
--ssl Use SSL to connect to Kuzzle | ||
--username=username [default: anonymous] Kuzzle username (local strategy) | ||
``` | ||
_See code: [src/commands/role/dump.ts](https://github.com/kuzzleio/kourou/blob/v0.9.0/src/commands/role/dump.ts)_ | ||
_See code: [src/commands/role/export.ts](https://github.com/kuzzleio/kourou/blob/v0.10.0/src/commands/role/export.ts)_ | ||
## `kourou role:restore PATH` | ||
## `kourou role:import PATH` | ||
Restores previously dumped Kuzzle roles | ||
Import roles | ||
``` | ||
USAGE | ||
$ kourou role:restore PATH | ||
$ kourou role:import PATH | ||
@@ -545,12 +586,11 @@ ARGUMENTS | ||
OPTIONS | ||
-h, --host=host [default: localhost] Kuzzle server host | ||
-p, --port=port [default: 7512] Kuzzle server port | ||
--batch-size=batch-size [default: 200] Maximum batch size (see limits.documentsWriteCount config) | ||
--help show CLI help | ||
--password=password Kuzzle user password | ||
--ssl Use SSL to connect to Kuzzle | ||
--username=username [default: anonymous] Kuzzle username (local strategy) | ||
-h, --host=host [default: localhost] Kuzzle server host | ||
-p, --port=port [default: 7512] Kuzzle server port | ||
--help show CLI help | ||
--password=password Kuzzle user password | ||
--ssl Use SSL to connect to Kuzzle | ||
--username=username [default: anonymous] Kuzzle username (local strategy) | ||
``` | ||
_See code: [src/commands/role/restore.ts](https://github.com/kuzzleio/kourou/blob/v0.9.0/src/commands/role/restore.ts)_ | ||
_See code: [src/commands/role/import.ts](https://github.com/kuzzleio/kourou/blob/v0.10.0/src/commands/role/import.ts)_ | ||
@@ -574,3 +614,3 @@ ## `kourou vault:add SECRETS-FILE KEY VALUE` | ||
_See code: [src/commands/vault/add.ts](https://github.com/kuzzleio/kourou/blob/v0.9.0/src/commands/vault/add.ts)_ | ||
_See code: [src/commands/vault/add.ts](https://github.com/kuzzleio/kourou/blob/v0.10.0/src/commands/vault/add.ts)_ | ||
@@ -594,3 +634,3 @@ ## `kourou vault:encrypt FILE` | ||
_See code: [src/commands/vault/encrypt.ts](https://github.com/kuzzleio/kourou/blob/v0.9.0/src/commands/vault/encrypt.ts)_ | ||
_See code: [src/commands/vault/encrypt.ts](https://github.com/kuzzleio/kourou/blob/v0.10.0/src/commands/vault/encrypt.ts)_ | ||
@@ -613,3 +653,3 @@ ## `kourou vault:show SECRETS-FILE KEY` | ||
_See code: [src/commands/vault/show.ts](https://github.com/kuzzleio/kourou/blob/v0.9.0/src/commands/vault/show.ts)_ | ||
_See code: [src/commands/vault/show.ts](https://github.com/kuzzleio/kourou/blob/v0.10.0/src/commands/vault/show.ts)_ | ||
@@ -631,3 +671,3 @@ ## `kourou vault:test SECRETS-FILE` | ||
_See code: [src/commands/vault/test.ts](https://github.com/kuzzleio/kourou/blob/v0.9.0/src/commands/vault/test.ts)_ | ||
_See code: [src/commands/vault/test.ts](https://github.com/kuzzleio/kourou/blob/v0.10.0/src/commands/vault/test.ts)_ | ||
<!-- commandsstop --> | ||
@@ -634,0 +674,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
130360
65
2201
651
16
32
4
+ Addedtmp@^0.1.0
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedrimraf@2.7.1(transitive)
+ Addedtmp@0.1.0(transitive)