All files / src/lib/api-docs/endpoints/dev labels.ts

100% Statements 65/65
100% Branches 0/0
100% Functions 0/0
100% Lines 65/65

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 661x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x  
/**
 * Dev Labels Endpoints
 * Development ticket labels management endpoints
 */
 
import type { ApiEndpoint } from '@/types/api-docs';
 
export const devLabelsEndpoints: ApiEndpoint[] = [
  {
    id: 'dev-labels-list',
    method: 'GET',
    path: '/api/dev/labels',
    summary: 'List labels',
    description: 'Returns all ticket labels with usage counts',
    category: 'dev-projects',
    requiresAuth: true,
    adminOnly: true,
    parameters: [
      { name: 'search', type: 'string', required: false, location: 'query', description: 'Search in name/description' },
    ],
    responses: [
      { status: 200, description: 'List of labels' },
    ],
  },
  {
    id: 'dev-labels-create',
    method: 'POST',
    path: '/api/dev/labels',
    summary: 'Create label',
    description: 'Creates a new ticket label',
    category: 'dev-projects',
    requiresAuth: true,
    adminOnly: true,
    requestBody: {
      contentType: 'application/json',
      fields: [
        { name: 'name', type: 'string', required: true, description: 'Label name (unique)' },
        { name: 'color', type: 'string', required: true, description: 'Label color (hex)' },
        { name: 'description', type: 'string', required: false, description: 'Label description' },
      ],
      example: { name: 'bug', color: '#ef4444', description: 'Bug reports' },
    },
    responses: [
      { status: 201, description: 'Label created' },
      { status: 400, description: 'Label name exists' },
    ],
  },
  {
    id: 'dev-labels-delete',
    method: 'DELETE',
    path: '/api/dev/labels',
    summary: 'Delete label',
    description: 'Deletes a label (disconnects from tickets)',
    category: 'dev-projects',
    requiresAuth: true,
    adminOnly: true,
    parameters: [
      { name: 'id', type: 'string', required: true, location: 'query', description: 'Label ID' },
    ],
    responses: [
      { status: 200, description: 'Label deleted' },
      { status: 404, description: 'Label not found' },
    ],
  },
];