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.version.create

Create a new version of a file.

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

    Create a new version of a file.

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

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