ContractSpec docs

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.

files

File storage, attachments, and media processing with presigned URLs

  • Type: feature
  • Version: 1.0.0
  • Stability: stable
  • Owners: @platform.files
  • Tags: files, upload, attachments, storage
  • field.key.label
    files
    field.version.label
    1.0.0
    field.type.label
    feature
    field.title.label
    files
    field.description.label

    File storage, attachments, and media processing with presigned URLs

  • Type: feature
  • Version: 1.0.0
  • Stability: stable
  • Owners: @platform.files
  • Tags: files, upload, attachments, storage
  • field.tags.label
    files,upload,attachments,storage
    field.owners.label
    @platform.files
    field.stability.label
    stable

    File storage, attachments, and media processing with presigned URLs

    Operations (12)

    `file.upload` (v1.0.0)

    `file.update` (v1.0.0)

    `file.delete` (v1.0.0)

    `file.get` (v1.0.0)

    `file.list` (v1.0.0)

    `file.downloadUrl` (v1.0.0)

    `file.presignedUrl.create` (v1.0.0)

    `file.version.create` (v1.0.0)

    `file.version.list` (v1.0.0)

    `attachment.attach` (v1.0.0)

    `attachment.detach` (v1.0.0)

    `attachment.list` (v1.0.0)

    Events (8)

    `file.uploaded` (v1.0.0)

    `file.updated` (v1.0.0)

    `file.deleted` (v1.0.0)

    `file.version_created` (v1.0.0)

    `attachment.attached` (v1.0.0)

    `attachment.detached` (v1.0.0)

    `upload.session_started` (v1.0.0)

    `upload.session_completed` (v1.0.0)

    Source Definition

    /**
     * Files Feature Module Specification
     *
     * Defines the feature module for file management capabilities.
     */
    import { defineFeature } from '@lssm-tech/lib.contracts-spec';
    
    /**
     * Files feature module that bundles file storage,
     * attachments, and media processing capabilities.
     */
    export const FilesFeature = defineFeature({
    	meta: {
    		key: 'files',
    		version: '1.0.0',
    		title: 'File Management',
    		description:
    			'File storage, attachments, and media processing with presigned URLs',
    		domain: 'platform',
    		owners: ['@platform.files'],
    		tags: ['files', 'upload', 'attachments', 'storage'],
    		stability: 'stable',
    	},
    
    	// All contract operations included in this feature
    	operations: [
    		// File CRUD operations
    		{ key: 'file.upload', version: '1.0.0' },
    		{ key: 'file.update', version: '1.0.0' },
    		{ key: 'file.delete', version: '1.0.0' },
    		{ key: 'file.get', version: '1.0.0' },
    		{ key: 'file.list', version: '1.0.0' },
    		{ key: 'file.downloadUrl', version: '1.0.0' },
    		{ key: 'file.presignedUrl.create', version: '1.0.0' },
    
    		// Version operations
    		{ key: 'file.version.create', version: '1.0.0' },
    		{ key: 'file.version.list', version: '1.0.0' },
    
    		// Attachment operations
    		{ key: 'attachment.attach', version: '1.0.0' },
    		{ key: 'attachment.detach', version: '1.0.0' },
    		{ key: 'attachment.list', version: '1.0.0' },
    	],
    
    	// Events emitted by this feature
    	events: [
    		// File events
    		{ key: 'file.uploaded', version: '1.0.0' },
    		{ key: 'file.updated', version: '1.0.0' },
    		{ key: 'file.deleted', version: '1.0.0' },
    		{ key: 'file.version_created', version: '1.0.0' },
    
    		// Attachment events
    		{ key: 'attachment.attached', version: '1.0.0' },
    		{ key: 'attachment.detached', version: '1.0.0' },
    
    		// Upload session events
    		{ key: 'upload.session_started', version: '1.0.0' },
    		{ key: 'upload.session_completed', version: '1.0.0' },
    	],
    
    	// No presentations for this library feature
    	presentations: [],
    	opToPresentation: [],
    	presentationsTargets: [],
    
    	// Capability definitions
    	capabilities: {
    		provides: [
    			{ key: 'files', version: '1.0.0' },
    			{ key: 'attachments', version: '1.0.0' },
    		],
    		requires: [{ key: 'identity', version: '1.0.0' }],
    	},
    });