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 new version of a file.
Goal
Upload a new version while preserving history.
Context
Called when updating a document.
Source Definition
import { defineCommand, defineQuery } from '@lssm-tech/lib.contracts-spec';
import { defineSchemaModel, ScalarTypeEnum } from '@lssm-tech/lib.schema';
export const CreateVersionContract = defineCommand({
meta: {
key: 'file.version.create',
version: '1.0.0',
stability: 'stable',
owners: ['platform.files'],
tags: ['files', 'version', 'create'],
description: 'Create a new version of a file.',
goal: 'Upload a new version while preserving history.',
context: 'Called when updating a document.',
},
io: {
input: CreateVersionInput,
output: FileVersionModel,
errors: {
FILE_NOT_FOUND: {
description: 'File does not exist',
http: 404,
gqlCode: 'FILE_NOT_FOUND',
when: 'File ID is invalid',
},
},
},
policy: {
auth: 'user',
},
});