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.connection.create

Create a connection to an external system.

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

    Create a connection to an external system.

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

    Create a connection to an external system.

    Goal

    Authenticate with external systems.

    Context

    Connection setup.

    Emitted Events

    `integration.connection.created` (v1.0.0)

    Source Definition

    import { defineCommand } from '@lssm-tech/lib.contracts-spec/operations';
    import {
    	ConnectionModel,
    	CreateConnectionInputModel,
    } from './connection.schema';
    
    export const CreateConnectionContract = defineCommand({
    	meta: {
    		key: 'integration.connection.create',
    		version: '1.0.0',
    		stability: 'stable',
    		owners: ['@example.integration-hub'],
    		tags: ['integration', 'connection', 'create'],
    		description: 'Create a connection to an external system.',
    		goal: 'Authenticate with external systems.',
    		context: 'Connection setup.',
    	},
    	io: { input: CreateConnectionInputModel, output: ConnectionModel },
    	policy: { auth: 'user' },
    	sideEffects: {
    		emits: [
    			{
    				key: 'integration.connection.created',
    				version: '1.0.0',
    				when: 'Connection created',
    				payload: ConnectionModel,
    			},
    		],
    		audit: ['integration.connection.created'],
    	},
    	acceptance: {
    		scenarios: [
    			{
    				key: 'create-connection-happy-path',
    				given: ['User is authenticated'],
    				when: ['User creates connection with valid credentials'],
    				then: ['Connection is created', 'ConnectionCreated event is emitted'],
    			},
    		],
    		examples: [
    			{
    				key: 'connect-payments',
    				input: {
    					name: 'Stripe Prod',
    					integrationId: 'spec_payments_stripe',
    					credentials: { clientId: 'xxx' },
    				},
    				output: {
    					id: 'conn-123',
    					status: 'connected',
    					connectedAt: '2025-01-01T12:00:00Z',
    				},
    			},
    		],
    	},
    });