open-index/open-npm huggingface dataset:
npm package: @nest-js/aws
Description: NestJS aws library
Author: Yasniel Fajardo
Latest version: 0.0.6

# Módulo AWS para NestJS

### @nest-js/aws

[![npm version](https://img.shields.io/npm/v/@nest-js/aws.svg)](https://www.npmjs.com/package/@nest-js/aws)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)


Este módulo proporciona una integración sencilla con varios servicios de AWS para aplicaciones NestJS.

## Instalación

El módulo está incluido en el proyecto. Para utilizarlo, importa `AwsModule` en tu módulo:

```typescript
import { AwsModule } from './aws/aws.module';

@Module({
  imports: [AwsModule],
})
export class YourModule {}
```

## Configuración

### Credenciales Obligatorias

Estas variables de entorno son **requeridas** para cualquier servicio de AWS:

```env
AWS_REGION=us-east-1
AWS_ACCESS_KEY_ID=your-access-key
AWS_SECRET_ACCESS_KEY=your-secret-key
```

### Configuración por Servicio

Configura solo las variables de entorno correspondientes a los servicios que vayas a utilizar:

#### Cognito (Autenticación y gestión de usuarios)
```env
AWS_COGNITO_USER_POOL_ID=your-user-pool-id
AWS_COGNITO_CLIENT_ID=your-client-id
```

#### S3 (Almacenamiento de objetos)
```env
AWS_S3_BUCKET=your-bucket-name
```

#### DynamoDB (Base de datos NoSQL)
```env
AWS_DYNAMODB_TABLE=your-table-name
```

#### SQS (Sistema de colas)
```env
AWS_SQS_QUEUE_URL=your-queue-url
```

#### SNS (Servicio de notificaciones)
```env
AWS_SNS_TOPIC_ARN=your-topic-arn
```

#### SES (Servicio de envío de correos)
```env
AWS_SES_SENDER_EMAIL=no-reply@yourdomain.com
```

#### AppSync (API GraphQL)
```env
AWS_APPSYNC_API_URL=your-appsync-api-url
AWS_APPSYNC_API_KEY=your-appsync-api-key
```

## Uso

Puedes inyectar los servicios que necesites en tus controladores o servicios:

```typescript
import { CognitoService } from './aws/cognito/cognito.service';
import { S3Service } from './aws/s3/s3.service';

@Injectable()
export class YourService {
  constructor(
    private readonly cognitoService: CognitoService, // Solo si usas Cognito
    private readonly s3Service: S3Service, // Solo si usas S3
  ) {}

  async example() {
    // Usar los servicios según necesites
  }
}
```

## Servicios Disponibles

- **Cognito**: Autenticación y gestión de usuarios
- **S3**: Almacenamiento de objetos
- **DynamoDB**: Base de datos NoSQL
- **SQS**: Sistema de colas
- **SNS**: Servicio de notificaciones
- **SES**: Servicio de envío de correos
- **AppSync**: API GraphQL gestionada

Cada servicio tiene su propia documentación detallada en su respectivo directorio.
npm package: @nest-js/circuit-breaker
Description: NestJS circuit breaker library
Author: Yasniel Fajardo
Latest version: 0.1.4

# Circuit Breaker

### @nest-js/circuit-breaker

[![npm version](https://img.shields.io/npm/v/@nest-js/circuit-breaker.svg)](https://www.npmjs.com/package/@nest-js/circuit-breaker)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Una implementación del patrón Circuit Breaker para NestJS que ayuda a manejar fallos en sistemas distribuidos, para evitar que las solicitudes se acumulen en un punto crítico.

## Instalación

```bash
npm install @nest-js/circuit-breaker
```
## Uso
```typescript
import { Module } from '@nestjs/common';
import { CircuitBreakerModule } from '@nest-js/circuit-breaker';
@Module({
  imports: [
    CircuitBreakerModule
  ]
})
export class AppModule {}
```

### Controlador
```typescript
import { Controller, Get, ServiceUnavailableException } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { CircuitBreakerResponseDto } from './circuit-breaker.response.dto';
import { CircuitBreaker } from 'src/lib/decorators/circuit-breaker.decorator';

@ApiTags('Circuit Breaker Test')
@Controller('/circuit-breaker')
export class CircuitBreakerController {

  @CircuitBreaker({
    successThreshold: 3, // 3 respuestas exitosas para cerrar el circuito
    openToHalfOpenWaitTime: 30000, // 30 seconds
    failureThreshold: 1, // 1 respuesta fallida para abrir el circuito
    fallback: (status) => {
      console.log('Circuit breaker is open: ', status);
      throw new ServiceUnavailableException(
        'Circuit breaker is open. Please try again later.',
      );
    },
  })
  @Get('/test')
  public async testCircuitBreaker(): Promise<CircuitBreakerResponseDto> {
    // Simular latencia
    await new Promise(resolve => setTimeout(resolve, 500));

    // Simular error aleatorio (50% de probabilidad)
    if (Math.random() < 0.5) {
      console.log('Error simulado');
      throw new Error('Service Failure');
    }

    // Respuesta exitosa
    return {
      status: 'ok',
    };
  }
}
```
npm package: @nest-js/error-manager
Description: NestJS error manager library
Author: Yasniel Fajardo
Latest version: 0.0.6

# Módulo Error Manager

### @nest-js/error-manager

[![npm version](https://img.shields.io/npm/v/@nest-js/error-manager.svg)](https://www.npmjs.com/package/@nest-js/error-manager)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)


El módulo Error Manager implementa el estándar [RFC 7807 Problem Details](https://datatracker.ietf.org/doc/html/rfc7807) para el manejo uniforme de errores en APIs HTTP. Este estándar proporciona una forma estructurada y consistente de devolver información de error a los clientes, facilitando el diagnóstico y la resolución de problemas.

#### Características principales

- Implementación completa del estándar RFC 7807 Problem Details
- Generación automática de IDs de rastreo (traceId) para cada error
- Páginas HTML de documentación para cada tipo de error
- Filtro global para capturar y transformar todas las excepciones
- Integración con el sistema de logging

# Uso

### Importación del módulo

El módulo está marcado como `@Global()`, por lo que solo necesitas importarlo una vez en el módulo raíz de tu aplicación:

```typescript
import { ErrorManagerModule } from './app/error-manager/error-manager.module';

@Module({
    imports: [ErrorManagerModule.forRoot({
        descriptions: {
            unauthorized: 'Mensaje personalizado para no autorizado',
            // ... otros mensajes
        },
        solutions: {
            unauthorized: [
                'Solución personalizada 1',
                'Solución personalizada 2'
            ],
            // ... otras soluciones
        }
    })],
})
export class AppModule { }
```
#### Ejemplo de Html Autogenerado
![Ejemplo de Html Autogenerado](./images/error-manager-example.png)


### Acceder a la documentación de errores

La documentación HTML para cada tipo de error está disponible en:

```
GET /errors/:errorType
```

Por ejemplo: `/errors/unauthorized` mostrará la documentación para errores de tipo "unauthorized".

## Beneficios

- **Consistencia**: Todas las respuestas de error siguen el mismo formato
- **Trazabilidad**: Cada error tiene un ID único para facilitar su seguimiento
- **Documentación**: Páginas HTML automáticas para cada tipo de error
- **Cumplimiento de estándares**: Implementación del RFC 7807 ampliamente adoptado
- **Facilidad de depuración**: Información detallada para desarrolladores y usuarios

## Campos

- **type**: URI que identifica el tipo de problema y apunta a la documentación HTML
- **title**: Resumen breve y legible del problema
- **status**: Código de estado HTTP
- **detail**: Explicación detallada del problema
- **instance**: URI que identifica la instancia específica del problema
- **timestamp**: Marca de tiempo cuando ocurrió el error
- **traceId**: Identificador único de rastreo para el error
- **errors**: Detalles adicionales sobre errores específicos (ej. errores de validación)
npm package: @nest-js/gcp
Description: NestJS gcp library
Author: Yasniel Fajardo
Latest version: 0.0.2

# Módulo GCP para NestJS

### @nest-js/gcp

[![npm version](https://img.shields.io/npm/v/@nest-js/gcp.svg)](https://www.npmjs.com/package/@nest-js/gcp)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Este módulo proporciona una integración completa con los servicios de Google Cloud Platform (GCP) para aplicaciones NestJS.

## Servicios Incluidos

- **Cloud Storage**: Almacenamiento de objetos y archivos
- **Cloud Pub/Sub**: Sistema de mensajería y eventos
- **Cloud Scheduler**: Programación de tareas
- **Cloud BigQuery**: Análisis de datos
- **Cloud Datastore**: Base de datos NoSQL
- **Cloud Firestore**: Base de datos en tiempo real

## Configuración

```typescript
// .env
GCP_PROJECT_ID=tu-proyecto-id
GCP_CLIENT_EMAIL=tu-client-email
GCP_PRIVATE_KEY=tu-private-key

// app.module.ts
import { GcpModule } from './gcp/gcp.module';

@Module({
  imports: [GcpModule],
})
export class AppModule {}
```

## Ejemplos de Uso

### Cloud Storage
```typescript
@Injectable()
export class AppService {
  constructor(private readonly storageService: StorageService) {}

  async uploadFile(file: Buffer) {
    const url = await this.storageService.uploadFile('mi-bucket', 'archivo.pdf', file);
    return url;
  }
}
```

### Cloud Pub/Sub
```typescript
@Injectable()
export class AppService {
  constructor(private readonly pubsubService: PubSubService) {}

  async publishEvent(data: any) {
    await this.pubsubService.publishMessage('mi-topic', data);
  }

  async setupSubscription() {
    await this.pubsubService.subscribe('mi-subscription', async (message) => {
      console.log('Mensaje recibido:', message);
    });
  }
}
```

### Cloud Scheduler
```typescript
@Injectable()
export class AppService {
  constructor(private readonly schedulerService: SchedulerService) {}

  async scheduleJob() {
    await this.schedulerService.createHttpJob({
      name: 'mi-job',
      schedule: '0 * * * *',
      url: 'https://mi-api.com/endpoint',
      httpMethod: 'POST',
      body: { data: 'ejemplo' }
    });
  }
}
```

## Contribución
Si deseas contribuir al desarrollo de este módulo, por favor revisa las guías de contribución y envía tus pull requests.

## Licencia
MIT
npm package: @nest-js/generic-mapper
Description: NestJS generic mapper library
Author: Yasniel Fajardo
Latest version: 0.0.4

# Generic Mapper Module

[![npm version](https://img.shields.io/npm/v/@nest-js/generic-mapper.svg)](https://www.npmjs.com/package/@nest-js/generic-mapper)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Módulo de mapeo automático y flexible para aplicaciones NestJS, diseñado para transformar objetos entre diferentes tipos de manera eficiente y tipo-segura.

## Características Principales

- 🔄 Mapeo automático basado en nombres de propiedades
- 🎯 Sistema de decoradores para control preciso
- 🛠 Transformaciones personalizables
- 📦 Soporte para objetos anidados y arrays
- ⚡ Alto rendimiento y tipo-seguro

## Instalación

```bash
npm install @nest-js/generic-mapper
```

## Configuración

```typescript
import { MapperModule } from '@nest-js/generic-mapper';

@Module({
  imports: [MapperModule],
})
export class AppModule {}
```

## Decoradores Disponibles

### @MapFrom(sourceKey: string)
Mapea una propiedad desde un campo con nombre diferente.

```typescript
export class UserDto {
  @MapFrom('firstName')
  name: string;
}
```

### @Transform(transformFn: (value: any) => any)
Aplica una transformación personalizada al valor.

```typescript
export class UserDto {
  @Transform(value => new Date(value))
  createdAt: Date;

  @Transform(value => value.join(', '))
  tags: string;
}
```

### @Ignore()
Excluye una propiedad del proceso de mapeo.

```typescript
export class UserDto {
  @Ignore()
  temporaryData: string;
}
```

### @Required()
Marca una propiedad como obligatoria durante el mapeo.

```typescript
export class UserDto {
  @Required()
  id: number;
}
```

## Ejemplos de Uso

### Mapeo Básico

```typescript
@Injectable()
export class UserService {
  constructor(private readonly mapperService: MapperService) {}

  async createUser(dto: CreateUserDto): Promise<User> {
    return this.mapperService.map(dto, User);
  }
}
```

### Mapeo de Arrays

```typescript
const userDtos = [dto1, dto2, dto3];
const users = this.mapperService.mapArray(userDtos, User);
```

### Mapeo Bidireccional

```typescript
@Injectable()
export class UserMapper {
  constructor(private readonly mapperService: MapperService) {}

  toEntity(dto: UserDto): User {
    return this.mapperService.map(dto, User);
  }

  toDto(entity: User): UserDto {
    return this.mapperService.map(entity, UserDto);
  }
}
```

### Transformaciones Avanzadas

```typescript
export class ProductDto {
  @Transform(price => {
    if (typeof price === 'string') return parseFloat(price);
    return price;
  })
  price: number;

  @Transform(tags => Array.isArray(tags) ? tags : tags.split(','))
  tags: string[];
}
```

## Licencia

MIT
npm package: @nest-kr/config
Description: ```cli npm i @nest-kr/config ```
Author: lucas
Latest version: 0.0.7

# Nest-kr/config

This library load and validate environment variables

### Installation

```sh
$ npm install --save @nest-kr/config
```

### How to use

Set config file with @Config(key). you have to pass key for finding your config from ConfigService.

```ts
import { Transform } from 'class-transformer';
import { IsNumber } from 'class-validator';

import { Config } from '../src/Config';

@Config('app')
export class AppConfig {
    @IsNumber()
    public port: number = parseInt(process.env.PORT, 10);

    @IsString()
    public serviceId: string = process.env.SERVICE_ID;
}
```

Register your config files to ConfigModule

```ts
import {ConfigModule} from '@nest-kr/config';

@Module({
    imports: [ConfigModule.forRoot(AppConfig, ...)],
})
export class AppModule {}
```

Get your config from ConfigService using key

```ts
// in bootstrap
import {ConfigService} from '@nest-kr/config';

async function bootstrap(){
    const app = await NestFactory.create(AppModule);
    const configService: ConfigService = app.get(ConfigService);

    const appConfig:AppConfig = configService.get('app');
    ...
}

// in class
@Injectable()
class TestService{

    constructor(private configService: ConfigService){}

    async function test(){
        const appConfig: AppConfig = this.configService.get('app');
    }
}

```
npm package: @nest-kr/cqrs
Description: ```cli npm i @nest-kr/cqrs ```
Author: lucas
Latest version: 0.0.7

# Nest-kr/cqrs

This library is for CQRS

### Installation

```sh
$ npm install --save @nest-kr/cqrs
```

### How to use

### Command

Import CqrsModule
This module provides CommandBus and QueryBus

```ts
import {CqrsModule} from '@nest-kr/cqrs';

@Module({
    imports: [CqrsModule],
    controllers: [],
})
export class AppModule {}
```

Create Command
```ts
import { Command } from '@nest-kr/cqrs';

export class CreateUserCommand implements Command {
    ...
}

```

Create CommandResult (Optional)
```ts
import { CommandResult } from '@nest-kr/cqrs';

export class CreateUserResult implements CommandResult {
    ...
}

```


Create CommandHandler
```ts
@Injectable()
export class UserCommandService {
    ...

    @CommandHandler(CreateUserCommand)
    async create(command: CreateUserCommand): Promise<CreateUserResult> {
        
        return new CreateUserResult();
    }
```


Execute command
```ts
@Controller('users')
export class UserController {
    constructor(private readonly commandBus: CommandBus) {}

    @Post('/')
    async create() {
        const result: CreateUserResult = await this.commandBus.execute(new CreateUserCommand());
        return { message: 'user created', result };
    }
    ...
}
```


### Query

Import CqrsModule
This module provides CommandBus and QueryBus

```ts
import {CqrsModule} from '@nest-kr/cqrs';

@Module({
    imports: [CqrsModule],
    controllers: [],
})
export class AppModule {}
```

Create Query
```ts
import { Query } from '@nest-kr/cqrs';

export class GetUserQuery implements Query {
    ...
}

```

Create QueryResult
```ts
import { QueryResult } from '@nest-kr/cqrs';

export class GetUserQueryResult implements QueryResult {
    ...
}

```


Create QueryHandler
```ts
@Injectable()
export class UserQueryService {
    ...

    @QueryHandler(GetUserQuery)
    async create(query: GetUserQuery): Promise<GetUserQueryResult> {
        
        return new GetUserQueryResult();
    }
```


Execute query
```ts
@Controller('users')
export class UserController {
    constructor(private readonly queryBus: QueryBus) {}

    @Get('/:id')
    async get() {
        ...
        const result: GetUserQueryResult = await this.queryBus.execute(new GetUserQuery());
        return { message: 'get user', result };
    }
    ...
}
```
npm package: @nest-kr/ddd
Description: ```cli npm i @nest-kr/ddd ```
Author: lucas
Latest version: 3.0.0

# Nest-kr/ddd

This library is for DDD

### Installation

```sh
$ npm install --save @nest-kr/ddd
```

### How to use

### Import DDDModule

This will automatically register DomainEventHandlers to a DomainEventDispatcher.

```ts
import {DDDModule} from '@nest-kr/ddd';

@Module({
    imports: [DDDModule],
    providers: [UserDomainEventService],
})
export class AppModule {}
```

### ValueObject

```ts
import {ValueObject} from '@nest-kr/ddd';

class Address extends ValueObject<Address>{

}
```

### Identity

```ts
import {Identity} from '@nest-kr/ddd';

class Identity extends Identity<UserId>{

}
```


### Entity

```ts
import {Entity} from '@nest-kr/ddd';

class User extends Entity<User, UserId>{

}
```


### AggregateRoot

```ts
import {AggregateRoot} from '@nest-kr/ddd';

class Order extends AggregateRoot<Order, OrderId>{

}
```


### Domain Event

```ts
import {DomainEvent} from '@nest-kr/ddd';

class UserCreated extends DomainEvent{

}
```

### Domain Event Handler

```ts
import { Injectable } from '@nestjs/common';
import { DomainEventHandler } from '@nest-kr/ddd';

import { UserCreated } from '../../domain/events/UserCreated';

@Injectable()
export class UserDomainEventService {
    @DomainEventHandler(UserCreated)
    public handleUserCreated(userCreated: UserCreated): void {

    }
}

```

### Domain Event Dispatcher
```ts

import { Repository, DomainEventDispatcher } from '@nest-kr/ddd';
import { Injectable } from '@nestjs/common';
...

@Injectable()
export class UserRepository extends Repository<User, UserId> {
    constructor(
        private readonly mapper: UserMapper,
        private readonly domainEventDispatcher: DomainEventDispatcher,
    ) {
        super();
    }


    async save(user: User): Promise<void> {
        const entity = this.mapper.toEntity(user);
        await this.ormRepository().save(entity);

        // Get domain events from aggregate root and dispatch all
        const events = user.getDomainEvents();
        this.domainEventDispatcher.dispatch(events);
    }

    ...

}

```
npm package: @nest-kr/request-storage
Description: ```cli npm i @nest-kr/request-storage ```
Author: lucas
Latest version: 0.0.10

# Nest-kr/request-storage

This library for handling data per request.
you can set and get data from storage which is maintained during the request scope.
It uses cls-hooked internally and compatible with nest.js.

### Installation

```sh
$ npm install --save @nest-kr/request-storage
```

### How to use

#### Configure module

```ts
const app = await NestFactory.create(AppModule);
const requestStorage = app.get(RequestStorage);

app.use(RequestStorageMiddleware(requestStorage));
```

If you don't pass RequestStorage, RequestStorageMiddleware will create a new RequestStorage;

```ts
const app = await NestFactory.create(AppModule);

app.use(RequestStorageMiddleware());
```

#### Use RequestStorage

You can save a data and get the data from everywhere.
data will be maintained during the request scope.

```ts
import { RequestStorage } from '@nest-kr/request-storage';

@Controller('users')
export class UserController {
  constructor(private requestStorage: RequestStorage) {}

  @Post('/')
  async create() {
    this.requestStorage.set('key', 'value');
    ...
  }
}

...


import {Injectable} from '@nestjs/common';
import { Transaction } from '@nest-kr/transaction';

@Injectable()
export class UserService {
    constructor(
        private requestStorage: RequestStorage,
    ){}

    async create(event: IntegrationEvent): Promise<void> {
        ...
        const data = this.requestStorage.get('key');
        ...
    }
}

```


#### Use RequestStorage with RequestInterceptor

Create RequestInterceptor 

```ts
import { RequestInterceptor, RequestStorage } from '@nest-kr/request-storage';

export const AUTH_INFORMATION_KEY = 'AUTH_INFORMATION_KEY';

export class AuthInterceptor implements RequestInterceptor {
  intercept(req: any, requestStorage: RequestStorage): void {
    const headers = req.headers;
    const userId: string = headers['user-id'] || '';
    const userAgent: string = headers['user-agent'] || '';

    requestStorage.set(AUTH_INFORMATION_KEY, {
      userId,
      userAgent
    });
  }
}
```

Add RequestInterceptor

```ts
const app = async NestFactory.create(AppModule);
const requestStorage = app.get(RequestStorage);
const authInterceptor = app.get(AuthInterceptor); // or new AuthInterceptor();

app.use(RequestStorageMiddleware(requestStorage, [authInterceptor]));

```

Use RequestStorage
```ts

@Injectable()
export class UserService {
    constructor(
        private requestStorage: RequestStorage,
    ){}

    async handle(event: UserCreatedEvent): Promise<void> {
        ...
        const {userID, userAgent} = this.requestStorage.get(AUTH_INFORMATION_KEY');
        ...

    }
}
```
npm package: @nest-kr/transaction
Description: ```cli npm i @nest-kr/transaction ```
Author: lucas
Latest version: 0.0.26

# Nest-kr/transaction

This library handles transaction per request using decorator.
It uses typeorm and cls-hooked internally and compatible with nest.js.

### Installation

```sh
$ npm install --save @nest-kr/transaction
```

### How to use

- Configure module (provide Transaction and set TransactionMiddleware)
```ts
import { TransactionMiddleware, Transaction } from '@nest-kr/transaction';
import { getConnection } from 'typeorm';

@Module({
  controllers: [UserController],
  providers: [
    { provide: 'Transaction', useClass: Transaction },
    { provide: 'UserRepository', useClass: UserRepository },
    { provide: 'UserMapper', useClass: UserMapper },
    ... 
  ],
})
export class UserModule implements NestModule {
  configure(consumer: MiddlewareConsumer) {
    consumer
      .apply(TransactionMiddleware(getConnection))
      .forRoutes(UserController);
  }
}
```

- Create Repository using Transaction
```ts
import {Injectable} from '@nestjs/common';
import { Transaction } from '@nest-kr/transaction';

@Injectable()
export class UserRepository {
    constructor(
        @Inject('UserMapper') private mapper: UserMapper,
        @Inject('Transaction') private transaction: Transaction,
    ){}
    
    async save(domain: User): Promise<void> {
        const entity = this.mapper.toEntity(domain);
        
        await this.transaction
          .entityManager()
          .getRepository(PageEntity)
          .save(entity);
    }
}
```

- Use @Transactional for handling transaction per request.
```ts
@Injectable()
export class UserCommandService {
  constructor(
    @Inject('UserRepository') private userRepository: UserRepository,
    @Inject('UserFactory') private userFactory: UserFactory,
  ) {}

  @Transactional()
  async create(command: CreateUserCommand): Promise<CreateUserResult> {
    const user: User = this.userFactory.create(this.userRepository.nextId());
    await this.userRepository.save(user);

    return new CreateUserResult(user.id.key);
  }
}
npm package: @nest-lab/fastify-multer
Description: A File Upload package for NestJS when using fastify
Author: Jay McDoniel
Latest version: 1.3.0

# @nest-lab/fastify-multer

Support for File Uploads when using the [`@nestjs/platform-fastify`](https://docs.nestjs.com/techniques/performance) adapter, using the [`fastify-multer`](https://www.npmjs.com/package/fastify-multer) library.

## Installation

Simple install, 

```shell
npm i @nest-lab/fastify-multer
yarn add @nest-lab/fastify-multer
pnpm i @nest-lab/fastify-multer
```

## Usage

Use this exactly like you would the [`MulterModule`](https://docs.nestjs.com/techniques/file-upload) from `@nestjs/platform-express`. The only difference is there is also a `NoFilesInterceptor` for when you jsut want to parse `multipart/form-data` and you __must__ have `FastifyMulterModule` imported _somewhere_ so that the `multipart/form-data` content parser gets registered with fastify.
npm package: @nest-lab/throttler-storage-redis
Description: Redis storage provider for the @nestjs/throttler package
Latest version: 1.2.0

# NestJS Throttler Redis Storage

Redis storage provider for the
[@nestjs/throttler](https://github.com/nestjs/throttler) package.

# Installation

### Yarn

- `yarn add @nest-lab/throttler-storage-redis ioredis`

### NPM

- `npm install --save @nest-lab/throttler-storage-redis ioredis`

# Usage

Basic usage:

```ts
import { ThrottlerModule, seconds } from '@nestjs/throttler';
import { ThrottlerStorageRedisService } from '@nest-lab/throttler-storage-redis';
import Redis from 'ioredis';

@Module({
  imports: [
    ThrottlerModule.forRoot({
      throttlers: [{ limit: 5, ttl: seconds(60) }],

      // Below are possible options on how to configure the storage service.

      // default config (host = localhost, port = 6379)
      storage: new ThrottlerStorageRedisService(),

      // connection url
      storage: new ThrottlerStorageRedisService('redis://'),

      // redis object
      storage: new ThrottlerStorageRedisService(new Redis()),

      // redis clusters
      storage: new ThrottlerStorageRedisService(
        new Redis.Cluster(nodes, options)
      ),
    }),
  ],
})
export class AppModule {}
```

Inject another config module and service:

```ts
import { ThrottlerModule } from '@nestjs/throttler';
import { ThrottlerStorageRedisService } from '@nest-lab/throttler-storage-redis';

@Module({
  imports: [
    ThrottlerModule.forRootAsync({
      imports: [ConfigModule],
      inject: [ConfigService],
      useFactory: (config: ConfigService) => ({
        throttlers: [
          {
            ttl: config.get('THROTTLE_TTL'),
            limit: config.get('THROTTLE_LIMIT'),
          },
        ],
        storage: new ThrottlerStorageRedisService(),
      }),
    }),
  ],
})
export class AppModule {}
```

# Issues

Bugs and features related to the redis implementation are welcome in this
repository.

# License

NestJS Throttler Redis Storage is licensed under the MIT license.
npm package: @nest-let/config
Description: nestjs yaml config
Author: woshiajuana
Latest version: 0.0.4

# @nest-let/config

## usage

1. 安装依赖

```sh
npm install @nest-let/config @nestjs/config
```

2. 新建 `src/config` 配置目录

- `src/config/config.yaml`
- `src/config/config.dev.yaml`
- `src/config/config.prod.yaml`

3. 使用

```ts
// src/app.module.ts
@Module({
  imports: [
    ConfigModule.forRootAsync({
      filepath: [
        resolve(__dirname, `config`, `config.yaml`),
        resolve(__dirname, `config`, `config.${process.env.NODE_ENV}.yaml`),
      ],
    }),
  ],
  controllers: [AppController],
})
export class AppModule {}
```

4. 配置 `nest-cli.json`

```json
{
  "compilerOptions": {
    "assets": ["**/*.yaml"]
  }
}
```

**注意** ：如果 `config` 文件夹与 `src` 文件夹处于同一级别，则添加值为：

```json
// `nest-cli.json`
{
  "compilerOptions": {
    "assets": [{ "include": "../config/*.yaml", "outDir": "./dist/config" }]
  }
}
```

[详情参考](https://docs.nestjs.com/techniques/configuration)

[中文详情参考](https://nest.nodejs.cn/techniques/configuration)

## 配置覆盖顺序

`filepath` 配置文件，后面的配置文件会覆盖前面的字段
npm package: @nest-lowcode/multi-pages-plugin
Description: multi-pages-plugin
Author: zeiet
Latest version: 1.0.1

# multi-pages-plugin [![][npm-image]][npm-url]

multi-pages-plugin

---

## 使用

### 注册插件
```jsx
import { plugins } from '@alilc/lowcode-engine';
import MultiPagesPlugin from 'multi-pages-plugin';

// 注册到引擎
plugins.register(MultiPagesPlugin);
```

### 插件属性 & 方法
无对外暴露的属性和方法

### 依赖插件
该插件依赖以下插件：

| 插件名 | 包名 |
| --- | --- |

## 开发
### 环境准备

### 启动
```sh
npm i & npm start
```

### 发布
```sh
npm run pub
```

[npm-image]: https://img.shields.io/badge/lowcode-plugin-multi-page-plugin
[npm-url]: https://www.npmjs.com/package/lowcode-plugin-multi-page-plugin