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.

attachment.detach

Detach a file from an entity.

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

    Detach a file from an entity.

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

    Detach a file from an entity.

    Goal

    Remove a file association.

    Context

    Called when removing file from entity.

    Source Definition

    import { defineCommand, defineQuery } from '@lssm-tech/lib.contracts-spec';
    import { defineSchemaModel, ScalarTypeEnum } from '@lssm-tech/lib.schema';
    
    export const DetachFileContract = defineCommand({
    	meta: {
    		key: 'attachment.detach',
    		version: '1.0.0',
    		stability: 'stable',
    		owners: ['platform.files'],
    		tags: ['files', 'attachment', 'detach'],
    		description: 'Detach a file from an entity.',
    		goal: 'Remove a file association.',
    		context: 'Called when removing file from entity.',
    	},
    	io: {
    		input: DetachFileInput,
    		output: SuccessOutput,
    		errors: {
    			ATTACHMENT_NOT_FOUND: {
    				description: 'Attachment does not exist',
    				http: 404,
    				gqlCode: 'ATTACHMENT_NOT_FOUND',
    				when: 'Attachment ID is invalid',
    			},
    		},
    	},
    	policy: {
    		auth: 'user',
    	},
    });