@merkaly/api 0.2.2-9 → 0.2.2
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/abstract/abstract.document.d.ts +10 -0
- package/.output/abstract/abstract.document.js +13 -0
- package/.output/{configs/app.entity.d.ts → abstract/abstract.entity.d.ts} +3 -3
- package/.output/abstract/abstract.entity.js +54 -0
- package/.output/abstract/abstract.fixture.d.ts +4 -0
- package/.output/abstract/abstract.fixture.js +11 -0
- package/.output/abstract/abstract.validator.d.ts +18 -0
- package/.output/abstract/abstract.validator.js +73 -0
- package/.output/modules/assets/asset.entity.d.ts +2 -2
- package/.output/modules/assets/asset.entity.js +59 -33
- package/.output/modules/content/banners/banner.document.d.ts +6 -0
- package/.output/modules/content/banners/banner.document.js +30 -0
- package/.output/modules/content/banners/banner.entity.d.ts +7 -0
- package/.output/modules/content/banners/banner.entity.js +54 -0
- package/.output/modules/content/banners/banner.fixture.d.ts +5 -0
- package/.output/modules/content/banners/banner.fixture.js +39 -0
- package/.output/modules/content/banners/banner.validator.d.ts +8 -0
- package/.output/modules/content/banners/banner.validator.js +63 -0
- 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.fixture.d.ts +5 -0
- package/.output/modules/content/pages/page.fixture.js +39 -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/.output/modules/insight/validators/order.validator.d.ts +4 -0
- package/.output/modules/insight/validators/order.validator.js +27 -0
- package/.output/modules/inventory/brands/brand.document.d.ts +5 -0
- package/.output/modules/inventory/brands/brand.document.js +30 -0
- package/.output/modules/inventory/brands/brand.entity.d.ts +2 -2
- package/.output/modules/inventory/brands/brand.entity.js +40 -17
- package/.output/modules/inventory/brands/brand.validator.js +34 -25
- package/.output/modules/inventory/categories/category.document.d.ts +6 -0
- package/.output/modules/inventory/categories/category.document.js +31 -0
- package/.output/modules/inventory/categories/category.entity.d.ts +5 -2
- package/.output/modules/inventory/categories/category.entity.js +51 -17
- package/.output/modules/inventory/categories/category.fixture.d.ts +5 -0
- package/.output/modules/inventory/categories/category.fixture.js +38 -0
- package/.output/modules/inventory/categories/category.validator.d.ts +2 -0
- package/.output/modules/inventory/categories/category.validator.js +46 -25
- package/.output/modules/inventory/products/entities/code.entity.d.ts +5 -0
- package/.output/modules/inventory/products/entities/code.entity.js +53 -0
- package/.output/modules/inventory/products/entities/dimension.entity.d.ts +6 -0
- package/.output/modules/inventory/products/entities/dimension.entity.js +57 -0
- package/.output/modules/inventory/products/entities/price.entity.d.ts +4 -0
- package/.output/modules/inventory/products/entities/price.entity.js +49 -0
- package/.output/modules/inventory/products/entities/seo.entity.d.ts +5 -0
- package/.output/modules/inventory/products/entities/seo.entity.js +53 -0
- package/.output/modules/inventory/products/product.document.d.ts +24 -0
- package/.output/modules/inventory/products/product.document.js +33 -0
- package/.output/modules/inventory/products/product.entity.d.ts +13 -3
- package/.output/modules/inventory/products/product.entity.js +91 -36
- package/.output/modules/inventory/products/product.fixture.d.ts +5 -0
- package/.output/modules/inventory/products/product.fixture.js +54 -0
- package/.output/modules/inventory/products/product.validator.d.ts +15 -11
- package/.output/modules/inventory/products/product.validator.js +107 -65
- package/.output/modules/inventory/products/validators/code.validator.d.ts +5 -0
- package/.output/modules/inventory/products/validators/code.validator.js +37 -0
- package/.output/modules/inventory/products/validators/dimension.validator.d.ts +6 -0
- package/.output/modules/inventory/products/validators/dimension.validator.js +43 -0
- package/.output/modules/inventory/products/validators/price.validator.d.ts +4 -0
- package/.output/modules/inventory/products/validators/price.validator.js +30 -0
- package/.output/modules/inventory/products/validators/seo.validator.d.ts +5 -0
- package/.output/modules/inventory/products/validators/seo.validator.js +37 -0
- package/.output/modules/inventory/properties/property.entity.d.ts +7 -0
- package/.output/modules/inventory/properties/property.entity.js +55 -0
- package/.output/modules/inventory/properties/property.validator.d.ts +12 -0
- package/.output/modules/inventory/properties/property.validator.js +51 -0
- package/.output/modules/sales/clients/client.entity.d.ts +12 -0
- package/.output/modules/sales/clients/client.entity.js +73 -0
- package/.output/modules/sales/clients/client.validator.d.ts +12 -0
- package/.output/modules/sales/clients/client.validator.js +67 -0
- package/.output/modules/{store/orders/billing/billing.validator.d.ts → sales/orders/billing/billing.document.d.ts} +4 -4
- package/.output/modules/sales/orders/billing/billing.document.js +9 -0
- package/.output/modules/{store → sales}/orders/billing/billing.entity.d.ts +0 -0
- package/.output/modules/sales/orders/billing/billing.entity.js +44 -0
- package/.output/modules/sales/orders/billing/billing.validator.d.ts +7 -0
- package/.output/modules/sales/orders/billing/billing.validator.js +40 -0
- package/.output/modules/sales/orders/item/item.document.d.ts +6 -0
- package/.output/modules/sales/orders/item/item.document.js +9 -0
- package/.output/modules/sales/orders/item/item.entity.d.ts +7 -0
- package/.output/modules/sales/orders/item/item.entity.js +54 -0
- package/.output/modules/{store/orders/item/item.entity.d.ts → sales/orders/item/item.schema.d.ts} +3 -9
- package/.output/modules/sales/orders/item/item.schema.js +6 -0
- package/.output/modules/{store → sales}/orders/item/item.validator.d.ts +0 -0
- package/.output/modules/sales/orders/item/item.validator.js +29 -0
- package/.output/modules/sales/orders/order.entity.d.ts +19 -0
- package/.output/modules/sales/orders/order.entity.js +82 -0
- package/.output/modules/sales/orders/order.validator.d.ts +18 -0
- package/.output/modules/sales/orders/order.validator.js +75 -0
- package/.output/modules/sales/orders/payment/payment.entity.d.ts +4 -0
- package/.output/modules/sales/orders/payment/payment.entity.js +28 -0
- package/.output/modules/sales/orders/payment/payment.schema.d.ts +27 -0
- package/.output/modules/sales/orders/payment/payment.schema.js +6 -0
- package/.output/modules/sales/orders/payment/payment.validator.d.ts +6 -0
- package/.output/modules/sales/orders/payment/payment.validator.js +10 -0
- package/.output/modules/{store/orders/shipping/shipping.validator.d.ts → sales/orders/shipping/shipping.document.d.ts} +4 -4
- package/.output/modules/sales/orders/shipping/shipping.document.js +9 -0
- package/.output/modules/{store → sales}/orders/shipping/shipping.entity.d.ts +0 -0
- package/.output/modules/sales/orders/shipping/shipping.entity.js +44 -0
- package/.output/modules/sales/orders/shipping/shipping.validator.d.ts +7 -0
- package/.output/modules/sales/orders/shipping/shipping.validator.js +40 -0
- package/.output/modules/sales/orders/status/status.document.d.ts +5 -0
- package/.output/modules/sales/orders/status/status.document.js +9 -0
- package/.output/modules/sales/orders/status/status.entity.d.ts +6 -0
- package/.output/modules/sales/orders/status/status.entity.js +37 -0
- package/.output/modules/sales/orders/status/status.validator.d.ts +8 -0
- package/.output/modules/sales/orders/status/status.validator.js +12 -0
- package/.output/modules/search/search.validator.d.ts +6 -0
- package/.output/modules/search/search.validator.js +49 -0
- package/.output/modules/{auth → setting}/connections/connection.validator.d.ts +0 -1
- package/.output/modules/setting/connections/connection.validator.js +37 -0
- package/.output/modules/setting/layout/layout.document.d.ts +5 -0
- package/.output/modules/setting/layout/layout.document.js +29 -0
- package/.output/modules/setting/layout/layout.entity.d.ts +6 -0
- package/.output/modules/setting/layout/layout.entity.js +46 -0
- package/.output/modules/{auth → setting}/members/member.validator.d.ts +0 -1
- package/.output/modules/{auth → setting}/members/member.validator.js +0 -1
- package/.output/modules/setting/organization/organization.document.d.ts +15 -0
- package/.output/modules/setting/organization/organization.document.js +31 -0
- package/.output/modules/setting/organization/organization.entity.d.ts +4 -0
- package/.output/modules/setting/organization/organization.entity.js +28 -0
- package/.output/modules/setting/organization/organization.types.d.ts +22 -0
- package/.output/modules/setting/organization/organization.types.js +102 -0
- package/.output/modules/setting/organization/organization.validator.d.ts +17 -0
- package/.output/modules/setting/organization/organization.validator.js +83 -0
- package/.output/modules/setting/theme/theme.entity.d.ts +6 -0
- package/.output/modules/setting/theme/theme.entity.js +46 -0
- package/.output/modules/users/user.validator.d.ts +10 -0
- package/.output/modules/users/user.validator.js +50 -0
- package/.output/types.d.ts +23 -0
- package/.output/types.js +2 -0
- package/package.json +21 -9
- package/.output/configs/app.entity.js +0 -28
- package/.output/main.d.ts +0 -0
- package/.output/modules/auth/connections/connection.validator.js +0 -29
- package/.output/modules/auth/organizations/organization.validator.d.ts +0 -6
- package/.output/modules/auth/organizations/organization.validator.js +0 -27
- package/.output/modules/settings/payments/payment.entity.d.ts +0 -10
- package/.output/modules/settings/payments/payment.entity.js +0 -35
- package/.output/modules/store/cart/cart.entity.d.ts +0 -14
- package/.output/modules/store/cart/cart.entity.js +0 -39
- package/.output/modules/store/cart/cart.validator.d.ts +0 -13
- package/.output/modules/store/cart/cart.validator.js +0 -48
- package/.output/modules/store/orders/billing/billing.entity.js +0 -38
- package/.output/modules/store/orders/billing/billing.validator.js +0 -36
- package/.output/modules/store/orders/item/item.entity.js +0 -32
- package/.output/modules/store/orders/item/item.validator.js +0 -22
- package/.output/modules/store/orders/order.entity.d.ts +0 -15
- package/.output/modules/store/orders/order.entity.js +0 -47
- package/.output/modules/store/orders/order.validator.d.ts +0 -12
- package/.output/modules/store/orders/order.validator.js +0 -42
- package/.output/modules/store/orders/shipping/shipping.entity.js +0 -38
- package/.output/modules/store/orders/shipping/shipping.validator.js +0 -36
- package/.output/modules/store/orders/status/status.entity.d.ts +0 -13
- package/.output/modules/store/orders/status/status.entity.js +0 -39
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AbstractDocument = void 0;
|
|
4
|
+
var AbstractDocument = (function () {
|
|
5
|
+
function AbstractDocument(_a) {
|
|
6
|
+
var _id = _a._id, createdAt = _a.createdAt, updatedAt = _a.updatedAt;
|
|
7
|
+
this.id = _id;
|
|
8
|
+
this.createdAt = createdAt || new Date();
|
|
9
|
+
this.updatedAt = updatedAt || new Date();
|
|
10
|
+
}
|
|
11
|
+
return AbstractDocument;
|
|
12
|
+
}());
|
|
13
|
+
exports.AbstractDocument = AbstractDocument;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Document } from 'mongoose';
|
|
2
|
-
export declare abstract class
|
|
2
|
+
export declare abstract class AbstractEntity extends Document {
|
|
3
3
|
static $index: string;
|
|
4
|
-
readonly _id
|
|
5
|
-
|
|
4
|
+
readonly _id: string;
|
|
5
|
+
createdAt?: Date;
|
|
6
6
|
readonly updatedAt?: Date;
|
|
7
7
|
readonly deletedAt?: Date;
|
|
8
8
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
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.AbstractEntity = void 0;
|
|
28
|
+
var mongoose_1 = require("@nestjs/mongoose");
|
|
29
|
+
var mongoose_2 = require("mongoose");
|
|
30
|
+
var AbstractEntity = (function (_super) {
|
|
31
|
+
__extends(AbstractEntity, _super);
|
|
32
|
+
function AbstractEntity() {
|
|
33
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
34
|
+
_this._id = String();
|
|
35
|
+
_this.createdAt = null;
|
|
36
|
+
_this.updatedAt = null;
|
|
37
|
+
_this.deletedAt = null;
|
|
38
|
+
return _this;
|
|
39
|
+
}
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Date }),
|
|
42
|
+
__metadata("design:type", Date)
|
|
43
|
+
], AbstractEntity.prototype, "createdAt", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Date }),
|
|
46
|
+
__metadata("design:type", Date)
|
|
47
|
+
], AbstractEntity.prototype, "updatedAt", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Date }),
|
|
50
|
+
__metadata("design:type", Date)
|
|
51
|
+
], AbstractEntity.prototype, "deletedAt", void 0);
|
|
52
|
+
return AbstractEntity;
|
|
53
|
+
}(mongoose_2.Document));
|
|
54
|
+
exports.AbstractEntity = AbstractEntity;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AbstractFixture = void 0;
|
|
4
|
+
var faker_1 = require("@faker-js/faker");
|
|
5
|
+
var AbstractFixture = (function () {
|
|
6
|
+
function AbstractFixture() {
|
|
7
|
+
this.$faker = faker_1.faker;
|
|
8
|
+
}
|
|
9
|
+
return AbstractFixture;
|
|
10
|
+
}());
|
|
11
|
+
exports.AbstractFixture = AbstractFixture;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PopulateOptions, QuerySelector, SortOrder } from 'mongoose';
|
|
2
|
+
import { AbstractEntity } from './abstract.entity';
|
|
3
|
+
export interface SearchResults<I> {
|
|
4
|
+
page: number;
|
|
5
|
+
total: number;
|
|
6
|
+
items: I[];
|
|
7
|
+
}
|
|
8
|
+
export declare class FindValidator<E extends AbstractEntity> {
|
|
9
|
+
limit?: number;
|
|
10
|
+
page?: number;
|
|
11
|
+
sort?: {
|
|
12
|
+
[x: string]: SortOrder;
|
|
13
|
+
};
|
|
14
|
+
filters?: {
|
|
15
|
+
[x: string]: string | QuerySelector<any>;
|
|
16
|
+
};
|
|
17
|
+
join?: (keyof E | string | PopulateOptions)[];
|
|
18
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.FindValidator = void 0;
|
|
13
|
+
var class_transformer_1 = require("class-transformer");
|
|
14
|
+
var class_validator_1 = require("class-validator");
|
|
15
|
+
var FindValidator = (function () {
|
|
16
|
+
function FindValidator() {
|
|
17
|
+
this.limit = 10;
|
|
18
|
+
this.page = 1;
|
|
19
|
+
this.sort = {};
|
|
20
|
+
this.filters = {};
|
|
21
|
+
}
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
|
24
|
+
var value = _a.value;
|
|
25
|
+
return value ? Number(value) : 10;
|
|
26
|
+
}),
|
|
27
|
+
(0, class_validator_1.IsInt)(),
|
|
28
|
+
(0, class_validator_1.IsOptional)(),
|
|
29
|
+
__metadata("design:type", Object)
|
|
30
|
+
], FindValidator.prototype, "limit", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
|
33
|
+
var value = _a.value;
|
|
34
|
+
return value ? Number(value) : 1;
|
|
35
|
+
}),
|
|
36
|
+
(0, class_validator_1.IsInt)(),
|
|
37
|
+
(0, class_validator_1.IsOptional)(),
|
|
38
|
+
__metadata("design:type", Object)
|
|
39
|
+
], FindValidator.prototype, "page", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
|
42
|
+
var value = _a.value;
|
|
43
|
+
return value && JSON.parse(value);
|
|
44
|
+
}),
|
|
45
|
+
(0, class_validator_1.IsOptional)(),
|
|
46
|
+
__metadata("design:type", Object)
|
|
47
|
+
], FindValidator.prototype, "sort", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
|
50
|
+
var value = _a.value;
|
|
51
|
+
return value && JSON.parse(value);
|
|
52
|
+
}),
|
|
53
|
+
(0, class_validator_1.IsOptional)(),
|
|
54
|
+
__metadata("design:type", Object)
|
|
55
|
+
], FindValidator.prototype, "filters", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
|
58
|
+
var value = _a.value;
|
|
59
|
+
return value.map(function (path) {
|
|
60
|
+
try {
|
|
61
|
+
return JSON.parse(path);
|
|
62
|
+
}
|
|
63
|
+
catch (e) {
|
|
64
|
+
return path;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}),
|
|
68
|
+
(0, class_validator_1.IsOptional)(),
|
|
69
|
+
__metadata("design:type", Array)
|
|
70
|
+
], FindValidator.prototype, "join", void 0);
|
|
71
|
+
return FindValidator;
|
|
72
|
+
}());
|
|
73
|
+
exports.FindValidator = FindValidator;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare class AssetEntity extends
|
|
1
|
+
import { AbstractEntity } from '../../abstract/abstract.entity';
|
|
2
|
+
export declare class AssetEntity extends AbstractEntity {
|
|
3
3
|
static readonly $index = "assets";
|
|
4
4
|
name: string;
|
|
5
5
|
url: string;
|
|
@@ -1,43 +1,69 @@
|
|
|
1
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
|
+
})();
|
|
2
17
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
18
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
19
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
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;
|
|
6
21
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
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
|
+
};
|
|
8
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
27
|
exports.AssetEntity = void 0;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
__decorate([
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
], AssetEntity.prototype, "
|
|
34
|
-
__decorate([
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
28
|
+
var mongoose_1 = require("@nestjs/mongoose");
|
|
29
|
+
var mongoose_2 = require("mongoose");
|
|
30
|
+
var abstract_entity_1 = require("../../abstract/abstract.entity");
|
|
31
|
+
var AssetEntity = (function (_super) {
|
|
32
|
+
__extends(AssetEntity, _super);
|
|
33
|
+
function AssetEntity() {
|
|
34
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
35
|
+
_this.weak = true;
|
|
36
|
+
_this.size = 0;
|
|
37
|
+
return _this;
|
|
38
|
+
}
|
|
39
|
+
AssetEntity.$index = 'assets';
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true, unique: true }),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], AssetEntity.prototype, "name", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true }),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], AssetEntity.prototype, "url", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Boolean, default: true }),
|
|
50
|
+
__metadata("design:type", Object)
|
|
51
|
+
], AssetEntity.prototype, "weak", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, nullable: true }),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], AssetEntity.prototype, "description", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String }),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], AssetEntity.prototype, "type", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Number, required: true, default: 0 }),
|
|
62
|
+
__metadata("design:type", Object)
|
|
63
|
+
], AssetEntity.prototype, "size", void 0);
|
|
64
|
+
AssetEntity = __decorate([
|
|
65
|
+
(0, mongoose_1.Schema)({ timestamps: true })
|
|
66
|
+
], AssetEntity);
|
|
67
|
+
return AssetEntity;
|
|
68
|
+
}(abstract_entity_1.AbstractEntity));
|
|
43
69
|
exports.AssetEntity = AssetEntity;
|
|
@@ -0,0 +1,30 @@
|
|
|
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.BannerDocument = void 0;
|
|
19
|
+
var abstract_document_1 = require("../../../abstract/abstract.document");
|
|
20
|
+
var BannerDocument = (function (_super) {
|
|
21
|
+
__extends(BannerDocument, _super);
|
|
22
|
+
function BannerDocument() {
|
|
23
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
+
_this.image = null;
|
|
25
|
+
_this.href = '#';
|
|
26
|
+
return _this;
|
|
27
|
+
}
|
|
28
|
+
return BannerDocument;
|
|
29
|
+
}(abstract_document_1.AbstractDocument));
|
|
30
|
+
exports.BannerDocument = BannerDocument;
|
|
@@ -0,0 +1,54 @@
|
|
|
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.BannerEntity = 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 BannerEntity = (function (_super) {
|
|
32
|
+
__extends(BannerEntity, _super);
|
|
33
|
+
function BannerEntity() {
|
|
34
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
35
|
+
}
|
|
36
|
+
BannerEntity.$index = 'content_banners';
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true }),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], BannerEntity.prototype, "name", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, required: true }),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], BannerEntity.prototype, "image", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.String, default: '#' }),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], BannerEntity.prototype, "href", void 0);
|
|
49
|
+
BannerEntity = __decorate([
|
|
50
|
+
(0, mongoose_1.Schema)({ timestamps: true })
|
|
51
|
+
], BannerEntity);
|
|
52
|
+
return BannerEntity;
|
|
53
|
+
}(abstract_entity_1.AbstractEntity));
|
|
54
|
+
exports.BannerEntity = BannerEntity;
|
|
@@ -0,0 +1,39 @@
|
|
|
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.BannerFixture = void 0;
|
|
19
|
+
var faker_1 = require("@faker-js/faker");
|
|
20
|
+
var abstract_fixture_1 = require("../../../abstract/abstract.fixture");
|
|
21
|
+
var banner_document_1 = require("./banner.document");
|
|
22
|
+
var BannerFixture = (function (_super) {
|
|
23
|
+
__extends(BannerFixture, _super);
|
|
24
|
+
function BannerFixture() {
|
|
25
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
26
|
+
}
|
|
27
|
+
BannerFixture.prototype.normal = function () {
|
|
28
|
+
var banner = new banner_document_1.BannerDocument({
|
|
29
|
+
_id: this.$faker.datatype.uuid(),
|
|
30
|
+
createdAt: this.$faker.date.past(1),
|
|
31
|
+
updatedAt: this.$faker.date.past(1),
|
|
32
|
+
});
|
|
33
|
+
banner.name = faker_1.faker.random.words(6);
|
|
34
|
+
banner.image = faker_1.faker.image.placeholder.imageUrl(850, 400, 'webp');
|
|
35
|
+
return banner;
|
|
36
|
+
};
|
|
37
|
+
return BannerFixture;
|
|
38
|
+
}(abstract_fixture_1.AbstractFixture));
|
|
39
|
+
exports.BannerFixture = BannerFixture;
|
|
@@ -0,0 +1,63 @@
|
|
|
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.UpdateBannerValidator = exports.CreateBannerValidator = void 0;
|
|
28
|
+
var class_validator_1 = require("class-validator");
|
|
29
|
+
var CreateBannerValidator = (function () {
|
|
30
|
+
function CreateBannerValidator() {
|
|
31
|
+
this.image = null;
|
|
32
|
+
}
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_validator_1.IsString)(),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], CreateBannerValidator.prototype, "name", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_validator_1.IsUrl)(),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], CreateBannerValidator.prototype, "image", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, class_validator_1.IsUrl)(),
|
|
43
|
+
(0, class_validator_1.IsOptional)(),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], CreateBannerValidator.prototype, "href", void 0);
|
|
46
|
+
return CreateBannerValidator;
|
|
47
|
+
}());
|
|
48
|
+
exports.CreateBannerValidator = CreateBannerValidator;
|
|
49
|
+
var UpdateBannerValidator = (function (_super) {
|
|
50
|
+
__extends(UpdateBannerValidator, _super);
|
|
51
|
+
function UpdateBannerValidator() {
|
|
52
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
53
|
+
_this.image = null;
|
|
54
|
+
return _this;
|
|
55
|
+
}
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, class_validator_1.IsUrl)(),
|
|
58
|
+
(0, class_validator_1.IsOptional)(),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], UpdateBannerValidator.prototype, "image", void 0);
|
|
61
|
+
return UpdateBannerValidator;
|
|
62
|
+
}(CreateBannerValidator));
|
|
63
|
+
exports.UpdateBannerValidator = UpdateBannerValidator;
|
|
@@ -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
|
+
}
|