This commit is contained in:
2023-08-08 17:46:39 +00:00
parent e381dd5a7e
commit 13d9662439
10 changed files with 193 additions and 214 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
import { LoginCtx } from "./ReqLogin";
import { SessionCtx } from "./StartSession";
import type { LoginCtx } from "./ReqLogin";
import type { SessionCtx } from "./StartSession";
import type { ProcDecoratorGenerator } from "./base";
import type { Request, Response } from "express";
+2 -2
View File
@@ -1,5 +1,5 @@
import { LoginCtx } from "./ReqLogin";
import { SessionCtx } from "./StartSession";
import type { LoginCtx } from "./ReqLogin";
import type { SessionCtx } from "./StartSession";
import type { ProcDecoratorGenerator } from "./base";
import type { Request, Response } from "express";
import { delay } from "../../util/delay.js";
+1 -1
View File
@@ -1,4 +1,4 @@
import { SessionCtx } from "./StartSession";
import type { SessionCtx } from "./StartSession";
import type { InvalidProc, ProcDecoratorGenerator } from "./base";
export type LoginCtx = {
+1 -1
View File
@@ -13,7 +13,7 @@ export type SessionCtx = {
export function StartSession<Q extends object = Empty>(): ProcDecoratorGenerator<SessionCtx, Q> {
return (inCtx) => {
const raw: object = {};
const raw: Record<string, unknown> = {};
return {
clearSession: () => Promise.resolve(),
deleteValue: async (key: string) => {
+1 -1
View File
@@ -9,7 +9,7 @@ export type InvalidProc = InvalidResponse & {
alreadyProcessed?: boolean;
};
export interface ProcDecorator<Out, In extends object = Record<string, never>> {
export interface ProcDecorator<Out extends object, In extends object = Record<string, never>> {
(inCtx: In, req: Request, res: Response, isValidRoute: boolean): MayBePromise<Out | InvalidProc>;
}