Skip to content

Align client with spec API protocol and add metadata discovery methods#488

Merged
xuyushun441-sys merged 4 commits into
mainfrom
copilot/update-client-according-to-spec
Feb 2, 2026
Merged

Align client with spec API protocol and add metadata discovery methods#488
xuyushun441-sys merged 4 commits into
mainfrom
copilot/update-client-according-to-spec

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 2, 2026

Client's discovery interface used custom routes object incompatible with spec's GetDiscoveryResponseSchema. Missing metadata discovery methods exposed by server.

Changes

Discovery interface alignment

  • Replace custom DiscoveryResult.routes with spec-compliant version, apiName, capabilities, endpoints
  • Use GetDiscoveryResponse type from @objectstack/spec/api
  • Remove dynamic route resolution; client now uses conventional paths (/api/v1/data, /api/v1/meta, /api/v1/ui)

Metadata discovery methods

  • Add meta.getTypes() - list available metadata types
  • Add meta.getItems(type) - list items of specific type
  • Add meta.getItem(type, name) - get specific metadata item
  • Deprecate meta.getObject() in favor of getItem('object', name)

Type exports

  • Export GetDiscoveryResponse, GetMetaTypesResponse, GetMetaItemsResponse from spec

Before/After

// Before: Custom discovery format
const discovery = await client.connect();
// { routes: { data: '/api/v1/data', ... }, capabilities: { ... } }

// After: Spec-compliant format
const discovery = await client.connect();
// { version: 'v1', apiName: 'ObjectStack', capabilities: [...] }

// New: Metadata discovery
const types = await client.meta.getTypes();        // { types: ['object', 'plugin', ...] }
const items = await client.meta.getItems('object'); // { type: 'object', items: [...] }
const item = await client.meta.getItem('object', 'customer'); // object definition
Original prompt

按照最新的plugin-hono-server改动和spec api规范,调整 @objectstack/client


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Canceled Canceled Feb 2, 2026 9:36am

Request Review

Copilot AI and others added 3 commits February 2, 2026 08:55
Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
Copilot AI changed the title [WIP] Adjust client to align with latest plugin-hono-server and spec API changes Align client with spec API protocol and add metadata discovery methods Feb 2, 2026
Copilot AI requested a review from xuyushun441-sys February 2, 2026 09:02
@xuyushun441-sys xuyushun441-sys marked this pull request as ready for review February 2, 2026 09:04
@xuyushun441-sys xuyushun441-sys merged commit e852964 into main Feb 2, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants