@objectstack/client 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @objectstack/client
2
2
 
3
+ ## 0.9.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Patch release for maintenance and stability improvements. All packages updated with unified versioning.
8
+ - Updated dependencies
9
+ - @objectstack/spec@0.9.1
10
+ - @objectstack/core@0.9.1
11
+
3
12
  ## 0.8.2
4
13
 
5
14
  ### Patch Changes
package/README.md CHANGED
@@ -157,10 +157,48 @@ try {
157
157
  }
158
158
  ```
159
159
 
160
- Common error codes:
161
- - `validation_error`: Input validation failed
162
- - `unauthenticated`: Authentication required
163
- - `permission_denied`: Insufficient permissions
164
- - `resource_not_found`: Resource does not exist
165
- - `rate_limit_exceeded`: Too many requests
160
+ ### Error Code Reference
161
+
162
+ #### Client Errors (4xx)
163
+
164
+ | Error Code | HTTP Status | Retryable | Description |
165
+ |------------|-------------|-----------|-------------|
166
+ | `validation_error` | 400 | No | Input validation failed. Check error.details for field-specific errors |
167
+ | `unauthenticated` | 401 | No | Authentication required. Provide valid token |
168
+ | `permission_denied` | 403 | No | Insufficient permissions for this operation |
169
+ | `resource_not_found` | 404 | No | Resource does not exist. Verify object name or record ID |
170
+ | `conflict` | 409 | No | Resource conflict (e.g., duplicate unique field) |
171
+ | `rate_limit_exceeded` | 429 | Yes | Too many requests. Wait before retrying |
172
+
173
+ #### Server Errors (5xx)
174
+
175
+ | Error Code | HTTP Status | Retryable | Description |
176
+ |------------|-------------|-----------|-------------|
177
+ | `internal_error` | 500 | Yes | Server encountered an error. Retry with backoff |
178
+ | `service_unavailable` | 503 | Yes | Service temporarily unavailable. Retry later |
179
+ | `gateway_timeout` | 504 | Yes | Request timeout. Consider increasing timeout or retrying |
180
+
181
+ **Retry Strategy Example:**
182
+
183
+ ```typescript
184
+ async function retryableRequest<T>(fn: () => Promise<T>, maxRetries = 3): Promise<T> {
185
+ for (let i = 0; i < maxRetries; i++) {
186
+ try {
187
+ return await fn();
188
+ } catch (error: any) {
189
+ if (!error.retryable || i === maxRetries - 1) {
190
+ throw error;
191
+ }
192
+ // Exponential backoff
193
+ await new Promise(resolve => setTimeout(resolve, Math.pow(2, i) * 1000));
194
+ }
195
+ }
196
+ throw new Error('Max retries exceeded');
197
+ }
198
+
199
+ // Usage
200
+ const data = await retryableRequest(() =>
201
+ client.data.create('todo_task', { subject: 'Task' })
202
+ );
203
+ ```
166
204
 
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@objectstack/client",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "Official Client SDK for ObjectStack Protocol",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "dependencies": {
8
- "@objectstack/spec": "0.9.0",
9
- "@objectstack/core": "0.9.0"
8
+ "@objectstack/spec": "0.9.1",
9
+ "@objectstack/core": "0.9.1"
10
10
  },
11
11
  "devDependencies": {
12
12
  "typescript": "^5.0.0",