@hedhog/admin 0.0.81 → 0.0.82

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. package/dist/__migrations/migrate-01.d.ts +6 -0
  2. package/dist/__migrations/migrate-01.d.ts.map +1 -0
  3. package/dist/__migrations/migrate-01.js +80 -0
  4. package/dist/__migrations/migrate-01.js.map +1 -0
  5. package/dist/__migrations/migrate-02.d.ts +6 -0
  6. package/dist/__migrations/migrate-02.d.ts.map +1 -0
  7. package/dist/__migrations/migrate-02.js +68 -0
  8. package/dist/__migrations/migrate-02.js.map +1 -0
  9. package/dist/__migrations/migrate-03.d.ts +6 -0
  10. package/dist/__migrations/migrate-03.d.ts.map +1 -0
  11. package/dist/__migrations/migrate-03.js +90 -0
  12. package/dist/__migrations/migrate-03.js.map +1 -0
  13. package/dist/__migrations/migrate-04.d.ts +6 -0
  14. package/dist/__migrations/migrate-04.d.ts.map +1 -0
  15. package/dist/__migrations/migrate-04.js +63 -0
  16. package/dist/__migrations/migrate-04.js.map +1 -0
  17. package/dist/__migrations/migrate-05.d.ts +6 -0
  18. package/dist/__migrations/migrate-05.d.ts.map +1 -0
  19. package/dist/__migrations/migrate-05.js +100 -0
  20. package/dist/__migrations/migrate-05.js.map +1 -0
  21. package/dist/__migrations/migrate-06.d.ts +6 -0
  22. package/dist/__migrations/migrate-06.d.ts.map +1 -0
  23. package/dist/__migrations/migrate-06.js +37 -0
  24. package/dist/__migrations/migrate-06.js.map +1 -0
  25. package/dist/__migrations/migrate-07.d.ts +6 -0
  26. package/dist/__migrations/migrate-07.d.ts.map +1 -0
  27. package/dist/__migrations/migrate-07.js +59 -0
  28. package/dist/__migrations/migrate-07.js.map +1 -0
  29. package/dist/__migrations/migrate-08.d.ts +6 -0
  30. package/dist/__migrations/migrate-08.d.ts.map +1 -0
  31. package/dist/__migrations/migrate-08.js +39 -0
  32. package/dist/__migrations/migrate-08.js.map +1 -0
  33. package/dist/__migrations/migrate-09.d.ts +6 -0
  34. package/dist/__migrations/migrate-09.d.ts.map +1 -0
  35. package/dist/__migrations/migrate-09.js +39 -0
  36. package/dist/__migrations/migrate-09.js.map +1 -0
  37. package/dist/__migrations/migrate-10.d.ts +6 -0
  38. package/dist/__migrations/migrate-10.d.ts.map +1 -0
  39. package/dist/__migrations/migrate-10.js +39 -0
  40. package/dist/__migrations/migrate-10.js.map +1 -0
  41. package/dist/__migrations/migrate-11.d.ts +6 -0
  42. package/dist/__migrations/migrate-11.d.ts.map +1 -0
  43. package/dist/__migrations/migrate-11.js +39 -0
  44. package/dist/__migrations/migrate-11.js.map +1 -0
  45. package/dist/__migrations/migrate-12.d.ts +6 -0
  46. package/dist/__migrations/migrate-12.d.ts.map +1 -0
  47. package/dist/__migrations/migrate-12.js +39 -0
  48. package/dist/__migrations/migrate-12.js.map +1 -0
  49. package/dist/__migrations/migrate-13.d.ts +6 -0
  50. package/dist/__migrations/migrate-13.d.ts.map +1 -0
  51. package/dist/__migrations/migrate-13.js +30 -0
  52. package/dist/__migrations/migrate-13.js.map +1 -0
  53. package/dist/__migrations/migrate-14.d.ts +6 -0
  54. package/dist/__migrations/migrate-14.d.ts.map +1 -0
  55. package/dist/__migrations/migrate-14.js +83 -0
  56. package/dist/__migrations/migrate-14.js.map +1 -0
  57. package/dist/__migrations/migrate-15.d.ts +6 -0
  58. package/dist/__migrations/migrate-15.d.ts.map +1 -0
  59. package/dist/__migrations/migrate-15.js +25 -0
  60. package/dist/__migrations/migrate-15.js.map +1 -0
  61. package/dist/__migrations/migrate-16.d.ts +6 -0
  62. package/dist/__migrations/migrate-16.d.ts.map +1 -0
  63. package/dist/__migrations/migrate-16.js +61 -0
  64. package/dist/__migrations/migrate-16.js.map +1 -0
  65. package/dist/__migrations/migrate-17.d.ts +6 -0
  66. package/dist/__migrations/migrate-17.d.ts.map +1 -0
  67. package/dist/__migrations/migrate-17.js +31 -0
  68. package/dist/__migrations/migrate-17.js.map +1 -0
  69. package/dist/__migrations/migrate-18.d.ts +6 -0
  70. package/dist/__migrations/migrate-18.d.ts.map +1 -0
  71. package/dist/__migrations/migrate-18.js +41 -0
  72. package/dist/__migrations/migrate-18.js.map +1 -0
  73. package/dist/__migrations/migrate-19.d.ts +6 -0
  74. package/dist/__migrations/migrate-19.d.ts.map +1 -0
  75. package/dist/__migrations/migrate-19.js +175 -0
  76. package/dist/__migrations/migrate-19.js.map +1 -0
  77. package/dist/__migrations/migrate-20.d.ts +6 -0
  78. package/dist/__migrations/migrate-20.d.ts.map +1 -0
  79. package/dist/__migrations/migrate-20.js +310 -0
  80. package/dist/__migrations/migrate-20.js.map +1 -0
  81. package/hedhog.yaml +487 -0
  82. package/package.json +1 -1
  83. package/src/migrations/migrate-01.ts +0 -86
  84. package/src/migrations/migrate-02.ts +0 -77
  85. package/src/migrations/migrate-03.ts +0 -102
  86. package/src/migrations/migrate-04.ts +0 -71
  87. package/src/migrations/migrate-05.ts +0 -119
  88. package/src/migrations/migrate-06.ts +0 -37
  89. package/src/migrations/migrate-07.ts +0 -66
  90. package/src/migrations/migrate-08.ts +0 -44
  91. package/src/migrations/migrate-09.ts +0 -44
  92. package/src/migrations/migrate-10.ts +0 -44
  93. package/src/migrations/migrate-11.ts +0 -45
  94. package/src/migrations/migrate-12.ts +0 -44
  95. package/src/migrations/migrate-13.ts +0 -28
  96. package/src/migrations/migrate-14.ts +0 -81
  97. package/src/migrations/migrate-15.ts +0 -23
  98. package/src/migrations/migrate-16.ts +0 -59
  99. package/src/migrations/migrate-17.ts +0 -29
  100. package/src/migrations/migrate-18.ts +0 -39
  101. package/src/migrations/migrate-19.ts +0 -186
  102. package/src/migrations/migrate-20.ts +0 -308
@@ -0,0 +1,6 @@
1
+ import { MigrationInterface, QueryRunner } from 'typeorm';
2
+ export declare class Migrate implements MigrationInterface {
3
+ up(queryRunner: QueryRunner): Promise<void>;
4
+ down(queryRunner: QueryRunner): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=migrate-19.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate-19.d.ts","sourceRoot":"","sources":["../../src/__migrations/migrate-19.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAS,MAAM,SAAS,CAAC;AAGjE,qBAAa,OAAQ,YAAW,kBAAkB;IACnC,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IA8K3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAO3D"}
@@ -0,0 +1,175 @@
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: 'setting_groups',
10
+ columns: [
11
+ (0, utils_1.idColumn)(),
12
+ {
13
+ name: 'icon',
14
+ type: 'varchar',
15
+ length: '31',
16
+ },
17
+ {
18
+ name: 'slug',
19
+ type: 'varchar',
20
+ length: '63',
21
+ isUnique: true,
22
+ },
23
+ (0, utils_1.timestampColumn)(),
24
+ (0, utils_1.timestampColumn)('updated_at'),
25
+ ],
26
+ }));
27
+ await queryRunner.createTable(new typeorm_1.Table({
28
+ name: 'setting_group_translations',
29
+ columns: [
30
+ (0, utils_1.foreignColumn)({ name: 'locale_id', isPrimary: true }),
31
+ (0, utils_1.foreignColumn)({ name: 'group_id', isPrimary: true }),
32
+ {
33
+ name: 'name',
34
+ type: 'varchar',
35
+ length: '63',
36
+ },
37
+ {
38
+ name: 'description',
39
+ type: 'varchar',
40
+ length: '255',
41
+ isNullable: true,
42
+ },
43
+ (0, utils_1.timestampColumn)(),
44
+ (0, utils_1.timestampColumn)('updated_at'),
45
+ ],
46
+ foreignKeys: [
47
+ {
48
+ columnNames: ['locale_id'],
49
+ referencedColumnNames: ['id'],
50
+ referencedTableName: 'locales',
51
+ onDelete: 'CASCADE',
52
+ },
53
+ {
54
+ columnNames: ['group_id'],
55
+ referencedColumnNames: ['id'],
56
+ referencedTableName: 'setting_groups',
57
+ onDelete: 'CASCADE',
58
+ },
59
+ ],
60
+ }));
61
+ await queryRunner.createTable(new typeorm_1.Table({
62
+ name: 'settings',
63
+ columns: [
64
+ (0, utils_1.idColumn)(),
65
+ (0, utils_1.foreignColumn)({ name: 'group_id' }),
66
+ {
67
+ name: 'slug',
68
+ type: 'varchar',
69
+ isUnique: true,
70
+ length: '63',
71
+ },
72
+ {
73
+ name: 'type',
74
+ type: 'enum',
75
+ enum: ['string', 'number', 'boolean', 'json'],
76
+ default: "'string'",
77
+ },
78
+ {
79
+ name: 'value',
80
+ type: 'varchar',
81
+ length: '1023',
82
+ isNullable: true,
83
+ },
84
+ {
85
+ name: 'userOverride',
86
+ type: 'boolean',
87
+ default: false,
88
+ },
89
+ (0, utils_1.timestampColumn)(),
90
+ (0, utils_1.timestampColumn)('updated_at'),
91
+ ],
92
+ foreignKeys: [
93
+ {
94
+ columnNames: ['group_id'],
95
+ referencedColumnNames: ['id'],
96
+ referencedTableName: 'setting_groups',
97
+ onDelete: 'CASCADE',
98
+ },
99
+ ],
100
+ }));
101
+ await queryRunner.createTable(new typeorm_1.Table({
102
+ name: 'setting_translations',
103
+ columns: [
104
+ (0, utils_1.foreignColumn)({ name: 'locale_id', isPrimary: true }),
105
+ (0, utils_1.foreignColumn)({ name: 'setting_id', isPrimary: true }),
106
+ {
107
+ name: 'description',
108
+ type: 'varchar',
109
+ isNullable: true,
110
+ length: '255',
111
+ },
112
+ {
113
+ name: 'name',
114
+ type: 'varchar',
115
+ isNullable: true,
116
+ length: '63',
117
+ },
118
+ (0, utils_1.timestampColumn)(),
119
+ (0, utils_1.timestampColumn)('updated_at'),
120
+ ],
121
+ foreignKeys: [
122
+ {
123
+ columnNames: ['locale_id'],
124
+ referencedColumnNames: ['id'],
125
+ referencedTableName: 'locales',
126
+ onDelete: 'CASCADE',
127
+ },
128
+ {
129
+ columnNames: ['setting_id'],
130
+ referencedColumnNames: ['id'],
131
+ referencedTableName: 'settings',
132
+ onDelete: 'CASCADE',
133
+ },
134
+ ],
135
+ }));
136
+ await queryRunner.createTable(new typeorm_1.Table({
137
+ name: 'setting_users',
138
+ columns: [
139
+ (0, utils_1.foreignColumn)({ name: 'user_id', isPrimary: true }),
140
+ (0, utils_1.foreignColumn)({ name: 'setting_id', isPrimary: true }),
141
+ {
142
+ name: 'value',
143
+ type: 'varchar',
144
+ length: '1023',
145
+ isNullable: true,
146
+ },
147
+ (0, utils_1.timestampColumn)(),
148
+ (0, utils_1.timestampColumn)('updated_at'),
149
+ ],
150
+ foreignKeys: [
151
+ {
152
+ columnNames: ['user_id'],
153
+ referencedColumnNames: ['id'],
154
+ referencedTableName: 'users',
155
+ onDelete: 'CASCADE',
156
+ },
157
+ {
158
+ columnNames: ['setting_id'],
159
+ referencedColumnNames: ['id'],
160
+ referencedTableName: 'settings',
161
+ onDelete: 'CASCADE',
162
+ },
163
+ ],
164
+ }));
165
+ }
166
+ async down(queryRunner) {
167
+ await queryRunner.dropTable('setting_users');
168
+ await queryRunner.dropTable('setting_translations');
169
+ await queryRunner.dropTable('settings');
170
+ await queryRunner.dropTable('setting_group_translations');
171
+ await queryRunner.dropTable('setting_groups');
172
+ }
173
+ }
174
+ exports.Migrate = Migrate;
175
+ //# sourceMappingURL=migrate-19.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate-19.js","sourceRoot":"","sources":["../../src/__migrations/migrate-19.ts"],"names":[],"mappings":";;;AAAA,qCAAiE;AACjE,yCAAyE;AAEzE,MAAa,OAAO;IACX,KAAK,CAAC,EAAE,CAAC,WAAwB;QACtC,MAAM,WAAW,CAAC,WAAW,CAC3B,IAAI,eAAK,CAAC;YACR,IAAI,EAAE,gBAAgB;YACtB,OAAO,EAAE;gBACP,IAAA,gBAAQ,GAAE;gBACV;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,SAAS;oBACf,MAAM,EAAE,IAAI;iBACb;gBACD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M,KAAK,CAAC,IAAI,CAAC,WAAwB;QACxC,MAAM,WAAW,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;QAC7C,MAAM,WAAW,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAAC;QACpD,MAAM,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QACxC,MAAM,WAAW,CAAC,SAAS,CAAC,4BAA4B,CAAC,CAAC;QAC1D,MAAM,WAAW,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAChD,CAAC;CACF;AAtLD,0BAsLC"}
@@ -0,0 +1,6 @@
1
+ import { MigrationInterface, QueryRunner } from 'typeorm';
2
+ export declare class Migrate implements MigrationInterface {
3
+ up(queryRunner: QueryRunner): Promise<void>;
4
+ down(queryRunner: QueryRunner): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=migrate-20.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate-20.d.ts","sourceRoot":"","sources":["../../src/__migrations/migrate-20.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE1D,qBAAa,OAAQ,YAAW,kBAAkB;IACnC,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IA0S3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAM3D"}
@@ -0,0 +1,310 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migrate = void 0;
4
+ class Migrate {
5
+ async up(queryRunner) {
6
+ /*
7
+ const groups = [
8
+ {
9
+ slug: 'file-storage',
10
+ icon: 'folder',
11
+ name_en: 'File Storage',
12
+ name_pt: 'Armazenamento de Arquivos',
13
+ description_en: 'Settings related to file storage',
14
+ description_pt:
15
+ 'Definições relacionadas com o armazenamento de arquivos',
16
+ settings: [
17
+ {
18
+ slug: 'storage',
19
+ type: 'string',
20
+ name_en: 'Storage Provider',
21
+ name_pt: 'Provedor de Armazenamento',
22
+ description_en: 'The storage to use',
23
+ description_pt: 'O armazenamento a utilizar',
24
+ value: 'local',
25
+ },
26
+ {
27
+ slug: 'storage-local-path',
28
+ type: 'string',
29
+ name_en: 'Local Path',
30
+ name_pt: 'Caminho Local',
31
+ description_en: 'The local path to store files',
32
+ description_pt: 'O caminho local para armazenar arquivos',
33
+ value: 'storage',
34
+ },
35
+ {
36
+ slug: 'storage-s3-key',
37
+ type: 'string',
38
+ name_en: 'S3 Key',
39
+ name_pt: 'Chave S3',
40
+ description_en: 'The S3 key',
41
+ description_pt: 'A chave S3',
42
+ value: '',
43
+ },
44
+ {
45
+ slug: 'storage-s3-secret',
46
+ type: 'string',
47
+ name_en: 'S3 Secret',
48
+ name_pt: 'Segredo S3',
49
+ description_en: 'The S3 secret',
50
+ description_pt: 'O segredo S3',
51
+ value: '',
52
+ },
53
+ {
54
+ slug: 'storage-s3-region',
55
+ type: 'string',
56
+ name_en: 'S3 Region',
57
+ name_pt: 'Região S3',
58
+ description_en: 'The S3 region',
59
+ description_pt: 'A região S3',
60
+ value: '',
61
+ },
62
+ {
63
+ slug: 'storage-s3-bucket',
64
+ type: 'string',
65
+ name_en: 'S3 Bucket',
66
+ name_pt: 'Bucket S3',
67
+ description_en: 'The S3 bucket',
68
+ description_pt: 'O bucket S3',
69
+ value: '',
70
+ },
71
+ ],
72
+ },
73
+ {
74
+ icon: 'world',
75
+ slug: 'localization',
76
+ name_en: 'Localization',
77
+ name_pt: 'Localização',
78
+ description_en: 'Settings related to localization',
79
+ description_pt: 'Definições relacionadas com a localização',
80
+ settings: [
81
+ {
82
+ slug: 'language',
83
+ type: 'string',
84
+ name_en: 'Default Language',
85
+ name_pt: 'Idioma Padrão',
86
+ description_en:
87
+ 'The system default language, each user can have their own preferred language',
88
+ description_pt:
89
+ 'O idioma padrão do sistema, cada usuário pode ter o seu próprio idioma preferido',
90
+ value: 'en',
91
+ },
92
+ {
93
+ slug: 'timezone',
94
+ type: 'string',
95
+ name_en: 'Timezone',
96
+ name_pt: 'Fuso Horário',
97
+ description_en: 'The timezone to use',
98
+ description_pt: 'O fuso horário a utilizar',
99
+ value: 'UTC',
100
+ },
101
+ ],
102
+ },
103
+ {
104
+ icon: 'palette',
105
+ slug: 'appearance',
106
+ name_en: 'Appearance',
107
+ name_pt: 'Aparência',
108
+ description_en: 'Settings related to appearance',
109
+ description_pt: 'Definições relacionadas com a aparência',
110
+ settings: [
111
+ {
112
+ slug: 'primary',
113
+ type: 'string',
114
+ name_en: 'Primary Color',
115
+ name_pt: 'Cor Primária',
116
+ description_en: 'The primary color to use',
117
+ description_pt: 'A cor primária a utilizar',
118
+ value: '#000000',
119
+ },
120
+ {
121
+ slug: 'secondary',
122
+ type: 'string',
123
+ name_en: 'Secondary Color',
124
+ name_pt: 'Cor Secundária',
125
+ description_en: 'The secondary color to use',
126
+ description_pt: 'A cor secundária a utilizar',
127
+ value: '#FFFFFF',
128
+ },
129
+ {
130
+ slug: 'accent',
131
+ type: 'string',
132
+ name_en: 'Accent Color',
133
+ name_pt: 'Cor de Realce',
134
+ description_en: 'The accent color to use',
135
+ description_pt: 'A cor de realce a utilizar',
136
+ value: '#000000',
137
+ },
138
+ {
139
+ slug: 'background',
140
+ type: 'string',
141
+ name_en: 'Background Color',
142
+ name_pt: 'Cor de Fundo',
143
+ description_en: 'The background color to use',
144
+ description_pt: 'A cor de fundo a utilizar',
145
+ value: '#FFFFFF',
146
+ },
147
+ {
148
+ slug: 'muted',
149
+ type: 'string',
150
+ name_en: 'Muted Color',
151
+ name_pt: 'Cor Suave',
152
+ description_en: 'The muted color to use',
153
+ description_pt: 'A cor suave a utilizar',
154
+ value: '#000000',
155
+ },
156
+ {
157
+ slug: 'radius',
158
+ type: 'number',
159
+ name_en: 'Border Radius',
160
+ name_pt: 'Raio da Borda',
161
+ description_en: 'The border radius to use',
162
+ description_pt: 'O raio da borda a utilizar',
163
+ value: 0.5,
164
+ },
165
+ {
166
+ slug: 'font',
167
+ type: 'string',
168
+ name_en: 'Font Family',
169
+ name_pt: 'Família de Fontes',
170
+ description_en: 'The font family to use',
171
+ description_pt: 'A família de fontes a utilizar',
172
+ value: 'ui-sans-serif, system-ui, sans-serif',
173
+ },
174
+ ],
175
+ },
176
+ ];
177
+
178
+ for (const group of groups) {
179
+ const settingGroup = await queryRunner.manager
180
+ .createQueryBuilder()
181
+ .insert()
182
+ .into('setting_groups', ['icon', 'slug'])
183
+ .values({
184
+ icon: group.icon,
185
+ slug: group.slug,
186
+ })
187
+ .execute();
188
+
189
+ const settingGroupId = settingGroup.raw.insertId;
190
+
191
+ await queryRunner.manager
192
+ .createQueryBuilder()
193
+ .insert()
194
+ .into('setting_group_translations', [
195
+ 'locale_id',
196
+ 'group_id',
197
+ 'name',
198
+ 'description',
199
+ ])
200
+ .values([
201
+ {
202
+ locale_id: 1,
203
+ group_id: settingGroupId,
204
+ name: group.name_en,
205
+ description: group.description_en,
206
+ },
207
+ {
208
+ locale_id: 2,
209
+ group_id: settingGroupId,
210
+ name: group.name_pt,
211
+ description: group.description_pt,
212
+ },
213
+ ])
214
+ .execute();
215
+
216
+ for (const s of group.settings) {
217
+ const setting = await queryRunner.manager
218
+ .createQueryBuilder()
219
+ .insert()
220
+ .into('settings', ['slug', 'group_id', 'type', 'value'])
221
+ .values({
222
+ slug: s.slug,
223
+ group_id: settingGroupId,
224
+ type: s.type,
225
+ value: s.value,
226
+ })
227
+ .execute();
228
+
229
+ const settingId = setting.raw.insertId;
230
+
231
+ await queryRunner.manager
232
+ .createQueryBuilder()
233
+ .insert()
234
+ .into('setting_translations', [
235
+ 'locale_id',
236
+ 'setting_id',
237
+ 'name',
238
+ 'description',
239
+ ])
240
+ .values([
241
+ {
242
+ locale_id: 1,
243
+ setting_id: settingId,
244
+ name: s.name_en,
245
+ description: s.description_en,
246
+ },
247
+ {
248
+ locale_id: 2,
249
+ setting_id: settingId,
250
+ name: s.name_pt,
251
+ description: s.description_pt,
252
+ },
253
+ ])
254
+ .execute();
255
+ }
256
+ }
257
+
258
+ const routesGetRole3 = await queryRunner.manager
259
+ .createQueryBuilder()
260
+ .select('id')
261
+ .from('routes', 'r')
262
+ .where('r.url IN (:...urls)', {
263
+ urls: [
264
+ '/settings/groups',
265
+ '/settings/groups/:slug',
266
+ '/auth/verify',
267
+ '/menus/system',
268
+ ],
269
+ })
270
+ .where('r.method = :method', { method: 'GET' })
271
+ .execute();
272
+
273
+ const routesPutRole3 = await queryRunner.manager
274
+ .createQueryBuilder()
275
+ .select('id')
276
+ .from('routes', 'r')
277
+ .where('r.url IN (:...urls)', {
278
+ urls: ['/settings/:slug'],
279
+ })
280
+ .where('r.method = :method', { method: 'PUT' })
281
+ .execute();
282
+
283
+ const adminAccessRoutes = [];
284
+
285
+ for (const route of [...routesGetRole3, ...routesPutRole3]) {
286
+ adminAccessRoutes.push(route.id);
287
+ }
288
+
289
+ for (const routeId of adminAccessRoutes) {
290
+ await queryRunner.manager
291
+ .createQueryBuilder()
292
+ .insert()
293
+ .into('role_routes', ['role_id', 'route_id'])
294
+ .values({
295
+ role_id: 3,
296
+ route_id: routeId,
297
+ })
298
+ .execute();
299
+ }
300
+ */
301
+ }
302
+ async down(queryRunner) {
303
+ await queryRunner.query('DELETE FROM setting_translations');
304
+ await queryRunner.query('DELETE FROM settings');
305
+ await queryRunner.query('DELETE FROM setting_group_translations');
306
+ await queryRunner.query('DELETE FROM setting_groups');
307
+ }
308
+ }
309
+ exports.Migrate = Migrate;
310
+ //# sourceMappingURL=migrate-20.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate-20.js","sourceRoot":"","sources":["../../src/__migrations/migrate-20.ts"],"names":[],"mappings":";;;AAEA,MAAa,OAAO;IACX,KAAK,CAAC,EAAE,CAAC,WAAwB;QACtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAsSM;IACR,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACxC,MAAM,WAAW,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;QAC5D,MAAM,WAAW,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAChD,MAAM,WAAW,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAAC;QAClE,MAAM,WAAW,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;IACxD,CAAC;CACF;AAjTD,0BAiTC"}