Giter Club home page Giter Club logo

dataui-nestjs-crud's People

Contributors

0xflotus avatar asheliahut avatar bashleigh avatar bestori avatar ckaeslin avatar darkein avatar davarga avatar debagger avatar diluka avatar dschoeni avatar duongleh avatar eugenio165 avatar frco9 avatar fwoelffel avatar greenkeeper[bot] avatar jdguzman avatar joennlae avatar klalex avatar michaelyali avatar pavlonaumenko avatar renovate-bot avatar rewiko avatar robotscribe avatar roland-chernov avatar samisammour avatar tbrannam avatar xtcry avatar yepes avatar zaidmaslouhi avatar zaro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

dataui-nestjs-crud's Issues

need customised Auth

some time we need some endpoint public and some with Auth then how we can handle this

Warning: Failed to parse source map

We get this warning in many files, is this some option we could use to fix it or it needs a change in this package?

WARNING in ./node_modules/@dataui/crud-request/lib/interfaces/create-query-params.interface.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'D:\R\project-frontend\node_modules\@dataui\crud-request\src\interfaces\create-query-params.interface.ts' file: Error: ENOENT: no such file or directory, open 'D:\R\project-front
end\node_modules\@dataui\crud-request\src\interfaces\create-query-params.interface.ts'

Thanks

How to implement ManyToMany?

I have two Entities, but I don't know how to implement ManyToMany in Curd
Category Entity

import { Entity, PrimaryGeneratedColumn, Column } from "typeorm"

@Entity()
export class Category {
    @PrimaryGeneratedColumn()
    id: number

    @Column()
    name: string
}

Question Entity

import {
    Entity,
    PrimaryGeneratedColumn,
    Column,
    ManyToMany,
    JoinTable,
} from "typeorm"
import { Category } from "./Category"

@Entity()
export class Question {
    @PrimaryGeneratedColumn()
    id: number

    @Column()
    title: string

    @Column()
    text: string

    @ManyToMany(() => Category)
    @JoinTable()
    categories: Category[]
}

How can I insert, update, find, and delete ManyToMany in Crud?
I haven't found a good solution at the moment🙁

Fail to compile on last stable version 5.1.3

  • Error message on compilation step :
node_modules/@dataui/crud/lib/interfaces/auth-options.interface.d.ts(2,31): error TS2307: Cannot find module '@dataui/crud-util/src' or its corresponding type declarations.
import { SCondition } from '@dataui/crud-request/lib/types/request-query.types';
import { ObjectLiteral } from 'crud-util/src';

export interface AuthGlobalOptions {
  property?: string;
}

export interface AuthOptions {
  property?: string;
  filter?: (req: any) => SCondition | void;
  or?: (req: any) => SCondition | void;
  persist?: (req: any) => ObjectLiteral;
}

to

import { SCondition } from '@dataui/crud-request/lib/types/request-query.types';
import { ObjectLiteral } from '@dataui/crud-util/lib/types/object-literal.type';
export interface AuthGlobalOptions {
    property?: string;
}
export interface AuthOptions {
    property?: string;
    filter?: (req: any) => SCondition | void;
    or?: (req: any) => SCondition | void;
    persist?: (req: any) => ObjectLiteral;
}

Soft Delete Support (TypeORM)

Any change to add this function by default on CRUD config?

Something like that:

@Crud({
  model: {
    type: MyModel,
  },
  routes: {
    deleteOneBase: {
      softDelete: true,
    },
  },
})
@Controller('my-models')
export class MyModelController implements CrudController<MyModel> {
    constructor(public service: MyModelService) {}
}

[EVOLUTION] - Store auth information on CrudRequest object

Hi.

First of all : thinks you for your fork ! ;-)


  • Subject :

    • CrudRequest object is pass between Controller and Service. But on this object we dont store any context informations as authenticate user for exemple : (this is nice to have auth user object on service (stored on native Request object))
  • Do you think it's possible to store extra informations on CrudRequest object and in particular auth. user?

    • Note :
      • Store native NestJs Request object is not possible : risk of producing strange case with singleton service (switch to Scope=Request by nestJs), but store auth user information seen to be possible.
      • Auth user can be found on native Request object with nesths-crud configuration auth. sample configuration ;
CrudConfigService.load({
      params: {
       [...]
      },
      auth: {
        property: 'user',
      },
[...]
* CurdRequest interface can became : 
export interface CrudRequest {
    parsed: ParsedRequestParams;
    options: CrudRequestOptions;
    auth: any; // according to configuration
    extra: any; // any params for business logic
}

Wrong repo on npm

First of all, thanks a lot for this fork and for keeping the lib alive, been using it since the guy from original library disappeared. The issue is that npm links to the wrong repo and so finding this one is really hard. The only direct link is in the issues for original lib.

QueryFilterFunction receives undefined for search

This is an issue from the original repository but still relevant, so I am reposting the issue here.

Original issue: nestjsx#551

When declaring the filter option inside of the @Crud() decorator for a controller it is only working when provided as a static object. When I use the documented QueryFilterFunction, as described [in the docs (https://github.com/nestjsx/crud/wiki/Controllers#filter), the first parameter is receiving undefined and all filters are ignored.

I need to extend any incoming filters with some persisted filters based on the current date for the records. Using new Date() in the static object generates a matching static date-value and therefore breaks my intent. The solution makes sense to use a factory function to merge the search options, but so long as the incoming ```SCondition```` is empty that is impossible.

I'm using the latest releases for the following libraries.

"@nestjs/typeorm": "~7.1.0",
"@nestjsx/crud": "~4.6.2",
"@nestjsx/crud-typeorm": "~4.6.2",
"typeorm": "~0.2.25"

access to Query Params from custom endpoint

Is there a way to use CrudRequest in a custom endpoint and to have access in Query Params and their functionality? For example to have something like that:

custom endpoint: /something/3/stats?filter[0]=price||$lte||100

@Get('/:id/stats')
async getStatistics(
  @Param('id') id:number,
  @ParsedRequest() req: CrudRequest
) {
  . . .
}

and to have access to these Query Params and the way they works:
image
or how to extend the functionality that the Query Params have?

withDeleted not working with relations

When using with deleted from the query builder

.setIncludeDeleted(1)

the relations included via @crud decorator are not being fetched if they have been deleted.

This is because builder.withDeleted(); is being called after the joins are created.

Bug: GetMany with join + pagination throws duplicate column error

Bug Report

I'm encountering an error when using getMany with joins and pagination. The issue seems to be related to duplicate column names in the query results.

  • Context: Using getMany method in NestJS CRUD library.
  • Problem: Duplicate column names appear in the query results when using joins and pagination together.
  • Impact: This might lead to unexpected behavior and errors in your application.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.