nicot 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -33,9 +33,17 @@ export class User extends IdBase() {
|
|
|
33
33
|
|
|
34
34
|
@EnumColumn(Gender, { description: 'User gender' })
|
|
35
35
|
gender: Gender;
|
|
36
|
+
|
|
37
|
+
@NotColumn()
|
|
38
|
+
somethingElse: any; // Would not come from client input, and would not go into OpenAPI document.
|
|
36
39
|
}
|
|
37
40
|
```
|
|
38
41
|
|
|
42
|
+
There are also other following decorators to control accessibility:
|
|
43
|
+
|
|
44
|
+
- `@NotWritable()` Can only come from GET requests.
|
|
45
|
+
- `@NotChangeable()` Cannot be changed by PATCH requests.
|
|
46
|
+
|
|
39
47
|
## CrudService
|
|
40
48
|
|
|
41
49
|
Creates a service for database operation in one word.
|
|
@@ -51,6 +59,8 @@ export class UserService extends CrudService(User) {
|
|
|
51
59
|
|
|
52
60
|
## Controller decorators
|
|
53
61
|
|
|
62
|
+
Would also register proper OpenAPI documentation for the controller.
|
|
63
|
+
|
|
54
64
|
```ts
|
|
55
65
|
const dec = new RestfulFactory(User);
|
|
56
66
|
class UpdateUserDto extends dec.updateDto {} // to extract type and class
|
package/package.json
CHANGED