@@ -15,44 +15,44 @@ import {
1515 benchmarkSummarySchema ,
1616} from '@/lib/benchmarks/types'
1717
18- export const benchmarkOrganizationParamsSchema = z . object ( { id : organizationIdSchema } )
19- export const benchmarkParamsSchema = benchmarkOrganizationParamsSchema . extend ( {
18+ const benchmarkOrganizationParamsSchema = z . object ( { id : organizationIdSchema } )
19+ const benchmarkParamsSchema = benchmarkOrganizationParamsSchema . extend ( {
2020 benchmarkId : z . string ( ) . min ( 1 ) . max ( 128 ) ,
2121} )
22- export const benchmarkRunParamsSchema = benchmarkParamsSchema . extend ( {
22+ const benchmarkRunParamsSchema = benchmarkParamsSchema . extend ( {
2323 runId : z . string ( ) . min ( 1 ) . max ( 128 ) ,
2424} )
25- export const listBenchmarksQuerySchema = z . object ( {
25+ const listBenchmarksQuerySchema = z . object ( {
2626 runAsUserId : z . string ( ) . min ( 1 ) . max ( 128 ) . optional ( ) ,
2727 cursor : z . string ( ) . min ( 1 ) . max ( 512 ) . optional ( ) ,
2828 limit : z . coerce . number ( ) . int ( ) . min ( 1 ) . max ( 50 ) . default ( 20 ) ,
2929} )
30- export const createBenchmarkBodySchema = z
30+ const createBenchmarkBodySchema = z
3131 . object ( {
3232 runAsUserId : z . string ( ) . min ( 1 ) . max ( 128 ) ,
3333 sourceWorkspaceId : workspaceIdSchema ,
3434 name : benchmarkNameSchema ,
3535 taskBrief : benchmarkBriefSchema . optional ( ) ,
3636 } )
3737 . strict ( )
38- export const updateBenchmarkBodySchema = benchmarkEditablePatchSchema
38+ const updateBenchmarkBodySchema = benchmarkEditablePatchSchema
3939 . extend ( { version : z . number ( ) . int ( ) . min ( 1 ) } )
4040 . strict ( )
41- export const deleteBenchmarkBodySchema = z . object ( { version : z . number ( ) . int ( ) . min ( 1 ) } ) . strict ( )
42- export const runBenchmarkStageBodySchema = deleteBenchmarkBodySchema
41+ const deleteBenchmarkBodySchema = z . object ( { version : z . number ( ) . int ( ) . min ( 1 ) } ) . strict ( )
42+ const runBenchmarkStageBodySchema = deleteBenchmarkBodySchema
4343 . extend ( { stage : benchmarkStageSchema , runLabel : benchmarkRunLabelSchema . optional ( ) } )
4444 . strict ( )
45- export const benchmarkResponseSchema = z . object ( { benchmark : benchmarkCaseSchema } )
46- export const listBenchmarksResponseSchema = z . object ( {
45+ const benchmarkResponseSchema = z . object ( { benchmark : benchmarkCaseSchema } )
46+ const listBenchmarksResponseSchema = z . object ( {
4747 benchmarks : z . array ( benchmarkSummarySchema ) . max ( 50 ) ,
4848 nextCursor : z . string ( ) . max ( 512 ) . nullable ( ) ,
4949} )
50- export const listBenchmarkRunsResponseSchema = z . object ( {
50+ const listBenchmarkRunsResponseSchema = z . object ( {
5151 runs : z . array ( benchmarkRunSummarySchema ) . max ( 50 ) ,
5252 nextCursor : z . string ( ) . max ( 512 ) . nullable ( ) ,
5353} )
54- export const benchmarkRunResponseSchema = z . object ( { run : benchmarkRunSchema } )
55- export const reviewBenchmarkRunBodySchema = z
54+ const benchmarkRunResponseSchema = z . object ( { run : benchmarkRunSchema } )
55+ const reviewBenchmarkRunBodySchema = z
5656 . object ( {
5757 version : z . number ( ) . int ( ) . min ( 1 ) ,
5858 blankId : benchmarkBlankSchema . shape . id ,
@@ -124,21 +124,16 @@ export const reviewBenchmarkRunContract = defineRouteContract({
124124 response : { mode : 'json' , schema : benchmarkRunResponseSchema } ,
125125} )
126126
127- export type ListBenchmarksResponse = z . infer < typeof listBenchmarksResponseSchema >
128127export type BenchmarkResponse = z . infer < typeof benchmarkResponseSchema >
129128export type BenchmarkCase = z . infer < typeof benchmarkCaseSchema >
130- export type BenchmarkSummary = z . infer < typeof benchmarkSummarySchema >
131129export type CreateBenchmarkBody = z . input < typeof createBenchmarkBodySchema >
132130export type UpdateBenchmarkBody = z . input < typeof updateBenchmarkBodySchema >
133131export type DeleteBenchmarkBody = z . input < typeof deleteBenchmarkBodySchema >
134132export type RunBenchmarkStageBody = z . input < typeof runBenchmarkStageBodySchema >
135133export type BenchmarkRun = z . infer < typeof benchmarkRunSchema >
136- export type BenchmarkRunSummary = z . infer < typeof benchmarkRunSummarySchema >
137- export type BenchmarkRunResponse = z . infer < typeof benchmarkRunResponseSchema >
138- export type ListBenchmarkRunsResponse = z . infer < typeof listBenchmarkRunsResponseSchema >
139134export type ReviewBenchmarkRunBody = z . input < typeof reviewBenchmarkRunBodySchema >
140135
141- export const benchmarkSelectionQuerySchema = z . object ( {
136+ const benchmarkSelectionQuerySchema = z . object ( {
142137 search : z . string ( ) . trim ( ) . max ( 200 ) . default ( '' ) ,
143138 cursor : z . string ( ) . min ( 1 ) . max ( 128 ) . optional ( ) ,
144139 selectedId : z . string ( ) . min ( 1 ) . max ( 128 ) . optional ( ) ,
@@ -148,25 +143,25 @@ const selectionOptionSchema = z.object({
148143 name : z . string ( ) . max ( 1_000 ) ,
149144} )
150145const userOptionSchema = selectionOptionSchema . extend ( { email : z . string ( ) . max ( 320 ) } )
151- export const benchmarkOrganizationsResponseSchema = z . object ( {
146+ const benchmarkOrganizationsResponseSchema = z . object ( {
152147 organizations : z . array ( selectionOptionSchema ) . max ( 50 ) ,
153148 selected : selectionOptionSchema . nullable ( ) ,
154149 nextCursor : z . string ( ) . max ( 128 ) . nullable ( ) ,
155150} )
156- export const benchmarkUsersResponseSchema = z . object ( {
151+ const benchmarkUsersResponseSchema = z . object ( {
157152 users : z . array ( userOptionSchema ) . max ( 50 ) ,
158153 selected : userOptionSchema . nullable ( ) ,
159154 nextCursor : z . string ( ) . max ( 128 ) . nullable ( ) ,
160155} )
161- export const benchmarkWorkspacesQuerySchema = benchmarkSelectionQuerySchema
156+ const benchmarkWorkspacesQuerySchema = benchmarkSelectionQuerySchema
162157 . omit ( { selectedId : true } )
163158 . extend ( { runAsUserId : z . string ( ) . min ( 1 ) . max ( 128 ) } )
164- export const benchmarkWorkspacesResponseSchema = z . object ( {
159+ const benchmarkWorkspacesResponseSchema = z . object ( {
165160 workspaces : z . array ( selectionOptionSchema ) . max ( 50 ) ,
166161 nextCursor : z . string ( ) . max ( 128 ) . nullable ( ) ,
167162 canPlan : z . boolean ( ) ,
168163} )
169- export const benchmarkAvailabilityResponseSchema = z . object ( { available : z . boolean ( ) } )
164+ const benchmarkAvailabilityResponseSchema = z . object ( { available : z . boolean ( ) } )
170165export const benchmarkOrganizationsContract = defineRouteContract ( {
171166 method : 'GET' ,
172167 path : '/api/benchmarks/organizations' ,
@@ -192,9 +187,3 @@ export const benchmarkAvailabilityContract = defineRouteContract({
192187 path : '/api/benchmarks/availability' ,
193188 response : { mode : 'json' , schema : benchmarkAvailabilityResponseSchema } ,
194189} )
195- export type BenchmarkSelectionQuery = z . input < typeof benchmarkSelectionQuerySchema >
196- export type BenchmarkWorkspacesQuery = z . input < typeof benchmarkWorkspacesQuerySchema >
197- export type BenchmarkOrganizationsResponse = z . output < typeof benchmarkOrganizationsResponseSchema >
198- export type BenchmarkUsersResponse = z . output < typeof benchmarkUsersResponseSchema >
199- export type BenchmarkWorkspacesResponse = z . output < typeof benchmarkWorkspacesResponseSchema >
200- export type BenchmarkAvailabilityResponse = z . output < typeof benchmarkAvailabilityResponseSchema >
0 commit comments