@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.
- package/dist/admin.module.d.ts.map +1 -1
- package/dist/admin.module.js +1 -6
- package/dist/admin.module.js.map +1 -1
- package/dist/auth/auth.controller.d.ts.map +1 -1
- package/dist/auth/auth.controller.js +6 -8
- package/dist/auth/auth.controller.js.map +1 -1
- package/dist/auth/guards/auth.guard.js +2 -2
- package/dist/auth/guards/auth.guard.js.map +1 -1
- package/dist/index.d.ts +0 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -11
- package/dist/index.js.map +1 -1
- package/dist/menu/menu.controller.d.ts.map +1 -1
- package/dist/menu/menu.controller.js +4 -5
- package/dist/menu/menu.controller.js.map +1 -1
- package/dist/role/dto/create.dto.d.ts +1 -1
- 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.d.ts.map +1 -1
- package/dist/role/guards/role.guard.js +3 -4
- package/dist/role/guards/role.guard.js.map +1 -1
- package/dist/role/role.controller.js +3 -3
- package/dist/role/role.controller.js.map +1 -1
- package/dist/role/role.module.js +1 -1
- package/dist/role/role.module.js.map +1 -1
- package/dist/role/role.service.d.ts +1 -1
- package/dist/role/role.service.d.ts.map +1 -1
- package/dist/role/role.service.js +1 -1
- package/dist/role/role.service.js.map +1 -1
- package/dist/route/route.controller.js +3 -3
- package/dist/route/route.controller.js.map +1 -1
- package/dist/screen/screen.controller.js +3 -3
- package/dist/screen/screen.controller.js.map +1 -1
- package/dist/user/user.controller.js +2 -2
- package/dist/user/user.controller.js.map +1 -1
- package/hedhog.yaml +1 -328
- package/package.json +8 -6
- package/src/admin.module.ts +1 -6
- package/src/auth/auth.controller.ts +1 -3
- package/src/auth/guards/auth.guard.ts +1 -1
- package/src/index.ts +0 -14
- package/src/menu/menu.controller.ts +2 -3
- package/src/role/dto/create.dto.ts +1 -1
- package/src/role/guards/role.guard.ts +1 -2
- package/src/role/role.controller.ts +2 -2
- package/src/role/role.module.ts +1 -1
- package/src/role/role.service.ts +1 -1
- package/src/route/route.controller.ts +2 -2
- package/src/screen/screen.controller.ts +2 -2
- package/src/user/user.controller.ts +1 -1
- package/dist/auth/decorators/public.decorator.d.ts +0 -3
- package/dist/auth/decorators/public.decorator.d.ts.map +0 -1
- package/dist/auth/decorators/public.decorator.js +0 -8
- package/dist/auth/decorators/public.decorator.js.map +0 -1
- package/dist/auth/decorators/user.decorator.d.ts +0 -2
- package/dist/auth/decorators/user.decorator.d.ts.map +0 -1
- package/dist/auth/decorators/user.decorator.js +0 -12
- package/dist/auth/decorators/user.decorator.js.map +0 -1
- package/dist/dto/with-locale.dto.d.ts +0 -4
- package/dist/dto/with-locale.dto.d.ts.map +0 -1
- package/dist/dto/with-locale.dto.js +0 -23
- package/dist/dto/with-locale.dto.js.map +0 -1
- package/dist/locale/dto/create.dto.d.ts +0 -6
- package/dist/locale/dto/create.dto.d.ts.map +0 -1
- package/dist/locale/dto/create.dto.js +0 -29
- package/dist/locale/dto/create.dto.js.map +0 -1
- package/dist/locale/dto/delete.dto.d.ts +0 -4
- package/dist/locale/dto/delete.dto.d.ts.map +0 -1
- package/dist/locale/dto/delete.dto.js +0 -23
- package/dist/locale/dto/delete.dto.js.map +0 -1
- package/dist/locale/dto/set-enabled.dto.d.ts +0 -4
- package/dist/locale/dto/set-enabled.dto.d.ts.map +0 -1
- package/dist/locale/dto/set-enabled.dto.js +0 -24
- package/dist/locale/dto/set-enabled.dto.js.map +0 -1
- package/dist/locale/dto/update.dto.d.ts +0 -6
- package/dist/locale/dto/update.dto.d.ts.map +0 -1
- package/dist/locale/dto/update.dto.js +0 -32
- package/dist/locale/dto/update.dto.js.map +0 -1
- package/dist/locale/index.d.ts +0 -5
- package/dist/locale/index.d.ts.map +0 -1
- package/dist/locale/index.js +0 -21
- package/dist/locale/index.js.map +0 -1
- package/dist/locale/locale.controller.d.ts +0 -18
- package/dist/locale/locale.controller.d.ts.map +0 -1
- package/dist/locale/locale.controller.js +0 -127
- package/dist/locale/locale.controller.js.map +0 -1
- package/dist/locale/locale.decorator.d.ts +0 -2
- package/dist/locale/locale.decorator.d.ts.map +0 -1
- package/dist/locale/locale.decorator.js +0 -9
- package/dist/locale/locale.decorator.js.map +0 -1
- package/dist/locale/locale.middleware.d.ts +0 -10
- package/dist/locale/locale.middleware.d.ts.map +0 -1
- package/dist/locale/locale.middleware.js +0 -45
- package/dist/locale/locale.middleware.js.map +0 -1
- package/dist/locale/locale.module.d.ts +0 -5
- package/dist/locale/locale.module.d.ts.map +0 -1
- package/dist/locale/locale.module.js +0 -35
- package/dist/locale/locale.module.js.map +0 -1
- package/dist/locale/locale.service.d.ts +0 -32
- package/dist/locale/locale.service.d.ts.map +0 -1
- package/dist/locale/locale.service.js +0 -290
- package/dist/locale/locale.service.js.map +0 -1
- package/dist/locale/locale.service.spec.d.ts +0 -2
- package/dist/locale/locale.service.spec.d.ts.map +0 -1
- package/dist/locale/locale.service.spec.js +0 -174
- package/dist/locale/locale.service.spec.js.map +0 -1
- package/dist/role/decorators/role.decorator.d.ts +0 -3
- package/dist/role/decorators/role.decorator.d.ts.map +0 -1
- package/dist/role/decorators/role.decorator.js +0 -10
- package/dist/role/decorators/role.decorator.js.map +0 -1
- package/dist/setting/dto/create.dto.d.ts +0 -3
- package/dist/setting/dto/create.dto.d.ts.map +0 -1
- package/dist/setting/dto/create.dto.js +0 -7
- package/dist/setting/dto/create.dto.js.map +0 -1
- package/dist/setting/dto/setting-user.dto.d.ts +0 -4
- package/dist/setting/dto/setting-user.dto.d.ts.map +0 -1
- package/dist/setting/dto/setting-user.dto.js +0 -21
- package/dist/setting/dto/setting-user.dto.js.map +0 -1
- package/dist/setting/dto/setting.dto.d.ts +0 -9
- package/dist/setting/dto/setting.dto.d.ts.map +0 -1
- package/dist/setting/dto/setting.dto.js +0 -34
- package/dist/setting/dto/setting.dto.js.map +0 -1
- package/dist/setting/dto/update.dto.d.ts +0 -4
- package/dist/setting/dto/update.dto.d.ts.map +0 -1
- package/dist/setting/dto/update.dto.js +0 -8
- package/dist/setting/dto/update.dto.js.map +0 -1
- package/dist/setting/setting.controller.d.ts +0 -25
- package/dist/setting/setting.controller.d.ts.map +0 -1
- package/dist/setting/setting.controller.js +0 -150
- package/dist/setting/setting.controller.js.map +0 -1
- package/dist/setting/setting.module.d.ts +0 -3
- package/dist/setting/setting.module.d.ts.map +0 -1
- package/dist/setting/setting.module.js +0 -31
- package/dist/setting/setting.module.js.map +0 -1
- package/dist/setting/setting.service.d.ts +0 -31
- package/dist/setting/setting.service.d.ts.map +0 -1
- package/dist/setting/setting.service.js +0 -314
- package/dist/setting/setting.service.js.map +0 -1
- package/dist/setting/setting.service.spec.d.ts +0 -2
- package/dist/setting/setting.service.spec.d.ts.map +0 -1
- package/dist/setting/setting.service.spec.js +0 -162
- package/dist/setting/setting.service.spec.js.map +0 -1
- package/src/auth/decorators/public.decorator.ts +0 -4
- package/src/auth/decorators/user.decorator.ts +0 -17
- package/src/dto/with-locale.dto.ts +0 -8
- package/src/locale/dto/create.dto.ts +0 -12
- package/src/locale/dto/delete.dto.ts +0 -8
- package/src/locale/dto/set-enabled.dto.ts +0 -9
- package/src/locale/dto/update.dto.ts +0 -15
- package/src/locale/index.ts +0 -4
- package/src/locale/locale.controller.ts +0 -79
- package/src/locale/locale.decorator.ts +0 -8
- package/src/locale/locale.middleware.ts +0 -34
- package/src/locale/locale.module.ts +0 -23
- package/src/locale/locale.service.spec.ts +0 -193
- package/src/locale/locale.service.ts +0 -364
- package/src/role/decorators/role.decorator.ts +0 -7
- package/src/setting/dto/create.dto.ts +0 -1
- package/src/setting/dto/setting-user.dto.ts +0 -6
- package/src/setting/dto/setting.dto.ts +0 -17
- package/src/setting/dto/update.dto.ts +0 -3
- package/src/setting/setting.controller.ts +0 -100
- package/src/setting/setting.module.ts +0 -18
- package/src/setting/setting.service.spec.ts +0 -183
- package/src/setting/setting.service.ts +0 -384
package/hedhog.yaml
CHANGED
@@ -1126,11 +1126,7 @@ data:
|
|
1126
1126
|
url:
|
1127
1127
|
in:
|
1128
1128
|
- /setting/:slug
|
1129
|
-
|
1130
|
-
- code: en
|
1131
|
-
region: US
|
1132
|
-
- code: pt
|
1133
|
-
region: BR
|
1129
|
+
|
1134
1130
|
translation_namespace:
|
1135
1131
|
- name: translation
|
1136
1132
|
relations:
|
@@ -1165,200 +1161,6 @@ data:
|
|
1165
1161
|
code: pt
|
1166
1162
|
name: pt
|
1167
1163
|
value: Português
|
1168
|
-
setting_group:
|
1169
|
-
- slug: localization
|
1170
|
-
icon: world
|
1171
|
-
name:
|
1172
|
-
en: Localization
|
1173
|
-
pt: Localização
|
1174
|
-
description:
|
1175
|
-
en: Configure the localization setting.
|
1176
|
-
pt: Configurar as definições de localização.
|
1177
|
-
relations:
|
1178
|
-
setting:
|
1179
|
-
- slug: language
|
1180
|
-
type: string
|
1181
|
-
name:
|
1182
|
-
en: Default Language
|
1183
|
-
pt: Idioma Padrão
|
1184
|
-
description:
|
1185
|
-
en: The system default language, each user can have their own preferred language
|
1186
|
-
pt: O idioma padrão do sistema, cada usuário pode ter o seu próprio idioma preferido
|
1187
|
-
value: en
|
1188
|
-
user_override: true
|
1189
|
-
- slug: timezone
|
1190
|
-
type: string
|
1191
|
-
name:
|
1192
|
-
en: Timezone
|
1193
|
-
pt: Fuso Horário
|
1194
|
-
description:
|
1195
|
-
en: The timezone to use
|
1196
|
-
pt: O fuso horário a utilizar
|
1197
|
-
value: UTC
|
1198
|
-
user_override: true
|
1199
|
-
- slug: appearance
|
1200
|
-
icon: palette
|
1201
|
-
name:
|
1202
|
-
en: Appearance
|
1203
|
-
pt: Aparência
|
1204
|
-
description:
|
1205
|
-
en: Configure the appearance setting.
|
1206
|
-
pt: Configurar as definições de aparência.
|
1207
|
-
relations:
|
1208
|
-
setting:
|
1209
|
-
- slug: theme-primary
|
1210
|
-
type: string
|
1211
|
-
name:
|
1212
|
-
en: Primary Color
|
1213
|
-
pt: Cor Primária
|
1214
|
-
description:
|
1215
|
-
en: The primary color to use
|
1216
|
-
pt: A cor primária a utilizar
|
1217
|
-
value: '#000000'
|
1218
|
-
- slug: theme-primary-foreground
|
1219
|
-
type: string
|
1220
|
-
name:
|
1221
|
-
en: Primary Color Foreground
|
1222
|
-
pt: Contraste da Cor Primária
|
1223
|
-
description:
|
1224
|
-
en: The primary color foreground to use
|
1225
|
-
pt: O contraste da cor primária a utilizar
|
1226
|
-
value: '#ffffff'
|
1227
|
-
- slug: theme-secondary
|
1228
|
-
type: string
|
1229
|
-
name:
|
1230
|
-
en: Secondary Color
|
1231
|
-
pt: Cor Secundária
|
1232
|
-
description:
|
1233
|
-
en: The secondary color to use
|
1234
|
-
pt: A cor secundária a utilizar
|
1235
|
-
value: '#FFFFFF'
|
1236
|
-
- slug: theme-secondary-foreground
|
1237
|
-
type: string
|
1238
|
-
name:
|
1239
|
-
en: Secondary Color Foreground
|
1240
|
-
pt: Contraste da Cor Secundária
|
1241
|
-
description:
|
1242
|
-
en: The secondary color foreground to use
|
1243
|
-
pt: O contraste da cor secundária a utilizar
|
1244
|
-
value: '#000000'
|
1245
|
-
- slug: theme-accent
|
1246
|
-
type: string
|
1247
|
-
name:
|
1248
|
-
en: Accent Color
|
1249
|
-
pt: Cor de Realce
|
1250
|
-
description:
|
1251
|
-
en: The accent color to use
|
1252
|
-
pt: A cor de realce a utilizar
|
1253
|
-
value: '#FF0000'
|
1254
|
-
- slug: theme-accent-foreground
|
1255
|
-
type: string
|
1256
|
-
name:
|
1257
|
-
en: Accent Color Foreground
|
1258
|
-
pt: Contraste da Cor de Realce
|
1259
|
-
description:
|
1260
|
-
en: The accent color foreground to use
|
1261
|
-
pt: O contraste da cor de realce a utilizar
|
1262
|
-
value: '#000000'
|
1263
|
-
- slug: theme-background
|
1264
|
-
type: string
|
1265
|
-
name:
|
1266
|
-
en: Background Color
|
1267
|
-
pt: Cor de Fundo
|
1268
|
-
description:
|
1269
|
-
en: The background color to use
|
1270
|
-
pt: A cor de fundo a utilizar
|
1271
|
-
value: '#FFFFFF'
|
1272
|
-
- slug: theme-background-foreground
|
1273
|
-
type: string
|
1274
|
-
name:
|
1275
|
-
en: Background Color Foreground
|
1276
|
-
pt: Contraste da Cor de Fundo
|
1277
|
-
description:
|
1278
|
-
en: The background color foreground to use
|
1279
|
-
pt: O contraste da cor de fundo a utilizar
|
1280
|
-
value: '#000000'
|
1281
|
-
- slug: theme-muted
|
1282
|
-
type: string
|
1283
|
-
name:
|
1284
|
-
en: Muted Color
|
1285
|
-
pt: Cor Suave
|
1286
|
-
description:
|
1287
|
-
en: The muted color to use
|
1288
|
-
pt: A cor suave a utilizar
|
1289
|
-
value: '#F0F0F0'
|
1290
|
-
- slug: theme-muted-foreground
|
1291
|
-
type: string
|
1292
|
-
name:
|
1293
|
-
en: Muted Color Foreground
|
1294
|
-
pt: Contraste da Cor Suave
|
1295
|
-
description:
|
1296
|
-
en: The muted color foreground to use
|
1297
|
-
pt: O contraste da cor suave a utilizar
|
1298
|
-
value: '#000000'
|
1299
|
-
- slug: theme-radius
|
1300
|
-
type: string
|
1301
|
-
name:
|
1302
|
-
en: Radius
|
1303
|
-
pt: Raio
|
1304
|
-
description:
|
1305
|
-
en: The radius to use
|
1306
|
-
pt: O raio a utilizar
|
1307
|
-
value: '0.5'
|
1308
|
-
- slug: theme-font
|
1309
|
-
type: string
|
1310
|
-
name:
|
1311
|
-
en: Font Family
|
1312
|
-
pt: Família de Fontes
|
1313
|
-
description:
|
1314
|
-
en: The font to use
|
1315
|
-
pt: A fonte a utilizar
|
1316
|
-
value: 'Arial, sans-serif'
|
1317
|
-
- slug: theme-text-size
|
1318
|
-
type: string
|
1319
|
-
name:
|
1320
|
-
en: Text Size
|
1321
|
-
pt: Tamanho do Texto
|
1322
|
-
description:
|
1323
|
-
en: Text size of the application
|
1324
|
-
pt: Tamanho do texto da aplicação
|
1325
|
-
value: '1'
|
1326
|
-
- slug: theme-muted-saturation
|
1327
|
-
type: string
|
1328
|
-
name:
|
1329
|
-
en: Muted Color Saturation
|
1330
|
-
pt: Saturação da Cor Suave
|
1331
|
-
description:
|
1332
|
-
en: Saturação da Cor Suave a utilizar
|
1333
|
-
pt: Muted Color Saturation to use
|
1334
|
-
value: '100'
|
1335
|
-
- slug: theme-muted-lightness
|
1336
|
-
type: string
|
1337
|
-
name:
|
1338
|
-
en: Muted Color Lightness
|
1339
|
-
pt: Luminância da Cor Suave
|
1340
|
-
description:
|
1341
|
-
en: Luminância da Cor Suave a utilizar
|
1342
|
-
pt: Muted Color Lightness to use
|
1343
|
-
value: '100'
|
1344
|
-
- slug: theme-light-dark-enabled
|
1345
|
-
type: boolean
|
1346
|
-
name:
|
1347
|
-
en: Light/Dark Themes Enabled
|
1348
|
-
pt: Tema Claro/Escuro Habilitado
|
1349
|
-
description:
|
1350
|
-
en: Enable or disable toggling of light/dark themes
|
1351
|
-
pt: Habilite ou desabilite a troca de tema claro/escuro
|
1352
|
-
value: true
|
1353
|
-
- slug: theme-light-dark-default
|
1354
|
-
type: string
|
1355
|
-
name:
|
1356
|
-
en: Default Theme
|
1357
|
-
pt: Tema Padrão
|
1358
|
-
description:
|
1359
|
-
en: System default theme
|
1360
|
-
pt: Tema Padrão do sistema
|
1361
|
-
value: 'dark'
|
1362
1164
|
|
1363
1165
|
tables:
|
1364
1166
|
country:
|
@@ -1700,132 +1502,3 @@ tables:
|
|
1700
1502
|
- type: created_at
|
1701
1503
|
- type: updated_at
|
1702
1504
|
ifNotExists: true
|
1703
|
-
|
1704
|
-
setting_group:
|
1705
|
-
columns:
|
1706
|
-
- type: pk
|
1707
|
-
- name: icon
|
1708
|
-
length: 31
|
1709
|
-
- type: slug
|
1710
|
-
- type: created_at
|
1711
|
-
- type: updated_at
|
1712
|
-
ifNotExists: true
|
1713
|
-
|
1714
|
-
setting_group_locale:
|
1715
|
-
columns:
|
1716
|
-
- name: locale_id
|
1717
|
-
type: fk
|
1718
|
-
isPrimary: true
|
1719
|
-
references:
|
1720
|
-
table: locale
|
1721
|
-
column: id
|
1722
|
-
onDelete: CASCADE
|
1723
|
-
- name: group_id
|
1724
|
-
type: fk
|
1725
|
-
isPrimary: true
|
1726
|
-
references:
|
1727
|
-
table: setting_group
|
1728
|
-
column: id
|
1729
|
-
onDelete: CASCADE
|
1730
|
-
- name: name
|
1731
|
-
length: 63
|
1732
|
-
- name: description
|
1733
|
-
length: 255
|
1734
|
-
isNullable: true
|
1735
|
-
- type: created_at
|
1736
|
-
- type: updated_at
|
1737
|
-
ifNotExists: true
|
1738
|
-
|
1739
|
-
setting:
|
1740
|
-
columns:
|
1741
|
-
- type: pk
|
1742
|
-
- name: group_id
|
1743
|
-
type: fk
|
1744
|
-
references:
|
1745
|
-
table: setting_group
|
1746
|
-
column: id
|
1747
|
-
onDelete: CASCADE
|
1748
|
-
- type: slug
|
1749
|
-
- name: type
|
1750
|
-
type: enum
|
1751
|
-
enum:
|
1752
|
-
- string
|
1753
|
-
- array
|
1754
|
-
- number
|
1755
|
-
- boolean
|
1756
|
-
- json
|
1757
|
-
default: string
|
1758
|
-
- name: value
|
1759
|
-
length: 1023
|
1760
|
-
isNullable: true
|
1761
|
-
- name: user_override
|
1762
|
-
type: boolean
|
1763
|
-
default: false
|
1764
|
-
- type: created_at
|
1765
|
-
- type: updated_at
|
1766
|
-
ifNotExists: true
|
1767
|
-
|
1768
|
-
setting_locale:
|
1769
|
-
columns:
|
1770
|
-
- name: locale_id
|
1771
|
-
type: fk
|
1772
|
-
isPrimary: true
|
1773
|
-
references:
|
1774
|
-
table: locale
|
1775
|
-
column: id
|
1776
|
-
onDelete: CASCADE
|
1777
|
-
- name: setting_id
|
1778
|
-
type: fk
|
1779
|
-
isPrimary: true
|
1780
|
-
references:
|
1781
|
-
table: setting
|
1782
|
-
column: id
|
1783
|
-
onDelete: CASCADE
|
1784
|
-
- name: description
|
1785
|
-
length: 255
|
1786
|
-
isNullable: true
|
1787
|
-
- name: name
|
1788
|
-
length: 63
|
1789
|
-
isNullable: true
|
1790
|
-
- type: created_at
|
1791
|
-
- type: updated_at
|
1792
|
-
ifNotExists: true
|
1793
|
-
|
1794
|
-
setting_user:
|
1795
|
-
columns:
|
1796
|
-
- name: user_id
|
1797
|
-
type: fk
|
1798
|
-
isPrimary: true
|
1799
|
-
references:
|
1800
|
-
table: user
|
1801
|
-
column: id
|
1802
|
-
onDelete: CASCADE
|
1803
|
-
- name: setting_id
|
1804
|
-
type: fk
|
1805
|
-
isPrimary: true
|
1806
|
-
references:
|
1807
|
-
table: setting
|
1808
|
-
column: id
|
1809
|
-
onDelete: CASCADE
|
1810
|
-
- name: value
|
1811
|
-
length: 1023
|
1812
|
-
isNullable: true
|
1813
|
-
- type: created_at
|
1814
|
-
- type: updated_at
|
1815
|
-
ifNotExists: true
|
1816
|
-
|
1817
|
-
locale:
|
1818
|
-
columns:
|
1819
|
-
- type: pk
|
1820
|
-
- name: code
|
1821
|
-
type: char
|
1822
|
-
length: 2
|
1823
|
-
- name: region
|
1824
|
-
type: char
|
1825
|
-
length: 2
|
1826
|
-
- name: enabled
|
1827
|
-
type: boolean
|
1828
|
-
default: true
|
1829
|
-
- type: created_at
|
1830
|
-
- type: updated_at
|
1831
|
-
ifNotExists: true
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@hedhog/admin",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.110",
|
4
4
|
"private": false,
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"scripts": {
|
@@ -21,11 +21,12 @@
|
|
21
21
|
"license": "MIT",
|
22
22
|
"description": "",
|
23
23
|
"devDependencies": {
|
24
|
-
"@hedhog/file": "^0.0.
|
24
|
+
"@hedhog/file": "^0.0.24",
|
25
25
|
"@hedhog/mail": "latest",
|
26
|
-
"@hedhog/
|
27
|
-
"@hedhog/
|
28
|
-
"@hedhog/
|
26
|
+
"@hedhog/locale": "^0.0.17",
|
27
|
+
"@hedhog/pagination": "^0.0.17",
|
28
|
+
"@hedhog/prisma": "^0.0.11",
|
29
|
+
"@hedhog/utils": "^0.0.21",
|
29
30
|
"@nestjs/mapped-types": "^2.0.5",
|
30
31
|
"ts-node": "^10.9.1",
|
31
32
|
"typescript": "^5.1.3"
|
@@ -33,9 +34,10 @@
|
|
33
34
|
"peerDependencies": {
|
34
35
|
"@hedhog/file": "latest",
|
35
36
|
"@hedhog/mail": "latest",
|
37
|
+
"@hedhog/locale": "latest",
|
36
38
|
"@hedhog/pagination": "latest",
|
37
39
|
"@hedhog/prisma": "latest",
|
38
|
-
"@hedhog/utils": "
|
40
|
+
"@hedhog/utils": "latest",
|
39
41
|
"@nestjs/jwt": "latest"
|
40
42
|
}
|
41
43
|
}
|
package/src/admin.module.ts
CHANGED
@@ -1,14 +1,12 @@
|
|
1
|
-
import { FileModule } from '@hedhog/file';
|
2
1
|
import { PaginationModule } from '@hedhog/pagination';
|
3
2
|
import { PrismaModule } from '@hedhog/prisma';
|
4
3
|
import { forwardRef, Module } from '@nestjs/common';
|
5
4
|
import { AuthModule } from './auth/auth.module';
|
6
|
-
import { LocaleModule } from '
|
5
|
+
import { LocaleModule } from '@hedhog/locale';
|
7
6
|
import { MenuModule } from './menu/menu.module';
|
8
7
|
import { RoleModule } from './role/role.module';
|
9
8
|
import { RouteModule } from './route/route.module';
|
10
9
|
import { ScreenModule } from './screen/screen.module';
|
11
|
-
import { SettingModule } from './setting/setting.module';
|
12
10
|
import { UserModule } from './user/user.module';
|
13
11
|
|
14
12
|
@Module({
|
@@ -20,10 +18,8 @@ import { UserModule } from './user/user.module';
|
|
20
18
|
forwardRef(() => RouteModule),
|
21
19
|
forwardRef(() => PrismaModule),
|
22
20
|
forwardRef(() => ScreenModule),
|
23
|
-
forwardRef(() => SettingModule),
|
24
21
|
forwardRef(() => LocaleModule),
|
25
22
|
forwardRef(() => UserModule),
|
26
|
-
forwardRef(() => FileModule),
|
27
23
|
],
|
28
24
|
exports: [
|
29
25
|
UserModule,
|
@@ -31,7 +27,6 @@ import { UserModule } from './user/user.module';
|
|
31
27
|
RouteModule,
|
32
28
|
RoleModule,
|
33
29
|
MenuModule,
|
34
|
-
SettingModule,
|
35
30
|
ScreenModule,
|
36
31
|
LocaleModule,
|
37
32
|
],
|
@@ -6,10 +6,8 @@ import {
|
|
6
6
|
Inject,
|
7
7
|
Post,
|
8
8
|
} from '@nestjs/common';
|
9
|
-
import { Role } from '
|
9
|
+
import { Role, Public, User } from '@hedhog/utils';
|
10
10
|
import { AuthService } from './auth.service';
|
11
|
-
import { Public } from './decorators/public.decorator';
|
12
|
-
import { User } from './decorators/user.decorator';
|
13
11
|
import { ForgetDTO } from './dto/forget.dto';
|
14
12
|
import { LoginDTO } from './dto/login.dto';
|
15
13
|
import { OtpDTO } from './dto/otp.dto';
|
@@ -7,7 +7,7 @@ import {
|
|
7
7
|
import { Reflector } from '@nestjs/core';
|
8
8
|
import { Request } from 'express';
|
9
9
|
import { AuthService } from '../auth.service';
|
10
|
-
import { IS_PUBLIC_KEY } from '
|
10
|
+
import { IS_PUBLIC_KEY } from '@hedhog/utils';
|
11
11
|
|
12
12
|
@Injectable()
|
13
13
|
export class AuthGuard implements CanActivate {
|
package/src/index.ts
CHANGED
@@ -3,32 +3,18 @@ export * from './admin.module';
|
|
3
3
|
|
4
4
|
// Auth Module
|
5
5
|
export * from './auth/auth.service';
|
6
|
-
export * from './auth/decorators/public.decorator';
|
7
|
-
export * from './auth/decorators/user.decorator';
|
8
6
|
export * from './auth/guards/auth.guard';
|
9
7
|
|
10
8
|
// Menu Module
|
11
9
|
export * from './menu/menu.service';
|
12
10
|
|
13
11
|
// Permission Module
|
14
|
-
export * from './role/decorators/role.decorator';
|
15
12
|
export * from './role/guards/role.guard';
|
16
13
|
export * from './role/role.service';
|
17
14
|
|
18
15
|
// Screen Module
|
19
16
|
export * from './screen/screen.service';
|
20
17
|
|
21
|
-
// Screen Module
|
22
|
-
export * from './setting/setting.service';
|
23
|
-
|
24
18
|
// User Module
|
25
19
|
export * from './user/constants/user.constants';
|
26
20
|
export * from './user/user.service';
|
27
|
-
|
28
|
-
// Locale Module
|
29
|
-
export * from './locale/locale.decorator';
|
30
|
-
export * from './locale/locale.service';
|
31
|
-
|
32
|
-
export * from './dto/delete.dto';
|
33
|
-
export * from './dto/update-ids.dto';
|
34
|
-
export * from './dto/with-locale.dto';
|
@@ -11,11 +11,10 @@ import {
|
|
11
11
|
Post,
|
12
12
|
forwardRef,
|
13
13
|
} from '@nestjs/common';
|
14
|
-
import { User } from '../auth/decorators/user.decorator';
|
15
14
|
import { DeleteDTO } from '../dto/delete.dto';
|
16
15
|
import { UpdateIdsDTO } from '../dto/update-ids.dto';
|
17
|
-
import { Locale } from '
|
18
|
-
import { Role } from '
|
16
|
+
import { Locale } from '@hedhog/locale';
|
17
|
+
import { Role, User } from '@hedhog/utils';
|
19
18
|
import { CreateDTO } from './dto/create.dto';
|
20
19
|
import { OrderDTO } from './dto/order.dto';
|
21
20
|
import { UpdateDTO } from './dto/update.dto';
|
@@ -11,8 +11,7 @@ import {
|
|
11
11
|
import { METHOD_METADATA } from '@nestjs/common/constants';
|
12
12
|
import { Reflector } from '@nestjs/core';
|
13
13
|
import { Request } from 'express';
|
14
|
-
import { IS_PUBLIC_KEY } from '
|
15
|
-
import { WITH_ROLE } from '../decorators/role.decorator';
|
14
|
+
import { IS_PUBLIC_KEY, WITH_ROLE } from '@hedhog/utils';
|
16
15
|
|
17
16
|
@Injectable()
|
18
17
|
export class RoleGuard implements CanActivate {
|
@@ -13,8 +13,8 @@ import {
|
|
13
13
|
} from '@nestjs/common';
|
14
14
|
import { DeleteDTO } from '../dto/delete.dto';
|
15
15
|
import { UpdateIdsDTO } from '../dto/update-ids.dto';
|
16
|
-
import { Locale } from '
|
17
|
-
import { Role } from '
|
16
|
+
import { Locale } from '@hedhog/locale';
|
17
|
+
import { Role } from '@hedhog/utils';
|
18
18
|
import { CreateDTO } from './dto/create.dto';
|
19
19
|
import { UpdateDTO } from './dto/update.dto';
|
20
20
|
import { RoleService } from './role.service';
|
package/src/role/role.module.ts
CHANGED
@@ -3,7 +3,7 @@ import { PrismaModule } from '@hedhog/prisma';
|
|
3
3
|
import { forwardRef, Module } from '@nestjs/common';
|
4
4
|
import { APP_GUARD } from '@nestjs/core';
|
5
5
|
import { AuthModule } from '../auth/auth.module';
|
6
|
-
import { LocaleModule } from '
|
6
|
+
import { LocaleModule } from '@hedhog/locale';
|
7
7
|
import { RoleGuard } from './guards/role.guard';
|
8
8
|
import { RoleController } from './role.controller';
|
9
9
|
import { RoleService } from './role.service';
|
package/src/role/role.service.ts
CHANGED
@@ -9,7 +9,7 @@ import {
|
|
9
9
|
} from '@nestjs/common';
|
10
10
|
import { DeleteDTO } from '../dto/delete.dto';
|
11
11
|
import { UpdateIdsDTO } from '../dto/update-ids.dto';
|
12
|
-
import { LocaleService } from '
|
12
|
+
import { LocaleService } from '@hedhog/locale';
|
13
13
|
import { CreateDTO } from './dto/create.dto';
|
14
14
|
import { UpdateDTO } from './dto/update.dto';
|
15
15
|
|
@@ -13,8 +13,8 @@ import {
|
|
13
13
|
} from '@nestjs/common';
|
14
14
|
import { DeleteDTO } from '../dto/delete.dto';
|
15
15
|
import { UpdateIdsDTO } from '../dto/update-ids.dto';
|
16
|
-
import { Locale } from '
|
17
|
-
import { Role } from '
|
16
|
+
import { Locale } from '@hedhog/locale';
|
17
|
+
import { Role } from '@hedhog/utils';
|
18
18
|
import { CreateDTO } from './dto/create.dto';
|
19
19
|
import { UpdateDTO } from './dto/update.dto';
|
20
20
|
import { RouteService } from './route.service';
|
@@ -13,8 +13,8 @@ import {
|
|
13
13
|
} from '@nestjs/common';
|
14
14
|
import { DeleteDTO } from '../dto/delete.dto';
|
15
15
|
import { UpdateIdsDTO } from '../dto/update-ids.dto';
|
16
|
-
import { Locale } from '
|
17
|
-
import { Role } from '
|
16
|
+
import { Locale } from '@hedhog/locale';
|
17
|
+
import { Role } from '@hedhog/utils';
|
18
18
|
import { CreateDTO } from './dto/create.dto';
|
19
19
|
import { UpdateDTO } from './dto/update.dto';
|
20
20
|
import { ScreenService } from './screen.service';
|
@@ -13,7 +13,7 @@ import {
|
|
13
13
|
} from '@nestjs/common';
|
14
14
|
import { DeleteDTO } from '../dto/delete.dto';
|
15
15
|
import { UpdateIdsDTO } from '../dto/update-ids.dto';
|
16
|
-
import { Role } from '
|
16
|
+
import { Role } from '@hedhog/utils';
|
17
17
|
import { CreateDTO } from './dto/create.dto';
|
18
18
|
import { UpdateDTO } from './dto/update.dto';
|
19
19
|
import { UserService } from './user.service';
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"public.decorator.d.ts","sourceRoot":"","sources":["../../../src/auth/decorators/public.decorator.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,aAAa,CAAC;AACxC,eAAO,MAAM,MAAM,wDAAyC,CAAC"}
|
@@ -1,8 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.Public = exports.IS_PUBLIC_KEY = void 0;
|
4
|
-
const common_1 = require("@nestjs/common");
|
5
|
-
exports.IS_PUBLIC_KEY = 'isPublic';
|
6
|
-
const Public = () => (0, common_1.SetMetadata)(exports.IS_PUBLIC_KEY, true);
|
7
|
-
exports.Public = Public;
|
8
|
-
//# sourceMappingURL=public.decorator.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"public.decorator.js","sourceRoot":"","sources":["../../../src/auth/decorators/public.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAA6C;AAEhC,QAAA,aAAa,GAAG,UAAU,CAAC;AACjC,MAAM,MAAM,GAAG,GAAG,EAAE,CAAC,IAAA,oBAAW,EAAC,qBAAa,EAAE,IAAI,CAAC,CAAC;AAAhD,QAAA,MAAM,UAA0C"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"user.decorator.d.ts","sourceRoot":"","sources":["../../../src/auth/decorators/user.decorator.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,IAAI,yLAUhB,CAAC"}
|
@@ -1,12 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.User = void 0;
|
4
|
-
const common_1 = require("@nestjs/common");
|
5
|
-
exports.User = (0, common_1.createParamDecorator)((field = null, ctx) => {
|
6
|
-
const request = ctx.switchToHttp().getRequest();
|
7
|
-
if (!request.auth || !request.auth.user) {
|
8
|
-
throw new common_1.UnauthorizedException(`User is not authenticated`);
|
9
|
-
}
|
10
|
-
return field ? request.auth.user[field] : request.auth.user;
|
11
|
-
});
|
12
|
-
//# sourceMappingURL=user.decorator.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"user.decorator.js","sourceRoot":"","sources":["../../../src/auth/decorators/user.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAIwB;AAEX,QAAA,IAAI,GAAG,IAAA,6BAAoB,EACtC,CAAC,QAAuB,IAAI,EAAE,GAAqB,EAAE,EAAE;IACrD,MAAM,OAAO,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;IAEhD,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QACxC,MAAM,IAAI,8BAAqB,CAAC,2BAA2B,CAAC,CAAC;IAC/D,CAAC;IAED,OAAO,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;AAC9D,CAAC,CACF,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"with-locale.dto.d.ts","sourceRoot":"","sources":["../../src/dto/with-locale.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,aAAa;IAIxB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAChD"}
|
@@ -1,23 +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.WithLocaleDTO = void 0;
|
13
|
-
const class_validator_1 = require("class-validator");
|
14
|
-
class WithLocaleDTO {
|
15
|
-
}
|
16
|
-
exports.WithLocaleDTO = WithLocaleDTO;
|
17
|
-
__decorate([
|
18
|
-
(0, class_validator_1.IsOptional)(),
|
19
|
-
(0, class_validator_1.IsObject)(),
|
20
|
-
(0, class_validator_1.ValidateNested)({ each: true }),
|
21
|
-
__metadata("design:type", Object)
|
22
|
-
], WithLocaleDTO.prototype, "locale", void 0);
|
23
|
-
//# sourceMappingURL=with-locale.dto.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"with-locale.dto.js","sourceRoot":"","sources":["../../src/dto/with-locale.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAuE;AAEvE,MAAa,aAAa;CAKzB;AALD,sCAKC;AADC;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;6CACgB"}
|