-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
The @objectstack/client currently implements ~51% of the spec-defined protocol (26/51 methods across 7/14 domains). This issue tracks completing the remaining API surface to achieve full spec compliance.
Current Coverage
✅ Fully Implemented (7 domains)
- Discovery —
connect()with well-known fallback - Metadata —
meta.getTypes/getItems/getItem/saveItem/getCached/getView - Data CRUD —
data.find/get/create/update/delete - Batch —
data.batch/createMany/updateMany/deleteMany - Storage —
storage.upload/getDownloadUrl - Analytics —
analytics.query/meta/explain - Packages —
packages.list/get/install/uninstall/enable/disable
❌ Missing Domains (5 domains, ~25 methods)
Tasks
P0 — Critical
-
Permissions namespace (
client.permissions.*)checkPermission({ object, action, recordId?, field? })→GET /permissions/checkgetObjectPermissions({ object })→GET /permissions/objects/:objectgetEffectivePermissions()→GET /permissions/effective- Reference:
ObjectStackProtocolinpackages/spec/src/api/protocol.zod.ts
-
Realtime namespace (
client.realtime.*)connect({ transport?, channels?, token? })— WebSocket/SSE connectiondisconnect()subscribe({ channel, events?, filter? })→ returns subscriptionIdunsubscribe({ subscriptionId })setPresence({ channel, state })getPresence({ channel })- Reference:
WebSocketMessageSchemainpackages/spec/src/api/websocket.zod.ts
P1 — Important
-
Workflow namespace (
client.workflow.*)getConfig({ object })→GET /workflow/:object/configgetState({ object, recordId })→GET /workflow/:object/:id/statetransition({ object, recordId, transition, comment?, data? })approve({ object, recordId, comment?, data? })reject({ object, recordId, reason, comment? })
-
Views CRUD namespace (
client.views.*)list({ object, type? })→GET /ui/views/:objectget({ object, viewId })→GET /ui/views/:object/:viewIdcreate({ object, data })→POST /ui/views/:objectupdate({ object, viewId, data })→PUT /ui/views/:object/:viewIddelete({ object, viewId })→DELETE /ui/views/:object/:viewId
-
Auth enhancements
auth.register(request)→POST /auth/registerauth.refreshToken(refreshToken)→POST /auth/refresh
-
QueryBuilder enhancements — add fluent methods for:
.expand(relation, subQuery)— nested relation loading.search(query, options?)— full-text search.cursor(cursor)— keyset pagination.distinct()— SELECT DISTINCT.between(field, min, max)on FilterBuilder.contains(field, value)on FilterBuilder.startsWith(field, value)on FilterBuilder.endsWith(field, value)on FilterBuilder.exists(field)on FilterBuilder
P2 — Nice to Have
-
Notifications namespace (
client.notifications.*)registerDevice,unregisterDevicegetPreferences,updatePreferenceslist,markRead,markAllRead
-
AI namespace (
client.ai.*)nlq({ query, object?, conversationId? })chat({ message, conversationId?, context? })suggest({ object, field?, recordId?, partial? })insights({ object, recordId?, type? })
-
i18n namespace (
client.i18n.*)getLocales()getTranslations({ locale, namespace?, keys? })getFieldLabels({ object, locale })
-
QueryBuilder advanced — fluent methods for:
.join(object, on, type?)— explicit joins.having(filter)— HAVING clause.window(fn, partitionBy, orderBy)— window functions
Implementation Guidelines
- Follow the existing namespace pattern in
packages/client/src/index.ts(e.g.,client.meta.*,client.data.*) - All methods should call
this.request()internally and useunwrapResponse()for envelope stripping - Use route resolution via
getRoute(type)with fallback to conventional paths - Types should be imported from
@objectstack/spec/apiwhere available - Add corresponding tests in
client.test.ts(unit) andclient.msw.test.ts(integration) - Export all new types from
index.ts
Acceptance Criteria
- All P0 methods implemented with full type safety
- Unit tests for each new namespace (mocked fetch)
- Integration tests with MSW for P0 methods
- All existing tests continue to pass
- Exported types align with spec schemas
- README.md updated with new namespace documentation
References
- Spec protocol:
packages/spec/src/api/protocol.zod.ts - REST routes:
packages/spec/src/api/router.zod.ts - Contracts:
packages/spec/src/contracts/ - Existing client:
packages/client/src/index.ts
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request