Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

wikibase-sdk

Package Overview
Dependencies
Maintainers
0
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wikibase-sdk - npm Package Compare versions

Comparing version 10.0.3 to 10.1.0

3

CHANGELOG.md
# CHANGELOG
*versions follow [SemVer](http://semver.org)*
## 10.1.0 - 2024-08-04
- * [`simplify.claims`](https://github.com/maxlath/wikibase-sdk/blob/main/docs/simplify_claims.md): add support for `entity-schema` snak values
## 10.0.0 - 2024-03-14

@@ -5,0 +8,0 @@ **BREAKING CHANGES**:

2

dist/src/helpers/helpers.d.ts

@@ -12,3 +12,3 @@ import type { EntityId, EntityPageTitle, Guid, GuidAltSyntax, NonNestedEntityId, NumericId, PropertyClaimsId } from '../types/entity.js';

export declare const isMediaInfoId: (id: string) => id is `M${number}`;
export declare const isGuid: (id: string) => id is `Q${number}$${string}` | `P${number}$${string}` | `L${number}$${string}` | `M${number}$${string}` | `L${number}-F${number}$${string}` | `L${number}-S${number}$${string}` | `q${Lowercase<`${number}`>}$${string}` | `p${Lowercase<`${number}`>}$${string}` | `l${Lowercase<`${number}`>}$${string}` | `m${Lowercase<`${number}`>}$${string}` | `l${Lowercase<`${number}`>}-f${Lowercase<`${number}`>}$${string}` | `l${Lowercase<`${number}`>}-s${Lowercase<`${number}`>}$${string}`;
export declare const isGuid: (id: string) => id is `L${number}-F${number}$${string}` | `L${number}-S${number}$${string}` | `Q${number}$${string}` | `L${number}$${string}` | `P${number}$${string}` | `E${number}$${string}` | `M${number}$${string}` | `l${Lowercase<`${number}`>}-f${Lowercase<`${number}`>}$${string}` | `l${Lowercase<`${number}`>}-s${Lowercase<`${number}`>}$${string}` | `q${Lowercase<`${number}`>}$${string}` | `l${Lowercase<`${number}`>}$${string}` | `p${Lowercase<`${number}`>}$${string}` | `e${Lowercase<`${number}`>}$${string}` | `m${Lowercase<`${number}`>}$${string}`;
export declare const isHash: (id: string) => id is string;

@@ -15,0 +15,0 @@ export declare const isRevisionId: (id: string) => id is `${number}`;

import type { TimeInputValue } from './time.js';
import type { SimplifySnakOptions } from '../types/simplify_claims.js';
import type { CommonsMediaSnakDataValue, ExternalIdSnakDataValue, GeoShapeSnakDataValue, GlobeCoordinateSnakDataValue, MathSnakDataValue, MonolingualTextSnakDataValue, QuantitySnakDataValue, StringSnakDataValue, TimeSnakDataValue, WikibaseEntityIdSnakDataValue, MusicalNotationSnakDataValue, TabularDataSnakDataValue, UrlSnakDataValue, WikibaseFormSnakDataValue, WikibaseItemSnakDataValue, WikibaseLexemeSnakDataValue, WikibasePropertySnakDataValue, WikibaseSenseSnakDataValue } from '../types/snakvalue.js';
import type { CommonsMediaSnakDataValue, ExternalIdSnakDataValue, GeoShapeSnakDataValue, GlobeCoordinateSnakDataValue, MathSnakDataValue, MonolingualTextSnakDataValue, QuantitySnakDataValue, StringSnakDataValue, TimeSnakDataValue, WikibaseEntityIdSnakDataValue, MusicalNotationSnakDataValue, TabularDataSnakDataValue, UrlSnakDataValue, WikibaseFormSnakDataValue, WikibaseItemSnakDataValue, WikibaseLexemeSnakDataValue, WikibasePropertySnakDataValue, WikibaseSenseSnakDataValue, EntitySchemaSnakDataValue } from '../types/snakvalue.js';
declare function stringValue(datavalue: StringSnakDataValue): string;

@@ -60,2 +60,3 @@ declare function monolingualtext(datavalue: MonolingualTextSnakDataValue, options: {

'external-id': ExternalIdSnakDataValue;
'entity-schema': EntitySchemaSnakDataValue;
'geo-shape': GeoShapeSnakDataValue;

@@ -80,2 +81,3 @@ 'globe-coordinate': GlobeCoordinateSnakDataValue;

readonly 'external-id': typeof stringValue;
readonly 'entity-schema': typeof entity;
readonly 'geo-shape': typeof stringValue;

@@ -82,0 +84,0 @@ readonly 'globe-coordinate': typeof coordinate;

@@ -24,2 +24,3 @@ import { wikibaseTimeToEpochTime, wikibaseTimeToISOString, wikibaseTimeToSimpleDay } from './time.js';

item: 'Q',
'entity-schema': 'E',
lexeme: 'L',

@@ -91,2 +92,3 @@ property: 'P',

'external-id': stringValue,
'entity-schema': entity,
'geo-shape': stringValue,

@@ -93,0 +95,0 @@ 'globe-coordinate': coordinate,

@@ -6,3 +6,3 @@ import type { Claims, DataType } from './claim.js';

import type { Aliases, Descriptions, Labels, Lemmas, SimplifiedAliases, SimplifiedDescriptions, SimplifiedLabels, SimplifiedLemmas } from './terms.js';
export declare const EntityTypes: readonly ["item", "property", "lexeme", "form", "sense"];
export declare const EntityTypes: readonly ["item", "property", "lexeme", "form", "sense", "entity-schema"];
export type EntityType = typeof EntityTypes[number];

@@ -20,4 +20,12 @@ export type NumericId = `${number}`;

export type EntityId = NonNestedEntityId | FormId | SenseId;
export type NonNestedEntityId = ItemId | PropertyId | LexemeId | MediaInfoId;
export type NamespacedEntityId = `Item:${ItemId}` | `Lexeme:${LexemeId}` | `Property:${PropertyId}`;
export type NonNestedEntityId = ItemId | PropertyId | LexemeId | MediaInfoId | EntitySchemaId;
export type NamespacedEntityId = `Item:${ItemId}` | `Lexeme:${LexemeId}` | `Property:${PropertyId}` | `EntitySchema:${EntitySchemaId}`;
export interface IdByEntityType {
'form': FormId;
'item': ItemId;
'lexeme': LexemeId;
'property': PropertyId;
'sense': SenseId;
'entity-schema': EntitySchemaId;
}
export type Guid = `${EntityId | Lowercase<EntityId>}$${string}`;

@@ -24,0 +32,0 @@ /**

@@ -1,2 +0,9 @@

export const EntityTypes = ['item', 'property', 'lexeme', 'form', 'sense'];
export const EntityTypes = [
'item',
'property',
'lexeme',
'form',
'sense',
'entity-schema',
];
//# sourceMappingURL=entity.js.map

@@ -1,2 +0,2 @@

import type { EntityId, EntityType } from './entity.js';
import type { EntityType, IdByEntityType } from './entity.js';
import type { LanguageCode } from './options.js';

@@ -51,15 +51,17 @@ export interface GlobeCoordinateSnakDataValue {

}
export interface WikibaseEntityIdSnakDataValue {
export interface GenericWikibaseEntityIdSnakDataValue<T extends EntityType> {
type: 'wikibase-entityid';
value: {
id: EntityId;
id: IdByEntityType[T];
'numeric-id'?: number;
'entity-type': EntityType;
'entity-type': T;
};
}
export type WikibaseFormSnakDataValue = WikibaseEntityIdSnakDataValue;
export type WikibaseItemSnakDataValue = WikibaseEntityIdSnakDataValue;
export type WikibaseLexemeSnakDataValue = WikibaseEntityIdSnakDataValue;
export type WikibasePropertySnakDataValue = WikibaseEntityIdSnakDataValue;
export type WikibaseSenseSnakDataValue = WikibaseEntityIdSnakDataValue;
export type WikibaseFormSnakDataValue = GenericWikibaseEntityIdSnakDataValue<'form'>;
export type WikibaseItemSnakDataValue = GenericWikibaseEntityIdSnakDataValue<'item'>;
export type WikibaseLexemeSnakDataValue = GenericWikibaseEntityIdSnakDataValue<'lexeme'>;
export type WikibasePropertySnakDataValue = GenericWikibaseEntityIdSnakDataValue<'property'>;
export type WikibaseSenseSnakDataValue = GenericWikibaseEntityIdSnakDataValue<'sense'>;
export type EntitySchemaSnakDataValue = GenericWikibaseEntityIdSnakDataValue<'entity-schema'>;
export type WikibaseEntityIdSnakDataValue = WikibaseFormSnakDataValue | WikibaseItemSnakDataValue | WikibaseLexemeSnakDataValue | WikibasePropertySnakDataValue | WikibaseSenseSnakDataValue | EntitySchemaSnakDataValue;
export type SnakDataValue = GlobeCoordinateSnakDataValue | MonolingualTextSnakDataValue | QuantitySnakDataValue | StringSnakDataValue | TimeSnakDataValue | WikibaseEntityIdSnakDataValue;

@@ -66,0 +68,0 @@ /** @deprecated use SnakDataValue */

@@ -44,3 +44,3 @@ import * as helpers from './helpers/helpers.js';

readonly isMediaInfoId: (id: string) => id is `M${number}`;
readonly isGuid: (id: string) => id is `Q${number}$${string}` | `P${number}$${string}` | `L${number}$${string}` | `M${number}$${string}` | `L${number}-F${number}$${string}` | `L${number}-S${number}$${string}` | `q${Lowercase<`${number}`>}$${string}` | `p${Lowercase<`${number}`>}$${string}` | `l${Lowercase<`${number}`>}$${string}` | `m${Lowercase<`${number}`>}$${string}` | `l${Lowercase<`${number}`>}-f${Lowercase<`${number}`>}$${string}` | `l${Lowercase<`${number}`>}-s${Lowercase<`${number}`>}$${string}`;
readonly isGuid: (id: string) => id is `L${number}-F${number}$${string}` | `L${number}-S${number}$${string}` | `Q${number}$${string}` | `L${number}$${string}` | `P${number}$${string}` | `E${number}$${string}` | `M${number}$${string}` | `l${Lowercase<`${number}`>}-f${Lowercase<`${number}`>}$${string}` | `l${Lowercase<`${number}`>}-s${Lowercase<`${number}`>}$${string}` | `q${Lowercase<`${number}`>}$${string}` | `l${Lowercase<`${number}`>}$${string}` | `p${Lowercase<`${number}`>}$${string}` | `e${Lowercase<`${number}`>}$${string}` | `m${Lowercase<`${number}`>}$${string}`;
readonly isHash: (id: string) => id is string;

@@ -47,0 +47,0 @@ readonly isRevisionId: (id: string) => id is `${number}`;

{
"name": "wikibase-sdk",
"version": "10.0.3",
"version": "10.1.0",
"type": "module",

@@ -5,0 +5,0 @@ "description": "utils functions to query a Wikibase instance and simplify its results",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc