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.

analytics.dashboard.create

Create a new analytics dashboard.

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

    Create a new analytics dashboard.

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

    Create a new analytics dashboard.

    Goal

    Allow users to create custom dashboards.

    Context

    Dashboard management.

    Source Definition

    import {
    	defineCommand,
    	defineQuery,
    } from '@lssm-tech/lib.contracts-spec/operations';
    import {
    	AddWidgetInputModel,
    	CreateDashboardInputModel,
    	DashboardModel,
    	GetDashboardInputModel,
    	ListDashboardsInputModel,
    	ListDashboardsOutputModel,
    	WidgetModel,
    } from './dashboard.schema';
    
    export const CreateDashboardContract = defineCommand({
    	meta: {
    		key: 'analytics.dashboard.create',
    		version: '1.0.0',
    		stability: 'stable',
    		owners: ['@example.analytics-dashboard'],
    		tags: ['analytics', 'dashboard', 'create'],
    		description: 'Create a new analytics dashboard.',
    		goal: 'Allow users to create custom dashboards.',
    		context: 'Dashboard management.',
    	},
    	io: { input: CreateDashboardInputModel, output: DashboardModel },
    	policy: { auth: 'user' },
    	sideEffects: {
    		emits: [
    			{
    				key: 'analytics.dashboard.created',
    				version: '1.0.0',
    				stability: 'stable',
    				owners: ['@example.analytics-dashboard'],
    				tags: ['analytics', 'dashboard', 'created'],
    				when: 'Dashboard created',
    				payload: DashboardModel,
    			},
    		],
    		audit: ['analytics.dashboard.created'],
    	},
    	acceptance: {
    		scenarios: [
    			{
    				key: 'create-dashboard-happy-path',
    				given: ['User is authenticated'],
    				when: ['User submits valid dashboard configuration'],
    				then: ['Dashboard is created', 'DashboardCreated event is emitted'],
    			},
    		],
    		examples: [
    			{
    				key: 'create-basic',
    				input: {
    					name: 'Revenue Dashboard',
    					description: 'Monthly revenue metrics',
    				},
    				output: { id: 'dash-123', name: 'Revenue Dashboard', widgets: [] },
    			},
    		],
    	},
    });