@hedhog/admin 0.0.37 → 0.0.39
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 +2 -0
- package/dist/admin.module.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/locale/dto/create.dto.d.ts +7 -0
- package/dist/locale/dto/create.dto.d.ts.map +1 -0
- package/dist/locale/dto/create.dto.js +33 -0
- package/dist/locale/dto/create.dto.js.map +1 -0
- package/dist/locale/dto/delete.dto.d.ts +4 -0
- package/dist/locale/dto/delete.dto.d.ts.map +1 -0
- package/dist/locale/dto/delete.dto.js +23 -0
- package/dist/locale/dto/delete.dto.js.map +1 -0
- package/dist/locale/dto/update.dto.d.ts +7 -0
- package/dist/locale/dto/update.dto.d.ts.map +1 -0
- package/dist/locale/dto/update.dto.js +37 -0
- package/dist/locale/dto/update.dto.js.map +1 -0
- package/dist/locale/index.d.ts +5 -0
- package/dist/locale/index.d.ts.map +1 -0
- package/dist/locale/index.js +21 -0
- package/dist/locale/index.js.map +1 -0
- package/dist/locale/locale.controller.d.ts +16 -0
- package/dist/locale/locale.controller.d.ts.map +1 -0
- package/dist/locale/locale.controller.js +110 -0
- package/dist/locale/locale.controller.js.map +1 -0
- package/dist/locale/locale.decorator.d.ts +2 -0
- package/dist/locale/locale.decorator.d.ts.map +1 -0
- package/dist/locale/locale.decorator.js +9 -0
- package/dist/locale/locale.decorator.js.map +1 -0
- package/dist/locale/locale.middleware.d.ts +10 -0
- package/dist/locale/locale.middleware.d.ts.map +1 -0
- package/dist/locale/locale.middleware.js +45 -0
- package/dist/locale/locale.middleware.js.map +1 -0
- package/dist/locale/locale.module.d.ts +5 -0
- package/dist/locale/locale.module.d.ts.map +1 -0
- package/dist/locale/locale.module.js +35 -0
- package/dist/locale/locale.module.js.map +1 -0
- package/dist/locale/locale.service.d.ts +26 -0
- package/dist/locale/locale.service.d.ts.map +1 -0
- package/dist/locale/locale.service.js +166 -0
- package/dist/locale/locale.service.js.map +1 -0
- package/dist/menu/menu.controller.js +1 -1
- package/dist/menu/menu.controller.js.map +1 -1
- package/dist/role/role.controller.d.ts.map +1 -1
- package/dist/role/role.controller.js +1 -1
- package/dist/role/role.controller.js.map +1 -1
- package/dist/route/route.controller.js +1 -1
- package/dist/route/route.controller.js.map +1 -1
- package/dist/screen/screen.controller.js +1 -1
- package/dist/screen/screen.controller.js.map +1 -1
- package/package.json +1 -3
- package/src/migrations/migrate-01.ts +271 -127
- package/src/migrations/migrate-02.ts +137 -236
- package/src/migrations/migrate-03.ts +98 -192
- package/src/migrations/migrate-04.ts +167 -197
- package/src/migrations/migrate-05.ts +185 -42
- package/src/migrations/migrate-06.ts +245 -33
- package/src/migrations/migrate-07.ts +87 -21
- package/src/migrations/migrate-08.ts +8 -8
- package/src/migrations/migrate-09.ts +13 -14
- package/src/migrations/migrate-10.ts +8 -8
- package/src/migrations/migrate-11.ts +46 -17
- package/src/migrations/migrate-12.ts +46 -71
- package/src/migrations/migrate-13.ts +15 -9
- package/src/migrations/migrate-14.ts +55 -33
- package/src/migrations/migrate-15.ts +9 -16
- package/src/migrations/migrate-16.ts +37 -17
- package/src/migrations/migrate-17.ts +20 -169
- package/src/migrations/migrate-18.ts +30 -191
- package/src/migrations/migrate-19.ts +176 -0
- package/src/migrations/migrate-20.ts +198 -0
@@ -1,236 +1,137 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
},
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
.
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
.execute();
|
139
|
-
const screenSettings = await queryRunner.manager
|
140
|
-
.createQueryBuilder()
|
141
|
-
.select('id')
|
142
|
-
.from('screens', 's')
|
143
|
-
.where('s.slug = :slug', { slug: '/management/settings' })
|
144
|
-
.execute();
|
145
|
-
|
146
|
-
await queryRunner.manager
|
147
|
-
.createQueryBuilder()
|
148
|
-
.insert()
|
149
|
-
.into('screen_translations', [
|
150
|
-
'screen_id',
|
151
|
-
'locale_id',
|
152
|
-
'name',
|
153
|
-
'description',
|
154
|
-
])
|
155
|
-
.values([
|
156
|
-
{
|
157
|
-
screen_id: screenUsers[0].id,
|
158
|
-
locale_id: 1,
|
159
|
-
name: 'Users',
|
160
|
-
description: 'Check all users registered in the system.',
|
161
|
-
},
|
162
|
-
{
|
163
|
-
screen_id: screenUsers[0].id,
|
164
|
-
locale_id: 2,
|
165
|
-
name: 'Usuários',
|
166
|
-
description: 'Verifique todos os usuários registrados no sistema.',
|
167
|
-
},
|
168
|
-
{
|
169
|
-
screen_id: screenRoles[0].id,
|
170
|
-
locale_id: 1,
|
171
|
-
name: 'Roles',
|
172
|
-
description: 'Check all roles registered in the system.',
|
173
|
-
},
|
174
|
-
{
|
175
|
-
screen_id: screenRoles[0].id,
|
176
|
-
locale_id: 2,
|
177
|
-
name: 'Funções',
|
178
|
-
description: 'Verifique todas as funções registradas no sistema.',
|
179
|
-
},
|
180
|
-
{
|
181
|
-
screen_id: screenScreens[0].id,
|
182
|
-
locale_id: 1,
|
183
|
-
name: 'Screens',
|
184
|
-
description: 'Check all screens registered in the system.',
|
185
|
-
},
|
186
|
-
{
|
187
|
-
screen_id: screenScreens[0].id,
|
188
|
-
locale_id: 2,
|
189
|
-
name: 'Telas',
|
190
|
-
description: 'Verifique todas as telas registradas no sistema.',
|
191
|
-
},
|
192
|
-
{
|
193
|
-
screen_id: screenMenus[0].id,
|
194
|
-
locale_id: 1,
|
195
|
-
name: 'Menus',
|
196
|
-
description: 'Check all menus registered in the system.',
|
197
|
-
},
|
198
|
-
{
|
199
|
-
screen_id: screenMenus[0].id,
|
200
|
-
locale_id: 2,
|
201
|
-
name: 'Menus',
|
202
|
-
description: 'Verifique todos os menus registrados no sistema.',
|
203
|
-
},
|
204
|
-
{
|
205
|
-
screen_id: screenRoutes[0].id,
|
206
|
-
locale_id: 1,
|
207
|
-
name: 'Routes',
|
208
|
-
description: 'Check all routes registered in the system.',
|
209
|
-
},
|
210
|
-
{
|
211
|
-
screen_id: screenRoutes[0].id,
|
212
|
-
locale_id: 2,
|
213
|
-
name: 'Rotas',
|
214
|
-
description: 'Verifique todas as rotas registradas no sistema.',
|
215
|
-
},
|
216
|
-
{
|
217
|
-
screen_id: screenSettings[0].id,
|
218
|
-
locale_id: 1,
|
219
|
-
name: 'Settings',
|
220
|
-
description: 'Check all settings registered in the system.',
|
221
|
-
},
|
222
|
-
{
|
223
|
-
screen_id: screenSettings[0].id,
|
224
|
-
locale_id: 2,
|
225
|
-
name: 'Configurações',
|
226
|
-
description:
|
227
|
-
'Verifique todas as configurações registradas no sistema.',
|
228
|
-
},
|
229
|
-
])
|
230
|
-
.execute();
|
231
|
-
}
|
232
|
-
|
233
|
-
async down(queryRunner: QueryRunner) {
|
234
|
-
await queryRunner.dropTable('screens');
|
235
|
-
}
|
236
|
-
}
|
1
|
+
import {
|
2
|
+
MigrationInterface,
|
3
|
+
QueryRunner,
|
4
|
+
Table,
|
5
|
+
TableForeignKey,
|
6
|
+
} from 'typeorm';
|
7
|
+
import { idColumn, timestampColumn } from '@hedhog/utils';
|
8
|
+
|
9
|
+
export class Migrate implements MigrationInterface {
|
10
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
11
|
+
await await queryRunner.createTable(
|
12
|
+
new Table({
|
13
|
+
name: 'translation_namespaces',
|
14
|
+
columns: [
|
15
|
+
idColumn(),
|
16
|
+
{
|
17
|
+
name: 'name',
|
18
|
+
type: 'varchar',
|
19
|
+
isNullable: false,
|
20
|
+
},
|
21
|
+
timestampColumn(),
|
22
|
+
timestampColumn('updated_at'),
|
23
|
+
],
|
24
|
+
}),
|
25
|
+
true,
|
26
|
+
);
|
27
|
+
|
28
|
+
await await queryRunner.manager
|
29
|
+
.createQueryBuilder()
|
30
|
+
.insert()
|
31
|
+
.into('translation_namespaces')
|
32
|
+
.values([{ name: 'translation' }])
|
33
|
+
.execute();
|
34
|
+
|
35
|
+
await queryRunner.createTable(
|
36
|
+
new Table({
|
37
|
+
name: 'translations',
|
38
|
+
columns: [
|
39
|
+
idColumn(),
|
40
|
+
{
|
41
|
+
name: 'locale_id',
|
42
|
+
type: 'int',
|
43
|
+
isNullable: false,
|
44
|
+
unsigned: true,
|
45
|
+
},
|
46
|
+
{
|
47
|
+
name: 'namespace_id',
|
48
|
+
type: 'int',
|
49
|
+
isNullable: false,
|
50
|
+
unsigned: true,
|
51
|
+
},
|
52
|
+
{
|
53
|
+
name: 'name',
|
54
|
+
type: 'varchar',
|
55
|
+
isNullable: false,
|
56
|
+
},
|
57
|
+
{
|
58
|
+
name: 'value',
|
59
|
+
type: 'varchar',
|
60
|
+
isNullable: false,
|
61
|
+
},
|
62
|
+
timestampColumn(),
|
63
|
+
timestampColumn('updated_at'),
|
64
|
+
],
|
65
|
+
uniques: [
|
66
|
+
{
|
67
|
+
columnNames: ['locale_id', 'namespace_id', 'name'],
|
68
|
+
},
|
69
|
+
],
|
70
|
+
foreignKeys: [
|
71
|
+
new TableForeignKey({
|
72
|
+
columnNames: ['locale_id'],
|
73
|
+
referencedTableName: 'locales',
|
74
|
+
referencedColumnNames: ['id'],
|
75
|
+
onDelete: 'CASCADE',
|
76
|
+
}),
|
77
|
+
new TableForeignKey({
|
78
|
+
columnNames: ['namespace_id'],
|
79
|
+
referencedTableName: 'translation_namespaces',
|
80
|
+
referencedColumnNames: ['id'],
|
81
|
+
onDelete: 'CASCADE',
|
82
|
+
}),
|
83
|
+
],
|
84
|
+
}),
|
85
|
+
true,
|
86
|
+
);
|
87
|
+
|
88
|
+
await await queryRunner.manager
|
89
|
+
.createQueryBuilder()
|
90
|
+
.insert()
|
91
|
+
.into('translations', ['locale_id', 'namespace_id', 'name', 'value'])
|
92
|
+
.values([
|
93
|
+
{
|
94
|
+
locale_id: 1,
|
95
|
+
namespace_id: 1,
|
96
|
+
name: 'slogan',
|
97
|
+
value: 'Administration Panel',
|
98
|
+
},
|
99
|
+
{
|
100
|
+
locale_id: 1,
|
101
|
+
namespace_id: 1,
|
102
|
+
name: 'en',
|
103
|
+
value: 'English',
|
104
|
+
},
|
105
|
+
{
|
106
|
+
locale_id: 1,
|
107
|
+
namespace_id: 1,
|
108
|
+
name: 'pt',
|
109
|
+
value: 'Portuguese',
|
110
|
+
},
|
111
|
+
{
|
112
|
+
locale_id: 2,
|
113
|
+
namespace_id: 1,
|
114
|
+
name: 'slogan',
|
115
|
+
value: 'Painel de Administração',
|
116
|
+
},
|
117
|
+
{
|
118
|
+
locale_id: 2,
|
119
|
+
namespace_id: 1,
|
120
|
+
name: 'en',
|
121
|
+
value: 'Inglês',
|
122
|
+
},
|
123
|
+
{
|
124
|
+
locale_id: 2,
|
125
|
+
namespace_id: 1,
|
126
|
+
name: 'pt',
|
127
|
+
value: 'Português',
|
128
|
+
},
|
129
|
+
])
|
130
|
+
.execute();
|
131
|
+
}
|
132
|
+
|
133
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
134
|
+
await queryRunner.dropTable('translations');
|
135
|
+
await queryRunner.dropTable('translation_namespaces');
|
136
|
+
}
|
137
|
+
}
|