@hedhog/admin 0.0.57 → 0.0.59

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. package/dist/entities/country.entity.d.ts.map +1 -1
  2. package/dist/entities/country.entity.js +3 -1
  3. package/dist/entities/country.entity.js.map +1 -1
  4. package/dist/entities/locale.entity.d.ts.map +1 -1
  5. package/dist/entities/locale.entity.js +3 -1
  6. package/dist/entities/locale.entity.js.map +1 -1
  7. package/dist/entities/menu.entity.d.ts.map +1 -1
  8. package/dist/entities/menu.entity.js +3 -1
  9. package/dist/entities/menu.entity.js.map +1 -1
  10. package/dist/entities/multifactor.entity.d.ts.map +1 -1
  11. package/dist/entities/multifactor.entity.js +3 -1
  12. package/dist/entities/multifactor.entity.js.map +1 -1
  13. package/dist/entities/role.entity.d.ts.map +1 -1
  14. package/dist/entities/role.entity.js +3 -1
  15. package/dist/entities/role.entity.js.map +1 -1
  16. package/dist/entities/route.entity.d.ts.map +1 -1
  17. package/dist/entities/route.entity.js +3 -1
  18. package/dist/entities/route.entity.js.map +1 -1
  19. package/dist/entities/screen.entity.d.ts.map +1 -1
  20. package/dist/entities/screen.entity.js +3 -1
  21. package/dist/entities/screen.entity.js.map +1 -1
  22. package/dist/entities/setting-group.entity.d.ts.map +1 -1
  23. package/dist/entities/setting-group.entity.js +3 -1
  24. package/dist/entities/setting-group.entity.js.map +1 -1
  25. package/dist/entities/setting.entity.d.ts.map +1 -1
  26. package/dist/entities/setting.entity.js +3 -1
  27. package/dist/entities/setting.entity.js.map +1 -1
  28. package/dist/entities/translation.entity.d.ts.map +1 -1
  29. package/dist/entities/translation.entity.js +3 -1
  30. package/dist/entities/translation.entity.js.map +1 -1
  31. package/dist/entities/user.entity.d.ts.map +1 -1
  32. package/dist/entities/user.entity.js +3 -1
  33. package/dist/entities/user.entity.js.map +1 -1
  34. package/package.json +1 -1
  35. package/src/entities/country.entity.ts +3 -1
  36. package/src/entities/locale.entity.ts +3 -1
  37. package/src/entities/menu.entity.ts +3 -1
  38. package/src/entities/multifactor.entity.ts +3 -1
  39. package/src/entities/role.entity.ts +3 -1
  40. package/src/entities/route.entity.ts +3 -1
  41. package/src/entities/screen.entity.ts +3 -1
  42. package/src/entities/setting-group.entity.ts +3 -1
  43. package/src/entities/setting.entity.ts +3 -1
  44. package/src/entities/translation.entity.ts +3 -1
  45. package/src/entities/user.entity.ts +3 -1
  46. package/src/migrations/migrate-05.ts +0 -139
  47. package/src/migrations/migrate-06.ts +140 -0
@@ -1 +1 @@
1
- {"version":3,"file":"country.entity.d.ts","sourceRoot":"","sources":["../../src/entities/country.entity.ts"],"names":[],"mappings":"AAEA,qBACa,OAAO;IAIlB,EAAE,EAAE,MAAM,CAAC;IAGX,IAAI,EAAE,MAAM,CAAC;IAKb,IAAI,EAAE,MAAM,CAAC;CACd"}
1
+ {"version":3,"file":"country.entity.d.ts","sourceRoot":"","sources":["../../src/entities/country.entity.ts"],"names":[],"mappings":"AAEA,qBAGa,OAAO;IAIlB,EAAE,EAAE,MAAM,CAAC;IAGX,IAAI,EAAE,MAAM,CAAC;IAKb,IAAI,EAAE,MAAM,CAAC;CACd"}
@@ -31,6 +31,8 @@ __decorate([
31
31
  __metadata("design:type", String)
32
32
  ], Country.prototype, "code", void 0);
33
33
  exports.Country = Country = __decorate([
34
- (0, typeorm_1.Entity)()
34
+ (0, typeorm_1.Entity)({
35
+ name: 'countries',
36
+ })
35
37
  ], Country);
36
38
  //# sourceMappingURL=country.entity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"country.entity.js","sourceRoot":"","sources":["../../src/entities/country.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAiE;AAG1D,IAAM,OAAO,GAAb,MAAM,OAAO;CAanB,CAAA;AAbY,0BAAO;AAIlB;IAHC,IAAA,gCAAsB,EAAC;QACtB,QAAQ,EAAE,IAAI;KACf,CAAC;;mCACS;AAGX;IADC,IAAA,gBAAM,GAAE;;qCACI;AAKb;IAHC,IAAA,gBAAM,EAAC;QACN,MAAM,EAAE,CAAC;KACV,CAAC;;qCACW;kBAZF,OAAO;IADnB,IAAA,gBAAM,GAAE;GACI,OAAO,CAanB"}
1
+ {"version":3,"file":"country.entity.js","sourceRoot":"","sources":["../../src/entities/country.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAiE;AAK1D,IAAM,OAAO,GAAb,MAAM,OAAO;CAanB,CAAA;AAbY,0BAAO;AAIlB;IAHC,IAAA,gCAAsB,EAAC;QACtB,QAAQ,EAAE,IAAI;KACf,CAAC;;mCACS;AAGX;IADC,IAAA,gBAAM,GAAE;;qCACI;AAKb;IAHC,IAAA,gBAAM,EAAC;QACN,MAAM,EAAE,CAAC;KACV,CAAC;;qCACW;kBAZF,OAAO;IAHnB,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,WAAW;KAClB,CAAC;GACW,OAAO,CAanB"}
@@ -1 +1 @@
1
- {"version":3,"file":"locale.entity.d.ts","sourceRoot":"","sources":["../../src/entities/locale.entity.ts"],"names":[],"mappings":"AAEA,qBACa,MAAM;IAIjB,EAAE,EAAE,MAAM,CAAC;IAMX,UAAU,EAAE,MAAM,CAAC;IAKnB,IAAI,EAAE,MAAM,CAAC;IAKb,MAAM,EAAE,MAAM,CAAC;IAGf,OAAO,EAAE,OAAO,CAAC;CAClB"}
1
+ {"version":3,"file":"locale.entity.d.ts","sourceRoot":"","sources":["../../src/entities/locale.entity.ts"],"names":[],"mappings":"AAEA,qBAGa,MAAM;IAIjB,EAAE,EAAE,MAAM,CAAC;IAMX,UAAU,EAAE,MAAM,CAAC;IAKnB,IAAI,EAAE,MAAM,CAAC;IAKb,MAAM,EAAE,MAAM,CAAC;IAGf,OAAO,EAAE,OAAO,CAAC;CAClB"}
@@ -44,6 +44,8 @@ __decorate([
44
44
  __metadata("design:type", Boolean)
45
45
  ], Locale.prototype, "enabled", void 0);
46
46
  exports.Locale = Locale = __decorate([
47
- (0, typeorm_1.Entity)()
47
+ (0, typeorm_1.Entity)({
48
+ name: 'locales',
49
+ })
48
50
  ], Locale);
49
51
  //# sourceMappingURL=locale.entity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"locale.entity.js","sourceRoot":"","sources":["../../src/entities/locale.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA6E;AAGtE,IAAM,MAAM,GAAZ,MAAM,MAAM;CAwBlB,CAAA;AAxBY,wBAAM;AAIjB;IAHC,IAAA,gCAAsB,EAAC;QACtB,QAAQ,EAAE,IAAI;KACf,CAAC;;kCACS;AAMX;IAJC,IAAA,oBAAU,GAAE;IACZ,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;;0CACiB;AAKnB;IAHC,IAAA,gBAAM,EAAC;QACN,MAAM,EAAE,CAAC;KACV,CAAC;;oCACW;AAKb;IAHC,IAAA,gBAAM,EAAC;QACN,MAAM,EAAE,CAAC;KACV,CAAC;;sCACa;AAGf;IADC,IAAA,gBAAM,GAAE;;uCACQ;iBAvBN,MAAM;IADlB,IAAA,gBAAM,GAAE;GACI,MAAM,CAwBlB"}
1
+ {"version":3,"file":"locale.entity.js","sourceRoot":"","sources":["../../src/entities/locale.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA6E;AAKtE,IAAM,MAAM,GAAZ,MAAM,MAAM;CAwBlB,CAAA;AAxBY,wBAAM;AAIjB;IAHC,IAAA,gCAAsB,EAAC;QACtB,QAAQ,EAAE,IAAI;KACf,CAAC;;kCACS;AAMX;IAJC,IAAA,oBAAU,GAAE;IACZ,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;;0CACiB;AAKnB;IAHC,IAAA,gBAAM,EAAC;QACN,MAAM,EAAE,CAAC;KACV,CAAC;;oCACW;AAKb;IAHC,IAAA,gBAAM,EAAC;QACN,MAAM,EAAE,CAAC;KACV,CAAC;;sCACa;AAGf;IADC,IAAA,gBAAM,GAAE;;uCACQ;iBAvBN,MAAM;IAHlB,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,SAAS;KAChB,CAAC;GACW,MAAM,CAwBlB"}
@@ -1 +1 @@
1
- {"version":3,"file":"menu.entity.d.ts","sourceRoot":"","sources":["../../src/entities/menu.entity.ts"],"names":[],"mappings":"AAEA,qBACa,IAAI;IAEf,EAAE,EAAE,MAAM,CAAC;IAOX,OAAO,CAAC,EAAE,MAAM,CAAC;IAGjB,IAAI,EAAE,MAAM,CAAC;IAKb,GAAG,CAAC,EAAE,MAAM,CAAC;IAMb,KAAK,EAAE,MAAM,CAAC;IAKd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
1
+ {"version":3,"file":"menu.entity.d.ts","sourceRoot":"","sources":["../../src/entities/menu.entity.ts"],"names":[],"mappings":"AAEA,qBAGa,IAAI;IAEf,EAAE,EAAE,MAAM,CAAC;IAOX,OAAO,CAAC,EAAE,MAAM,CAAC;IAGjB,IAAI,EAAE,MAAM,CAAC;IAKb,GAAG,CAAC,EAAE,MAAM,CAAC;IAMb,KAAK,EAAE,MAAM,CAAC;IAKd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
@@ -50,6 +50,8 @@ __decorate([
50
50
  __metadata("design:type", String)
51
51
  ], Menu.prototype, "icon", void 0);
52
52
  exports.Menu = Menu = __decorate([
53
- (0, typeorm_1.Entity)()
53
+ (0, typeorm_1.Entity)({
54
+ name: 'menus',
55
+ })
54
56
  ], Menu);
55
57
  //# sourceMappingURL=menu.entity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"menu.entity.js","sourceRoot":"","sources":["../../src/entities/menu.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA6E;AAGtE,IAAM,IAAI,GAAV,MAAM,IAAI;CA6BhB,CAAA;AA7BY,oBAAI;AAEf;IADC,IAAA,gCAAsB,GAAE;;gCACd;AAOX;IALC,IAAA,oBAAU,GAAE;IACZ,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,IAAI;KACf,CAAC;;qCACe;AAGjB;IADC,IAAA,gBAAM,GAAE;;kCACI;AAKb;IAHC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;;iCACW;AAMb;IAJC,IAAA,gBAAM,EAAC;QACN,OAAO,EAAE,CAAC;QACV,QAAQ,EAAE,IAAI;KACf,CAAC;;mCACY;AAKd;IAHC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;;kCACY;eA5BH,IAAI;IADhB,IAAA,gBAAM,GAAE;GACI,IAAI,CA6BhB"}
1
+ {"version":3,"file":"menu.entity.js","sourceRoot":"","sources":["../../src/entities/menu.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA6E;AAKtE,IAAM,IAAI,GAAV,MAAM,IAAI;CA6BhB,CAAA;AA7BY,oBAAI;AAEf;IADC,IAAA,gCAAsB,GAAE;;gCACd;AAOX;IALC,IAAA,oBAAU,GAAE;IACZ,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,IAAI;KACf,CAAC;;qCACe;AAGjB;IADC,IAAA,gBAAM,GAAE;;kCACI;AAKb;IAHC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;;iCACW;AAMb;IAJC,IAAA,gBAAM,EAAC;QACN,OAAO,EAAE,CAAC;QACV,QAAQ,EAAE,IAAI;KACf,CAAC;;mCACY;AAKd;IAHC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;;kCACY;eA5BH,IAAI;IAHhB,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,OAAO;KACd,CAAC;GACW,IAAI,CA6BhB"}
@@ -1 +1 @@
1
- {"version":3,"file":"multifactor.entity.d.ts","sourceRoot":"","sources":["../../src/entities/multifactor.entity.ts"],"names":[],"mappings":"AAEA,qBACa,WAAW;IAEtB,EAAE,EAAE,MAAM,CAAC;IAGX,IAAI,EAAE,MAAM,CAAC;CACd"}
1
+ {"version":3,"file":"multifactor.entity.d.ts","sourceRoot":"","sources":["../../src/entities/multifactor.entity.ts"],"names":[],"mappings":"AAEA,qBAGa,WAAW;IAEtB,EAAE,EAAE,MAAM,CAAC;IAGX,IAAI,EAAE,MAAM,CAAC;CACd"}
@@ -23,6 +23,8 @@ __decorate([
23
23
  __metadata("design:type", String)
24
24
  ], Multifactor.prototype, "slug", void 0);
25
25
  exports.Multifactor = Multifactor = __decorate([
26
- (0, typeorm_1.Entity)()
26
+ (0, typeorm_1.Entity)({
27
+ name: 'multifactors',
28
+ })
27
29
  ], Multifactor);
28
30
  //# sourceMappingURL=multifactor.entity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"multifactor.entity.js","sourceRoot":"","sources":["../../src/entities/multifactor.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA6E;AAGtE,IAAM,WAAW,GAAjB,MAAM,WAAW;CAMvB,CAAA;AANY,kCAAW;AAEtB;IADC,IAAA,gCAAsB,GAAE;;uCACd;AAGX;IADC,IAAA,gBAAM,GAAE;;yCACI;sBALF,WAAW;IADvB,IAAA,gBAAM,GAAE;GACI,WAAW,CAMvB"}
1
+ {"version":3,"file":"multifactor.entity.js","sourceRoot":"","sources":["../../src/entities/multifactor.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA6E;AAKtE,IAAM,WAAW,GAAjB,MAAM,WAAW;CAMvB,CAAA;AANY,kCAAW;AAEtB;IADC,IAAA,gCAAsB,GAAE;;uCACd;AAGX;IADC,IAAA,gBAAM,GAAE;;yCACI;sBALF,WAAW;IAHvB,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,cAAc;KACrB,CAAC;GACW,WAAW,CAMvB"}
@@ -1 +1 @@
1
- {"version":3,"file":"role.entity.d.ts","sourceRoot":"","sources":["../../src/entities/role.entity.ts"],"names":[],"mappings":"AAEA,qBACa,IAAI;IAEf,EAAE,EAAE,MAAM,CAAC;IAKX,IAAI,EAAE,MAAM,CAAC;CACd"}
1
+ {"version":3,"file":"role.entity.d.ts","sourceRoot":"","sources":["../../src/entities/role.entity.ts"],"names":[],"mappings":"AAEA,qBAGa,IAAI;IAEf,EAAE,EAAE,MAAM,CAAC;IAKX,IAAI,EAAE,MAAM,CAAC;CACd"}
@@ -25,6 +25,8 @@ __decorate([
25
25
  __metadata("design:type", String)
26
26
  ], Role.prototype, "slug", void 0);
27
27
  exports.Role = Role = __decorate([
28
- (0, typeorm_1.Entity)()
28
+ (0, typeorm_1.Entity)({
29
+ name: 'roles',
30
+ })
29
31
  ], Role);
30
32
  //# sourceMappingURL=role.entity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"role.entity.js","sourceRoot":"","sources":["../../src/entities/role.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA6E;AAGtE,IAAM,IAAI,GAAV,MAAM,IAAI;CAQhB,CAAA;AARY,oBAAI;AAEf;IADC,IAAA,gCAAsB,GAAE;;gCACd;AAKX;IAHC,IAAA,gBAAM,EAAC;QACN,MAAM,EAAE,IAAI;KACb,CAAC;;kCACW;eAPF,IAAI;IADhB,IAAA,gBAAM,GAAE;GACI,IAAI,CAQhB"}
1
+ {"version":3,"file":"role.entity.js","sourceRoot":"","sources":["../../src/entities/role.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA6E;AAKtE,IAAM,IAAI,GAAV,MAAM,IAAI;CAQhB,CAAA;AARY,oBAAI;AAEf;IADC,IAAA,gCAAsB,GAAE;;gCACd;AAKX;IAHC,IAAA,gBAAM,EAAC;QACN,MAAM,EAAE,IAAI;KACb,CAAC;;kCACW;eAPF,IAAI;IAHhB,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,OAAO;KACd,CAAC;GACW,IAAI,CAQhB"}
@@ -1 +1 @@
1
- {"version":3,"file":"route.entity.d.ts","sourceRoot":"","sources":["../../src/entities/route.entity.ts"],"names":[],"mappings":"AAEA,qBACa,KAAK;IAEhB,EAAE,EAAE,MAAM,CAAC;IAGX,GAAG,EAAE,MAAM,CAAC;IAKZ,MAAM,EAAE,MAAM,CAAC;CAChB"}
1
+ {"version":3,"file":"route.entity.d.ts","sourceRoot":"","sources":["../../src/entities/route.entity.ts"],"names":[],"mappings":"AAEA,qBAGa,KAAK;IAEhB,EAAE,EAAE,MAAM,CAAC;IAGX,GAAG,EAAE,MAAM,CAAC;IAKZ,MAAM,EAAE,MAAM,CAAC;CAChB"}
@@ -29,6 +29,8 @@ __decorate([
29
29
  __metadata("design:type", String)
30
30
  ], Route.prototype, "method", void 0);
31
31
  exports.Route = Route = __decorate([
32
- (0, typeorm_1.Entity)()
32
+ (0, typeorm_1.Entity)({
33
+ name: 'routes',
34
+ })
33
35
  ], Route);
34
36
  //# sourceMappingURL=route.entity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"route.entity.js","sourceRoot":"","sources":["../../src/entities/route.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA6E;AAGtE,IAAM,KAAK,GAAX,MAAM,KAAK;CAWjB,CAAA;AAXY,sBAAK;AAEhB;IADC,IAAA,gCAAsB,GAAE;;iCACd;AAGX;IADC,IAAA,gBAAM,GAAE;;kCACG;AAKZ;IAHC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC;KACnE,CAAC;;qCACa;gBAVJ,KAAK;IADjB,IAAA,gBAAM,GAAE;GACI,KAAK,CAWjB"}
1
+ {"version":3,"file":"route.entity.js","sourceRoot":"","sources":["../../src/entities/route.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA6E;AAKtE,IAAM,KAAK,GAAX,MAAM,KAAK;CAWjB,CAAA;AAXY,sBAAK;AAEhB;IADC,IAAA,gCAAsB,GAAE;;iCACd;AAGX;IADC,IAAA,gBAAM,GAAE;;kCACG;AAKZ;IAHC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC;KACnE,CAAC;;qCACa;gBAVJ,KAAK;IAHjB,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,QAAQ;KACf,CAAC;GACW,KAAK,CAWjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"screen.entity.d.ts","sourceRoot":"","sources":["../../src/entities/screen.entity.ts"],"names":[],"mappings":"AAEA,qBACa,MAAM;IAEjB,EAAE,EAAE,MAAM,CAAC;IAGX,IAAI,EAAE,MAAM,CAAC;IAKb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
1
+ {"version":3,"file":"screen.entity.d.ts","sourceRoot":"","sources":["../../src/entities/screen.entity.ts"],"names":[],"mappings":"AAEA,qBAGa,MAAM;IAEjB,EAAE,EAAE,MAAM,CAAC;IAGX,IAAI,EAAE,MAAM,CAAC;IAKb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
@@ -29,6 +29,8 @@ __decorate([
29
29
  __metadata("design:type", String)
30
30
  ], Screen.prototype, "icon", void 0);
31
31
  exports.Screen = Screen = __decorate([
32
- (0, typeorm_1.Entity)()
32
+ (0, typeorm_1.Entity)({
33
+ name: 'screens',
34
+ })
33
35
  ], Screen);
34
36
  //# sourceMappingURL=screen.entity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"screen.entity.js","sourceRoot":"","sources":["../../src/entities/screen.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA6E;AAGtE,IAAM,MAAM,GAAZ,MAAM,MAAM;CAWlB,CAAA;AAXY,wBAAM;AAEjB;IADC,IAAA,gCAAsB,GAAE;;kCACd;AAGX;IADC,IAAA,gBAAM,GAAE;;oCACI;AAKb;IAHC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;;oCACY;iBAVH,MAAM;IADlB,IAAA,gBAAM,GAAE;GACI,MAAM,CAWlB"}
1
+ {"version":3,"file":"screen.entity.js","sourceRoot":"","sources":["../../src/entities/screen.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA6E;AAKtE,IAAM,MAAM,GAAZ,MAAM,MAAM;CAWlB,CAAA;AAXY,wBAAM;AAEjB;IADC,IAAA,gCAAsB,GAAE;;kCACd;AAGX;IADC,IAAA,gBAAM,GAAE;;oCACI;AAKb;IAHC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;;oCACY;iBAVH,MAAM;IAHlB,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,SAAS;KAChB,CAAC;GACW,MAAM,CAWlB"}
@@ -1 +1 @@
1
- {"version":3,"file":"setting-group.entity.d.ts","sourceRoot":"","sources":["../../src/entities/setting-group.entity.ts"],"names":[],"mappings":"AAEA,qBACa,YAAY;IAEvB,EAAE,EAAE,MAAM,CAAC;IAKX,IAAI,EAAE,MAAM,CAAC;IAMb,IAAI,EAAE,MAAM,CAAC;CACd"}
1
+ {"version":3,"file":"setting-group.entity.d.ts","sourceRoot":"","sources":["../../src/entities/setting-group.entity.ts"],"names":[],"mappings":"AAEA,qBAGa,YAAY;IAEvB,EAAE,EAAE,MAAM,CAAC;IAKX,IAAI,EAAE,MAAM,CAAC;IAMb,IAAI,EAAE,MAAM,CAAC;CACd"}
@@ -32,6 +32,8 @@ __decorate([
32
32
  __metadata("design:type", String)
33
33
  ], SettingGroup.prototype, "slug", void 0);
34
34
  exports.SettingGroup = SettingGroup = __decorate([
35
- (0, typeorm_1.Entity)()
35
+ (0, typeorm_1.Entity)({
36
+ name: 'setting_groups',
37
+ })
36
38
  ], SettingGroup);
37
39
  //# sourceMappingURL=setting-group.entity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"setting-group.entity.js","sourceRoot":"","sources":["../../src/entities/setting-group.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA6E;AAGtE,IAAM,YAAY,GAAlB,MAAM,YAAY;CAcxB,CAAA;AAdY,oCAAY;AAEvB;IADC,IAAA,gCAAsB,GAAE;;wCACd;AAKX;IAHC,IAAA,gBAAM,EAAC;QACN,MAAM,EAAE,EAAE;KACX,CAAC;;0CACW;AAMb;IAJC,IAAA,gBAAM,EAAC;QACN,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,EAAE;KACX,CAAC;;0CACW;uBAbF,YAAY;IADxB,IAAA,gBAAM,GAAE;GACI,YAAY,CAcxB"}
1
+ {"version":3,"file":"setting-group.entity.js","sourceRoot":"","sources":["../../src/entities/setting-group.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA6E;AAKtE,IAAM,YAAY,GAAlB,MAAM,YAAY;CAcxB,CAAA;AAdY,oCAAY;AAEvB;IADC,IAAA,gCAAsB,GAAE;;wCACd;AAKX;IAHC,IAAA,gBAAM,EAAC;QACN,MAAM,EAAE,EAAE;KACX,CAAC;;0CACW;AAMb;IAJC,IAAA,gBAAM,EAAC;QACN,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,EAAE;KACX,CAAC;;0CACW;uBAbF,YAAY;IAHxB,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,gBAAgB;KACvB,CAAC;GACW,YAAY,CAcxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"setting.entity.d.ts","sourceRoot":"","sources":["../../src/entities/setting.entity.ts"],"names":[],"mappings":"AAEA,qBACa,OAAO;IAElB,EAAE,EAAE,MAAM,CAAC;IAMX,IAAI,EAAE,MAAM,CAAC;IAKb,IAAI,EAAE,MAAM,CAAC;IAKb,KAAK,EAAE,MAAM,CAAC;IAKd,YAAY,EAAE,OAAO,CAAC;CACvB"}
1
+ {"version":3,"file":"setting.entity.d.ts","sourceRoot":"","sources":["../../src/entities/setting.entity.ts"],"names":[],"mappings":"AAEA,qBAGa,OAAO;IAElB,EAAE,EAAE,MAAM,CAAC;IAMX,IAAI,EAAE,MAAM,CAAC;IAKb,IAAI,EAAE,MAAM,CAAC;IAKb,KAAK,EAAE,MAAM,CAAC;IAKd,YAAY,EAAE,OAAO,CAAC;CACvB"}
@@ -44,6 +44,8 @@ __decorate([
44
44
  __metadata("design:type", Boolean)
45
45
  ], Setting.prototype, "userOverride", void 0);
46
46
  exports.Setting = Setting = __decorate([
47
- (0, typeorm_1.Entity)()
47
+ (0, typeorm_1.Entity)({
48
+ name: 'settings',
49
+ })
48
50
  ], Setting);
49
51
  //# sourceMappingURL=setting.entity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"setting.entity.js","sourceRoot":"","sources":["../../src/entities/setting.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA6E;AAGtE,IAAM,OAAO,GAAb,MAAM,OAAO;CAwBnB,CAAA;AAxBY,0BAAO;AAElB;IADC,IAAA,gCAAsB,GAAE;;mCACd;AAMX;IAJC,IAAA,gBAAM,EAAC;QACN,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,EAAE;KACX,CAAC;;qCACW;AAKb;IAHC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC;KAC9C,CAAC;;qCACW;AAKb;IAHC,IAAA,gBAAM,EAAC;QACN,MAAM,EAAE,IAAI;KACb,CAAC;;sCACY;AAKd;IAHC,IAAA,gBAAM,EAAC;QACN,OAAO,EAAE,KAAK;KACf,CAAC;;6CACoB;kBAvBX,OAAO;IADnB,IAAA,gBAAM,GAAE;GACI,OAAO,CAwBnB"}
1
+ {"version":3,"file":"setting.entity.js","sourceRoot":"","sources":["../../src/entities/setting.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA6E;AAKtE,IAAM,OAAO,GAAb,MAAM,OAAO;CAwBnB,CAAA;AAxBY,0BAAO;AAElB;IADC,IAAA,gCAAsB,GAAE;;mCACd;AAMX;IAJC,IAAA,gBAAM,EAAC;QACN,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,EAAE;KACX,CAAC;;qCACW;AAKb;IAHC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC;KAC9C,CAAC;;qCACW;AAKb;IAHC,IAAA,gBAAM,EAAC;QACN,MAAM,EAAE,IAAI;KACb,CAAC;;sCACY;AAKd;IAHC,IAAA,gBAAM,EAAC;QACN,OAAO,EAAE,KAAK;KACf,CAAC;;6CACoB;kBAvBX,OAAO;IAHnB,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,UAAU;KACjB,CAAC;GACW,OAAO,CAwBnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"translation.entity.d.ts","sourceRoot":"","sources":["../../src/entities/translation.entity.ts"],"names":[],"mappings":"AAEA,qBACa,iBAAiB;IAE5B,EAAE,EAAE,MAAM,CAAC;IAGX,SAAS,EAAE,MAAM,CAAC;IAGlB,YAAY,EAAE,MAAM,CAAC;IAGrB,IAAI,EAAE,MAAM,CAAC;IAGb,KAAK,EAAE,MAAM,CAAC;CACf"}
1
+ {"version":3,"file":"translation.entity.d.ts","sourceRoot":"","sources":["../../src/entities/translation.entity.ts"],"names":[],"mappings":"AAEA,qBAGa,iBAAiB;IAE5B,EAAE,EAAE,MAAM,CAAC;IAGX,SAAS,EAAE,MAAM,CAAC;IAGlB,YAAY,EAAE,MAAM,CAAC;IAGrB,IAAI,EAAE,MAAM,CAAC;IAGb,KAAK,EAAE,MAAM,CAAC;CACf"}
@@ -35,6 +35,8 @@ __decorate([
35
35
  __metadata("design:type", String)
36
36
  ], TranslationEntity.prototype, "value", void 0);
37
37
  exports.TranslationEntity = TranslationEntity = __decorate([
38
- (0, typeorm_1.Entity)()
38
+ (0, typeorm_1.Entity)({
39
+ name: 'translations',
40
+ })
39
41
  ], TranslationEntity);
40
42
  //# sourceMappingURL=translation.entity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"translation.entity.js","sourceRoot":"","sources":["../../src/entities/translation.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA6E;AAGtE,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAe7B,CAAA;AAfY,8CAAiB;AAE5B;IADC,IAAA,gCAAsB,GAAE;;6CACd;AAGX;IADC,IAAA,oBAAU,GAAE;;oDACK;AAGlB;IADC,IAAA,oBAAU,GAAE;;uDACQ;AAGrB;IADC,IAAA,gBAAM,GAAE;;+CACI;AAGb;IADC,IAAA,gBAAM,GAAE;;gDACK;4BAdH,iBAAiB;IAD7B,IAAA,gBAAM,GAAE;GACI,iBAAiB,CAe7B"}
1
+ {"version":3,"file":"translation.entity.js","sourceRoot":"","sources":["../../src/entities/translation.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA6E;AAKtE,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAe7B,CAAA;AAfY,8CAAiB;AAE5B;IADC,IAAA,gCAAsB,GAAE;;6CACd;AAGX;IADC,IAAA,oBAAU,GAAE;;oDACK;AAGlB;IADC,IAAA,oBAAU,GAAE;;uDACQ;AAGrB;IADC,IAAA,gBAAM,GAAE;;+CACI;AAGb;IADC,IAAA,gBAAM,GAAE;;gDACK;4BAdH,iBAAiB;IAH7B,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,cAAc;KACrB,CAAC;GACW,iBAAiB,CAe7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"user.entity.d.ts","sourceRoot":"","sources":["../../src/entities/user.entity.ts"],"names":[],"mappings":"AAEA,qBACa,IAAI;IAEf,EAAE,EAAE,MAAM,CAAC;IAMX,cAAc,CAAC,EAAE,MAAM,CAAC;IAGxB,IAAI,EAAE,MAAM,CAAC;IAGb,KAAK,EAAE,MAAM,CAAC;IAGd,QAAQ,EAAE,MAAM,CAAC;IAKjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
1
+ {"version":3,"file":"user.entity.d.ts","sourceRoot":"","sources":["../../src/entities/user.entity.ts"],"names":[],"mappings":"AAEA,qBAGa,IAAI;IAEf,EAAE,EAAE,MAAM,CAAC;IAMX,cAAc,CAAC,EAAE,MAAM,CAAC;IAGxB,IAAI,EAAE,MAAM,CAAC;IAGb,KAAK,EAAE,MAAM,CAAC;IAGd,QAAQ,EAAE,MAAM,CAAC;IAKjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
@@ -44,6 +44,8 @@ __decorate([
44
44
  __metadata("design:type", String)
45
45
  ], User.prototype, "code", void 0);
46
46
  exports.User = User = __decorate([
47
- (0, typeorm_1.Entity)()
47
+ (0, typeorm_1.Entity)({
48
+ name: 'users',
49
+ })
48
50
  ], User);
49
51
  //# sourceMappingURL=user.entity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../src/entities/user.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA6E;AAGtE,IAAM,IAAI,GAAV,MAAM,IAAI;CAuBhB,CAAA;AAvBY,oBAAI;AAEf;IADC,IAAA,gCAAsB,GAAE;;gCACd;AAMX;IAJC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAU,GAAE;;4CACW;AAGxB;IADC,IAAA,gBAAM,GAAE;;kCACI;AAGb;IADC,IAAA,gBAAM,GAAE;;mCACK;AAGd;IADC,IAAA,gBAAM,GAAE;;sCACQ;AAKjB;IAHC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;;kCACY;eAtBH,IAAI;IADhB,IAAA,gBAAM,GAAE;GACI,IAAI,CAuBhB"}
1
+ {"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../src/entities/user.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA6E;AAKtE,IAAM,IAAI,GAAV,MAAM,IAAI;CAuBhB,CAAA;AAvBY,oBAAI;AAEf;IADC,IAAA,gCAAsB,GAAE;;gCACd;AAMX;IAJC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAU,GAAE;;4CACW;AAGxB;IADC,IAAA,gBAAM,GAAE;;kCACI;AAGb;IADC,IAAA,gBAAM,GAAE;;mCACK;AAGd;IADC,IAAA,gBAAM,GAAE;;sCACQ;AAKjB;IAHC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;;kCACY;eAtBH,IAAI;IAHhB,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,OAAO;KACd,CAAC;GACW,IAAI,CAuBhB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hedhog/admin",
3
- "version": "0.0.57",
3
+ "version": "0.0.59",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -1,6 +1,8 @@
1
1
  import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';
2
2
 
3
- @Entity()
3
+ @Entity({
4
+ name: 'countries',
5
+ })
4
6
  export class Country {
5
7
  @PrimaryGeneratedColumn({
6
8
  unsigned: true,
@@ -1,6 +1,8 @@
1
1
  import { Entity, PrimaryGeneratedColumn, Column, JoinColumn } from 'typeorm';
2
2
 
3
- @Entity()
3
+ @Entity({
4
+ name: 'locales',
5
+ })
4
6
  export class Locale {
5
7
  @PrimaryGeneratedColumn({
6
8
  unsigned: true,
@@ -1,6 +1,8 @@
1
1
  import { Entity, PrimaryGeneratedColumn, Column, JoinColumn } from 'typeorm';
2
2
 
3
- @Entity()
3
+ @Entity({
4
+ name: 'menus',
5
+ })
4
6
  export class Menu {
5
7
  @PrimaryGeneratedColumn()
6
8
  id: number;
@@ -1,6 +1,8 @@
1
1
  import { Entity, PrimaryGeneratedColumn, Column, JoinColumn } from 'typeorm';
2
2
 
3
- @Entity()
3
+ @Entity({
4
+ name: 'multifactors',
5
+ })
4
6
  export class Multifactor {
5
7
  @PrimaryGeneratedColumn()
6
8
  id: number;
@@ -1,6 +1,8 @@
1
1
  import { Entity, PrimaryGeneratedColumn, Column, JoinColumn } from 'typeorm';
2
2
 
3
- @Entity()
3
+ @Entity({
4
+ name: 'roles',
5
+ })
4
6
  export class Role {
5
7
  @PrimaryGeneratedColumn()
6
8
  id: number;
@@ -1,6 +1,8 @@
1
1
  import { Entity, PrimaryGeneratedColumn, Column, JoinColumn } from 'typeorm';
2
2
 
3
- @Entity()
3
+ @Entity({
4
+ name: 'routes',
5
+ })
4
6
  export class Route {
5
7
  @PrimaryGeneratedColumn()
6
8
  id: number;
@@ -1,6 +1,8 @@
1
1
  import { Entity, PrimaryGeneratedColumn, Column, JoinColumn } from 'typeorm';
2
2
 
3
- @Entity()
3
+ @Entity({
4
+ name: 'screens',
5
+ })
4
6
  export class Screen {
5
7
  @PrimaryGeneratedColumn()
6
8
  id: number;
@@ -1,6 +1,8 @@
1
1
  import { Entity, PrimaryGeneratedColumn, Column, JoinColumn } from 'typeorm';
2
2
 
3
- @Entity()
3
+ @Entity({
4
+ name: 'setting_groups',
5
+ })
4
6
  export class SettingGroup {
5
7
  @PrimaryGeneratedColumn()
6
8
  id: number;
@@ -1,6 +1,8 @@
1
1
  import { Entity, PrimaryGeneratedColumn, Column, JoinColumn } from 'typeorm';
2
2
 
3
- @Entity()
3
+ @Entity({
4
+ name: 'settings',
5
+ })
4
6
  export class Setting {
5
7
  @PrimaryGeneratedColumn()
6
8
  id: number;
@@ -1,6 +1,8 @@
1
1
  import { Entity, PrimaryGeneratedColumn, Column, JoinColumn } from 'typeorm';
2
2
 
3
- @Entity()
3
+ @Entity({
4
+ name: 'translations',
5
+ })
4
6
  export class TranslationEntity {
5
7
  @PrimaryGeneratedColumn()
6
8
  id: number;
@@ -1,6 +1,8 @@
1
1
  import { Entity, PrimaryGeneratedColumn, Column, JoinColumn } from 'typeorm';
2
2
 
3
- @Entity()
3
+ @Entity({
4
+ name: 'users',
5
+ })
4
6
  export class User {
5
7
  @PrimaryGeneratedColumn()
6
8
  id: number;
@@ -102,145 +102,6 @@ export class Migrate implements MigrationInterface {
102
102
  onDelete: 'CASCADE',
103
103
  }),
104
104
  );
105
-
106
- const menus = [
107
- {
108
- name_en: 'Dashboard',
109
- name_pt: 'Dashboard',
110
- url: '/',
111
- order: 0,
112
- icon: 'dashboard',
113
- slug: 'dashboard',
114
- },
115
- {
116
- name_en: 'Management',
117
- name_pt: 'Gereciamento',
118
- url: '/management',
119
- order: 1,
120
- icon: 'settings',
121
- slug: 'management',
122
- },
123
- ];
124
-
125
- for (const menu of menus) {
126
- const menuInserted = await queryRunner.manager.insert(Menu, {
127
- url: menu.url,
128
- order: menu.order,
129
- icon: menu.icon,
130
- slug: menu.slug,
131
- });
132
-
133
- console.log('menuInserted', menuInserted);
134
-
135
- await queryRunner.manager
136
- .createQueryBuilder()
137
- .insert()
138
- .into('menu_translations', ['menu_id', 'locale_id', 'name'])
139
- .values([
140
- {
141
- menu_id: menuInserted.identifiers[0].id,
142
- locale_id: 1,
143
- name: menu.name_en,
144
- },
145
- {
146
- menu_id: menuInserted.identifiers[0].id,
147
- locale_id: 2,
148
- name: menu.name_pt,
149
- },
150
- ])
151
- .execute();
152
- }
153
-
154
- const menusManagement = [
155
- {
156
- name_en: 'Users',
157
- name_pt: 'Usuários',
158
- url: '/management/users',
159
- order: 0,
160
- icon: 'users',
161
- slug: 'management/users',
162
- },
163
- {
164
- name_en: 'Roles',
165
- name_pt: 'Funções',
166
- url: '/management/roles',
167
- order: 1,
168
- icon: 'circles',
169
- slug: 'management/roles',
170
- },
171
- {
172
- name_en: 'Screens',
173
- name_pt: 'Telas',
174
- url: '/management/screens',
175
- order: 2,
176
- icon: 'device-tv',
177
- slug: 'management/screens',
178
- },
179
- {
180
- name_en: 'Menus',
181
- name_pt: 'Menus',
182
- url: '/management/menus',
183
- order: 3,
184
- icon: 'menu',
185
- slug: 'management/menus',
186
- },
187
- {
188
- name_en: 'Routes',
189
- name_pt: 'Rotas',
190
- url: '/management/routes',
191
- order: 4,
192
- icon: 'route',
193
- slug: 'management/routes',
194
- },
195
- {
196
- name_en: 'Settings',
197
- name_pt: 'Configurações',
198
- url: '/management/settings',
199
- order: 5,
200
- icon: 'settings',
201
- slug: 'management/settings',
202
- },
203
- ];
204
-
205
- const menuManagement = await queryRunner.manager
206
- .createQueryBuilder()
207
- .select('id')
208
- .from('menus', 'm')
209
- .where('m.url = :url', { url: '/management' })
210
- .execute();
211
-
212
- for (const menu of menusManagement) {
213
- const m = await queryRunner.manager
214
- .createQueryBuilder()
215
- .insert()
216
- .into('menus', ['url', 'order', 'icon', 'menu_id', 'slug'])
217
- .values({
218
- url: menu.url,
219
- order: menu.order,
220
- icon: menu.icon,
221
- menu_id: menuManagement[0].id,
222
- slug: menu.slug,
223
- })
224
- .execute();
225
-
226
- await queryRunner.manager
227
- .createQueryBuilder()
228
- .insert()
229
- .into('menu_translations', ['menu_id', 'locale_id', 'name'])
230
- .values([
231
- {
232
- menu_id: m.raw.insertId,
233
- locale_id: 1,
234
- name: menu.name_en,
235
- },
236
- {
237
- menu_id: m.raw.insertId,
238
- locale_id: 2,
239
- name: menu.name_pt,
240
- },
241
- ])
242
- .execute();
243
- }
244
105
  }
245
106
 
246
107
  public async down(queryRunner: QueryRunner): Promise<void> {
@@ -1,9 +1,149 @@
1
1
  import { idColumn, timestampColumn } from '@hedhog/utils';
2
2
 
3
3
  import { MigrationInterface, QueryRunner, Table, TableUnique } from 'typeorm';
4
+ import { Menu } from '../entities';
4
5
 
5
6
  export class Migrate implements MigrationInterface {
6
7
  async up(queryRunner: QueryRunner) {
8
+ const menus = [
9
+ {
10
+ name_en: 'Dashboard',
11
+ name_pt: 'Dashboard',
12
+ url: '/',
13
+ order: 0,
14
+ icon: 'dashboard',
15
+ slug: 'dashboard',
16
+ },
17
+ {
18
+ name_en: 'Management',
19
+ name_pt: 'Gereciamento',
20
+ url: '/management',
21
+ order: 1,
22
+ icon: 'settings',
23
+ slug: 'management',
24
+ },
25
+ ];
26
+
27
+ for (const menu of menus) {
28
+ const m = await queryRunner.connection.getRepository(Menu).save({
29
+ url: menu.url,
30
+ order: menu.order,
31
+ icon: menu.icon,
32
+ slug: menu.slug,
33
+ });
34
+
35
+ console.log('menuInserted', m);
36
+
37
+ await queryRunner.manager
38
+ .createQueryBuilder()
39
+ .insert()
40
+ .into('menu_translations', ['menu_id', 'locale_id', 'name'])
41
+ .values([
42
+ {
43
+ menu_id: m.id,
44
+ locale_id: 1,
45
+ name: menu.name_en,
46
+ },
47
+ {
48
+ menu_id: m.id,
49
+ locale_id: 2,
50
+ name: menu.name_pt,
51
+ },
52
+ ])
53
+ .execute();
54
+ }
55
+
56
+ const menusManagement = [
57
+ {
58
+ name_en: 'Users',
59
+ name_pt: 'Usuários',
60
+ url: '/management/users',
61
+ order: 0,
62
+ icon: 'users',
63
+ slug: 'management/users',
64
+ },
65
+ {
66
+ name_en: 'Roles',
67
+ name_pt: 'Funções',
68
+ url: '/management/roles',
69
+ order: 1,
70
+ icon: 'circles',
71
+ slug: 'management/roles',
72
+ },
73
+ {
74
+ name_en: 'Screens',
75
+ name_pt: 'Telas',
76
+ url: '/management/screens',
77
+ order: 2,
78
+ icon: 'device-tv',
79
+ slug: 'management/screens',
80
+ },
81
+ {
82
+ name_en: 'Menus',
83
+ name_pt: 'Menus',
84
+ url: '/management/menus',
85
+ order: 3,
86
+ icon: 'menu',
87
+ slug: 'management/menus',
88
+ },
89
+ {
90
+ name_en: 'Routes',
91
+ name_pt: 'Rotas',
92
+ url: '/management/routes',
93
+ order: 4,
94
+ icon: 'route',
95
+ slug: 'management/routes',
96
+ },
97
+ {
98
+ name_en: 'Settings',
99
+ name_pt: 'Configurações',
100
+ url: '/management/settings',
101
+ order: 5,
102
+ icon: 'settings',
103
+ slug: 'management/settings',
104
+ },
105
+ ];
106
+
107
+ const menuManagement = await queryRunner.manager
108
+ .createQueryBuilder()
109
+ .select('id')
110
+ .from('menus', 'm')
111
+ .where('m.url = :url', { url: '/management' })
112
+ .execute();
113
+
114
+ for (const menu of menusManagement) {
115
+ const m = await queryRunner.manager
116
+ .createQueryBuilder()
117
+ .insert()
118
+ .into('menus', ['url', 'order', 'icon', 'menu_id', 'slug'])
119
+ .values({
120
+ url: menu.url,
121
+ order: menu.order,
122
+ icon: menu.icon,
123
+ menu_id: menuManagement[0].id,
124
+ slug: menu.slug,
125
+ })
126
+ .execute();
127
+
128
+ await queryRunner.manager
129
+ .createQueryBuilder()
130
+ .insert()
131
+ .into('menu_translations', ['menu_id', 'locale_id', 'name'])
132
+ .values([
133
+ {
134
+ menu_id: m.raw.insertId,
135
+ locale_id: 1,
136
+ name: menu.name_en,
137
+ },
138
+ {
139
+ menu_id: m.raw.insertId,
140
+ locale_id: 2,
141
+ name: menu.name_pt,
142
+ },
143
+ ])
144
+ .execute();
145
+ }
146
+
7
147
  await queryRunner.createTable(
8
148
  new Table({
9
149
  name: 'routes',