@merkaly/api 0.2.2-28 → 0.2.2-29
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.document.d.ts +10 -0
- package/.output/modules/content/pages/page.document.js +32 -0
- package/.output/modules/content/pages/page.entity.d.ts +11 -0
- package/.output/modules/content/pages/page.entity.js +69 -0
- package/.output/modules/content/pages/page.types.d.ts +8 -0
- package/.output/modules/content/pages/page.types.js +13 -0
- package/.output/modules/content/pages/page.validator.d.ts +11 -0
- package/.output/modules/content/pages/page.validator.js +73 -0
- package/package.json +2 -2
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AbstractDocument } from '../../../abstract/abstract.document';
|
|
2
|
+
import { PageTypes } from './page.types';
|
|
3
|
+
export declare class PageDocument extends AbstractDocument {
|
|
4
|
+
slug: string;
|
|
5
|
+
title: string;
|
|
6
|
+
content: string;
|
|
7
|
+
description: string;
|
|
8
|
+
image: string;
|
|
9
|
+
type: PageTypes;
|
|
10
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.PageDocument = void 0;
|
|
19
|
+
var abstract_document_1 = require("../../../abstract/abstract.document");
|
|
20
|
+
var page_types_1 = require("./page.types");
|
|
21
|
+
var PageDocument = (function (_super) {
|
|
22
|
+
__extends(PageDocument, _super);
|
|
23
|
+
function PageDocument() {
|
|
24
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
25
|
+
_this.description = null;
|
|
26
|
+
_this.image = null;
|
|
27
|
+
_this.type = page_types_1.PageTypes.PAGE;
|
|
28
|
+
return _this;
|
|
29
|
+
}
|
|
30
|
+
return PageDocument;
|
|
31
|
+
}(abstract_document_1.AbstractDocument));
|
|
32
|
+
exports.PageDocument = PageDocument;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AbstractEntity } from '../../../abstract/abstract.entity';
|
|
2
|
+
import { PageTypes } from './page.types';
|
|
3
|
+
export declare class PageEntity extends AbstractEntity {
|
|
4
|
+
static readonly $index = "content_pages";
|
|
5
|
+
slug: string;
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
image: string;
|
|
9
|
+
type: PageTypes;
|
|
10
|
+
content: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.PageEntity = void 0;
|
|
28
|
+
var mongoose_1 = require("@nestjs/mongoose");
|
|
29
|
+
var mongoose_2 = require("mongoose");
|
|
30
|
+
var abstract_entity_1 = require("../../../abstract/abstract.entity");
|
|
31
|
+
var page_types_1 = require("./page.types");
|
|
32
|
+
var PageEntity = (function (_super) {
|
|
33
|
+
__extends(PageEntity, _super);
|
|
34
|
+
function PageEntity() {
|
|
35
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
36
|
+
_this.type = page_types_1.PageTypes.PAGE;
|
|
37
|
+
return _this;
|
|
38
|
+
}
|
|
39
|
+
PageEntity.$index = 'content_pages';
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true, unique: true, length: 128 }),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], PageEntity.prototype, "slug", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true }),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], PageEntity.prototype, "title", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, default: null }),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], PageEntity.prototype, "description", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, default: null }),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], PageEntity.prototype, "image", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, enum: page_types_1.PageTypes, required: true, default: page_types_1.PageTypes.PAGE }),
|
|
58
|
+
__metadata("design:type", Object)
|
|
59
|
+
], PageEntity.prototype, "type", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true }),
|
|
62
|
+
__metadata("design:type", String)
|
|
63
|
+
], PageEntity.prototype, "content", void 0);
|
|
64
|
+
PageEntity = __decorate([
|
|
65
|
+
(0, mongoose_1.Schema)({ timestamps: true })
|
|
66
|
+
], PageEntity);
|
|
67
|
+
return PageEntity;
|
|
68
|
+
}(abstract_entity_1.AbstractEntity));
|
|
69
|
+
exports.PageEntity = PageEntity;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PageEvents = exports.PageTypes = void 0;
|
|
4
|
+
var PageTypes;
|
|
5
|
+
(function (PageTypes) {
|
|
6
|
+
PageTypes["PAGE"] = "PAGE";
|
|
7
|
+
PageTypes["POST"] = "POST";
|
|
8
|
+
})(PageTypes = exports.PageTypes || (exports.PageTypes = {}));
|
|
9
|
+
var PageEvents;
|
|
10
|
+
(function (PageEvents) {
|
|
11
|
+
PageEvents["VALIDATE"] = "database.content.pages.validate";
|
|
12
|
+
PageEvents["UPSERT_ES_DOCUMENT"] = "database.content.pages.upsert-es-document";
|
|
13
|
+
})(PageEvents = exports.PageEvents || (exports.PageEvents = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PageTypes } from './page.types';
|
|
2
|
+
export declare class CreatePageValidator {
|
|
3
|
+
slug: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
image: string;
|
|
7
|
+
type: PageTypes;
|
|
8
|
+
content: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class UpdatePageValidator extends CreatePageValidator {
|
|
11
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.UpdatePageValidator = exports.CreatePageValidator = void 0;
|
|
28
|
+
var class_validator_1 = require("class-validator");
|
|
29
|
+
var page_types_1 = require("./page.types");
|
|
30
|
+
var CreatePageValidator = (function () {
|
|
31
|
+
function CreatePageValidator() {
|
|
32
|
+
this.description = null;
|
|
33
|
+
this.image = null;
|
|
34
|
+
this.type = page_types_1.PageTypes.PAGE;
|
|
35
|
+
}
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, class_validator_1.IsString)(),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], CreatePageValidator.prototype, "slug", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, class_validator_1.IsString)(),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], CreatePageValidator.prototype, "title", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, class_validator_1.IsString)(),
|
|
46
|
+
(0, class_validator_1.IsOptional)(),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], CreatePageValidator.prototype, "description", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, class_validator_1.IsUrl)(),
|
|
51
|
+
(0, class_validator_1.IsOptional)(),
|
|
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),
|
|
57
|
+
__metadata("design:type", Object)
|
|
58
|
+
], CreatePageValidator.prototype, "type", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, class_validator_1.IsString)(),
|
|
61
|
+
__metadata("design:type", String)
|
|
62
|
+
], CreatePageValidator.prototype, "content", void 0);
|
|
63
|
+
return CreatePageValidator;
|
|
64
|
+
}());
|
|
65
|
+
exports.CreatePageValidator = CreatePageValidator;
|
|
66
|
+
var UpdatePageValidator = (function (_super) {
|
|
67
|
+
__extends(UpdatePageValidator, _super);
|
|
68
|
+
function UpdatePageValidator() {
|
|
69
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
70
|
+
}
|
|
71
|
+
return UpdatePageValidator;
|
|
72
|
+
}(CreatePageValidator));
|
|
73
|
+
exports.UpdatePageValidator = UpdatePageValidator;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@merkaly/api",
|
|
3
|
-
"version": "0.2.2-
|
|
3
|
+
"version": "0.2.2-29",
|
|
4
4
|
"description": "NestJS Backend ApiRest Service",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"postpack": "yarn run clean",
|
|
26
26
|
"semantic-release": "yarn run build:package && semantic-release",
|
|
27
27
|
"start": "nest start",
|
|
28
|
-
"start:prod": "node
|
|
28
|
+
"start:prod": "node ./src/main.js",
|
|
29
29
|
"test": "jest",
|
|
30
30
|
"test:cov": "yarn test -- --coverage",
|
|
31
31
|
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|