From 2e50c27d299eff83fe0d8ad6dd332260d007bb1a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 31 Jan 2026 05:11:05 +0000 Subject: [PATCH 1/2] Initial plan From dbc25a6c497e0f7497075e22e4c58d0f4acb5982 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 31 Jan 2026 05:17:10 +0000 Subject: [PATCH 2/2] Add missing type exports for API, Hub, System, and Integration modules Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> --- content/docs/references/api/batch.mdx | 18 ++- content/docs/references/api/odata.mdx | 18 ++- content/docs/references/api/realtime.mdx | 16 ++- .../spec/json-schema/api/BatchConfig.json | 51 +++++++ .../spec/json-schema/api/ODataConfig.json | 132 ++++++++++++++++++ .../spec/json-schema/api/RealtimeConfig.json | 90 ++++++++++++ packages/spec/package.json | 8 ++ packages/spec/src/api/batch.zod.ts | 18 +++ packages/spec/src/api/odata.zod.ts | 18 +++ packages/spec/src/api/realtime.zod.ts | 18 +++ packages/spec/src/hub/composer.zod.ts | 1 + packages/spec/src/hub/marketplace.zod.ts | 1 + packages/spec/src/hub/space.zod.ts | 1 + .../src/integration/connector/saas.zod.ts | 1 + packages/spec/src/system/job.zod.ts | 1 + 15 files changed, 384 insertions(+), 8 deletions(-) create mode 100644 packages/spec/json-schema/api/BatchConfig.json create mode 100644 packages/spec/json-schema/api/ODataConfig.json create mode 100644 packages/spec/json-schema/api/RealtimeConfig.json diff --git a/content/docs/references/api/batch.mdx b/content/docs/references/api/batch.mdx index 2b12e38987f..0dc5ab8a1a5 100644 --- a/content/docs/references/api/batch.mdx +++ b/content/docs/references/api/batch.mdx @@ -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); ``` --- +## 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 diff --git a/content/docs/references/api/odata.mdx b/content/docs/references/api/odata.mdx index 87468810e57..034dedb3f7b 100644 --- a/content/docs/references/api/odata.mdx +++ b/content/docs/references/api/odata.mdx @@ -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); ``` --- +## 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 diff --git a/content/docs/references/api/realtime.mdx b/content/docs/references/api/realtime.mdx index 9532ed757fb..672a6a37ae9 100644 --- a/content/docs/references/api/realtime.mdx +++ b/content/docs/references/api/realtime.mdx @@ -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); @@ -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 diff --git a/packages/spec/json-schema/api/BatchConfig.json b/packages/spec/json-schema/api/BatchConfig.json new file mode 100644 index 00000000000..8617dad95b4 --- /dev/null +++ b/packages/spec/json-schema/api/BatchConfig.json @@ -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#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/api/ODataConfig.json b/packages/spec/json-schema/api/ODataConfig.json new file mode 100644 index 00000000000..92b15f12ef2 --- /dev/null +++ b/packages/spec/json-schema/api/ODataConfig.json @@ -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#" +} \ No newline at end of file diff --git a/packages/spec/json-schema/api/RealtimeConfig.json b/packages/spec/json-schema/api/RealtimeConfig.json new file mode 100644 index 00000000000..087ce8e7de4 --- /dev/null +++ b/packages/spec/json-schema/api/RealtimeConfig.json @@ -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#" +} \ No newline at end of file diff --git a/packages/spec/package.json b/packages/spec/package.json index 2e378ade013..61b835cacdd 100644 --- a/packages/spec/package.json +++ b/packages/spec/package.json @@ -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": [ diff --git a/packages/spec/src/api/batch.zod.ts b/packages/spec/src/api/batch.zod.ts index de83152ba75..11444e2ccaf 100644 --- a/packages/spec/src/api/batch.zod.ts +++ b/packages/spec/src/api/batch.zod.ts @@ -222,3 +222,21 @@ export const BatchApiContracts = { output: BatchUpdateResponseSchema, }, }; + +/** + * Batch Configuration Schema + * + * Configuration for enabling batch operations API. + */ +export const BatchConfigSchema = z.object({ + /** Enable batch operations */ + enabled: z.boolean().default(true).describe('Enable batch operations'), + + /** Maximum records per batch */ + maxRecordsPerBatch: z.number().int().min(1).max(1000).default(200).describe('Maximum records per batch'), + + /** Default options */ + defaultOptions: BatchOptionsSchema.optional().describe('Default batch options'), +}).passthrough(); // Allow additional properties + +export type BatchConfig = z.infer; diff --git a/packages/spec/src/api/odata.zod.ts b/packages/spec/src/api/odata.zod.ts index 6d6366ee08f..a8846b439ea 100644 --- a/packages/spec/src/api/odata.zod.ts +++ b/packages/spec/src/api/odata.zod.ts @@ -446,3 +446,21 @@ export const OData = { or: (...expressions: string[]) => expressions.join(' or '), }, } as const; + +/** + * OData Configuration Schema + * + * Configuration for enabling OData v4 API endpoint. + */ +export const ODataConfigSchema = z.object({ + /** Enable OData endpoint */ + enabled: z.boolean().default(true).describe('Enable OData API'), + + /** OData endpoint path */ + path: z.string().default('/odata').describe('OData endpoint path'), + + /** Metadata configuration */ + metadata: ODataMetadataSchema.optional().describe('OData metadata configuration'), +}).passthrough(); // Allow additional properties for flexibility + +export type ODataConfig = z.infer; diff --git a/packages/spec/src/api/realtime.zod.ts b/packages/spec/src/api/realtime.zod.ts index 54c193fa74d..dae79e36518 100644 --- a/packages/spec/src/api/realtime.zod.ts +++ b/packages/spec/src/api/realtime.zod.ts @@ -100,3 +100,21 @@ export const RealtimeEventSchema = z.object({ }); export type RealtimeEvent = z.infer; + +/** + * Realtime Configuration Schema + * + * Configuration for enabling realtime data synchronization. + */ +export const RealtimeConfigSchema = z.object({ + /** Enable realtime sync */ + enabled: z.boolean().default(true).describe('Enable realtime synchronization'), + + /** Transport protocol */ + transport: TransportProtocol.default('websocket').describe('Transport protocol'), + + /** Default subscriptions */ + subscriptions: z.array(SubscriptionSchema).optional().describe('Default subscriptions'), +}).passthrough(); // Allow additional properties + +export type RealtimeConfig = z.infer; diff --git a/packages/spec/src/hub/composer.zod.ts b/packages/spec/src/hub/composer.zod.ts index 5760cc94d6d..c95e2852066 100644 --- a/packages/spec/src/hub/composer.zod.ts +++ b/packages/spec/src/hub/composer.zod.ts @@ -127,3 +127,4 @@ export const ComposerResponseSchema = z.object({ export type BillOfMaterials = z.infer; export type ComposerRequest = z.infer; export type ComposerResponse = z.infer; +export type ComposerConfig = ComposerRequest; // Alias for configuration context diff --git a/packages/spec/src/hub/marketplace.zod.ts b/packages/spec/src/hub/marketplace.zod.ts index 844f9fca373..7340b43164e 100644 --- a/packages/spec/src/hub/marketplace.zod.ts +++ b/packages/spec/src/hub/marketplace.zod.ts @@ -98,3 +98,4 @@ export const MarketplacePluginSchema = z.object({ export type PluginAuthor = z.infer; export type MarketplacePlugin = z.infer; +export type MarketplaceListing = MarketplacePlugin; // Alias for backwards compatibility diff --git a/packages/spec/src/hub/space.zod.ts b/packages/spec/src/hub/space.zod.ts index 54be1da3b3f..590070562b8 100644 --- a/packages/spec/src/hub/space.zod.ts +++ b/packages/spec/src/hub/space.zod.ts @@ -118,3 +118,4 @@ export type SubscriptionStatus = z.infer; export type SpaceSubscription = z.infer; export type DeploymentTarget = z.infer; export type HubSpace = z.infer; +export type Space = HubSpace; // Alias for backwards compatibility diff --git a/packages/spec/src/integration/connector/saas.zod.ts b/packages/spec/src/integration/connector/saas.zod.ts index 4f003b8a277..1b73e56515a 100644 --- a/packages/spec/src/integration/connector/saas.zod.ts +++ b/packages/spec/src/integration/connector/saas.zod.ts @@ -121,6 +121,7 @@ export const SaasConnectorSchema = ConnectorSchema.extend({ }); export type SaasConnector = z.infer; +export type SaaSConnector = SaasConnector; // Alias for alternative capitalization // ============================================================================ // Helper Functions & Examples diff --git a/packages/spec/src/system/job.zod.ts b/packages/spec/src/system/job.zod.ts index 4d196e06322..7895445b813 100644 --- a/packages/spec/src/system/job.zod.ts +++ b/packages/spec/src/system/job.zod.ts @@ -42,6 +42,7 @@ export type Schedule = z.infer; export type CronSchedule = z.infer; export type IntervalSchedule = z.infer; export type OnceSchedule = z.infer; +export type JobSchedule = Schedule; // Alias for backwards compatibility /** * Retry Policy Schema