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