pasika 0.10.72 → 0.10.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eslint/pasika/index.js +550 -168
- package/dist/helpers/api-contract.d.ts +6 -2
- package/package.json +1 -1
|
@@ -4,12 +4,16 @@ import { HttpMethod } from './http-method.js';
|
|
|
4
4
|
declare const apiErrorResponseSchema: z.ZodObject<{
|
|
5
5
|
message: z.ZodString;
|
|
6
6
|
}, z.core.$strip>;
|
|
7
|
-
interface
|
|
7
|
+
interface ApiContractBase<TResponseSchema extends ZodType> {
|
|
8
8
|
readonly method: HttpMethod;
|
|
9
9
|
readonly path: string;
|
|
10
10
|
readonly responseSchema: TResponseSchema;
|
|
11
|
-
readonly requestSchema?: TRequestSchema;
|
|
12
11
|
}
|
|
12
|
+
type ApiContract<TResponseSchema extends ZodType = ZodType, TRequestSchema extends ZodType | undefined = undefined> = ApiContractBase<TResponseSchema> & (TRequestSchema extends ZodType ? {
|
|
13
|
+
readonly requestSchema: TRequestSchema;
|
|
14
|
+
} : {
|
|
15
|
+
readonly requestSchema?: undefined;
|
|
16
|
+
});
|
|
13
17
|
/**
|
|
14
18
|
* Declares one schema-validated JSON endpoint. Route, client, and mock import
|
|
15
19
|
* this same value so method, path, request validation, and response validation
|