Skip to content

Commit edfb083

Browse files
authored
Merge pull request #377 from objectstack-ai/copilot/enhance-connector-protocols
2 parents 39452e3 + 95a23eb commit edfb083

Some content is hidden

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

68 files changed

+11306
-96
lines changed

content/docs/references/auth/config.mdx

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ description: Config protocol schemas
1212
## TypeScript Usage
1313

1414
```typescript
15-
import { AccountLinkingConfigSchema, AuthConfigSchema, AuthPluginConfigSchema, AuthStrategySchema, CSRFConfigSchema, DatabaseAdapterSchema, DatabaseMappingSchema, EmailPasswordConfigSchema, EnterpriseAuthConfigSchema, LDAPConfigSchema, MagicLinkConfigSchema, OAuthProviderSchema, OIDCConfigSchema, PasskeyConfigSchema, RateLimitConfigSchema, SAMLConfigSchema, SessionConfigSchema, StandardAuthProviderSchema, TwoFactorConfigSchema, UserFieldMappingSchema } from '@objectstack/spec/auth';
16-
import type { AccountLinkingConfig, AuthConfig, AuthPluginConfig, AuthStrategy, CSRFConfig, DatabaseAdapter, DatabaseMapping, EmailPasswordConfig, EnterpriseAuthConfig, LDAPConfig, MagicLinkConfig, OAuthProvider, OIDCConfig, PasskeyConfig, RateLimitConfig, SAMLConfig, SessionConfig, StandardAuthProvider, TwoFactorConfig, UserFieldMapping } from '@objectstack/spec/auth';
15+
import { AccountLinkingConfigSchema, AuthConfigSchema, AuthPluginConfigSchema, AuthStrategySchema, CSRFConfigSchema, DatabaseAdapterSchema, DatabaseMappingSchema, EmailPasswordConfigSchema, EnterpriseAuthConfigSchema, LDAPConfigSchema, MagicLinkConfigSchema, OAuthProviderSchema, OIDCConfigSchema, PasskeyConfigSchema, SAMLConfigSchema, SessionConfigSchema, StandardAuthProviderSchema, TwoFactorConfigSchema, UserFieldMappingSchema } from '@objectstack/spec/auth';
16+
import type { AccountLinkingConfig, AuthConfig, AuthPluginConfig, AuthStrategy, CSRFConfig, DatabaseAdapter, DatabaseMapping, EmailPasswordConfig, EnterpriseAuthConfig, LDAPConfig, MagicLinkConfig, OAuthProvider, OIDCConfig, PasskeyConfig, SAMLConfig, SessionConfig, StandardAuthProvider, TwoFactorConfig, UserFieldMapping } from '@objectstack/spec/auth';
1717

1818
// Validate data
1919
const result = AccountLinkingConfigSchema.parse(data);
@@ -238,20 +238,6 @@ const result = AccountLinkingConfigSchema.parse(data);
238238

239239
---
240240

241-
## RateLimitConfig
242-
243-
### Properties
244-
245-
| Property | Type | Required | Description |
246-
| :--- | :--- | :--- | :--- |
247-
| **enabled** | `boolean` | optional | |
248-
| **maxAttempts** | `number` | optional | Maximum login attempts |
249-
| **windowMs** | `number` | optional | Time window in milliseconds (default 15 min) |
250-
| **blockDuration** | `number` | optional | Block duration after max attempts in ms |
251-
| **skipSuccessfulRequests** | `boolean` | optional | Only count failed requests |
252-
253-
---
254-
255241
## SAMLConfig
256242

257243
### Properties
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
title: Connector
3+
description: Connector protocol schemas
4+
---
5+
6+
# Connector
7+
8+
<Callout type="info">
9+
**Source:** `packages/spec/src/auth/connector.zod.ts`
10+
</Callout>
11+
12+
## TypeScript Usage
13+
14+
```typescript
15+
import { RateLimitConfigSchema } from '@objectstack/spec/auth';
16+
import type { RateLimitConfig } from '@objectstack/spec/auth';
17+
18+
// Validate data
19+
const result = RateLimitConfigSchema.parse(data);
20+
```
21+
22+
---
23+
24+
## RateLimitConfig
25+
26+
### Properties
27+
28+
| Property | Type | Required | Description |
29+
| :--- | :--- | :--- | :--- |
30+
| **enabled** | `boolean` | optional | |
31+
| **maxAttempts** | `number` | optional | Maximum login attempts |
32+
| **windowMs** | `number` | optional | Time window in milliseconds (default 15 min) |
33+
| **blockDuration** | `number` | optional | Block duration after max attempts in ms |
34+
| **skipSuccessfulRequests** | `boolean` | optional | Only count failed requests |
35+

content/docs/references/automation/connector.mdx

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ description: Connector protocol schemas
1212
## TypeScript Usage
1313

1414
```typescript
15-
import { AuthFieldSchema, AuthenticationSchema, AuthenticationTypeSchema, ConnectorSchema, ConnectorCategorySchema, ConnectorInstanceSchema, ConnectorOperationSchema, ConnectorTriggerSchema, OAuth2ConfigSchema, OperationParameterSchema, OperationTypeSchema } from '@objectstack/spec/automation';
16-
import type { AuthField, Authentication, AuthenticationType, Connector, ConnectorCategory, ConnectorInstance, ConnectorOperation, ConnectorTrigger, OAuth2Config, OperationParameter, OperationType } from '@objectstack/spec/automation';
15+
import { AuthFieldSchema, AuthenticationSchema, AuthenticationTypeSchema, ConflictResolutionSchema, ConnectorSchema, ConnectorCategorySchema, ConnectorInstanceSchema, ConnectorOperationSchema, ConnectorTriggerSchema, DataSyncConfigSchema, FieldMappingSchema, OAuth2ConfigSchema, OperationParameterSchema, OperationTypeSchema } from '@objectstack/spec/automation';
16+
import type { AuthField, Authentication, AuthenticationType, ConflictResolution, Connector, ConnectorCategory, ConnectorInstance, ConnectorOperation, ConnectorTrigger, DataSyncConfig, FieldMapping, OAuth2Config, OperationParameter, OperationType } from '@objectstack/spec/automation';
1717

1818
// Validate data
1919
const result = AuthFieldSchema.parse(data);
@@ -65,6 +65,18 @@ const result = AuthFieldSchema.parse(data);
6565

6666
---
6767

68+
## ConflictResolution
69+
70+
### Allowed Values
71+
72+
* `source_wins`
73+
* `destination_wins`
74+
* `latest_wins`
75+
* `manual`
76+
* `merge`
77+
78+
---
79+
6880
## Connector
6981

7082
### Properties
@@ -167,6 +179,48 @@ const result = AuthFieldSchema.parse(data);
167179

168180
---
169181

182+
## DataSyncConfig
183+
184+
### Properties
185+
186+
| Property | Type | Required | Description |
187+
| :--- | :--- | :--- | :--- |
188+
| **name** | `string` || Sync configuration name (snake_case) |
189+
| **label** | `string` | optional | Sync display name |
190+
| **description** | `string` | optional | Sync description |
191+
| **source** | `object` || Data source |
192+
| **destination** | `object` || Data destination |
193+
| **direction** | `Enum<'push' \| 'pull' \| 'bidirectional'>` | optional | Sync direction |
194+
| **syncMode** | `Enum<'full' \| 'incremental' \| 'realtime'>` | optional | Sync mode |
195+
| **conflictResolution** | `Enum<'source_wins' \| 'destination_wins' \| 'latest_wins' \| 'manual' \| 'merge'>` | optional | Conflict resolution |
196+
| **schedule** | `string` | optional | Cron schedule |
197+
| **enabled** | `boolean` | optional | Sync enabled |
198+
| **changeTrackingField** | `string` | optional | Field for change tracking |
199+
| **batchSize** | `integer` | optional | Batch size for processing |
200+
| **retry** | `object` | optional | Retry configuration |
201+
| **validation** | `object` | optional | Validation rules |
202+
| **errorHandling** | `object` | optional | Error handling |
203+
| **optimization** | `object` | optional | Performance optimization |
204+
| **audit** | `object` | optional | Audit configuration |
205+
| **tags** | `string[]` | optional | Sync tags |
206+
| **metadata** | `Record<string, any>` | optional | Custom metadata |
207+
208+
---
209+
210+
## FieldMapping
211+
212+
### Properties
213+
214+
| Property | Type | Required | Description |
215+
| :--- | :--- | :--- | :--- |
216+
| **sourceField** | `string` || Source field name |
217+
| **destinationField** | `string` || Destination field name |
218+
| **transform** | `string` | optional | Transformation formula |
219+
| **default** | `any` | optional | Default value |
220+
| **syncNull** | `boolean` | optional | Sync null values |
221+
222+
---
223+
170224
## OAuth2Config
171225

172226
### Properties

content/docs/references/automation/mapping.mdx

Lines changed: 0 additions & 35 deletions
This file was deleted.

content/docs/references/automation/sync.mdx

Lines changed: 3 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,15 @@ description: Sync protocol schemas
1212
## TypeScript Usage
1313

1414
```typescript
15-
import { ConflictResolutionSchema, DataDestinationConfigSchema, DataSourceConfigSchema, DataSyncConfigSchema, SyncDirectionSchema, SyncExecutionResultSchema, SyncExecutionStatusSchema, SyncModeSchema } from '@objectstack/spec/automation';
16-
import type { ConflictResolution, DataDestinationConfig, DataSourceConfig, DataSyncConfig, SyncDirection, SyncExecutionResult, SyncExecutionStatus, SyncMode } from '@objectstack/spec/automation';
15+
import { DataDestinationConfigSchema, DataSourceConfigSchema, SyncDirectionSchema, SyncExecutionResultSchema, SyncExecutionStatusSchema, SyncModeSchema } from '@objectstack/spec/automation';
16+
import type { DataDestinationConfig, DataSourceConfig, SyncDirection, SyncExecutionResult, SyncExecutionStatus, SyncMode } from '@objectstack/spec/automation';
1717

1818
// Validate data
19-
const result = ConflictResolutionSchema.parse(data);
19+
const result = DataDestinationConfigSchema.parse(data);
2020
```
2121

2222
---
2323

24-
## ConflictResolution
25-
26-
### Allowed Values
27-
28-
* `source_wins`
29-
* `destination_wins`
30-
* `latest_wins`
31-
* `manual`
32-
* `merge`
33-
34-
---
35-
3624
## DataDestinationConfig
3725

3826
### Properties
@@ -62,34 +50,6 @@ const result = ConflictResolutionSchema.parse(data);
6250

6351
---
6452

65-
## DataSyncConfig
66-
67-
### Properties
68-
69-
| Property | Type | Required | Description |
70-
| :--- | :--- | :--- | :--- |
71-
| **name** | `string` || Sync configuration name (snake_case) |
72-
| **label** | `string` | optional | Sync display name |
73-
| **description** | `string` | optional | Sync description |
74-
| **source** | `object` || Data source |
75-
| **destination** | `object` || Data destination |
76-
| **direction** | `Enum<'push' \| 'pull' \| 'bidirectional'>` | optional | Sync direction |
77-
| **syncMode** | `Enum<'full' \| 'incremental' \| 'realtime'>` | optional | Sync mode |
78-
| **conflictResolution** | `Enum<'source_wins' \| 'destination_wins' \| 'latest_wins' \| 'manual' \| 'merge'>` | optional | Conflict resolution |
79-
| **schedule** | `string` | optional | Cron schedule |
80-
| **enabled** | `boolean` | optional | Sync enabled |
81-
| **changeTrackingField** | `string` | optional | Field for change tracking |
82-
| **batchSize** | `integer` | optional | Batch size for processing |
83-
| **retry** | `object` | optional | Retry configuration |
84-
| **validation** | `object` | optional | Validation rules |
85-
| **errorHandling** | `object` | optional | Error handling |
86-
| **optimization** | `object` | optional | Performance optimization |
87-
| **audit** | `object` | optional | Audit configuration |
88-
| **tags** | `string[]` | optional | Sync tags |
89-
| **metadata** | `Record<string, any>` | optional | Custom metadata |
90-
91-
---
92-
9353
## SyncDirection
9454

9555
### Allowed Values

0 commit comments

Comments
 (0)