2020-11-18 23:38:53 +01:00
2020-11-16 16:20:03 +01:00
2020-11-18 23:38:53 +01:00
2020-11-18 23:38:53 +01:00
2020-11-16 10:01:58 +01:00
2020-11-16 10:01:58 +01:00
2020-11-16 10:01:08 +01:00
2020-11-16 12:47:36 +01:00
2020-11-18 22:56:12 +01:00
2020-11-16 10:01:58 +01:00

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
No description provided
Readme 119 KiB
Languages
JavaScript 57.9%
TypeScript 42.1%