@hedhog/admin 0.0.108 → 0.0.109
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 -3
- package/dist/admin.module.js.map +1 -1
- package/dist/auth/auth.controller.d.ts.map +1 -1
- package/dist/auth/auth.controller.js +5 -6
- 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 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -8
- package/dist/index.js.map +1 -1
- package/dist/menu/menu.controller.js +3 -3
- package/dist/menu/menu.controller.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/setting/setting.controller.d.ts +1 -0
- package/dist/setting/setting.controller.d.ts.map +1 -1
- package/dist/setting/setting.controller.js +14 -3
- package/dist/setting/setting.controller.js.map +1 -1
- package/dist/setting/setting.module.d.ts.map +1 -1
- package/dist/setting/setting.module.js +2 -0
- package/dist/setting/setting.module.js.map +1 -1
- package/dist/setting/setting.service.d.ts +2 -0
- package/dist/setting/setting.service.d.ts.map +1 -1
- package/dist/setting/setting.service.js +63 -0
- package/dist/setting/setting.service.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 -21
- package/package.json +8 -6
- package/src/admin.module.ts +1 -3
- package/src/auth/auth.controller.ts +1 -2
- package/src/auth/guards/auth.guard.ts +1 -1
- package/src/index.ts +0 -10
- package/src/menu/menu.controller.ts +2 -2
- 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/setting/setting.controller.ts +10 -3
- package/src/setting/setting.module.ts +2 -0
- package/src/setting/setting.service.ts +73 -0
- 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/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/src/auth/decorators/public.decorator.ts +0 -4
- 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
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"setting.service.d.ts","sourceRoot":"","sources":["../../src/setting/setting.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAA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aAAa,EAAE,aAAa,EAE5B,iBAAiB,EAAE,iBAAiB,EAEpC,WAAW,EAAE,WAAW;IAGrC,gBAAgB,CAAC,GAAG,EAAE,QAAQ;IAQ9B,wBAAwB;IA8ExB,eAAe,CAAC,IAAI,EAAE,UAAU;;;IAoChC,mBAAmB,CAAC,MAAM,EAAE,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM;IAiEpE,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,aAAa;IAqCjE,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,aAAa;IA0D5D,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"}
|
@@ -24,6 +24,11 @@ let SettingService = class SettingService {
|
|
24
24
|
this.paginationService = paginationService;
|
25
25
|
this.fileService = fileService;
|
26
26
|
}
|
27
|
+
async getAppearanceCSS(res) {
|
28
|
+
const fileCSS = await this.fileService.readStream(`appearance/theme.css`);
|
29
|
+
res.setHeader('Content-Type', 'text/css');
|
30
|
+
return fileCSS.pipe(res);
|
31
|
+
}
|
27
32
|
async updateAppearanceSettings() {
|
28
33
|
console.log({ updateAppearanceSettings: 'updateAppearanceSettings' });
|
29
34
|
const settings = await this.prismaService.setting.findMany({
|
@@ -33,6 +38,64 @@ let SettingService = class SettingService {
|
|
33
38
|
},
|
34
39
|
},
|
35
40
|
});
|
41
|
+
await this.fileService.uploadFromString('appearance', 'theme.css', `
|
42
|
+
@layer base {
|
43
|
+
:root {
|
44
|
+
--background: 0 0% 100%;
|
45
|
+
--foreground: 20 14.3% 4.1%;
|
46
|
+
--card: 0 0% 100%;
|
47
|
+
--card-foreground: 20 14.3% 4.1%;
|
48
|
+
--popover: 0 0% 100%;
|
49
|
+
--popover-foreground: 20 14.3% 4.1%;
|
50
|
+
--primary: 24.6 95% 53.1%;
|
51
|
+
--primary-foreground: 60 9.1% 97.8%;
|
52
|
+
--secondary: 60 4.8% 95.9%;
|
53
|
+
--secondary-foreground: 24 9.8% 10%;
|
54
|
+
--muted: 60 4.8% 95.9%;
|
55
|
+
--muted-foreground: 25 5.3% 44.7%;
|
56
|
+
--accent: 60 4.8% 95.9%;
|
57
|
+
--accent-foreground: 24 9.8% 10%;
|
58
|
+
--destructive: 0 84.2% 60.2%;
|
59
|
+
--destructive-foreground: 60 9.1% 97.8%;
|
60
|
+
--border: 20 5.9% 90%;
|
61
|
+
--input: 20 5.9% 90%;
|
62
|
+
--ring: 24.6 95% 53.1%;
|
63
|
+
--radius: 0.5rem;
|
64
|
+
--chart-1: 12 76% 61%;
|
65
|
+
--chart-2: 173 58% 39%;
|
66
|
+
--chart-3: 197 37% 24%;
|
67
|
+
--chart-4: 43 74% 66%;
|
68
|
+
--chart-5: 27 87% 67%;
|
69
|
+
}
|
70
|
+
|
71
|
+
.dark {
|
72
|
+
--background: 20 14.3% 4.1%;
|
73
|
+
--foreground: 60 9.1% 97.8%;
|
74
|
+
--card: 20 14.3% 4.1%;
|
75
|
+
--card-foreground: 60 9.1% 97.8%;
|
76
|
+
--popover: 20 14.3% 4.1%;
|
77
|
+
--popover-foreground: 60 9.1% 97.8%;
|
78
|
+
--primary: 20.5 90.2% 48.2%;
|
79
|
+
--primary-foreground: 60 9.1% 97.8%;
|
80
|
+
--secondary: 12 6.5% 15.1%;
|
81
|
+
--secondary-foreground: 60 9.1% 97.8%;
|
82
|
+
--muted: 12 6.5% 15.1%;
|
83
|
+
--muted-foreground: 24 5.4% 63.9%;
|
84
|
+
--accent: 12 6.5% 15.1%;
|
85
|
+
--accent-foreground: 60 9.1% 97.8%;
|
86
|
+
--destructive: 0 72.2% 50.6%;
|
87
|
+
--destructive-foreground: 60 9.1% 97.8%;
|
88
|
+
--border: 12 6.5% 15.1%;
|
89
|
+
--input: 12 6.5% 15.1%;
|
90
|
+
--ring: 20.5 90.2% 48.2%;
|
91
|
+
--chart-1: 220 70% 50%;
|
92
|
+
--chart-2: 160 60% 45%;
|
93
|
+
--chart-3: 30 80% 55%;
|
94
|
+
--chart-4: 280 65% 60%;
|
95
|
+
--chart-5: 340 75% 55%;
|
96
|
+
}
|
97
|
+
}
|
98
|
+
`, 'text/css');
|
36
99
|
console.log({ settings });
|
37
100
|
}
|
38
101
|
async setManySettings(data) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"setting.service.js","sourceRoot":"","sources":["../../src/setting/setting.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uCAA2C;AAC3C,mDAAsE;AACtE,2CAA+C;AAC/C,yCAAiD;AACjD,2CAKwB;
|
1
|
+
{"version":3,"file":"setting.service.js","sourceRoot":"","sources":["../../src/setting/setting.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uCAA2C;AAC3C,mDAAsE;AACtE,2CAA+C;AAC/C,yCAAiD;AACjD,2CAKwB;AAQjB,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YAEmB,aAA4B,EAE5B,iBAAoC,EAEpC,WAAwB;QAJxB,kBAAa,GAAb,aAAa,CAAe;QAE5B,sBAAiB,GAAjB,iBAAiB,CAAmB;QAEpC,gBAAW,GAAX,WAAW,CAAa;IACxC,CAAC;IAEJ,KAAK,CAAC,gBAAgB,CAAC,GAAa;QAClC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,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 @@ const pagination_1 = require("@hedhog/pagination");
|
|
17
17
|
const common_1 = require("@nestjs/common");
|
18
18
|
const delete_dto_1 = require("../dto/delete.dto");
|
19
19
|
const update_ids_dto_1 = require("../dto/update-ids.dto");
|
20
|
-
const
|
20
|
+
const utils_1 = require("@hedhog/utils");
|
21
21
|
const create_dto_1 = require("./dto/create.dto");
|
22
22
|
const update_dto_1 = require("./dto/update.dto");
|
23
23
|
const user_service_1 = require("./user.service");
|
@@ -104,7 +104,7 @@ __decorate([
|
|
104
104
|
__metadata("design:returntype", Promise)
|
105
105
|
], UserController.prototype, "delete", null);
|
106
106
|
exports.UserController = UserController = __decorate([
|
107
|
-
(0,
|
107
|
+
(0, utils_1.Role)(),
|
108
108
|
(0, common_1.Controller)('user'),
|
109
109
|
__param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => user_service_1.UserService))),
|
110
110
|
__metadata("design:paramtypes", [user_service_1.UserService])
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"user.controller.js","sourceRoot":"","sources":["../../src/user/user.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAgD;AAChD,2CAWwB;AACxB,kDAA8C;AAC9C,0DAAqD;AACrD,
|
1
|
+
{"version":3,"file":"user.controller.js","sourceRoot":"","sources":["../../src/user/user.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAgD;AAChD,2CAWwB;AACxB,kDAA8C;AAC9C,0DAAqD;AACrD,yCAAqC;AACrC,iDAA6C;AAC7C,iDAA6C;AAC7C,iDAA6C;AAItC,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YAEmB,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;IACxC,CAAC;IAGE,AAAN,KAAK,CAAC,IAAI,CAAe,gBAAgB;QACvC,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACjD,CAAC;IAGK,AAAN,KAAK,CAAC,SAAS,CACkB,M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,CAAC;IACJ,WAAA,IAAA,cAAK,EAAC,QAAQ,EAAE,qBAAY,CAAC,CAAA;;;;yCAEvC;AAGD;IADC,IAAA,aAAI,GAAE;IACC,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAO,sBAAS;;4CAE7B;AAGK;IADL,IAAA,cAAK,EAAC,SAAS,CAAC;IAEd,WAAA,IAAA,cAAK,EAAC,QAAQ,EAAE,qBAAY,CAAC,CAAA;IAC7B,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAO,sBAAS;;4CAMxB;AAGK;IADL,IAAA,eAAM,GAAE;IACK,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAO,sBAAS;;4CAEnC;yBAnDU,cAAc;IAF1B,IAAA,YAAI,GAAE;IACN,IAAA,mBAAU,EAAC,MAAM,CAAC;IAGd,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,0BAAW,CAAC,CAAC,CAAA;qCACR,0BAAW;GAHhC,cAAc,CAoD1B"}
|
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:
|
@@ -1813,19 +1809,3 @@ tables:
|
|
1813
1809
|
- type: created_at
|
1814
1810
|
- type: updated_at
|
1815
1811
|
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.109",
|
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.16",
|
27
|
+
"@hedhog/pagination": "^0.0.17",
|
28
|
+
"@hedhog/prisma": "^0.0.11",
|
29
|
+
"@hedhog/utils": "^0.0.20",
|
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,9 +1,8 @@
|
|
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';
|
@@ -23,7 +22,6 @@ import { UserModule } from './user/user.module';
|
|
23
22
|
forwardRef(() => SettingModule),
|
24
23
|
forwardRef(() => LocaleModule),
|
25
24
|
forwardRef(() => UserModule),
|
26
|
-
forwardRef(() => FileModule),
|
27
25
|
],
|
28
26
|
exports: [
|
29
27
|
UserModule,
|
@@ -6,9 +6,8 @@ import {
|
|
6
6
|
Inject,
|
7
7
|
Post,
|
8
8
|
} from '@nestjs/common';
|
9
|
-
import { Role } from '
|
9
|
+
import { Role, Public } from '@hedhog/utils';
|
10
10
|
import { AuthService } from './auth.service';
|
11
|
-
import { Public } from './decorators/public.decorator';
|
12
11
|
import { User } from './decorators/user.decorator';
|
13
12
|
import { ForgetDTO } from './dto/forget.dto';
|
14
13
|
import { LoginDTO } from './dto/login.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,7 +3,6 @@ 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
6
|
export * from './auth/decorators/user.decorator';
|
8
7
|
export * from './auth/guards/auth.guard';
|
9
8
|
|
@@ -11,7 +10,6 @@ export * from './auth/guards/auth.guard';
|
|
11
10
|
export * from './menu/menu.service';
|
12
11
|
|
13
12
|
// Permission Module
|
14
|
-
export * from './role/decorators/role.decorator';
|
15
13
|
export * from './role/guards/role.guard';
|
16
14
|
export * from './role/role.service';
|
17
15
|
|
@@ -24,11 +22,3 @@ export * from './setting/setting.service';
|
|
24
22
|
// User Module
|
25
23
|
export * from './user/constants/user.constants';
|
26
24
|
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';
|
@@ -14,8 +14,8 @@ import {
|
|
14
14
|
import { User } from '../auth/decorators/user.decorator';
|
15
15
|
import { DeleteDTO } from '../dto/delete.dto';
|
16
16
|
import { UpdateIdsDTO } from '../dto/update-ids.dto';
|
17
|
-
import { Locale } from '
|
18
|
-
import { Role } from '
|
17
|
+
import { Locale } from '@hedhog/locale';
|
18
|
+
import { Role } from '@hedhog/utils';
|
19
19
|
import { CreateDTO } from './dto/create.dto';
|
20
20
|
import { OrderDTO } from './dto/order.dto';
|
21
21
|
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';
|
@@ -3,6 +3,7 @@ import {
|
|
3
3
|
Body,
|
4
4
|
Controller,
|
5
5
|
Delete,
|
6
|
+
forwardRef,
|
6
7
|
Get,
|
7
8
|
Inject,
|
8
9
|
Param,
|
@@ -10,12 +11,12 @@ import {
|
|
10
11
|
Patch,
|
11
12
|
Post,
|
12
13
|
Put,
|
13
|
-
|
14
|
+
Res,
|
14
15
|
} from '@nestjs/common';
|
16
|
+
import { Locale } from '@hedhog/locale';
|
17
|
+
import { Role, Public } from '@hedhog/utils';
|
15
18
|
import { User } from '../auth/decorators/user.decorator';
|
16
19
|
import { DeleteDTO } from '../dto/delete.dto';
|
17
|
-
import { Locale } from '../locale';
|
18
|
-
import { Role } from '../role/decorators/role.decorator';
|
19
20
|
import { CreateDTO } from './dto/create.dto';
|
20
21
|
import { SettingUserDTO } from './dto/setting-user.dto';
|
21
22
|
import { SettingDTO } from './dto/setting.dto';
|
@@ -43,6 +44,12 @@ export class SettingsController {
|
|
43
44
|
);
|
44
45
|
}
|
45
46
|
|
47
|
+
@Public()
|
48
|
+
@Get('appearance.css')
|
49
|
+
async appearanceCSS(@Res() res) {
|
50
|
+
return this.settingService.getAppearanceCSS(res);
|
51
|
+
}
|
52
|
+
|
46
53
|
@Get('group')
|
47
54
|
async listSettingGroups(@Pagination() paginationParams, @Locale() locale) {
|
48
55
|
return this.settingService.listSettingGroups(locale, paginationParams);
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { FileModule } from '@hedhog/file';
|
1
2
|
import { PaginationModule } from '@hedhog/pagination';
|
2
3
|
import { PrismaModule } from '@hedhog/prisma';
|
3
4
|
import { Module, forwardRef } from '@nestjs/common';
|
@@ -13,6 +14,7 @@ import { SettingService } from './setting.service';
|
|
13
14
|
forwardRef(() => AuthModule),
|
14
15
|
forwardRef(() => PrismaModule),
|
15
16
|
forwardRef(() => PaginationModule),
|
17
|
+
forwardRef(() => FileModule),
|
16
18
|
],
|
17
19
|
})
|
18
20
|
export class SettingModule {}
|
@@ -8,6 +8,7 @@ import {
|
|
8
8
|
Injectable,
|
9
9
|
forwardRef,
|
10
10
|
} from '@nestjs/common';
|
11
|
+
import { Response } from 'express';
|
11
12
|
import { DeleteDTO } from '../dto/delete.dto';
|
12
13
|
import { CreateDTO } from './dto/create.dto';
|
13
14
|
import { SettingDTO } from './dto/setting.dto';
|
@@ -24,6 +25,14 @@ export class SettingService {
|
|
24
25
|
private readonly fileService: FileService,
|
25
26
|
) {}
|
26
27
|
|
28
|
+
async getAppearanceCSS(res: Response) {
|
29
|
+
const fileCSS = await this.fileService.readStream(`appearance/theme.css`);
|
30
|
+
|
31
|
+
res.setHeader('Content-Type', 'text/css');
|
32
|
+
|
33
|
+
return fileCSS.pipe(res);
|
34
|
+
}
|
35
|
+
|
27
36
|
async updateAppearanceSettings() {
|
28
37
|
console.log({ updateAppearanceSettings: 'updateAppearanceSettings' });
|
29
38
|
|
@@ -35,6 +44,70 @@ export class SettingService {
|
|
35
44
|
},
|
36
45
|
});
|
37
46
|
|
47
|
+
await this.fileService.uploadFromString(
|
48
|
+
'appearance',
|
49
|
+
'theme.css',
|
50
|
+
`
|
51
|
+
@layer base {
|
52
|
+
:root {
|
53
|
+
--background: 0 0% 100%;
|
54
|
+
--foreground: 20 14.3% 4.1%;
|
55
|
+
--card: 0 0% 100%;
|
56
|
+
--card-foreground: 20 14.3% 4.1%;
|
57
|
+
--popover: 0 0% 100%;
|
58
|
+
--popover-foreground: 20 14.3% 4.1%;
|
59
|
+
--primary: 24.6 95% 53.1%;
|
60
|
+
--primary-foreground: 60 9.1% 97.8%;
|
61
|
+
--secondary: 60 4.8% 95.9%;
|
62
|
+
--secondary-foreground: 24 9.8% 10%;
|
63
|
+
--muted: 60 4.8% 95.9%;
|
64
|
+
--muted-foreground: 25 5.3% 44.7%;
|
65
|
+
--accent: 60 4.8% 95.9%;
|
66
|
+
--accent-foreground: 24 9.8% 10%;
|
67
|
+
--destructive: 0 84.2% 60.2%;
|
68
|
+
--destructive-foreground: 60 9.1% 97.8%;
|
69
|
+
--border: 20 5.9% 90%;
|
70
|
+
--input: 20 5.9% 90%;
|
71
|
+
--ring: 24.6 95% 53.1%;
|
72
|
+
--radius: 0.5rem;
|
73
|
+
--chart-1: 12 76% 61%;
|
74
|
+
--chart-2: 173 58% 39%;
|
75
|
+
--chart-3: 197 37% 24%;
|
76
|
+
--chart-4: 43 74% 66%;
|
77
|
+
--chart-5: 27 87% 67%;
|
78
|
+
}
|
79
|
+
|
80
|
+
.dark {
|
81
|
+
--background: 20 14.3% 4.1%;
|
82
|
+
--foreground: 60 9.1% 97.8%;
|
83
|
+
--card: 20 14.3% 4.1%;
|
84
|
+
--card-foreground: 60 9.1% 97.8%;
|
85
|
+
--popover: 20 14.3% 4.1%;
|
86
|
+
--popover-foreground: 60 9.1% 97.8%;
|
87
|
+
--primary: 20.5 90.2% 48.2%;
|
88
|
+
--primary-foreground: 60 9.1% 97.8%;
|
89
|
+
--secondary: 12 6.5% 15.1%;
|
90
|
+
--secondary-foreground: 60 9.1% 97.8%;
|
91
|
+
--muted: 12 6.5% 15.1%;
|
92
|
+
--muted-foreground: 24 5.4% 63.9%;
|
93
|
+
--accent: 12 6.5% 15.1%;
|
94
|
+
--accent-foreground: 60 9.1% 97.8%;
|
95
|
+
--destructive: 0 72.2% 50.6%;
|
96
|
+
--destructive-foreground: 60 9.1% 97.8%;
|
97
|
+
--border: 12 6.5% 15.1%;
|
98
|
+
--input: 12 6.5% 15.1%;
|
99
|
+
--ring: 20.5 90.2% 48.2%;
|
100
|
+
--chart-1: 220 70% 50%;
|
101
|
+
--chart-2: 160 60% 45%;
|
102
|
+
--chart-3: 30 80% 55%;
|
103
|
+
--chart-4: 280 65% 60%;
|
104
|
+
--chart-5: 340 75% 55%;
|
105
|
+
}
|
106
|
+
}
|
107
|
+
`,
|
108
|
+
'text/css',
|
109
|
+
);
|
110
|
+
|
38
111
|
console.log({ settings });
|
39
112
|
}
|
40
113
|
|
@@ -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":"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,29 +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.CreateDTO = void 0;
|
13
|
-
const class_validator_1 = require("class-validator");
|
14
|
-
class CreateDTO {
|
15
|
-
}
|
16
|
-
exports.CreateDTO = CreateDTO;
|
17
|
-
__decorate([
|
18
|
-
(0, class_validator_1.IsString)(),
|
19
|
-
__metadata("design:type", String)
|
20
|
-
], CreateDTO.prototype, "name", void 0);
|
21
|
-
__decorate([
|
22
|
-
(0, class_validator_1.IsString)(),
|
23
|
-
__metadata("design:type", String)
|
24
|
-
], CreateDTO.prototype, "code", void 0);
|
25
|
-
__decorate([
|
26
|
-
(0, class_validator_1.IsString)(),
|
27
|
-
__metadata("design:type", String)
|
28
|
-
], CreateDTO.prototype, "region", void 0);
|
29
|
-
//# sourceMappingURL=create.dto.js.map
|
@@ -1 +0,0 @@
|
|
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"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"delete.dto.d.ts","sourceRoot":"","sources":["../../../src/locale/dto/delete.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,SAAS;IAIpB,GAAG,EAAE,MAAM,EAAE,CAAC;CACf"}
|
@@ -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.DeleteDTO = void 0;
|
13
|
-
const class_validator_1 = require("class-validator");
|
14
|
-
class DeleteDTO {
|
15
|
-
}
|
16
|
-
exports.DeleteDTO = DeleteDTO;
|
17
|
-
__decorate([
|
18
|
-
(0, class_validator_1.IsArray)(),
|
19
|
-
(0, class_validator_1.ArrayMinSize)(1),
|
20
|
-
(0, class_validator_1.IsInt)({ each: true }),
|
21
|
-
__metadata("design:type", Array)
|
22
|
-
], DeleteDTO.prototype, "ids", void 0);
|
23
|
-
//# sourceMappingURL=delete.dto.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"delete.dto.js","sourceRoot":"","sources":["../../../src/locale/dto/delete.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA+D;AAE/D,MAAa,SAAS;CAKrB;AALD,8BAKC;AADC;IAHC,IAAA,yBAAO,GAAE;IACT,IAAA,8BAAY,EAAC,CAAC,CAAC;IACf,IAAA,uBAAK,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;sCACR"}
|