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 presigned URL for direct upload.
Goal
Enable direct-to-storage uploads.
Context
Called for large file uploads.
Source Definition
import { defineCommand, defineQuery } from '@lssm-tech/lib.contracts-spec';
import { defineSchemaModel, ScalarTypeEnum } from '@lssm-tech/lib.schema';
export const CreatePresignedUrlContract = defineCommand({
meta: {
key: 'file.presignedUrl.create',
version: '1.0.0',
stability: 'stable',
owners: ['platform.files'],
tags: ['files', 'presigned', 'upload'],
description: 'Create a presigned URL for direct upload.',
goal: 'Enable direct-to-storage uploads.',
context: 'Called for large file uploads.',
},
io: {
input: CreatePresignedUrlInput,
output: PresignedUrlModel,
errors: {
FILE_TOO_LARGE: {
description: 'File exceeds size limit',
http: 413,
gqlCode: 'FILE_TOO_LARGE',
when: 'Requested file size exceeds 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',
},
});