All files / layers / L1 / contracts runs.ts

62.5% Statements 5/8
100% Branches 0/0
50% Functions 3/6
62.5% Lines 5/8

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 3137x 1513x       11x                     2x         1x                  
import type { ApiContract } from '@/layers/interfaces'
import type { components } from '@/types/api'
 
type Run = components['schemas']['Run']
type CreateRunRequest = components['schemas']['CreateRunRequest']
type UpdateRunRequest = components['schemas']['UpdateRunRequest']
 
type RunListQuery = {
  [key: string]: string | number | boolean | undefined
}
 
export const runsContract: ApiContract<
  Run & { id: string },
  CreateRunRequest,
  UpdateRunRequest,
  RunListQuery
> = {
  idOf: (e) => e.run_id as string,
  entityPath: 'runs',
  endpoints: {
    list: '/runs',
    detail: (id) => `/runs/${id}`,
    create: '/runs',
    update: (id) => `/runs/${id}`,
  },
  subscription: {
    ssePath: '/api/v1/runs/events',
    entityName: 'run',
  },
}