@hedhog/admin 0.0.104 → 0.0.105
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +141 -141
- package/dist/admin.module.js +7 -7
- package/dist/admin.module.js.map +1 -1
- package/dist/auth/auth.service.d.ts +1 -1
- package/dist/auth/auth.service.d.ts.map +1 -1
- package/dist/auth/auth.service.js +8 -8
- package/dist/auth/auth.service.js.map +1 -1
- package/dist/auth/auth.service.spec.js +16 -16
- package/dist/auth/auth.service.spec.js.map +1 -1
- package/dist/dto/with-locale.dto.d.ts +4 -0
- package/dist/dto/with-locale.dto.d.ts.map +1 -0
- package/dist/dto/{with-locales.dto.js → with-locale.dto.js} +5 -5
- package/dist/dto/with-locale.dto.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/locale/locale.controller.js +1 -1
- package/dist/locale/locale.controller.js.map +1 -1
- package/dist/locale/locale.middleware.d.ts +1 -1
- package/dist/locale/locale.middleware.d.ts.map +1 -1
- package/dist/locale/locale.middleware.js +2 -2
- package/dist/locale/locale.middleware.js.map +1 -1
- package/dist/locale/locale.service.d.ts +6 -6
- package/dist/locale/locale.service.d.ts.map +1 -1
- package/dist/locale/locale.service.js +40 -40
- package/dist/locale/locale.service.js.map +1 -1
- package/dist/locale/locale.service.spec.js +14 -14
- package/dist/locale/locale.service.spec.js.map +1 -1
- package/dist/menu/menu.controller.js +3 -3
- package/dist/menu/menu.controller.js.map +1 -1
- package/dist/menu/menu.service.d.ts +3 -3
- package/dist/menu/menu.service.d.ts.map +1 -1
- package/dist/menu/menu.service.js +35 -35
- package/dist/menu/menu.service.js.map +1 -1
- package/dist/menu/menu.service.spec.js +33 -37
- package/dist/menu/menu.service.spec.js.map +1 -1
- package/dist/role/dto/create.dto.d.ts +2 -2
- package/dist/role/dto/create.dto.d.ts.map +1 -1
- package/dist/role/dto/create.dto.js +2 -2
- package/dist/role/dto/create.dto.js.map +1 -1
- package/dist/role/guards/role.guard.js +4 -4
- package/dist/role/guards/role.guard.js.map +1 -1
- package/dist/role/role.controller.js +7 -7
- package/dist/role/role.controller.js.map +1 -1
- package/dist/role/role.service.d.ts +2 -2
- package/dist/role/role.service.d.ts.map +1 -1
- package/dist/role/role.service.js +35 -35
- package/dist/role/role.service.js.map +1 -1
- package/dist/role/role.service.spec.d.ts +0 -1
- package/dist/role/role.service.spec.js +400 -340
- package/dist/role/role.service.spec.js.map +1 -1
- package/dist/route/route.controller.js +3 -3
- package/dist/route/route.controller.js.map +1 -1
- package/dist/route/route.service.d.ts +2 -2
- package/dist/route/route.service.d.ts.map +1 -1
- package/dist/route/route.service.js +18 -18
- package/dist/route/route.service.js.map +1 -1
- package/dist/route/route.service.spec.js +27 -27
- package/dist/route/route.service.spec.js.map +1 -1
- package/dist/screen/screen.controller.js +4 -4
- package/dist/screen/screen.controller.js.map +1 -1
- package/dist/screen/screen.service.d.ts +2 -2
- package/dist/screen/screen.service.d.ts.map +1 -1
- package/dist/screen/screen.service.js +16 -16
- package/dist/screen/screen.service.js.map +1 -1
- package/dist/screen/screen.service.spec.js +16 -16
- package/dist/screen/screen.service.spec.js.map +1 -1
- package/dist/setting/dto/setting.dto.d.ts +9 -0
- package/dist/setting/dto/setting.dto.d.ts.map +1 -0
- package/dist/setting/dto/{settings.dto.js → setting.dto.js} +6 -6
- package/dist/setting/dto/setting.dto.js.map +1 -0
- package/dist/setting/{settings.controller.d.ts → setting.controller.d.ts} +6 -6
- package/dist/setting/setting.controller.d.ts.map +1 -0
- package/dist/setting/{settings.controller.js → setting.controller.js} +20 -20
- package/dist/setting/setting.controller.js.map +1 -0
- package/dist/setting/setting.module.d.ts +3 -0
- package/dist/setting/setting.module.d.ts.map +1 -0
- package/dist/setting/{settings.module.js → setting.module.js} +6 -6
- package/dist/setting/setting.module.js.map +1 -0
- package/dist/setting/{settings.service.d.ts → setting.service.d.ts} +4 -4
- package/dist/setting/setting.service.d.ts.map +1 -0
- package/dist/setting/{settings.service.js → setting.service.js} +42 -42
- package/dist/setting/setting.service.js.map +1 -0
- package/dist/setting/setting.service.spec.d.ts +2 -0
- package/dist/setting/setting.service.spec.d.ts.map +1 -0
- package/dist/setting/{settings.service.spec.js → setting.service.spec.js} +17 -17
- package/dist/setting/setting.service.spec.js.map +1 -0
- package/dist/user/user.controller.js +3 -3
- package/dist/user/user.controller.js.map +1 -1
- package/dist/user/user.service.d.ts +2 -2
- package/dist/user/user.service.d.ts.map +1 -1
- package/dist/user/user.service.js +9 -9
- package/dist/user/user.service.js.map +1 -1
- package/dist/user/user.service.spec.js +24 -24
- package/dist/user/user.service.spec.js.map +1 -1
- package/package.json +2 -2
- package/src/admin.module.ts +36 -0
- package/src/auth/auth.controller.ts +48 -0
- package/src/auth/auth.module.ts +39 -0
- package/src/auth/auth.service.spec.ts +196 -0
- package/src/auth/auth.service.ts +175 -0
- package/src/auth/decorators/public.decorator.ts +4 -0
- package/src/auth/decorators/user.decorator.ts +17 -0
- package/src/auth/dto/forget.dto.ts +6 -0
- package/src/auth/dto/login.dto.ts +15 -0
- package/src/auth/dto/otp.dto.ts +11 -0
- package/src/auth/enums/multifactor-type.enum.ts +4 -0
- package/src/auth/guards/auth.guard.ts +50 -0
- package/src/auth/types/user.type.ts +8 -0
- package/src/dto/delete.dto.ts +8 -0
- package/src/dto/update-ids.dto.ts +9 -0
- package/src/dto/with-locale.dto.ts +8 -0
- package/src/index.ts +34 -0
- package/src/locale/dto/create.dto.ts +12 -0
- package/src/locale/dto/delete.dto.ts +8 -0
- package/src/locale/dto/set-enabled.dto.ts +9 -0
- package/src/locale/dto/update.dto.ts +15 -0
- package/src/locale/index.ts +4 -0
- package/src/locale/locale.controller.ts +79 -0
- package/src/locale/locale.decorator.ts +8 -0
- package/src/locale/locale.middleware.ts +34 -0
- package/src/locale/locale.module.ts +23 -0
- package/src/locale/locale.service.spec.ts +193 -0
- package/src/locale/locale.service.ts +366 -0
- package/src/menu/dto/create.dto.ts +25 -0
- package/src/menu/dto/order.dto.ts +8 -0
- package/src/menu/dto/update.dto.ts +19 -0
- package/src/menu/menu.controller.ts +106 -0
- package/src/menu/menu.module.ts +18 -0
- package/src/menu/menu.service.spec.ts +247 -0
- package/src/menu/menu.service.ts +263 -0
- package/src/role/decorators/role.decorator.ts +4 -0
- package/src/role/dto/create.dto.ts +7 -0
- package/src/role/dto/update.dto.ts +4 -0
- package/src/role/guards/role.guard.ts +122 -0
- package/src/role/role.controller.ts +126 -0
- package/src/role/role.module.ts +28 -0
- package/src/role/role.service.spec.ts +417 -0
- package/src/role/role.service.ts +302 -0
- package/src/route/dto/create.dto.ts +13 -0
- package/src/route/dto/update.dto.ts +15 -0
- package/src/route/route.controller.ts +91 -0
- package/src/route/route.module.ts +18 -0
- package/src/route/route.service.spec.ts +299 -0
- package/src/route/route.service.ts +164 -0
- package/src/screen/dto/create.dto.ts +19 -0
- package/src/screen/dto/update.dto.ts +19 -0
- package/src/screen/screen.controller.ts +93 -0
- package/src/screen/screen.module.ts +18 -0
- package/src/screen/screen.service.spec.ts +298 -0
- package/src/screen/screen.service.ts +181 -0
- package/src/setting/dto/create.dto.ts +1 -0
- package/src/setting/dto/setting-user.dto.ts +6 -0
- package/src/setting/dto/setting.dto.ts +17 -0
- package/src/setting/dto/update.dto.ts +3 -0
- package/src/setting/setting.controller.ts +100 -0
- package/src/setting/setting.module.ts +18 -0
- package/src/setting/setting.service.spec.ts +183 -0
- package/src/setting/setting.service.ts +346 -0
- package/src/types/http-method.ts +8 -0
- package/src/user/constants/user.constants.ts +1 -0
- package/src/user/dto/create.dto.ts +24 -0
- package/src/user/dto/update.dto.ts +41 -0
- package/src/user/user.controller.ts +75 -0
- package/src/user/user.module.ts +18 -0
- package/src/user/user.service.spec.ts +294 -0
- package/src/user/user.service.ts +129 -0
- package/tsconfig.lib.json +9 -0
- package/tsconfig.production.json +20 -0
- package/dist/dto/with-locales.dto.d.ts +0 -4
- package/dist/dto/with-locales.dto.d.ts.map +0 -1
- package/dist/dto/with-locales.dto.js.map +0 -1
- package/dist/setting/dto/settings.dto.d.ts +0 -9
- package/dist/setting/dto/settings.dto.d.ts.map +0 -1
- package/dist/setting/dto/settings.dto.js.map +0 -1
- package/dist/setting/settings.controller.d.ts.map +0 -1
- package/dist/setting/settings.controller.js.map +0 -1
- package/dist/setting/settings.module.d.ts +0 -3
- package/dist/setting/settings.module.d.ts.map +0 -1
- package/dist/setting/settings.module.js.map +0 -1
- package/dist/setting/settings.service.d.ts.map +0 -1
- package/dist/setting/settings.service.js.map +0 -1
- package/dist/setting/settings.service.spec.d.ts +0 -2
- package/dist/setting/settings.service.spec.d.ts.map +0 -1
- package/dist/setting/settings.service.spec.js.map +0 -1
package/README.md
CHANGED
@@ -20,16 +20,16 @@
|
|
20
20
|
|
21
21
|
The **Hedhog Admin** module is a collection of core modules essential for managing and administering applications within the HedHog framework. It brings together various modules that provide key functionalities such as authentication, menu configuration, permissions, screen management and user management.
|
22
22
|
|
23
|
-
Whether you need to secure access to resources, manage user
|
23
|
+
Whether you need to secure access to resources, manage user role, or handle file uploads, the `@hedhog/admin` module provides everything required to manage a modern web application’s backend with minimal setup.
|
24
24
|
|
25
25
|
### Included Modules<
|
26
26
|
|
27
27
|
- **@hedhog/auth**: Provides authentication and authorization mechanisms, ensuring secure access to application resources.
|
28
|
-
- **@hedhog/locale**: Provides solution for managing
|
29
|
-
- **@hedhog/menu**: Allows for the creation and management of dynamic
|
30
|
-
- **@hedhog/role**: Facilitates the management of
|
31
|
-
- **@hedhog/route**: Provides a comprehensive system for managing
|
32
|
-
- **@hedhog/setting**: Provides a solution for managing application
|
28
|
+
- **@hedhog/locale**: Provides solution for managing locale and translation across applications.
|
29
|
+
- **@hedhog/menu**: Allows for the creation and management of dynamic menu within the application interface.
|
30
|
+
- **@hedhog/role**: Facilitates the management of role, controlling access to specific features or areas.
|
31
|
+
- **@hedhog/route**: Provides a comprehensive system for managing route within your application.
|
32
|
+
- **@hedhog/setting**: Provides a solution for managing application setting.
|
33
33
|
- **@hedhog/screen**: Provides a structure for managing different screens and UI components.
|
34
34
|
- **@hedhog/user**: Manages user accounts, including creation, updates, and deletion, along with password encryption and secure access.
|
35
35
|
|
@@ -54,7 +54,7 @@ import { AdminModule } from '@hedhog/admin';
|
|
54
54
|
export class AppModule {}
|
55
55
|
```
|
56
56
|
|
57
|
-
By importing the AdminModule, you gain access to all the functionality provided by the individual modules, making it easier to manage authentication, permissions,
|
57
|
+
By importing the AdminModule, you gain access to all the functionality provided by the individual modules, making it easier to manage authentication, permissions, user, and more.
|
58
58
|
|
59
59
|
---
|
60
60
|
|
@@ -64,8 +64,8 @@ By importing the AdminModule, you gain access to all the functionality provided
|
|
64
64
|
|
65
65
|
### Features
|
66
66
|
|
67
|
-
- **Token Verification**: Verify authentication tokens for
|
68
|
-
- **Login**: Authenticate
|
67
|
+
- **Token Verification**: Verify authentication tokens for user.
|
68
|
+
- **Login**: Authenticate user with email and password, and handle multi-factor authentication if required.
|
69
69
|
- **OTP Management**: Manage one-time passwords (OTP) for multi-factor authentication.
|
70
70
|
- **Password Reset**: Facilitate password reset requests through email.
|
71
71
|
|
@@ -85,7 +85,7 @@ The `AuthService` provides methods for:
|
|
85
85
|
- `verifyToken(token: string)`: Verify the provided JWT token.
|
86
86
|
- `generateRandomString(length: number)`: Generate a random string of specified length.
|
87
87
|
- `generateRandomNumber()`: Generate a random 6-digit number.
|
88
|
-
- `loginWithEmailAndPassword(email: string, password: string)`: Authenticate
|
88
|
+
- `loginWithEmailAndPassword(email: string, password: string)`: Authenticate user with email and password and handle multi-factor authentication if required.
|
89
89
|
- `getToken(user)`: Generate a JWT token for the authenticated user.
|
90
90
|
- `forget({ email }: ForgetDTO)`: Initiate a password reset process for the specified email.
|
91
91
|
- `otp({ token, code }: OtpDTO)`: Verify the OTP code provided by the user.
|
@@ -93,7 +93,7 @@ The `AuthService` provides methods for:
|
|
93
93
|
### Folder Structure
|
94
94
|
|
95
95
|
```plaintext
|
96
|
-
├── auth.controller.ts # Defines
|
96
|
+
├── auth.controller.ts # Defines route for authentication
|
97
97
|
├── auth.service.ts # Contains authentication logic
|
98
98
|
├── auth.service.spec.ts # Testing file for auth service
|
99
99
|
├── auth.module.ts # Authentication module
|
@@ -102,54 +102,54 @@ The `AuthService` provides methods for:
|
|
102
102
|
│ ├── login.dto.ts # Data Transfer Object for login
|
103
103
|
│ └── otp.dto.ts # Data Transfer Object for OTP verification
|
104
104
|
├── decorators/
|
105
|
-
│ ├── public.decorator.ts # Custom decorator to mark public
|
105
|
+
│ ├── public.decorator.ts # Custom decorator to mark public route
|
106
106
|
│ └── user.decorator.ts # Custom decorator to get user from request
|
107
107
|
├── types/
|
108
108
|
│ └── user.type.ts # Type definitions for user-related data
|
109
109
|
├── enums/
|
110
110
|
│ └── multifactor-type.enum.ts # Enumeration for multi-factor authentication types
|
111
111
|
├── guards/
|
112
|
-
│ └── auth.guard.ts # Guard for protecting
|
112
|
+
│ └── auth.guard.ts # Guard for protecting route
|
113
113
|
```
|
114
114
|
|
115
115
|
---
|
116
116
|
|
117
117
|
# Hedhog Locale
|
118
118
|
|
119
|
-
**Hedhog Locale** module provides a powerful solution for managing
|
119
|
+
**Hedhog Locale** module provides a powerful solution for managing locale and translation across applications. It includes functionalities to retrieve, create, update, and delete locale data, with support for pagination and localization. The module integrates seamlessly within the HedHog ecosystem, using @hedhog/pagination for handling paginated responses and @hedhog/prisma for database interactions.
|
120
120
|
|
121
121
|
### Controller Endpoints
|
122
122
|
|
123
|
-
#### `GET /
|
123
|
+
#### `GET /locale/system/enables`
|
124
124
|
|
125
|
-
- **Description**: Retrieve a paginated list of enabled
|
125
|
+
- **Description**: Retrieve a paginated list of enabled locale.
|
126
126
|
- **Authentication**: Not required (public endpoint).
|
127
127
|
- **Parameters**:
|
128
128
|
- `locale (string)`: Locale code for filtering.
|
129
129
|
- Pagination parameters (optional).
|
130
130
|
|
131
|
-
#### `GET /
|
131
|
+
#### `GET /locale/:localeCode/:namespace`
|
132
132
|
|
133
|
-
- **Description**: Retrieve
|
133
|
+
- **Description**: Retrieve translation for a specific locale and namespace.
|
134
134
|
- **Authentication**: Not required (public endpoint).
|
135
135
|
- **Parameters**:
|
136
|
-
- `localeCode (string)`: The locale code to fetch
|
137
|
-
- `namespace (string)`: The namespace to fetch
|
136
|
+
- `localeCode (string)`: The locale code to fetch translation for.
|
137
|
+
- `namespace (string)`: The namespace to fetch translation from.
|
138
138
|
|
139
|
-
#### `GET /
|
139
|
+
#### `GET /locale`
|
140
140
|
|
141
|
-
- **Description**: Retrieve a paginated list of
|
141
|
+
- **Description**: Retrieve a paginated list of locale.
|
142
142
|
- **Authentication**: Required.
|
143
143
|
- **Pagination**: Supports pagination through query parameters.
|
144
144
|
|
145
|
-
#### `GET /
|
145
|
+
#### `GET /locale/:id`
|
146
146
|
|
147
147
|
- **Description**: Retrieve a specific locale by its ID.
|
148
148
|
- **Authentication**: Required.
|
149
149
|
- **Parameters**:
|
150
150
|
- `id (number)`: The ID of the locale to retrieve.
|
151
151
|
|
152
|
-
#### `POST /
|
152
|
+
#### `POST /locale`
|
153
153
|
|
154
154
|
- **Description**: Create a new locale entry.
|
155
155
|
- **Authentication**: Required.
|
@@ -157,7 +157,7 @@ The `AuthService` provides methods for:
|
|
157
157
|
- `code (string)`: The code of the locale.
|
158
158
|
- `region (string)`: The region of the locale.
|
159
159
|
|
160
|
-
#### `PATCH /
|
160
|
+
#### `PATCH /locale/:id`
|
161
161
|
|
162
162
|
- **Description**: Update an existing locale entry.
|
163
163
|
- **Authentication**: Required.
|
@@ -167,9 +167,9 @@ The `AuthService` provides methods for:
|
|
167
167
|
- `code (string, optional)`: Updated code of the locale.
|
168
168
|
- `region (string, optional)`: Updated region of the locale.
|
169
169
|
|
170
|
-
#### `DELETE /
|
170
|
+
#### `DELETE /locale`
|
171
171
|
|
172
|
-
- **Description**: Delete one or more
|
172
|
+
- **Description**: Delete one or more locale.
|
173
173
|
- **Authentication**: Required.
|
174
174
|
- **Body**:
|
175
175
|
- `ids (number[])`: Array of locale IDs to delete.
|
@@ -178,21 +178,21 @@ The `AuthService` provides methods for:
|
|
178
178
|
|
179
179
|
#### `getEnables(locale: string, paginationParams: PaginationDTO)`
|
180
180
|
|
181
|
-
- **Description**: Retrieves a paginated list of enabled
|
181
|
+
- **Description**: Retrieves a paginated list of enabled locale based on locale code and pagination parameters.
|
182
182
|
- **Parameters**:
|
183
183
|
- `locale (string)`: Locale code for filtering.
|
184
184
|
- `paginationParams (PaginationDTO)`: Includes pagination criteria.
|
185
185
|
|
186
186
|
#### `getTranslations(localeCode: string, namespace: string)`
|
187
187
|
|
188
|
-
- **Description**: Retrieves
|
188
|
+
- **Description**: Retrieves translation for a given locale code and namespace.
|
189
189
|
- **Parameters**:
|
190
|
-
- `localeCode (string)`: The locale code to fetch
|
191
|
-
- `namespace (string)`: The namespace to fetch
|
190
|
+
- `localeCode (string)`: The locale code to fetch translation for.
|
191
|
+
- `namespace (string)`: The namespace to fetch translation from.
|
192
192
|
|
193
193
|
#### `get(paginationParams: PaginationDTO)`
|
194
194
|
|
195
|
-
- **Description**: Retrieves a paginated list of all
|
195
|
+
- **Description**: Retrieves a paginated list of all locale.
|
196
196
|
- **Parameters**:
|
197
197
|
- `paginationParams (PaginationDTO)`: Includes pagination criteria.
|
198
198
|
|
@@ -225,14 +225,14 @@ The `AuthService` provides methods for:
|
|
225
225
|
|
226
226
|
```plaintext
|
227
227
|
|── dto/ # Data Transfer Objects
|
228
|
-
│ ├── create.dto.ts # DTO for creating
|
229
|
-
│ ├── delete.dto.ts # DTO for deleting
|
230
|
-
│ └── update.dto.ts # DTO for updating
|
231
|
-
|── locale.controller.ts # Controller for
|
228
|
+
│ ├── create.dto.ts # DTO for creating locale
|
229
|
+
│ ├── delete.dto.ts # DTO for deleting locale
|
230
|
+
│ └── update.dto.ts # DTO for updating locale
|
231
|
+
|── locale.controller.ts # Controller for locale
|
232
232
|
|── locale.decorator.ts # Decorator for injecting locale into requests
|
233
233
|
|── locale.middleware.ts # Middleware to handle locale-specific processing
|
234
|
-
|── locale.module.ts # Module definition for
|
235
|
-
|── locale.service.ts # Service class for
|
234
|
+
|── locale.module.ts # Module definition for locale
|
235
|
+
|── locale.service.ts # Service class for locale logic
|
236
236
|
├── locale.service.spec.ts # Testing file for locale service
|
237
237
|
|── index.ts # Main export file for the module
|
238
238
|
```
|
@@ -241,7 +241,7 @@ The `AuthService` provides methods for:
|
|
241
241
|
|
242
242
|
# Hedhog Menu
|
243
243
|
|
244
|
-
**HedHog Menu** is a library for managing
|
244
|
+
**HedHog Menu** is a library for managing menu within the HedHog framework. It provides a set of RESTful endpoints for CRUD operations on menu items, as well as functionalities to handle pagination and ordering of menu.
|
245
245
|
|
246
246
|
### Features
|
247
247
|
|
@@ -253,12 +253,12 @@ The `AuthService` provides methods for:
|
|
253
253
|
|
254
254
|
The `MenuController` exposes the following endpoints:
|
255
255
|
|
256
|
-
- **GET /
|
257
|
-
- **GET /
|
258
|
-
- **POST /
|
259
|
-
- **PATCH /
|
260
|
-
- **DELETE /
|
261
|
-
- **PATCH /
|
256
|
+
- **GET /menu**: Retrieve a list of menu with pagination.
|
257
|
+
- **GET /menu/:menuId**: Retrieve a specific menu by ID.
|
258
|
+
- **POST /menu**: Create a new menu item.
|
259
|
+
- **PATCH /menu/:menuId**: Update an existing menu item by ID.
|
260
|
+
- **DELETE /menu**: Delete menu items based on provided IDs.
|
261
|
+
- **PATCH /menu/order**: Update the order of menu items.
|
262
262
|
|
263
263
|
### MenuService
|
264
264
|
|
@@ -274,7 +274,7 @@ The `MenuService` class contains the business logic for handling menu operations
|
|
274
274
|
### Folder Structure
|
275
275
|
|
276
276
|
```plaintext
|
277
|
-
├── menu.controller.ts # Handles HTTP requests related to
|
277
|
+
├── menu.controller.ts # Handles HTTP requests related to menu
|
278
278
|
├── menu.service.ts # Contains business logic for menu operations
|
279
279
|
├── menu.service.spec.ts # Testing file for menu service
|
280
280
|
├── menu.module.ts # Module definition for menu functionalities
|
@@ -288,39 +288,39 @@ The `MenuService` class contains the business logic for handling menu operations
|
|
288
288
|
|
289
289
|
# Hedhog Role
|
290
290
|
|
291
|
-
**HedHog Role** module is designed to handle role management within the HedHog framework. It allows for creating, updating, and deleting
|
291
|
+
**HedHog Role** module is designed to handle role management within the HedHog framework. It allows for creating, updating, and deleting role and managing their relationships with user, menu, route, and screens.
|
292
292
|
|
293
293
|
### Features
|
294
294
|
|
295
|
-
- **Role Management**: Create, update, and delete
|
296
|
-
- **User Associations**: Assign and manage
|
297
|
-
- **Menu, Route, and Screen Associations**: Manage the association between
|
295
|
+
- **Role Management**: Create, update, and delete role.
|
296
|
+
- **User Associations**: Assign and manage user associated with role.
|
297
|
+
- **Menu, Route, and Screen Associations**: Manage the association between role and menu, route, or screens.
|
298
298
|
- **Pagination**: Handle paginated responses for all resources.
|
299
299
|
|
300
300
|
### Controller Endpoints
|
301
301
|
|
302
|
-
#### `GET /
|
302
|
+
#### `GET /role`
|
303
303
|
|
304
|
-
- **Description**: Retrieve a paginated list of all
|
304
|
+
- **Description**: Retrieve a paginated list of all role.
|
305
305
|
- **Authentication**: Required (uses `AuthGuard`).
|
306
306
|
- **Parameters**:
|
307
307
|
- `paginationParams` (optional): Standard pagination parameters.
|
308
308
|
|
309
|
-
#### `GET /
|
309
|
+
#### `GET /role/:roleId`
|
310
310
|
|
311
311
|
- **Description**: Retrieve details of a specific role.
|
312
312
|
- **Authentication**: Required (uses `AuthGuard`).
|
313
313
|
- **Parameters**:
|
314
314
|
- `roleId (number)`: The ID of the role to retrieve.
|
315
315
|
|
316
|
-
#### `POST /
|
316
|
+
#### `POST /role`
|
317
317
|
|
318
318
|
- **Description**: Create a new role.
|
319
319
|
- **Authentication**: Required (uses `AuthGuard`).
|
320
320
|
- **Parameters**:
|
321
321
|
- `data` (CreateDTO): The data for the new role (name, description, etc).
|
322
322
|
|
323
|
-
#### `PATCH /
|
323
|
+
#### `PATCH /role/:roleId`
|
324
324
|
|
325
325
|
- **Description**: Update an existing role.
|
326
326
|
- **Authentication**: Required (uses `AuthGuard`).
|
@@ -328,38 +328,38 @@ The `MenuService` class contains the business logic for handling menu operations
|
|
328
328
|
- `roleId (number)`: The ID of the role to update.
|
329
329
|
- `data` (UpdateDTO): The data to update for the role.
|
330
330
|
|
331
|
-
#### `DELETE /
|
331
|
+
#### `DELETE /role`
|
332
332
|
|
333
|
-
- **Description**: Delete one or more
|
333
|
+
- **Description**: Delete one or more role.
|
334
334
|
- **Authentication**: Required (uses `AuthGuard`).
|
335
335
|
- **Parameters**:
|
336
336
|
- `data` (DeleteDTO): List of role IDs to delete.
|
337
337
|
|
338
|
-
#### `GET /
|
338
|
+
#### `GET /role/:roleId/user`
|
339
339
|
|
340
|
-
- **Description**: Get a list of
|
340
|
+
- **Description**: Get a list of user associated with a specific role.
|
341
341
|
- **Authentication**: Required (uses `AuthGuard`).
|
342
342
|
- **Parameters**:
|
343
|
-
- `roleId (number)`: The ID of the role to retrieve
|
343
|
+
- `roleId (number)`: The ID of the role to retrieve user for.
|
344
344
|
- `paginationParams` (optional): Standard pagination parameters.
|
345
345
|
|
346
|
-
#### `GET /
|
346
|
+
#### `GET /role/:roleId/menu`
|
347
347
|
|
348
|
-
- **Description**: Get a list of
|
348
|
+
- **Description**: Get a list of menu associated with a specific role.
|
349
349
|
- **Authentication**: Required (uses `AuthGuard`).
|
350
350
|
- **Parameters**:
|
351
|
-
- `roleId (number)`: The ID of the role to retrieve
|
351
|
+
- `roleId (number)`: The ID of the role to retrieve menu for.
|
352
352
|
- `paginationParams` (optional): Standard pagination parameters.
|
353
353
|
|
354
|
-
#### `GET /
|
354
|
+
#### `GET /role/:roleId/route`
|
355
355
|
|
356
|
-
- **Description**: Get a list of
|
356
|
+
- **Description**: Get a list of route associated with a specific role.
|
357
357
|
- **Authentication**: Required (uses `AuthGuard`).
|
358
358
|
- **Parameters**:
|
359
|
-
- `roleId (number)`: The ID of the role to retrieve
|
359
|
+
- `roleId (number)`: The ID of the role to retrieve route for.
|
360
360
|
- `paginationParams` (optional): Standard pagination parameters.
|
361
361
|
|
362
|
-
#### `GET /
|
362
|
+
#### `GET /role/:roleId/screens`
|
363
363
|
|
364
364
|
- **Description**: Get a list of screens associated with a specific role.
|
365
365
|
- **Authentication**: Required (uses `AuthGuard`).
|
@@ -367,30 +367,30 @@ The `MenuService` class contains the business logic for handling menu operations
|
|
367
367
|
- `roleId (number)`: The ID of the role to retrieve screens for.
|
368
368
|
- `paginationParams` (optional): Standard pagination parameters.
|
369
369
|
|
370
|
-
#### `PATCH /
|
370
|
+
#### `PATCH /role/:roleId/user`
|
371
371
|
|
372
|
-
- **Description**: Update the
|
372
|
+
- **Description**: Update the user associated with a specific role.
|
373
373
|
- **Authentication**: Required (uses `AuthGuard`).
|
374
374
|
- **Parameters**:
|
375
375
|
- `roleId (number)`: The ID of the role. -`data` (UpdateIdsDTO): List of user IDs to associate with the role.
|
376
376
|
|
377
|
-
#### `PATCH /
|
377
|
+
#### `PATCH /role/:roleId/menu`
|
378
378
|
|
379
|
-
- **Description**: Update the
|
379
|
+
- **Description**: Update the menu associated with a specific role.
|
380
380
|
- **Authentication**: Required (uses `AuthGuard`).
|
381
381
|
- **Parameters**:
|
382
382
|
- `roleId (number)`: The ID of the role.
|
383
383
|
- `data` (UpdateIdsDTO): List of menu IDs to associate with the role.
|
384
384
|
|
385
|
-
#### `PATCH /
|
385
|
+
#### `PATCH /role/:roleId/route`
|
386
386
|
|
387
|
-
- **Description**: Update the
|
387
|
+
- **Description**: Update the route associated with a specific role.
|
388
388
|
- **Authentication**: Required (uses `AuthGuard`).
|
389
389
|
- **Parameters**:
|
390
390
|
- `roleId (number)`: The ID of the role.
|
391
391
|
- `data` (UpdateIdsDTO): List of route IDs to associate with the role.
|
392
392
|
|
393
|
-
#### `PATCH /
|
393
|
+
#### `PATCH /role/:roleId/screens`
|
394
394
|
|
395
395
|
- **Description**: Update the screens associated with a specific role.
|
396
396
|
- **Authentication**: Required (uses `AuthGuard`).
|
@@ -402,7 +402,7 @@ The `MenuService` class contains the business logic for handling menu operations
|
|
402
402
|
|
403
403
|
#### `updateUsers(roleId: number, { ids }: UpdateIdsDTO)`
|
404
404
|
|
405
|
-
- **Description**: Updates the
|
405
|
+
- **Description**: Updates the user associated with a specific role by deleting existing associations and creating new ones.
|
406
406
|
- **Parameters**:
|
407
407
|
- `roleId (number)`: The ID of the role to update.
|
408
408
|
- `data`: An object containing an array of user IDs to associate with the role.
|
@@ -416,37 +416,37 @@ The `MenuService` class contains the business logic for handling menu operations
|
|
416
416
|
|
417
417
|
#### `updateRoutes(roleId: number, data: UpdateIdsDTO)`
|
418
418
|
|
419
|
-
- **Description**: Updates the
|
419
|
+
- **Description**: Updates the route associated with a specific role by deleting existing associations and creating new ones.
|
420
420
|
- **Parameters**:
|
421
421
|
- `roleId (number)`: The ID of the role to update.
|
422
422
|
- `data`: An object containing an array of route IDs to associate with the role.
|
423
423
|
|
424
424
|
#### `updateMenus(roleId: number, data: UpdateIdsDTO)`
|
425
425
|
|
426
|
-
- **Description**: Updates the
|
426
|
+
- **Description**: Updates the menu associated with a specific role by deleting existing associations and creating new ones.
|
427
427
|
- **Parameters**:
|
428
428
|
- `roleId (number)`: The ID of the role to update.
|
429
429
|
- `data`: An object containing an array of menu IDs to associate with the role.
|
430
430
|
|
431
431
|
#### `listUsers(roleId: number, paginationParams: PaginationDTO)`
|
432
432
|
|
433
|
-
- **Description**: Retrieves a paginated list of
|
433
|
+
- **Description**: Retrieves a paginated list of user associated with a specific role.
|
434
434
|
- **Parameters**:
|
435
|
-
- `roleId (number)`: The ID of the role to retrieve associated
|
435
|
+
- `roleId (number)`: The ID of the role to retrieve associated user.
|
436
436
|
- `paginationParams`: Includes pagination criteria.
|
437
437
|
|
438
438
|
#### `listMenus(roleId: number, paginationParams: PaginationDTO)`
|
439
439
|
|
440
|
-
- **Description**: Retrieves a paginated list of
|
440
|
+
- **Description**: Retrieves a paginated list of menu associated with a specific role.
|
441
441
|
- **Parameters**:
|
442
|
-
- `roleId (number)`: The ID of the role to retrieve associated
|
442
|
+
- `roleId (number)`: The ID of the role to retrieve associated menu.
|
443
443
|
- `paginationParams`: Includes pagination criteria.
|
444
444
|
|
445
445
|
#### `listRoutes(roleId: number, paginationParams: PaginationDTO)`
|
446
446
|
|
447
|
-
- **Description**: Retrieves a paginated list of
|
447
|
+
- **Description**: Retrieves a paginated list of route associated with a specific role.
|
448
448
|
- **Parameters**:
|
449
|
-
- `roleId (number)`: The ID of the role to retrieve associated
|
449
|
+
- `roleId (number)`: The ID of the role to retrieve associated route.
|
450
450
|
- `paginationParams`: Includes pagination criteria.
|
451
451
|
|
452
452
|
#### `listScreens(roleId: number, paginationParams: PaginationDTO)`
|
@@ -458,7 +458,7 @@ The `MenuService` class contains the business logic for handling menu operations
|
|
458
458
|
|
459
459
|
#### `getRoles(paginationParams: PaginationDTO)`
|
460
460
|
|
461
|
-
- **Description**: Retrieves a paginated list of all
|
461
|
+
- **Description**: Retrieves a paginated list of all role, with optional search functionality based on name and description.
|
462
462
|
- **Parameters**:
|
463
463
|
- `paginationParams`: Includes pagination and search criteria.
|
464
464
|
|
@@ -485,21 +485,21 @@ The `MenuService` class contains the business logic for handling menu operations
|
|
485
485
|
|
486
486
|
#### `delete({ ids }: DeleteDTO)`
|
487
487
|
|
488
|
-
- **Description**: Deletes one or more
|
488
|
+
- **Description**: Deletes one or more role identified by their IDs.
|
489
489
|
- **Parameters**:
|
490
|
-
- `ids (array of number)`: An array containing the IDs of the
|
490
|
+
- `ids (array of number)`: An array containing the IDs of the role to delete.
|
491
491
|
|
492
492
|
### Folder Structure
|
493
493
|
|
494
494
|
```plaintext
|
495
495
|
├── decorators/
|
496
|
-
│ ├── role.decorator.ts # Custom decorator for
|
496
|
+
│ ├── role.decorator.ts # Custom decorator for role
|
497
497
|
├── dto/ # Data Transfer Objects
|
498
498
|
│ ├── create.dto.ts # DTO for creating a role
|
499
499
|
│ ├── update.dto.ts # DTO for updating a role
|
500
500
|
├── guards/
|
501
|
-
│ └── role.guard.ts # Guard for
|
502
|
-
├── role.controller.ts # Handles HTTP requests related to
|
501
|
+
│ └── role.guard.ts # Guard for role
|
502
|
+
├── role.controller.ts # Handles HTTP requests related to role
|
503
503
|
├── role.module.ts # Module definition for the role
|
504
504
|
└── role.service.ts # Service class for role-related logic
|
505
505
|
└── role.service.spec.ts # Testing file for role service
|
@@ -509,38 +509,38 @@ The `MenuService` class contains the business logic for handling menu operations
|
|
509
509
|
|
510
510
|
# Hedhog Route
|
511
511
|
|
512
|
-
**Hedhog Route** module provides a comprehensive system for managing
|
512
|
+
**Hedhog Route** module provides a comprehensive system for managing route within your application. It allows administrators to define, modify, and control access to different route within the application. The module also integrates with other Hedhog modules to ensure that permissions and role are respected when accessing route.
|
513
513
|
|
514
514
|
### Features
|
515
515
|
|
516
|
-
- **CRUD Operations**: Create, Read, Update, and Delete
|
517
|
-
- **Route Management**: Manage application
|
518
|
-
- **Permissions Integration**: Integrates with Hedhog Permission to control access to specific
|
516
|
+
- **CRUD Operations**: Create, Read, Update, and Delete route.
|
517
|
+
- **Route Management**: Manage application route, including their accessibility and assignment to user role.
|
518
|
+
- **Permissions Integration**: Integrates with Hedhog Permission to control access to specific route based on user role.
|
519
519
|
|
520
520
|
### Controller Endpoints
|
521
521
|
|
522
|
-
#### `GET /
|
522
|
+
#### `GET /route`
|
523
523
|
|
524
|
-
- **Description**: Retrieves a paginated list of all
|
524
|
+
- **Description**: Retrieves a paginated list of all route.
|
525
525
|
- **Authentication**: Required (uses `AuthGuard`).
|
526
526
|
- **Parameters**:
|
527
527
|
- `paginationParams`: Includes pagination criteria.
|
528
528
|
|
529
|
-
#### `GET /
|
529
|
+
#### `GET /route/:routeId`
|
530
530
|
|
531
531
|
- **Description**: Retrieves a specific route by its ID.
|
532
532
|
- **Authentication**: Required (uses `AuthGuard`).
|
533
533
|
- **Parameters**:
|
534
534
|
- `routeId (number)`: The ID of the route to retrieve.
|
535
535
|
|
536
|
-
#### `POST /
|
536
|
+
#### `POST /route`
|
537
537
|
|
538
538
|
- **Description**: Creates a new route with the specified URL and method.
|
539
539
|
- **Authentication**: Required (uses `AuthGuard`).
|
540
540
|
- **Parameters**:
|
541
541
|
- `data`: An object containing the url and method for the new route.
|
542
542
|
|
543
|
-
#### `PATCH /
|
543
|
+
#### `PATCH /route/:routeId`
|
544
544
|
|
545
545
|
- **Description**: Updates an existing route identified by its ID.
|
546
546
|
- **Authentication**: Required (uses `AuthGuard`).
|
@@ -548,30 +548,30 @@ The `MenuService` class contains the business logic for handling menu operations
|
|
548
548
|
- `routeId (number)`: The ID of the route to update.
|
549
549
|
- `data`: An object containing the updated information for the route.
|
550
550
|
|
551
|
-
#### `DELETE /
|
551
|
+
#### `DELETE /route`
|
552
552
|
|
553
|
-
- **Description**: Deletes one or more
|
553
|
+
- **Description**: Deletes one or more route.
|
554
554
|
- **Authentication**: Required (uses `AuthGuard`).
|
555
555
|
- **Parameters**:
|
556
556
|
- `data`: An object containing an array of route IDs to delete.
|
557
557
|
|
558
|
-
#### `GET /
|
558
|
+
#### `GET /route/:routeId/role`
|
559
559
|
|
560
|
-
- **Description**: Retrieves a paginated list of
|
560
|
+
- **Description**: Retrieves a paginated list of role associated with a specific route.
|
561
561
|
- **Authentication**: Required (uses `AuthGuard`).
|
562
562
|
- **Parameters**:
|
563
|
-
- `routeId (number)`: The ID of the route to retrieve associated
|
563
|
+
- `routeId (number)`: The ID of the route to retrieve associated role.
|
564
564
|
- `paginationParams`: Includes pagination criteria.
|
565
565
|
|
566
|
-
#### `PATCH /
|
566
|
+
#### `PATCH /route/:routeId/role`
|
567
567
|
|
568
|
-
- **Description**: Updates the
|
568
|
+
- **Description**: Updates the role associated with a specific route.
|
569
569
|
- **Authentication**: Required (uses `AuthGuard`).
|
570
570
|
- **Parameters**:
|
571
571
|
- `routeId (number)`: The ID of the route.
|
572
572
|
- `data`: An object containing an array of role IDs to associate with the route.
|
573
573
|
|
574
|
-
#### `GET /
|
574
|
+
#### `GET /route/:routeId/screens`
|
575
575
|
|
576
576
|
- **Description**: Retrieves a paginated list of screens associated with a specific route.
|
577
577
|
- **Authentication**: Required (uses `AuthGuard`).
|
@@ -579,7 +579,7 @@ The `MenuService` class contains the business logic for handling menu operations
|
|
579
579
|
- `routeId (number)`: The ID of the route to retrieve associated screens.
|
580
580
|
- `paginationParams`: Includes pagination criteria.
|
581
581
|
|
582
|
-
#### `PATCH /
|
582
|
+
#### `PATCH /route/:routeId/screens`
|
583
583
|
|
584
584
|
- **Description:** Updates the screens associated with a specific route.
|
585
585
|
- **Authentication**: Required (uses AuthGuard).
|
@@ -591,7 +591,7 @@ The `MenuService` class contains the business logic for handling menu operations
|
|
591
591
|
|
592
592
|
#### `getRoutes(paginationParams: PaginationDTO)`
|
593
593
|
|
594
|
-
- **Description**: Retrieves a paginated list of
|
594
|
+
- **Description**: Retrieves a paginated list of route with optional search functionality based on URL and method.
|
595
595
|
- **Parameters**:
|
596
596
|
- `paginationParams`: Includes pagination and search criteria.
|
597
597
|
|
@@ -616,20 +616,20 @@ The `MenuService` class contains the business logic for handling menu operations
|
|
616
616
|
|
617
617
|
#### `delete({ ids }: DeleteDTO)`
|
618
618
|
|
619
|
-
- **Description**: Deletes one or more
|
619
|
+
- **Description**: Deletes one or more route identified by their IDs.
|
620
620
|
- **Parameters**:
|
621
621
|
- `ids`: An object containing an array of route IDs to delete.
|
622
622
|
|
623
623
|
#### `listRoles(routeId: number, paginationParams: PaginationDTO)`
|
624
624
|
|
625
|
-
- **Description**: Retrieves a paginated list of
|
625
|
+
- **Description**: Retrieves a paginated list of role associated with a specific route.
|
626
626
|
- **Parameters**:
|
627
|
-
- `routeId`: The ID of the route to retrieve associated
|
627
|
+
- `routeId`: The ID of the route to retrieve associated role.
|
628
628
|
- `paginationParams`: Includes pagination parameters.
|
629
629
|
|
630
630
|
#### `updateRoles(routeId: number, data: UpdateIdsDTO)`
|
631
631
|
|
632
|
-
- **Description**: Updates the
|
632
|
+
- **Description**: Updates the role associated with a specific route.
|
633
633
|
- **Parameters**:
|
634
634
|
- `routeId`: The ID of the route.
|
635
635
|
- `data`: An object containing an array of role IDs to associate with the route.
|
@@ -655,8 +655,8 @@ The `MenuService` class contains the business logic for handling menu operations
|
|
655
655
|
│ ├── create.dto.ts # DTO for creating a route
|
656
656
|
│ ├── update.dto.ts # DTO for updating a route
|
657
657
|
├── guards/
|
658
|
-
│ └── route.guard.ts # Guard for
|
659
|
-
├── route.controller.ts # Handles HTTP requests related to
|
658
|
+
│ └── route.guard.ts # Guard for route
|
659
|
+
├── route.controller.ts # Handles HTTP requests related to route
|
660
660
|
├── route.module.ts # Module definition for the route
|
661
661
|
├── route.service.ts # Service class for route-related logic
|
662
662
|
└── route.service.spec.ts # Testing file for route service
|
@@ -666,31 +666,31 @@ The `MenuService` class contains the business logic for handling menu operations
|
|
666
666
|
|
667
667
|
# Hedhog Setting
|
668
668
|
|
669
|
-
**Hedhog Setting** module provides a comprehensive solution for managing application
|
669
|
+
**Hedhog Setting** module provides a comprehensive solution for managing application setting. It includes functionalities to create, read, update, and delete setting, along with support for pagination and search capabilities. This module integrates with the HedHog ecosystem, utilizing @hedhog/pagination for managing paginated results and @hedhog/prisma for database interactions.
|
670
670
|
|
671
671
|
### Controller Endpoints
|
672
672
|
|
673
|
-
#### `GET /
|
673
|
+
#### `GET /setting`
|
674
674
|
|
675
|
-
- **Description**: Retrieve a paginated list of
|
675
|
+
- **Description**: Retrieve a paginated list of setting.
|
676
676
|
- **Authentication**: Required (uses `AuthGuard`).
|
677
677
|
- **Pagination**: Supports pagination through query parameters.
|
678
678
|
|
679
|
-
#### `GET /
|
679
|
+
#### `GET /setting/:settingId`
|
680
680
|
|
681
681
|
- **Description**: Retrieve a specific setting by its ID.
|
682
682
|
- **Authentication**: Required (uses AuthGuard).
|
683
683
|
- **Parameters**:
|
684
684
|
- **settingId** (number): The ID of the setting to retrieve.
|
685
685
|
|
686
|
-
#### `POST /
|
686
|
+
#### `POST /setting`
|
687
687
|
|
688
688
|
- **Description**: Create a new setting.
|
689
689
|
- **Authentication**: Required (uses AuthGuard).
|
690
690
|
- **Body**:
|
691
691
|
- **name** (string): Name of the setting.
|
692
692
|
|
693
|
-
#### `PATCH /
|
693
|
+
#### `PATCH /setting/:settingId`
|
694
694
|
|
695
695
|
- **Description**: Update an existing setting.
|
696
696
|
- **Authentication**: Required (uses AuthGuard).
|
@@ -699,9 +699,9 @@ The `MenuService` class contains the business logic for handling menu operations
|
|
699
699
|
- **Body**:
|
700
700
|
- **name** (string, optional): Updated name of the setting.
|
701
701
|
|
702
|
-
#### `DELETE /
|
702
|
+
#### `DELETE /setting`
|
703
703
|
|
704
|
-
- **Description**: Delete one or more
|
704
|
+
- **Description**: Delete one or more setting.
|
705
705
|
- **Authentication**: Required (uses AuthGuard).
|
706
706
|
- **Body**:
|
707
707
|
- **ids** (number[]): Array of setting IDs to delete.
|
@@ -710,7 +710,7 @@ The `MenuService` class contains the business logic for handling menu operations
|
|
710
710
|
|
711
711
|
#### `getSettings(paginationParams: PaginationDTO)`
|
712
712
|
|
713
|
-
- **Description**: Retrieves a paginated list of
|
713
|
+
- **Description**: Retrieves a paginated list of setting with optional search functionality.
|
714
714
|
- **Parameters**:
|
715
715
|
- **paginationParams**: Includes pagination and search criteria.
|
716
716
|
|
@@ -735,7 +735,7 @@ The `MenuService` class contains the business logic for handling menu operations
|
|
735
735
|
|
736
736
|
#### `delete(data: DeleteDTO)`
|
737
737
|
|
738
|
-
- **Description**: Deletes one or more
|
738
|
+
- **Description**: Deletes one or more setting.
|
739
739
|
- **Parameters**:
|
740
740
|
- **data**: Includes array of ids to delete.
|
741
741
|
|
@@ -743,12 +743,12 @@ The `MenuService` class contains the business logic for handling menu operations
|
|
743
743
|
|
744
744
|
```plaintext
|
745
745
|
|── dto/ # Data Transfer Objects
|
746
|
-
│ |── create.dto.ts # DTO for creating
|
747
|
-
│ |── delete.dto.ts # DTO for deleting
|
748
|
-
│ |── update.dto.ts # DTO for updating
|
749
|
-
|── setting.controller.ts # Controller for
|
750
|
-
|── setting.module.ts # Module definition for
|
751
|
-
|── setting.service.ts # Service class for
|
746
|
+
│ |── create.dto.ts # DTO for creating setting
|
747
|
+
│ |── delete.dto.ts # DTO for deleting setting
|
748
|
+
│ |── update.dto.ts # DTO for updating setting
|
749
|
+
|── setting.controller.ts # Controller for setting
|
750
|
+
|── setting.module.ts # Module definition for setting
|
751
|
+
|── setting.service.ts # Service class for setting logic
|
752
752
|
|── setting.service.spec.ts # Testing file for setting service
|
753
753
|
```
|
754
754
|
|
@@ -863,24 +863,24 @@ The **Hedhog User** module in HedHog provides functionality to manage user data
|
|
863
863
|
|
864
864
|
- **Pagination**: Utilizes `@hedhog/pagination` for managing paginated results of user queries.
|
865
865
|
- **Database Interaction**: Uses `@hedhog/prisma` to interface with the database for user data management.
|
866
|
-
- **Authentication**: Secured with Auth Module from `@hedhog/admin` to ensure that only authorized
|
866
|
+
- **Authentication**: Secured with Auth Module from `@hedhog/admin` to ensure that only authorized user can access or modify user data.
|
867
867
|
|
868
868
|
### Controller Endpoints
|
869
869
|
|
870
|
-
#### `GET /
|
870
|
+
#### `GET /user`
|
871
871
|
|
872
|
-
- **Description**: Retrieve a paginated list of
|
872
|
+
- **Description**: Retrieve a paginated list of user.
|
873
873
|
- **Authentication**: Required (uses `AuthGuard`).
|
874
874
|
- **Pagination**: Supports pagination through query parameters.
|
875
875
|
|
876
|
-
#### `GET /
|
876
|
+
#### `GET /user/:userId`
|
877
877
|
|
878
878
|
- **Description**: Retrieve a specific user by its ID.
|
879
879
|
- **Authentication**: Required (uses `AuthGuard`).
|
880
880
|
- **Parameters**:
|
881
881
|
- **userId** (number): The ID of the user to retrieve.
|
882
882
|
|
883
|
-
#### `POST /
|
883
|
+
#### `POST /user`
|
884
884
|
|
885
885
|
- **Description**: Create a new user.
|
886
886
|
- **Authentication**: Required (uses `AuthGuard`).
|
@@ -889,7 +889,7 @@ The **Hedhog User** module in HedHog provides functionality to manage user data
|
|
889
889
|
- **name** (string): Name of the user.
|
890
890
|
- **password** (string): Password of the user.
|
891
891
|
|
892
|
-
#### `PATCH /
|
892
|
+
#### `PATCH /user/:userId`
|
893
893
|
|
894
894
|
- **Description**: Update an existing user.
|
895
895
|
- **Authentication**: Required (uses `AuthGuard`).
|
@@ -900,9 +900,9 @@ The **Hedhog User** module in HedHog provides functionality to manage user data
|
|
900
900
|
- **name** (string, optional): Updated name of the user.
|
901
901
|
- **password** (string, optional): Updated password of the user.
|
902
902
|
|
903
|
-
#### `DELETE /
|
903
|
+
#### `DELETE /user`
|
904
904
|
|
905
|
-
- **Description**: Delete one or more
|
905
|
+
- **Description**: Delete one or more user.
|
906
906
|
- **Authentication**: Required (uses `AuthGuard`).
|
907
907
|
- **Body**:
|
908
908
|
- **ids** (number[]): Array of user IDs to delete.
|
@@ -911,7 +911,7 @@ The **Hedhog User** module in HedHog provides functionality to manage user data
|
|
911
911
|
|
912
912
|
#### `getUsers(paginationParams: PaginationDTO)`
|
913
913
|
|
914
|
-
- **Description**: Retrieves a paginated list of
|
914
|
+
- **Description**: Retrieves a paginated list of user with optional search functionality.
|
915
915
|
- **Parameters**:
|
916
916
|
- **paginationParams**: Includes pagination and search criteria.
|
917
917
|
|
@@ -942,7 +942,7 @@ The **Hedhog User** module in HedHog provides functionality to manage user data
|
|
942
942
|
|
943
943
|
#### `delete(data: DeleteDTO)`
|
944
944
|
|
945
|
-
- **Description**: Deletes one or more
|
945
|
+
- **Description**: Deletes one or more user.
|
946
946
|
- **Parameters**:
|
947
947
|
- **data**: Includes array of user IDs to delete.
|
948
948
|
|
@@ -956,5 +956,5 @@ The **Hedhog User** module in HedHog provides functionality to manage user data
|
|
956
956
|
│ └── update.dto.ts # Data Transfer Object for updating a user
|
957
957
|
├── user.module.ts # Module for UserService
|
958
958
|
├── user.controller.ts # Controller for user-related endpoints
|
959
|
-
└── user.service.ts # Service handling business logic for
|
959
|
+
└── user.service.ts # Service handling business logic for user
|
960
960
|
```
|