Comparing version 0.5.0 to 0.6.0
@@ -12,3 +12,2 @@ import { flags } from '@oclif/command'; | ||
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>; | ||
user: flags.IOptionFlag<string>; | ||
description: flags.IOptionFlag<string>; | ||
@@ -18,4 +17,9 @@ id: flags.IOptionFlag<string | undefined>; | ||
}; | ||
static args: { | ||
name: string; | ||
description: string; | ||
required: boolean; | ||
}[]; | ||
run(): Promise<void>; | ||
} | ||
export default ApiKeyCreate; |
@@ -5,9 +5,7 @@ "use strict"; | ||
const common_1 = require("../../common"); | ||
const kuzzle_1 = require("../../kuzzle"); | ||
const kuzzle_1 = require("../../support/kuzzle"); | ||
class ApiKeyCreate extends common_1.Kommand { | ||
async run() { | ||
this.log(''); | ||
this.log(`${common_1.printCliName()} - ${ApiKeyCreate.description}`); | ||
this.log(''); | ||
const { flags: userFlags } = this.parse(ApiKeyCreate); | ||
this.printCommand(); | ||
const { args, flags: userFlags } = this.parse(ApiKeyCreate); | ||
const sdk = new kuzzle_1.KuzzleSDK(userFlags); | ||
@@ -19,3 +17,3 @@ await sdk.init(); | ||
_id: userFlags.id, | ||
userId: userFlags.user, | ||
userId: args.user, | ||
expiresIn: userFlags.expire, | ||
@@ -29,3 +27,3 @@ refresh: 'wait_for', | ||
const { result } = await sdk.query(request); | ||
this.log(`Successfully created API Key "${result._id}" for user "${userFlags.user}"`); | ||
this.log(`Successfully created API Key "${result._id}" for user "${args.user}"`); | ||
this.log(result._source.token); | ||
@@ -39,7 +37,3 @@ } | ||
ApiKeyCreate.description = 'Creates a new API Key for an user'; | ||
ApiKeyCreate.flags = Object.assign({ help: command_1.flags.help(), user: command_1.flags.string({ | ||
char: 'u', | ||
description: 'User kuid', | ||
required: true, | ||
}), description: command_1.flags.string({ | ||
ApiKeyCreate.flags = Object.assign({ help: command_1.flags.help(), description: command_1.flags.string({ | ||
char: 'd', | ||
@@ -54,2 +48,5 @@ description: 'API Key description', | ||
}) }, kuzzle_1.kuzzleFlags); | ||
ApiKeyCreate.args = [ | ||
{ name: 'user', description: 'User kuid', required: true }, | ||
]; | ||
exports.default = ApiKeyCreate; |
@@ -12,7 +12,11 @@ import { flags } from '@oclif/command'; | ||
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>; | ||
user: flags.IOptionFlag<string>; | ||
id: flags.IOptionFlag<string | undefined>; | ||
}; | ||
static args: { | ||
name: string; | ||
description: string; | ||
required: boolean; | ||
}[]; | ||
run(): Promise<void>; | ||
} | ||
export default ApiKeyDelete; |
@@ -5,9 +5,7 @@ "use strict"; | ||
const common_1 = require("../../common"); | ||
const kuzzle_1 = require("../../kuzzle"); | ||
const kuzzle_1 = require("../../support/kuzzle"); | ||
class ApiKeyDelete extends common_1.Kommand { | ||
async run() { | ||
this.log(''); | ||
this.log(`${common_1.printCliName()} - ${ApiKeyDelete.description}`); | ||
this.log(''); | ||
const { flags: userFlags } = this.parse(ApiKeyDelete); | ||
this.printCommand(); | ||
const { flags: userFlags, args } = this.parse(ApiKeyDelete); | ||
const sdk = new kuzzle_1.KuzzleSDK(userFlags); | ||
@@ -20,7 +18,7 @@ await sdk.init(); | ||
_id: userFlags.id, | ||
userId: userFlags.user, | ||
userId: args.user, | ||
}; | ||
try { | ||
const { result } = await sdk.query(request); | ||
this.log(`Successfully deleted API Key "${result._id}" of user "${userFlags.user}"`); | ||
this.log(`Successfully deleted API Key "${result._id}" of user "${args.user}"`); | ||
} | ||
@@ -33,9 +31,8 @@ catch (error) { | ||
ApiKeyDelete.description = 'Deletes a new API Key for an user'; | ||
ApiKeyDelete.flags = Object.assign({ help: command_1.flags.help(), user: command_1.flags.string({ | ||
char: 'u', | ||
description: 'User kuid', | ||
required: true, | ||
}), id: command_1.flags.string({ | ||
ApiKeyDelete.flags = Object.assign({ help: command_1.flags.help(), id: command_1.flags.string({ | ||
description: 'API Key unique ID', | ||
}) }, kuzzle_1.kuzzleFlags); | ||
ApiKeyDelete.args = [ | ||
{ name: 'user', description: 'User kuid', required: true }, | ||
]; | ||
exports.default = ApiKeyDelete; |
@@ -12,7 +12,11 @@ import { flags } from '@oclif/command'; | ||
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>; | ||
user: flags.IOptionFlag<string>; | ||
filter: flags.IOptionFlag<string | undefined>; | ||
}; | ||
static args: { | ||
name: string; | ||
description: string; | ||
required: boolean; | ||
}[]; | ||
run(): Promise<void>; | ||
} | ||
export default ApiKeySearch; |
@@ -5,9 +5,7 @@ "use strict"; | ||
const common_1 = require("../../common"); | ||
const kuzzle_1 = require("../../kuzzle"); | ||
const kuzzle_1 = require("../../support/kuzzle"); | ||
class ApiKeySearch extends common_1.Kommand { | ||
async run() { | ||
this.log(''); | ||
this.log(`${common_1.printCliName()} - ${ApiKeySearch.description}`); | ||
this.log(''); | ||
const { flags: userFlags } = this.parse(ApiKeySearch); | ||
this.printCommand(); | ||
const { flags: userFlags, args } = this.parse(ApiKeySearch); | ||
const sdk = new kuzzle_1.KuzzleSDK(userFlags); | ||
@@ -18,3 +16,3 @@ await sdk.init(); | ||
action: 'searchApiKeys', | ||
userId: userFlags.user, | ||
userId: args.user, | ||
body: {}, | ||
@@ -33,3 +31,3 @@ from: 0, | ||
const { result } = await sdk.query(request); | ||
this.log(`${result.total} API Keys found for user ${userFlags.user}`); | ||
this.log(`${result.total} API Keys found for user ${args.user}`); | ||
if (result.total !== 0) { | ||
@@ -50,9 +48,8 @@ this.log(''); | ||
ApiKeySearch.description = 'List an user API Keys'; | ||
ApiKeySearch.flags = Object.assign({ help: command_1.flags.help(), user: command_1.flags.string({ | ||
char: 'u', | ||
description: 'User kuid', | ||
required: true, | ||
}), filter: command_1.flags.string({ | ||
ApiKeySearch.flags = Object.assign({ help: command_1.flags.help(), filter: command_1.flags.string({ | ||
description: 'Filter to match the API Key descriptions', | ||
}) }, kuzzle_1.kuzzleFlags); | ||
ApiKeySearch.args = [ | ||
{ name: 'user', description: 'User kuid', required: true }, | ||
]; | ||
exports.default = ApiKeySearch; |
@@ -6,3 +6,3 @@ "use strict"; | ||
const common_1 = require("../../common"); | ||
const kuzzle_1 = require("../../kuzzle"); | ||
const kuzzle_1 = require("../../support/kuzzle"); | ||
const dump_collection_1 = tslib_1.__importDefault(require("../../support/dump-collection")); | ||
@@ -13,5 +13,3 @@ const fs = tslib_1.__importStar(require("fs")); | ||
async run() { | ||
this.log(''); | ||
this.log(`${common_1.printCliName()} - ${CollectionDump.description}`); | ||
this.log(''); | ||
this.printCommand(); | ||
const { args, flags: userFlags } = this.parse(CollectionDump); | ||
@@ -18,0 +16,0 @@ const path = userFlags.path || args.index; |
@@ -6,3 +6,3 @@ "use strict"; | ||
const common_1 = require("../../common"); | ||
const kuzzle_1 = require("../../kuzzle"); | ||
const kuzzle_1 = require("../../support/kuzzle"); | ||
const chalk_1 = tslib_1.__importDefault(require("chalk")); | ||
@@ -12,5 +12,3 @@ const restore_collection_1 = tslib_1.__importDefault(require("../../support/restore-collection")); | ||
async run() { | ||
this.log(''); | ||
this.log(`${common_1.printCliName()} - ${CollectionRestore.description}`); | ||
this.log(''); | ||
this.printCommand(); | ||
const { args, flags: userFlags } = this.parse(CollectionRestore); | ||
@@ -17,0 +15,0 @@ const index = userFlags.index; |
@@ -5,8 +5,6 @@ "use strict"; | ||
const common_1 = require("../../common"); | ||
const kuzzle_1 = require("../../kuzzle"); | ||
const kuzzle_1 = require("../../support/kuzzle"); | ||
class DocumentGet extends common_1.Kommand { | ||
async run() { | ||
this.log(''); | ||
this.log(`${common_1.printCliName()} - ${DocumentGet.description}`); | ||
this.log(''); | ||
this.printCommand(); | ||
const { args, flags: userFlags } = this.parse(DocumentGet); | ||
@@ -13,0 +11,0 @@ const sdk = new kuzzle_1.KuzzleSDK(userFlags); |
@@ -6,3 +6,3 @@ "use strict"; | ||
const common_1 = require("../../common"); | ||
const kuzzle_1 = require("../../kuzzle"); | ||
const kuzzle_1 = require("../../support/kuzzle"); | ||
const dump_collection_1 = tslib_1.__importDefault(require("../../support/dump-collection")); | ||
@@ -13,5 +13,3 @@ const fs = tslib_1.__importStar(require("fs")); | ||
async run() { | ||
this.log(''); | ||
this.log(`${common_1.printCliName()} - ${IndexDump.description}`); | ||
this.log(''); | ||
this.printCommand(); | ||
const { args, flags: userFlags } = this.parse(IndexDump); | ||
@@ -18,0 +16,0 @@ const path = userFlags.path || args.index; |
@@ -6,3 +6,3 @@ "use strict"; | ||
const common_1 = require("../../common"); | ||
const kuzzle_1 = require("../../kuzzle"); | ||
const kuzzle_1 = require("../../support/kuzzle"); | ||
const fs = tslib_1.__importStar(require("fs")); | ||
@@ -13,5 +13,3 @@ const chalk_1 = tslib_1.__importDefault(require("chalk")); | ||
async run() { | ||
this.log(''); | ||
this.log(`${common_1.printCliName()} - ${IndexRestore.description}`); | ||
this.log(''); | ||
this.printCommand(); | ||
const { args, flags: userFlags } = this.parse(IndexRestore); | ||
@@ -18,0 +16,0 @@ const index = userFlags.index; |
@@ -1,3 +0,4 @@ | ||
import { Command, flags } from '@oclif/command'; | ||
export declare class InstanceLogs extends Command { | ||
import { Kommand } from '../../common'; | ||
import { flags } from '@oclif/command'; | ||
export declare class InstanceLogs extends Kommand { | ||
static flags: { | ||
@@ -4,0 +5,0 @@ instance: flags.IOptionFlag<string | undefined>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
const common_1 = require("../../common"); | ||
const command_1 = require("@oclif/command"); | ||
const inquirer = tslib_1.__importStar(require("inquirer")); | ||
const execa_1 = tslib_1.__importDefault(require("execa")); | ||
class InstanceLogs extends command_1.Command { | ||
class InstanceLogs extends common_1.Kommand { | ||
async run() { | ||
this.printCommand(); | ||
const { flags } = this.parse(InstanceLogs); | ||
@@ -10,0 +12,0 @@ let instance = flags.instance; |
@@ -92,3 +92,3 @@ "use strict"; | ||
async run() { | ||
this.log(`\n${common_1.printCliName()} - ${InstanceSpawn.description}\n`); | ||
this.printCommand(); | ||
const { flags: userFlags } = this.parse(InstanceSpawn); | ||
@@ -95,0 +95,0 @@ const portIndex = await this.findAvailablePort(); |
import { Command } from '@oclif/command'; | ||
export declare const printCliName: () => string; | ||
export declare abstract class Kommand extends Command { | ||
printCommand(): void; | ||
log(message?: string | undefined, ...args: any[]): void; | ||
logError(message?: string | undefined, ...args: any[]): void; | ||
} |
@@ -7,6 +7,9 @@ "use strict"; | ||
const node_emoji_1 = tslib_1.__importDefault(require("node-emoji")); | ||
exports.printCliName = () => { | ||
return chalk_1.default.blue.bold(`${node_emoji_1.default.get('rocket')} Kourou`); | ||
}; | ||
class Kommand extends command_1.Command { | ||
printCommand() { | ||
const klass = this.constructor; | ||
this.log(''); | ||
this.log(`${chalk_1.default.blue.bold(`${node_emoji_1.default.get('rocket')} Kourou`)} - ${klass.description}`); | ||
this.log(''); | ||
} | ||
log(message, ...args) { | ||
@@ -13,0 +16,0 @@ return super.log(` ${message}`, ...args); |
@@ -1,1 +0,1 @@ | ||
{"version":"0.5.0","commands":{"api-key:create":{"id":"api-key:create","description":"Creates a new API Key for an user","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"user":{"name":"user","type":"option","char":"u","description":"User kuid","required":true},"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 user","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"}},"args":[]},"api-key:delete":{"id":"api-key:delete","description":"Deletes a new API Key for an user","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"user":{"name":"user","type":"option","char":"u","description":"User kuid","required":true},"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 user","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"}},"args":[]},"api-key:search":{"id":"api-key:search","description":"List an user API Keys","pluginName":"kourou","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","description":"show CLI help","allowNo":false},"user":{"name":"user","type":"option","char":"u","description":"User kuid","required":true},"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 user","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"}},"args":[]},"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 directory (default: index name)"},"batch-size":{"name":"batch-size","type":"option","description":"Maximum batch size (see limits.documentsFetchCount config)","default":"5000"},"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 user","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.documentsFetchCount config)","default":"5000"},"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"},"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 user","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"}},"args":[{"name":"path","description":"Dump file path","required":true}]},"document:get":{"id":"document:get","description":"Get 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 user","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}]},"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":"5000"},"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 user","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.documentsFetchCount config)","default":"5000"},"index":{"name":"index","type":"option","description":"If set, override the index destination name"},"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 user","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","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":[]}}} | ||
{"version":"0.6.0","commands":{"api-key:create":{"id":"api-key:create","description":"Creates a new API Key for an 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 user","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 a new API Key for an user","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 user","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":"List an user 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 user","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 directory (default: index name)"},"batch-size":{"name":"batch-size","type":"option","description":"Maximum batch size (see limits.documentsFetchCount config)","default":"5000"},"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 user","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.documentsFetchCount config)","default":"5000"},"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"},"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 user","default":"anonymous"},"password":{"name":"password","type":"option","description":"Kuzzle user password"}},"args":[{"name":"path","description":"Dump file path","required":true}]},"document:get":{"id":"document:get","description":"Get 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 user","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}]},"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":"5000"},"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 user","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.documentsFetchCount config)","default":"5000"},"index":{"name":"index","type":"option","description":"If set, override the index destination name"},"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 user","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","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":[]},"vault:add":{"id":"vault:add","description":"Add 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":"Encrypt 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":"Display an encrypted key on stdout","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": "kourou", | ||
"description": "The CLI that helps you manage your Kuzzle instances", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"author": "The Kuzzle Team <support@kuzzle.io>", | ||
@@ -21,2 +21,3 @@ "bin": { | ||
"kuzzle-sdk": "^7.0.1", | ||
"kuzzle-vault": "^1.0.2", | ||
"listr": "^0.14.3", | ||
@@ -23,0 +24,0 @@ "ndjson": "^1.5.0", |
113
README.md
@@ -17,2 +17,4 @@ # kourou | ||
:warning: This project is currently in beta and breaking changes may occur until the 1.0.0 | ||
# Usage | ||
@@ -26,3 +28,3 @@ | ||
$ kourou (-v|--version|version) | ||
kourou/0.5.0 linux-x64 node-v12.14.1 | ||
kourou/0.6.0 linux-x64 node-v12.15.0 | ||
$ kourou --help [COMMAND] | ||
@@ -60,5 +62,5 @@ USAGE | ||
<!-- commands --> | ||
* [`kourou api-key:create`](#kourou-api-keycreate) | ||
* [`kourou api-key:delete`](#kourou-api-keydelete) | ||
* [`kourou api-key:search`](#kourou-api-keysearch) | ||
* [`kourou api-key:create USER`](#kourou-api-keycreate-user) | ||
* [`kourou api-key:delete USER`](#kourou-api-keydelete-user) | ||
* [`kourou api-key:search USER`](#kourou-api-keysearch-user) | ||
* [`kourou collection:dump INDEX COLLECTION`](#kourou-collectiondump-index-collection) | ||
@@ -72,4 +74,7 @@ * [`kourou collection:restore PATH`](#kourou-collectionrestore-path) | ||
* [`kourou instance:spawn`](#kourou-instancespawn) | ||
* [`kourou vault:add SECRETS-FILE KEY VALUE`](#kourou-vaultadd-secrets-file-key-value) | ||
* [`kourou vault:encrypt FILE`](#kourou-vaultencrypt-file) | ||
* [`kourou vault:show SECRETS-FILE KEY`](#kourou-vaultshow-secrets-file-key) | ||
## `kourou api-key:create` | ||
## `kourou api-key:create USER` | ||
@@ -80,4 +85,7 @@ Creates a new API Key for an user | ||
USAGE | ||
$ kourou api-key:create | ||
$ kourou api-key:create USER | ||
ARGUMENTS | ||
USER User kuid | ||
OPTIONS | ||
@@ -87,3 +95,2 @@ -d, --description=description (required) API Key description | ||
-p, --port=port [default: 7512] Kuzzle server port | ||
-u, --user=user (required) User kuid | ||
--expire=expire [default: -1] API Key validity | ||
@@ -97,5 +104,5 @@ --help show CLI help | ||
_See code: [src/commands/api-key/create.ts](https://github.com/kuzzleio/kourou/blob/v0.5.0/src/commands/api-key/create.ts)_ | ||
_See code: [src/commands/api-key/create.ts](https://github.com/kuzzleio/kourou/blob/v0.6.0/src/commands/api-key/create.ts)_ | ||
## `kourou api-key:delete` | ||
## `kourou api-key:delete USER` | ||
@@ -106,8 +113,10 @@ Deletes a new API Key for an user | ||
USAGE | ||
$ kourou api-key:delete | ||
$ kourou api-key:delete USER | ||
ARGUMENTS | ||
USER User kuid | ||
OPTIONS | ||
-h, --host=host [default: localhost] Kuzzle server host | ||
-p, --port=port [default: 7512] Kuzzle server port | ||
-u, --user=user (required) User kuid | ||
--help show CLI help | ||
@@ -120,5 +129,5 @@ --id=id API Key unique ID | ||
_See code: [src/commands/api-key/delete.ts](https://github.com/kuzzleio/kourou/blob/v0.5.0/src/commands/api-key/delete.ts)_ | ||
_See code: [src/commands/api-key/delete.ts](https://github.com/kuzzleio/kourou/blob/v0.6.0/src/commands/api-key/delete.ts)_ | ||
## `kourou api-key:search` | ||
## `kourou api-key:search USER` | ||
@@ -129,8 +138,10 @@ List an user API Keys | ||
USAGE | ||
$ kourou api-key:search | ||
$ kourou api-key:search USER | ||
ARGUMENTS | ||
USER User kuid | ||
OPTIONS | ||
-h, --host=host [default: localhost] Kuzzle server host | ||
-p, --port=port [default: 7512] Kuzzle server port | ||
-u, --user=user (required) User kuid | ||
--filter=filter Filter to match the API Key descriptions | ||
@@ -143,3 +154,3 @@ --help show CLI help | ||
_See code: [src/commands/api-key/search.ts](https://github.com/kuzzleio/kourou/blob/v0.5.0/src/commands/api-key/search.ts)_ | ||
_See code: [src/commands/api-key/search.ts](https://github.com/kuzzleio/kourou/blob/v0.6.0/src/commands/api-key/search.ts)_ | ||
@@ -169,3 +180,3 @@ ## `kourou collection:dump INDEX COLLECTION` | ||
_See code: [src/commands/collection/dump.ts](https://github.com/kuzzleio/kourou/blob/v0.5.0/src/commands/collection/dump.ts)_ | ||
_See code: [src/commands/collection/dump.ts](https://github.com/kuzzleio/kourou/blob/v0.6.0/src/commands/collection/dump.ts)_ | ||
@@ -195,3 +206,3 @@ ## `kourou collection:restore PATH` | ||
_See code: [src/commands/collection/restore.ts](https://github.com/kuzzleio/kourou/blob/v0.5.0/src/commands/collection/restore.ts)_ | ||
_See code: [src/commands/collection/restore.ts](https://github.com/kuzzleio/kourou/blob/v0.6.0/src/commands/collection/restore.ts)_ | ||
@@ -220,3 +231,3 @@ ## `kourou document:get INDEX COLLECTION ID` | ||
_See code: [src/commands/document/get.ts](https://github.com/kuzzleio/kourou/blob/v0.5.0/src/commands/document/get.ts)_ | ||
_See code: [src/commands/document/get.ts](https://github.com/kuzzleio/kourou/blob/v0.6.0/src/commands/document/get.ts)_ | ||
@@ -262,3 +273,3 @@ ## `kourou help [COMMAND]` | ||
_See code: [src/commands/index/dump.ts](https://github.com/kuzzleio/kourou/blob/v0.5.0/src/commands/index/dump.ts)_ | ||
_See code: [src/commands/index/dump.ts](https://github.com/kuzzleio/kourou/blob/v0.6.0/src/commands/index/dump.ts)_ | ||
@@ -287,3 +298,3 @@ ## `kourou index:restore PATH` | ||
_See code: [src/commands/index/restore.ts](https://github.com/kuzzleio/kourou/blob/v0.5.0/src/commands/index/restore.ts)_ | ||
_See code: [src/commands/index/restore.ts](https://github.com/kuzzleio/kourou/blob/v0.6.0/src/commands/index/restore.ts)_ | ||
@@ -301,3 +312,3 @@ ## `kourou instance:logs` | ||
_See code: [src/commands/instance/logs.ts](https://github.com/kuzzleio/kourou/blob/v0.5.0/src/commands/instance/logs.ts)_ | ||
_See code: [src/commands/instance/logs.ts](https://github.com/kuzzleio/kourou/blob/v0.6.0/src/commands/instance/logs.ts)_ | ||
@@ -318,3 +329,59 @@ ## `kourou instance:spawn` | ||
_See code: [src/commands/instance/spawn.ts](https://github.com/kuzzleio/kourou/blob/v0.5.0/src/commands/instance/spawn.ts)_ | ||
_See code: [src/commands/instance/spawn.ts](https://github.com/kuzzleio/kourou/blob/v0.6.0/src/commands/instance/spawn.ts)_ | ||
## `kourou vault:add SECRETS-FILE KEY VALUE` | ||
Add an encrypted key to a secrets file | ||
``` | ||
USAGE | ||
$ kourou vault:add SECRETS-FILE KEY VALUE | ||
ARGUMENTS | ||
SECRETS-FILE Encrypted secrets file | ||
KEY Path to the key (lodash style) | ||
VALUE Value to encrypt | ||
OPTIONS | ||
--vault-key=vault-key Kuzzle Vault Key (or KUZZLE_VAULT_KEY) | ||
``` | ||
_See code: [src/commands/vault/add.ts](https://github.com/kuzzleio/kourou/blob/v0.6.0/src/commands/vault/add.ts)_ | ||
## `kourou vault:encrypt FILE` | ||
Encrypt an entire file | ||
``` | ||
USAGE | ||
$ kourou vault:encrypt FILE | ||
ARGUMENTS | ||
FILE File containing unencrypted secrets | ||
OPTIONS | ||
-f, --force Overwrite the output file if it already exists | ||
-o, --output-file=output-file Output file (default: <file>.enc.json) | ||
--vault-key=vault-key Kuzzle Vault Key (or KUZZLE_VAULT_KEY) | ||
``` | ||
_See code: [src/commands/vault/encrypt.ts](https://github.com/kuzzleio/kourou/blob/v0.6.0/src/commands/vault/encrypt.ts)_ | ||
## `kourou vault:show SECRETS-FILE KEY` | ||
Display an encrypted key on stdout | ||
``` | ||
USAGE | ||
$ kourou vault:show SECRETS-FILE KEY | ||
ARGUMENTS | ||
SECRETS-FILE Encrypted secrets file | ||
KEY Path to the key (lodash style) | ||
OPTIONS | ||
--vault-key=vault-key Kuzzle Vault Key (or KUZZLE_VAULT_KEY) | ||
``` | ||
_See code: [src/commands/vault/show.ts](https://github.com/kuzzleio/kourou/blob/v0.6.0/src/commands/vault/show.ts)_ | ||
<!-- commandsstop --> | ||
@@ -321,0 +388,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
72193
41
1234
374
15
15
+ Addedkuzzle-vault@^1.0.2
+ Addedkuzzle-vault@1.0.2(transitive)