kourou 1.5.0 → 1.5.1-dev.2

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.
package/README.md CHANGED
@@ -27,7 +27,7 @@ $ npm install -g kourou
27
27
  $ kourou COMMAND
28
28
  running command...
29
29
  $ kourou (--version)
30
- kourou/1.5.0 linux-x64 node-v24.20.0
30
+ kourou/1.5.1-dev.2 linux-x64 node-v24.21.0
31
31
  $ kourou --help [COMMAND]
32
32
  USAGE
33
33
  $ kourou COMMAND
@@ -387,6 +387,10 @@ FLAGS
387
387
 
388
388
  DESCRIPTION
389
389
  Scaffolds a new Kuzzle application
390
+
391
+ Template repositories are private: this command is reserved to Kuzzle customers
392
+ and members of the kuzzleio GitHub organization. It requires GitHub credentials
393
+ allowed to read the template repositories (see --token).
390
394
  ```
391
395
 
392
396
  _See code: [src/commands/app/scaffold.ts](src/commands/app/scaffold.ts)_
@@ -137,9 +137,11 @@ class AppScaffold extends common_1.Kommand {
137
137
  }
138
138
  }
139
139
  throw new Error(`Unable to clone the template repository "kuzzleio/${repo}". ` +
140
- "If this repository is private, provide credentials with the --token flag, " +
141
- "the GITHUB_TOKEN environment variable, the GitHub CLI (gh auth login) " +
142
- `or a SSH key allowed to read it.\n${this.hideToken((lastError === null || lastError === void 0 ? void 0 : lastError.message) || "")}`);
140
+ "Template repositories are private and reserved to Kuzzle customers and " +
141
+ "members of the kuzzleio GitHub organization. Provide credentials allowed " +
142
+ "to read it with the --token flag, the GITHUB_TOKEN environment variable, " +
143
+ "the GitHub CLI (gh auth login) or a SSH key. " +
144
+ `If you need access, contact Kuzzle support.\n${this.hideToken((lastError === null || lastError === void 0 ? void 0 : lastError.message) || "")}`);
143
145
  }
144
146
  async copyTemplate(destination) {
145
147
  // -R (and not -r) so symlinks contained in the template are copied as
@@ -153,7 +155,11 @@ class AppScaffold extends common_1.Kommand {
153
155
  }
154
156
  }
155
157
  AppScaffold.initSdk = false;
156
- AppScaffold.description = "Scaffolds a new Kuzzle application";
158
+ AppScaffold.description = `Scaffolds a new Kuzzle application
159
+
160
+ Template repositories are private: this command is reserved to Kuzzle customers
161
+ and members of the kuzzleio GitHub organization. It requires GitHub credentials
162
+ allowed to read the template repositories (see --token).`;
157
163
  AppScaffold.flags = {
158
164
  help: core_1.Flags.help(),
159
165
  flavor: core_1.Flags.string({
package/lib/common.js CHANGED
@@ -111,13 +111,23 @@ class Kommand extends core_1.Command {
111
111
  const esDetails = esBody
112
112
  ? `\n\nElasticsearch response: ${JSON.stringify(esBody)}`
113
113
  : "";
114
- this.logKo(`Error stack: \n${stack || error.message}${esDetails}\n\nError status: ${(_d = (_c = error.status) !== null && _c !== void 0 ? _c : error.statusCode) !== null && _d !== void 0 ? _d : (_e = error.meta) === null || _e === void 0 ? void 0 : _e.statusCode}\n\nError id: ${error.id}${errorLink}`);
114
+ const status = (_d = (_c = error.status) !== null && _c !== void 0 ? _c : error.statusCode) !== null && _d !== void 0 ? _d : (_e = error.meta) === null || _e === void 0 ? void 0 : _e.statusCode;
115
+ // Status and id only exist on Kuzzle and Elasticsearch errors, don't
116
+ // display them for other errors
117
+ let message = `Error stack: \n${stack || error.message}${esDetails}`;
118
+ if (status !== undefined) {
119
+ message += `\n\nError status: ${status}`;
120
+ }
121
+ if (error.id !== undefined) {
122
+ message += `\n\nError id: ${error.id}${errorLink}`;
123
+ }
124
+ this.logKo(message);
115
125
  if (Array.isArray(error.errors)) {
116
126
  for (const e of error.errors) {
117
127
  this.logKo(`${e.document._id} : ${e.reason}`);
118
128
  }
119
129
  }
120
- else {
130
+ else if (error.reason !== undefined) {
121
131
  this.logKo(JSON.stringify(error.reason));
122
132
  }
123
133
  err = true;
@@ -62,6 +62,9 @@ class Elasticsearch7 {
62
62
  return specifications;
63
63
  }
64
64
  async createIndex(index, specifications) {
65
+ var _a;
66
+ specifications = specifications !== null && specifications !== void 0 ? specifications : {};
67
+ specifications.settings = (_a = specifications.settings) !== null && _a !== void 0 ? _a : {};
65
68
  specifications.settings.write = {
66
69
  wait_for_active_shards: 1, // Wait for at least one shard to be active before returning
67
70
  };
@@ -63,6 +63,9 @@ class Elasticsearch8 {
63
63
  return specifications;
64
64
  }
65
65
  async createIndex(index, specifications) {
66
+ var _a;
67
+ specifications = specifications !== null && specifications !== void 0 ? specifications : {};
68
+ specifications.settings = (_a = specifications.settings) !== null && _a !== void 0 ? _a : {};
66
69
  specifications.settings.write = {
67
70
  wait_for_active_shards: 1, // Wait for at least one shard to be active before returning
68
71
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kourou",
3
3
  "description": "The CLI that helps you manage your Kuzzle instances",
4
- "version": "1.5.0",
4
+ "version": "1.5.1-dev.2",
5
5
  "author": "The Kuzzle Team <support@kuzzle.io>",
6
6
  "bin": {
7
7
  "kourou": "./bin/run"