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