91ba224f79a677e38801824b594bb0e6ba67c234
Express Utils for Node Projects
Installation
1. Install the package
npm install git+https://git.biotronik.int/scm/coe-bs-website/node-pkg-express-utils.git
2. Copy the types
Copy the content below to any location within the source folder of your project and name it extend-request.d.ts.
It just needs to sit there with no more action required.
// extend-request.d.ts
declare global {
namespace Express {
interface Request {
// fetch user info (needs AuthProxy and some headers)
getUserInfo(): Promise<import('pkg-express-utils').UserInfo|undefined>;
// fetch user info (needed for HttpLogger)
noHttpLogging: boolean|undefined;
// permission details (after a Permission route)
permissionDetails: import('role-acl').Permission;
// switch session to another user;does not close old session (after Session router)
setSessionById(sessionId: string): Promise<boolean>;
}
interface Response {
// initialize a logout (needs AuthProxy and some headers)
initLogout(): boolean;
}
}
}
export {};
Description
Languages
JavaScript
57.9%
TypeScript
42.1%