forma-log
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Descrição

Modulo NestJS para envio de logs do sistema.

Instalação

$ npm i forma-log

Como usar

AppModule.ts

import { Module } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { LogServiceModule } from 'forma-log';

@Module({
  imports: [
    LogServiceModule.registerAsync({
      useFactory: (configService: ConfigService) => {
        return {
          awsId: configService.get('ACCOUNT_ID_AWS'),
          awsKey: configService.get('ACCESS_KEY_AWS'),
          awsRegion: configService.get('SQS_REGION'),
          awsSecret: configService.get('SECRET_KEY_AWS'),
          irSistema: 1,
        };
      },
      inject: [ConfigService],
    }),
  ],
  providers: [],
  controllers: [],
})
export class AppModule {}

AlteraPermissaoUsuario.ts

import { ILogService } from 'forma-log';

export class AlteraPermissaoUsuario
{
  async executar(
    { idUsuario, irEmpresa }: { idUsuario: number, irEmpresa: number },
  ): Promise<string> {
  
    await this.logService.logar({
      idUsuario,
      irEmpresa,
      codigoFrase: 'ANY-001',
      parametros: [1],
    });

    return "Permissao alterada com sucesso!"
  }
}


Nest is MIT licensed.

Readme

Keywords

none

Package Sidebar

Install

npm i forma-log

Weekly Downloads

0

Version

1.1.0

License

ISC

Unpacked Size

31.1 kB

Total Files

33

Last publish

Collaborators

  • eduardo.forma