wikibase-edit
Advanced tools
Comparing version
// Generated by scripts/postversion | ||
export const name = "wikibase-edit" | ||
export const version = "7.0.4" | ||
export const version = "7.1.0" | ||
export const homepage = "https://github.com/maxlath/wikibase-edit" | ||
export const issues = "https://github.com/maxlath/wikibase-edit/issues" | ||
import { isGuid, isEntityId, isPropertyId, getEntityIdFromGuid } from 'wikibase-sdk' | ||
import error_ from '../error.js' | ||
import { getEntityClaims } from '../get_entity.js' | ||
import formatClaimValue from './format_claim_value.js' | ||
import { findClaimByGuid } from './helpers.js' | ||
import { propertiesDatatypesDontMatch } from './move_commons.js' | ||
import { buildSnak } from './snak.js' | ||
export default async (params, config, API) => { | ||
const { guid, propertyClaimsId, id: targetEntityId, property: targetPropertyId, baserevid } = params | ||
const { guid, propertyClaimsId, id: targetEntityId, property: targetPropertyId, newValue, baserevid } = params | ||
const { instance } = config | ||
@@ -68,3 +71,8 @@ let originEntityId, originPropertyId | ||
delete claim.id | ||
claim.mainsnak.property = targetPropertyId | ||
if (newValue) { | ||
const value = formatClaimValue(propertyDatatype, newValue, instance) | ||
claim.mainsnak = buildSnak(targetPropertyId, propertyDatatype, value) | ||
} else { | ||
claim.mainsnak.property = targetPropertyId | ||
} | ||
}) | ||
@@ -71,0 +79,0 @@ |
{ | ||
"name": "wikibase-edit", | ||
"version": "7.0.4", | ||
"version": "7.1.0", | ||
"description": "Edit Wikibase from NodeJS", | ||
@@ -45,3 +45,3 @@ "type": "module", | ||
"oauth-1.0a": "^2.2.6", | ||
"wikibase-sdk": "^9.1.3" | ||
"wikibase-sdk": "^10.1.0" | ||
}, | ||
@@ -48,0 +48,0 @@ "devDependencies": { |
109009
0.3%2726
0.29%+ Added
- Removed
Updated