@hedhog/admin 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/admin.module.d.ts +3 -0
- package/dist/admin.module.d.ts.map +1 -0
- package/dist/admin.module.js +33 -0
- package/dist/admin.module.js.map +1 -0
- package/dist/auth/src/auth.controller.d.ts +21 -0
- package/dist/auth/src/auth.controller.d.ts.map +1 -0
- package/dist/auth/src/auth.controller.js +77 -0
- package/dist/auth/src/auth.controller.js.map +1 -0
- package/dist/auth/src/auth.module.d.ts +3 -0
- package/dist/auth/src/auth.module.d.ts.map +1 -0
- package/dist/auth/src/auth.module.js +50 -0
- package/dist/auth/src/auth.module.js.map +1 -0
- package/dist/auth/src/auth.service.d.ts +36 -0
- package/dist/auth/src/auth.service.d.ts.map +1 -0
- package/dist/auth/src/auth.service.js +162 -0
- package/dist/auth/src/auth.service.js.map +1 -0
- package/dist/auth/src/auth.service.spec.d.ts +2 -0
- package/dist/auth/src/auth.service.spec.d.ts.map +1 -0
- package/dist/auth/src/auth.service.spec.js +17 -0
- package/dist/auth/src/auth.service.spec.js.map +1 -0
- package/dist/auth/src/decorators/public.decorator.d.ts +3 -0
- package/dist/auth/src/decorators/public.decorator.d.ts.map +1 -0
- package/dist/auth/src/decorators/public.decorator.js +8 -0
- package/dist/auth/src/decorators/public.decorator.js.map +1 -0
- package/dist/auth/src/decorators/user.decorator.d.ts +2 -0
- package/dist/auth/src/decorators/user.decorator.d.ts.map +1 -0
- package/dist/auth/src/decorators/user.decorator.js +12 -0
- package/dist/auth/src/decorators/user.decorator.js.map +1 -0
- package/dist/auth/src/dto/forget.dto.d.ts +4 -0
- package/dist/auth/src/dto/forget.dto.d.ts.map +1 -0
- package/dist/auth/src/dto/forget.dto.js +21 -0
- package/dist/auth/src/dto/forget.dto.js.map +1 -0
- package/dist/auth/src/dto/login.dto.d.ts +5 -0
- package/dist/auth/src/dto/login.dto.d.ts.map +1 -0
- package/dist/auth/src/dto/login.dto.js +31 -0
- package/dist/auth/src/dto/login.dto.js.map +1 -0
- package/dist/auth/src/dto/otp.dto.d.ts +5 -0
- package/dist/auth/src/dto/otp.dto.d.ts.map +1 -0
- package/dist/auth/src/dto/otp.dto.js +27 -0
- package/dist/auth/src/dto/otp.dto.js.map +1 -0
- package/dist/auth/src/enums/multifactor-type.enum.d.ts +5 -0
- package/dist/auth/src/enums/multifactor-type.enum.d.ts.map +1 -0
- package/dist/auth/src/enums/multifactor-type.enum.js +9 -0
- package/dist/auth/src/enums/multifactor-type.enum.js.map +1 -0
- package/dist/auth/src/guards/auth.guard.d.ts +11 -0
- package/dist/auth/src/guards/auth.guard.d.ts.map +1 -0
- package/dist/auth/src/guards/auth.guard.js +56 -0
- package/dist/auth/src/guards/auth.guard.js.map +1 -0
- package/dist/auth/src/migrations/index.d.ts +6 -0
- package/dist/auth/src/migrations/index.d.ts.map +1 -0
- package/dist/auth/src/migrations/index.js +121 -0
- package/dist/auth/src/migrations/index.js.map +1 -0
- package/dist/auth/src/types/user.type.d.ts +9 -0
- package/dist/auth/src/types/user.type.d.ts.map +1 -0
- package/dist/auth/src/types/user.type.js +3 -0
- package/dist/auth/src/types/user.type.js.map +1 -0
- package/dist/file/src/dto/delete.dto.d.ts +4 -0
- package/dist/file/src/dto/delete.dto.d.ts.map +1 -0
- package/dist/file/src/dto/delete.dto.js +23 -0
- package/dist/file/src/dto/delete.dto.js.map +1 -0
- package/dist/file/src/file.module.d.ts +3 -0
- package/dist/file/src/file.module.d.ts.map +1 -0
- package/dist/file/src/file.module.js +29 -0
- package/dist/file/src/file.module.js.map +1 -0
- package/dist/file/src/file.service.d.ts +12 -0
- package/dist/file/src/file.service.d.ts.map +1 -0
- package/dist/file/src/file.service.js +59 -0
- package/dist/file/src/file.service.js.map +1 -0
- package/dist/file/src/migrations/index.d.ts +6 -0
- package/dist/file/src/migrations/index.d.ts.map +1 -0
- package/dist/file/src/migrations/index.js +137 -0
- package/dist/file/src/migrations/index.js.map +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -0
- package/dist/mail/src/enums/mail-configuration-type.enum.d.ts +6 -0
- package/dist/mail/src/enums/mail-configuration-type.enum.d.ts.map +1 -0
- package/dist/mail/src/enums/mail-configuration-type.enum.js +10 -0
- package/dist/mail/src/enums/mail-configuration-type.enum.js.map +1 -0
- package/dist/mail/src/interfaces/index.d.ts +3 -0
- package/dist/mail/src/interfaces/index.d.ts.map +1 -0
- package/dist/mail/src/interfaces/index.js +19 -0
- package/dist/mail/src/interfaces/index.js.map +1 -0
- package/dist/mail/src/interfaces/mail-module-options.interface.d.ts +32 -0
- package/dist/mail/src/interfaces/mail-module-options.interface.d.ts.map +1 -0
- package/dist/mail/src/interfaces/mail-module-options.interface.js +3 -0
- package/dist/mail/src/interfaces/mail-module-options.interface.js.map +1 -0
- package/dist/mail/src/interfaces/mail-type.d.ts +13 -0
- package/dist/mail/src/interfaces/mail-type.d.ts.map +1 -0
- package/dist/mail/src/interfaces/mail-type.js +3 -0
- package/dist/mail/src/interfaces/mail-type.js.map +1 -0
- package/dist/mail/src/mail.consts.d.ts +17 -0
- package/dist/mail/src/mail.consts.d.ts.map +1 -0
- package/dist/mail/src/mail.consts.js +5 -0
- package/dist/mail/src/mail.consts.js.map +1 -0
- package/dist/mail/src/mail.module.d.ts +8 -0
- package/dist/mail/src/mail.module.d.ts.map +1 -0
- package/dist/mail/src/mail.module.js +51 -0
- package/dist/mail/src/mail.module.js.map +1 -0
- package/dist/mail/src/mail.service.d.ts +14 -0
- package/dist/mail/src/mail.service.d.ts.map +1 -0
- package/dist/mail/src/mail.service.js +281 -0
- package/dist/mail/src/mail.service.js.map +1 -0
- package/dist/mail/src/mail.service.spec.d.ts +2 -0
- package/dist/mail/src/mail.service.spec.d.ts.map +1 -0
- package/dist/mail/src/mail.service.spec.js +17 -0
- package/dist/mail/src/mail.service.spec.js.map +1 -0
- package/dist/menu/src/dto/create.dto.d.ts +8 -0
- package/dist/menu/src/dto/create.dto.d.ts.map +1 -0
- package/dist/menu/src/dto/create.dto.js +44 -0
- package/dist/menu/src/dto/create.dto.js.map +1 -0
- package/dist/menu/src/dto/delete.dto.d.ts +4 -0
- package/dist/menu/src/dto/delete.dto.d.ts.map +1 -0
- package/dist/menu/src/dto/delete.dto.js +24 -0
- package/dist/menu/src/dto/delete.dto.js.map +1 -0
- package/dist/menu/src/dto/order.dto.d.ts +4 -0
- package/dist/menu/src/dto/order.dto.d.ts.map +1 -0
- package/dist/menu/src/dto/order.dto.js +23 -0
- package/dist/menu/src/dto/order.dto.js.map +1 -0
- package/dist/menu/src/dto/update.dto.d.ts +7 -0
- package/dist/menu/src/dto/update.dto.d.ts.map +1 -0
- package/dist/menu/src/dto/update.dto.js +37 -0
- package/dist/menu/src/dto/update.dto.js.map +1 -0
- package/dist/menu/src/menu.controller.d.ts +19 -0
- package/dist/menu/src/menu.controller.d.ts.map +1 -0
- package/dist/menu/src/menu.controller.js +117 -0
- package/dist/menu/src/menu.controller.js.map +1 -0
- package/dist/menu/src/menu.module.d.ts +3 -0
- package/dist/menu/src/menu.module.d.ts.map +1 -0
- package/dist/menu/src/menu.module.js +31 -0
- package/dist/menu/src/menu.module.js.map +1 -0
- package/dist/menu/src/menu.service.d.ts +23 -0
- package/dist/menu/src/menu.service.d.ts.map +1 -0
- package/dist/menu/src/menu.service.js +117 -0
- package/dist/menu/src/menu.service.js.map +1 -0
- package/dist/menu/src/migrations/index.d.ts +7 -0
- package/dist/menu/src/migrations/index.d.ts.map +1 -0
- package/dist/menu/src/migrations/index.js +101 -0
- package/dist/menu/src/migrations/index.js.map +1 -0
- package/dist/migrations/1726795702341-migrate.d.ts +6 -0
- package/dist/migrations/1726795702341-migrate.d.ts.map +1 -0
- package/dist/migrations/1726795702341-migrate.js +121 -0
- package/dist/migrations/1726795702341-migrate.js.map +1 -0
- package/dist/migrations/1726795734665-migrate.d.ts +6 -0
- package/dist/migrations/1726795734665-migrate.d.ts.map +1 -0
- package/dist/migrations/1726795734665-migrate.js +40 -0
- package/dist/migrations/1726795734665-migrate.js.map +1 -0
- package/dist/migrations/1726795818403-migrate.d.ts +7 -0
- package/dist/migrations/1726795818403-migrate.d.ts.map +1 -0
- package/dist/migrations/1726795818403-migrate.js +101 -0
- package/dist/migrations/1726795818403-migrate.js.map +1 -0
- package/dist/migrations/1726795828359-migrate.d.ts +6 -0
- package/dist/migrations/1726795828359-migrate.d.ts.map +1 -0
- package/dist/migrations/1726795828359-migrate.js +525 -0
- package/dist/migrations/1726795828359-migrate.js.map +1 -0
- package/dist/permission/src/decorators/permission.decorator.d.ts +3 -0
- package/dist/permission/src/decorators/permission.decorator.d.ts.map +1 -0
- package/dist/permission/src/decorators/permission.decorator.js +8 -0
- package/dist/permission/src/decorators/permission.decorator.js.map +1 -0
- package/dist/permission/src/dto/create.dto.d.ts +5 -0
- package/dist/permission/src/dto/create.dto.d.ts.map +1 -0
- package/dist/permission/src/dto/create.dto.js +27 -0
- package/dist/permission/src/dto/create.dto.js.map +1 -0
- package/dist/permission/src/dto/delete.dto.d.ts +4 -0
- package/dist/permission/src/dto/delete.dto.d.ts.map +1 -0
- package/dist/permission/src/dto/delete.dto.js +23 -0
- package/dist/permission/src/dto/delete.dto.js.map +1 -0
- package/dist/permission/src/dto/update.dto.d.ts +5 -0
- package/dist/permission/src/dto/update.dto.d.ts.map +1 -0
- package/dist/permission/src/dto/update.dto.js +27 -0
- package/dist/permission/src/dto/update.dto.js.map +1 -0
- package/dist/permission/src/guards/permission.guard.d.ts +11 -0
- package/dist/permission/src/guards/permission.guard.d.ts.map +1 -0
- package/dist/permission/src/guards/permission.guard.js +99 -0
- package/dist/permission/src/guards/permission.guard.js.map +1 -0
- package/dist/permission/src/migrations/index.d.ts +6 -0
- package/dist/permission/src/migrations/index.d.ts.map +1 -0
- package/dist/permission/src/migrations/index.js +520 -0
- package/dist/permission/src/migrations/index.js.map +1 -0
- package/dist/permission/src/permission.controller.d.ts +14 -0
- package/dist/permission/src/permission.controller.d.ts.map +1 -0
- package/dist/permission/src/permission.controller.js +95 -0
- package/dist/permission/src/permission.controller.js.map +1 -0
- package/dist/permission/src/permission.module.d.ts +3 -0
- package/dist/permission/src/permission.module.d.ts.map +1 -0
- package/dist/permission/src/permission.module.js +39 -0
- package/dist/permission/src/permission.module.js.map +1 -0
- package/dist/permission/src/permission.service.d.ts +19 -0
- package/dist/permission/src/permission.service.d.ts.map +1 -0
- package/dist/permission/src/permission.service.js +73 -0
- package/dist/permission/src/permission.service.js.map +1 -0
- package/dist/permission/src/types/permission.types.d.ts +33 -0
- package/dist/permission/src/types/permission.types.d.ts.map +1 -0
- package/dist/permission/src/types/permission.types.js +3 -0
- package/dist/permission/src/types/permission.types.js.map +1 -0
- package/dist/screen/src/dto/create.dto.d.ts +7 -0
- package/dist/screen/src/dto/create.dto.d.ts.map +1 -0
- package/dist/screen/src/dto/create.dto.js +37 -0
- package/dist/screen/src/dto/create.dto.js.map +1 -0
- package/dist/screen/src/dto/delete.dto.d.ts +4 -0
- package/dist/screen/src/dto/delete.dto.d.ts.map +1 -0
- package/dist/screen/src/dto/delete.dto.js +23 -0
- package/dist/screen/src/dto/delete.dto.js.map +1 -0
- package/dist/screen/src/dto/update.dto.d.ts +7 -0
- package/dist/screen/src/dto/update.dto.d.ts.map +1 -0
- package/dist/screen/src/dto/update.dto.js +37 -0
- package/dist/screen/src/dto/update.dto.js.map +1 -0
- package/dist/screen/src/migrations/index.d.ts +6 -0
- package/dist/screen/src/migrations/index.d.ts.map +1 -0
- package/dist/screen/src/migrations/index.js +40 -0
- package/dist/screen/src/migrations/index.js.map +1 -0
- package/dist/screen/src/screen.controller.d.ts +14 -0
- package/dist/screen/src/screen.controller.d.ts.map +1 -0
- package/dist/screen/src/screen.controller.js +94 -0
- package/dist/screen/src/screen.controller.js.map +1 -0
- package/dist/screen/src/screen.module.d.ts +3 -0
- package/dist/screen/src/screen.module.d.ts.map +1 -0
- package/dist/screen/src/screen.module.js +31 -0
- package/dist/screen/src/screen.module.js.map +1 -0
- package/dist/screen/src/screen.service.d.ts +19 -0
- package/dist/screen/src/screen.service.d.ts.map +1 -0
- package/dist/screen/src/screen.service.js +73 -0
- package/dist/screen/src/screen.service.js.map +1 -0
- package/dist/setting/src/dto/create.dto.d.ts +4 -0
- package/dist/setting/src/dto/create.dto.d.ts.map +1 -0
- package/dist/setting/src/dto/create.dto.js +22 -0
- package/dist/setting/src/dto/create.dto.js.map +1 -0
- package/dist/setting/src/dto/delete.dto.d.ts +4 -0
- package/dist/setting/src/dto/delete.dto.d.ts.map +1 -0
- package/dist/setting/src/dto/delete.dto.js +23 -0
- package/dist/setting/src/dto/delete.dto.js.map +1 -0
- package/dist/setting/src/dto/update.dto.d.ts +4 -0
- package/dist/setting/src/dto/update.dto.d.ts.map +1 -0
- package/dist/setting/src/dto/update.dto.js +8 -0
- package/dist/setting/src/dto/update.dto.js.map +1 -0
- package/dist/setting/src/migrations/index.d.ts +6 -0
- package/dist/setting/src/migrations/index.d.ts.map +1 -0
- package/dist/setting/src/migrations/index.js +67 -0
- package/dist/setting/src/migrations/index.js.map +1 -0
- package/dist/setting/src/settings.controller.d.ts +14 -0
- package/dist/setting/src/settings.controller.d.ts.map +1 -0
- package/dist/setting/src/settings.controller.js +94 -0
- package/dist/setting/src/settings.controller.js.map +1 -0
- package/dist/setting/src/settings.module.d.ts +3 -0
- package/dist/setting/src/settings.module.d.ts.map +1 -0
- package/dist/setting/src/settings.module.js +31 -0
- package/dist/setting/src/settings.module.js.map +1 -0
- package/dist/setting/src/settings.service.d.ts +19 -0
- package/dist/setting/src/settings.service.d.ts.map +1 -0
- package/dist/setting/src/settings.service.js +70 -0
- package/dist/setting/src/settings.service.js.map +1 -0
- package/dist/user/src/constants/user.constants.d.ts +2 -0
- package/dist/user/src/constants/user.constants.d.ts.map +1 -0
- package/dist/user/src/constants/user.constants.js +5 -0
- package/dist/user/src/constants/user.constants.js.map +1 -0
- package/dist/user/src/dto/create.dto.d.ts +6 -0
- package/dist/user/src/dto/create.dto.d.ts.map +1 -0
- package/dist/user/src/dto/create.dto.js +37 -0
- package/dist/user/src/dto/create.dto.js.map +1 -0
- package/dist/user/src/dto/delete.dto.d.ts +4 -0
- package/dist/user/src/dto/delete.dto.d.ts.map +1 -0
- package/dist/user/src/dto/delete.dto.js +23 -0
- package/dist/user/src/dto/delete.dto.js.map +1 -0
- package/dist/user/src/dto/update.dto.d.ts +8 -0
- package/dist/user/src/dto/update.dto.d.ts.map +1 -0
- package/dist/user/src/dto/update.dto.js +50 -0
- package/dist/user/src/dto/update.dto.js.map +1 -0
- package/dist/user/src/user.controller.d.ts +14 -0
- package/dist/user/src/user.controller.d.ts.map +1 -0
- package/dist/user/src/user.controller.js +94 -0
- package/dist/user/src/user.controller.js.map +1 -0
- package/dist/user/src/user.module.d.ts +3 -0
- package/dist/user/src/user.module.d.ts.map +1 -0
- package/dist/user/src/user.module.js +31 -0
- package/dist/user/src/user.module.js.map +1 -0
- package/dist/user/src/user.service.d.ts +20 -0
- package/dist/user/src/user.service.d.ts.map +1 -0
- package/dist/user/src/user.service.js +84 -0
- package/dist/user/src/user.service.js.map +1 -0
- package/dist/user/src/user.service.spec.d.ts +2 -0
- package/dist/user/src/user.service.spec.d.ts.map +1 -0
- package/dist/user/src/user.service.spec.js +17 -0
- package/dist/user/src/user.service.spec.js.map +1 -0
- package/package.json +29 -0
- package/src/mail/src/mail.template.ejs +1 -0
- package/src/migrations/1726795702341-migrate.ts +107 -0
- package/src/migrations/1726795734665-migrate.ts +40 -0
- package/src/migrations/1726795818403-migrate.ts +161 -0
- package/src/migrations/1726795828359-migrate.ts +573 -0
@@ -0,0 +1,101 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Migrate = void 0;
|
4
|
+
const typeorm_1 = require("typeorm");
|
5
|
+
const utils_1 = require("@hedhog/utils");
|
6
|
+
class Migrate {
|
7
|
+
async up(queryRunner) {
|
8
|
+
await queryRunner.createTable(new typeorm_1.Table({
|
9
|
+
name: 'menus',
|
10
|
+
columns: [
|
11
|
+
(0, utils_1.idColumn)(),
|
12
|
+
{
|
13
|
+
name: 'name',
|
14
|
+
type: 'varchar',
|
15
|
+
},
|
16
|
+
{
|
17
|
+
name: 'url',
|
18
|
+
type: 'varchar',
|
19
|
+
isNullable: true,
|
20
|
+
},
|
21
|
+
{
|
22
|
+
name: 'order',
|
23
|
+
type: 'int',
|
24
|
+
default: 0,
|
25
|
+
unsigned: true,
|
26
|
+
},
|
27
|
+
{
|
28
|
+
name: 'menu_id',
|
29
|
+
type: 'int',
|
30
|
+
isNullable: true,
|
31
|
+
unsigned: true,
|
32
|
+
},
|
33
|
+
{
|
34
|
+
name: 'icon',
|
35
|
+
type: 'varchar',
|
36
|
+
isNullable: true,
|
37
|
+
},
|
38
|
+
(0, utils_1.timestampColumn)(),
|
39
|
+
(0, utils_1.timestampColumn)('updated_at'),
|
40
|
+
],
|
41
|
+
}));
|
42
|
+
await queryRunner.createTable(new typeorm_1.Table({
|
43
|
+
name: 'menu_screens',
|
44
|
+
columns: [
|
45
|
+
{
|
46
|
+
name: 'menu_id',
|
47
|
+
type: 'int',
|
48
|
+
isPrimary: true,
|
49
|
+
unsigned: true,
|
50
|
+
},
|
51
|
+
{
|
52
|
+
name: 'screen_id',
|
53
|
+
type: 'int',
|
54
|
+
isPrimary: true,
|
55
|
+
unsigned: true,
|
56
|
+
},
|
57
|
+
],
|
58
|
+
}));
|
59
|
+
await queryRunner.createForeignKey('menu_screens', new typeorm_1.TableForeignKey({
|
60
|
+
columnNames: ['menu_id'],
|
61
|
+
referencedColumnNames: ['id'],
|
62
|
+
referencedTableName: 'menus',
|
63
|
+
onDelete: 'CASCADE',
|
64
|
+
}));
|
65
|
+
await queryRunner.createForeignKey('menu_screens', new typeorm_1.TableForeignKey({
|
66
|
+
columnNames: ['screen_id'],
|
67
|
+
referencedColumnNames: ['id'],
|
68
|
+
referencedTableName: 'screens',
|
69
|
+
onDelete: 'CASCADE',
|
70
|
+
}));
|
71
|
+
//System Populating
|
72
|
+
await this.insertMenu(queryRunner, 'Dashboard', '/', 0, null, 'dashboard');
|
73
|
+
const managementId = await this.insertMenu(queryRunner, 'Management', null, 1, null, 'settings');
|
74
|
+
await this.insertMenu(queryRunner, 'Users', '/management/users', 0, managementId, 'users');
|
75
|
+
await this.insertMenu(queryRunner, 'Roles', '/management/roles', 1, managementId, 'circles');
|
76
|
+
await this.insertMenu(queryRunner, 'Screens', '/management/screens', 2, managementId, 'monitor');
|
77
|
+
await this.insertMenu(queryRunner, 'Menus', '/management/menus', 3, managementId, 'menu');
|
78
|
+
}
|
79
|
+
async insertMenu(queryRunner, name, url, order, menuId, icon) {
|
80
|
+
const result = await queryRunner.manager
|
81
|
+
.createQueryBuilder()
|
82
|
+
.insert()
|
83
|
+
.into('menus')
|
84
|
+
.values({
|
85
|
+
name,
|
86
|
+
url,
|
87
|
+
order,
|
88
|
+
menu_id: menuId,
|
89
|
+
icon,
|
90
|
+
})
|
91
|
+
.returning('id')
|
92
|
+
.execute();
|
93
|
+
return result.raw[0].id;
|
94
|
+
}
|
95
|
+
async down(queryRunner) {
|
96
|
+
await queryRunner.dropTable('menu_screens');
|
97
|
+
await queryRunner.dropTable('menus');
|
98
|
+
}
|
99
|
+
}
|
100
|
+
exports.Migrate = Migrate;
|
101
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/menu/src/migrations/index.ts"],"names":[],"mappings":";;;AAAA,qCAKiB;AACjB,yCAA0D;AAE1D,MAAa,OAAO;IACX,KAAK,CAAC,EAAE,CAAC,WAAwB;QACtC,MAAM,WAAW,CAAC,WAAW,CAC3B,IAAI,eAAK,CAAC;YACR,IAAI,EAAE,OAAO;YACb,OAAO,EAAE;gBACP,IAAA,gBAAQ,GAAE;gBACV;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,SAAS;iBAChB;gBACD;oBACE,IAAI,EAAE,K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AC,cAAc,CAAC,CAAC;QAC5C,MAAM,WAAW,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;CACF;AAxJD,0BAwJC"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { MigrationInterface, QueryRunner } from "typeorm";
|
2
|
+
export declare class Migrate1726795702341 implements MigrationInterface {
|
3
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
4
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
5
|
+
}
|
6
|
+
//# sourceMappingURL=1726795702341-migrate.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"1726795702341-migrate.d.ts","sourceRoot":"","sources":["../../src/migrations/1726795702341-migrate.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,WAAW,EAGZ,MAAM,SAAS,CAAC;AAIjB,qBAAa,oBAAqB,YAAW,kBAAkB;IACvD,EAAE,CAAC,WAAW,EAAE,WAAW;IA4F3B,IAAI,CAAC,WAAW,EAAE,WAAW;CAIpC"}
|
@@ -0,0 +1,121 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
+
if (mod && mod.__esModule) return mod;
|
20
|
+
var result = {};
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
+
__setModuleDefault(result, mod);
|
23
|
+
return result;
|
24
|
+
};
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
+
exports.Migrate1726795702341 = void 0;
|
27
|
+
const typeorm_1 = require("typeorm");
|
28
|
+
const utils_1 = require("@hedhog/utils");
|
29
|
+
const bcrypt = __importStar(require("bcrypt"));
|
30
|
+
class Migrate1726795702341 {
|
31
|
+
async up(queryRunner) {
|
32
|
+
await queryRunner.createTable(new typeorm_1.Table({
|
33
|
+
name: "multifactors",
|
34
|
+
columns: [
|
35
|
+
(0, utils_1.idColumn)(),
|
36
|
+
{
|
37
|
+
name: "name",
|
38
|
+
type: "varchar",
|
39
|
+
},
|
40
|
+
(0, utils_1.timestampColumn)(),
|
41
|
+
(0, utils_1.timestampColumn)("updated_at"),
|
42
|
+
],
|
43
|
+
}));
|
44
|
+
await queryRunner.manager
|
45
|
+
.createQueryBuilder()
|
46
|
+
.insert()
|
47
|
+
.into("multifactors", ["name"])
|
48
|
+
.values([
|
49
|
+
{
|
50
|
+
name: "Email",
|
51
|
+
},
|
52
|
+
{
|
53
|
+
name: "Applicativo",
|
54
|
+
},
|
55
|
+
])
|
56
|
+
.execute();
|
57
|
+
await queryRunner.createTable(new typeorm_1.Table({
|
58
|
+
name: "users",
|
59
|
+
columns: [
|
60
|
+
(0, utils_1.idColumn)(),
|
61
|
+
{
|
62
|
+
name: "name",
|
63
|
+
type: "varchar",
|
64
|
+
},
|
65
|
+
{
|
66
|
+
name: "email",
|
67
|
+
type: "varchar",
|
68
|
+
},
|
69
|
+
{
|
70
|
+
name: "password",
|
71
|
+
type: "varchar",
|
72
|
+
},
|
73
|
+
{
|
74
|
+
name: "multifactor_id",
|
75
|
+
type: "int",
|
76
|
+
isNullable: true,
|
77
|
+
unsigned: true,
|
78
|
+
},
|
79
|
+
{
|
80
|
+
name: "code",
|
81
|
+
type: "varchar",
|
82
|
+
isNullable: true,
|
83
|
+
},
|
84
|
+
(0, utils_1.timestampColumn)(),
|
85
|
+
(0, utils_1.timestampColumn)("updated_at"),
|
86
|
+
],
|
87
|
+
}));
|
88
|
+
await queryRunner.createForeignKeys("users", [
|
89
|
+
new typeorm_1.TableForeignKey({
|
90
|
+
columnNames: ["multifactor_id"],
|
91
|
+
referencedColumnNames: ["id"],
|
92
|
+
referencedTableName: "multifactors",
|
93
|
+
name: "fk_users_to_multifactors_on_multifactor_id",
|
94
|
+
onDelete: "Cascade",
|
95
|
+
}),
|
96
|
+
]);
|
97
|
+
await queryRunner.manager
|
98
|
+
.createQueryBuilder()
|
99
|
+
.insert()
|
100
|
+
.into("users", ["name", "email", "password"])
|
101
|
+
.values([
|
102
|
+
{
|
103
|
+
name: "Superuser",
|
104
|
+
email: "root@hedhog.com",
|
105
|
+
password: await bcrypt.hash(`hedhog`, 12),
|
106
|
+
},
|
107
|
+
{
|
108
|
+
name: "User",
|
109
|
+
email: "user@hedhog.com",
|
110
|
+
password: await bcrypt.hash(`hedhog`, 12),
|
111
|
+
},
|
112
|
+
])
|
113
|
+
.execute();
|
114
|
+
}
|
115
|
+
async down(queryRunner) {
|
116
|
+
await queryRunner.dropTable("multifactors");
|
117
|
+
await queryRunner.dropTable("users");
|
118
|
+
}
|
119
|
+
}
|
120
|
+
exports.Migrate1726795702341 = Migrate1726795702341;
|
121
|
+
//# sourceMappingURL=1726795702341-migrate.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"1726795702341-migrate.js","sourceRoot":"","sources":["../../src/migrations/1726795702341-migrate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAKiB;AACjB,yCAA0D;AAC1D,+CAAiC;AAEjC,MAAa,oBAAoB;IAC/B,KAAK,CAAC,EAAE,CAAC,W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gBAAgB,CAAC;gBAC/B,qBAAqB,EAAE,CAAC,IAAI,CAAC;gBAC7B,mBAAmB,EAAE,cAAc;gBACnC,IAAI,EAAE,4CAA4C;gBAClD,QAAQ,EAAE,SAAS;aACpB,CAAC;SACH,CAAC,CAAC;QAEH,MAAM,WAAW,CAAC,OAAO;aACtB,kBAAkB,EAAE;aACpB,MAAM,EAAE;aACR,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;aAC5C,MAAM,CAAC;YACN;gBACE,IAAI,EAAE,WAAW;gBACjB,KAAK,EAAE,iBAAiB;gBACxB,QAAQ,EAAE,MAAM,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC;aAC1C;YACD;gBACE,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE,iBAAiB;gBACxB,QAAQ,EAAE,MAAM,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC;aAC1C;SACF,CAAC;aACD,OAAO,EAAE,CAAC;IACf,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,WAAwB;QACjC,MAAM,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;QAC5C,MAAM,WAAW,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;CACF;AAjGD,oDAiGC"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { MigrationInterface, QueryRunner } from "typeorm";
|
2
|
+
export declare class Migrate1726795734665 implements MigrationInterface {
|
3
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
4
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
5
|
+
}
|
6
|
+
//# sourceMappingURL=1726795734665-migrate.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"1726795734665-migrate.d.ts","sourceRoot":"","sources":["../../src/migrations/1726795734665-migrate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAS,MAAM,SAAS,CAAC;AAEjE,qBAAa,oBAAqB,YAAW,kBAAkB;IACvD,EAAE,CAAC,WAAW,EAAE,WAAW;IA+B3B,IAAI,CAAC,WAAW,EAAE,WAAW;CAGpC"}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Migrate1726795734665 = void 0;
|
4
|
+
const utils_1 = require("@hedhog/utils");
|
5
|
+
const typeorm_1 = require("typeorm");
|
6
|
+
class Migrate1726795734665 {
|
7
|
+
async up(queryRunner) {
|
8
|
+
await queryRunner.createTable(new typeorm_1.Table({
|
9
|
+
name: "screens",
|
10
|
+
columns: [
|
11
|
+
(0, utils_1.idColumn)(),
|
12
|
+
{
|
13
|
+
name: "name",
|
14
|
+
type: "varchar",
|
15
|
+
},
|
16
|
+
{
|
17
|
+
name: "slug",
|
18
|
+
type: "varchar",
|
19
|
+
isUnique: true,
|
20
|
+
},
|
21
|
+
{
|
22
|
+
name: "description",
|
23
|
+
type: "varchar",
|
24
|
+
},
|
25
|
+
{
|
26
|
+
name: "icon",
|
27
|
+
type: "varchar",
|
28
|
+
isNullable: true,
|
29
|
+
},
|
30
|
+
(0, utils_1.timestampColumn)(),
|
31
|
+
(0, utils_1.timestampColumn)("updated_at"),
|
32
|
+
],
|
33
|
+
}));
|
34
|
+
}
|
35
|
+
async down(queryRunner) {
|
36
|
+
await queryRunner.dropTable("screens");
|
37
|
+
}
|
38
|
+
}
|
39
|
+
exports.Migrate1726795734665 = Migrate1726795734665;
|
40
|
+
//# sourceMappingURL=1726795734665-migrate.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"1726795734665-migrate.js","sourceRoot":"","sources":["../../src/migrations/1726795734665-migrate.ts"],"names":[],"mappings":";;;AAAA,yCAA0D;AAE1D,qCAAiE;AAEjE,MAAa,oBAAoB;IAC/B,KAAK,CAAC,EAAE,CAAC,WAAwB;QAC/B,MAAM,WAAW,CAAC,WAAW,CAC3B,IAAI,eAAK,CAAC;YACR,IAAI,EAAE,SAAS;YACf,OAAO,EAAE;gBACP,IAAA,gBAAQ,GAAE;gBACV;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,SAAS;iBAChB;gBACD;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,SAAS;oBACf,QAAQ,EAAE,IAAI;iBACf;gBACD;oBACE,IAAI,EAAE,aAAa;oBACnB,IAAI,EAAE,SAAS;iBAChB;gBACD;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,SAAS;oBACf,UAAU,EAAE,IAAI;iBACjB;gBACD,IAAA,uBAAe,GAAE;gBACjB,IAAA,uBAAe,EAAC,YAAY,CAAC;aAC9B;SACF,CAAC,CACH,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,WAAwB;QACjC,MAAM,WAAW,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;CACF;AAnCD,oDAmCC"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { MigrationInterface, QueryRunner } from "typeorm";
|
2
|
+
export declare class Migrate1726795818403 implements MigrationInterface {
|
3
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
4
|
+
private insertMenu;
|
5
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
6
|
+
}
|
7
|
+
//# sourceMappingURL=1726795818403-migrate.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"1726795818403-migrate.d.ts","sourceRoot":"","sources":["../../src/migrations/1726795818403-migrate.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,WAAW,EAGZ,MAAM,SAAS,CAAC;AAGjB,qBAAa,oBAAqB,YAAW,kBAAkB;IAChD,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;YA0H1C,UAAU;IAyBX,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAI3D"}
|
@@ -0,0 +1,101 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Migrate1726795818403 = void 0;
|
4
|
+
const typeorm_1 = require("typeorm");
|
5
|
+
const utils_1 = require("@hedhog/utils");
|
6
|
+
class Migrate1726795818403 {
|
7
|
+
async up(queryRunner) {
|
8
|
+
await queryRunner.createTable(new typeorm_1.Table({
|
9
|
+
name: "menus",
|
10
|
+
columns: [
|
11
|
+
(0, utils_1.idColumn)(),
|
12
|
+
{
|
13
|
+
name: "name",
|
14
|
+
type: "varchar",
|
15
|
+
},
|
16
|
+
{
|
17
|
+
name: "url",
|
18
|
+
type: "varchar",
|
19
|
+
isNullable: true,
|
20
|
+
},
|
21
|
+
{
|
22
|
+
name: "order",
|
23
|
+
type: "int",
|
24
|
+
default: 0,
|
25
|
+
unsigned: true,
|
26
|
+
},
|
27
|
+
{
|
28
|
+
name: "menu_id",
|
29
|
+
type: "int",
|
30
|
+
isNullable: true,
|
31
|
+
unsigned: true,
|
32
|
+
},
|
33
|
+
{
|
34
|
+
name: "icon",
|
35
|
+
type: "varchar",
|
36
|
+
isNullable: true,
|
37
|
+
},
|
38
|
+
(0, utils_1.timestampColumn)(),
|
39
|
+
(0, utils_1.timestampColumn)("updated_at"),
|
40
|
+
],
|
41
|
+
}));
|
42
|
+
await queryRunner.createTable(new typeorm_1.Table({
|
43
|
+
name: "menu_screens",
|
44
|
+
columns: [
|
45
|
+
{
|
46
|
+
name: "menu_id",
|
47
|
+
type: "int",
|
48
|
+
isPrimary: true,
|
49
|
+
unsigned: true,
|
50
|
+
},
|
51
|
+
{
|
52
|
+
name: "screen_id",
|
53
|
+
type: "int",
|
54
|
+
isPrimary: true,
|
55
|
+
unsigned: true,
|
56
|
+
},
|
57
|
+
],
|
58
|
+
}));
|
59
|
+
await queryRunner.createForeignKey("menu_screens", new typeorm_1.TableForeignKey({
|
60
|
+
columnNames: ["menu_id"],
|
61
|
+
referencedColumnNames: ["id"],
|
62
|
+
referencedTableName: "menus",
|
63
|
+
onDelete: "CASCADE",
|
64
|
+
}));
|
65
|
+
await queryRunner.createForeignKey("menu_screens", new typeorm_1.TableForeignKey({
|
66
|
+
columnNames: ["screen_id"],
|
67
|
+
referencedColumnNames: ["id"],
|
68
|
+
referencedTableName: "screens",
|
69
|
+
onDelete: "CASCADE",
|
70
|
+
}));
|
71
|
+
//System Populating
|
72
|
+
await this.insertMenu(queryRunner, "Dashboard", "/", 0, null, "dashboard");
|
73
|
+
const managementId = await this.insertMenu(queryRunner, "Management", null, 1, null, "settings");
|
74
|
+
await this.insertMenu(queryRunner, "Users", "/management/users", 0, managementId, "users");
|
75
|
+
await this.insertMenu(queryRunner, "Roles", "/management/roles", 1, managementId, "circles");
|
76
|
+
await this.insertMenu(queryRunner, "Screens", "/management/screens", 2, managementId, "screem");
|
77
|
+
await this.insertMenu(queryRunner, "Menus", "/management/menus", 3, managementId, "menu");
|
78
|
+
}
|
79
|
+
async insertMenu(queryRunner, name, url, order, menuId, icon) {
|
80
|
+
const result = await queryRunner.manager
|
81
|
+
.createQueryBuilder()
|
82
|
+
.insert()
|
83
|
+
.into("menus")
|
84
|
+
.values({
|
85
|
+
name,
|
86
|
+
url,
|
87
|
+
order,
|
88
|
+
menu_id: menuId,
|
89
|
+
icon,
|
90
|
+
})
|
91
|
+
.returning("id")
|
92
|
+
.execute();
|
93
|
+
return result.raw[0].id;
|
94
|
+
}
|
95
|
+
async down(queryRunner) {
|
96
|
+
await queryRunner.dropTable("menu_screens");
|
97
|
+
await queryRunner.dropTable("menus");
|
98
|
+
}
|
99
|
+
}
|
100
|
+
exports.Migrate1726795818403 = Migrate1726795818403;
|
101
|
+
//# sourceMappingURL=1726795818403-migrate.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"1726795818403-migrate.js","sourceRoot":"","sources":["../../src/migrations/1726795818403-migrate.ts"],"names":[],"mappings":";;;AAAA,qCA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AM,CAAC;YACN,IAAI;YACJ,GAAG;YACH,KAAK;YACL,OAAO,EAAE,MAAM;YACf,IAAI;SACL,CAAC;aACD,SAAS,CAAC,IAAI,CAAC;aACf,OAAO,EAAE,CAAC;QAEb,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1B,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACxC,MAAM,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;QAC5C,MAAM,WAAW,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;CACF;AAxJD,oDAwJC"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm';
|
2
|
+
export declare class Migrate1726795828359 implements MigrationInterface {
|
3
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
4
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
5
|
+
}
|
6
|
+
//# sourceMappingURL=1726795828359-migrate.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"1726795828359-migrate.d.ts","sourceRoot":"","sources":["../../src/migrations/1726795828359-migrate.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,kBAAkB,EAClB,WAAW,EAIZ,MAAM,SAAS,CAAC;AAEjB,qBAAa,oBAAqB,YAAW,kBAAkB;IACvD,EAAE,CAAC,WAAW,EAAE,WAAW;IA0hB3B,IAAI,CAAC,WAAW,EAAE,WAAW;CAuBpC"}
|