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.

integration.fieldMapping.add

Add a field mapping to a sync config.

  • Type: operation (command)
  • Version: 1.0.0
  • Stability: stable
  • Owners: @example.integration-hub
  • Tags: integration, mapping, field
  • File: packages/examples/integration-hub/src/sync/sync.operations.ts
  • field.key.label
    integration.fieldMapping.add
    field.version.label
    1.0.0
    field.type.label
    operation (command)
    field.title.label
    integration.fieldMapping.add
    field.description.label

    Add a field mapping to a sync config.

  • Type: operation (command)
  • Version: 1.0.0
  • Stability: stable
  • Owners: @example.integration-hub
  • Tags: integration, mapping, field
  • File: packages/examples/integration-hub/src/sync/sync.operations.ts
  • field.tags.label
    integration,mapping,field
    field.owners.label
    @example.integration-hub
    field.stability.label
    stable

    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' },
    			},
    		],
    	},
    });