0.0.22 • Published 3 years ago

elewis-ui-common v0.0.22

Weekly downloads
4
License
MIT
Repository
-
Last release
3 years ago

Common security modules

Overview

!!! This is an expermental module !!!

Provides a data transformation interceptor which adds workflow elements to all elements in an array of data.

Requires that method is decorated with the WorkflowConfig decorator

Install

npm install elewis-nestjs-workflow

Types

  • WorkflowTransoformationInterceptor

Usage

import { WorkflowTransformationInterceptor } from 'elewis-nestjs-workflow';
import { WorkflowTransformationInterceptor } from 'elewis-nestjs-workflow';
// etc.
@Get()
@Roles('admin')
@workflowConfig(workflow)         // Need this, it's injected into WorkflowInterceptor
@UseGuards(AuthGuard, RolesGuard)
@UseInterceptors(WorkflowTransormationInterceptor)
async findAll(
  @Headers('Authorization') authorzation: string,
): Promise<User[]> {
  return this.usersService.findAll();
}