endpoint返回参数增加statusCode声明

This commit is contained in:
wkj 2025-06-16 10:29:38 +08:00
parent f9625d9bc9
commit 8484b33da2
2 changed files with 2 additions and 0 deletions

1
lib/AppLoader.d.ts vendored
View File

@ -40,6 +40,7 @@ export declare class AppLoader<ED extends EntityDict & BaseEntityDict, Cxt exten
getEndpoints(prefix: string): [string, "post" | "get" | "put" | "delete", string, (params: Record<string, string>, headers: IncomingHttpHeaders, req: IncomingMessage, body?: any) => Promise<{
headers?: Record<string, string | string[]> | undefined;
data: any;
statusCode?: number | undefined;
}>][];
protected operateInWatcher<T extends keyof ED>(entity: T, operation: ED[T]['Update'], context: Cxt, singleton?: true): Promise<OperationResult<ED>>;
protected selectInWatcher<T extends keyof ED>(entity: T, selection: ED[T]['Selection'], context: Cxt, forUpdate?: true, singleton?: true): Promise<Partial<ED[T]["Schema"]>[]>;

View File

@ -324,6 +324,7 @@ export class AppLoader<ED extends EntityDict & BaseEntityDict, Cxt extends Backe
const endPointRouters: Array<[EndpointItem<ED, Cxt>['name'], EndpointItem<ED, Cxt>['method'], string, (params: Record<string, string>, headers: IncomingHttpHeaders, req: IncomingMessage, body?: any) => Promise<{
headers?: Record<string, string | string[]>;
data: any;
statusCode?: number;
}>]> = [];
const endPointMap: Record<string, true> = {};