@hedhog/blog 0.0.12 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. package/dist/author/author.controller.d.ts +13 -5
  2. package/dist/author/author.controller.d.ts.map +1 -1
  3. package/dist/author/author.controller.js +7 -7
  4. package/dist/author/author.controller.js.map +1 -1
  5. package/dist/author/author.service.d.ts +9 -1
  6. package/dist/author/author.service.d.ts.map +1 -1
  7. package/dist/author/author.service.js +2 -1
  8. package/dist/author/author.service.js.map +1 -1
  9. package/dist/category/category.controller.d.ts +13 -5
  10. package/dist/category/category.controller.d.ts.map +1 -1
  11. package/dist/category/category.controller.js +9 -9
  12. package/dist/category/category.controller.js.map +1 -1
  13. package/dist/category/category.service.d.ts +9 -1
  14. package/dist/category/category.service.d.ts.map +1 -1
  15. package/dist/category/category.service.js +2 -1
  16. package/dist/category/category.service.js.map +1 -1
  17. package/dist/category/dto/create.dto.d.ts +1 -1
  18. package/dist/category/dto/create.dto.d.ts.map +1 -1
  19. package/dist/category/dto/create.dto.js +2 -2
  20. package/dist/category/dto/create.dto.js.map +1 -1
  21. package/dist/post/post.controller.d.ts +13 -5
  22. package/dist/post/post.controller.d.ts.map +1 -1
  23. package/dist/post/post.controller.js +7 -7
  24. package/dist/post/post.controller.js.map +1 -1
  25. package/dist/post/post.service.d.ts +9 -1
  26. package/dist/post/post.service.d.ts.map +1 -1
  27. package/dist/post/post.service.js +2 -1
  28. package/dist/post/post.service.js.map +1 -1
  29. package/hedhog.yaml +133 -133
  30. package/package.json +9 -5
  31. package/frontend/author/components/author.screen.ts +0 -105
  32. package/frontend/author/components/create-panel.tsx +0 -64
  33. package/frontend/author/components/update-panel.tsx +0 -75
  34. package/frontend/author/react-query/handlers.ts +0 -28
  35. package/frontend/author/react-query/requests.ts +0 -54
  36. package/frontend/category/components/category.screen.ts +0 -105
  37. package/frontend/category/components/create-panel.tsx +0 -53
  38. package/frontend/category/components/update-panel.tsx +0 -64
  39. package/frontend/category/react-query/handlers.ts +0 -28
  40. package/frontend/category/react-query/requests.ts +0 -55
  41. package/frontend/post/components/create-panel.tsx +0 -78
  42. package/frontend/post/components/post.screen.ts +0 -105
  43. package/frontend/post/components/update-panel.tsx +0 -89
  44. package/frontend/post/react-query/handlers.ts +0 -28
  45. package/frontend/post/react-query/requests.ts +0 -54
@@ -1,11 +1,19 @@
1
- import { CreateDTO } from "./dto/create.dto";
2
- import { DeleteDTO } from "./dto/delete.dto";
3
- import { UpdateDTO } from "./dto/update.dto";
4
- import { AuthorService } from "./author.service";
1
+ import { CreateDTO } from './dto/create.dto';
2
+ import { DeleteDTO } from './dto/delete.dto';
3
+ import { UpdateDTO } from './dto/update.dto';
4
+ import { AuthorService } from './author.service';
5
5
  export declare class AuthorController {
6
6
  private readonly authorService;
7
7
  constructor(authorService: AuthorService);
8
- list(paginationParams: any): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
8
+ list(paginationParams: any): Promise<{
9
+ total: any;
10
+ lastPage: number;
11
+ page: number;
12
+ pageSize: number;
13
+ prev: number;
14
+ next: number;
15
+ data: any;
16
+ }>;
9
17
  get(id: number): Promise<any>;
10
18
  create(data: CreateDTO): Promise<any>;
11
19
  update(id: number, data: UpdateDTO): Promise<any>;
@@ -1 +1 @@
1
- {"version":3,"file":"author.controller.d.ts","sourceRoot":"","sources":["../../src/author/author.controller.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,qBAEa,gBAAgB;IAGzB,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAIzC,IAAI,CAAe,gBAAgB,KAAA;IAKnC,GAAG,CAA4B,EAAE,EAAE,MAAM;IAKzC,MAAM,CAAS,IAAI,EAAE,SAAS;IAK9B,MAAM,CAA4B,EAAE,EAAE,MAAM,EAAU,IAAI,EAAE,SAAS;IAQrE,MAAM,CAAS,IAAI,EAAE,SAAS;CAGrC"}
1
+ {"version":3,"file":"author.controller.d.ts","sourceRoot":"","sources":["../../src/author/author.controller.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,qBAEa,gBAAgB;IAGzB,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAIzC,IAAI,CAAe,gBAAgB,KAAA;;;;;;;;;IAKnC,GAAG,CAA4B,EAAE,EAAE,MAAM;IAKzC,MAAM,CAAS,IAAI,EAAE,SAAS;IAK9B,MAAM,CAA4B,EAAE,EAAE,MAAM,EAAU,IAAI,EAAE,SAAS;IAQrE,MAAM,CAAS,IAAI,EAAE,SAAS;CAGrC"}
@@ -19,7 +19,7 @@ const create_dto_1 = require("./dto/create.dto");
19
19
  const delete_dto_1 = require("./dto/delete.dto");
20
20
  const update_dto_1 = require("./dto/update.dto");
21
21
  const author_service_1 = require("./author.service");
22
- const admin_1 = require("@hedhog/admin");
22
+ const core_1 = require("@hedhog/core");
23
23
  let AuthorController = class AuthorController {
24
24
  constructor(authorService) {
25
25
  this.authorService = authorService;
@@ -52,8 +52,8 @@ __decorate([
52
52
  __metadata("design:returntype", Promise)
53
53
  ], AuthorController.prototype, "list", null);
54
54
  __decorate([
55
- (0, common_1.Get)(":id"),
56
- __param(0, (0, common_1.Param)("id", common_1.ParseIntPipe)),
55
+ (0, common_1.Get)(':id'),
56
+ __param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
57
57
  __metadata("design:type", Function),
58
58
  __metadata("design:paramtypes", [Number]),
59
59
  __metadata("design:returntype", Promise)
@@ -66,8 +66,8 @@ __decorate([
66
66
  __metadata("design:returntype", Promise)
67
67
  ], AuthorController.prototype, "create", null);
68
68
  __decorate([
69
- (0, common_1.Patch)(":id"),
70
- __param(0, (0, common_1.Param)("id", common_1.ParseIntPipe)),
69
+ (0, common_1.Patch)(':id'),
70
+ __param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
71
71
  __param(1, (0, common_1.Body)()),
72
72
  __metadata("design:type", Function),
73
73
  __metadata("design:paramtypes", [Number, update_dto_1.UpdateDTO]),
@@ -81,8 +81,8 @@ __decorate([
81
81
  __metadata("design:returntype", Promise)
82
82
  ], AuthorController.prototype, "delete", null);
83
83
  exports.AuthorController = AuthorController = __decorate([
84
- (0, admin_1.Role)(),
85
- (0, common_1.Controller)("author"),
84
+ (0, core_1.Role)(),
85
+ (0, common_1.Controller)('author'),
86
86
  __param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => author_service_1.AuthorService))),
87
87
  __metadata("design:paramtypes", [author_service_1.AuthorService])
88
88
  ], AuthorController);
@@ -1 +1 @@
1
- {"version":3,"file":"author.controller.js","sourceRoot":"","sources":["../../src/author/author.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAgD;AAChD,2CAWwB;AACxB,iDAA6C;AAC7C,iDAA6C;AAC7C,iDAA6C;AAC7C,qDAAiD;AACjD,yCAAqC;AAI9B,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAC3B,YAEmB,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAC5C,CAAC;IAGE,AAAN,KAAK,CAAC,IAAI,CAAe,gBAAgB;QACvC,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACnD,CAAC;IAGK,AAAN,KAAK,CAAC,GAAG,CAA4B,EAAU;QAC7C,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACpC,C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AC;IACC,WAAA,IAAA,cAAK,EAAC,IAAI,EAAE,qBAAY,CAAC,CAAA;IAAc,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAO,sBAAS;;8CAK1E;AAGK;IADL,IAAA,eAAM,GAAE;IACK,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAO,sBAAS;;8CAEnC;2BAhCU,gBAAgB;IAF5B,IAAA,WAAI,GAAE;IACN,IAAA,mBAAU,EAAC,QAAQ,CAAC;IAGhB,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,8BAAa,CAAC,CAAC,CAAA;qCACR,8BAAa;GAHpC,gBAAgB,CAiC5B"}
@@ -7,7 +7,15 @@ export declare class AuthorService {
7
7
  private readonly prismaService;
8
8
  private readonly paginationService;
9
9
  constructor(prismaService: PrismaService, paginationService: PaginationService);
10
- list(paginationParams: PaginationDTO): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
10
+ list(paginationParams: PaginationDTO): Promise<{
11
+ total: any;
12
+ lastPage: number;
13
+ page: number;
14
+ pageSize: number;
15
+ prev: number;
16
+ next: number;
17
+ data: any;
18
+ }>;
11
19
  get(authorId: number): Promise<any>;
12
20
  create(data: CreateDTO): Promise<any>;
13
21
  update({ id, data }: {
@@ -1 +1 @@
1
- {"version":3,"file":"author.service.d.ts","sourceRoot":"","sources":["../../src/author/author.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAO/C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,qBACa,aAAa;IAGtB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAE9B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;gBAFjB,aAAa,EAAE,aAAa,EAE5B,iBAAiB,EAAE,iBAAiB;IAGjD,IAAI,CAAC,gBAAgB,EAAE,aAAa;IAkBpC,GAAG,CAAC,QAAQ,EAAE,MAAM;IAMpB,MAAM,CAAC,IAAI,EAAE,SAAS;IAMtB,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,SAAS,CAAA;KAAE;IAOpD,MAAM,CAAC,EAAE,GAAG,EAAE,EAAE,SAAS;CAehC"}
1
+ {"version":3,"file":"author.service.d.ts","sourceRoot":"","sources":["../../src/author/author.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAO/C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,qBACa,aAAa;IAGtB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAE9B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;gBAFjB,aAAa,EAAE,aAAa,EAE5B,iBAAiB,EAAE,iBAAiB;IAGjD,IAAI,CAAC,gBAAgB,EAAE,aAAa;;;;;;;;;IAsBpC,GAAG,CAAC,QAAQ,EAAE,MAAM;IAMpB,MAAM,CAAC,IAAI,EAAE,SAAS;IAMtB,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,SAAS,CAAA;KAAE;IAOpD,MAAM,CAAC,EAAE,GAAG,EAAE,EAAE,SAAS;CAehC"}
@@ -22,7 +22,8 @@ let AuthorService = class AuthorService {
22
22
  this.paginationService = paginationService;
23
23
  }
24
24
  async list(paginationParams) {
25
- const OR = [];
25
+ const fields = ["name", "email"];
26
+ const OR = this.prismaService.createInsensitiveSearch(fields, paginationParams);
26
27
  if (!isNaN(+paginationParams.search)) {
27
28
  OR.push({ id: { equals: +paginationParams.search } });
28
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"author.service.js","sourceRoot":"","sources":["../../src/author/author.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAsE;AACtE,2CAA+C;AAC/C,2CAKwB;AAMjB,IAAM,aAAa,GAAnB,MAAM,aAAa;IACxB,YAEmB,aAA4B,EAE5B,iBAAoC;QAFpC,kBAAa,GAAb,aAAa,CAAe;QAE5B,sBAAiB,GAAjB,iBAAiB,CAAmB;IACpD,CAAC;IAEJ,KAAK,CAAC,IAAI,CAAC,gBAA+B;QACxC,MAAM,EAAE,GAAU,EAAE,CAAC;QAErB,IAAI,CAAC,KAAK,CAAC,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC;YACrC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,gBAAgB,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACxD,CAAC;QAED,OAAO,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CACpC,IAAI,CAAC,aAAa,CAAC,MAAM,EACzB,gBAAgB,EAChB;YACE,KAAK,EAAE;gBACL,EAAE;aACH;SACF,CACF,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,QAAgB;QACxB,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC;YAC1C,KAAK,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE;SACxB,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,IAAe;QAC1B,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC;YACtC,IAAI;SACL,CAAC,CAAC;IACL,CAAC;I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,EAAE;oBACF,EAAE,EAAE,GAAG;iBACR;aACF;SACF,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAhEY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,sBAAa,CAAC,CAAC,CAAA;IAEvC,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,8BAAiB,CAAC,CAAC,CAAA;qCADZ,sBAAa;QAET,8BAAiB;GAL5C,aAAa,CAgEzB"}
@@ -1,11 +1,19 @@
1
- import { CreateDTO } from "./dto/create.dto";
2
- import { DeleteDTO } from "./dto/delete.dto";
3
- import { UpdateDTO } from "./dto/update.dto";
4
- import { CategoryService } from "./category.service";
1
+ import { CreateDTO } from './dto/create.dto';
2
+ import { DeleteDTO } from './dto/delete.dto';
3
+ import { UpdateDTO } from './dto/update.dto';
4
+ import { CategoryService } from './category.service';
5
5
  export declare class CategoryController {
6
6
  private readonly categoryService;
7
7
  constructor(categoryService: CategoryService);
8
- list(paginationParams: any, locale: any): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
8
+ list(paginationParams: any, locale: any): Promise<{
9
+ total: any;
10
+ lastPage: number;
11
+ page: number;
12
+ pageSize: number;
13
+ prev: number;
14
+ next: number;
15
+ data: any;
16
+ }>;
9
17
  get(id: number): Promise<any>;
10
18
  create(data: CreateDTO): Promise<any>;
11
19
  update(id: number, data: UpdateDTO): Promise<any>;
@@ -1 +1 @@
1
- {"version":3,"file":"category.controller.d.ts","sourceRoot":"","sources":["../../src/category/category.controller.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGrD,qBAEa,kBAAkB;IAG3B,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAAf,eAAe,EAAE,eAAe;IAI7C,IAAI,CAAe,gBAAgB,KAAA,EAAY,MAAM,KAAA;IAKrD,GAAG,CAA4B,EAAE,EAAE,MAAM;IAKzC,MAAM,CAAS,IAAI,EAAE,SAAS;IAK9B,MAAM,CAA4B,EAAE,EAAE,MAAM,EAAU,IAAI,EAAE,SAAS;IAQrE,MAAM,CAAS,IAAI,EAAE,SAAS;CAGrC"}
1
+ {"version":3,"file":"category.controller.d.ts","sourceRoot":"","sources":["../../src/category/category.controller.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGrD,qBAEa,kBAAkB;IAG3B,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAAf,eAAe,EAAE,eAAe;IAI7C,IAAI,CAAe,gBAAgB,KAAA,EAAY,MAAM,KAAA;;;;;;;;;IAKrD,GAAG,CAA4B,EAAE,EAAE,MAAM;IAKzC,MAAM,CAAS,IAAI,EAAE,SAAS;IAK9B,MAAM,CAA4B,EAAE,EAAE,MAAM,EAAU,IAAI,EAAE,SAAS;IAQrE,MAAM,CAAS,IAAI,EAAE,SAAS;CAGrC"}
@@ -13,14 +13,14 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.CategoryController = void 0;
16
- const admin_1 = require("@hedhog/admin");
16
+ const locale_1 = require("@hedhog/locale");
17
17
  const pagination_1 = require("@hedhog/pagination");
18
18
  const common_1 = require("@nestjs/common");
19
19
  const create_dto_1 = require("./dto/create.dto");
20
20
  const delete_dto_1 = require("./dto/delete.dto");
21
21
  const update_dto_1 = require("./dto/update.dto");
22
22
  const category_service_1 = require("./category.service");
23
- const admin_2 = require("@hedhog/admin");
23
+ const core_1 = require("@hedhog/core");
24
24
  let CategoryController = class CategoryController {
25
25
  constructor(categoryService) {
26
26
  this.categoryService = categoryService;
@@ -48,14 +48,14 @@ exports.CategoryController = CategoryController;
48
48
  __decorate([
49
49
  (0, common_1.Get)(),
50
50
  __param(0, (0, pagination_1.Pagination)()),
51
- __param(1, (0, admin_1.Locale)()),
51
+ __param(1, (0, locale_1.Locale)()),
52
52
  __metadata("design:type", Function),
53
53
  __metadata("design:paramtypes", [Object, Object]),
54
54
  __metadata("design:returntype", Promise)
55
55
  ], CategoryController.prototype, "list", null);
56
56
  __decorate([
57
- (0, common_1.Get)(":id"),
58
- __param(0, (0, common_1.Param)("id", common_1.ParseIntPipe)),
57
+ (0, common_1.Get)(':id'),
58
+ __param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
59
59
  __metadata("design:type", Function),
60
60
  __metadata("design:paramtypes", [Number]),
61
61
  __metadata("design:returntype", Promise)
@@ -68,8 +68,8 @@ __decorate([
68
68
  __metadata("design:returntype", Promise)
69
69
  ], CategoryController.prototype, "create", null);
70
70
  __decorate([
71
- (0, common_1.Patch)(":id"),
72
- __param(0, (0, common_1.Param)("id", common_1.ParseIntPipe)),
71
+ (0, common_1.Patch)(':id'),
72
+ __param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
73
73
  __param(1, (0, common_1.Body)()),
74
74
  __metadata("design:type", Function),
75
75
  __metadata("design:paramtypes", [Number, update_dto_1.UpdateDTO]),
@@ -83,8 +83,8 @@ __decorate([
83
83
  __metadata("design:returntype", Promise)
84
84
  ], CategoryController.prototype, "delete", null);
85
85
  exports.CategoryController = CategoryController = __decorate([
86
- (0, admin_2.Role)(),
87
- (0, common_1.Controller)("category"),
86
+ (0, core_1.Role)(),
87
+ (0, common_1.Controller)('category'),
88
88
  __param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => category_service_1.CategoryService))),
89
89
  __metadata("design:paramtypes", [category_service_1.CategoryService])
90
90
  ], CategoryController);
@@ -1 +1 @@
1
- {"version":3,"file":"category.controller.js","sourceRoot":"","sources":["../../src/category/category.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,yCAAuC;AACvC,mDAAgD;AAChD,2CAWwB;AACxB,iDAA6C;AAC7C,iDAA6C;AAC7C,iDAA6C;AAC7C,yDAAqD;AACrD,yCAAqC;AAI9B,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC7B,YAEmB,eAAgC;QAAhC,oBAAe,GAAf,eAAe,CAAiB;IAChD,CAAC;IAGE,AAAN,KAAK,CAAC,IAAI,CAAe,gBAAgB,EAAY,MAAM;QACzD,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC7D,CAAC;IAGK,AAAN,KAAK,CAAC,GAAG,CAA4B,EAAU;QAC7C,OAAO,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACtC,CAAC;IAGK,AAAN,KAAK,CAAC,MAAM,CAAS,IAAe;QAClC,OAAO,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAGK,AAAN,KAAK,CAAC,MAAM,CAA4B,EAAU,EAAU,IAAe;QACzE,OAAO,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC;YACjC,EAAE;YACF,IAAI;SACL,CAAC,CAAC;IACL,CAAC;IAGK,AAAN,KAAK,CAAC,MAAM,CAAS,IAAe;QAClC,OAAO,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;CACF,CAAA;AAjCY,gDAAkB;AAOvB;IADL,IAAA,YAAG,GAAE;IACM,WAAA,IAAA,uBAAU,GAAE,CAAA;IAAoB,WAAA,IAAA,cAAM,GAAE,CAAA;;;;8CAE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
@@ -7,7 +7,15 @@ export declare class CategoryService {
7
7
  private readonly prismaService;
8
8
  private readonly paginationService;
9
9
  constructor(prismaService: PrismaService, paginationService: PaginationService);
10
- list(locale: string, paginationParams: PaginationDTO): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
10
+ list(locale: string, paginationParams: PaginationDTO): Promise<{
11
+ total: any;
12
+ lastPage: number;
13
+ page: number;
14
+ pageSize: number;
15
+ prev: number;
16
+ next: number;
17
+ data: any;
18
+ }>;
11
19
  get(categoryId: number): Promise<any>;
12
20
  create(data: CreateDTO): Promise<any>;
13
21
  update({ id, data }: {
@@ -1 +1 @@
1
- {"version":3,"file":"category.service.d.ts","sourceRoot":"","sources":["../../src/category/category.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAO/C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,qBACa,eAAe;IAGxB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAE9B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;gBAFjB,aAAa,EAAE,aAAa,EAE5B,iBAAiB,EAAE,iBAAiB;IAGjD,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,aAAa;IAkCpD,GAAG,CAAC,UAAU,EAAE,MAAM;IAMtB,MAAM,CAAC,IAAI,EAAE,SAAS;IAMtB,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,SAAS,CAAA;KAAE;IAOpD,MAAM,CAAC,EAAE,GAAG,EAAE,EAAE,SAAS;CAehC"}
1
+ {"version":3,"file":"category.service.d.ts","sourceRoot":"","sources":["../../src/category/category.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAO/C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,qBACa,eAAe;IAGxB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAE9B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;gBAFjB,aAAa,EAAE,aAAa,EAE5B,iBAAiB,EAAE,iBAAiB;IAGjD,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,aAAa;;;;;;;;;IAsCpD,GAAG,CAAC,UAAU,EAAE,MAAM;IAMtB,MAAM,CAAC,IAAI,EAAE,SAAS;IAMtB,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,SAAS,CAAA;KAAE;IAOpD,MAAM,CAAC,EAAE,GAAG,EAAE,EAAE,SAAS;CAehC"}
@@ -22,7 +22,8 @@ let CategoryService = class CategoryService {
22
22
  this.paginationService = paginationService;
23
23
  }
24
24
  async list(locale, paginationParams) {
25
- const OR = [];
25
+ const fields = ["slug"];
26
+ const OR = this.prismaService.createInsensitiveSearch(fields, paginationParams);
26
27
  const include = {
27
28
  category: {
28
29
  select: {
@@ -1 +1 @@
1
- {"version":3,"file":"category.service.js","sourceRoot":"","sources":["../../src/category/category.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAsE;AACtE,2CAA+C;AAC/C,2CAKwB;AAMjB,IAAM,eAAe,GAArB,MAAM,eAAe;IAC1B,YAEmB,aAA4B,EAE5B,iBAAoC;QAFpC,kB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MAAM,IAAI,4BAAmB,CAC3B,8CAA8C,CAC/C,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,UAAU,CAAC;YAC5C,KAAK,EAAE;gBACL,EAAE,EAAE;oBACF,EAAE,EAAE,GAAG;iBACR;aACF;SACF,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AA5EY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,sBAAa,CAAC,CAAC,CAAA;IAEvC,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,8BAAiB,CAAC,CAAC,CAAA;qCADZ,sBAAa;QAET,8BAAiB;GAL5C,eAAe,CA4E3B"}
1
+ {"version":3,"file":"category.service.js","sourceRoot":"","sources":["../../src/category/category.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAsE;AACtE,2CAA+C;AAC/C,2CAKwB;AAMjB,IAAM,eAAe,GAArB,MAAM,eAAe;IAC1B,YAEmB,aAA4B,EAE5B,iBAAoC;QAFpC,kBAAa,GAAb,aAAa,CAAe;QAE5B,sBAAiB,GAAjB,iBAAiB,CAAmB;IACpD,CAAC;IAEJ,KAAK,CAAC,IAAI,CAAC,MAAc,EAAE,gBAA+B;QACxD,MAAM,MAAM,GAAG,CAAC,MAAM,CAAC,CAAC;QACxB,MAAM,EAAE,GAAU,IAAI,CAAC,aAAa,CAAC,uBAAuB,CAC1D,MAAM,EACN,gBAAgB,CACjB,CAAC;QAEF,MAAM,OAAO,GAAG;YACd,QAAQ,EAAE;gBACR,MAAM,EAAE;oBACN,EAAE,EAAE,IAAI;oBACR,eAAe,EAAE;wBACf,KAAK,EAAE;4BACL,MAAM,EAAE;gCACN,IAAI,EAAE,MAAM;6BACb;yBACF;wBACD,MAAM,EAAE;4BACN,IAAI,EAAE,IAAI;yBACX;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C,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,8BAAiB,CAAC,CAAC,CAAA;qCADZ,sBAAa;QAET,8BAAiB;GAL5C,eAAe,CAgF3B"}
@@ -1,4 +1,4 @@
1
- import { WithLocaleDTO } from '@hedhog/admin';
1
+ import { WithLocaleDTO } from '@hedhog/locale';
2
2
  export declare class CreateDTO extends WithLocaleDTO {
3
3
  slug: string;
4
4
  }
@@ -1 +1 @@
1
- {"version":3,"file":"create.dto.d.ts","sourceRoot":"","sources":["../../../src/category/dto/create.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,qBAAa,SAAU,SAAQ,aAAa;IAG1C,IAAI,EAAE,MAAM,CAAC;CACd"}
1
+ {"version":3,"file":"create.dto.d.ts","sourceRoot":"","sources":["../../../src/category/dto/create.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,qBAAa,SAAU,SAAQ,aAAa;IAG1C,IAAI,EAAE,MAAM,CAAC;CACd"}
@@ -11,8 +11,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.CreateDTO = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
- const admin_1 = require("@hedhog/admin");
15
- class CreateDTO extends admin_1.WithLocaleDTO {
14
+ const locale_1 = require("@hedhog/locale");
15
+ class CreateDTO extends locale_1.WithLocaleDTO {
16
16
  }
17
17
  exports.CreateDTO = CreateDTO;
18
18
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"create.dto.js","sourceRoot":"","sources":["../../../src/category/dto/create.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAmD;AACnD,yCAA8C;AAE9C,MAAa,SAAU,SAAQ,qBAAa;CAI3C;AAJD,8BAIC;AADC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,wBAAM,EAAC,CAAC,EAAE,GAAG,CAAC;;uCACF"}
1
+ {"version":3,"file":"create.dto.js","sourceRoot":"","sources":["../../../src/category/dto/create.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAmD;AACnD,2CAA+C;AAE/C,MAAa,SAAU,SAAQ,sBAAa;CAI3C;AAJD,8BAIC;AADC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,wBAAM,EAAC,CAAC,EAAE,GAAG,CAAC;;uCACF"}
@@ -1,11 +1,19 @@
1
- import { CreateDTO } from "./dto/create.dto";
2
- import { DeleteDTO } from "./dto/delete.dto";
3
- import { UpdateDTO } from "./dto/update.dto";
4
- import { PostService } from "./post.service";
1
+ import { CreateDTO } from './dto/create.dto';
2
+ import { DeleteDTO } from './dto/delete.dto';
3
+ import { UpdateDTO } from './dto/update.dto';
4
+ import { PostService } from './post.service';
5
5
  export declare class PostController {
6
6
  private readonly postService;
7
7
  constructor(postService: PostService);
8
- list(paginationParams: any): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
8
+ list(paginationParams: any): Promise<{
9
+ total: any;
10
+ lastPage: number;
11
+ page: number;
12
+ pageSize: number;
13
+ prev: number;
14
+ next: number;
15
+ data: any;
16
+ }>;
9
17
  get(id: number): Promise<any>;
10
18
  create(data: CreateDTO): Promise<any>;
11
19
  update(id: number, data: UpdateDTO): Promise<any>;
@@ -1 +1 @@
1
- {"version":3,"file":"post.controller.d.ts","sourceRoot":"","sources":["../../src/post/post.controller.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,qBAEa,cAAc;IAGvB,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAAX,WAAW,EAAE,WAAW;IAIrC,IAAI,CAAe,gBAAgB,KAAA;IAKnC,GAAG,CAA4B,EAAE,EAAE,MAAM;IAKzC,MAAM,CAAS,IAAI,EAAE,SAAS;IAK9B,MAAM,CAA4B,EAAE,EAAE,MAAM,EAAU,IAAI,EAAE,SAAS;IAQrE,MAAM,CAAS,IAAI,EAAE,SAAS;CAGrC"}
1
+ {"version":3,"file":"post.controller.d.ts","sourceRoot":"","sources":["../../src/post/post.controller.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,qBAEa,cAAc;IAGvB,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAAX,WAAW,EAAE,WAAW;IAIrC,IAAI,CAAe,gBAAgB,KAAA;;;;;;;;;IAKnC,GAAG,CAA4B,EAAE,EAAE,MAAM;IAKzC,MAAM,CAAS,IAAI,EAAE,SAAS;IAK9B,MAAM,CAA4B,EAAE,EAAE,MAAM,EAAU,IAAI,EAAE,SAAS;IAQrE,MAAM,CAAS,IAAI,EAAE,SAAS;CAGrC"}
@@ -19,7 +19,7 @@ const create_dto_1 = require("./dto/create.dto");
19
19
  const delete_dto_1 = require("./dto/delete.dto");
20
20
  const update_dto_1 = require("./dto/update.dto");
21
21
  const post_service_1 = require("./post.service");
22
- const admin_1 = require("@hedhog/admin");
22
+ const core_1 = require("@hedhog/core");
23
23
  let PostController = class PostController {
24
24
  constructor(postService) {
25
25
  this.postService = postService;
@@ -52,8 +52,8 @@ __decorate([
52
52
  __metadata("design:returntype", Promise)
53
53
  ], PostController.prototype, "list", null);
54
54
  __decorate([
55
- (0, common_1.Get)(":id"),
56
- __param(0, (0, common_1.Param)("id", common_1.ParseIntPipe)),
55
+ (0, common_1.Get)(':id'),
56
+ __param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
57
57
  __metadata("design:type", Function),
58
58
  __metadata("design:paramtypes", [Number]),
59
59
  __metadata("design:returntype", Promise)
@@ -66,8 +66,8 @@ __decorate([
66
66
  __metadata("design:returntype", Promise)
67
67
  ], PostController.prototype, "create", null);
68
68
  __decorate([
69
- (0, common_1.Patch)(":id"),
70
- __param(0, (0, common_1.Param)("id", common_1.ParseIntPipe)),
69
+ (0, common_1.Patch)(':id'),
70
+ __param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
71
71
  __param(1, (0, common_1.Body)()),
72
72
  __metadata("design:type", Function),
73
73
  __metadata("design:paramtypes", [Number, update_dto_1.UpdateDTO]),
@@ -81,8 +81,8 @@ __decorate([
81
81
  __metadata("design:returntype", Promise)
82
82
  ], PostController.prototype, "delete", null);
83
83
  exports.PostController = PostController = __decorate([
84
- (0, admin_1.Role)(),
85
- (0, common_1.Controller)("post"),
84
+ (0, core_1.Role)(),
85
+ (0, common_1.Controller)('post'),
86
86
  __param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => post_service_1.PostService))),
87
87
  __metadata("design:paramtypes", [post_service_1.PostService])
88
88
  ], PostController);
@@ -1 +1 @@
1
- {"version":3,"file":"post.controller.js","sourceRoot":"","sources":["../../src/post/post.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAgD;AAChD,2CAWwB;AACxB,iDAA6C;AAC7C,iDAA6C;AAC7C,iDAA6C;AAC7C,iDAA6C;AAC7C,yCAAqC;AAI9B,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YAEmB,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;IACxC,CAAC;IAGE,AAAN,KAAK,CAAC,IAAI,CAAe,gBAAgB;QACvC,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACjD,CAAC;IAGK,AAAN,KAAK,CAAC,GAAG,CAA4B,EAA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CAAO,sBAAS;;4CAEnC;AAGK;IADL,IAAA,cAAK,EAAC,KAAK,CAAC;IACC,WAAA,IAAA,cAAK,EAAC,IAAI,EAAE,qBAAY,CAAC,CAAA;IAAc,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAO,sBAAS;;4CAK1E;AAGK;IADL,IAAA,eAAM,GAAE;IACK,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAO,sBAAS;;4CAEnC;yBAhCU,cAAc;IAF1B,IAAA,WAAI,GAAE;IACN,IAAA,mBAAU,EAAC,MAAM,CAAC;IAGd,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,0BAAW,CAAC,CAAC,CAAA;qCACR,0BAAW;GAHhC,cAAc,CAiC1B"}
@@ -7,7 +7,15 @@ export declare class PostService {
7
7
  private readonly prismaService;
8
8
  private readonly paginationService;
9
9
  constructor(prismaService: PrismaService, paginationService: PaginationService);
10
- list(paginationParams: PaginationDTO): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
10
+ list(paginationParams: PaginationDTO): Promise<{
11
+ total: any;
12
+ lastPage: number;
13
+ page: number;
14
+ pageSize: number;
15
+ prev: number;
16
+ next: number;
17
+ data: any;
18
+ }>;
11
19
  get(postId: number): Promise<any>;
12
20
  create(data: CreateDTO): Promise<any>;
13
21
  update({ id, data }: {
@@ -1 +1 @@
1
- {"version":3,"file":"post.service.d.ts","sourceRoot":"","sources":["../../src/post/post.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAO/C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,qBACa,WAAW;IAGpB,OAAO,C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,8 @@ let PostService = class PostService {
22
22
  this.paginationService = paginationService;
23
23
  }
24
24
  async list(paginationParams) {
25
- const OR = [];
25
+ const fields = ["title", "content"];
26
+ const OR = this.prismaService.createInsensitiveSearch(fields, paginationParams);
26
27
  if (!isNaN(+paginationParams.search)) {
27
28
  OR.push({ id: { equals: +paginationParams.search } });
28
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"post.service.js","sourceRoot":"","sources":["../../src/post/post.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAsE;AACtE,2CAA+C;AAC/C,2CAKwB;AAMjB,IAAM,WAAW,GAAjB,MAAM,WAAW;IACtB,YAEmB,aAA4B,EAE5B,iBAAoC;QAFpC,kBAAa,GAAb,aAAa,CAAe;QAE5B,sBAAiB,GAAjB,iBAAiB,CAAmB;IACpD,CAAC;IAEJ,KAAK,CAAC,IAAI,CAAC,gBAA+B;QACxC,MAAM,EAAE,GAAU,EAAE,CAAC;QAErB,IAAI,CAAC,KAAK,CAAC,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC;YACrC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,gBAAgB,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACxD,CAAC;QAED,OAAO,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CACpC,IAAI,CAAC,aAAa,CAAC,IAAI,EACvB,gBAAgB,EAChB;YACE,KAAK,EAAE;gBACL,EAAE;aACH;SACF,CACF,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,MAAc;QACtB,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC;YACxC,KAAK,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;SACtB,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,IAAe;QAC1B,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC;YAC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