@hedhog/admin 0.0.94 → 0.0.95
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +171 -35
- package/dist/auth/auth.module.d.ts.map +1 -1
- package/dist/auth/auth.module.js +1 -0
- package/dist/auth/auth.module.js.map +1 -1
- package/dist/locale/dto/create.dto.d.ts.map +1 -1
- package/dist/locale/dto/create.dto.js.map +1 -1
- package/dist/locale/dto/set-enabled.dto.d.ts +4 -0
- package/dist/locale/dto/set-enabled.dto.d.ts.map +1 -0
- package/dist/locale/dto/set-enabled.dto.js +24 -0
- package/dist/locale/dto/set-enabled.dto.js.map +1 -0
- package/dist/locale/dto/update.dto.d.ts.map +1 -1
- package/dist/locale/dto/update.dto.js.map +1 -1
- package/dist/locale/locale.controller.d.ts +3 -1
- package/dist/locale/locale.controller.d.ts.map +1 -1
- package/dist/locale/locale.controller.js +15 -3
- package/dist/locale/locale.controller.js.map +1 -1
- package/dist/locale/locale.service.d.ts +2 -1
- package/dist/locale/locale.service.d.ts.map +1 -1
- package/dist/locale/locale.service.js +57 -3
- package/dist/locale/locale.service.js.map +1 -1
- package/dist/locale/locale.service.spec.js +33 -25
- package/dist/locale/locale.service.spec.js.map +1 -1
- package/dist/setting/settings.service.d.ts +1 -1
- package/dist/setting/settings.service.d.ts.map +1 -1
- package/dist/setting/settings.service.js +20 -11
- package/dist/setting/settings.service.js.map +1 -1
- package/hedhog.yaml +3 -0
- package/package.json +3 -2
package/README.md
CHANGED
@@ -8,10 +8,12 @@
|
|
8
8
|
|
9
9
|
- [Overview](#overview)
|
10
10
|
- [Hedhog Auth](#hedhog-auth)
|
11
|
+
- [Hedhog Locale](#hedhog-locale)
|
11
12
|
- [Hedhog Menu](#hedhog-menu)
|
12
13
|
- [Hedhog Role](#hedhog-role)
|
13
14
|
- [Hedhog Route](#hedhog-route)
|
14
15
|
- [Hedhog Screen](#hedhog-screen)
|
16
|
+
- [Hedhog Setting](#hedhog-setting)
|
15
17
|
- [Hedhog User](#hedhog-user)
|
16
18
|
|
17
19
|
# Overview
|
@@ -23,9 +25,11 @@ Whether you need to secure access to resources, manage user roles, or handle fil
|
|
23
25
|
### Included Modules<
|
24
26
|
|
25
27
|
- **@hedhog/auth**: Provides authentication and authorization mechanisms, ensuring secure access to application resources.
|
28
|
+
- **@hedhog/locale**: Provides solution for managing locales and translations across applications.
|
26
29
|
- **@hedhog/menu**: Allows for the creation and management of dynamic menus within the application interface.
|
27
30
|
- **@hedhog/role**: Facilitates the management of roles, controlling access to specific features or areas.
|
28
31
|
- **@hedhog/route**: Provides a comprehensive system for managing routes within your application.
|
32
|
+
- **@hedhog/setting**: Provides a solution for managing application settings.
|
29
33
|
- **@hedhog/screen**: Provides a structure for managing different screens and UI components.
|
30
34
|
- **@hedhog/user**: Manages user accounts, including creation, updates, and deletion, along with password encryption and secure access.
|
31
35
|
|
@@ -91,6 +95,7 @@ The `AuthService` provides methods for:
|
|
91
95
|
```plaintext
|
92
96
|
├── auth.controller.ts # Defines routes for authentication
|
93
97
|
├── auth.service.ts # Contains authentication logic
|
98
|
+
├── auth.service.spec.ts # Testing file for auth service
|
94
99
|
├── auth.module.ts # Authentication module
|
95
100
|
├── dto/
|
96
101
|
│ ├── forget.dto.ts # Data Transfer Object for password reset
|
@@ -109,6 +114,131 @@ The `AuthService` provides methods for:
|
|
109
114
|
|
110
115
|
---
|
111
116
|
|
117
|
+
# Hedhog Locale
|
118
|
+
|
119
|
+
**Hedhog Locale** module provides a powerful solution for managing locales and translations 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
|
+
|
121
|
+
### Controller Endpoints
|
122
|
+
|
123
|
+
#### `GET /locales/system/enables`
|
124
|
+
|
125
|
+
- **Description**: Retrieve a paginated list of enabled locales.
|
126
|
+
- **Authentication**: Not required (public endpoint).
|
127
|
+
- **Parameters**:
|
128
|
+
- `locale (string)`: Locale code for filtering.
|
129
|
+
- Pagination parameters (optional).
|
130
|
+
|
131
|
+
#### `GET /locales/:localeCode/:namespace`
|
132
|
+
|
133
|
+
- **Description**: Retrieve translations for a specific locale and namespace.
|
134
|
+
- **Authentication**: Not required (public endpoint).
|
135
|
+
- **Parameters**:
|
136
|
+
- `localeCode (string)`: The locale code to fetch translations for.
|
137
|
+
- `namespace (string)`: The namespace to fetch translations from.
|
138
|
+
|
139
|
+
#### `GET /locales`
|
140
|
+
|
141
|
+
- **Description**: Retrieve a paginated list of locales.
|
142
|
+
- **Authentication**: Required.
|
143
|
+
- **Pagination**: Supports pagination through query parameters.
|
144
|
+
|
145
|
+
#### `GET /locales/:id`
|
146
|
+
|
147
|
+
- **Description**: Retrieve a specific locale by its ID.
|
148
|
+
- **Authentication**: Required.
|
149
|
+
- **Parameters**:
|
150
|
+
- `id (number)`: The ID of the locale to retrieve.
|
151
|
+
|
152
|
+
#### `POST /locales`
|
153
|
+
|
154
|
+
- **Description**: Create a new locale entry.
|
155
|
+
- **Authentication**: Required.
|
156
|
+
- **Body**:
|
157
|
+
- `code (string)`: The code of the locale.
|
158
|
+
- `region (string)`: The region of the locale.
|
159
|
+
|
160
|
+
#### `PATCH /locales/:id`
|
161
|
+
|
162
|
+
- **Description**: Update an existing locale entry.
|
163
|
+
- **Authentication**: Required.
|
164
|
+
- **Parameters**:
|
165
|
+
- `id (number)`: The ID of the locale to update.
|
166
|
+
- **Body**:
|
167
|
+
- `code (string, optional)`: Updated code of the locale.
|
168
|
+
- `region (string, optional)`: Updated region of the locale.
|
169
|
+
|
170
|
+
#### `DELETE /locales`
|
171
|
+
|
172
|
+
- **Description**: Delete one or more locales.
|
173
|
+
- **Authentication**: Required.
|
174
|
+
- **Body**:
|
175
|
+
- `ids (number[])`: Array of locale IDs to delete.
|
176
|
+
|
177
|
+
### Service Methods
|
178
|
+
|
179
|
+
#### `getEnables(locale: string, paginationParams: PaginationDTO)`
|
180
|
+
|
181
|
+
- **Description**: Retrieves a paginated list of enabled locales based on locale code and pagination parameters.
|
182
|
+
- **Parameters**:
|
183
|
+
- `locale (string)`: Locale code for filtering.
|
184
|
+
- `paginationParams (PaginationDTO)`: Includes pagination criteria.
|
185
|
+
|
186
|
+
#### `getTranslations(localeCode: string, namespace: string)`
|
187
|
+
|
188
|
+
- **Description**: Retrieves translations for a given locale code and namespace.
|
189
|
+
- **Parameters**:
|
190
|
+
- `localeCode (string)`: The locale code to fetch translations for.
|
191
|
+
- `namespace (string)`: The namespace to fetch translations from.
|
192
|
+
|
193
|
+
#### `get(paginationParams: PaginationDTO)`
|
194
|
+
|
195
|
+
- **Description**: Retrieves a paginated list of all locales.
|
196
|
+
- **Parameters**:
|
197
|
+
- `paginationParams (PaginationDTO)`: Includes pagination criteria.
|
198
|
+
|
199
|
+
#### `getById(localeId: number)`
|
200
|
+
|
201
|
+
- **Description**: Retrieves a specific locale by its ID.
|
202
|
+
- **Parameters**:
|
203
|
+
- `localeId (number)`: ID of the locale to retrieve.
|
204
|
+
|
205
|
+
#### `create(data: CreateDTO)`
|
206
|
+
|
207
|
+
- **Description**: Creates a new locale entry.
|
208
|
+
- **Parameters**:
|
209
|
+
- `data (CreateDTO)`: Includes code and region of the new locale.
|
210
|
+
|
211
|
+
#### `update(id: number, data: UpdateDTO)`
|
212
|
+
|
213
|
+
- **Description**: Updates an existing locale entry.
|
214
|
+
- **Parameters**:
|
215
|
+
- `id (number)`: ID of the locale to update.
|
216
|
+
- `data (UpdateDTO)`: Includes updated code and region.
|
217
|
+
|
218
|
+
#### `delete(data: DeleteDTO)`
|
219
|
+
|
220
|
+
- **Description**: Deletes one or more locale entries.
|
221
|
+
- **Parameters**:
|
222
|
+
- `data (DeleteDTO)`: Includes array of IDs to delete.
|
223
|
+
|
224
|
+
### Folder Structure
|
225
|
+
|
226
|
+
```plaintext
|
227
|
+
|── dto/ # Data Transfer Objects
|
228
|
+
│ ├── create.dto.ts # DTO for creating locales
|
229
|
+
│ ├── delete.dto.ts # DTO for deleting locales
|
230
|
+
│ └── update.dto.ts # DTO for updating locales
|
231
|
+
|── locale.controller.ts # Controller for locales
|
232
|
+
|── locale.decorator.ts # Decorator for injecting locale into requests
|
233
|
+
|── locale.middleware.ts # Middleware to handle locale-specific processing
|
234
|
+
|── locale.module.ts # Module definition for locales
|
235
|
+
|── locale.service.ts # Service class for locales logic
|
236
|
+
├── locale.service.spec.ts # Testing file for locale service
|
237
|
+
|── index.ts # Main export file for the module
|
238
|
+
```
|
239
|
+
|
240
|
+
---
|
241
|
+
|
112
242
|
# Hedhog Menu
|
113
243
|
|
114
244
|
**HedHog Menu** is a library for managing menus 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 menus.
|
@@ -146,6 +276,7 @@ The `MenuService` class contains the business logic for handling menu operations
|
|
146
276
|
```plaintext
|
147
277
|
├── menu.controller.ts # Handles HTTP requests related to menus
|
148
278
|
├── menu.service.ts # Contains business logic for menu operations
|
279
|
+
├── menu.service.spec.ts # Testing file for menu service
|
149
280
|
├── menu.module.ts # Module definition for menu functionalities
|
150
281
|
├── dto/
|
151
282
|
│ ├── create.dto.ts # Data Transfer Object for creating a menu
|
@@ -371,6 +502,7 @@ The `MenuService` class contains the business logic for handling menu operations
|
|
371
502
|
├── role.controller.ts # Handles HTTP requests related to roles
|
372
503
|
├── role.module.ts # Module definition for the role
|
373
504
|
└── role.service.ts # Service class for role-related logic
|
505
|
+
└── role.service.spec.ts # Testing file for role service
|
374
506
|
```
|
375
507
|
|
376
508
|
---
|
@@ -526,7 +658,8 @@ The `MenuService` class contains the business logic for handling menu operations
|
|
526
658
|
│ └── route.guard.ts # Guard for routes
|
527
659
|
├── route.controller.ts # Handles HTTP requests related to routes
|
528
660
|
├── route.module.ts # Module definition for the route
|
529
|
-
|
661
|
+
├── route.service.ts # Service class for route-related logic
|
662
|
+
└── route.service.spec.ts # Testing file for route service
|
530
663
|
```
|
531
664
|
|
532
665
|
---
|
@@ -535,29 +668,29 @@ The `MenuService` class contains the business logic for handling menu operations
|
|
535
668
|
|
536
669
|
**Hedhog Setting** module provides a comprehensive solution for managing application settings. It includes functionalities to create, read, update, and delete settings, 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.
|
537
670
|
|
538
|
-
|
671
|
+
### Controller Endpoints
|
539
672
|
|
540
|
-
|
673
|
+
#### `GET /settings`
|
541
674
|
|
542
675
|
- **Description**: Retrieve a paginated list of settings.
|
543
676
|
- **Authentication**: Required (uses `AuthGuard`).
|
544
677
|
- **Pagination**: Supports pagination through query parameters.
|
545
678
|
|
546
|
-
|
679
|
+
#### `GET /settings/:settingId`
|
547
680
|
|
548
681
|
- **Description**: Retrieve a specific setting by its ID.
|
549
682
|
- **Authentication**: Required (uses AuthGuard).
|
550
683
|
- **Parameters**:
|
551
684
|
- **settingId** (number): The ID of the setting to retrieve.
|
552
685
|
|
553
|
-
|
686
|
+
#### `POST /settings`
|
554
687
|
|
555
688
|
- **Description**: Create a new setting.
|
556
689
|
- **Authentication**: Required (uses AuthGuard).
|
557
690
|
- **Body**:
|
558
691
|
- **name** (string): Name of the setting.
|
559
692
|
|
560
|
-
|
693
|
+
#### `PATCH /settings/:settingId`
|
561
694
|
|
562
695
|
- **Description**: Update an existing setting.
|
563
696
|
- **Authentication**: Required (uses AuthGuard).
|
@@ -566,44 +699,45 @@ The `MenuService` class contains the business logic for handling menu operations
|
|
566
699
|
- **Body**:
|
567
700
|
- **name** (string, optional): Updated name of the setting.
|
568
701
|
|
569
|
-
|
702
|
+
#### `DELETE /settings`
|
570
703
|
|
571
704
|
- **Description**: Delete one or more settings.
|
572
705
|
- **Authentication**: Required (uses AuthGuard).
|
573
706
|
- **Body**:
|
574
707
|
- **ids** (number[]): Array of setting IDs to delete.
|
575
708
|
|
576
|
-
|
709
|
+
### Service Methods
|
577
710
|
|
578
|
-
|
711
|
+
#### `getSettings(paginationParams: PaginationDTO)`
|
579
712
|
|
580
|
-
|
581
|
-
|
582
|
-
|
713
|
+
- **Description**: Retrieves a paginated list of settings with optional search functionality.
|
714
|
+
- **Parameters**:
|
715
|
+
- **paginationParams**: Includes pagination and search criteria.
|
583
716
|
|
584
|
-
|
717
|
+
#### `get(settingId: number)`
|
718
|
+
|
719
|
+
- **Description**: Retrieves a specific setting by its ID.
|
720
|
+
- **Parameters**:
|
721
|
+
- **settingId**: ID of the setting to retrieve.
|
585
722
|
|
586
|
-
|
587
|
-
- **Parameters**:
|
588
|
-
- **settingId**: ID of the setting to retrieve.
|
723
|
+
#### `create(data: CreateDTO)`
|
589
724
|
|
590
|
-
- **
|
725
|
+
- **Description**: Creates a new setting.
|
726
|
+
- **Parameters**:
|
727
|
+
- **data**: Includes name of the setting.
|
591
728
|
|
592
|
-
|
593
|
-
- **Parameters**:
|
594
|
-
- **data**: Includes name of the setting.
|
729
|
+
#### `update(id: number, data: UpdateDTO)`
|
595
730
|
|
596
|
-
- **
|
731
|
+
- **Description**: Updates an existing setting.
|
732
|
+
- **Parameters**:
|
733
|
+
- **id**: ID of the setting to update.
|
734
|
+
- **data**: Includes updated name of the setting.
|
597
735
|
|
598
|
-
|
599
|
-
- **Parameters**:
|
600
|
-
- **id**: ID of the setting to update.
|
601
|
-
- **data**: Includes updated name of the setting.
|
736
|
+
#### `delete(data: DeleteDTO)`
|
602
737
|
|
603
|
-
- **
|
604
|
-
|
605
|
-
- **
|
606
|
-
- **data**: Includes array of ids to delete.
|
738
|
+
- **Description**: Deletes one or more settings.
|
739
|
+
- **Parameters**:
|
740
|
+
- **data**: Includes array of ids to delete.
|
607
741
|
|
608
742
|
## Folder Structure
|
609
743
|
|
@@ -615,6 +749,7 @@ The `MenuService` class contains the business logic for handling menu operations
|
|
615
749
|
|── setting.controller.ts # Controller for settings
|
616
750
|
|── setting.module.ts # Module definition for settings
|
617
751
|
|── setting.service.ts # Service class for settings logic
|
752
|
+
|── setting.service.spec.ts # Testing file for setting service
|
618
753
|
```
|
619
754
|
|
620
755
|
---
|
@@ -715,6 +850,7 @@ The `MenuService` class contains the business logic for handling menu operations
|
|
715
850
|
├── screen.controller.ts # Handles HTTP requests related to screens
|
716
851
|
├── screen.module.ts # Module definition for the screen
|
717
852
|
└── screen.service.ts # Service class for screen-related logic
|
853
|
+
└── screen.service.spec.ts # Testing file for screen service
|
718
854
|
```
|
719
855
|
|
720
856
|
---
|
@@ -773,38 +909,38 @@ The **Hedhog User** module in HedHog provides functionality to manage user data
|
|
773
909
|
|
774
910
|
### Service Methods
|
775
911
|
|
776
|
-
|
912
|
+
#### `getUsers(paginationParams: PaginationDTO)`
|
777
913
|
|
778
914
|
- **Description**: Retrieves a paginated list of users with optional search functionality.
|
779
915
|
- **Parameters**:
|
780
916
|
- **paginationParams**: Includes pagination and search criteria.
|
781
917
|
|
782
|
-
|
918
|
+
#### `get(userId: number)`
|
783
919
|
|
784
920
|
- **Description**: Retrieves a specific user by its ID.
|
785
921
|
- **Parameters**:
|
786
922
|
- **userId**: ID of the user to retrieve.
|
787
923
|
|
788
|
-
|
924
|
+
#### `hashPassword(password: string): Promise<string>`
|
789
925
|
|
790
926
|
- **Description**: Hashes a password using bcrypt.
|
791
927
|
- **Parameters**:
|
792
928
|
- **password**: The password to be hashed.
|
793
929
|
|
794
|
-
|
930
|
+
#### `create(data: CreateDTO)`
|
795
931
|
|
796
932
|
- **Description**: Creates a new user.
|
797
933
|
- **Parameters**:
|
798
934
|
- **data**: Includes email, name, and password.
|
799
935
|
|
800
|
-
|
936
|
+
#### `update(id: number, data: UpdateDTO)`
|
801
937
|
|
802
938
|
- **Description**: Updates an existing user.
|
803
939
|
- **Parameters**:
|
804
940
|
- **id**: ID of the user to update.
|
805
941
|
- **data**: Includes updated email, name, and password.
|
806
942
|
|
807
|
-
|
943
|
+
#### `delete(data: DeleteDTO)`
|
808
944
|
|
809
945
|
- **Description**: Deletes one or more users.
|
810
946
|
- **Parameters**:
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"auth.module.d.ts","sourceRoot":"","sources":["../../src/auth/auth.module.ts"],"names":[],"mappings":"AASA,
|
1
|
+
{"version":3,"file":"auth.module.d.ts","sourceRoot":"","sources":["../../src/auth/auth.module.ts"],"names":[],"mappings":"AASA,qBAiCa,UAAU;CAAG"}
|
package/dist/auth/auth.module.js
CHANGED
@@ -24,6 +24,7 @@ exports.AuthModule = AuthModule = __decorate([
|
|
24
24
|
(0, common_1.forwardRef)(() => jwt_1.JwtModule.registerAsync({
|
25
25
|
global: true,
|
26
26
|
useFactory: () => {
|
27
|
+
console.log('AuthModule -> process.env.JWT_SECRET', process.env.JWT_SECRET);
|
27
28
|
return {
|
28
29
|
secret: String(process.env.JWT_SECRET),
|
29
30
|
global: true,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"auth.module.js","sourceRoot":"","sources":["../../src/auth/auth.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAoD;AACpD,iDAA6C;AAC7C,uDAAmD;AACnD,2CAA8C;AAC9C,qCAAwC;AACxC,uCAAyC;AACzC,oDAAgD;AAChD,uCAA0C;
|
1
|
+
{"version":3,"file":"auth.module.js","sourceRoot":"","sources":["../../src/auth/auth.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAoD;AACpD,iDAA6C;AAC7C,uDAAmD;AACnD,2CAA8C;AAC9C,qCAAwC;AACxC,uCAAyC;AACzC,oDAAgD;AAChD,uCAA0C;AAmCnC,IAAM,UAAU,GAAhB,MAAM,UAAU;CAAG,CAAA;AAAb,gCAAU;qBAAV,UAAU;IAjCtB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,IAAA,mBAAU,EAAC,GAAG,EAAE,CACd,eAAS,CAAC,aAAa,CAAC;gBACtB,MAAM,EAAE,IAAI;gBACZ,UAAU,EAAE,GAAG,EAAE;oBACf,OAAO,CAAC,GAAG,CACT,sCAAsC,EACtC,OAAO,CAAC,GAAG,CAAC,UAAU,CACvB,CAAC;oBACF,OAAO;wBACL,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;wBACtC,MAAM,EAAE,IAAI;wBACZ,WAAW,EAAE;4BACX,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,KAAK;yBAC/C;qBACF,CAAC;gBACJ,CAAC;aACF,CAAC,CACH;YACD,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,qBAAY,CAAC;YAC9B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,iBAAU,CAAC;SAC7B;QACD,WAAW,EAAE,CAAC,gCAAc,CAAC;QAC7B,SAAS,EAAE;YACT,0BAAW;YACX;gBACE,OAAO,EAAE,gBAAS;gBAClB,QAAQ,EAAE,sBAAS;aACpB;SACF;QACD,OAAO,EAAE,CAAC,0BAAW,CAAC;KACvB,CAAC;GACW,UAAU,CAAG"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"create.dto.d.ts","sourceRoot":"","sources":["../../../src/locale/dto/create.dto.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"create.dto.d.ts","sourceRoot":"","sources":["../../../src/locale/dto/create.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,SAAS;IAEpB,IAAI,EAAE,MAAM,CAAC;IAGb,IAAI,EAAE,MAAM,CAAC;IAGb,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"create.dto.js","sourceRoot":"","sources":["../../../src/locale/dto/create.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
1
|
+
{"version":3,"file":"create.dto.js","sourceRoot":"","sources":["../../../src/locale/dto/create.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA2C;AAE3C,MAAa,SAAS;CASrB;AATD,8BASC;AAPC;IADC,IAAA,0BAAQ,GAAE;;uCACE;AAGb;IADC,IAAA,0BAAQ,GAAE;;uCACE;AAGb;IADC,IAAA,0BAAQ,GAAE;;yCACI"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"set-enabled.dto.d.ts","sourceRoot":"","sources":["../../../src/locale/dto/set-enabled.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,aAAa;IAKxB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB"}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
+
};
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.SetEnabledDTO = void 0;
|
13
|
+
const class_validator_1 = require("class-validator");
|
14
|
+
class SetEnabledDTO {
|
15
|
+
}
|
16
|
+
exports.SetEnabledDTO = SetEnabledDTO;
|
17
|
+
__decorate([
|
18
|
+
(0, class_validator_1.IsArray)(),
|
19
|
+
(0, class_validator_1.IsString)({
|
20
|
+
each: true,
|
21
|
+
}),
|
22
|
+
__metadata("design:type", Array)
|
23
|
+
], SetEnabledDTO.prototype, "codes", void 0);
|
24
|
+
//# sourceMappingURL=set-enabled.dto.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"set-enabled.dto.js","sourceRoot":"","sources":["../../../src/locale/dto/set-enabled.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAoD;AAEpD,MAAa,aAAa;CAMzB;AAND,sCAMC;AADC;IAJC,IAAA,yBAAO,GAAE;IACT,IAAA,0BAAQ,EAAC;QACR,IAAI,EAAE,IAAI;KACX,CAAC;;4CACc"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"update.dto.d.ts","sourceRoot":"","sources":["../../../src/locale/dto/update.dto.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"update.dto.d.ts","sourceRoot":"","sources":["../../../src/locale/dto/update.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,SAAS;IAGpB,IAAI,CAAC,EAAE,MAAM,CAAC;IAId,IAAI,CAAC,EAAE,MAAM,CAAC;IAId,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"update.dto.js","sourceRoot":"","sources":["../../../src/locale/dto/update.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
1
|
+
{"version":3,"file":"update.dto.js","sourceRoot":"","sources":["../../../src/locale/dto/update.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAuD;AAEvD,MAAa,SAAS;CAYrB;AAZD,8BAYC;AATC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;uCACC;AAId;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;uCACC;AAId;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;yCACG"}
|
@@ -2,14 +2,16 @@ import { CreateDTO } from './dto/create.dto';
|
|
2
2
|
import { DeleteDTO } from './dto/delete.dto';
|
3
3
|
import { UpdateDTO } from './dto/update.dto';
|
4
4
|
import { LocaleService } from './locale.service';
|
5
|
+
import { SetEnabledDTO } from './dto/set-enabled.dto';
|
5
6
|
export declare class LocaleController {
|
6
7
|
private readonly localeService;
|
7
8
|
constructor(localeService: LocaleService);
|
8
9
|
getEnables(paginationParams: any, locale: string): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
|
9
10
|
getTranslations(localeCode: string, namespace: string): Promise<{}>;
|
10
|
-
get(paginationParams: any): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
|
11
|
+
get(paginationParams: any, locale: string): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
|
11
12
|
getById(id: number): Promise<any>;
|
12
13
|
create(data: CreateDTO): Promise<any>;
|
14
|
+
setEnabled({ codes }: SetEnabledDTO): Promise<any>;
|
13
15
|
update(id: number, data: UpdateDTO): Promise<any>;
|
14
16
|
delete(data: DeleteDTO): Promise<any>;
|
15
17
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"locale.controller.d.ts","sourceRoot":"","sources":["../../src/locale/locale.controller.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"locale.controller.d.ts","sourceRoot":"","sources":["../../src/locale/locale.controller.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,qBACa,gBAAgB;IAGzB,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAKzC,UAAU,CAAe,gBAAgB,KAAA,EAAY,MAAM,EAAE,MAAM;IAMnE,eAAe,CACE,UAAU,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM;IAMjC,GAAG,CAAe,gBAAgB,KAAA,EAAY,MAAM,EAAE,MAAM;IAK5D,OAAO,CAA4B,EAAE,EAAE,MAAM;IAKnD,MAAM,CAAS,IAAI,EAAE,SAAS;IAKxB,UAAU,CAAS,EAAE,KAAK,EAAE,EAAE,aAAa;IAK3C,MAAM,CAA4B,EAAE,EAAE,MAAM,EAAU,IAAI,EAAE,SAAS;IAQrE,MAAM,CAAS,IAAI,EAAE,SAAS;CAGrC"}
|
@@ -21,6 +21,7 @@ const update_dto_1 = require("./dto/update.dto");
|
|
21
21
|
const locale_service_1 = require("./locale.service");
|
22
22
|
const locale_decorator_1 = require("./locale.decorator");
|
23
23
|
const public_decorator_1 = require("../auth/decorators/public.decorator");
|
24
|
+
const set_enabled_dto_1 = require("./dto/set-enabled.dto");
|
24
25
|
let LocaleController = class LocaleController {
|
25
26
|
constructor(localeService) {
|
26
27
|
this.localeService = localeService;
|
@@ -31,8 +32,8 @@ let LocaleController = class LocaleController {
|
|
31
32
|
async getTranslations(localeCode, namespace) {
|
32
33
|
return this.localeService.getTranslations(localeCode, namespace);
|
33
34
|
}
|
34
|
-
async get(paginationParams) {
|
35
|
-
return this.localeService.get(paginationParams);
|
35
|
+
async get(paginationParams, locale) {
|
36
|
+
return this.localeService.get(locale, paginationParams);
|
36
37
|
}
|
37
38
|
async getById(id) {
|
38
39
|
return this.localeService.getById(id);
|
@@ -40,6 +41,9 @@ let LocaleController = class LocaleController {
|
|
40
41
|
create(data) {
|
41
42
|
return this.localeService.create(data);
|
42
43
|
}
|
44
|
+
async setEnabled({ codes }) {
|
45
|
+
return this.localeService.setEnabled(codes);
|
46
|
+
}
|
43
47
|
async update(id, data) {
|
44
48
|
return this.localeService.update({
|
45
49
|
id,
|
@@ -72,8 +76,9 @@ __decorate([
|
|
72
76
|
__decorate([
|
73
77
|
(0, common_1.Get)(),
|
74
78
|
__param(0, (0, pagination_1.Pagination)()),
|
79
|
+
__param(1, (0, locale_decorator_1.Locale)()),
|
75
80
|
__metadata("design:type", Function),
|
76
|
-
__metadata("design:paramtypes", [Object]),
|
81
|
+
__metadata("design:paramtypes", [Object, String]),
|
77
82
|
__metadata("design:returntype", Promise)
|
78
83
|
], LocaleController.prototype, "get", null);
|
79
84
|
__decorate([
|
@@ -90,6 +95,13 @@ __decorate([
|
|
90
95
|
__metadata("design:paramtypes", [create_dto_1.CreateDTO]),
|
91
96
|
__metadata("design:returntype", void 0)
|
92
97
|
], LocaleController.prototype, "create", null);
|
98
|
+
__decorate([
|
99
|
+
(0, common_1.Put)(),
|
100
|
+
__param(0, (0, common_1.Body)()),
|
101
|
+
__metadata("design:type", Function),
|
102
|
+
__metadata("design:paramtypes", [set_enabled_dto_1.SetEnabledDTO]),
|
103
|
+
__metadata("design:returntype", Promise)
|
104
|
+
], LocaleController.prototype, "setEnabled", null);
|
93
105
|
__decorate([
|
94
106
|
(0, common_1.Patch)(':id'),
|
95
107
|
__param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"locale.controller.js","sourceRoot":"","sources":["../../src/locale/locale.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAgD;AAChD,
|
1
|
+
{"version":3,"file":"locale.controller.js","sourceRoot":"","sources":["../../src/locale/locale.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAgD;AAChD,2CAYwB;AACxB,iDAA6C;AAC7C,iDAA6C;AAC7C,iDAA6C;AAC7C,qDAAiD;AACjD,yDAA4C;AAC5C,0EAA6D;AAC7D,2DAAsD;AAG/C,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAC3B,YAEmB,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAC5C,CAAC;IAIE,AAAN,KAAK,CAAC,UAAU,CAAe,gBAAgB,EAAY,MAAc;QACvE,OAAO,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IACjE,CAAC;IAIK,AAAN,KAAK,CAAC,eAAe,CACE,UAAkB,EACnB,SAAiB;QAErC,OAAO,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IACnE,CAAC;IAGK,AAAN,KAAK,CAAC,GAAG,CAAe,gBAAgB,EAAY,MAAc;QAChE,OAAO,IAAI,CAAC,aAAa,CA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AAK,EAAC,IAAI,EAAE,qBAAY,CAAC,CAAA;;;;+CAEvC;AAGD;IADC,IAAA,aAAI,GAAE;IACC,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAO,sBAAS;;8CAE7B;AAGK;IADL,IAAA,YAAG,GAAE;IACY,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAY,+BAAa;;kDAEhD;AAGK;IADL,IAAA,cAAK,EAAC,KAAK,CAAC;IACC,WAAA,IAAA,cAAK,EAAC,IAAI,EAAE,qBAAY,CAAC,CAAA;IAAc,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAO,sBAAS;;8CAK1E;AAGK;IADL,IAAA,eAAM,GAAE;IACK,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAO,sBAAS;;8CAEnC;2BApDU,gBAAgB;IAD5B,IAAA,mBAAU,EAAC,SAAS,CAAC;IAGjB,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,8BAAa,CAAC,CAAC,CAAA;qCACR,8BAAa;GAHpC,gBAAgB,CAqD5B"}
|
@@ -7,6 +7,7 @@ export declare class LocaleService {
|
|
7
7
|
private readonly prismaService;
|
8
8
|
private readonly paginationService;
|
9
9
|
constructor(prismaService: PrismaService, paginationService: PaginationService);
|
10
|
+
setEnabled(codes: string[]): Promise<any>;
|
10
11
|
getEnables(locale: string, paginationParams: PaginationDTO): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
|
11
12
|
parseLocale(locale: string): {
|
12
13
|
code: string;
|
@@ -14,7 +15,7 @@ export declare class LocaleService {
|
|
14
15
|
locales: string[];
|
15
16
|
};
|
16
17
|
getTranslations(localeCode: string, namespace: string): Promise<{}>;
|
17
|
-
get(paginationParams: PaginationDTO): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
|
18
|
+
get(locale: string, paginationParams: PaginationDTO): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
|
18
19
|
getById(localesId: number): Promise<any>;
|
19
20
|
create(data: CreateDTO): Promise<any>;
|
20
21
|
update({ id, data }: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"locale.service.d.ts","sourceRoot":"","sources":["../../src/locale/locale.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAO/C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,qBACa,aAAa;IAGtB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAE9B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;gBAFjB,aAAa,EAAE,aAAa,EAE5B,iBAAiB,EAAE,iBAAiB;IAGjD,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,aAAa;IAiEhE,WAAW,CAAC,MAAM,EAAE,MAAM;;;;;IAWpB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAwCrD,GAAG,CAAC,gBAAgB,EAAE,aAAa;
|
1
|
+
{"version":3,"file":"locale.service.d.ts","sourceRoot":"","sources":["../../src/locale/locale.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAO/C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,qBACa,aAAa;IAGtB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAE9B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;gBAFjB,aAAa,EAAE,aAAa,EAE5B,iBAAiB,EAAE,iBAAiB;IAGjD,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE;IA0B1B,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,aAAa;IAiEhE,WAAW,CAAC,MAAM,EAAE,MAAM;;;;;IAWpB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAwCrD,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,aAAa;IA0DnD,OAAO,CAAC,SAAS,EAAE,MAAM;IAMzB,MAAM,CAAC,IAAI,EAAE,SAAS;IAMtB,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,SAAS,CAAA;KAAE;IAOpD,MAAM,CAAC,EAAE,GAAG,EAAE,EAAE,SAAS;CAehC"}
|
@@ -21,6 +21,29 @@ let LocaleService = class LocaleService {
|
|
21
21
|
this.prismaService = prismaService;
|
22
22
|
this.paginationService = paginationService;
|
23
23
|
}
|
24
|
+
async setEnabled(codes) {
|
25
|
+
if (!codes || codes.length < 1) {
|
26
|
+
throw new common_1.BadRequestException('You must select at least one item code.');
|
27
|
+
}
|
28
|
+
await this.prismaService.locales.updateMany({
|
29
|
+
where: {
|
30
|
+
enabled: true,
|
31
|
+
},
|
32
|
+
data: {
|
33
|
+
enabled: false,
|
34
|
+
},
|
35
|
+
});
|
36
|
+
return this.prismaService.locales.updateMany({
|
37
|
+
where: {
|
38
|
+
code: {
|
39
|
+
in: codes,
|
40
|
+
},
|
41
|
+
},
|
42
|
+
data: {
|
43
|
+
enabled: true,
|
44
|
+
},
|
45
|
+
});
|
46
|
+
}
|
24
47
|
async getEnables(locale, paginationParams) {
|
25
48
|
const fields = ['code', 'region'];
|
26
49
|
const OR = this.prismaService.createInsensitiveSearch(fields, paginationParams);
|
@@ -111,14 +134,45 @@ let LocaleService = class LocaleService {
|
|
111
134
|
}
|
112
135
|
return translations;
|
113
136
|
}
|
114
|
-
async get(paginationParams) {
|
115
|
-
const fields = [];
|
137
|
+
async get(locale, paginationParams) {
|
138
|
+
const fields = ['code', 'region'];
|
116
139
|
const OR = this.prismaService.createInsensitiveSearch(fields, paginationParams);
|
117
|
-
|
140
|
+
const result = await this.paginationService.paginate(this.prismaService.locales, paginationParams, {
|
118
141
|
where: {
|
119
142
|
OR,
|
120
143
|
},
|
121
144
|
});
|
145
|
+
const codes = [];
|
146
|
+
for (const item of result.data) {
|
147
|
+
codes.push(item.code);
|
148
|
+
}
|
149
|
+
const { code, region, locales } = this.parseLocale(locale);
|
150
|
+
const where = {
|
151
|
+
locales: {
|
152
|
+
code,
|
153
|
+
},
|
154
|
+
translation_namespaces: {
|
155
|
+
name: 'translation',
|
156
|
+
},
|
157
|
+
};
|
158
|
+
if (locales.length > 1) {
|
159
|
+
where.locale.region = region;
|
160
|
+
}
|
161
|
+
const values = await this.prismaService.translations.findMany({
|
162
|
+
where,
|
163
|
+
select: {
|
164
|
+
name: true,
|
165
|
+
value: true,
|
166
|
+
},
|
167
|
+
});
|
168
|
+
for (let i = 0; i < result.data.length; i++) {
|
169
|
+
for (const value of values) {
|
170
|
+
if (value.name === result.data[i].code) {
|
171
|
+
result.data[i].name = value.value;
|
172
|
+
break;
|
173
|
+
}
|
174
|
+
}
|
175
|
+
}
|
122
176
|
return result;
|
123
177
|
}
|
124
178
|
async getById(localesId) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"locale.service.js","sourceRoot":"","sources":["../../src/locale/locale.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAsE;AACtE,2CAA+C;AAC/C,2CAKwB;AAMjB,IAAM,aAAa,GAAnB,MAAM,aAAa;IACxB,YAEmB,aAA4B,EAE5B,iBAAoC;QAFpC,kBAAa,GAAb,aAAa,CAAe;QAE5B,sBAAiB,GAAjB,iBAAiB,CAAmB;IACpD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a;QAC7B,IAAI,GAAG,IAAI,SAAS,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;YACpC,MAAM,IAAI,4BAAmB,CAC3B,8CAA8C,CAC/C,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC;YAC3C,KAAK,EAAE;gBACL,EAAE,EAAE;oBACF,EAAE,EAAE,GAAG;iBACR;aACF;SACF,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAlPY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,sBAAa,CAAC,CAAC,CAAA;IAEvC,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,8BAAiB,CAAC,CAAC,CAAA;qCADZ,sBAAa;QAET,8BAAiB;GAL5C,aAAa,CAkPzB"}
|
@@ -65,33 +65,41 @@ describe('LocaleService', () => {
|
|
65
65
|
expect(result).toEqual({ hello: 'Hello' });
|
66
66
|
});
|
67
67
|
});
|
68
|
+
/*
|
68
69
|
describe('get', () => {
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
70
|
+
it('should paginate locales', async () => {
|
71
|
+
const mockPaginationResult = {
|
72
|
+
data: [],
|
73
|
+
total: 10,
|
74
|
+
lastPage: 1,
|
75
|
+
page: 1,
|
76
|
+
prev: 0,
|
77
|
+
next: 2,
|
78
|
+
pageSize: 10,
|
79
|
+
};
|
80
|
+
jest
|
81
|
+
.spyOn(paginationService, 'paginate')
|
82
|
+
.mockResolvedValue(mockPaginationResult);
|
83
|
+
|
84
|
+
const paginationParams: PaginationDTO = {
|
85
|
+
page: 1,
|
86
|
+
pageSize: 20,
|
87
|
+
sortField: '',
|
88
|
+
sortOrder: PageOrderDirection.Asc,
|
89
|
+
fields: '',
|
90
|
+
search: '',
|
91
|
+
};
|
92
|
+
const result = await service.get(paginationParams );
|
93
|
+
|
94
|
+
expect(paginationService.paginate).toHaveBeenCalledWith(
|
95
|
+
prismaService.locales,
|
96
|
+
paginationParams,
|
97
|
+
expect.anything(),
|
98
|
+
);
|
99
|
+
expect(result).toBe(mockPaginationResult);
|
100
|
+
});
|
94
101
|
});
|
102
|
+
*/
|
95
103
|
describe('getById', () => {
|
96
104
|
it('should return a locale by ID', async () => {
|
97
105
|
const mockLocale = {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"locale.service.spec.js","sourceRoot":"","sources":["../../src/locale/locale.service.spec.ts"],"names":[],"mappings":";;AAAA,6CAAsD;AACtD,qDAAiD;AACjD,2CAA+C;AAC/C,mDAI4B;AAC5B,2CAAqD;AAKrD,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,IAAI,OAAsB,CAAC;IAC3B,IAAI,aAA4B,CAAC;IACjC,IAAI,iBAAoC,CAAC;IAEzC,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,MAAM,MAAM,GAAkB,MAAM,cAAI,CAAC,mBAAmB,CAAC;YAC3D,SAAS,EAAE;gBACT,8BAAa;gBACb;oBACE,OAAO,EAAE,sBAAa;oBACtB,QAAQ,EAAE;wBACR,YAAY,EAAE;4BACZ,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE;yBACpB;wBACD,OAAO,EAAE;4BACP,UAAU,EAAE,IAAI,CAAC,EAAE,EAAE;4BACrB,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE;4BACjB,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE;4BACjB,UAAU,EAAE,IAAI,CAAC,EAAE,EAAE;yBACtB;qBACF;iBACF;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AM,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;YACnD,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
@@ -23,6 +23,6 @@ export declare class SettingsService {
|
|
23
23
|
updateFromSlug(slug: string, data: UpdateDTO): Promise<any>;
|
24
24
|
delete({ ids }: DeleteDTO): Promise<any>;
|
25
25
|
setSettingUserValue(user_id: number, slug: string, value: string): Promise<any>;
|
26
|
-
getSettingValues(slug: string | string[]): Promise<any
|
26
|
+
getSettingValues(slug: string | string[]): Promise<Record<string, any>>;
|
27
27
|
}
|
28
28
|
//# sourceMappingURL=settings.service.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"settings.service.d.ts","sourceRoot":"","sources":["../../src/setting/settings.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAO/C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;
|
1
|
+
{"version":3,"file":"settings.service.d.ts","sourceRoot":"","sources":["../../src/setting/settings.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAO/C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,qBACa,eAAe;IAGxB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAE9B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;gBAFjB,aAAa,EAAE,aAAa,EAE5B,iBAAiB,EAAE,iBAAiB;IAGjD,eAAe,CAAC,IAAI,EAAE,WAAW;;;IAejC,mBAAmB,CAAC,MAAM,EAAE,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM;IAiEpE,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,aAAa;IAqChE,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,aAAa;IA0D3D,GAAG,CAAC,SAAS,EAAE,MAAM;IAMrB,MAAM,CAAC,EAAE,EAAE,SAAS;IAMpB,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,SAAS,CAAA;KAAE;IAOpD,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS;IAiB5C,MAAM,CAAC,EAAE,GAAG,EAAE,EAAE,SAAS;IAgBzB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAkDhE,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE;CA6C/C"}
|
@@ -214,7 +214,10 @@ let SettingsService = class SettingsService {
|
|
214
214
|
}
|
215
215
|
return await this.prismaService.setting_users.upsert({
|
216
216
|
where: {
|
217
|
-
|
217
|
+
user_id_setting_id: {
|
218
|
+
setting_id: setting.id,
|
219
|
+
user_id: user.id,
|
220
|
+
},
|
218
221
|
},
|
219
222
|
create: {
|
220
223
|
setting_id: setting.id,
|
@@ -224,6 +227,11 @@ let SettingsService = class SettingsService {
|
|
224
227
|
update: {
|
225
228
|
value,
|
226
229
|
},
|
230
|
+
select: {
|
231
|
+
setting_id: true,
|
232
|
+
user_id: true,
|
233
|
+
value: true,
|
234
|
+
},
|
227
235
|
});
|
228
236
|
}
|
229
237
|
async getSettingValues(slug) {
|
@@ -243,25 +251,26 @@ let SettingsService = class SettingsService {
|
|
243
251
|
},
|
244
252
|
});
|
245
253
|
const slugUserOverride = settings.filter((setting) => setting.userOverride);
|
246
|
-
const settingsUser = await this.prismaService.
|
254
|
+
const settingsUser = await this.prismaService.setting_users.findMany({
|
247
255
|
where: {
|
248
|
-
|
256
|
+
setting_id: {
|
249
257
|
in: slugUserOverride.map((setting) => setting.id),
|
250
258
|
},
|
251
259
|
},
|
252
260
|
select: {
|
253
261
|
value: true,
|
254
|
-
|
262
|
+
setting_id: true,
|
255
263
|
},
|
256
264
|
});
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
265
|
+
const data = {};
|
266
|
+
settings.forEach((setting) => {
|
267
|
+
data[setting.slug] = setting.value;
|
268
|
+
});
|
269
|
+
settingsUser.forEach((setting) => {
|
270
|
+
data[slugUserOverride.find((s) => s.id === setting.setting_id).slug] =
|
271
|
+
setting.value;
|
263
272
|
});
|
264
|
-
return
|
273
|
+
return data;
|
265
274
|
}
|
266
275
|
};
|
267
276
|
exports.SettingsService = SettingsService;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"settings.service.js","sourceRoot":"","sources":["../../src/setting/settings.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAsE;AACtE,2CAA+C;AAC/C,2CAKwB;AAIxB,yCAAiD;
|
1
|
+
{"version":3,"file":"settings.service.js","sourceRoot":"","sources":["../../src/setting/settings.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAsE;AACtE,2CAA+C;AAC/C,2CAKwB;AAIxB,yCAAiD;AAK1C,IAAM,eAA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BAAiB,CAAC,CAAC,CAAA;qCADZ,sBAAa;QAET,8BAAiB;GAL5C,eAAe,CA0U3B"}
|
package/hedhog.yaml
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# yaml-language-server: $schema=../../hedhog.schema.json
|
1
2
|
data:
|
2
3
|
routes:
|
3
4
|
- url: /auth/verify
|
@@ -126,6 +127,8 @@ data:
|
|
126
127
|
method: GET
|
127
128
|
- url: /locales
|
128
129
|
method: POST
|
130
|
+
- url: /locales
|
131
|
+
method: PUT
|
129
132
|
- url: /locales/:localeId
|
130
133
|
method: PATCH
|
131
134
|
- url: /locales
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@hedhog/admin",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.95",
|
4
4
|
"private": false,
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"scripts": {
|
@@ -32,6 +32,7 @@
|
|
32
32
|
"@hedhog/mail": "latest",
|
33
33
|
"@hedhog/pagination": "latest",
|
34
34
|
"@hedhog/prisma": "latest",
|
35
|
-
"@hedhog/utils": "latest"
|
35
|
+
"@hedhog/utils": "latest",
|
36
|
+
"@nestjs/jwt": "latest"
|
36
37
|
}
|
37
38
|
}
|