Skip to content

Latest commit

 

History

History
102 lines (73 loc) · 3.17 KB

README.MD

File metadata and controls

102 lines (73 loc) · 3.17 KB

Welcome to our Himalaya NestJS Crud System 👋

Node NestJS Maintenance License

Prerequisites

  • NestJS >= 10.2.1

Installation

Choose your preferred package manager to install Himalaya UI:

yarn add @himalaya/admin-backend
npm install @himalaya/admin-backend

Run Tests

You can run tests using the following command:

yarn test

Getting Started

Here's a simple example of how to use within your NesstJS application:

@Controller({
  path: 'tokens',
  version: ['1'],
})
@AuthPermission()
export class TokenController {
  constructor(
    @InjectRepository(TokenEntity)
    protected repository: Repository<TokenEntity>,
  ) {}

  @Post('collection')
  @CrudSearchRequest({
    entity: AuthJwtTokenEntity,
    output: AuthJwtTokenResponse,
    sortable: { accessToken: true },
    filterable: { accessToken: true, identifier: true },
  })
  public async getCollectionPost(
    @Body() options: CrudPaginationRequest,
  ): Promise<CrudPaginationResource<AuthJwtTokenEntity>> {
    return await crudPagination(AuthJwtTokenEntity, this.repository, options);
  }

  @Delete('item/:id')
  @CrudEntityRequest(AuthJwtTokenEntity, 'id')
  public async deleteRequest(@CrudEntity() record: AuthJwtTokenEntity) {
    await record.remove();
  }

  @Get('item/:id')
  @CrudEntityRequest(AuthJwtTokenEntity, 'id')
  @CrudTransformResponse(AuthJwtTokenEntity, AuthJwtTokenResponse)
  public async getRequest(@CrudEntity() record: AuthJwtTokenEntity) {
    return record;
  }
}

Author

👤 RedNinjas LTD

👤 Stefan Kalysta

🤝 Contributing

We welcome contributions, issues, and feature requests from the community! Please visit our issues page to report problems or make suggestions. You can also find our contributing guide for more information.

Show Your Support

If Himalaya UI has helped you in your projects, show your support by giving us a ⭐️!

📝 License

Himalaya UI is licensed under the MIT License. The MIT License is a permissive open source license that allows you to use, modify, and distribute the software for both commercial and non-commercial purposes. You are granted extensive freedom to customize and integrate Himalaya UI into your projects while maintaining the freedom to use it as you see fit.

Copyright © 2023 RedNinjas LTD.

For more details, please review the full MIT License provided by the project.