Discovery
Discovery protocol schemas
Service Status in Discovery Response
Reports per-service availability so clients can adapt their UI accordingly.
Source: packages/spec/src/api/discovery.zod.ts
TypeScript Usage
import { ApiRoutes, Discovery, ServiceInfo, WellKnownCapabilities } from '@objectstack/spec/api';
import type { ApiRoutes, Discovery, ServiceInfo, WellKnownCapabilities } from '@objectstack/spec/api';
// Validate data
const result = ApiRoutes.parse(data);ApiRoutes
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| data | string | ✅ | e.g. /api/v1/data |
| metadata | string | ✅ | e.g. /api/v1/meta |
| ui | string | optional | e.g. /api/v1/ui |
| auth | string | optional | e.g. /api/v1/auth |
| automation | string | optional | e.g. /api/v1/automation |
| storage | string | optional | e.g. /api/v1/storage |
| analytics | string | optional | e.g. /api/v1/analytics |
| graphql | string | optional | e.g. /graphql |
| packages | string | optional | e.g. /api/v1/packages |
| workflow | string | optional | e.g. /api/v1/workflow |
| realtime | string | optional | e.g. /api/v1/realtime |
| notifications | string | optional | e.g. /api/v1/notifications |
| ai | string | optional | e.g. /api/v1/ai |
| i18n | string | optional | e.g. /api/v1/i18n |
Discovery
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| name | string | ✅ | |
| version | string | ✅ | |
| environment | Enum<'production' | 'sandbox' | 'development'> | ✅ | |
| routes | Object | ✅ | |
| locale | Object | ✅ | |
| services | Record<string, Object> | ✅ | Per-service availability map keyed by CoreServiceName |
| capabilities | Record<string, Object> | optional | Hierarchical capability descriptors for frontend intelligent adaptation |
| schemaDiscovery | Object | optional | Schema discovery endpoints for API toolchain integration |
| metadata | Record<string, any> | optional | Custom metadata key-value pairs for extensibility |
ServiceInfo
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| enabled | boolean | ✅ | |
| status | Enum<'available' | 'unavailable' | 'degraded' | 'stub'> | ✅ | available = fully operational, unavailable = not installed, degraded = partial, stub = placeholder that throws |
| route | string | optional | e.g. /api/v1/analytics |
| provider | string | optional | e.g. "objectql", "plugin-redis", "driver-memory" |
| version | string | optional | Semantic version of the service implementation (e.g. "3.0.6") |
| message | string | optional | e.g. "Install plugin-workflow to enable" |
| rateLimit | Object | optional | Rate limit and quota info for this service |
WellKnownCapabilities
Well-known capability flags for frontend intelligent adaptation
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| feed | boolean | ✅ | Whether the backend supports Feed / Chatter API |
| comments | boolean | ✅ | Whether the backend supports comments (a subset of Feed) |
| automation | boolean | ✅ | Whether the backend supports Automation CRUD (flows, triggers) |
| cron | boolean | ✅ | Whether the backend supports cron scheduling |
| search | boolean | ✅ | Whether the backend supports full-text search |
| export | boolean | ✅ | Whether the backend supports async export |
| chunkedUpload | boolean | ✅ | Whether the backend supports chunked (multipart) uploads |