@@ -11,8 +11,8 @@ import {
11
11
MethodInvalidError ,
12
12
newMethodInvalidError ,
13
13
} from "../spec" ;
14
- import { SSAnyApiResponses , SSApiSpec } from "../ss " ;
15
- import { SSApiEndpoints } from "../ss " ;
14
+ import { ApiResponsesSchema , ApiSpecSchema } from "../schema " ;
15
+ import { ApiEndpointsSchema } from "../schema " ;
16
16
import {
17
17
AnySpecValidator ,
18
18
listDefinedRequestApiSpecKeys ,
@@ -39,7 +39,7 @@ export type Validator<V extends AnyStandardSchemaV1 | undefined> =
39
39
: undefined ;
40
40
41
41
export type Validators <
42
- AS extends SSApiSpec ,
42
+ AS extends ApiSpecSchema ,
43
43
// FIXME
44
44
// eslint-disable-next-line @typescript-eslint/no-unused-vars
45
45
ParamKeys extends string ,
@@ -58,15 +58,15 @@ export type ResponseValidators<
58
58
Headers extends SS | undefined ,
59
59
> = ResponseSpecValidator < Validator < Body > , Validator < Headers > > ;
60
60
export type ToSSResponseValidators <
61
- Responses extends SSAnyApiResponses | undefined ,
61
+ Responses extends ApiResponsesSchema | undefined ,
62
62
SC extends number ,
63
63
> = ResponseValidators <
64
- Responses extends SSAnyApiResponses
64
+ Responses extends ApiResponsesSchema
65
65
? SC extends keyof Responses
66
66
? ApiResBody < Responses , SC >
67
67
: undefined
68
68
: undefined ,
69
- Responses extends SSAnyApiResponses
69
+ Responses extends ApiResponsesSchema
70
70
? SC extends keyof Responses
71
71
? ApiResHeaders < Responses , SC > extends SS
72
72
? ApiResHeaders < Responses , SC >
@@ -76,12 +76,12 @@ export type ToSSResponseValidators<
76
76
> ;
77
77
78
78
export type ToValidators <
79
- E extends SSApiEndpoints ,
79
+ E extends ApiEndpointsSchema ,
80
80
Path extends string ,
81
81
M extends string ,
82
82
> = Path extends keyof E
83
83
? M extends keyof E [ Path ] & Method
84
- ? E [ Path ] [ M ] extends SSApiSpec
84
+ ? E [ Path ] [ M ] extends ApiSpecSchema
85
85
? Validators < E [ Path ] [ M ] , string >
86
86
: Record < string , never >
87
87
: Record < string , never >
@@ -159,7 +159,7 @@ type ValidatorInputPathNotFoundError = ReturnType<
159
159
*
160
160
* @param endpoints API endpoints
161
161
*/
162
- export const newValidator = < E extends SSApiEndpoints > ( endpoints : E ) => {
162
+ export const newValidator = < E extends ApiEndpointsSchema > ( endpoints : E ) => {
163
163
const req = < Path extends string , M extends string > (
164
164
input : SpecValidatorGeneratorRawInput < Path , M > ,
165
165
) : Result < ToValidators < E , Path , M > , ValidatorInputError > => {
0 commit comments