@hedhog/admin 0.0.108 → 0.0.110

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. package/dist/admin.module.d.ts.map +1 -1
  2. package/dist/admin.module.js +1 -6
  3. package/dist/admin.module.js.map +1 -1
  4. package/dist/auth/auth.controller.d.ts.map +1 -1
  5. package/dist/auth/auth.controller.js +6 -8
  6. package/dist/auth/auth.controller.js.map +1 -1
  7. package/dist/auth/guards/auth.guard.js +2 -2
  8. package/dist/auth/guards/auth.guard.js.map +1 -1
  9. package/dist/index.d.ts +0 -9
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +0 -11
  12. package/dist/index.js.map +1 -1
  13. package/dist/menu/menu.controller.d.ts.map +1 -1
  14. package/dist/menu/menu.controller.js +4 -5
  15. package/dist/menu/menu.controller.js.map +1 -1
  16. package/dist/role/dto/create.dto.d.ts +1 -1
  17. package/dist/role/dto/create.dto.d.ts.map +1 -1
  18. package/dist/role/dto/create.dto.js +2 -2
  19. package/dist/role/dto/create.dto.js.map +1 -1
  20. package/dist/role/guards/role.guard.d.ts.map +1 -1
  21. package/dist/role/guards/role.guard.js +3 -4
  22. package/dist/role/guards/role.guard.js.map +1 -1
  23. package/dist/role/role.controller.js +3 -3
  24. package/dist/role/role.controller.js.map +1 -1
  25. package/dist/role/role.module.js +1 -1
  26. package/dist/role/role.module.js.map +1 -1
  27. package/dist/role/role.service.d.ts +1 -1
  28. package/dist/role/role.service.d.ts.map +1 -1
  29. package/dist/role/role.service.js +1 -1
  30. package/dist/role/role.service.js.map +1 -1
  31. package/dist/route/route.controller.js +3 -3
  32. package/dist/route/route.controller.js.map +1 -1
  33. package/dist/screen/screen.controller.js +3 -3
  34. package/dist/screen/screen.controller.js.map +1 -1
  35. package/dist/user/user.controller.js +2 -2
  36. package/dist/user/user.controller.js.map +1 -1
  37. package/hedhog.yaml +1 -328
  38. package/package.json +8 -6
  39. package/src/admin.module.ts +1 -6
  40. package/src/auth/auth.controller.ts +1 -3
  41. package/src/auth/guards/auth.guard.ts +1 -1
  42. package/src/index.ts +0 -14
  43. package/src/menu/menu.controller.ts +2 -3
  44. package/src/role/dto/create.dto.ts +1 -1
  45. package/src/role/guards/role.guard.ts +1 -2
  46. package/src/role/role.controller.ts +2 -2
  47. package/src/role/role.module.ts +1 -1
  48. package/src/role/role.service.ts +1 -1
  49. package/src/route/route.controller.ts +2 -2
  50. package/src/screen/screen.controller.ts +2 -2
  51. package/src/user/user.controller.ts +1 -1
  52. package/dist/auth/decorators/public.decorator.d.ts +0 -3
  53. package/dist/auth/decorators/public.decorator.d.ts.map +0 -1
  54. package/dist/auth/decorators/public.decorator.js +0 -8
  55. package/dist/auth/decorators/public.decorator.js.map +0 -1
  56. package/dist/auth/decorators/user.decorator.d.ts +0 -2
  57. package/dist/auth/decorators/user.decorator.d.ts.map +0 -1
  58. package/dist/auth/decorators/user.decorator.js +0 -12
  59. package/dist/auth/decorators/user.decorator.js.map +0 -1
  60. package/dist/dto/with-locale.dto.d.ts +0 -4
  61. package/dist/dto/with-locale.dto.d.ts.map +0 -1
  62. package/dist/dto/with-locale.dto.js +0 -23
  63. package/dist/dto/with-locale.dto.js.map +0 -1
  64. package/dist/locale/dto/create.dto.d.ts +0 -6
  65. package/dist/locale/dto/create.dto.d.ts.map +0 -1
  66. package/dist/locale/dto/create.dto.js +0 -29
  67. package/dist/locale/dto/create.dto.js.map +0 -1
  68. package/dist/locale/dto/delete.dto.d.ts +0 -4
  69. package/dist/locale/dto/delete.dto.d.ts.map +0 -1
  70. package/dist/locale/dto/delete.dto.js +0 -23
  71. package/dist/locale/dto/delete.dto.js.map +0 -1
  72. package/dist/locale/dto/set-enabled.dto.d.ts +0 -4
  73. package/dist/locale/dto/set-enabled.dto.d.ts.map +0 -1
  74. package/dist/locale/dto/set-enabled.dto.js +0 -24
  75. package/dist/locale/dto/set-enabled.dto.js.map +0 -1
  76. package/dist/locale/dto/update.dto.d.ts +0 -6
  77. package/dist/locale/dto/update.dto.d.ts.map +0 -1
  78. package/dist/locale/dto/update.dto.js +0 -32
  79. package/dist/locale/dto/update.dto.js.map +0 -1
  80. package/dist/locale/index.d.ts +0 -5
  81. package/dist/locale/index.d.ts.map +0 -1
  82. package/dist/locale/index.js +0 -21
  83. package/dist/locale/index.js.map +0 -1
  84. package/dist/locale/locale.controller.d.ts +0 -18
  85. package/dist/locale/locale.controller.d.ts.map +0 -1
  86. package/dist/locale/locale.controller.js +0 -127
  87. package/dist/locale/locale.controller.js.map +0 -1
  88. package/dist/locale/locale.decorator.d.ts +0 -2
  89. package/dist/locale/locale.decorator.d.ts.map +0 -1
  90. package/dist/locale/locale.decorator.js +0 -9
  91. package/dist/locale/locale.decorator.js.map +0 -1
  92. package/dist/locale/locale.middleware.d.ts +0 -10
  93. package/dist/locale/locale.middleware.d.ts.map +0 -1
  94. package/dist/locale/locale.middleware.js +0 -45
  95. package/dist/locale/locale.middleware.js.map +0 -1
  96. package/dist/locale/locale.module.d.ts +0 -5
  97. package/dist/locale/locale.module.d.ts.map +0 -1
  98. package/dist/locale/locale.module.js +0 -35
  99. package/dist/locale/locale.module.js.map +0 -1
  100. package/dist/locale/locale.service.d.ts +0 -32
  101. package/dist/locale/locale.service.d.ts.map +0 -1
  102. package/dist/locale/locale.service.js +0 -290
  103. package/dist/locale/locale.service.js.map +0 -1
  104. package/dist/locale/locale.service.spec.d.ts +0 -2
  105. package/dist/locale/locale.service.spec.d.ts.map +0 -1
  106. package/dist/locale/locale.service.spec.js +0 -174
  107. package/dist/locale/locale.service.spec.js.map +0 -1
  108. package/dist/role/decorators/role.decorator.d.ts +0 -3
  109. package/dist/role/decorators/role.decorator.d.ts.map +0 -1
  110. package/dist/role/decorators/role.decorator.js +0 -10
  111. package/dist/role/decorators/role.decorator.js.map +0 -1
  112. package/dist/setting/dto/create.dto.d.ts +0 -3
  113. package/dist/setting/dto/create.dto.d.ts.map +0 -1
  114. package/dist/setting/dto/create.dto.js +0 -7
  115. package/dist/setting/dto/create.dto.js.map +0 -1
  116. package/dist/setting/dto/setting-user.dto.d.ts +0 -4
  117. package/dist/setting/dto/setting-user.dto.d.ts.map +0 -1
  118. package/dist/setting/dto/setting-user.dto.js +0 -21
  119. package/dist/setting/dto/setting-user.dto.js.map +0 -1
  120. package/dist/setting/dto/setting.dto.d.ts +0 -9
  121. package/dist/setting/dto/setting.dto.d.ts.map +0 -1
  122. package/dist/setting/dto/setting.dto.js +0 -34
  123. package/dist/setting/dto/setting.dto.js.map +0 -1
  124. package/dist/setting/dto/update.dto.d.ts +0 -4
  125. package/dist/setting/dto/update.dto.d.ts.map +0 -1
  126. package/dist/setting/dto/update.dto.js +0 -8
  127. package/dist/setting/dto/update.dto.js.map +0 -1
  128. package/dist/setting/setting.controller.d.ts +0 -25
  129. package/dist/setting/setting.controller.d.ts.map +0 -1
  130. package/dist/setting/setting.controller.js +0 -150
  131. package/dist/setting/setting.controller.js.map +0 -1
  132. package/dist/setting/setting.module.d.ts +0 -3
  133. package/dist/setting/setting.module.d.ts.map +0 -1
  134. package/dist/setting/setting.module.js +0 -31
  135. package/dist/setting/setting.module.js.map +0 -1
  136. package/dist/setting/setting.service.d.ts +0 -31
  137. package/dist/setting/setting.service.d.ts.map +0 -1
  138. package/dist/setting/setting.service.js +0 -314
  139. package/dist/setting/setting.service.js.map +0 -1
  140. package/dist/setting/setting.service.spec.d.ts +0 -2
  141. package/dist/setting/setting.service.spec.d.ts.map +0 -1
  142. package/dist/setting/setting.service.spec.js +0 -162
  143. package/dist/setting/setting.service.spec.js.map +0 -1
  144. package/src/auth/decorators/public.decorator.ts +0 -4
  145. package/src/auth/decorators/user.decorator.ts +0 -17
  146. package/src/dto/with-locale.dto.ts +0 -8
  147. package/src/locale/dto/create.dto.ts +0 -12
  148. package/src/locale/dto/delete.dto.ts +0 -8
  149. package/src/locale/dto/set-enabled.dto.ts +0 -9
  150. package/src/locale/dto/update.dto.ts +0 -15
  151. package/src/locale/index.ts +0 -4
  152. package/src/locale/locale.controller.ts +0 -79
  153. package/src/locale/locale.decorator.ts +0 -8
  154. package/src/locale/locale.middleware.ts +0 -34
  155. package/src/locale/locale.module.ts +0 -23
  156. package/src/locale/locale.service.spec.ts +0 -193
  157. package/src/locale/locale.service.ts +0 -364
  158. package/src/role/decorators/role.decorator.ts +0 -7
  159. package/src/setting/dto/create.dto.ts +0 -1
  160. package/src/setting/dto/setting-user.dto.ts +0 -6
  161. package/src/setting/dto/setting.dto.ts +0 -17
  162. package/src/setting/dto/update.dto.ts +0 -3
  163. package/src/setting/setting.controller.ts +0 -100
  164. package/src/setting/setting.module.ts +0 -18
  165. package/src/setting/setting.service.spec.ts +0 -183
  166. package/src/setting/setting.service.ts +0 -384
@@ -1,290 +0,0 @@
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
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.LocaleService = void 0;
16
- const pagination_1 = require("@hedhog/pagination");
17
- const prisma_1 = require("@hedhog/prisma");
18
- const common_1 = require("@nestjs/common");
19
- let LocaleService = class LocaleService {
20
- constructor(prismaService, paginationService) {
21
- this.prismaService = prismaService;
22
- this.paginationService = paginationService;
23
- this.codes = {};
24
- }
25
- async setEnabled(codes) {
26
- if (!codes || codes.length < 1) {
27
- throw new common_1.BadRequestException('You must select at least one item code.');
28
- }
29
- await this.prismaService.locale.updateMany({
30
- where: {
31
- enabled: true,
32
- },
33
- data: {
34
- enabled: false,
35
- },
36
- });
37
- return this.prismaService.locale.updateMany({
38
- where: {
39
- code: {
40
- in: codes,
41
- },
42
- },
43
- data: {
44
- enabled: true,
45
- },
46
- });
47
- }
48
- async getEnables(currentLocale, paginationParams) {
49
- const fields = ['code', 'region'];
50
- const OR = this.prismaService.createInsensitiveSearch(fields, paginationParams);
51
- const result = await this.paginationService.paginate(this.prismaService.locale, paginationParams, {
52
- where: {
53
- AND: [
54
- {
55
- enabled: true,
56
- },
57
- {
58
- OR,
59
- },
60
- ],
61
- },
62
- });
63
- const codes = [];
64
- for (const item of result.data) {
65
- codes.push(item.code);
66
- }
67
- const { code, region, locale } = this.parseLocale(currentLocale);
68
- const where = {
69
- locale: {
70
- code,
71
- },
72
- translation_namespace: {
73
- name: 'translation',
74
- },
75
- };
76
- if (locale.length > 1) {
77
- where.locale.region = region;
78
- }
79
- const values = await this.prismaService.translation.findMany({
80
- where,
81
- select: {
82
- name: true,
83
- value: true,
84
- },
85
- });
86
- for (let i = 0; i < result.data.length; i++) {
87
- for (const value of values) {
88
- if (value.name === result.data[i].code) {
89
- result.data[i].name = value.value;
90
- break;
91
- }
92
- }
93
- }
94
- return result;
95
- }
96
- parseLocale(locale) {
97
- const localeCodes = locale.toLowerCase().split('-');
98
- const code = localeCodes[0];
99
- const region = localeCodes[1];
100
- return {
101
- code,
102
- region,
103
- locale: localeCodes,
104
- };
105
- }
106
- async getTranslations(localeCode, namespace) {
107
- if (!localeCode) {
108
- throw new common_1.BadRequestException('Locale code is required.');
109
- }
110
- if (!namespace) {
111
- namespace = 'translation';
112
- }
113
- const { code, region, locale } = this.parseLocale(localeCode);
114
- const where = {
115
- locale: {
116
- code,
117
- },
118
- translation_namespace: {
119
- name: namespace,
120
- },
121
- };
122
- if (locale.length > 1) {
123
- where.locale.region = region;
124
- }
125
- const values = await this.prismaService.translation.findMany({
126
- where,
127
- select: {
128
- name: true,
129
- value: true,
130
- },
131
- });
132
- const translation = {};
133
- for (const value of values) {
134
- translation[value.name] = value.value;
135
- }
136
- return translation;
137
- }
138
- async get(currentLocale, paginationParams) {
139
- const fields = ['code', 'region'];
140
- const OR = this.prismaService.createInsensitiveSearch(fields, paginationParams);
141
- const result = await this.paginationService.paginate(this.prismaService.locale, paginationParams, {
142
- where: {
143
- OR,
144
- },
145
- });
146
- const codes = [];
147
- for (const item of result.data) {
148
- codes.push(item.code);
149
- }
150
- const { code, region, locale } = this.parseLocale(currentLocale);
151
- const where = {
152
- locale: {
153
- code,
154
- },
155
- translation_namespace: {
156
- name: 'translation',
157
- },
158
- };
159
- if (locale.length > 1) {
160
- where.locale.region = region;
161
- }
162
- const values = await this.prismaService.translation.findMany({
163
- where,
164
- select: {
165
- name: true,
166
- value: true,
167
- },
168
- });
169
- for (let i = 0; i < result.data.length; i++) {
170
- for (const value of values) {
171
- if (value.name === result.data[i].code) {
172
- result.data[i].name = value.value;
173
- break;
174
- }
175
- }
176
- }
177
- return result;
178
- }
179
- async getByCode(code) {
180
- if (this.codes[code]) {
181
- return this.codes[code];
182
- }
183
- return (this.codes[code] = await this.prismaService.locale.findFirst({
184
- where: { code },
185
- }));
186
- }
187
- async getById(localeId) {
188
- return this.prismaService.locale.findUnique({
189
- where: { id: localeId },
190
- });
191
- }
192
- async create(data) {
193
- return this.prismaService.locale.create({
194
- data,
195
- });
196
- }
197
- async update({ id, data }) {
198
- return this.prismaService.locale.update({
199
- where: { id },
200
- data,
201
- });
202
- }
203
- async delete({ ids }) {
204
- if (ids == undefined || ids == null) {
205
- throw new common_1.BadRequestException('You must select at least one item to delete.');
206
- }
207
- return this.prismaService.locale.deleteMany({
208
- where: {
209
- id: {
210
- in: ids,
211
- },
212
- },
213
- });
214
- }
215
- getTableNameTranslations(modelName) {
216
- return `${modelName}_locale`;
217
- }
218
- async createModelWithLocale(modelName, foreignKeyName, data, locale) {
219
- try {
220
- const model = await this.prismaService[modelName].create({ data });
221
- if (locale) {
222
- await Promise.all(Object.entries(locale).map(async ([localeCode, localeData]) => {
223
- const localeRecord = await this.getByCode(localeCode);
224
- const localeEntry = Object.assign({ [foreignKeyName]: model.id, locale_id: localeRecord.id }, localeData);
225
- await this.prismaService[this.getTableNameTranslations(modelName)].create({
226
- data: localeEntry,
227
- });
228
- }));
229
- }
230
- return this.prismaService[modelName].findUnique({
231
- where: { id: model.id },
232
- include: {
233
- [this.getTableNameTranslations(modelName)]: {
234
- where: { locale: { enabled: true } },
235
- include: { locale: { select: { code: true } } },
236
- },
237
- },
238
- });
239
- }
240
- catch (error) {
241
- if (error.message.includes('Unique constraint failed')) {
242
- throw new common_1.BadRequestException('Data already exists.');
243
- }
244
- else {
245
- throw new common_1.BadRequestException(error);
246
- }
247
- }
248
- }
249
- async updateModelWithLocale(modelName, foreignKeyName, id, data, locale) {
250
- try {
251
- if (locale) {
252
- await Promise.all(Object.entries(locale).map(async ([localeCode, localeData]) => {
253
- const localeRecord = await this.getByCode(localeCode);
254
- const localeEntry = Object.assign({ [foreignKeyName]: id, locale_id: localeRecord.id }, localeData);
255
- await this.prismaService[this.getTableNameTranslations(modelName)].upsert({
256
- where: {
257
- [`${foreignKeyName}_locale_id`]: {
258
- [foreignKeyName]: id,
259
- locale_id: localeRecord.id,
260
- },
261
- },
262
- create: localeEntry,
263
- update: localeData,
264
- });
265
- }));
266
- }
267
- return this.prismaService[modelName].update({
268
- where: { id },
269
- data,
270
- });
271
- }
272
- catch (error) {
273
- if (error.message.includes('Unique constraint failed')) {
274
- throw new common_1.BadRequestException('Data already exists.');
275
- }
276
- else {
277
- throw new common_1.BadRequestException(error);
278
- }
279
- }
280
- }
281
- };
282
- exports.LocaleService = LocaleService;
283
- exports.LocaleService = LocaleService = __decorate([
284
- (0, common_1.Injectable)(),
285
- __param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => prisma_1.PrismaService))),
286
- __param(1, (0, common_1.Inject)((0, common_1.forwardRef)(() => pagination_1.PaginationService))),
287
- __metadata("design:paramtypes", [prisma_1.PrismaService,
288
- pagination_1.PaginationService])
289
- ], LocaleService);
290
- //# sourceMappingURL=locale.service.js.map
@@ -1 +0,0 @@
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;IAGxB,YAEE,aAA6C,EAE7C,iBAAqD;QAFpC,kBAAa,GAAb,aAAa,CAAe;QAE5B,sBAAiB,GAAjB,iBAAiB,CAAmB;QAN/C,UAAK,GAAQ,EAAE,CAAC;IAOrB,CAAC;IAEJ,KAAK,CAAC,UAAU,CAAC,KAAe;QAC9B,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC/B,MAAM,IAAI,4BAAmB,CAAC,yCAAyC,CAAC,CAAC;QAC3E,CAAC;QAED,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC;YACzC,KAAK,EAAE;gBACL,OAAO,EAAE,IAAI;aACd;YACD,IAAI,EAAE;gBACJ,OAAO,EAAE,KAAK;aACf;SACF,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC;YAC1C,KAAK,EAAE;gBACL,IAAI,EAAE;oBACJ,EAAE,EAAE,KAAK;iBACV;aACF;YACD,IAAI,EAAE;gBACJ,OAAO,EAAE,IAAI;aACd;SACF,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,aAAqB,EAAE,gBAA+B;QACrE,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAClC,MAAM,EAAE,GAAU,IAAI,CAAC,aAAa,CAAC,uBAAuB,CAC1D,MAAM,EACN,gBAAgB,CACjB,CAAC;QAEF,MAAM,MAAM,GAAG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CAAC,MAAM,CAAC;wBACP,KAAK,EAAE;4BACL,CAAC,GAAG,cAAc,YAAY,CAAC,EAAE;gCAC/B,CAAC,cAAc,CAAC,EAAE,EAAE;gCACpB,SAAS,EAAE,YAAY,CAAC,EAAE;6BAC3B;yBACF;wBACD,MAAM,EAAE,WAAW;wBACnB,MAAM,EAAE,UAAU;qBACnB,CAAC,CAAC;gBACL,CAAC,CAAC,CACH,CAAC;YACJ,CAAC;YAED,OAAO,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC;gBAC1C,KAAK,EAAE,EAAE,EAAE,EAAE;gBACb,IAAI;aACL,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,0BAA0B,CAAC,EAAE,CAAC;gBACvD,MAAM,IAAI,4BAAmB,CAAC,sBAAsB,CAAC,CAAC;YACxD,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,4BAAmB,CAAC,KAAK,CAAC,CAAC;YACvC,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAA;AA9VY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;IAKR,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;GAP5C,aAAa,CA8VzB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=locale.service.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"locale.service.spec.d.ts","sourceRoot":"","sources":["../../src/locale/locale.service.spec.ts"],"names":[],"mappings":""}
@@ -1,174 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const pagination_1 = require("@hedhog/pagination");
4
- const prisma_1 = require("@hedhog/prisma");
5
- const common_1 = require("@nestjs/common");
6
- const testing_1 = require("@nestjs/testing");
7
- const locale_service_1 = require("./locale.service");
8
- describe('LocaleService', () => {
9
- let service;
10
- let prismaService;
11
- let paginationService;
12
- beforeEach(async () => {
13
- const module = await testing_1.Test.createTestingModule({
14
- providers: [
15
- locale_service_1.LocaleService,
16
- {
17
- provide: prisma_1.PrismaService,
18
- useValue: {
19
- translation: {
20
- findMany: jest.fn(),
21
- },
22
- locale: {
23
- findUnique: jest.fn(),
24
- create: jest.fn(),
25
- update: jest.fn(),
26
- deleteMany: jest.fn(),
27
- },
28
- },
29
- },
30
- {
31
- provide: pagination_1.PaginationService,
32
- useValue: {
33
- paginate: jest.fn(),
34
- },
35
- },
36
- ],
37
- }).compile();
38
- service = module.get(locale_service_1.LocaleService);
39
- prismaService = module.get(prisma_1.PrismaService);
40
- paginationService = module.get(pagination_1.PaginationService);
41
- });
42
- it('should be defined', () => {
43
- expect(service).toBeDefined();
44
- });
45
- describe('getTranslations', () => {
46
- it('should throw BadRequestException when localeCode is not provided', async () => {
47
- await expect(service.getTranslations('', 'namespace')).rejects.toThrow(common_1.BadRequestException);
48
- });
49
- it('should return translation for a given localeCode and namespace', async () => {
50
- const mockTranslations = [
51
- {
52
- id: 1,
53
- locale_id: 1,
54
- namespace_id: 1,
55
- name: 'hello',
56
- value: 'Hello',
57
- created_at: new Date(),
58
- updated_at: new Date(),
59
- },
60
- ];
61
- jest
62
- .spyOn(prismaService.translation, 'findMany')
63
- .mockResolvedValue(mockTranslations);
64
- const result = await service.getTranslations('en-US', 'namespace');
65
- expect(result).toEqual({ hello: 'Hello' });
66
- });
67
- });
68
- /*
69
- describe('get', () => {
70
- it('should paginate locale', 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.locale,
96
- paginationParams,
97
- expect.anything(),
98
- );
99
- expect(result).toBe(mockPaginationResult);
100
- });
101
- });
102
- */
103
- describe('getById', () => {
104
- it('should return a locale by ID', async () => {
105
- const mockLocale = {
106
- id: 1,
107
- name: 'English',
108
- code: 'en',
109
- region: 'us',
110
- created_at: new Date(),
111
- updated_at: new Date(),
112
- };
113
- jest
114
- .spyOn(prismaService.locale, 'findUnique')
115
- .mockResolvedValue(mockLocale);
116
- const result = await service.getById(1);
117
- expect(result).toBe(mockLocale);
118
- });
119
- });
120
- describe('create', () => {
121
- it('should create a new locale', async () => {
122
- const mockCreateDTO = {
123
- name: 'English',
124
- code: 'en',
125
- region: 'us',
126
- };
127
- const mockLocale = {
128
- id: 1,
129
- name: 'English',
130
- code: 'en',
131
- region: 'us',
132
- created_at: new Date(),
133
- updated_at: new Date(),
134
- };
135
- jest.spyOn(prismaService.locale, 'create').mockResolvedValue(mockLocale);
136
- const result = await service.create(mockCreateDTO);
137
- expect(result).toBe(mockLocale);
138
- });
139
- });
140
- describe('update', () => {
141
- it('should update a locale', async () => {
142
- const mockUpdateDTO = {
143
- name: 'English Updated',
144
- code: 'en',
145
- region: 'us',
146
- };
147
- const mockLocale = {
148
- id: 1,
149
- name: 'English Updated',
150
- code: 'en',
151
- region: 'us',
152
- created_at: new Date(),
153
- updated_at: new Date(),
154
- };
155
- jest.spyOn(prismaService.locale, 'update').mockResolvedValue(mockLocale);
156
- const result = await service.update({ id: 1, data: mockUpdateDTO });
157
- expect(result).toBe(mockLocale);
158
- });
159
- });
160
- describe('delete', () => {
161
- it('should throw BadRequestException if no IDs are provided', async () => {
162
- await expect(service.delete({ ids: null })).rejects.toThrow(common_1.BadRequestException);
163
- });
164
- it('should delete locale by IDs', async () => {
165
- const mockDeleteDTO = { ids: [1, 2, 3] };
166
- jest
167
- .spyOn(prismaService.locale, 'deleteMany')
168
- .mockResolvedValue({ count: 3 });
169
- const result = await service.delete(mockDeleteDTO);
170
- expect(result.count).toBe(3);
171
- });
172
- });
173
- });
174
- //# sourceMappingURL=locale.service.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"locale.service.spec.js","sourceRoot":"","sources":["../../src/locale/locale.service.spec.ts"],"names":[],"mappings":";;AAAA,mDAAuD;AACvD,2CAA+C;AAC/C,2CAAqD;AACrD,6CAAsD;AAItD,qDAAiD;AAEjD,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,WAAW,EAAE;4BACX,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE;yBACpB;wBACD,MAAM,EAAE;4BACN,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;gBACD;oBACE,OAAO,EAAE,8BAAiB;oBAC1B,QAAQ,EAAE;wBACR,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE;qBACpB;iBACF;aACF;SACF,CAAC,CAAC,OAAO,EAAE,CAAC;QAEb,OAAO,GAAG,MAAM,CAAC,GAAG,CAAgB,8BAAa,CAA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D,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,YAAY,CAAC;iBACzC,iBAAiB,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;YAEnC,MAAM,MAAM,GAAG,MAAM,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"}
@@ -1,3 +0,0 @@
1
- export declare const WITH_ROLE = "withRole";
2
- export declare function Role(): import("@nestjs/common").CustomDecorator<string>;
3
- //# sourceMappingURL=role.decorator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"role.decorator.d.ts","sourceRoot":"","sources":["../../../src/role/decorators/role.decorator.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,aAAa,CAAC;AAEpC,wBAAgB,IAAI,qDAEnB"}
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WITH_ROLE = void 0;
4
- exports.Role = Role;
5
- const common_1 = require("@nestjs/common");
6
- exports.WITH_ROLE = 'withRole';
7
- function Role() {
8
- return (0, common_1.SetMetadata)(exports.WITH_ROLE, true);
9
- }
10
- //# sourceMappingURL=role.decorator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"role.decorator.js","sourceRoot":"","sources":["../../../src/role/decorators/role.decorator.ts"],"names":[],"mappings":";;;AAIA,oBAEC;AAND,2CAA6C;AAEhC,QAAA,SAAS,GAAG,UAAU,CAAC;AAEpC,SAAgB,IAAI;IAClB,OAAO,IAAA,oBAAW,EAAC,iBAAS,EAAE,IAAI,CAAC,CAAC;AACtC,CAAC"}
@@ -1,3 +0,0 @@
1
- export declare class CreateDTO {
2
- }
3
- //# sourceMappingURL=create.dto.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create.dto.d.ts","sourceRoot":"","sources":["../../../src/setting/dto/create.dto.ts"],"names":[],"mappings":"AAAA,qBAAa,SAAS;CAAG"}
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CreateDTO = void 0;
4
- class CreateDTO {
5
- }
6
- exports.CreateDTO = CreateDTO;
7
- //# sourceMappingURL=create.dto.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create.dto.js","sourceRoot":"","sources":["../../../src/setting/dto/create.dto.ts"],"names":[],"mappings":";;;AAAA,MAAa,SAAS;CAAG;AAAzB,8BAAyB"}
@@ -1,4 +0,0 @@
1
- export declare class SettingUserDTO {
2
- value: string;
3
- }
4
- //# sourceMappingURL=setting-user.dto.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"setting-user.dto.d.ts","sourceRoot":"","sources":["../../../src/setting/dto/setting-user.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,cAAc;IAEzB,KAAK,EAAE,MAAM,CAAC;CACf"}
@@ -1,21 +0,0 @@
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.SettingUserDTO = void 0;
13
- const class_validator_1 = require("class-validator");
14
- class SettingUserDTO {
15
- }
16
- exports.SettingUserDTO = SettingUserDTO;
17
- __decorate([
18
- (0, class_validator_1.IsString)(),
19
- __metadata("design:type", String)
20
- ], SettingUserDTO.prototype, "value", void 0);
21
- //# sourceMappingURL=setting-user.dto.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"setting-user.dto.js","sourceRoot":"","sources":["../../../src/setting/dto/setting-user.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA2C;AAE3C,MAAa,cAAc;CAG1B;AAHD,wCAGC;AADC;IADC,IAAA,0BAAQ,GAAE;;6CACG"}
@@ -1,9 +0,0 @@
1
- declare class Setting {
2
- slug: string;
3
- value: string;
4
- }
5
- export declare class SettingDTO {
6
- setting: Setting[];
7
- }
8
- export {};
9
- //# sourceMappingURL=setting.dto.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"setting.dto.d.ts","sourceRoot":"","sources":["../../../src/setting/dto/setting.dto.ts"],"names":[],"mappings":"AAGA,cAAM,OAAO;IAEX,IAAI,EAAE,MAAM,CAAC;IAGb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,qBAAa,UAAU;IAIrB,OAAO,EAAE,OAAO,EAAE,CAAC;CACpB"}
@@ -1,34 +0,0 @@
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.SettingDTO = void 0;
13
- const class_transformer_1 = require("class-transformer");
14
- const class_validator_1 = require("class-validator");
15
- class Setting {
16
- }
17
- __decorate([
18
- (0, class_validator_1.IsString)(),
19
- __metadata("design:type", String)
20
- ], Setting.prototype, "slug", void 0);
21
- __decorate([
22
- (0, class_validator_1.IsString)(),
23
- __metadata("design:type", String)
24
- ], Setting.prototype, "value", void 0);
25
- class SettingDTO {
26
- }
27
- exports.SettingDTO = SettingDTO;
28
- __decorate([
29
- (0, class_validator_1.IsArray)(),
30
- (0, class_validator_1.ValidateNested)({ each: true }),
31
- (0, class_transformer_1.Type)(() => Setting),
32
- __metadata("design:type", Array)
33
- ], SettingDTO.prototype, "setting", void 0);
34
- //# sourceMappingURL=setting.dto.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"setting.dto.js","sourceRoot":"","sources":["../../../src/setting/dto/setting.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAyC;AACzC,qDAAoE;AAEpE,MAAM,OAAO;CAMZ;AAJC;IADC,IAAA,0BAAQ,GAAE;;qCACE;AAGb;IADC,IAAA,0BAAQ,GAAE;;sCACG;AAGhB,MAAa,UAAU;CAKtB;AALD,gCAKC;AADC;IAHC,IAAA,yBAAO,GAAE;IACT,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,OAAO,CAAC;;2CACD"}
@@ -1,4 +0,0 @@
1
- import { CreateDTO } from './create.dto';
2
- export declare class UpdateDTO extends CreateDTO {
3
- }
4
- //# sourceMappingURL=update.dto.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update.dto.d.ts","sourceRoot":"","sources":["../../../src/setting/dto/update.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,qBAAa,SAAU,SAAQ,SAAS;CAAG"}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UpdateDTO = void 0;
4
- const create_dto_1 = require("./create.dto");
5
- class UpdateDTO extends create_dto_1.CreateDTO {
6
- }
7
- exports.UpdateDTO = UpdateDTO;
8
- //# sourceMappingURL=update.dto.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update.dto.js","sourceRoot":"","sources":["../../../src/setting/dto/update.dto.ts"],"names":[],"mappings":";;;AAAA,6CAAyC;AAEzC,MAAa,SAAU,SAAQ,sBAAS;CAAG;AAA3C,8BAA2C"}