kourou 1.4.0-dev.4 → 1.5.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/README.md +892 -707
  2. package/bin/run +10 -24
  3. package/lib/commands/api-key/check.d.ts +11 -14
  4. package/lib/commands/api-key/check.js +5 -5
  5. package/lib/commands/api-key/create.d.ts +14 -17
  6. package/lib/commands/api-key/create.js +7 -5
  7. package/lib/commands/api-key/delete.d.ts +12 -14
  8. package/lib/commands/api-key/delete.js +6 -6
  9. package/lib/commands/api-key/search.d.ts +12 -15
  10. package/lib/commands/api-key/search.js +5 -3
  11. package/lib/commands/app/debug-proxy.d.ts +15 -16
  12. package/lib/commands/app/debug-proxy.js +7 -7
  13. package/lib/commands/app/doctor.d.ts +11 -12
  14. package/lib/commands/app/doctor.js +3 -3
  15. package/lib/commands/app/scaffold.d.ts +5 -8
  16. package/lib/commands/app/scaffold.js +8 -9
  17. package/lib/commands/app/start-services.d.ts +2 -2
  18. package/lib/commands/app/start-services.js +3 -3
  19. package/lib/commands/collection/create.d.ts +14 -19
  20. package/lib/commands/collection/create.js +8 -9
  21. package/lib/commands/collection/export.d.ts +20 -22
  22. package/lib/commands/collection/export.js +14 -14
  23. package/lib/commands/collection/import.d.ts +15 -18
  24. package/lib/commands/collection/import.js +9 -9
  25. package/lib/commands/collection/migrate.d.ts +15 -17
  26. package/lib/commands/collection/migrate.js +12 -9
  27. package/lib/commands/config/diff.d.ts +5 -6
  28. package/lib/commands/config/diff.js +11 -9
  29. package/lib/commands/document/search.d.ts +20 -25
  30. package/lib/commands/document/search.js +13 -13
  31. package/lib/commands/es/aliases/cat.d.ts +3 -4
  32. package/lib/commands/es/aliases/cat.js +4 -4
  33. package/lib/commands/es/indices/cat.d.ts +3 -4
  34. package/lib/commands/es/indices/cat.js +4 -4
  35. package/lib/commands/es/indices/get.d.ts +5 -7
  36. package/lib/commands/es/indices/get.js +7 -7
  37. package/lib/commands/es/indices/insert.d.ts +6 -9
  38. package/lib/commands/es/indices/insert.js +8 -8
  39. package/lib/commands/es/migrate.d.ts +11 -12
  40. package/lib/commands/es/migrate.js +26 -15
  41. package/lib/commands/es/snapshot/create-repository.d.ts +6 -8
  42. package/lib/commands/es/snapshot/create-repository.js +12 -10
  43. package/lib/commands/es/snapshot/create.d.ts +6 -8
  44. package/lib/commands/es/snapshot/create.js +11 -8
  45. package/lib/commands/es/snapshot/list.d.ts +4 -7
  46. package/lib/commands/es/snapshot/list.js +7 -8
  47. package/lib/commands/es/snapshot/restore.d.ts +6 -8
  48. package/lib/commands/es/snapshot/restore.js +11 -8
  49. package/lib/commands/file/decrypt.d.ts +5 -8
  50. package/lib/commands/file/decrypt.js +7 -7
  51. package/lib/commands/file/encrypt.d.ts +5 -8
  52. package/lib/commands/file/encrypt.js +7 -5
  53. package/lib/commands/file/test.d.ts +3 -6
  54. package/lib/commands/file/test.js +5 -5
  55. package/lib/commands/import.d.ts +13 -16
  56. package/lib/commands/import.js +8 -9
  57. package/lib/commands/index/export.d.ts +17 -20
  58. package/lib/commands/index/export.js +12 -11
  59. package/lib/commands/index/import.d.ts +14 -17
  60. package/lib/commands/index/import.js +11 -8
  61. package/lib/commands/instance/kill.d.ts +2 -3
  62. package/lib/commands/instance/kill.js +6 -7
  63. package/lib/commands/instance/logs.d.ts +2 -3
  64. package/lib/commands/instance/logs.js +3 -3
  65. package/lib/commands/instance/spawn.d.ts +3 -4
  66. package/lib/commands/instance/spawn.js +7 -8
  67. package/lib/commands/paas/login.d.ts +4 -5
  68. package/lib/commands/paas/login.js +13 -8
  69. package/lib/commands/profile/export.d.ts +10 -11
  70. package/lib/commands/profile/export.js +3 -3
  71. package/lib/commands/profile/import.d.ts +11 -14
  72. package/lib/commands/profile/import.js +5 -3
  73. package/lib/commands/realtime/subscribe.d.ts +19 -24
  74. package/lib/commands/realtime/subscribe.js +12 -12
  75. package/lib/commands/redis/list-keys.d.ts +14 -17
  76. package/lib/commands/redis/list-keys.js +8 -9
  77. package/lib/commands/role/export.d.ts +10 -11
  78. package/lib/commands/role/export.js +3 -3
  79. package/lib/commands/role/import.d.ts +12 -15
  80. package/lib/commands/role/import.js +6 -4
  81. package/lib/commands/sdk/execute.d.ts +15 -18
  82. package/lib/commands/sdk/execute.js +9 -10
  83. package/lib/commands/sdk/query.d.ts +20 -23
  84. package/lib/commands/sdk/query.js +14 -15
  85. package/lib/commands/user/export-mappings.d.ts +10 -11
  86. package/lib/commands/user/export-mappings.js +3 -3
  87. package/lib/commands/user/export.d.ts +14 -15
  88. package/lib/commands/user/export.js +7 -7
  89. package/lib/commands/user/import-mappings.d.ts +11 -14
  90. package/lib/commands/user/import-mappings.js +5 -3
  91. package/lib/commands/user/import.d.ts +11 -14
  92. package/lib/commands/user/import.js +5 -3
  93. package/lib/commands/vault/add.d.ts +5 -6
  94. package/lib/commands/vault/add.js +9 -11
  95. package/lib/commands/vault/decrypt.d.ts +5 -8
  96. package/lib/commands/vault/decrypt.js +8 -9
  97. package/lib/commands/vault/encrypt.d.ts +5 -8
  98. package/lib/commands/vault/encrypt.js +8 -9
  99. package/lib/commands/vault/show.d.ts +5 -11
  100. package/lib/commands/vault/show.js +7 -8
  101. package/lib/commands/vault/test.d.ts +3 -6
  102. package/lib/commands/vault/test.js +6 -7
  103. package/lib/common.d.ts +1 -1
  104. package/lib/common.js +3 -3
  105. package/lib/help.d.ts +16 -0
  106. package/lib/help.js +31 -0
  107. package/lib/hooks/command_not_found/api-action.d.ts +1 -1
  108. package/lib/hooks/command_not_found/api-action.js +8 -8
  109. package/lib/index.d.ts +1 -1
  110. package/lib/index.js +2 -2
  111. package/lib/support/dump-collection.js +2 -2
  112. package/lib/support/kuzzle.d.ts +8 -9
  113. package/lib/support/kuzzle.js +9 -9
  114. package/lib/support/progressBar.d.ts +10 -0
  115. package/lib/support/progressBar.js +15 -0
  116. package/package.json +13 -12
@@ -1,26 +1,23 @@
1
- import { flags } from "@oclif/command";
2
1
  import { Kommand } from "../common";
3
2
  export default class Import extends Kommand {
4
3
  static keepAuth: boolean;
5
4
  static description: string;
6
5
  static flags: {
7
- protocol: flags.IOptionFlag<string>;
8
- host: flags.IOptionFlag<string>;
9
- port: flags.IOptionFlag<string>;
10
- ssl: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
11
- username: flags.IOptionFlag<string>;
12
- password: flags.IOptionFlag<string | undefined>;
13
- as: flags.IOptionFlag<string | undefined>;
14
- "api-key": flags.IOptionFlag<string | undefined>;
15
- "preserve-anonymous": import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
16
- help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
17
- "batch-size": flags.IOptionFlag<string>;
6
+ protocol: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ host: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ port: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ ssl: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
+ username: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ password: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ as: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ "api-key": import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
14
+ "preserve-anonymous": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
15
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
16
+ "batch-size": import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
18
17
  };
19
18
  static args: {
20
- name: string;
21
- description: string;
22
- required: boolean;
23
- }[];
19
+ path: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
20
+ };
24
21
  runSafe(): Promise<void>;
25
22
  walkDirectories(directory: string): Promise<any>;
26
23
  getFileType(file: string): any;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const command_1 = require("@oclif/command");
4
+ const core_1 = require("@oclif/core");
5
5
  const fs_1 = tslib_1.__importDefault(require("fs"));
6
6
  const path_1 = tslib_1.__importDefault(require("path"));
7
7
  const common_1 = require("../common");
@@ -124,21 +124,20 @@ class Import extends common_1.Kommand {
124
124
  }
125
125
  Import.keepAuth = true;
126
126
  Import.description = "Recursively imports dump files from a root directory";
127
- Import.flags = Object.assign(Object.assign({ "preserve-anonymous": command_1.flags.boolean({
127
+ Import.flags = Object.assign(Object.assign({ "preserve-anonymous": core_1.Flags.boolean({
128
128
  description: "Preserve anonymous rights",
129
129
  default: false,
130
- }), help: command_1.flags.help({}), "batch-size": command_1.flags.string({
130
+ }), help: core_1.Flags.help({}), "batch-size": core_1.Flags.string({
131
131
  description: "Maximum batch size (see limits.documentsWriteCount config)",
132
132
  default: "200",
133
- }) }, kuzzle_1.kuzzleFlags), { protocol: command_1.flags.string({
133
+ }) }, kuzzle_1.kuzzleFlags), { protocol: core_1.Flags.string({
134
134
  description: "Kuzzle protocol (http or websocket)",
135
135
  default: "ws",
136
136
  }) });
137
- Import.args = [
138
- {
139
- name: "path",
137
+ Import.args = {
138
+ path: core_1.Args.string({
140
139
  description: "Root directory containing dumps",
141
140
  required: true,
142
- },
143
- ];
141
+ }),
142
+ };
144
143
  exports.default = Import;
@@ -1,30 +1,27 @@
1
- import { flags } from "@oclif/command";
2
1
  import { Kommand } from "../../common";
3
2
  export default class IndexExport extends Kommand {
4
3
  static keepAuth: boolean;
5
4
  static description: string;
6
5
  static flags: {
7
- protocol: flags.IOptionFlag<string>;
8
- type: flags.IOptionFlag<string>;
9
- host: flags.IOptionFlag<string>;
10
- port: flags.IOptionFlag<string>;
11
- ssl: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
12
- username: flags.IOptionFlag<string>;
13
- password: flags.IOptionFlag<string | undefined>;
14
- as: flags.IOptionFlag<string | undefined>;
15
- "api-key": flags.IOptionFlag<string | undefined>;
16
- help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
17
- path: flags.IOptionFlag<string | undefined>;
18
- "batch-size": flags.IOptionFlag<string>;
19
- query: flags.IOptionFlag<string>;
20
- format: flags.IOptionFlag<string>;
21
- scrollTTL: flags.IOptionFlag<string>;
6
+ protocol: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ type: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ host: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ port: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ ssl: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
+ username: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ password: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ as: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
+ "api-key": import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
15
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
16
+ path: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
17
+ "batch-size": import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
18
+ query: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
19
+ format: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
20
+ scrollTTL: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
22
21
  };
23
22
  static args: {
24
- name: string;
25
- description: string;
26
- required: boolean;
27
- }[];
23
+ index: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
24
+ };
28
25
  static examples: string[];
29
26
  runSafe(): Promise<void>;
30
27
  }
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const command_1 = require("@oclif/command");
4
+ const core_1 = require("@oclif/core");
5
5
  const fs_1 = tslib_1.__importDefault(require("fs"));
6
- const cli_ux_1 = tslib_1.__importDefault(require("cli-ux"));
7
6
  const path_1 = tslib_1.__importDefault(require("path"));
8
7
  const common_1 = require("../../common");
9
8
  const kuzzle_1 = require("../../support/kuzzle");
@@ -30,7 +29,7 @@ class IndexExport extends common_1.Kommand {
30
29
  this.logInfo(`Dumping collection "${collection.name}" documents ...`);
31
30
  await (0, dump_collection_1.dumpCollectionData)(this.sdk, this.args.index, collection.name, Number(this.flags["batch-size"]), exportPath, query, this.flags.format, this.flags.scrollTTL);
32
31
  }
33
- cli_ux_1.default.action.stop();
32
+ core_1.ux.action.stop();
34
33
  }
35
34
  catch (error) {
36
35
  this.logKo(`Error when exporting collection "${collection.name}": ${error}`);
@@ -41,29 +40,31 @@ class IndexExport extends common_1.Kommand {
41
40
  }
42
41
  IndexExport.keepAuth = true;
43
42
  IndexExport.description = "Exports an index (JSONL or Kuzzle format)";
44
- IndexExport.flags = Object.assign(Object.assign({ help: command_1.flags.help({}), path: command_1.flags.string({
43
+ IndexExport.flags = Object.assign(Object.assign({ help: core_1.Flags.help({}), path: core_1.Flags.string({
45
44
  description: "Dump root directory",
46
- }), "batch-size": command_1.flags.string({
45
+ }), "batch-size": core_1.Flags.string({
47
46
  description: "Maximum batch size (see limits.documentsFetchCount config)",
48
47
  default: "2000",
49
- }), query: command_1.flags.string({
48
+ }), query: core_1.Flags.string({
50
49
  description: "Only dump documents in collections matching the query (JS or JSON format)",
51
50
  default: "{}",
52
- }), format: command_1.flags.string({
51
+ }), format: core_1.Flags.string({
53
52
  description: '"jsonl or kuzzle - kuzzle will export in Kuzzle format usable for internal fixtures and jsonl allows to import that data back with kourou',
54
53
  default: "jsonl",
55
- }), scrollTTL: command_1.flags.string({
54
+ }), scrollTTL: core_1.Flags.string({
56
55
  description: `The scroll TTL option to pass to the dump operation (which performs a document.search under the hood),
57
56
  expressed in ms format, e.g. '2s', '1m', '3h'.`,
58
57
  default: "20s",
59
- }) }, kuzzle_1.kuzzleFlags), { protocol: command_1.flags.string({
58
+ }) }, kuzzle_1.kuzzleFlags), { protocol: core_1.Flags.string({
60
59
  description: "Kuzzle protocol (http or websocket)",
61
60
  default: "ws",
62
- }), type: command_1.flags.string({
61
+ }), type: core_1.Flags.string({
63
62
  description: "Type of the export: all, mappings, data",
64
63
  default: "all",
65
64
  }) });
66
- IndexExport.args = [{ name: "index", description: "Index name", required: true }];
65
+ IndexExport.args = {
66
+ index: core_1.Args.string({ description: "Index name", required: true }),
67
+ };
67
68
  IndexExport.examples = [
68
69
  "kourou index:export nyc-open-data",
69
70
  'kourou index:export nyc-open-data --query \'{"range":{"_kuzzle_info.createdAt":{"gt":1632935638866}}}\'',
@@ -1,27 +1,24 @@
1
- import { flags } from "@oclif/command";
2
1
  import { Kommand } from "../../common";
3
2
  export default class IndexImport extends Kommand {
4
3
  static keepAuth: boolean;
5
4
  static description: string;
6
5
  static examples: string[];
7
6
  static flags: {
8
- protocol: flags.IOptionFlag<string>;
9
- host: flags.IOptionFlag<string>;
10
- port: flags.IOptionFlag<string>;
11
- ssl: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
12
- username: flags.IOptionFlag<string>;
13
- password: flags.IOptionFlag<string | undefined>;
14
- as: flags.IOptionFlag<string | undefined>;
15
- "api-key": flags.IOptionFlag<string | undefined>;
16
- help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
17
- "batch-size": flags.IOptionFlag<string>;
18
- index: flags.IOptionFlag<string | undefined>;
19
- "no-mappings": import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
7
+ protocol: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ host: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ port: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ ssl: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
+ username: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ password: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ as: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
+ "api-key": import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
15
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
16
+ "batch-size": import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
17
+ index: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
18
+ "no-mappings": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
20
19
  };
21
20
  static args: {
22
- name: string;
23
- description: string;
24
- required: boolean;
25
- }[];
21
+ path: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
22
+ };
26
23
  runSafe(): Promise<void>;
27
24
  }
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const path_1 = tslib_1.__importDefault(require("path"));
5
5
  const fs_1 = tslib_1.__importDefault(require("fs"));
6
- const command_1 = require("@oclif/command");
6
+ const core_1 = require("@oclif/core");
7
7
  const common_1 = require("../../common");
8
8
  const kuzzle_1 = require("../../support/kuzzle");
9
9
  const restore_collection_1 = require("../../support/restore-collection");
@@ -40,18 +40,21 @@ IndexImport.examples = [
40
40
  "kourou index:import ./dump/iot-data",
41
41
  "kourou index:import ./dump/iot-data --index iot-data-production --no-mappings",
42
42
  ];
43
- IndexImport.flags = Object.assign(Object.assign({ help: command_1.flags.help({}), "batch-size": command_1.flags.string({
43
+ IndexImport.flags = Object.assign(Object.assign({ help: core_1.Flags.help({}), "batch-size": core_1.Flags.string({
44
44
  description: "Maximum batch size (see limits.documentsWriteCount config)",
45
45
  default: "200",
46
- }), index: command_1.flags.string({
46
+ }), index: core_1.Flags.string({
47
47
  description: "If set, override the index destination name",
48
- }), "no-mappings": command_1.flags.boolean({
48
+ }), "no-mappings": core_1.Flags.boolean({
49
49
  description: "Skip collections mappings",
50
- }) }, kuzzle_1.kuzzleFlags), { protocol: command_1.flags.string({
50
+ }) }, kuzzle_1.kuzzleFlags), { protocol: core_1.Flags.string({
51
51
  description: "Kuzzle protocol (http or websocket)",
52
52
  default: "ws",
53
53
  }) });
54
- IndexImport.args = [
55
- { name: "path", description: "Dump directory or file", required: true },
56
- ];
54
+ IndexImport.args = {
55
+ path: core_1.Args.string({
56
+ description: "Dump directory or file",
57
+ required: true,
58
+ }),
59
+ };
57
60
  exports.default = IndexImport;
@@ -1,11 +1,10 @@
1
- import { flags } from "@oclif/command";
2
1
  import { Kommand } from "../../common";
3
2
  export declare class InstanceLogs extends Kommand {
4
3
  static initSdk: boolean;
5
4
  static description: string;
6
5
  static flags: {
7
- instance: flags.IOptionFlag<string | undefined>;
8
- all: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
6
+ instance: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ all: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
8
  };
10
9
  runSafe(): Promise<void>;
11
10
  private killInstance;
@@ -2,10 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InstanceLogs = void 0;
4
4
  const tslib_1 = require("tslib");
5
+ const core_1 = require("@oclif/core");
5
6
  const path_1 = tslib_1.__importDefault(require("path"));
6
- const command_1 = require("@oclif/command");
7
7
  const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
8
- const cli_ux_1 = tslib_1.__importDefault(require("cli-ux"));
9
8
  const child_process_1 = require("child_process");
10
9
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
11
10
  const emoji_1 = require("../../support/emoji");
@@ -47,7 +46,7 @@ class InstanceLogs extends common_1.Kommand {
47
46
  }
48
47
  async killInstance(instanceName) {
49
48
  const docoFilename = path_1.default.join(this.kourouDir, `kuzzle-${instanceName}.yml`);
50
- cli_ux_1.default.action.start(`${emoji_1.emoji.boom} Killing Kuzzle instance ${instanceName}`, undefined, {
49
+ core_1.ux.action.start(`${emoji_1.emoji.boom} Killing Kuzzle instance ${instanceName}`, undefined, {
51
50
  stdout: true,
52
51
  });
53
52
  const instanceKill = (0, child_process_1.spawn)("docker", [
@@ -60,10 +59,10 @@ class InstanceLogs extends common_1.Kommand {
60
59
  ]);
61
60
  return new Promise((resolve) => instanceKill.on("close", (code) => {
62
61
  if (code === 0) {
63
- cli_ux_1.default.action.stop(chalk_1.default.green(`\n${emoji_1.emoji.thumbsUp} Instance ${instanceName} successfully killed.`));
62
+ core_1.ux.action.stop(chalk_1.default.green(`\n${emoji_1.emoji.thumbsUp} Instance ${instanceName} successfully killed.`));
64
63
  }
65
64
  else {
66
- cli_ux_1.default.action.stop(chalk_1.default.red(`\n${emoji_1.emoji.thumbsDown} Something went wrong whilde killing instance ${instanceName}.`));
65
+ core_1.ux.action.stop(chalk_1.default.red(`\n${emoji_1.emoji.thumbsDown} Something went wrong whilde killing instance ${instanceName}.`));
67
66
  }
68
67
  resolve(undefined);
69
68
  }));
@@ -91,11 +90,11 @@ exports.InstanceLogs = InstanceLogs;
91
90
  InstanceLogs.initSdk = false;
92
91
  InstanceLogs.description = "Stop and remove all the containers of a running kuzzle instance";
93
92
  InstanceLogs.flags = {
94
- instance: command_1.flags.string({
93
+ instance: core_1.Flags.string({
95
94
  char: "i",
96
95
  description: "Kuzzle instance name [ex: stack-0]",
97
96
  }),
98
- all: command_1.flags.boolean({
97
+ all: core_1.Flags.boolean({
99
98
  char: "a",
100
99
  description: "Kill all instances",
101
100
  }),
@@ -1,11 +1,10 @@
1
- import { flags } from "@oclif/command";
2
1
  import { Kommand } from "../../common";
3
2
  export declare class InstanceLogs extends Kommand {
4
3
  static initSdk: boolean;
5
4
  static description: string;
6
5
  static flags: {
7
- instance: flags.IOptionFlag<string | undefined>;
8
- follow: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
6
+ instance: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ follow: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
8
  };
10
9
  runSafe(): Promise<void>;
11
10
  private showInstanceLogs;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InstanceLogs = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const command_1 = require("@oclif/command");
5
+ const core_1 = require("@oclif/core");
6
6
  const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
7
7
  const common_1 = require("../../common");
8
8
  const execute_1 = require("../../support/execute");
@@ -62,11 +62,11 @@ exports.InstanceLogs = InstanceLogs;
62
62
  InstanceLogs.initSdk = false;
63
63
  InstanceLogs.description = "Displays the logs of a running Kuzzle";
64
64
  InstanceLogs.flags = {
65
- instance: command_1.flags.string({
65
+ instance: core_1.Flags.string({
66
66
  char: "i",
67
67
  description: "Kuzzle instance name",
68
68
  }),
69
- follow: command_1.flags.boolean({
69
+ follow: core_1.Flags.boolean({
70
70
  char: "f",
71
71
  description: "Follow log output",
72
72
  }),
@@ -1,12 +1,11 @@
1
- import { flags } from "@oclif/command";
2
1
  import { Kommand } from "../../common";
3
2
  export default class InstanceSpawn extends Kommand {
4
3
  static initSdk: boolean;
5
4
  static description: string;
6
5
  static flags: {
7
- help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
8
- check: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
9
- version: flags.IOptionFlag<string>;
6
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
7
+ check: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
+ version: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
10
9
  };
11
10
  runSafe(): Promise<void>;
12
11
  private generateDocoFile;
@@ -1,13 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
+ const core_1 = require("@oclif/core");
4
5
  const path_1 = tslib_1.__importDefault(require("path"));
5
6
  const fs_1 = require("fs");
6
7
  const net_1 = tslib_1.__importDefault(require("net"));
7
- const command_1 = require("@oclif/command");
8
8
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
9
9
  const child_process_1 = require("child_process");
10
- const cli_ux_1 = tslib_1.__importDefault(require("cli-ux"));
11
10
  const emoji_1 = require("../../support/emoji");
12
11
  const common_1 = require("../../common");
13
12
  const execute_1 = require("../../support/execute");
@@ -104,12 +103,12 @@ class InstanceSpawn extends common_1.Kommand {
104
103
  "up",
105
104
  "-d",
106
105
  ]);
107
- cli_ux_1.default.action.start(` ${emoji_1.emoji.rocket} Kuzzle version ${this.flags.version} is launching`, undefined, {
106
+ core_1.ux.action.start(` ${emoji_1.emoji.rocket} Kuzzle version ${this.flags.version} is launching`, undefined, {
108
107
  stdout: true,
109
108
  });
110
109
  doco.on("close", (docoCode) => {
111
110
  if (docoCode === 0) {
112
- cli_ux_1.default.action.stop("done");
111
+ core_1.ux.action.stop("done");
113
112
  this.log(`\n${emoji_1.emoji.thumbsUp} ${chalk_1.default.bold("Kuzzle is booting")} in the background right now.`);
114
113
  this.log(chalk_1.default.grey("To watch the logs, run"));
115
114
  this.log(chalk_1.default.grey(` docker compose -f ${docoFilename} -p stack-${portIndex} logs -f\n`));
@@ -119,7 +118,7 @@ class InstanceSpawn extends common_1.Kommand {
119
118
  this.log(` Elasticsearch port: ${9200 + portIndex}`);
120
119
  }
121
120
  else {
122
- cli_ux_1.default.action.stop(chalk_1.default.red(` Something went wrong: docker compose exited with ${docoCode}`));
121
+ core_1.ux.action.stop(chalk_1.default.red(` Something went wrong: docker compose exited with ${docoCode}`));
123
122
  this.log(chalk_1.default.grey("If you want to investigate the problem, try running"));
124
123
  this.log(chalk_1.default.grey(` docker compose -f ${docoFilename} -p stack-${portIndex} up\n`));
125
124
  throw new Error("docker compose exited with a non-zero status");
@@ -161,12 +160,12 @@ class InstanceSpawn extends common_1.Kommand {
161
160
  InstanceSpawn.initSdk = false;
162
161
  InstanceSpawn.description = "Spawn a new Kuzzle instance";
163
162
  InstanceSpawn.flags = {
164
- help: command_1.flags.help(),
165
- check: command_1.flags.boolean({
163
+ help: core_1.Flags.help(),
164
+ check: core_1.Flags.boolean({
166
165
  description: "Check prerequisite before running Kuzzle",
167
166
  default: false,
168
167
  }),
169
- version: command_1.flags.string({
168
+ version: core_1.Flags.string({
170
169
  char: "v",
171
170
  description: "Core-version of the instance to spawn",
172
171
  default: "2",
@@ -1,13 +1,12 @@
1
- import { flags } from "@oclif/command";
2
1
  import { ApiKey } from "kuzzle-sdk";
3
2
  import { PaasKommand } from "../../support/PaasKommand";
4
3
  declare class PaasLogin extends PaasKommand {
5
4
  static description: string;
6
5
  static flags: {
7
- help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
8
- project: flags.IOptionFlag<string | undefined>;
9
- username: flags.IOptionFlag<string | undefined>;
10
- only_npm: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
6
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
7
+ project: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ username: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ only_npm: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
10
  };
12
11
  runSafe(): Promise<void>;
13
12
  createProjectCredentials(apiKey: ApiKey): void;
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const fs_1 = tslib_1.__importDefault(require("fs"));
5
- const command_1 = require("@oclif/command");
6
- const cli_ux_1 = tslib_1.__importDefault(require("cli-ux"));
5
+ const core_1 = require("@oclif/core");
6
+ const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
7
7
  const PaasKommand_1 = require("../../support/PaasKommand");
8
8
  const child_process_1 = require("child_process");
9
9
  class PaasLogin extends PaasKommand_1.PaasKommand {
@@ -11,10 +11,15 @@ class PaasLogin extends PaasKommand_1.PaasKommand {
11
11
  this.createKourouDir();
12
12
  const username = this.flags.username
13
13
  ? this.flags.username
14
- : await cli_ux_1.default.prompt(` Username`);
14
+ : (await inquirer_1.default.prompt([
15
+ { type: "input", name: "username", message: ` Username` },
16
+ ])).username;
17
+ // "password" echoes nothing, which is what cli-ux's { type: "hide" } did
15
18
  const password = process.env.KUZZLE_PAAS_PASSWORD
16
19
  ? process.env.KUZZLE_PAAS_PASSWORD
17
- : await cli_ux_1.default.prompt(` Password`, { type: "hide" });
20
+ : (await inquirer_1.default.prompt([
21
+ { type: "password", name: "password", message: ` Password` },
22
+ ])).password;
18
23
  if (this.flags.only_npm) {
19
24
  await this.authenticateNPM(username, password);
20
25
  return;
@@ -66,15 +71,15 @@ class PaasLogin extends PaasKommand_1.PaasKommand {
66
71
  }
67
72
  PaasLogin.description = "Login for a PaaS project";
68
73
  PaasLogin.flags = {
69
- help: command_1.flags.help(),
70
- project: command_1.flags.string({
74
+ help: core_1.Flags.help(),
75
+ project: core_1.Flags.string({
71
76
  description: "Current PaaS project",
72
77
  required: false,
73
78
  }),
74
- username: command_1.flags.string({
79
+ username: core_1.Flags.string({
75
80
  description: "PaaS username",
76
81
  }),
77
- only_npm: command_1.flags.boolean({
82
+ only_npm: core_1.Flags.boolean({
78
83
  description: "Only perform the login on the private NPM registry",
79
84
  required: false,
80
85
  default: false,
@@ -1,18 +1,17 @@
1
- import { flags } from "@oclif/command";
2
1
  import { Kommand } from "../../common";
3
2
  export default class ProfileExport extends Kommand {
4
3
  static description: string;
5
4
  static flags: {
6
- protocol: flags.IOptionFlag<string>;
7
- host: flags.IOptionFlag<string>;
8
- port: flags.IOptionFlag<string>;
9
- ssl: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
10
- username: flags.IOptionFlag<string>;
11
- password: flags.IOptionFlag<string | undefined>;
12
- as: flags.IOptionFlag<string | undefined>;
13
- "api-key": flags.IOptionFlag<string | undefined>;
14
- help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
15
- path: flags.IOptionFlag<string>;
5
+ protocol: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
6
+ host: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ port: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ ssl: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
+ username: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ password: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ as: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ "api-key": import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
14
+ path: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
16
15
  };
17
16
  runSafe(): Promise<void>;
18
17
  _dumpProfiles(): Promise<any>;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const fs_1 = tslib_1.__importDefault(require("fs"));
5
5
  const path_1 = tslib_1.__importDefault(require("path"));
6
- const command_1 = require("@oclif/command");
6
+ const core_1 = require("@oclif/core");
7
7
  const common_1 = require("../../common");
8
8
  const kuzzle_1 = require("../../support/kuzzle");
9
9
  class ProfileExport extends common_1.Kommand {
@@ -36,10 +36,10 @@ class ProfileExport extends common_1.Kommand {
36
36
  }
37
37
  }
38
38
  ProfileExport.description = "Exports profiles";
39
- ProfileExport.flags = Object.assign(Object.assign({ help: command_1.flags.help({}), path: command_1.flags.string({
39
+ ProfileExport.flags = Object.assign(Object.assign({ help: core_1.Flags.help({}), path: core_1.Flags.string({
40
40
  description: "Dump directory",
41
41
  default: "profiles",
42
- }) }, kuzzle_1.kuzzleFlags), { protocol: command_1.flags.string({
42
+ }) }, kuzzle_1.kuzzleFlags), { protocol: core_1.Flags.string({
43
43
  description: "Kuzzle protocol (http or websocket)",
44
44
  default: "ws",
45
45
  }) });
@@ -1,22 +1,19 @@
1
- import { flags } from "@oclif/command";
2
1
  import { Kommand } from "../../common";
3
2
  export default class ProfileImport extends Kommand {
4
3
  static description: string;
5
4
  static flags: {
6
- protocol: flags.IOptionFlag<string>;
7
- host: flags.IOptionFlag<string>;
8
- port: flags.IOptionFlag<string>;
9
- ssl: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
10
- username: flags.IOptionFlag<string>;
11
- password: flags.IOptionFlag<string | undefined>;
12
- as: flags.IOptionFlag<string | undefined>;
13
- "api-key": flags.IOptionFlag<string | undefined>;
14
- help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
5
+ protocol: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
6
+ host: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ port: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ ssl: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
+ username: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ password: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ as: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ "api-key": import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
15
14
  };
16
15
  static args: {
17
- name: string;
18
- description: string;
19
- required: boolean;
20
- }[];
16
+ path: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
17
+ };
21
18
  runSafe(): Promise<void>;
22
19
  }