Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions content/docs/references/api/batch.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,27 @@ description: Batch protocol schemas
## TypeScript Usage

```typescript
import { BatchOperationResultSchema, BatchOperationTypeSchema, BatchOptionsSchema, BatchRecordSchema, BatchUpdateRequestSchema, BatchUpdateResponseSchema, DeleteManyRequestSchema, UpdateManyRequestSchema } from '@objectstack/spec/api';
import type { BatchOperationResult, BatchOperationType, BatchOptions, BatchRecord, BatchUpdateRequest, BatchUpdateResponse, DeleteManyRequest, UpdateManyRequest } from '@objectstack/spec/api';
import { BatchConfigSchema, BatchOperationResultSchema, BatchOperationTypeSchema, BatchOptionsSchema, BatchRecordSchema, BatchUpdateRequestSchema, BatchUpdateResponseSchema, DeleteManyRequestSchema, UpdateManyRequestSchema } from '@objectstack/spec/api';
import type { BatchConfig, BatchOperationResult, BatchOperationType, BatchOptions, BatchRecord, BatchUpdateRequest, BatchUpdateResponse, DeleteManyRequest, UpdateManyRequest } from '@objectstack/spec/api';

// Validate data
const result = BatchOperationResultSchema.parse(data);
const result = BatchConfigSchema.parse(data);

Copilot AI Jan 31, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example code has been changed from parsing BatchOperationResultSchema to BatchConfigSchema. This change doesn't make sense in the context of the documentation - the example should demonstrate the primary use case of the API module. If BatchConfigSchema is more important, this is a reasonable change, but if BatchOperationResultSchema was the better example before, changing it just because a new schema was added is inconsistent.

Consider whether this change is intentional or if it should revert to the original example while still documenting the new BatchConfigSchema elsewhere in the file.

Suggested change
const result = BatchConfigSchema.parse(data);
const result = BatchOperationResultSchema.parse(data);

Copilot uses AI. Check for mistakes.
```

---

## BatchConfig

### Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **enabled** | `boolean` | optional | Enable batch operations |
| **maxRecordsPerBatch** | `integer` | optional | Maximum records per batch |
| **defaultOptions** | `object` | optional | Default batch options |

---

## BatchOperationResult

### Properties
Expand Down
18 changes: 15 additions & 3 deletions content/docs/references/api/odata.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,27 @@ description: Odata protocol schemas
## TypeScript Usage

```typescript
import { ODataErrorSchema, ODataFilterFunctionSchema, ODataFilterOperatorSchema, ODataMetadataSchema, ODataQuerySchema, ODataResponseSchema } from '@objectstack/spec/api';
import type { ODataError, ODataFilterFunction, ODataFilterOperator, ODataMetadata, ODataQuery, ODataResponse } from '@objectstack/spec/api';
import { ODataConfigSchema, ODataErrorSchema, ODataFilterFunctionSchema, ODataFilterOperatorSchema, ODataMetadataSchema, ODataQuerySchema, ODataResponseSchema } from '@objectstack/spec/api';
import type { ODataConfig, ODataError, ODataFilterFunction, ODataFilterOperator, ODataMetadata, ODataQuery, ODataResponse } from '@objectstack/spec/api';

// Validate data
const result = ODataErrorSchema.parse(data);
const result = ODataConfigSchema.parse(data);

Copilot AI Jan 31, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example code has been changed from parsing ODataErrorSchema to ODataConfigSchema. This change doesn't make sense in the context of the documentation - the example should demonstrate the primary use case of the API module. If ODataConfigSchema is more important, this is a reasonable change, but if ODataErrorSchema was the better example before, changing it just because a new schema was added is inconsistent.

Consider whether this change is intentional or if it should revert to the original example while still documenting the new ODataConfigSchema elsewhere in the file.

Suggested change
const result = ODataConfigSchema.parse(data);
const result = ODataErrorSchema.parse(data);

Copilot uses AI. Check for mistakes.
```

---

## ODataConfig

### Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **enabled** | `boolean` | optional | Enable OData API |
| **path** | `string` | optional | OData endpoint path |
| **metadata** | `object` | optional | OData metadata configuration |

---

## ODataError

### Properties
Expand Down
16 changes: 14 additions & 2 deletions content/docs/references/api/realtime.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ description: Realtime protocol schemas
## TypeScript Usage

```typescript
import { PresenceSchema, PresenceStatusSchema, RealtimeActionSchema, RealtimeEventSchema, RealtimeEventTypeSchema, SubscriptionSchema, SubscriptionEventSchema, TransportProtocolSchema } from '@objectstack/spec/api';
import type { Presence, PresenceStatus, RealtimeAction, RealtimeEvent, RealtimeEventType, Subscription, SubscriptionEvent, TransportProtocol } from '@objectstack/spec/api';
import { PresenceSchema, PresenceStatusSchema, RealtimeActionSchema, RealtimeConfigSchema, RealtimeEventSchema, RealtimeEventTypeSchema, SubscriptionSchema, SubscriptionEventSchema, TransportProtocolSchema } from '@objectstack/spec/api';
import type { Presence, PresenceStatus, RealtimeAction, RealtimeConfig, RealtimeEvent, RealtimeEventType, Subscription, SubscriptionEvent, TransportProtocol } from '@objectstack/spec/api';

// Validate data
const result = PresenceSchema.parse(data);
Expand Down Expand Up @@ -54,6 +54,18 @@ const result = PresenceSchema.parse(data);

---

## RealtimeConfig

### Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **enabled** | `boolean` | optional | Enable realtime synchronization |
| **transport** | `Enum<'websocket' \| 'sse' \| 'polling'>` | optional | Transport protocol |
| **subscriptions** | `object[]` | optional | Default subscriptions |

---

## RealtimeEvent

### Properties
Expand Down
51 changes: 51 additions & 0 deletions packages/spec/json-schema/api/BatchConfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"$ref": "#/definitions/BatchConfig",
"definitions": {
"BatchConfig": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": true,
"description": "Enable batch operations"
},
"maxRecordsPerBatch": {
"type": "integer",
"minimum": 1,
"maximum": 1000,
"default": 200,
"description": "Maximum records per batch"
},
"defaultOptions": {
"type": "object",
"properties": {
"atomic": {
"type": "boolean",
"default": true,
"description": "If true, rollback entire batch on any failure (transaction mode)"
},
"returnRecords": {
"type": "boolean",
"default": false,
"description": "If true, return full record data in response"
},
"continueOnError": {
"type": "boolean",
"default": false,
"description": "If true (and atomic=false), continue processing remaining records after errors"
},
"validateOnly": {
"type": "boolean",
"default": false,
"description": "If true, validate records without persisting changes (dry-run mode)"
}
},
"additionalProperties": false,
"description": "Default batch options"
}
},
"additionalProperties": true
}
},
"$schema": "http://json-schema.org/draft-07/schema#"
}
132 changes: 132 additions & 0 deletions packages/spec/json-schema/api/ODataConfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
{
"$ref": "#/definitions/ODataConfig",
"definitions": {
"ODataConfig": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": true,
"description": "Enable OData API"
},
"path": {
"type": "string",
"default": "/odata",
"description": "OData endpoint path"
},
"metadata": {
"type": "object",
"properties": {
"namespace": {
"type": "string",
"description": "Service namespace"
},
"entityTypes": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Entity type name"
},
"key": {
"type": "array",
"items": {
"type": "string"
},
"description": "Key fields"
},
"properties": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"type": {
"type": "string",
"description": "OData type (Edm.String, Edm.Int32, etc.)"
},
"nullable": {
"type": "boolean",
"default": true
}
},
"required": [
"name",
"type"
],
"additionalProperties": false
}
},
"navigationProperties": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"type": {
"type": "string"
},
"partner": {
"type": "string"
}
},
"required": [
"name",
"type"
],
"additionalProperties": false
}
}
},
"required": [
"name",
"key",
"properties"
],
"additionalProperties": false
},
"description": "Entity types"
},
"entitySets": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Entity set name"
},
"entityType": {
"type": "string",
"description": "Entity type"
}
},
"required": [
"name",
"entityType"
],
"additionalProperties": false
},
"description": "Entity sets"
}
},
"required": [
"namespace",
"entityTypes",
"entitySets"
],
"additionalProperties": false,
"description": "OData metadata configuration"
}
},
"additionalProperties": true
}
},
"$schema": "http://json-schema.org/draft-07/schema#"
}
90 changes: 90 additions & 0 deletions packages/spec/json-schema/api/RealtimeConfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"$ref": "#/definitions/RealtimeConfig",
"definitions": {
"RealtimeConfig": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": true,
"description": "Enable realtime synchronization"
},
"transport": {
"type": "string",
"enum": [
"websocket",
"sse",
"polling"
],
"default": "websocket",
"description": "Transport protocol"
},
"subscriptions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid",
"description": "Unique subscription identifier"
},
"events": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"record.created",
"record.updated",
"record.deleted",
"field.changed"
],
"description": "Type of event to subscribe to"
},
"object": {
"type": "string",
"description": "Object name to subscribe to"
},
"filters": {
"description": "Filter conditions"
}
},
"required": [
"type"
],
"additionalProperties": false
},
"description": "Array of events to subscribe to"
},
"transport": {
"type": "string",
"enum": [
"websocket",
"sse",
"polling"
],
"description": "Transport protocol to use"
},
"channel": {
"type": "string",
"description": "Optional channel name for grouping subscriptions"
}
},
"required": [
"id",
"events",
"transport"
],
"additionalProperties": false
},
"description": "Default subscriptions"
}
},
"additionalProperties": true
}
},
"$schema": "http://json-schema.org/draft-07/schema#"
}
8 changes: 8 additions & 0 deletions packages/spec/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@
"./contracts": {
"types": "./dist/contracts/index.d.ts",
"default": "./dist/contracts/index.js"
},
"./integration": {
"types": "./dist/integration/index.d.ts",
"default": "./dist/integration/index.js"
},
"./permission": {
"types": "./dist/permission/index.d.ts",
"default": "./dist/permission/index.js"
}
},
"files": [
Expand Down
Loading