wikibase-sdk
Advanced tools
Comparing version 7.9.1 to 7.10.0
# CHANGELOG | ||
*versions follow [SemVer](http://semver.org)* | ||
## 7.10.0 - 2021-04-10 | ||
* Added [`cirrusSearchPages`](https://github.com/maxlath/wikidata-sdk/blob/master/docs/search_entities.md#cirrussearchpages) function | ||
## 7.9.0 - 2021-01-29 | ||
@@ -5,0 +8,0 @@ * [`getEntityIdFromGuid`](https://github.com/maxlath/wikidata-sdk/blob/master/docs/general_helpers.md#getentityidfromguid): added support for hyphenated GUIDs |
const { simplifyEntity } = require('./simplify_entity') | ||
module.exports = { | ||
wd: { | ||
entities: res => { | ||
res = res.body || res | ||
const { entities } = res | ||
Object.keys(entities).forEach(entityId => { | ||
entities[entityId] = simplifyEntity(entities[entityId]) | ||
}) | ||
return entities | ||
} | ||
const wb = { | ||
entities: res => { | ||
// Legacy convenience for the time the 'request' lib was all the rage | ||
res = res.body || res | ||
const { entities } = res | ||
Object.keys(entities).forEach(entityId => { | ||
entities[entityId] = simplifyEntity(entities[entityId]) | ||
}) | ||
return entities | ||
}, | ||
pagesTitles: res => { | ||
// Same behavior as above | ||
res = res.body || res | ||
return res.query.search.map(result => result.title) | ||
} | ||
} | ||
module.exports = { | ||
wb, | ||
// Legacy | ||
wd: wb | ||
} |
@@ -36,2 +36,3 @@ const { isPlainObject } = require('./utils/utils') | ||
searchEntities: require('./queries/search_entities')(buildUrl), | ||
cirrusSearchPages: require('./queries/cirrus_search')(buildUrl), | ||
getEntities: require('./queries/get_entities')(buildUrl), | ||
@@ -46,2 +47,3 @@ getManyEntities: require('./queries/get_many_entities')(buildUrl), | ||
searchEntities: missingInstance('searchEntities'), | ||
cirrusSearchPages: missingInstance('cirrusSearchPages'), | ||
getEntities: missingInstance('getEntities'), | ||
@@ -48,0 +50,0 @@ getManyEntities: missingInstance('getManyEntities'), |
{ | ||
"name": "wikibase-sdk", | ||
"version": "7.9.1", | ||
"version": "7.10.0", | ||
"description": "utils functions to query a Wikibase instance and simplify its results", | ||
@@ -5,0 +5,0 @@ "main": "lib/wikibase-sdk.js", |
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
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
75301
33
1199