Implement ObjectStack kernel API specifications (P0/P1/P2)#380
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Added batch operations API (batch.zod.ts) for updateMany/deleteMany - Added metadata cache control with ETag support (cache.zod.ts) - Added standardized error codes (errors.zod.ts) - Added full-text search support to query.zod.ts - Added view storage API for UI configuration persistence (view-storage.zod.ts) - Added comprehensive test coverage for all new features - All tests passing (2164 tests) Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
|
This PR is very large. Consider breaking it into smaller PRs for easier review. |
There was a problem hiding this comment.
Pull request overview
This PR implements ObjectStack kernel API specifications to support ObjectUI requirements, focusing on batch operations, metadata caching, error standardization, full-text search, and view persistence.
Changes:
- Added batch operations API with atomic transaction support (max 200 records per batch)
- Implemented ETag-based metadata caching with conditional requests
- Standardized 50+ error codes with categorization and retry guidance
- Extended query schema with full-text search capabilities
- Added view storage API for persisting UI configurations
Reviewed changes
Copilot reviewed 62 out of 62 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/spec/src/data/query.zod.ts | Added full-text search schema to query AST |
| packages/spec/src/data/query.test.ts | Added 15 test cases for full-text search functionality |
| packages/spec/src/api/view-storage.zod.ts | Implemented view persistence schemas for list/kanban/calendar/chart views |
| packages/spec/src/api/index.ts | Exported new batch, cache, errors, and view-storage modules |
| packages/spec/src/api/errors.zod.ts | Added standardized error codes with HTTP status mapping |
| packages/spec/src/api/errors.test.ts | Added comprehensive error handling test suite |
| packages/spec/src/api/cache.zod.ts | Implemented ETag-based caching protocol |
| packages/spec/src/api/cache.test.ts | Added cache invalidation and conditional request tests |
| packages/spec/src/api/batch.zod.ts | Implemented batch operations with transaction support |
| packages/spec/src/api/batch.test.ts | Added batch operation validation tests |
| packages/spec/json-schema/* | Generated JSON schemas for new API types |
| content/docs/references/* | Added documentation for new system protocols (logging, metrics, tracing) |
| --- | ||
| title: Tracing | ||
| description: Tracing protocol schemas | ||
| --- |
There was a problem hiding this comment.
The new documentation files (tracing.mdx, metrics.mdx, logging.mdx) are added but lack examples or usage scenarios beyond the basic schema documentation. Consider adding practical examples showing how these protocols integrate with the batch operations, caching, and error handling features introduced in this PR to provide better context for developers.
- Add batch operations with BatchUpdateRequest/Response schemas - Add metadata caching with ETag support (getCached method) - Implement standardized error handling with error codes and categories - Add view storage API (create, list, update, delete, share views) - Re-export commonly used types from @objectstack/spec/api - Update method signatures to match new API contracts Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Implements batch operations, metadata caching, error standardization, full-text search, and view persistence APIs to support ObjectUI requirements.
Batch Operations (
batch.zod.ts)Added
updateMany/deleteManywith atomic transaction support:Max 200 records/batch. Partial success handling with per-record error details.
Metadata Cache Control (
cache.zod.ts)ETag-based conditional requests for metadata endpoints:
Selective invalidation by target type (object/field/permission/layout).
Error Standardization (
errors.zod.ts)50+ machine-readable error codes with categorization, HTTP status mapping, and retry guidance:
Full-Text Search (extended
query.zod.ts)Added
searchparameter with fuzzy matching, field boosting, and language analysis:View Persistence (
view-storage.zod.ts)Save/share UI configurations for list, kanban, calendar, chart views. Supports column layouts, filters, sorting, and per-user defaults.
Notes
$groupby,$aggregate) already supportedOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.