Skip to content

Commit e02b476

Browse files
committed
feat(api): add API methods and schemas for request/response handling
- Introduced `apiMethods` property in Object and ObjectCapabilities schemas to define allowed API operations. - Created new Zod schemas for API error handling, base responses, and various request types (Create, Update, Bulk, Export). - Added detailed JSON schemas for API envelopes including ApiError, BaseResponse, BulkResponse, and others. - Updated documentation to include new API request and response schemas. - Removed deprecated contract.zod.ts and refactored API contract definitions into a new file. - Enhanced manifest schema to include descriptions for kinds. - Added new plugin configuration for Business Intelligence capabilities.
1 parent 056bc3b commit e02b476

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1019
-57
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
title: ApiError
3+
description: ApiError Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **code** | `string` || Error code (e.g. validation_error) |
11+
| **message** | `string` || Readable error message |
12+
| **details** | `any` | optional | Additional error context (e.g. field validation errors) |
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
title: BaseResponse
3+
description: BaseResponse Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **success** | `boolean` || Operation success status |
11+
| **error** | `object` | optional | Error details if success is false |
12+
| **meta** | `object` | optional | Response metadata |
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: BulkResponse
3+
description: BulkResponse Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **success** | `boolean` || Operation success status |
11+
| **error** | `object` | optional | Error details if success is false |
12+
| **meta** | `object` | optional | Response metadata |
13+
| **data** | `object[]` || Results for each item in the batch |
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: DeleteResponse
3+
description: DeleteResponse Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **success** | `boolean` || Operation success status |
11+
| **error** | `object` | optional | Error details if success is false |
12+
| **meta** | `object` | optional | Response metadata |
13+
| **id** | `string` || ID of the deleted record |
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: ListRecordResponse
3+
description: ListRecordResponse Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **success** | `boolean` || Operation success status |
11+
| **error** | `object` | optional | Error details if success is false |
12+
| **meta** | `object` | optional | Response metadata |
13+
| **data** | `Record<string, any>[]` || Array of matching records |
14+
| **pagination** | `object` || Pagination info |
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
title: ModificationResult
3+
description: ModificationResult Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **id** | `string` | optional | Record ID if processed |
11+
| **success** | `boolean` || |
12+
| **errors** | `object[]` | optional | |
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: SingleRecordResponse
3+
description: SingleRecordResponse Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **success** | `boolean` || Operation success status |
11+
| **error** | `object` | optional | Error details if success is false |
12+
| **meta** | `object` | optional | Response metadata |
13+
| **data** | `Record<string, any>` || The requested or modified record |
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"title": "Response Envelopes"
3+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"title": "API Protocol",
3+
"root": true,
4+
"pages": [
5+
"envelopes",
6+
"requests"
7+
]
8+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: BulkRequest
3+
description: BulkRequest Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **records** | `Record<string, any>[]` || Array of records to process |
11+
| **allOrNone** | `boolean` | optional | If true, rollback entire transaction on any failure |

0 commit comments

Comments
 (0)