Sebastian Seedorf 1ba81209c9 Update README.md
2020-11-17 13:37:26 +01:00
2020-11-16 16:20:03 +01:00
2020-11-16 17:06:34 +01:00
2020-11-17 00:23:36 +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-16 16:43:05 +01:00
2020-11-17 13:37:26 +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 UserInfo {
			email: string,
			email_verified: boolean,
			family_name: string,
			given_name: string,
			groups: string[],
			name: string,
			preferred_username: string,
			sub: string,
		}

		interface Request {
			getUserInfo(): Promise<Partial<UserInfo>|undefined>;
			noLogging: boolean|undefined;
			permissionDetails?: import('role-acl').Permission;
		}

		interface Response {
			initLogout(): boolean;
		}
	}
}

export {};
Description
No description provided
Readme 119 KiB
Languages
JavaScript 57.9%
TypeScript 42.1%