This commit is contained in:
tamaina 2023-05-02 17:31:17 +00:00
parent abefddb90e
commit ef15b9c0d3
6 changed files with 106 additions and 8 deletions

View file

@ -1,4 +1,5 @@
import { localUsernameSchema, passwordSchema } from "./schemas/user";
import type { JSONSchema7 } from 'json-schema-to-ts';
export type RolePolicies = {
gtlAvailable: boolean;
@ -33,7 +34,7 @@ export interface IEndpointMeta {
};
};
readonly defines: { req: Schema | undefined; res: Schema | undefined; }[];
readonly defines: ReadonlyArray<{ req: JSONSchema7 | undefined; res: JSONSchema7 | undefined; }>;
/**
*
@ -132,14 +133,13 @@ export const endpoints = {
required: ['username', 'password'],
},
res: {
type: 'object',
ref: 'User',
$ref: '/schemas/User',
properties: {
token: {
type: 'string',
},
required: ['token'],
},
required: ['token'],
},
}],
},
@ -159,4 +159,4 @@ export const endpoints = {
res: undefined,
}],
},
} as const;
} as const satisfies { [x: string]: IEndpointMeta; };