Skip to content

chore: remove wikibase-rest-api integration#153

Merged
DaxServer merged 1 commit intomainfrom
wikibase-restapi
Sep 7, 2025
Merged

chore: remove wikibase-rest-api integration#153
DaxServer merged 1 commit intomainfrom
wikibase-restapi

Conversation

@DaxServer
Copy link
Owner

No description provided.

@coderabbitai
Copy link

coderabbitai bot commented Sep 7, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Property search responses now include relevance scores, optional usage stats, and search metadata.
  • Refactor
    • Simplified ID handling for item/property endpoints; removed strict regex checks in favor of typed parameters.
    • Adjusted client handling for the “wikidata” instance to improve reliability.
  • Documentation
    • Removed internal Wikibase REST API integration design, requirements, and task planning documents.
  • Chores
    • Removed the Wikibase REST API dependency and related type declarations.
  • Tests
    • Removed tests tied to the deprecated Wikibase API service.

Walkthrough

Removes Wikibase REST API integration (service, types, tests, dependency, and specs). API routes and schemas switch from regex string IDs to typed ItemId/PropertyId and adjust responses. NodemwWikibaseService getClient adds a special-case path for the 'wikidata' instance. Connectivity checks are removed from the config service. Core API types adopt typed IDs.

Changes

Cohort / File(s) Summary
Specs removal
.kiro/specs/wikibase-rest-api-integration/*
Deleted design.md, requirements.md, tasks.md documentation for the prior REST-based Wikibase integration.
Dependency and ambient types removal
backend/package.json, backend/src/types/wikibase-rest-api.d.ts
Removed @wmde/wikibase-rest-api dependency and its ambient type declarations (ApiClient, PropertiesApi, ItemsApi, search APIs).
Service removal and tests
backend/src/services/wikibase-api.service.ts, backend/tests/services/wikibase-api.service.test.ts
Deleted WikibaseApiService (client mgmt, REST operations, constraints parsing) and its unit tests.
Routes: entities
backend/src/api/wikibase/entities.ts
Dropped regex validation for P/Q IDs; removed type-only ID casts; pass IDs directly to wikibase.getProperty/getItem; removed type-only imports.
Routes: instances
backend/src/api/wikibase/instances.ts
Switched route params to typed PropertyId/ItemId; removed regex checks; pass IDs directly; property search response adds relevanceScore, optional usageStats, and searchMetadata; ItemId/PropertyId imported as values.
Schemas typing
backend/src/api/wikibase/schemas.ts
Replaced string-with-pattern schemas for IDs with typed ItemId/PropertyId across property/item detail, constraints, and validation schemas.
Config service connectivity removal
backend/src/services/wikibase-config.service.ts
Removed connectivity/health-check methods and helpers; validation now static (no runtime API checks).
Nodemw service client selection
backend/src/services/nodemw-wikibase.service.ts
getClient adds early return for instanceId === 'wikidata' delegating to getWikidataClient; otherwise uses existing clients map.
Public API types
backend/src/types/wikibase-api.ts
PropertyDetails.id, PropertySearchResult.id, ItemDetails.id changed from string to PropertyId/ItemId; added corresponding imports.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant FE as Client
  participant API as Backend Routes
  participant WB as Wikibase Service
  participant WD as Wikidata Client (special-case)
  participant GI as Generic Instance Client

  FE->>API: GET /:instanceId/properties/:propertyId
  API->>WB: getProperty(instanceId, propertyId)
  alt instanceId == "wikidata"
    WB->>WD: getClient("wikidata")
    WD-->>WB: client
  else other instance
    WB->>GI: getClient(instanceId)
    GI-->>WB: client
  end
  WB-->>API: PropertyDetails (typed PropertyId)
  API-->>FE: 200 OK (typed IDs)

  note over API,FE: ID params validated via typed ItemId/PropertyId (no regex)

  FE->>API: GET /:instanceId/properties/search?q=...
  API->>WB: searchProperties(...)
  WB-->>API: results
  API-->>FE: results + relevanceScore, usageStats?, searchMetadata
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3891213 and 59f1d33.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (13)
  • .kiro/specs/wikibase-rest-api-integration/design.md (0 hunks)
  • .kiro/specs/wikibase-rest-api-integration/requirements.md (0 hunks)
  • .kiro/specs/wikibase-rest-api-integration/tasks.md (0 hunks)
  • backend/package.json (0 hunks)
  • backend/src/api/wikibase/entities.ts (2 hunks)
  • backend/src/api/wikibase/instances.ts (9 hunks)
  • backend/src/api/wikibase/schemas.ts (8 hunks)
  • backend/src/services/nodemw-wikibase.service.ts (1 hunks)
  • backend/src/services/wikibase-api.service.ts (0 hunks)
  • backend/src/services/wikibase-config.service.ts (0 hunks)
  • backend/src/types/wikibase-api.ts (4 hunks)
  • backend/src/types/wikibase-rest-api.d.ts (0 hunks)
  • backend/tests/services/wikibase-api.service.test.ts (0 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch wikibase-restapi

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@DaxServer DaxServer merged commit 61a7781 into main Sep 7, 2025
5 of 6 checks passed
@DaxServer DaxServer deleted the wikibase-restapi branch September 7, 2025 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant