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.

file.upload

Upload a new file.

  • Type: operation (command)
  • Version: 1.0.0
  • Stability: stable
  • Owners: platform.files
  • Tags: files, upload
  • File: packages/libs/files/src/contracts/index.ts
  • field.key.label
    file.upload
    field.version.label
    1.0.0
    field.type.label
    operation (command)
    field.title.label
    file.upload
    field.description.label

    Upload a new file.

  • Type: operation (command)
  • Version: 1.0.0
  • Stability: stable
  • Owners: platform.files
  • Tags: files, upload
  • File: packages/libs/files/src/contracts/index.ts
  • field.tags.label
    files,upload
    field.owners.label
    platform.files
    field.stability.label
    stable

    Upload a new file.

    Goal

    Store a file and create a file record.

    Context

    Called when uploading files directly.

    Source Definition

    import { defineCommand, defineQuery } from '@lssm-tech/lib.contracts-spec';
    import { defineSchemaModel, ScalarTypeEnum } from '@lssm-tech/lib.schema';
    
    export const UploadFileContract = defineCommand({
    	meta: {
    		key: 'file.upload',
    		version: '1.0.0',
    		stability: 'stable',
    		owners: ['platform.files'],
    		tags: ['files', 'upload'],
    		description: 'Upload a new file.',
    		goal: 'Store a file and create a file record.',
    		context: 'Called when uploading files directly.',
    	},
    	io: {
    		input: UploadFileInput,
    		output: FileModel,
    		errors: {
    			FILE_TOO_LARGE: {
    				description: 'File exceeds size limit',
    				http: 413,
    				gqlCode: 'FILE_TOO_LARGE',
    				when: 'File size exceeds configured limit',
    			},
    			INVALID_MIME_TYPE: {
    				description: 'MIME type not allowed',
    				http: 415,
    				gqlCode: 'INVALID_MIME_TYPE',
    				when: 'File type is not in allowed list',
    			},
    		},
    	},
    	policy: {
    		auth: 'user',
    	},
    });