OSS-first docs
These docs teach the open system first: contracts, generated surfaces, runtimes, governance, and incremental adoption. Studio shows up as the operating layer on top, not as the source of truth.
Add a field mapping to a sync config.
Goal
Map fields between systems.
Context
Mapping configuration.
Emitted Events
•
`integration.fieldMapping.added` (v1.0.0)
Source Definition
import {
defineCommand,
defineQuery,
} from '@lssm-tech/lib.contracts-spec/operations';
import {
AddFieldMappingInputModel,
CreateSyncConfigInputModel,
FieldMappingModel,
ListSyncRunsInputModel,
ListSyncRunsOutputModel,
SyncConfigModel,
SyncRunModel,
TriggerSyncInputModel,
} from './sync.schema';
export const AddFieldMappingContract = defineCommand({
meta: {
key: 'integration.fieldMapping.add',
version: '1.0.0',
stability: 'stable',
owners: ['@example.integration-hub'],
tags: ['integration', 'mapping', 'field'],
description: 'Add a field mapping to a sync config.',
goal: 'Map fields between systems.',
context: 'Mapping configuration.',
},
io: { input: AddFieldMappingInputModel, output: FieldMappingModel },
policy: { auth: 'user' },
sideEffects: {
emits: [
{
key: 'integration.fieldMapping.added',
version: '1.0.0',
when: 'Mapping added',
payload: FieldMappingModel,
},
],
},
acceptance: {
scenarios: [
{
key: 'add-mapping-happy-path',
given: ['Sync config exists'],
when: ['User adds field mapping'],
then: ['Mapping is added', 'FieldMappingAdded event is emitted'],
},
],
examples: [
{
key: 'map-email',
input: {
syncConfigId: 'sync-123',
sourceField: 'email',
targetField: 'user_email',
},
output: { id: 'map-456', type: 'string' },
},
],
},
});