You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/docs/guides/client-sdk.mdx
+139Lines changed: 139 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,7 @@ The `@objectstack/client` is the official TypeScript client for ObjectStack. It
17
17
-**Batch Operations**: Efficient bulk create/update/upsert/delete with transaction support
18
18
-**Query Builder**: Programmatic query construction with `createQuery()` and `createFilter()`
19
19
-**Standardized Errors**: Machine-readable error codes with retry guidance
20
+
-**100% Protocol Compliant**: Implements all 13 API namespaces and 95+ methods defined in `@objectstack/spec`
20
21
21
22
## Installation
22
23
@@ -102,6 +103,32 @@ if (discovery.services?.auth?.enabled) {
102
103
103
104
---
104
105
106
+
## Protocol Coverage
107
+
108
+
The `@objectstack/client` SDK aims to implement the ObjectStack API protocol specification. It covers all 13 API namespaces defined in `@objectstack/spec`:
109
+
110
+
| Namespace | Status | Methods | Purpose |
111
+
|:----------|:------:|:--------|:--------|
112
+
|**discovery**| ✅ | 1 | API version & capabilities detection |
**Protocol compliance & verification**: See [`CLIENT_SPEC_COMPLIANCE.md`](https://github.com/objectstack-ai/spec/blob/main/packages/client/CLIENT_SPEC_COMPLIANCE.md) for detailed method-by-method verification and [`CLIENT_SERVER_INTEGRATION_TESTS.md`](https://github.com/objectstack-ai/spec/blob/main/packages/client/CLIENT_SERVER_INTEGRATION_TESTS.md) for comprehensive integration test specifications.
**Service availability**: Optional services (workflow, ai, etc.) are only available when the corresponding plugin is installed on the server. Always check `client.discovery?.services` to verify service availability before calling these methods.
300
+
</Callout>
301
+
209
302
---
210
303
211
304
## Query Builder
@@ -329,6 +422,52 @@ function AccountList() {
329
422
330
423
---
331
424
425
+
## Testing
426
+
427
+
The client SDK includes comprehensive unit and integration tests to ensure reliability and protocol compliance.
428
+
429
+
### Unit Tests
430
+
431
+
```bash
432
+
cd packages/client
433
+
pnpm test
434
+
```
435
+
436
+
Unit tests use mocks to verify client behavior without requiring a server.
437
+
438
+
### Integration Tests
439
+
440
+
**Note:** Integration tests require a running ObjectStack server. The server is provided by a separate repository and must be set up independently.
441
+
442
+
```bash
443
+
# Prerequisite: Start an ObjectStack server with test data
444
+
# For example, using the reference server repository
445
+
# Follow the server repository's documentation for local setup
446
+
447
+
# From this repository, run the integration test script
448
+
cd packages/client
449
+
pnpm test:integration
450
+
```
451
+
452
+
Integration tests verify end-to-end communication with a live ObjectStack server across all 13 API namespaces.
453
+
454
+
<Callouttype="info">
455
+
**Test coverage**: Integration test specifications cover discovery/connection, authentication, metadata operations, CRUD operations (basic, batch, advanced queries), permissions, workflow, realtime, notifications, AI services, i18n, analytics, packages, views, storage, and automation.
456
+
</Callout>
457
+
458
+
---
459
+
460
+
## Protocol Compliance Documentation
461
+
462
+
For detailed information about the client's protocol implementation:
463
+
464
+
-**[Protocol Compliance Matrix](https://github.com/objectstack-ai/spec/blob/main/packages/client/CLIENT_SPEC_COMPLIANCE.md)** — Method-by-method verification of all 95+ API methods across 13 namespaces
465
+
-**[Integration Test Specifications](https://github.com/objectstack-ai/spec/blob/main/packages/client/CLIENT_SERVER_INTEGRATION_TESTS.md)** — Comprehensive test cases for client-server communication
466
+
-**[Quick Reference Guide](https://github.com/objectstack-ai/spec/blob/main/packages/client/QUICK_REFERENCE.md)** — Developer navigation and API reference
467
+
-**[中文合规性报告](https://github.com/objectstack-ai/spec/blob/main/packages/client/CLIENT_SPEC_COMPLIANCE_CN.md)** — Chinese language compliance verification report
0 commit comments