@merkaly/api 0.2.4-13 → 0.2.4-14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/modules/content/pages/page.entity.d.ts +2 -5
- package/.output/modules/content/pages/page.fixture.js +2 -5
- package/.output/modules/content/pages/page.types.d.ts +12 -0
- package/.output/modules/content/pages/page.validator.d.ts +2 -5
- package/.output/modules/content/pages/page.validator.js +3 -15
- package/package.json +1 -1
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { AbstractEntity } from '../../../abstract/abstract.entity';
|
|
2
|
-
import { PageTypes } from './page.types';
|
|
3
2
|
export declare class PageEntity extends AbstractEntity {
|
|
4
3
|
static readonly $index = "content_pages";
|
|
5
|
-
|
|
4
|
+
name: string;
|
|
6
5
|
title: string;
|
|
7
6
|
description: string;
|
|
8
|
-
|
|
9
|
-
type: PageTypes;
|
|
10
|
-
content: string;
|
|
7
|
+
content: Record<string, any>;
|
|
11
8
|
}
|
|
@@ -17,7 +17,6 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.PageFixture = void 0;
|
|
19
19
|
var abstract_fixture_1 = require("../../../abstract/abstract.fixture");
|
|
20
|
-
var page_types_1 = require("./page.types");
|
|
21
20
|
var page_validator_1 = require("./page.validator");
|
|
22
21
|
var PageFixture = (function (_super) {
|
|
23
22
|
__extends(PageFixture, _super);
|
|
@@ -27,11 +26,9 @@ var PageFixture = (function (_super) {
|
|
|
27
26
|
PageFixture.prototype.normal = function () {
|
|
28
27
|
var page = new page_validator_1.CreatePageValidator();
|
|
29
28
|
page.title = this.$faker.random.words(6);
|
|
30
|
-
page.
|
|
29
|
+
page.name = this.$faker.helpers.slugify(page.title);
|
|
31
30
|
page.description = this.$faker.lorem.words(45);
|
|
32
|
-
page.
|
|
33
|
-
page.content = this.$faker.lorem.paragraph(this.$faker.datatype.number({ min: 30, max: 60 }));
|
|
34
|
-
page.type = this.$faker.helpers.arrayElement(Object.values(page_types_1.PageTypes));
|
|
31
|
+
page.content = {};
|
|
35
32
|
return page;
|
|
36
33
|
};
|
|
37
34
|
return PageFixture;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { ProductEntity } from '../../inventory/products/product.entity';
|
|
2
|
+
import { BrandEntity } from '../../inventory/brands/brand.entity';
|
|
3
|
+
import { CategoryEntity } from '../../inventory/categories/category.entity';
|
|
1
4
|
export declare enum PageTypes {
|
|
2
5
|
PAGE = "PAGE",
|
|
3
6
|
POST = "POST"
|
|
@@ -6,3 +9,12 @@ export declare enum PageEvents {
|
|
|
6
9
|
VALIDATE = "database.content.pages.validate",
|
|
7
10
|
UPSERT_ES_DOCUMENT = "database.content.pages.upsert-es-document"
|
|
8
11
|
}
|
|
12
|
+
export interface IndexPageContent {
|
|
13
|
+
hero: any[];
|
|
14
|
+
banners: any[];
|
|
15
|
+
products: ProductEntity[];
|
|
16
|
+
categories: CategoryEntity[];
|
|
17
|
+
brands: BrandEntity[];
|
|
18
|
+
promotions: unknown[];
|
|
19
|
+
services: unknown[];
|
|
20
|
+
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { PageTypes } from './page.types';
|
|
2
1
|
export declare class CreatePageValidator {
|
|
3
|
-
|
|
2
|
+
name: string;
|
|
4
3
|
title: string;
|
|
5
4
|
description: string;
|
|
6
|
-
|
|
7
|
-
type: PageTypes;
|
|
8
|
-
content: string;
|
|
5
|
+
content: Record<string, any>;
|
|
9
6
|
}
|
|
10
7
|
export declare class UpdatePageValidator extends CreatePageValidator {
|
|
11
8
|
}
|
|
@@ -26,17 +26,14 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
27
|
exports.UpdatePageValidator = exports.CreatePageValidator = void 0;
|
|
28
28
|
var class_validator_1 = require("class-validator");
|
|
29
|
-
var page_types_1 = require("./page.types");
|
|
30
29
|
var CreatePageValidator = (function () {
|
|
31
30
|
function CreatePageValidator() {
|
|
32
31
|
this.description = null;
|
|
33
|
-
this.image = null;
|
|
34
|
-
this.type = page_types_1.PageTypes.PAGE;
|
|
35
32
|
}
|
|
36
33
|
__decorate([
|
|
37
34
|
(0, class_validator_1.IsString)(),
|
|
38
35
|
__metadata("design:type", String)
|
|
39
|
-
], CreatePageValidator.prototype, "
|
|
36
|
+
], CreatePageValidator.prototype, "name", void 0);
|
|
40
37
|
__decorate([
|
|
41
38
|
(0, class_validator_1.IsString)(),
|
|
42
39
|
__metadata("design:type", String)
|
|
@@ -47,18 +44,9 @@ var CreatePageValidator = (function () {
|
|
|
47
44
|
__metadata("design:type", String)
|
|
48
45
|
], CreatePageValidator.prototype, "description", void 0);
|
|
49
46
|
__decorate([
|
|
50
|
-
(0, class_validator_1.
|
|
51
|
-
(0, class_validator_1.
|
|
52
|
-
__metadata("design:type", String)
|
|
53
|
-
], CreatePageValidator.prototype, "image", void 0);
|
|
54
|
-
__decorate([
|
|
55
|
-
(0, class_validator_1.IsString)(),
|
|
56
|
-
(0, class_validator_1.IsEnum)(page_types_1.PageTypes),
|
|
47
|
+
(0, class_validator_1.IsObject)(),
|
|
48
|
+
(0, class_validator_1.IsNotEmptyObject)(),
|
|
57
49
|
__metadata("design:type", Object)
|
|
58
|
-
], CreatePageValidator.prototype, "type", void 0);
|
|
59
|
-
__decorate([
|
|
60
|
-
(0, class_validator_1.IsString)(),
|
|
61
|
-
__metadata("design:type", String)
|
|
62
50
|
], CreatePageValidator.prototype, "content", void 0);
|
|
63
51
|
return CreatePageValidator;
|
|
64
52
|
}());
|