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,18 +1,15 @@
1
- import { flags } from "@oclif/command";
2
1
  import { Kommand } from "../../../common";
3
2
  export default class EsInsert extends Kommand {
4
3
  static initSdk: boolean;
5
4
  static description: string;
6
5
  static flags: {
7
- body: flags.IOptionFlag<string>;
8
- id: flags.IOptionFlag<string | undefined>;
9
- node: flags.IOptionFlag<string>;
10
- help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
6
+ body: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ id: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ node: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
11
10
  };
12
11
  static args: {
13
- name: string;
14
- description: string;
15
- required: boolean;
16
- }[];
12
+ index: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
13
+ };
17
14
  runSafe(): Promise<void>;
18
15
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const command_1 = require("@oclif/command");
3
+ const core_1 = require("@oclif/core");
4
4
  const sdk_es7_1 = require("sdk-es7");
5
5
  const common_1 = require("../../../common");
6
6
  class EsInsert extends common_1.Kommand {
@@ -18,21 +18,21 @@ class EsInsert extends common_1.Kommand {
18
18
  EsInsert.initSdk = false;
19
19
  EsInsert.description = "Inserts a document directly into ES (will replace if exists)";
20
20
  EsInsert.flags = {
21
- body: command_1.flags.string({
21
+ body: core_1.Flags.string({
22
22
  description: "Document body in JSON",
23
23
  default: "{}",
24
24
  }),
25
- id: command_1.flags.string({
25
+ id: core_1.Flags.string({
26
26
  description: "Document ID",
27
27
  }),
28
- node: command_1.flags.string({
28
+ node: core_1.Flags.string({
29
29
  char: "n",
30
30
  description: "Elasticsearch server URL",
31
31
  default: "http://localhost:9200",
32
32
  }),
33
- help: command_1.flags.help(),
33
+ help: core_1.Flags.help(),
34
+ };
35
+ EsInsert.args = {
36
+ index: core_1.Args.string({ description: "ES Index name", required: true }),
34
37
  };
35
- EsInsert.args = [
36
- { name: "index", description: "ES Index name", required: true },
37
- ];
38
38
  exports.default = EsInsert;
@@ -1,20 +1,19 @@
1
- import { flags } from "@oclif/command";
2
1
  import { Kommand } from "../../common";
3
2
  export default class EsMigrate 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
- src: flags.IOptionFlag<string>;
9
- dest: flags.IOptionFlag<string>;
10
- reset: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
11
- "batch-size": import("@oclif/parser/lib/flags").IOptionFlag<number>;
12
- "no-interactive": import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
13
- "dry-run": import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
14
- pattern: flags.IOptionFlag<string | undefined>;
15
- scroll: flags.IOptionFlag<string>;
16
- "only-mappings": import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
17
- esVersion: flags.IOptionFlag<string>;
6
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
7
+ src: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ dest: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ reset: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
+ "batch-size": import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ "no-interactive": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
+ "dry-run": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
+ pattern: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
+ scroll: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
15
+ "only-mappings": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
16
+ esVersion: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
18
17
  };
19
18
  static examples: string[];
20
19
  private src;
@@ -1,13 +1,14 @@
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 path_1 = tslib_1.__importDefault(require("path"));
6
- const cli_ux_1 = tslib_1.__importDefault(require("cli-ux"));
7
6
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
7
+ const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
8
8
  const emoji_1 = require("../../support/emoji");
9
9
  const fs_1 = require("fs");
10
10
  const common_1 = require("../../common");
11
+ const progressBar_1 = require("../../support/progressBar");
11
12
  const providers_1 = require("../../support/migrate/providers");
12
13
  class EsMigrate extends common_1.Kommand {
13
14
  constructor() {
@@ -48,7 +49,7 @@ class EsMigrate extends common_1.Kommand {
48
49
  const scrollId = data.scrollId;
49
50
  const total = data.total;
50
51
  documents = data.documents;
51
- const progressBar = cli_ux_1.default.progress({
52
+ const progressBar = (0, progressBar_1.createProgressBar)({
52
53
  format: chalk_1.default.blue(" [*] Importing |{bar}| {percentage}% || {value}/{total} documents"),
53
54
  });
54
55
  if (total) {
@@ -88,7 +89,17 @@ class EsMigrate extends common_1.Kommand {
88
89
  if (this.flags.reset) {
89
90
  if (!this.flags["no-interactive"]) {
90
91
  this.log(chalk_1.default.red(`${emoji_1.emoji.fire} Are you sure you want to reset ${chalk_1.default.bold(this.flags.dest)}?`));
91
- await cli_ux_1.default.confirm(chalk_1.default.redBright(` ${emoji_1.emoji.fire} You will lose all the data stored in it (Type "yes" to confirm)`));
92
+ const { confirmation } = await inquirer_1.default.prompt([
93
+ {
94
+ type: "input",
95
+ name: "confirmation",
96
+ message: chalk_1.default.redBright(` ${emoji_1.emoji.fire} You will lose all the data stored in it (Type "yes" to confirm)`),
97
+ },
98
+ ]);
99
+ if (confirmation !== "yes") {
100
+ this.logKo("Aborted, nothing was cleared.");
101
+ return;
102
+ }
92
103
  }
93
104
  await this.dest.clear();
94
105
  }
@@ -108,45 +119,45 @@ class EsMigrate extends common_1.Kommand {
108
119
  EsMigrate.initSdk = false;
109
120
  EsMigrate.description = "Migrate all the index from an Elasticsearch (or a file) to another Elasticsearch";
110
121
  EsMigrate.flags = {
111
- help: command_1.flags.help(),
112
- src: command_1.flags.string({
122
+ help: core_1.Flags.help(),
123
+ src: core_1.Flags.string({
113
124
  description: "Migration source provider",
114
125
  env: "KUZZLE_MIGRATION_SRC",
115
126
  required: true,
116
127
  }),
117
- dest: command_1.flags.string({
128
+ dest: core_1.Flags.string({
118
129
  description: "Migration destination provider",
119
130
  env: "KUZZLE_MIGRATION_DEST",
120
131
  required: true,
121
132
  }),
122
- reset: command_1.flags.boolean({
133
+ reset: core_1.Flags.boolean({
123
134
  description: "Reset destination Elasticsearch server",
124
135
  default: false,
125
136
  }),
126
- "batch-size": command_1.flags.integer({
137
+ "batch-size": core_1.Flags.integer({
127
138
  description: "How many documents to move in batch per operation",
128
139
  default: 1000,
129
140
  }),
130
- "no-interactive": command_1.flags.boolean({
141
+ "no-interactive": core_1.Flags.boolean({
131
142
  description: "Skip confirmation interactive prompts (perfect for scripting)",
132
143
  default: false,
133
144
  }),
134
- "dry-run": command_1.flags.boolean({
145
+ "dry-run": core_1.Flags.boolean({
135
146
  description: "Print witch collections will be migrated",
136
147
  default: false,
137
148
  }),
138
- pattern: command_1.flags.string({
149
+ pattern: core_1.Flags.string({
139
150
  description: "Pattern to match indices to migrate",
140
151
  }),
141
- scroll: command_1.flags.string({
152
+ scroll: core_1.Flags.string({
142
153
  description: "Scroll duration for Elasticsearch scrolling",
143
154
  default: "30s",
144
155
  }),
145
- "only-mappings": command_1.flags.boolean({
156
+ "only-mappings": core_1.Flags.boolean({
146
157
  description: "Only migrate mappings",
147
158
  default: false,
148
159
  }),
149
- esVersion: command_1.flags.string({
160
+ esVersion: core_1.Flags.string({
150
161
  description: "Elasticsearch version to use for the migration",
151
162
  default: "7",
152
163
  options: ["7", "8"],
@@ -1,17 +1,15 @@
1
- import { flags } from "@oclif/command";
2
1
  import { Kommand } from "../../../common";
3
2
  export default class EsSnapshotsCreateRepository extends Kommand {
4
3
  static initSdk: boolean;
5
4
  static description: string;
6
5
  static flags: {
7
- compress: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
8
- node: flags.IOptionFlag<string>;
9
- help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
6
+ compress: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
+ node: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
10
9
  };
11
10
  static args: {
12
- name: string;
13
- description: string;
14
- required: boolean;
15
- }[];
11
+ repository: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
12
+ location: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
13
+ };
16
14
  runSafe(): Promise<void>;
17
15
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const command_1 = require("@oclif/command");
3
+ const core_1 = require("@oclif/core");
4
4
  const sdk_es7_1 = require("sdk-es7");
5
5
  const common_1 = require("../../../common");
6
6
  class EsSnapshotsCreateRepository extends common_1.Kommand {
@@ -24,23 +24,25 @@ class EsSnapshotsCreateRepository extends common_1.Kommand {
24
24
  EsSnapshotsCreateRepository.initSdk = false;
25
25
  EsSnapshotsCreateRepository.description = "Create a FS snapshot repository inside an ES instance";
26
26
  EsSnapshotsCreateRepository.flags = {
27
- compress: command_1.flags.boolean({
27
+ compress: core_1.Flags.boolean({
28
28
  description: "Compress data when storing them",
29
29
  default: false,
30
30
  }),
31
- node: command_1.flags.string({
31
+ node: core_1.Flags.string({
32
32
  char: "n",
33
33
  description: "Elasticsearch server URL",
34
34
  default: "http://localhost:9200",
35
35
  }),
36
- help: command_1.flags.help(),
36
+ help: core_1.Flags.help(),
37
37
  };
38
- EsSnapshotsCreateRepository.args = [
39
- { name: "repository", description: "ES repository name", required: true },
40
- {
41
- name: "location",
38
+ EsSnapshotsCreateRepository.args = {
39
+ repository: core_1.Args.string({
40
+ description: "ES repository name",
41
+ required: true,
42
+ }),
43
+ location: core_1.Args.string({
42
44
  description: "ES snapshot repository location",
43
45
  required: true,
44
- },
45
- ];
46
+ }),
47
+ };
46
48
  exports.default = EsSnapshotsCreateRepository;
@@ -1,17 +1,15 @@
1
- import { flags } from "@oclif/command";
2
1
  import { Kommand } from "../../../common";
3
2
  export default class EsSnapshotsCreate extends Kommand {
4
3
  static initSdk: boolean;
5
4
  static description: string;
6
5
  static flags: {
7
- node: flags.IOptionFlag<string>;
8
- wait: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
9
- help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
6
+ node: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ wait: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
10
9
  };
11
10
  static args: {
12
- name: string;
13
- description: string;
14
- required: boolean;
15
- }[];
11
+ repository: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
12
+ name: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
13
+ };
16
14
  runSafe(): Promise<void>;
17
15
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const command_1 = require("@oclif/command");
3
+ const core_1 = require("@oclif/core");
4
4
  const sdk_es7_1 = require("sdk-es7");
5
5
  const common_1 = require("../../../common");
6
6
  const SNAPSHOT_TIMEOUT = 30 * 60 * 1000;
@@ -29,20 +29,23 @@ class EsSnapshotsCreate extends common_1.Kommand {
29
29
  EsSnapshotsCreate.initSdk = false;
30
30
  EsSnapshotsCreate.description = "Create a snapshot repository inside an ES instance";
31
31
  EsSnapshotsCreate.flags = {
32
- node: command_1.flags.string({
32
+ node: core_1.Flags.string({
33
33
  char: "n",
34
34
  description: "Elasticsearch server URL",
35
35
  default: "http://localhost:9200",
36
36
  }),
37
- wait: command_1.flags.boolean({
37
+ wait: core_1.Flags.boolean({
38
38
  description: "Wait for the snapshot to complete before returning. Use --no-wait to return as soon as Elasticsearch has accepted the request",
39
39
  default: true,
40
40
  allowNo: true,
41
41
  }),
42
- help: command_1.flags.help(),
42
+ help: core_1.Flags.help(),
43
+ };
44
+ EsSnapshotsCreate.args = {
45
+ repository: core_1.Args.string({
46
+ description: "ES repository name",
47
+ required: true,
48
+ }),
49
+ name: core_1.Args.string({ description: "ES snapshot name", required: true }),
43
50
  };
44
- EsSnapshotsCreate.args = [
45
- { name: "repository", description: "ES repository name", required: true },
46
- { name: "name", description: "ES snapshot name", required: true },
47
- ];
48
51
  exports.default = EsSnapshotsCreate;
@@ -1,16 +1,13 @@
1
- import { flags } from "@oclif/command";
2
1
  import { Kommand } from "../../../common";
3
2
  export default class EsSnapshotsList extends Kommand {
4
3
  static initSdk: boolean;
5
4
  static description: string;
6
5
  static flags: {
7
- node: flags.IOptionFlag<string>;
8
- help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
6
+ node: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
9
8
  };
10
9
  static args: {
11
- name: string;
12
- description: string;
13
- required: boolean;
14
- }[];
10
+ repository: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
11
+ };
15
12
  runSafe(): Promise<void>;
16
13
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const command_1 = require("@oclif/command");
3
+ const core_1 = require("@oclif/core");
4
4
  const sdk_es7_1 = require("sdk-es7");
5
5
  const common_1 = require("../../../common");
6
6
  class EsSnapshotsList extends common_1.Kommand {
@@ -31,18 +31,17 @@ class EsSnapshotsList extends common_1.Kommand {
31
31
  EsSnapshotsList.initSdk = false;
32
32
  EsSnapshotsList.description = "List all snapshot from a repository acknowledge by an ES instance";
33
33
  EsSnapshotsList.flags = {
34
- node: command_1.flags.string({
34
+ node: core_1.Flags.string({
35
35
  char: "n",
36
36
  description: "Elasticsearch server URL",
37
37
  default: "http://localhost:9200",
38
38
  }),
39
- help: command_1.flags.help(),
39
+ help: core_1.Flags.help(),
40
40
  };
41
- EsSnapshotsList.args = [
42
- {
43
- name: "repository",
41
+ EsSnapshotsList.args = {
42
+ repository: core_1.Args.string({
44
43
  description: "Name of repository from which to fetch the snapshot information",
45
44
  required: true,
46
- },
47
- ];
45
+ }),
46
+ };
48
47
  exports.default = EsSnapshotsList;
@@ -1,17 +1,15 @@
1
- import { flags } from "@oclif/command";
2
1
  import { Kommand } from "../../../common";
3
2
  export default class EsSnapshotsRestore extends Kommand {
4
3
  static initSdk: boolean;
5
4
  static description: string;
6
5
  static flags: {
7
- node: flags.IOptionFlag<string>;
8
- wait: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
9
- help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
6
+ node: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ wait: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
10
9
  };
11
10
  static args: {
12
- name: string;
13
- description: string;
14
- required: boolean;
15
- }[];
11
+ repository: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
12
+ name: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
13
+ };
16
14
  runSafe(): Promise<void>;
17
15
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const command_1 = require("@oclif/command");
3
+ const core_1 = require("@oclif/core");
4
4
  const sdk_es7_1 = require("sdk-es7");
5
5
  const common_1 = require("../../../common");
6
6
  const RESTORE_TIMEOUT = 30 * 60 * 1000;
@@ -33,20 +33,23 @@ class EsSnapshotsRestore extends common_1.Kommand {
33
33
  EsSnapshotsRestore.initSdk = false;
34
34
  EsSnapshotsRestore.description = "Restore a snapshot repository inside an ES instance";
35
35
  EsSnapshotsRestore.flags = {
36
- node: command_1.flags.string({
36
+ node: core_1.Flags.string({
37
37
  char: "n",
38
38
  description: "Elasticsearch server URL",
39
39
  default: "http://localhost:9200",
40
40
  }),
41
- wait: command_1.flags.boolean({
41
+ wait: core_1.Flags.boolean({
42
42
  description: "Wait for the restore to complete before returning. Use --no-wait to return as soon as Elasticsearch has accepted the request",
43
43
  default: true,
44
44
  allowNo: true,
45
45
  }),
46
- help: command_1.flags.help(),
46
+ help: core_1.Flags.help(),
47
+ };
48
+ EsSnapshotsRestore.args = {
49
+ repository: core_1.Args.string({
50
+ description: "ES repository name",
51
+ required: true,
52
+ }),
53
+ name: core_1.Args.string({ description: "ES snapshot name", required: true }),
47
54
  };
48
- EsSnapshotsRestore.args = [
49
- { name: "repository", description: "ES repository name", required: true },
50
- { name: "name", description: "ES snapshot name", required: true },
51
- ];
52
55
  exports.default = EsSnapshotsRestore;
@@ -1,18 +1,15 @@
1
- import { flags } from "@oclif/command";
2
1
  import { Kommand } from "../../common";
3
2
  export declare class FileDecrypt extends Kommand {
4
3
  static initSdk: boolean;
5
4
  static description: string;
6
5
  static examples: string[];
7
6
  static flags: {
8
- force: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
9
- "output-file": flags.IOptionFlag<string | undefined>;
10
- "vault-key": flags.IOptionFlag<string | undefined>;
7
+ force: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
+ "output-file": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ "vault-key": import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
11
10
  };
12
11
  static args: {
13
- name: string;
14
- description: string;
15
- required: boolean;
16
- }[];
12
+ file: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
13
+ };
17
14
  runSafe(): Promise<void>;
18
15
  }
@@ -4,7 +4,7 @@ exports.FileDecrypt = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const fs_1 = tslib_1.__importDefault(require("fs"));
6
6
  const lodash_1 = tslib_1.__importDefault(require("lodash"));
7
- const command_1 = require("@oclif/command");
7
+ const core_1 = require("@oclif/core");
8
8
  const kuzzle_vault_1 = require("kuzzle-vault");
9
9
  const common_1 = require("../../common");
10
10
  class FileDecrypt extends common_1.Kommand {
@@ -46,19 +46,19 @@ FileDecrypt.examples = [
46
46
  "kourou file:decrypt books/cryptonomicon.txt.enc -o books/cryptonomicon.txt --vault-key <vault-key>",
47
47
  ];
48
48
  FileDecrypt.flags = {
49
- force: command_1.flags.boolean({
49
+ force: core_1.Flags.boolean({
50
50
  char: "f",
51
51
  description: "Overwrite the output file if it already exists",
52
52
  }),
53
- "output-file": command_1.flags.string({
53
+ "output-file": core_1.Flags.string({
54
54
  char: "o",
55
55
  description: 'Output file (default: remove ".enc")',
56
56
  }),
57
- "vault-key": command_1.flags.string({
57
+ "vault-key": core_1.Flags.string({
58
58
  description: "Kuzzle Vault Key (or KUZZLE_VAULT_KEY)",
59
59
  default: process.env.KUZZLE_VAULT_KEY,
60
60
  }),
61
61
  };
62
- FileDecrypt.args = [
63
- { name: "file", description: "Encrypted file", required: true },
64
- ];
62
+ FileDecrypt.args = {
63
+ file: core_1.Args.string({ description: "Encrypted file", required: true }),
64
+ };
@@ -1,18 +1,15 @@
1
- import { flags } from "@oclif/command";
2
1
  import { Kommand } from "../../common";
3
2
  export declare class VaultEncrypt extends Kommand {
4
3
  static initSdk: boolean;
5
4
  static description: string;
6
5
  static examples: string[];
7
6
  static flags: {
8
- force: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
9
- "output-file": flags.IOptionFlag<string | undefined>;
10
- "vault-key": flags.IOptionFlag<string | undefined>;
7
+ force: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
+ "output-file": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ "vault-key": import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
11
10
  };
12
11
  static args: {
13
- name: string;
14
- description: string;
15
- required: boolean;
16
- }[];
12
+ file: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
13
+ };
17
14
  runSafe(): Promise<void>;
18
15
  }
@@ -4,7 +4,7 @@ exports.VaultEncrypt = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const fs_1 = tslib_1.__importDefault(require("fs"));
6
6
  const lodash_1 = tslib_1.__importDefault(require("lodash"));
7
- const command_1 = require("@oclif/command");
7
+ const core_1 = require("@oclif/core");
8
8
  const kuzzle_vault_1 = require("kuzzle-vault");
9
9
  const common_1 = require("../../common");
10
10
  class VaultEncrypt extends common_1.Kommand {
@@ -46,17 +46,19 @@ VaultEncrypt.examples = [
46
46
  "kourou file:encrypt books/cryptonomicon.txt -o books/cryptonomicon.txt.enc --vault-key <vault-key>",
47
47
  ];
48
48
  VaultEncrypt.flags = {
49
- force: command_1.flags.boolean({
49
+ force: core_1.Flags.boolean({
50
50
  char: "f",
51
51
  description: "Overwrite the output file if it already exists",
52
52
  }),
53
- "output-file": command_1.flags.string({
53
+ "output-file": core_1.Flags.string({
54
54
  char: "o",
55
55
  description: "Output file (default: <filename>.enc)",
56
56
  }),
57
- "vault-key": command_1.flags.string({
57
+ "vault-key": core_1.Flags.string({
58
58
  description: "Kuzzle Vault Key (or KUZZLE_VAULT_KEY)",
59
59
  default: process.env.KUZZLE_VAULT_KEY,
60
60
  }),
61
61
  };
62
- VaultEncrypt.args = [{ name: "file", description: "Filename", required: true }];
62
+ VaultEncrypt.args = {
63
+ file: core_1.Args.string({ description: "Filename", required: true }),
64
+ };
@@ -1,16 +1,13 @@
1
- import { flags } from "@oclif/command";
2
1
  import { Kommand } from "../../common";
3
2
  export declare class FileTest extends Kommand {
4
3
  static initSdk: boolean;
5
4
  static description: string;
6
5
  static examples: string[];
7
6
  static flags: {
8
- "vault-key": flags.IOptionFlag<string | undefined>;
7
+ "vault-key": import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
9
8
  };
10
9
  static args: {
11
- name: string;
12
- description: string;
13
- required: boolean;
14
- }[];
10
+ file: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
11
+ };
15
12
  runSafe(): Promise<void>;
16
13
  }
@@ -4,7 +4,7 @@ exports.FileTest = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const fs_1 = tslib_1.__importDefault(require("fs"));
6
6
  const lodash_1 = tslib_1.__importDefault(require("lodash"));
7
- const command_1 = require("@oclif/command");
7
+ const core_1 = require("@oclif/core");
8
8
  const kuzzle_vault_1 = require("kuzzle-vault");
9
9
  const common_1 = require("../../common");
10
10
  class FileTest extends common_1.Kommand {
@@ -42,11 +42,11 @@ FileTest.examples = [
42
42
  "kourou file:test books/cryptonomicon.txt.enc --vault-key <vault-key>",
43
43
  ];
44
44
  FileTest.flags = {
45
- "vault-key": command_1.flags.string({
45
+ "vault-key": core_1.Flags.string({
46
46
  description: "Kuzzle Vault Key (or KUZZLE_VAULT_KEY)",
47
47
  default: process.env.KUZZLE_VAULT_KEY,
48
48
  }),
49
49
  };
50
- FileTest.args = [
51
- { name: "file", description: "Encrypted file", required: true },
52
- ];
50
+ FileTest.args = {
51
+ file: core_1.Args.string({ description: "Encrypted file", required: true }),
52
+ };