Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v.3.2.0 #46

Merged
merged 10 commits into from
Mar 27, 2019
30 changes: 26 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
- [Params Options](#params-options)
- [Validation Options](#validation-options)
- [IntelliSense](#intellisense)
- [Method Override](#method-override)
- [Routes Override](#routes-override)
- [Adding Routes](#adding-routes)
- [Additional Decorators](#additional-decorators)
- [Example Project](#example-project)
- [Contribution](#contribution)
Expand Down Expand Up @@ -797,9 +798,9 @@ export class HeroesCrud {
}
```

### Method Override
### Routes Override

List of composed base methods:
List of composed base routes methods:

```typescript
getManyBase(
Expand Down Expand Up @@ -910,7 +911,28 @@ export class HeroesCrud {
}
```

**_Notice:_** new custom route decorators were created to simplify process: `@ParsedQuery()`, `@ParsedParams`, `@ParsedBody()`, and`@ParsedOptions()`. But you still can add your param decorators to any of the methods, e.g. `@Param()`, `@Session()`, etc. Or any of your own cutom route decorators.
**_Notice:_** new custom route decorators were created to simplify process: `@ParsedQuery()`, `@ParsedParams`, `@ParsedBody()`, and `@ParsedOptions()`. But you still can add your param decorators to any of the methods, e.g. `@Param()`, `@Session()`, etc. Or any of your own cutom route decorators.

### Adding Routes

Sometimes you might need to add a new route and to use `@ParsedQuery()`, `@ParsedParams`, `@ParsedOptions()` in it. You need to use `@UsePathInterceptors()` method decorator in order to do that:

```typescript
...
import { UsePathInterceptors } from '@nestjsx/crud';
...

@UsePathInterceptors()
@Get('/export/list.xlsx')
async exportSome(
@ParsedQuery() query: RestfulParamsDto,
@ParsedOptions() options: CrudOptions,
) {
// some logic
}
```

By default this decorator will parse `query` and `param`. But you can specify what you need to parse by passing the appropriate argument (`@UsePathInterceptors('query')` or `@UsePathInterceptors('param')`).

### Additional Decorators

Expand Down
30 changes: 26 additions & 4 deletions dist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
- [Params Options](#params-options)
- [Validation Options](#validation-options)
- [IntelliSense](#intellisense)
- [Method Override](#method-override)
- [Routes Override](#routes-override)
- [Adding Routes](#adding-routes)
- [Additional Decorators](#additional-decorators)
- [Example Project](#example-project)
- [Contribution](#contribution)
Expand Down Expand Up @@ -797,9 +798,9 @@ export class HeroesCrud {
}
```

### Method Override
### Routes Override

List of composed base methods:
List of composed base routes methods:

```typescript
getManyBase(
Expand Down Expand Up @@ -910,7 +911,28 @@ export class HeroesCrud {
}
```

**_Notice:_** new custom route decorators were created to simplify process: `@ParsedQuery()`, `@ParsedParams`, `@ParsedBody()`, and`@ParsedOptions()`. But you still can add your param decorators to any of the methods, e.g. `@Param()`, `@Session()`, etc. Or any of your own cutom route decorators.
**_Notice:_** new custom route decorators were created to simplify process: `@ParsedQuery()`, `@ParsedParams`, `@ParsedBody()`, and `@ParsedOptions()`. But you still can add your param decorators to any of the methods, e.g. `@Param()`, `@Session()`, etc. Or any of your own cutom route decorators.

### Adding Routes

Sometimes you might need to add a new route and to use `@ParsedQuery()`, `@ParsedParams`, `@ParsedOptions()` in it. You need to use `@UsePathInterceptors()` method decorator in order to do that:

```typescript
...
import { UsePathInterceptors } from '@nestjsx/crud';
...

@UsePathInterceptors()
@Get('/export/list.xlsx')
async exportSome(
@ParsedQuery() query: RestfulParamsDto,
@ParsedOptions() options: CrudOptions,
) {
// some logic
}
```

By default this decorator will parse `query` and `param`. But you can specify what you need to parse by passing the appropriate argument (`@UsePathInterceptors('query')` or `@UsePathInterceptors('param')`).

### Additional Decorators

Expand Down
8 changes: 5 additions & 3 deletions dist/classes/restful-service.class.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/classes/restful-service.class.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/constants.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export declare const PARSED_QUERY_REQUEST_KEY = "NESTJSX_PARSED_QUERY_REQUEST_KE
export declare const PARSED_PARAMS_REQUEST_KEY = "NESTJSX_PARSED_PARAMS_REQUEST_KEY";
export declare const PARSED_OPTIONS_METADATA = "NESTJSX_PARSED_OPTIONS_METADATA";
export declare const PARSED_BODY_METADATA = "NESTJSX_PARSED_BODY_METADATA";
export declare const CRUD_OPTIONS_METADATA = "NESTJSX_CRUD_OPTIONS_METADATA";
export declare const CREATE_UPDATE: {
groups: string[];
};
Expand Down
1 change: 1 addition & 0 deletions dist/constants.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/constants.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 18 additions & 29 deletions dist/decorators/crud.decorator.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading