External Lookup
External Lookup protocol schemas
External Data Source Schema
Configuration for connecting to external data systems.
Similar to Salesforce External Objects for real-time data integration.
@example
\{
"id": "salesforce-accounts",
"name": "Salesforce Account Data",
"type": "rest-api",
"endpoint": "https://api.salesforce.com/services/data/v58.0",
"authentication": \{
"type": "oauth2",
"config": \{
"clientId": "...",
"clientSecret": "...",
"tokenUrl": "https://login.salesforce.com/services/oauth2/token"
\}
\}
\}Source: packages/spec/src/data/external-lookup.zod.ts
TypeScript Usage
import { ExternalDataSource, ExternalFieldMapping, ExternalLookup } from '@objectstack/spec/data';
import type { ExternalDataSource, ExternalFieldMapping, ExternalLookup } from '@objectstack/spec/data';
// Validate data
const result = ExternalDataSource.parse(data);ExternalDataSource
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| id | string | ✅ | Data source ID |
| name | string | ✅ | Data source name |
| type | Enum<'odata' | 'rest-api' | 'graphql' | 'custom'> | ✅ | Protocol type |
| endpoint | string | ✅ | API endpoint URL |
| authentication | Object | ✅ | Authentication |
ExternalFieldMapping
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| source | string | ✅ | Source field name |
| target | string | ✅ | Target field name |
| transform | Object | Object | Object | Object | Object | optional | Transformation to apply |
| defaultValue | any | optional | Default if source is null/undefined |
| type | string | optional | Field type |
| readonly | boolean | ✅ | Read-only field |
ExternalLookup
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| fieldName | string | ✅ | Field name |
| dataSource | Object | ✅ | External data source |
| query | Object | ✅ | Query configuration |
| fieldMappings | Object[] | ✅ | Field mappings |
| caching | Object | optional | Caching configuration |
| fallback | Object | optional | Fallback configuration |
| rateLimit | Object | optional | Rate limiting |
| retry | Object | optional | Retry configuration with exponential backoff |
| transform | Object | optional | Request/response transformation pipeline |
| pagination | Object | optional | Pagination configuration for external data |