open-index/open-npm huggingface dataset:
npm package: @nest-dynamodb/typedorm
Description: Nest - a typedorm module
Author: ChenNima
Latest version: 1.2.0

<p align="center">
  <a href="http://nestjs.com/" target="blank">
    <img src="https://nestjs.com/img/logo_text.svg" width="320" alt="Nest Logo" />
  </a>
</p>

<p align="center">
  A DynamoDB module for Nest framework (node.js) using <a href="https://github.com/typedorm/typedorm">typeDorm</a> library
</p>

<p align="center">
  <a><img src="https://github.com/nest-dynamodb/typedorm/actions/workflows/test.yaml/badge.svg?branch=main" alt="Github action" /></a>
</p>

### Installation

#### with npm
```sh
npm install --save @nest-dynamodb/typedorm
```

#### with yarn
```sh
yarn add @nest-dynamodb/typedorm
```

### How to use?

#### TypeDormModule.forRoot(options)

```ts
import { Module } from '@nestjs/common';
import { TypeDormModule } from '@nest-dynamodb/typedorm';
import { AppController } from './app.controller';
@Module({
  imports: [
    TypeDormModule.forRoot({
        table,
        entities: [],
        documentClient: new DocumentClientV3(new DynamoDBClient({})),
        name: instanceName
      }),
  ],
  controllers: [AppController],
})
export class AppModule {}
```

#### TypeDormModule.forRootAsync(options)

```ts
import { Module } from '@nestjs/common';
import { TypeDormModule } from '@nest-dynamodb/typedorm';
import { AppController } from './app.controller';
@Module({
  imports: [
    TypeDormModule.forRootAsync({
        // need another name here for dependency injection, @InjectTypeDorm(instanceName)
        name: instanceName,
        useFactory: async () => {
          return {
            table,
            entities: [],
            documentClient: new DocumentClientV3(new DynamoDBClient({})),
            name: instanceName
          }
        },
      }),
  ],
  controllers: [AppController],
})
export class AppModule {}
```

#### InjectTypeDorm(name?)

```ts
import { Controller, Get, } from '@nestjs/common';
import { InjectTypeDorm, TypeDormConnection } from '@nest-dynamodb/typedorm';
@Controller()
export class AppController {
  constructor(
    @InjectTypeDorm() private readonly connection: TypeDormConnection,
  ) {}
  @Get()
  async getHello() {
    const item = await this.connection.entityManager.findOne(...);
    return { item };
  }
}
```

#### TypeDormModule.forRootNonInjection(options)

```ts
import { Module } from '@nestjs/common';
import { TypeDormModule } from '@nest-dynamodb/typedorm';
import { AppController } from './app.controller';
@Module({
  imports: [
    TypeDormModule.forRootNonInjection({
        table,
        entities: [],
        documentClient: new DocumentClientV3(new DynamoDBClient({})),
      }),
  ],
  controllers: [AppController],
})
export class AppModule {}
```

```ts
import { Controller, Get, } from '@nestjs/common';
import { TypeDormConnection } from '@nest-dynamodb/typedorm';
@Controller()
export class AppController {
  constructor(
    // do not need InjectTypeDorm here
    private readonly connection: TypeDormConnection,
  ) {}
  @Get()
  async getHello() {
    const item = await this.connection.entityManager.findOne(...);
    return { item };
  }
}
```

## License

MIT
npm package: @nest-excalibur/crud-swagger
Description: Swagger extension for CrudController
Author: Andrés Velasco
Latest version: 0.0.4
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

<img src="https://img.shields.io/npm/dt/@nest-excalibur/crud-swagger"></img>
<img src="https://img.shields.io/npm/v/@nest-excalibur/crud-swagger"></img>
<img src="https://img.shields.io/npm/l/@nest-excalibur/crud-swagger"></img>
<img src="https://img.shields.io/github/stars/nest-excalibur/crud-swagger"></img>
<img src="https://img.shields.io/github/issues/nest-excalibur/crud-swagger"></img>


# Crud Swagger

For Document the API-REST paths on swagger, you need to make use of `CrudDoc` decorator or `CrudApi` decorator.


## Installation

```shell
npm i @nest-excalibur/common-api --save-dev
npm i @nest-excalibur/crud-swagger
```


Example:
For every CRUD method you should make a configuration. The follwing example shows a configuration object:

In another file (if you want), make the configuration as a constant.

```typescript
import {CrudApiConfig} from '@nest-excalibur/crud-swagger/lib';


export const PRODUCT_SWAGGER_CONFIG: CrudApiConfig = {
    createOne: { // MethodName
        apiBody: {
            type: ProductCrearDto
        },
        headers: [
            {
                name: 'X-MyHeader',
                description: 'Custom header',
            },
        ],
        responses: [
            {
                type: ProductCreateDto,
                status: HttpStatus.CREATED,
                description: 'Created Product'
            },
            {
                status: HttpStatus.BAD_REQUEST,
                description: 'Data not valid',
            }
        ]
    },
    updateOne: {
        apiBody: {
            type: ProductUpdateDto,
        },
        responses: [
            {
                type: ProductCreateDto,
                status: HttpStatus.OK,
                description: 'Updated product'
            }
        ]
    },
    findAll: {
        headers: [
            {
                name: 'X-MyHeader',
                description: 'Custom header',
            },
        ],
        responses: [
            {
                type: ProductFindResponse,
                status: HttpStatus.OK,
                description: 'Fetched Products'
            }
        ]
    }
}
```

```typescript
import {CrudDoc} from '@nest-excalibur/crud-swagger/lib';


@CrudDoc(
     PRODUCT_SWAGGER_CONFIG,
)
@Controller('product')
export class ProductController extends CrudController<PostEntity>(options){
    
}
```
npm package: @nest-excalibur/google-cloud-storage
Description: A simple package for NestJS framework to upload files to Google Cloud Storage
Author: Andrés Velasco
Latest version: 0.0.2-beta
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

<img src="https://img.shields.io/npm/dt/@nest-excalibur/google-cloud-storage"></img>
<img src="https://img.shields.io/npm/v/@nest-excalibur/google-cloud-storage"></img>
<img src="https://img.shields.io/npm/l/@nest-excalibur/google-cloud-storage"></img>
<img src="https://img.shields.io/github/stars/nest-excalibur/google-cloud-storage"></img>
<img src="https://img.shields.io/github/issues/nest-excalibur/google-cloud-storage"></img>

# Google Cloud Storage 


## Setup

Import the module with your bucket name.

``` typescript

import { GoogleCloudStorageModule } from '@nest-excalibur/google-cloud-storage/lib';

@Module({
    imports: [
        GoogleCloudStorageModule
            .register({bucketDefaultName: '<bucket-name>'}),
    ],
})
export class SomeModule {
}
```

> Don't forget to export your google-cloud credentials before start the server.

Inject the google-cloud-service in your controller

``` typescript
import { GoogleCloudStorageService } from '@nest-excalibur/google-cloud-storage/lib';

@Controller('some')
export class SomeController {

    constructor(
        private readonly _googleCloudStorageService: GoogleCloudStorageService,
    ) {
    }
}
```

Use the service to store a file

``` typescript
    @Post('upload-picture')
    @UseInterceptors(
        FileInterceptor('picture'),
    )
    async uploadPicture(
            @UploadedFile() pictureFile: UploadedFileMetadata,
    ){
       try {
          return  await this._googleCloudStorageService.upload(pictureFile);
       }catch (error) {
          throw new InternalServerErrorException('Error on Upload');
       }
    }
```

### GoogleCloudStorageFileInterceptor

You can use the `GoogleCloudStorageFileInterceptor` to store a file
using a specific folder/prefix name.

``` typescript
import { GoogleCloudStorageFileInterceptor } from '@nest-excalibur/google-cloud-storage/lib';
```

``` typescript
    @Post('upload-picture')
    @UseInterceptors(
        GoogleCloudStorageFileInterceptor(
            'picture', 
            undefined, 
            { 
              prefix: 'pictures'
            }
        )
    )
    async uploadPicture(
        @UploadedFile() pictureFile
    ){
            return  pictureFile;
    }
```