mormati-mongoose 0.1.1
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/dist/const/const.provider.d.ts +1 -0
- package/dist/const/const.provider.js +5 -0
- package/dist/const/const.provider.js.map +1 -0
- package/dist/const/index.d.ts +1 -0
- package/dist/const/index.js +6 -0
- package/dist/const/index.js.map +1 -0
- package/dist/helper/index.d.ts +2 -0
- package/dist/helper/index.js +19 -0
- package/dist/helper/index.js.map +1 -0
- package/dist/helper/model/index.d.ts +4 -0
- package/dist/helper/model/index.js +21 -0
- package/dist/helper/model/index.js.map +1 -0
- package/dist/helper/model/model.dto.d.ts +18 -0
- package/dist/helper/model/model.dto.js +126 -0
- package/dist/helper/model/model.dto.js.map +1 -0
- package/dist/helper/model/model.method.d.ts +4 -0
- package/dist/helper/model/model.method.js +28 -0
- package/dist/helper/model/model.method.js.map +1 -0
- package/dist/helper/model/model.option.d.ts +3 -0
- package/dist/helper/model/model.option.js +6 -0
- package/dist/helper/model/model.option.js.map +1 -0
- package/dist/helper/model/model.schema.d.ts +29 -0
- package/dist/helper/model/model.schema.js +107 -0
- package/dist/helper/model/model.schema.js.map +1 -0
- package/dist/helper/query/index.d.ts +4 -0
- package/dist/helper/query/index.js +18 -0
- package/dist/helper/query/index.js.map +1 -0
- package/dist/helper/query/quer.type.d.ts +6 -0
- package/dist/helper/query/quer.type.js +3 -0
- package/dist/helper/query/quer.type.js.map +1 -0
- package/dist/helper/query/query.dto.d.ts +22 -0
- package/dist/helper/query/query.dto.js +29 -0
- package/dist/helper/query/query.dto.js.map +1 -0
- package/dist/helper/query/query.engine.d.ts +8 -0
- package/dist/helper/query/query.engine.js +253 -0
- package/dist/helper/query/query.engine.js.map +1 -0
- package/dist/helper/query/query.expression.d.ts +55 -0
- package/dist/helper/query/query.expression.js +57 -0
- package/dist/helper/query/query.expression.js.map +1 -0
- package/dist/helper/query/query.method.d.ts +21 -0
- package/dist/helper/query/query.method.js +106 -0
- package/dist/helper/query/query.method.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/modules/mongoose-connection/mongoose-config.service.d.ts +6 -0
- package/dist/modules/mongoose-connection/mongoose-config.service.js +45 -0
- package/dist/modules/mongoose-connection/mongoose-config.service.js.map +1 -0
- package/dist/modules/mongoose-connection/mongoose-connection.module.d.ts +5 -0
- package/dist/modules/mongoose-connection/mongoose-connection.module.js +38 -0
- package/dist/modules/mongoose-connection/mongoose-connection.module.js.map +1 -0
- package/dist/modules/mongoose-connection/mongoose-connection.type.d.ts +3 -0
- package/dist/modules/mongoose-connection/mongoose-connection.type.js +3 -0
- package/dist/modules/mongoose-connection/mongoose-connection.type.js.map +1 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -0
- package/package.json +18 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MONGOOSE_CONFIG_SERVICE = "MONGOOSE_CONFIG_SERVICE";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"const.provider.js","sourceRoot":"","sources":["../../../../libs/mongoose/src/const/const.provider.ts"],"names":[],"mappings":";;;AAAa,QAAA,uBAAuB,GAAG,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MONGOOSE_CONFIG_SERVICE } from './const.provider';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MONGOOSE_CONFIG_SERVICE = void 0;
|
|
4
|
+
var const_provider_1 = require("./const.provider");
|
|
5
|
+
Object.defineProperty(exports, "MONGOOSE_CONFIG_SERVICE", { enumerable: true, get: function () { return const_provider_1.MONGOOSE_CONFIG_SERVICE; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/mongoose/src/const/index.ts"],"names":[],"mappings":";;;AAAA,mDAE0B;AADtB,yHAAA,uBAAuB,OAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./model"), exports);
|
|
18
|
+
__exportStar(require("./query"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/mongoose/src/helper/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,0CAAwB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { createGenericDto, createGenericWithApproveDto, GenericSubAssetDto, GenericSubVisibilityDto, } from "./model.dto";
|
|
2
|
+
export { GenericSchema, GenericWithApproveSchema, GenericSubAssetSchema, GenericSubVisibilitySchema, } from "./model.schema";
|
|
3
|
+
export { dateTransform, createIndex, createSearchIndex, } from "./model.method";
|
|
4
|
+
export { TAssetType, assetType, assetTypeEntity, } from './model.option';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.assetTypeEntity = exports.assetType = exports.createSearchIndex = exports.createIndex = exports.dateTransform = exports.GenericSubVisibilitySchema = exports.GenericSubAssetSchema = exports.GenericWithApproveSchema = exports.GenericSchema = exports.GenericSubVisibilityDto = exports.GenericSubAssetDto = exports.createGenericWithApproveDto = exports.createGenericDto = void 0;
|
|
4
|
+
var model_dto_1 = require("./model.dto");
|
|
5
|
+
Object.defineProperty(exports, "createGenericDto", { enumerable: true, get: function () { return model_dto_1.createGenericDto; } });
|
|
6
|
+
Object.defineProperty(exports, "createGenericWithApproveDto", { enumerable: true, get: function () { return model_dto_1.createGenericWithApproveDto; } });
|
|
7
|
+
Object.defineProperty(exports, "GenericSubAssetDto", { enumerable: true, get: function () { return model_dto_1.GenericSubAssetDto; } });
|
|
8
|
+
Object.defineProperty(exports, "GenericSubVisibilityDto", { enumerable: true, get: function () { return model_dto_1.GenericSubVisibilityDto; } });
|
|
9
|
+
var model_schema_1 = require("./model.schema");
|
|
10
|
+
Object.defineProperty(exports, "GenericSchema", { enumerable: true, get: function () { return model_schema_1.GenericSchema; } });
|
|
11
|
+
Object.defineProperty(exports, "GenericWithApproveSchema", { enumerable: true, get: function () { return model_schema_1.GenericWithApproveSchema; } });
|
|
12
|
+
Object.defineProperty(exports, "GenericSubAssetSchema", { enumerable: true, get: function () { return model_schema_1.GenericSubAssetSchema; } });
|
|
13
|
+
Object.defineProperty(exports, "GenericSubVisibilitySchema", { enumerable: true, get: function () { return model_schema_1.GenericSubVisibilitySchema; } });
|
|
14
|
+
var model_method_1 = require("./model.method");
|
|
15
|
+
Object.defineProperty(exports, "dateTransform", { enumerable: true, get: function () { return model_method_1.dateTransform; } });
|
|
16
|
+
Object.defineProperty(exports, "createIndex", { enumerable: true, get: function () { return model_method_1.createIndex; } });
|
|
17
|
+
Object.defineProperty(exports, "createSearchIndex", { enumerable: true, get: function () { return model_method_1.createSearchIndex; } });
|
|
18
|
+
var model_option_1 = require("./model.option");
|
|
19
|
+
Object.defineProperty(exports, "assetType", { enumerable: true, get: function () { return model_option_1.assetType; } });
|
|
20
|
+
Object.defineProperty(exports, "assetTypeEntity", { enumerable: true, get: function () { return model_option_1.assetTypeEntity; } });
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/mongoose/src/helper/model/index.ts"],"names":[],"mappings":";;;AAAA,yCAKqB;AAJjB,6GAAA,gBAAgB,OAAA;AAChB,wHAAA,2BAA2B,OAAA;AAC3B,+GAAA,kBAAkB,OAAA;AAClB,oHAAA,uBAAuB,OAAA;AAE3B,+CAKwB;AAJpB,6GAAA,aAAa,OAAA;AACb,wHAAA,wBAAwB,OAAA;AACxB,qHAAA,qBAAqB,OAAA;AACrB,0HAAA,0BAA0B,OAAA;AAE9B,+CAIwB;AAHpB,6GAAA,aAAa,OAAA;AACb,2GAAA,WAAW,OAAA;AACX,iHAAA,iBAAiB,OAAA;AAErB,+CAIwB;AAFpB,yGAAA,SAAS,OAAA;AACT,+GAAA,eAAe,OAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ClassConstructor } from 'class-transformer';
|
|
2
|
+
export declare function createGenericDto(enumEntityLanguage: any): ClassConstructor<any>;
|
|
3
|
+
export declare function createGenericWithApproveDto(enumEntityLanguage: any): ClassConstructor<any>;
|
|
4
|
+
export declare class GenericSubAssetDto {
|
|
5
|
+
is_visible?: boolean;
|
|
6
|
+
created_at?: Date;
|
|
7
|
+
sequence?: number;
|
|
8
|
+
type?: string;
|
|
9
|
+
label?: string;
|
|
10
|
+
value?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare class GenericSubVisibilityDto {
|
|
14
|
+
is_visible?: boolean;
|
|
15
|
+
sequence?: number;
|
|
16
|
+
from?: Date;
|
|
17
|
+
to?: Date;
|
|
18
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
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.GenericSubVisibilityDto = exports.GenericSubAssetDto = void 0;
|
|
13
|
+
exports.createGenericDto = createGenericDto;
|
|
14
|
+
exports.createGenericWithApproveDto = createGenericWithApproveDto;
|
|
15
|
+
const class_transformer_1 = require("class-transformer");
|
|
16
|
+
const nestjs_dto_1 = require("@adaikappan/nestjs-dto");
|
|
17
|
+
const query_dto_1 = require("../query/query.dto");
|
|
18
|
+
const model_option_1 = require("./model.option");
|
|
19
|
+
const model_method_1 = require("./model.method");
|
|
20
|
+
function createGenericDto(enumEntityLanguage) {
|
|
21
|
+
class GenericDto extends query_dto_1.QueryDto {
|
|
22
|
+
}
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, nestjs_dto_1.BooleanDecorator)({ isOpt: true, isReq: false, groups: nestjs_dto_1.ValidationGrp.CRUD }),
|
|
25
|
+
__metadata("design:type", Boolean)
|
|
26
|
+
], GenericDto.prototype, "is_active", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, nestjs_dto_1.BooleanDecorator)({ isOpt: true, isReq: false, groups: nestjs_dto_1.ValidationGrp.CRUD }),
|
|
29
|
+
__metadata("design:type", Boolean)
|
|
30
|
+
], GenericDto.prototype, "is_visible", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, nestjs_dto_1.BooleanDecorator)({ isOpt: true, isReq: false, groups: nestjs_dto_1.ValidationGrp.CRUD }),
|
|
33
|
+
__metadata("design:type", Boolean)
|
|
34
|
+
], GenericDto.prototype, "is_deleted", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, class_transformer_1.Transform)((params) => (0, model_method_1.dateTransform)(params.value)),
|
|
37
|
+
(0, nestjs_dto_1.DateDecorator)({ isOpt: true, isReq: false, groups: nestjs_dto_1.ValidationGrp.CRUD }),
|
|
38
|
+
__metadata("design:type", Date)
|
|
39
|
+
], GenericDto.prototype, "created_at", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, class_transformer_1.Transform)((params) => (0, model_method_1.dateTransform)(params.value)),
|
|
42
|
+
(0, nestjs_dto_1.DateDecorator)({ isOpt: true, isReq: false, groups: nestjs_dto_1.ValidationGrp.CRUD }),
|
|
43
|
+
__metadata("design:type", Date)
|
|
44
|
+
], GenericDto.prototype, "updated_at", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, nestjs_dto_1.StringDecorator)({ isOpt: false, isReq: true, enumEntity: enumEntityLanguage, groups: nestjs_dto_1.ValidationGrp.C }),
|
|
47
|
+
(0, nestjs_dto_1.StringDecorator)({ isOpt: true, isReq: false, enumEntity: enumEntityLanguage, groups: nestjs_dto_1.ValidationGrp.RUD }),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], GenericDto.prototype, "language", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, nestjs_dto_1.NumberDecorator)({ isOpt: true, isReq: false, groups: nestjs_dto_1.ValidationGrp.CRUD }),
|
|
52
|
+
__metadata("design:type", Number)
|
|
53
|
+
], GenericDto.prototype, "sequence", void 0);
|
|
54
|
+
return GenericDto;
|
|
55
|
+
}
|
|
56
|
+
function createGenericWithApproveDto(enumEntityLanguage) {
|
|
57
|
+
class GenericWithApproveDto extends createGenericDto(enumEntityLanguage) {
|
|
58
|
+
}
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, nestjs_dto_1.StringDecorator)({ isOpt: true, isReq: false, groups: nestjs_dto_1.ValidationGrp.CRUD }),
|
|
61
|
+
__metadata("design:type", String)
|
|
62
|
+
], GenericWithApproveDto.prototype, "approved_by", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, nestjs_dto_1.StringDecorator)({ isOpt: true, isReq: false, groups: nestjs_dto_1.ValidationGrp.CRUD }),
|
|
65
|
+
__metadata("design:type", String)
|
|
66
|
+
], GenericWithApproveDto.prototype, "approved_at", void 0);
|
|
67
|
+
return GenericWithApproveDto;
|
|
68
|
+
}
|
|
69
|
+
class GenericSubAssetDto {
|
|
70
|
+
}
|
|
71
|
+
exports.GenericSubAssetDto = GenericSubAssetDto;
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, nestjs_dto_1.BooleanDecorator)({ isOpt: true, isReq: false, groups: nestjs_dto_1.ValidationGrp.CRUD }),
|
|
74
|
+
__metadata("design:type", Boolean)
|
|
75
|
+
], GenericSubAssetDto.prototype, "is_visible", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, class_transformer_1.Transform)((params) => (0, model_method_1.dateTransform)(params.value)),
|
|
78
|
+
(0, nestjs_dto_1.DateDecorator)({ isOpt: true, isReq: false, groups: nestjs_dto_1.ValidationGrp.CRUD }),
|
|
79
|
+
__metadata("design:type", Date)
|
|
80
|
+
], GenericSubAssetDto.prototype, "created_at", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, nestjs_dto_1.NumberDecorator)({ isOpt: true, isReq: false, groups: nestjs_dto_1.ValidationGrp.CRUD }),
|
|
83
|
+
__metadata("design:type", Number)
|
|
84
|
+
], GenericSubAssetDto.prototype, "sequence", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, nestjs_dto_1.StringDecorator)({ isOpt: false, isReq: true, enumEntity: model_option_1.assetTypeEntity, groups: nestjs_dto_1.ValidationGrp.C }),
|
|
87
|
+
(0, nestjs_dto_1.StringDecorator)({ isOpt: true, isReq: false, enumEntity: model_option_1.assetTypeEntity, groups: nestjs_dto_1.ValidationGrp.RUD }),
|
|
88
|
+
__metadata("design:type", String)
|
|
89
|
+
], GenericSubAssetDto.prototype, "type", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, nestjs_dto_1.StringDecorator)({ isOpt: false, isReq: true, groups: nestjs_dto_1.ValidationGrp.C }),
|
|
92
|
+
(0, nestjs_dto_1.StringDecorator)({ isOpt: true, isReq: false, groups: nestjs_dto_1.ValidationGrp.RUD }),
|
|
93
|
+
__metadata("design:type", String)
|
|
94
|
+
], GenericSubAssetDto.prototype, "label", void 0);
|
|
95
|
+
__decorate([
|
|
96
|
+
(0, nestjs_dto_1.StringDecorator)({ isOpt: false, isReq: true, groups: nestjs_dto_1.ValidationGrp.C }),
|
|
97
|
+
(0, nestjs_dto_1.StringDecorator)({ isOpt: true, isReq: false, groups: nestjs_dto_1.ValidationGrp.RUD }),
|
|
98
|
+
__metadata("design:type", String)
|
|
99
|
+
], GenericSubAssetDto.prototype, "value", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, nestjs_dto_1.StringDecorator)({ isOpt: true, isReq: false, groups: nestjs_dto_1.ValidationGrp.CRUD }),
|
|
102
|
+
__metadata("design:type", String)
|
|
103
|
+
], GenericSubAssetDto.prototype, "description", void 0);
|
|
104
|
+
class GenericSubVisibilityDto {
|
|
105
|
+
}
|
|
106
|
+
exports.GenericSubVisibilityDto = GenericSubVisibilityDto;
|
|
107
|
+
__decorate([
|
|
108
|
+
(0, nestjs_dto_1.BooleanDecorator)({ isOpt: true, isReq: false, groups: nestjs_dto_1.ValidationGrp.CRUD }),
|
|
109
|
+
__metadata("design:type", Boolean)
|
|
110
|
+
], GenericSubVisibilityDto.prototype, "is_visible", void 0);
|
|
111
|
+
__decorate([
|
|
112
|
+
(0, nestjs_dto_1.NumberDecorator)({ isOpt: true, isReq: false, groups: nestjs_dto_1.ValidationGrp.CRUD }),
|
|
113
|
+
__metadata("design:type", Number)
|
|
114
|
+
], GenericSubVisibilityDto.prototype, "sequence", void 0);
|
|
115
|
+
__decorate([
|
|
116
|
+
(0, class_transformer_1.Transform)((params) => (0, model_method_1.dateTransform)(params.value)),
|
|
117
|
+
(0, nestjs_dto_1.DateDecorator)({ isOpt: false, isReq: true, groups: nestjs_dto_1.ValidationGrp.C }),
|
|
118
|
+
(0, nestjs_dto_1.DateDecorator)({ isOpt: true, isReq: false, groups: nestjs_dto_1.ValidationGrp.RUD }),
|
|
119
|
+
__metadata("design:type", Date)
|
|
120
|
+
], GenericSubVisibilityDto.prototype, "from", void 0);
|
|
121
|
+
__decorate([
|
|
122
|
+
(0, class_transformer_1.Transform)((params) => (0, model_method_1.dateTransform)(params.value)),
|
|
123
|
+
(0, nestjs_dto_1.DateDecorator)({ isOpt: true, isReq: false, groups: nestjs_dto_1.ValidationGrp.CRUD }),
|
|
124
|
+
__metadata("design:type", Date)
|
|
125
|
+
], GenericSubVisibilityDto.prototype, "to", void 0);
|
|
126
|
+
//# sourceMappingURL=model.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.dto.js","sourceRoot":"","sources":["../../../../../libs/mongoose/src/helper/model/model.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAYA,4CA4BC;AACD,kEASC;AAlDD,yDAA+D;AAC/D,uDAMgC;AAChC,kDAA8C;AAC9C,iDAAiD;AACjD,iDAA+C;AAE/C,SAAgB,gBAAgB,CAAC,kBAAkB;IAC/C,MAAM,UAAW,SAAQ,oBAAQ;KAwBhC;IAtBU;QADN,IAAA,6BAAgB,EAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,K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a,EAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAClD,IAAA,0BAAa,EAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,0BAAG,CAAC,CAAC,EAAE,CAAC;IAC3D,IAAA,0BAAa,EAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,0BAAG,CAAC,GAAG,EAAE,CAAC;8BAChD,IAAI;qDAAC;AAIZ;IAFN,IAAA,6BAAS,EAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAA,4BAAa,EAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAClD,IAAA,0BAAa,EAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,0BAAG,CAAC,IAAI,EAAE,CAAC;8BACnD,IAAI;mDAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Schema } from "mongoose";
|
|
2
|
+
export declare const dateTransform: (value: any) => Date;
|
|
3
|
+
export declare const createIndex: (schema: Schema, keys: string[], unique?: boolean) => void;
|
|
4
|
+
export declare const createSearchIndex: (schema: Schema, keys: string[], unique?: boolean) => void;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createSearchIndex = exports.createIndex = exports.dateTransform = void 0;
|
|
4
|
+
const moment = require("moment");
|
|
5
|
+
const dateTransform = (value) => {
|
|
6
|
+
if (!value)
|
|
7
|
+
return null;
|
|
8
|
+
return moment(value, "DD-MM-YYYY HH:mm:ss").toDate();
|
|
9
|
+
};
|
|
10
|
+
exports.dateTransform = dateTransform;
|
|
11
|
+
const createIndex = (schema, keys, unique = true) => {
|
|
12
|
+
const name = `${unique ? 'index-unq' : 'index-nonunq'}-${keys.join('-')}`;
|
|
13
|
+
const fields = keys.reduce((a, e) => ({ ...a, [e]: 1 }), {});
|
|
14
|
+
schema.index(fields, { name, unique });
|
|
15
|
+
};
|
|
16
|
+
exports.createIndex = createIndex;
|
|
17
|
+
const createSearchIndex = (schema, keys, unique = false) => {
|
|
18
|
+
const name = `${unique ? 'index-unq-search' : 'index-nonunq-search'}-${keys.join('-')}`;
|
|
19
|
+
const fields = keys.reduce((a, e) => ({ ...a, [e]: 'text' }), {});
|
|
20
|
+
schema.index(fields, {
|
|
21
|
+
name,
|
|
22
|
+
unique,
|
|
23
|
+
language_override: "mongo-language",
|
|
24
|
+
default_language: "none",
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
exports.createSearchIndex = createSearchIndex;
|
|
28
|
+
//# sourceMappingURL=model.method.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.method.js","sourceRoot":"","sources":["../../../../../libs/mongoose/src/helper/model/model.method.ts"],"names":[],"mappings":";;;AAAA,iCAAiC;AAK1B,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,EAAE;IACnC,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAA;IACvB,OAAO,MAAM,CAAC,KAAK,EAAE,qBAAqB,CAAC,CAAC,MAAM,EAAE,CAAA;AACxD,CAAC,CAAA;AAHY,QAAA,aAAa,iBAGzB;AAEM,MAAM,WAAW,GAAG,CACvB,MAAc,EACd,IAAc,EACd,SAAkB,IAAI,EACxB,EAAE;IACA,MAAM,IAAI,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,cAAc,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IAC1E,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAC7D,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;AAC3C,CAAC,CAAA;AARY,QAAA,WAAW,eAQvB;AAGM,MAAM,iBAAiB,GAAG,CAC7B,MAAc,EACd,IAAc,EACd,SAAkB,KAAK,EACzB,EAAE;IACA,MAAM,IAAI,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,qBAAqB,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IACxF,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAClE,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE;QACjB,IAAI;QACJ,MAAM;QACN,iBAAiB,EAAE,gBAAgB;QACnC,gBAAgB,EAAE,MAAM;KAC3B,CAAC,CAAC;AAEP,CAAC,CAAA;AAdY,QAAA,iBAAiB,qBAc7B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.assetTypeEntity = exports.assetType = void 0;
|
|
4
|
+
exports.assetType = ["IMAGE.PNG", "VIDEO.MP4"];
|
|
5
|
+
exports.assetTypeEntity = exports.assetType.reduce((a, e) => ({ ...a, [e]: e }), {});
|
|
6
|
+
//# sourceMappingURL=model.option.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.option.js","sourceRoot":"","sources":["../../../../../libs/mongoose/src/helper/model/model.option.ts"],"names":[],"mappings":";;;AAEa,QAAA,SAAS,GAAiB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AACrD,QAAA,eAAe,GAAG,iBAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { TAssetType } from './model.option';
|
|
2
|
+
export declare class GenericSchema {
|
|
3
|
+
is_active: boolean;
|
|
4
|
+
is_visible: boolean;
|
|
5
|
+
is_deleted: boolean;
|
|
6
|
+
created_at: Date;
|
|
7
|
+
updated_at: Date;
|
|
8
|
+
language: string;
|
|
9
|
+
sequence: number;
|
|
10
|
+
}
|
|
11
|
+
export declare class GenericWithApproveSchema extends GenericSchema {
|
|
12
|
+
approved_by: string;
|
|
13
|
+
approved_at: Date;
|
|
14
|
+
}
|
|
15
|
+
export declare class GenericSubAssetSchema {
|
|
16
|
+
is_visible: boolean;
|
|
17
|
+
created_at: Date;
|
|
18
|
+
sequence: number;
|
|
19
|
+
type: TAssetType;
|
|
20
|
+
label: string;
|
|
21
|
+
value: string;
|
|
22
|
+
description: string;
|
|
23
|
+
}
|
|
24
|
+
export declare class GenericSubVisibilitySchema {
|
|
25
|
+
is_visible: boolean;
|
|
26
|
+
sequence: number;
|
|
27
|
+
from: Date;
|
|
28
|
+
to: Date;
|
|
29
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
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.GenericSubVisibilitySchema = exports.GenericSubAssetSchema = exports.GenericWithApproveSchema = exports.GenericSchema = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const model_option_1 = require("./model.option");
|
|
15
|
+
class GenericSchema {
|
|
16
|
+
}
|
|
17
|
+
exports.GenericSchema = GenericSchema;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, mongoose_1.Prop)({ type: Boolean, required: false, default: true }),
|
|
20
|
+
__metadata("design:type", Boolean)
|
|
21
|
+
], GenericSchema.prototype, "is_active", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, mongoose_1.Prop)({ type: Boolean, required: false, default: true }),
|
|
24
|
+
__metadata("design:type", Boolean)
|
|
25
|
+
], GenericSchema.prototype, "is_visible", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, mongoose_1.Prop)({ type: Boolean, required: false, default: false }),
|
|
28
|
+
__metadata("design:type", Boolean)
|
|
29
|
+
], GenericSchema.prototype, "is_deleted", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, mongoose_1.Prop)({ type: Date, required: true, default: Date.now }),
|
|
32
|
+
__metadata("design:type", Date)
|
|
33
|
+
], GenericSchema.prototype, "created_at", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, mongoose_1.Prop)({ type: Date, required: true, default: Date.now }),
|
|
36
|
+
__metadata("design:type", Date)
|
|
37
|
+
], GenericSchema.prototype, "updated_at", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, mongoose_1.Prop)({ type: String, required: true }),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], GenericSchema.prototype, "language", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, mongoose_1.Prop)({ type: Number, required: false, default: 0 }),
|
|
44
|
+
__metadata("design:type", Number)
|
|
45
|
+
], GenericSchema.prototype, "sequence", void 0);
|
|
46
|
+
class GenericWithApproveSchema extends GenericSchema {
|
|
47
|
+
}
|
|
48
|
+
exports.GenericWithApproveSchema = GenericWithApproveSchema;
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, mongoose_1.Prop)({ type: String, required: false, default: '' }),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], GenericWithApproveSchema.prototype, "approved_by", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, mongoose_1.Prop)({ type: Date, required: false, default: '' }),
|
|
55
|
+
__metadata("design:type", Date)
|
|
56
|
+
], GenericWithApproveSchema.prototype, "approved_at", void 0);
|
|
57
|
+
class GenericSubAssetSchema {
|
|
58
|
+
}
|
|
59
|
+
exports.GenericSubAssetSchema = GenericSubAssetSchema;
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, mongoose_1.Prop)({ type: Boolean, required: false, default: true }),
|
|
62
|
+
__metadata("design:type", Boolean)
|
|
63
|
+
], GenericSubAssetSchema.prototype, "is_visible", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, mongoose_1.Prop)({ type: Date, required: false, default: Date.now }),
|
|
66
|
+
__metadata("design:type", Date)
|
|
67
|
+
], GenericSubAssetSchema.prototype, "created_at", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, mongoose_1.Prop)({ type: Number, required: false, default: 0 }),
|
|
70
|
+
__metadata("design:type", Number)
|
|
71
|
+
], GenericSubAssetSchema.prototype, "sequence", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, mongoose_1.Prop)({ type: String, enum: model_option_1.assetType, required: true }),
|
|
74
|
+
__metadata("design:type", String)
|
|
75
|
+
], GenericSubAssetSchema.prototype, "type", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, mongoose_1.Prop)({ type: String, required: true }),
|
|
78
|
+
__metadata("design:type", String)
|
|
79
|
+
], GenericSubAssetSchema.prototype, "label", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, mongoose_1.Prop)({ type: String, required: true }),
|
|
82
|
+
__metadata("design:type", String)
|
|
83
|
+
], GenericSubAssetSchema.prototype, "value", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, mongoose_1.Prop)({ type: String, required: false }),
|
|
86
|
+
__metadata("design:type", String)
|
|
87
|
+
], GenericSubAssetSchema.prototype, "description", void 0);
|
|
88
|
+
class GenericSubVisibilitySchema {
|
|
89
|
+
}
|
|
90
|
+
exports.GenericSubVisibilitySchema = GenericSubVisibilitySchema;
|
|
91
|
+
__decorate([
|
|
92
|
+
(0, mongoose_1.Prop)({ type: Boolean, required: false, default: true }),
|
|
93
|
+
__metadata("design:type", Boolean)
|
|
94
|
+
], GenericSubVisibilitySchema.prototype, "is_visible", void 0);
|
|
95
|
+
__decorate([
|
|
96
|
+
(0, mongoose_1.Prop)({ type: Number, required: false, default: 0 }),
|
|
97
|
+
__metadata("design:type", Number)
|
|
98
|
+
], GenericSubVisibilitySchema.prototype, "sequence", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
(0, mongoose_1.Prop)({ type: Date, required: true }),
|
|
101
|
+
__metadata("design:type", Date)
|
|
102
|
+
], GenericSubVisibilitySchema.prototype, "from", void 0);
|
|
103
|
+
__decorate([
|
|
104
|
+
(0, mongoose_1.Prop)({ type: Date, required: false, default: null }),
|
|
105
|
+
__metadata("design:type", Date)
|
|
106
|
+
], GenericSubVisibilitySchema.prototype, "to", void 0);
|
|
107
|
+
//# sourceMappingURL=model.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.schema.js","sourceRoot":"","sources":["../../../../../libs/mongoose/src/helper/model/model.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAAwC;AACxC,iDAAuD;AAEvD,MAAa,aAAa;CAqBzB;AArBD,sCAqBC;AAnBU;IADN,IAA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;IADN,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8BAC1C,IAAI;sDAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { QueryDto, } from './query.dto';
|
|
2
|
+
export { QueryEngine } from './query.engine';
|
|
3
|
+
export { getFlattenCollectionRef, removeUndefined, transformObj, lengthCheck, objKeyLengthCheck, sortOnPriority, genGraphLookupTree, graphLookupTree, returnArray, } from './query.method';
|
|
4
|
+
export { TRemoveUndefinedObject, TRemoveUndefinedOptions } from "./quer.type";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.returnArray = exports.graphLookupTree = exports.genGraphLookupTree = exports.sortOnPriority = exports.objKeyLengthCheck = exports.lengthCheck = exports.transformObj = exports.removeUndefined = exports.getFlattenCollectionRef = exports.QueryEngine = exports.QueryDto = void 0;
|
|
4
|
+
var query_dto_1 = require("./query.dto");
|
|
5
|
+
Object.defineProperty(exports, "QueryDto", { enumerable: true, get: function () { return query_dto_1.QueryDto; } });
|
|
6
|
+
var query_engine_1 = require("./query.engine");
|
|
7
|
+
Object.defineProperty(exports, "QueryEngine", { enumerable: true, get: function () { return query_engine_1.QueryEngine; } });
|
|
8
|
+
var query_method_1 = require("./query.method");
|
|
9
|
+
Object.defineProperty(exports, "getFlattenCollectionRef", { enumerable: true, get: function () { return query_method_1.getFlattenCollectionRef; } });
|
|
10
|
+
Object.defineProperty(exports, "removeUndefined", { enumerable: true, get: function () { return query_method_1.removeUndefined; } });
|
|
11
|
+
Object.defineProperty(exports, "transformObj", { enumerable: true, get: function () { return query_method_1.transformObj; } });
|
|
12
|
+
Object.defineProperty(exports, "lengthCheck", { enumerable: true, get: function () { return query_method_1.lengthCheck; } });
|
|
13
|
+
Object.defineProperty(exports, "objKeyLengthCheck", { enumerable: true, get: function () { return query_method_1.objKeyLengthCheck; } });
|
|
14
|
+
Object.defineProperty(exports, "sortOnPriority", { enumerable: true, get: function () { return query_method_1.sortOnPriority; } });
|
|
15
|
+
Object.defineProperty(exports, "genGraphLookupTree", { enumerable: true, get: function () { return query_method_1.genGraphLookupTree; } });
|
|
16
|
+
Object.defineProperty(exports, "graphLookupTree", { enumerable: true, get: function () { return query_method_1.graphLookupTree; } });
|
|
17
|
+
Object.defineProperty(exports, "returnArray", { enumerable: true, get: function () { return query_method_1.returnArray; } });
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/mongoose/src/helper/query/index.ts"],"names":[],"mappings":";;;AAAA,yCAEqB;AADjB,qGAAA,QAAQ,OAAA;AAEZ,+CAEwB;AADpB,2GAAA,WAAW,OAAA;AAEf,+CAUwB;AATpB,uHAAA,uBAAuB,OAAA;AACvB,+GAAA,eAAe,OAAA;AACf,4GAAA,YAAY,OAAA;AACZ,2GAAA,WAAW,OAAA;AACX,iHAAA,iBAAiB,OAAA;AACjB,8GAAA,cAAc,OAAA;AACd,kHAAA,kBAAkB,OAAA;AAClB,+GAAA,eAAe,OAAA;AACf,2GAAA,WAAW,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quer.type.js","sourceRoot":"","sources":["../../../../../libs/mongoose/src/helper/query/quer.type.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare class ValidationDto {
|
|
2
|
+
protected readonly getValidationGroups?: () => string[];
|
|
3
|
+
groups?: string[];
|
|
4
|
+
}
|
|
5
|
+
export declare class QueryDto extends ValidationDto {
|
|
6
|
+
criteria?: {
|
|
7
|
+
_or?: boolean;
|
|
8
|
+
_rawUpdate?: boolean;
|
|
9
|
+
_updateType?: string;
|
|
10
|
+
_hardDelete?: boolean;
|
|
11
|
+
_searchString?: string;
|
|
12
|
+
_sort?: object;
|
|
13
|
+
_skip?: number;
|
|
14
|
+
_limit?: number;
|
|
15
|
+
_lookup?: object;
|
|
16
|
+
_graphLookup?: object;
|
|
17
|
+
_unwind?: string[];
|
|
18
|
+
_unset?: string[];
|
|
19
|
+
_group?: object[];
|
|
20
|
+
_project?: object;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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.QueryDto = exports.ValidationDto = void 0;
|
|
13
|
+
const nestjs_dto_1 = require("@adaikappan/nestjs-dto");
|
|
14
|
+
class ValidationDto {
|
|
15
|
+
constructor() {
|
|
16
|
+
this.getValidationGroups = () => {
|
|
17
|
+
return this.groups?.length ? this.groups : [];
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.ValidationDto = ValidationDto;
|
|
22
|
+
class QueryDto extends ValidationDto {
|
|
23
|
+
}
|
|
24
|
+
exports.QueryDto = QueryDto;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, nestjs_dto_1.ObjectDecorator)({ isOpt: true, isReq: false, groups: nestjs_dto_1.ValidationGrp.CRUD }),
|
|
27
|
+
__metadata("design:type", Object)
|
|
28
|
+
], QueryDto.prototype, "criteria", void 0);
|
|
29
|
+
//# sourceMappingURL=query.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.dto.js","sourceRoot":"","sources":["../../../../../libs/mongoose/src/helper/query/query.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uDAA+E;AAE/E,MAAa,aAAa;IAA1B;QACuB,wBAAmB,GAAI,GAAG,EAAE;YAC3C,OAAO,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;QAClD,CAAC,CAAC;IAGN,CAAC;CAAA;AAND,sCAMC;AAED,MAAa,QAAS,SAAQ,aAAa;CAmB1C;AAnBD,4BAmBC;AAjBG;IADC,IAAA,4BAAe,EAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,0BAAG,CAAC,IAAI,EAAE,CAAC;;0CAiBhE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const QueryEngine: ({ ConfigSystem, CollectionRef, GroupRef }: {
|
|
2
|
+
ConfigSystem: any;
|
|
3
|
+
CollectionRef: any;
|
|
4
|
+
GroupRef: any;
|
|
5
|
+
}) => {
|
|
6
|
+
queryAggregate: (props: any) => any[];
|
|
7
|
+
queryUpdate: (props: any) => import("./quer.type").TRemoveUndefinedObject;
|
|
8
|
+
};
|