wikibase-cli 15.17.0 → 16.0.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
@@ -54,7 +54,7 @@ See [CHANGELOG.md](CHANGELOG.md) for version info
54
54
  ## Dependencies
55
55
 
56
56
  ### General
57
- * [NodeJs](https://nodejs.org) **>= v8** (recommended way to install it: use the awesome [NVM](https://github.com/creationix/nvm))
57
+ * [NodeJs](https://nodejs.org) **>= v10** (recommended way to install it: use the awesome [NVM](https://github.com/creationix/nvm) to install the latest LTS version `nvm install --lts`)
58
58
  * [Git](https://git-scm.com/)
59
59
 
60
60
  ### Per feature
package/bin/wb-add-claim CHANGED
@@ -7,4 +7,5 @@ const inlineArgsParser = ([ id, property, value ]) => {
7
7
  return [ data ]
8
8
  }
9
9
  program.customArgsParser = polymorphicCommandArgsParser(inlineArgsParser)
10
+ program.customHelpOption = require('../lib/command_with_template_custom_help')
10
11
  require('../lib/edit/edit_command')('claim', 'add')
package/bin/wb-search CHANGED
@@ -15,6 +15,7 @@ if (!(search && search.length > 0)) program.helpAndExit(0)
15
15
 
16
16
  let { lang: language, json, verbose, properties, limit, type, cirrus } = program
17
17
  limit = limit || 20
18
+ if (typeof limit === 'string') limit = parseInt(limit)
18
19
 
19
20
  if (properties) program.verbose = verbose = true
20
21
 
@@ -152,7 +152,7 @@ const runInBatch = (section, action, exitOnError) => {
152
152
  successes++
153
153
  } catch (err) {
154
154
  errors++
155
- if (exitOnError) throw err
155
+ if (exitOnError) logErrorAndExit(err)
156
156
  else if (err.code === 'EMPTY_PARAMS') console.error('produced an empty parameters object: passing')
157
157
  else console.error(`error triggered by line: "${line}":`, err)
158
158
  }
@@ -175,6 +175,10 @@ const randomKey = () => Math.random().toString(16).slice(2)
175
175
  const logErrorAndExit = err => {
176
176
  if (err.statusCode === 400) {
177
177
  console.error(red(err.message), err.context)
178
+ } else if (err.body && err.body.error && err.body.error.messages) {
179
+ err.body.error.messages.forEach(message => {
180
+ console.error(`${red(message.name)}\n${JSON.stringify(message, null, 2)}`)
181
+ })
178
182
  } else {
179
183
  // util.inspect doc: https://nodejs.org/api/util.html#util_util_inspect_object_options
180
184
  console.error(inspect(err, { depth: null, maxArrayLength: null }))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wikibase-cli",
3
- "version": "15.17.0",
3
+ "version": "16.0.2",
4
4
  "description": "A command-line interface to Wikibase",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -50,8 +50,8 @@
50
50
  "shell-quote": "^1.7.3",
51
51
  "split": "^1.0.1",
52
52
  "through": "^2.3.8",
53
- "wikibase-edit": "^4.16.1",
54
- "wikibase-sdk": "^7.15.0",
53
+ "wikibase-edit": "^5.0.3",
54
+ "wikibase-sdk": "^8.0.0",
55
55
  "wikidata-lang": "^2.0.11"
56
56
  },
57
57
  "devDependencies": {
@@ -67,6 +67,6 @@
67
67
  "should": "^13.2.3"
68
68
  },
69
69
  "engines": {
70
- "node": ">= 7.6.0"
70
+ "node": ">= 10.0.0"
71
71
  }
72
72
  }