@elsikora/nestjs-crud-automator 1.7.0-dev.1 → 1.8.0-dev.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/README.md +272 -226
- package/dist/cjs/class/api/service-base.class.d.ts +7 -6
- package/dist/cjs/class/api/service-base.class.js +7 -6
- package/dist/cjs/class/api/service-base.class.js.map +1 -1
- package/dist/cjs/class/metadata-storage.class.js +2 -0
- package/dist/cjs/class/metadata-storage.class.js.map +1 -1
- package/dist/cjs/class/utility/dto/strategy/request.class.js +1 -0
- package/dist/cjs/class/utility/dto/strategy/request.class.js.map +1 -1
- package/dist/cjs/constant/number.constant.js +1 -0
- package/dist/cjs/constant/number.constant.js.map +1 -1
- package/dist/cjs/decorator/api/controller.decorator.js +2 -0
- package/dist/cjs/decorator/api/controller.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/create.decorator.js +8 -3
- package/dist/cjs/decorator/api/function/create.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/decorator.js +2 -0
- package/dist/cjs/decorator/api/function/decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/delete.decorator.js +8 -3
- package/dist/cjs/decorator/api/function/delete.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/get-list.decorator.js +16 -4
- package/dist/cjs/decorator/api/function/get-list.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/get-many.decorator.js +12 -4
- package/dist/cjs/decorator/api/function/get-many.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/get.decorator.js +12 -4
- package/dist/cjs/decorator/api/function/get.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/update.decorator.js +9 -4
- package/dist/cjs/decorator/api/function/update.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/method.decorator.js +2 -0
- package/dist/cjs/decorator/api/method.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/boolean.decorator.js +2 -0
- package/dist/cjs/decorator/api/property/boolean.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/date.decorator.js +2 -0
- package/dist/cjs/decorator/api/property/date.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/enum.decorator.js +2 -0
- package/dist/cjs/decorator/api/property/enum.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/number.decorator.js +4 -0
- package/dist/cjs/decorator/api/property/number.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/object.decorator.js +2 -0
- package/dist/cjs/decorator/api/property/object.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/string.decorator.js +21 -3
- package/dist/cjs/decorator/api/property/string.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/uuid.decorator.js +2 -0
- package/dist/cjs/decorator/api/property/uuid.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/service.decorator.js +55 -12
- package/dist/cjs/decorator/api/service.decorator.js.map +1 -1
- package/dist/cjs/factory/api/controller.factory.js +13 -0
- package/dist/cjs/factory/api/controller.factory.js.map +1 -1
- package/dist/cjs/interface/decorator/api/function/create-executor-properties.interface.d.ts +2 -1
- package/dist/cjs/interface/decorator/api/function/delete-executor-properties.interface.d.ts +3 -2
- package/dist/cjs/interface/decorator/api/function/get-executor-properties.interface.d.ts +2 -1
- package/dist/cjs/interface/decorator/api/function/get-list-executor-properties.interface.d.ts +2 -1
- package/dist/cjs/interface/decorator/api/function/get-many-executor-properties.interface.d.ts +2 -1
- package/dist/cjs/interface/decorator/api/function/update-executor-properties.interface.d.ts +3 -2
- package/dist/cjs/utility/api/controller/get-list/transform-filter.utility.js +5 -0
- package/dist/cjs/utility/api/controller/get-list/transform-filter.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/get-list/transform-operation.utility.js +2 -0
- package/dist/cjs/utility/api/controller/get-list/transform-operation.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/handle-request-relations.utility.js +2 -0
- package/dist/cjs/utility/api/controller/handle-request-relations.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/write-dto-swagger.utility.js +3 -0
- package/dist/cjs/utility/api/controller/write-dto-swagger.utility.js.map +1 -1
- package/dist/cjs/utility/api/filter-order-by-from-entity.utility.js +2 -0
- package/dist/cjs/utility/api/filter-order-by-from-entity.utility.js.map +1 -1
- package/dist/cjs/utility/dto/build-decorator.utility.js +1 -0
- package/dist/cjs/utility/dto/build-decorator.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate-filter-decorator.utility.js +2 -0
- package/dist/cjs/utility/dto/generate-filter-decorator.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate.utility.js +17 -0
- package/dist/cjs/utility/dto/generate.utility.js.map +1 -1
- package/dist/cjs/utility/dto/get-decorator-config.utility.js +1 -0
- package/dist/cjs/utility/dto/get-decorator-config.utility.js.map +1 -1
- package/dist/cjs/utility/dto/validate-property-config.utility.js +1 -0
- package/dist/cjs/utility/dto/validate-property-config.utility.js.map +1 -1
- package/dist/cjs/utility/generate-entity-information.utility.js +5 -0
- package/dist/cjs/utility/generate-entity-information.utility.js.map +1 -1
- package/dist/cjs/utility/get-entity-columns.utility.js +1 -0
- package/dist/cjs/utility/get-entity-columns.utility.js.map +1 -1
- package/dist/cjs/utility/is-error-of-type.utility.js +2 -0
- package/dist/cjs/utility/is-error-of-type.utility.js.map +1 -1
- package/dist/cjs/utility/logger.utility.d.ts +9 -0
- package/dist/cjs/utility/logger.utility.js +11 -0
- package/dist/cjs/utility/logger.utility.js.map +1 -1
- package/dist/cjs/validator/all-or-none-of-listed-properties.validator.js +1 -0
- package/dist/cjs/validator/all-or-none-of-listed-properties.validator.js.map +1 -1
- package/dist/cjs/validator/has-at-least-one-and-only-one-of-listed-properties.validator.js +1 -0
- package/dist/cjs/validator/has-at-least-one-and-only-one-of-listed-properties.validator.js.map +1 -1
- package/dist/cjs/validator/has-at-least-one-of-listed-properties.validator.js +1 -0
- package/dist/cjs/validator/has-at-least-one-of-listed-properties.validator.js.map +1 -1
- package/dist/cjs/validator/has-at-least-one-property.validator.js +1 -0
- package/dist/cjs/validator/has-at-least-one-property.validator.js.map +1 -1
- package/dist/cjs/validator/has-paired-custom-suffixes-fields.validator.js +6 -0
- package/dist/cjs/validator/has-paired-custom-suffixes-fields.validator.js.map +1 -1
- package/dist/cjs/validator/only-one-of-listed-properties.validator.js +1 -0
- package/dist/cjs/validator/only-one-of-listed-properties.validator.js.map +1 -1
- package/dist/esm/class/api/service-base.class.d.ts +7 -6
- package/dist/esm/interface/decorator/api/function/create-executor-properties.interface.d.ts +2 -1
- package/dist/esm/interface/decorator/api/function/delete-executor-properties.interface.d.ts +3 -2
- package/dist/esm/interface/decorator/api/function/get-executor-properties.interface.d.ts +2 -1
- package/dist/esm/interface/decorator/api/function/get-list-executor-properties.interface.d.ts +2 -1
- package/dist/esm/interface/decorator/api/function/get-many-executor-properties.interface.d.ts +2 -1
- package/dist/esm/interface/decorator/api/function/update-executor-properties.interface.d.ts +3 -2
- package/dist/esm/src/class/api/service-base.class.js +7 -6
- package/dist/esm/src/class/api/service-base.class.js.map +1 -1
- package/dist/esm/src/class/metadata-storage.class.js +2 -0
- package/dist/esm/src/class/metadata-storage.class.js.map +1 -1
- package/dist/esm/src/class/utility/dto/strategy/request.class.js +1 -0
- package/dist/esm/src/class/utility/dto/strategy/request.class.js.map +1 -1
- package/dist/esm/src/constant/number.constant.js +1 -0
- package/dist/esm/src/constant/number.constant.js.map +1 -1
- package/dist/esm/src/decorator/api/controller.decorator.js +2 -0
- package/dist/esm/src/decorator/api/controller.decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/function/create.decorator.js +8 -3
- package/dist/esm/src/decorator/api/function/create.decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/function/decorator.js +2 -0
- package/dist/esm/src/decorator/api/function/decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/function/delete.decorator.js +8 -3
- package/dist/esm/src/decorator/api/function/delete.decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/function/get-list.decorator.js +16 -4
- package/dist/esm/src/decorator/api/function/get-list.decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/function/get-many.decorator.js +12 -4
- package/dist/esm/src/decorator/api/function/get-many.decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/function/get.decorator.js +12 -4
- package/dist/esm/src/decorator/api/function/get.decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/function/update.decorator.js +9 -4
- package/dist/esm/src/decorator/api/function/update.decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/method.decorator.js +2 -0
- package/dist/esm/src/decorator/api/method.decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/property/boolean.decorator.js +2 -0
- package/dist/esm/src/decorator/api/property/boolean.decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/property/date.decorator.js +2 -0
- package/dist/esm/src/decorator/api/property/date.decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/property/enum.decorator.js +2 -0
- package/dist/esm/src/decorator/api/property/enum.decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/property/number.decorator.js +4 -0
- package/dist/esm/src/decorator/api/property/number.decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/property/object.decorator.js +2 -0
- package/dist/esm/src/decorator/api/property/object.decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/property/string.decorator.js +21 -3
- package/dist/esm/src/decorator/api/property/string.decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/property/uuid.decorator.js +2 -0
- package/dist/esm/src/decorator/api/property/uuid.decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/service.decorator.js +55 -12
- package/dist/esm/src/decorator/api/service.decorator.js.map +1 -1
- package/dist/esm/src/factory/api/controller.factory.js +13 -0
- package/dist/esm/src/factory/api/controller.factory.js.map +1 -1
- package/dist/esm/src/utility/api/controller/get-list/transform-filter.utility.js +5 -0
- package/dist/esm/src/utility/api/controller/get-list/transform-filter.utility.js.map +1 -1
- package/dist/esm/src/utility/api/controller/get-list/transform-operation.utility.js +2 -0
- package/dist/esm/src/utility/api/controller/get-list/transform-operation.utility.js.map +1 -1
- package/dist/esm/src/utility/api/controller/handle-request-relations.utility.js +2 -0
- package/dist/esm/src/utility/api/controller/handle-request-relations.utility.js.map +1 -1
- package/dist/esm/src/utility/api/controller/write-dto-swagger.utility.js +3 -0
- package/dist/esm/src/utility/api/controller/write-dto-swagger.utility.js.map +1 -1
- package/dist/esm/src/utility/api/filter-order-by-from-entity.utility.js +2 -0
- package/dist/esm/src/utility/api/filter-order-by-from-entity.utility.js.map +1 -1
- package/dist/esm/src/utility/dto/build-decorator.utility.js +1 -0
- package/dist/esm/src/utility/dto/build-decorator.utility.js.map +1 -1
- package/dist/esm/src/utility/dto/generate-filter-decorator.utility.js +2 -0
- package/dist/esm/src/utility/dto/generate-filter-decorator.utility.js.map +1 -1
- package/dist/esm/src/utility/dto/generate.utility.js +17 -0
- package/dist/esm/src/utility/dto/generate.utility.js.map +1 -1
- package/dist/esm/src/utility/dto/get-decorator-config.utility.js +1 -0
- package/dist/esm/src/utility/dto/get-decorator-config.utility.js.map +1 -1
- package/dist/esm/src/utility/dto/validate-property-config.utility.js +1 -0
- package/dist/esm/src/utility/dto/validate-property-config.utility.js.map +1 -1
- package/dist/esm/src/utility/generate-entity-information.utility.js +5 -0
- package/dist/esm/src/utility/generate-entity-information.utility.js.map +1 -1
- package/dist/esm/src/utility/get-entity-columns.utility.js +1 -0
- package/dist/esm/src/utility/get-entity-columns.utility.js.map +1 -1
- package/dist/esm/src/utility/is-error-of-type.utility.js +2 -0
- package/dist/esm/src/utility/is-error-of-type.utility.js.map +1 -1
- package/dist/esm/src/utility/logger.utility.js +11 -0
- package/dist/esm/src/utility/logger.utility.js.map +1 -1
- package/dist/esm/src/validator/all-or-none-of-listed-properties.validator.js +1 -0
- package/dist/esm/src/validator/all-or-none-of-listed-properties.validator.js.map +1 -1
- package/dist/esm/src/validator/has-at-least-one-and-only-one-of-listed-properties.validator.js +1 -0
- package/dist/esm/src/validator/has-at-least-one-and-only-one-of-listed-properties.validator.js.map +1 -1
- package/dist/esm/src/validator/has-at-least-one-of-listed-properties.validator.js +1 -0
- package/dist/esm/src/validator/has-at-least-one-of-listed-properties.validator.js.map +1 -1
- package/dist/esm/src/validator/has-at-least-one-property.validator.js +1 -0
- package/dist/esm/src/validator/has-at-least-one-property.validator.js.map +1 -1
- package/dist/esm/src/validator/has-paired-custom-suffixes-fields.validator.js +6 -0
- package/dist/esm/src/validator/has-paired-custom-suffixes-fields.validator.js.map +1 -1
- package/dist/esm/src/validator/only-one-of-listed-properties.validator.js +1 -0
- package/dist/esm/src/validator/only-one-of-listed-properties.validator.js.map +1 -1
- package/dist/esm/utility/logger.utility.d.ts +9 -0
- package/package.json +5 -5
|
@@ -4,9 +4,13 @@ var tslib_es6 = require('../external/tslib/tslib.es6.js');
|
|
|
4
4
|
var common = require('@nestjs/common');
|
|
5
5
|
|
|
6
6
|
var LoggerUtility_1;
|
|
7
|
+
/**
|
|
8
|
+
* Custom logger that extends NestJS's ConsoleLogger with environment-based log level filtering
|
|
9
|
+
*/
|
|
7
10
|
exports.LoggerUtility = class LoggerUtility extends common.ConsoleLogger {
|
|
8
11
|
static { LoggerUtility_1 = this; }
|
|
9
12
|
static ENV_LOG_LEVEL_KEY = "NCD_LOG_LEVEL";
|
|
13
|
+
// eslint-disable-next-line @elsikora/javascript/constructor-super,@elsikora/sonar/super-invocation
|
|
10
14
|
constructor(context) {
|
|
11
15
|
if (context != null) {
|
|
12
16
|
super(context, {
|
|
@@ -14,12 +18,19 @@ exports.LoggerUtility = class LoggerUtility extends common.ConsoleLogger {
|
|
|
14
18
|
});
|
|
15
19
|
}
|
|
16
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Static method to create a logger with a specific context
|
|
23
|
+
*/
|
|
17
24
|
static getLogger(context) {
|
|
18
25
|
return new LoggerUtility_1(`NestJS-Crud-Automator/${context ?? "Core"}`);
|
|
19
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Get the current log level from environment variable
|
|
29
|
+
*/
|
|
20
30
|
static getLogLevelsFromEnv() {
|
|
21
31
|
const logLevel = process.env[this.ENV_LOG_LEVEL_KEY] ?? "none";
|
|
22
32
|
if (!logLevel) {
|
|
33
|
+
// Default log levels if not specified in env
|
|
23
34
|
return ["error", "warn", "log"];
|
|
24
35
|
}
|
|
25
36
|
switch (logLevel.toLowerCase()) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.utility.js","sources":["../../../../src/utility/logger.utility.ts"],"sourcesContent":[null],"names":["LoggerUtility","ConsoleLogger","__decorate","Injectable"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"logger.utility.js","sources":["../../../../src/utility/logger.utility.ts"],"sourcesContent":[null],"names":["LoggerUtility","ConsoleLogger","__decorate","Injectable"],"mappings":";;;;;;AAIA;;AAEG;AAEUA,qBAAa,GAAnB,MAAM,aAAc,SAAQC,oBAAa,CAAA;;AACvC,IAAA,OAAgB,iBAAiB,GAAW,eAAe;;AAGnE,IAAA,WAAA,CAAY,OAAgB,EAAA;AAC3B,QAAA,IAAI,OAAO,IAAI,IAAI,EAAE;YACpB,KAAK,CAAC,OAAO,EAAE;AACd,gBAAA,SAAS,EAAE,eAAa,CAAC,mBAAmB,EAAE;AAC9C,aAAA,CAAC;;;AAIJ;;AAEG;IACI,OAAO,SAAS,CAAC,OAAgB,EAAA;QACvC,OAAO,IAAI,eAAa,CAAC,CAAA,sBAAA,EAAyB,OAAO,IAAI,MAAM,CAAE,CAAA,CAAC;;AAGvE;;AAEG;AACK,IAAA,OAAO,mBAAmB,GAAA;AACjC,QAAA,MAAM,QAAQ,GAAW,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,MAAM;QAEtE,IAAI,CAAC,QAAQ,EAAE;;AAEd,YAAA,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC;;AAGhC,QAAA,QAAQ,QAAQ,CAAC,WAAW,EAAE;YAC7B,KAAK,OAAO,EAAE;gBACb,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC;;YAGzC,KAAK,OAAO,EAAE;gBACb,OAAO,CAAC,OAAO,CAAC;;YAGjB,KAAK,KAAK,EAAE;AACX,gBAAA,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC;;YAGhC,KAAK,MAAM,EAAE;AACZ,gBAAA,OAAO,EAAE;;YAGV,KAAK,SAAS,EAAE;gBACf,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,CAAC;;YAGpD,KAAK,MAAM,EAAE;AACZ,gBAAA,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC;;YAGzB,SAAS;AACR,gBAAA,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC;;;;;AAxDtBD,qBAAa,GAAA,eAAA,GAAAE,oBAAA,CAAA;AADzB,IAAAC,iBAAU,EAAE;;AACA,CAAA,EAAAH,qBAAa,CA4DzB;;"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var tslib_es6 = require('../external/tslib/tslib.es6.js');
|
|
4
4
|
var classValidator = require('class-validator');
|
|
5
5
|
|
|
6
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
6
7
|
exports.AllOrNoneOfListedProperties = class AllOrNoneOfListedProperties {
|
|
7
8
|
defaultMessage(properties) {
|
|
8
9
|
return `either all or none of the following properties must be provided: ${properties.constraints.join(", ")}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all-or-none-of-listed-properties.validator.js","sources":["../../../../src/validator/all-or-none-of-listed-properties.validator.ts"],"sourcesContent":[null],"names":["AllOrNoneOfListedProperties","__decorate","ValidatorConstraint"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"all-or-none-of-listed-properties.validator.js","sources":["../../../../src/validator/all-or-none-of-listed-properties.validator.ts"],"sourcesContent":[null],"names":["AllOrNoneOfListedProperties","__decorate","ValidatorConstraint"],"mappings":";;;;;AAIA;AAEaA,mCAA2B,GAAjC,MAAM,2BAA2B,CAAA;AACvC,IAAA,cAAc,CAAC,UAA+B,EAAA;QAC7C,OAAO,CAAA,iEAAA,EAAoE,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,CAAE;;IAG/G,QAAQ,CAAC,MAAe,EAAE,UAA+B,EAAA;AACxD,QAAA,MAAM,WAAW,GAAkB,UAAU,CAAC,WAA4B;AAE1E,QAAA,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;AAC3B,YAAA,MAAM,eAAe,GAAwB,UAAU,CAAC,MAA6B;AACrF,YAAA,MAAM,aAAa,GAAkB,WAAW,CAAC,MAAM,CAAC,CAAC,KAAa,KAAK,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,eAAe,EAAE,KAAK,CAAC,IAAI,eAAe,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC;AAEhL,YAAA,OAAO,aAAa,CAAC,MAAM,KAAK,CAAC,IAAI,aAAa,CAAC,MAAM,KAAK,WAAW,CAAC,MAAM;;AAGjF,QAAA,OAAO,IAAI;;;AAfAA,mCAA2B,GAAAC,oBAAA,CAAA;IADvCC,kCAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,kCAAkC,EAAE;AAClE,CAAA,EAAAF,mCAA2B,CAiBvC;;"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var tslib_es6 = require('../external/tslib/tslib.es6.js');
|
|
4
4
|
var classValidator = require('class-validator');
|
|
5
5
|
|
|
6
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
6
7
|
exports.HasAtLeastOneAndOnlyOneOfListedProperties = class HasAtLeastOneAndOnlyOneOfListedProperties {
|
|
7
8
|
defaultMessage(properties) {
|
|
8
9
|
return `at least one and only one of the following properties must be provided: ${properties.constraints.join(", ")}`;
|
package/dist/cjs/validator/has-at-least-one-and-only-one-of-listed-properties.validator.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"has-at-least-one-and-only-one-of-listed-properties.validator.js","sources":["../../../../src/validator/has-at-least-one-and-only-one-of-listed-properties.validator.ts"],"sourcesContent":[null],"names":["HasAtLeastOneAndOnlyOneOfListedProperties","__decorate","ValidatorConstraint"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"has-at-least-one-and-only-one-of-listed-properties.validator.js","sources":["../../../../src/validator/has-at-least-one-and-only-one-of-listed-properties.validator.ts"],"sourcesContent":[null],"names":["HasAtLeastOneAndOnlyOneOfListedProperties","__decorate","ValidatorConstraint"],"mappings":";;;;;AAIA;AAEaA,iDAAyC,GAA/C,MAAM,yCAAyC,CAAA;AACrD,IAAA,cAAc,CAAC,UAA+B,EAAA;QAC7C,OAAO,CAAA,wEAAA,EAA2E,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,CAAE;;IAGtH,QAAQ,CAAC,MAAe,EAAE,UAA+B,EAAA;AACxD,QAAA,MAAM,WAAW,GAAkB,UAAU,CAAC,WAA4B;AAE1E,QAAA,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;YAC3B,IAAI,QAAQ,GAAY,KAAK;YAC7B,IAAI,KAAK,GAAW,CAAC;AACrB,YAAA,MAAM,eAAe,GAAwB,UAAU,CAAC,MAA6B;AAErF,YAAA,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE;gBACrC,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,IAAI,eAAe,CAAC,UAAU,CAAC,KAAK,SAAS,EAAE;oBACnH,QAAQ,GAAG,IAAI;AACf,oBAAA,KAAK,EAAE;;;AAIT,YAAA,IAAI,KAAK,KAAK,CAAC,EAAE;AAChB,gBAAA,OAAO,KAAK;;AAGb,YAAA,OAAO,QAAQ;;AAGhB,QAAA,OAAO,IAAI;;;AA3BAA,iDAAyC,GAAAC,oBAAA,CAAA;IADrDC,kCAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,uCAAuC,EAAE;AACvE,CAAA,EAAAF,iDAAyC,CA6BrD;;"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var tslib_es6 = require('../external/tslib/tslib.es6.js');
|
|
4
4
|
var classValidator = require('class-validator');
|
|
5
5
|
|
|
6
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
6
7
|
exports.HasAtLeastOneOfListedProperties = class HasAtLeastOneOfListedProperties {
|
|
7
8
|
defaultMessage(properties) {
|
|
8
9
|
return `at least one of the following properties must be provided: ${properties.constraints.join(", ")}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"has-at-least-one-of-listed-properties.validator.js","sources":["../../../../src/validator/has-at-least-one-of-listed-properties.validator.ts"],"sourcesContent":[null],"names":["HasAtLeastOneOfListedProperties","__decorate","ValidatorConstraint"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"has-at-least-one-of-listed-properties.validator.js","sources":["../../../../src/validator/has-at-least-one-of-listed-properties.validator.ts"],"sourcesContent":[null],"names":["HasAtLeastOneOfListedProperties","__decorate","ValidatorConstraint"],"mappings":";;;;;AAIA;AAEaA,uCAA+B,GAArC,MAAM,+BAA+B,CAAA;AAC3C,IAAA,cAAc,CAAC,UAA+B,EAAA;QAC7C,OAAO,CAAA,2DAAA,EAA8D,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,CAAE;;IAGzG,QAAQ,CAAC,MAAe,EAAE,UAA+B,EAAA;AACxD,QAAA,MAAM,WAAW,GAAkB,UAAU,CAAC,WAA4B;AAE1E,QAAA,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;YAC3B,IAAI,QAAQ,GAAY,KAAK;AAC7B,YAAA,MAAM,eAAe,GAAwB,UAAU,CAAC,MAA6B;AAErF,YAAA,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE;gBACrC,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,IAAI,eAAe,CAAC,UAAU,CAAC,KAAK,SAAS,EAAE;oBACnH,QAAQ,GAAG,IAAI;oBAEf;;;AAIF,YAAA,OAAO,QAAQ;;AAGhB,QAAA,OAAO,IAAI;;;AAvBAA,uCAA+B,GAAAC,oBAAA,CAAA;IAD3CC,kCAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,uCAAuC,EAAE;AACvE,CAAA,EAAAF,uCAA+B,CAyB3C;;"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var tslib_es6 = require('../external/tslib/tslib.es6.js');
|
|
4
4
|
var classValidator = require('class-validator');
|
|
5
5
|
|
|
6
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
6
7
|
exports.HasAtLeastOneProperty = class HasAtLeastOneProperty {
|
|
7
8
|
defaultMessage() {
|
|
8
9
|
return "at least one property must be provided";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"has-at-least-one-property.validator.js","sources":["../../../../src/validator/has-at-least-one-property.validator.ts"],"sourcesContent":[null],"names":["HasAtLeastOneProperty","__decorate","ValidatorConstraint"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"has-at-least-one-property.validator.js","sources":["../../../../src/validator/has-at-least-one-property.validator.ts"],"sourcesContent":[null],"names":["HasAtLeastOneProperty","__decorate","ValidatorConstraint"],"mappings":";;;;;AAIA;AAEaA,6BAAqB,GAA3B,MAAM,qBAAqB,CAAA;IACjC,cAAc,GAAA;AACb,QAAA,OAAO,wCAAwC;;IAGhD,QAAQ,CAAC,MAAe,EAAE,UAA+B,EAAA;AACxD,QAAA,OAAO,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC;;;AANrCA,6BAAqB,GAAAC,oBAAA,CAAA;IADjCC,kCAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,2BAA2B,EAAE;AAC3D,CAAA,EAAAF,6BAAqB,CAQjC;;"}
|
|
@@ -13,6 +13,7 @@ var EArgumentType;
|
|
|
13
13
|
const DEFAULT_OPERATION_CONFIGS = {
|
|
14
14
|
[filterOperation_enum.EFilterOperation.BETWEEN]: {
|
|
15
15
|
argumentType: EArgumentType.ARRAY,
|
|
16
|
+
// eslint-disable-next-line @elsikora/typescript/no-magic-numbers
|
|
16
17
|
exactLength: 2,
|
|
17
18
|
},
|
|
18
19
|
[filterOperation_enum.EFilterOperation.CONT]: {
|
|
@@ -86,6 +87,7 @@ const DEFAULT_OPERATION_CONFIGS = {
|
|
|
86
87
|
argumentType: EArgumentType.SINGLE,
|
|
87
88
|
},
|
|
88
89
|
};
|
|
90
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
89
91
|
exports.HasPairedCustomSuffixesFields = class HasPairedCustomSuffixesFields {
|
|
90
92
|
defaultMessage(properties) {
|
|
91
93
|
const object = properties.object;
|
|
@@ -123,6 +125,8 @@ exports.HasPairedCustomSuffixesFields = class HasPairedCustomSuffixesFields {
|
|
|
123
125
|
if (valueFields.length > 1) {
|
|
124
126
|
return `group "${baseName}" can only have one value with suffix [${[...valueSuffixes].join(", ")}] when operator is present`;
|
|
125
127
|
}
|
|
128
|
+
// @ts-ignore
|
|
129
|
+
// eslint-disable-next-line @elsikora/typescript/no-unsafe-assignment
|
|
126
130
|
const value = indexableObject[valueFields[0]];
|
|
127
131
|
const isArray = Array.isArray(value);
|
|
128
132
|
if (operatorConfig.argumentType === EArgumentType.ARRAY && !isArray) {
|
|
@@ -189,6 +193,8 @@ exports.HasPairedCustomSuffixesFields = class HasPairedCustomSuffixesFields {
|
|
|
189
193
|
const valueFields = valueSuffixes.filter((suffix) => groupSuffixes.has(suffix)).map((suffix) => `${baseName}[${suffix}]`);
|
|
190
194
|
if (valueFields.length !== 1)
|
|
191
195
|
return false;
|
|
196
|
+
// @ts-ignore
|
|
197
|
+
// eslint-disable-next-line @elsikora/typescript/no-unsafe-assignment
|
|
192
198
|
const value = indexableObject[valueFields[0]];
|
|
193
199
|
const isArray = Array.isArray(value);
|
|
194
200
|
if (operatorConfig.argumentType === EArgumentType.ARRAY && !isArray)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"has-paired-custom-suffixes-fields.validator.js","sources":["../../../../src/validator/has-paired-custom-suffixes-fields.validator.ts"],"sourcesContent":[null],"names":["EFilterOperation","HasPairedCustomSuffixesFields","__decorate","ValidatorConstraint"],"mappings":";;;;;;AAIA,IAAK,aAIJ;AAJD,CAAA,UAAK,aAAa,EAAA;AACjB,IAAA,aAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,aAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AAClB,CAAC,EAJI,aAAa,KAAb,aAAa,GAIjB,EAAA,CAAA,CAAA;AAeD,MAAM,yBAAyB,GAA+C;AAC7E,IAAA,CAACA,qCAAgB,CAAC,OAAO,GAAG;QAC3B,YAAY,EAAE,aAAa,CAAC,KAAK
|
|
1
|
+
{"version":3,"file":"has-paired-custom-suffixes-fields.validator.js","sources":["../../../../src/validator/has-paired-custom-suffixes-fields.validator.ts"],"sourcesContent":[null],"names":["EFilterOperation","HasPairedCustomSuffixesFields","__decorate","ValidatorConstraint"],"mappings":";;;;;;AAIA,IAAK,aAIJ;AAJD,CAAA,UAAK,aAAa,EAAA;AACjB,IAAA,aAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,aAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AAClB,CAAC,EAJI,aAAa,KAAb,aAAa,GAIjB,EAAA,CAAA,CAAA;AAeD,MAAM,yBAAyB,GAA+C;AAC7E,IAAA,CAACA,qCAAgB,CAA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,KAAK;AAEnG,oBAAA,IAAI,cAAc,CAAC,SAAS,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,GAAG,cAAc,CAAC,SAAS;AAAE,wBAAA,OAAO,KAAK;;;;AAKtG,QAAA,OAAO,IAAI;;;AA1JAA,qCAA6B,GAAAC,oBAAA,CAAA;IADzCC,kCAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,mCAAmC,EAAE;AACnE,CAAA,EAAAF,qCAA6B,CA4JzC;;"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var tslib_es6 = require('../external/tslib/tslib.es6.js');
|
|
4
4
|
var classValidator = require('class-validator');
|
|
5
5
|
|
|
6
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
6
7
|
exports.OnlyOneOfListedProperties = class OnlyOneOfListedProperties {
|
|
7
8
|
defaultMessage(properties) {
|
|
8
9
|
return `only one of the following properties must be provided: ${properties.constraints.join(", ")}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"only-one-of-listed-properties.validator.js","sources":["../../../../src/validator/only-one-of-listed-properties.validator.ts"],"sourcesContent":[null],"names":["OnlyOneOfListedProperties","__decorate","ValidatorConstraint"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"only-one-of-listed-properties.validator.js","sources":["../../../../src/validator/only-one-of-listed-properties.validator.ts"],"sourcesContent":[null],"names":["OnlyOneOfListedProperties","__decorate","ValidatorConstraint"],"mappings":";;;;;AAIA;AAEaA,iCAAyB,GAA/B,MAAM,yBAAyB,CAAA;AACrC,IAAA,cAAc,CAAC,UAA+B,EAAA;QAC7C,OAAO,CAAA,uDAAA,EAA0D,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,CAAE;;IAGrG,QAAQ,CAAC,MAAe,EAAE,UAA+B,EAAA;AACxD,QAAA,MAAM,WAAW,GAAkB,UAAU,CAAC,WAA4B;AAE1E,QAAA,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;YAC3B,IAAI,KAAK,GAAW,CAAC;AACrB,YAAA,MAAM,eAAe,GAAwB,UAAU,CAAC,MAA6B;AAErF,YAAA,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE;gBACrC,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,IAAI,eAAe,CAAC,UAAU,CAAC,KAAK,SAAS,EAAE;AACnH,oBAAA,KAAK,EAAE;;;YAIT,OAAO,KAAK,KAAK,CAAC;;AAGnB,QAAA,OAAO,IAAI;;;AArBAA,iCAAyB,GAAAC,oBAAA,CAAA;IADrCC,kCAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,+BAA+B,EAAE;AAC/D,CAAA,EAAAF,iCAAyB,CAuBrC;;"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import type { EntityManager } from "typeorm";
|
|
1
2
|
import type { IApiGetListResponseResult } from "../../interface";
|
|
2
3
|
import type { TApiFunctionGetManyProperties, TApiFunctionUpdateCriteria } from "../../type";
|
|
3
4
|
import type { TApiFunctionCreateProperties, TApiFunctionDeleteCriteria, TApiFunctionGetListProperties, TApiFunctionGetProperties, TApiFunctionUpdateProperties } from "../../type";
|
|
4
5
|
export declare class ApiServiceBase<E> {
|
|
5
|
-
create(properties: TApiFunctionCreateProperties<E
|
|
6
|
-
delete(criteria: TApiFunctionDeleteCriteria<E
|
|
7
|
-
get(properties: TApiFunctionGetProperties<E
|
|
8
|
-
getList(properties: TApiFunctionGetListProperties<E
|
|
9
|
-
getMany(properties: TApiFunctionGetManyProperties<E
|
|
10
|
-
update(criteria: TApiFunctionUpdateCriteria<E>, properties: TApiFunctionUpdateProperties<E
|
|
6
|
+
create(properties: TApiFunctionCreateProperties<E>, eventManager?: EntityManager): Promise<E>;
|
|
7
|
+
delete(criteria: TApiFunctionDeleteCriteria<E>, eventManager?: EntityManager): Promise<void>;
|
|
8
|
+
get(properties: TApiFunctionGetProperties<E>, eventManager?: EntityManager): Promise<E>;
|
|
9
|
+
getList(properties: TApiFunctionGetListProperties<E>, eventManager?: EntityManager): Promise<IApiGetListResponseResult<E>>;
|
|
10
|
+
getMany(properties: TApiFunctionGetManyProperties<E>, eventManager?: EntityManager): Promise<Array<E>>;
|
|
11
|
+
update(criteria: TApiFunctionUpdateCriteria<E>, properties: TApiFunctionUpdateProperties<E>, eventManager?: EntityManager): Promise<E>;
|
|
11
12
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { Repository } from "typeorm";
|
|
1
|
+
import type { EntityManager, Repository } from "typeorm";
|
|
2
2
|
import type { TApiFunctionCreateProperties } from "../../../../type";
|
|
3
3
|
import type { IApiBaseEntity } from "../../../api-base-entity.interface";
|
|
4
4
|
export interface IApiFunctionCreateExecutorProperties<E extends IApiBaseEntity> {
|
|
5
5
|
entity: IApiBaseEntity;
|
|
6
|
+
eventManager?: EntityManager;
|
|
6
7
|
properties: TApiFunctionCreateProperties<E>;
|
|
7
8
|
repository: Repository<E>;
|
|
8
9
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type { FindOptionsWhere, Repository } from "typeorm";
|
|
1
|
+
import type { EntityManager, FindOptionsWhere, Repository } from "typeorm";
|
|
2
2
|
import type { TApiFunctionGetProperties } from "../../../../type";
|
|
3
3
|
import type { IApiBaseEntity } from "../../../api-base-entity.interface";
|
|
4
4
|
export interface IApiFunctionDeleteExecutorProperties<E extends IApiBaseEntity> {
|
|
5
5
|
criteria: FindOptionsWhere<E>;
|
|
6
6
|
entity: IApiBaseEntity;
|
|
7
|
-
|
|
7
|
+
eventManager?: EntityManager;
|
|
8
|
+
getFunction: (properties: TApiFunctionGetProperties<E>, eventManager?: EntityManager) => Promise<E>;
|
|
8
9
|
repository: Repository<E>;
|
|
9
10
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { Repository } from "typeorm";
|
|
1
|
+
import type { EntityManager, Repository } from "typeorm";
|
|
2
2
|
import type { TApiFunctionGetProperties } from "../../../../type";
|
|
3
3
|
import type { IApiBaseEntity } from "../../../api-base-entity.interface";
|
|
4
4
|
export interface IApiFunctionGetExecutorProperties<E extends IApiBaseEntity> {
|
|
5
5
|
entity: IApiBaseEntity;
|
|
6
|
+
eventManager?: EntityManager;
|
|
6
7
|
properties: TApiFunctionGetProperties<E>;
|
|
7
8
|
repository: Repository<E>;
|
|
8
9
|
}
|
package/dist/esm/interface/decorator/api/function/get-list-executor-properties.interface.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { Repository } from "typeorm";
|
|
1
|
+
import type { EntityManager, Repository } from "typeorm";
|
|
2
2
|
import type { TApiFunctionGetListProperties } from "../../../../type";
|
|
3
3
|
import type { IApiBaseEntity } from "../../../api-base-entity.interface";
|
|
4
4
|
export interface IApiFunctionGetListExecutorProperties<E extends IApiBaseEntity> {
|
|
5
5
|
entity: IApiBaseEntity;
|
|
6
|
+
eventManager?: EntityManager;
|
|
6
7
|
properties: TApiFunctionGetListProperties<E>;
|
|
7
8
|
repository: Repository<E>;
|
|
8
9
|
}
|
package/dist/esm/interface/decorator/api/function/get-many-executor-properties.interface.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { Repository } from "typeorm";
|
|
1
|
+
import type { EntityManager, Repository } from "typeorm";
|
|
2
2
|
import type { TApiFunctionGetManyProperties } from "../../../../type";
|
|
3
3
|
import type { IApiBaseEntity } from "../../../api-base-entity.interface";
|
|
4
4
|
export interface IApiFunctionGetManyExecutorProperties<E extends IApiBaseEntity> {
|
|
5
5
|
entity: IApiBaseEntity;
|
|
6
|
+
eventManager?: EntityManager;
|
|
6
7
|
properties: TApiFunctionGetManyProperties<E>;
|
|
7
8
|
repository: Repository<E>;
|
|
8
9
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { FindOptionsWhere, Repository } from "typeorm";
|
|
1
|
+
import type { EntityManager, FindOptionsWhere, Repository } from "typeorm";
|
|
2
2
|
import type { TApiFunctionGetProperties, TApiFunctionUpdateProperties } from "../../../../type";
|
|
3
3
|
import type { IApiBaseEntity } from "../../../api-base-entity.interface";
|
|
4
4
|
export interface IApiFunctionUpdateExecutorProperties<E extends IApiBaseEntity> {
|
|
5
5
|
criteria: FindOptionsWhere<E>;
|
|
6
6
|
entity: IApiBaseEntity;
|
|
7
|
-
|
|
7
|
+
eventManager?: EntityManager;
|
|
8
|
+
getFunction: (properties: TApiFunctionGetProperties<E>, eventManager?: EntityManager) => Promise<E>;
|
|
8
9
|
properties: TApiFunctionUpdateProperties<E>;
|
|
9
10
|
repository: Repository<E>;
|
|
10
11
|
}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
class ApiServiceBase {
|
|
2
|
-
create(properties) {
|
|
2
|
+
create(properties, eventManager) {
|
|
3
3
|
return Promise.resolve({});
|
|
4
4
|
}
|
|
5
|
-
delete(criteria) {
|
|
5
|
+
delete(criteria, eventManager) {
|
|
6
6
|
return Promise.resolve();
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
// eslint-disable-next-line @elsikora/sonar/no-identical-functions
|
|
9
|
+
get(properties, eventManager) {
|
|
9
10
|
return Promise.resolve({});
|
|
10
11
|
}
|
|
11
|
-
getList(properties) {
|
|
12
|
+
getList(properties, eventManager) {
|
|
12
13
|
return Promise.resolve({ items: [], total: 0 });
|
|
13
14
|
}
|
|
14
|
-
getMany(properties) {
|
|
15
|
+
getMany(properties, eventManager) {
|
|
15
16
|
return Promise.resolve([]);
|
|
16
17
|
}
|
|
17
|
-
update(criteria, properties) {
|
|
18
|
+
update(criteria, properties, eventManager) {
|
|
18
19
|
return Promise.resolve({});
|
|
19
20
|
}
|
|
20
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-base.class.js","sources":["../../../../../../src/class/api/service-base.class.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"service-base.class.js","sources":["../../../../../../src/class/api/service-base.class.ts"],"sourcesContent":[null],"names":[],"mappings":"MAOa,cAAc,CAAA;IAC1B,MAAM,CAAC,UAA2C,EAAE,YAA4B,EAAA;AAI/E,QAAA,OAAO,OAAO,CAAC,OAAO,CAAC,EAAO,CAAC;;IAGhC,MAAM,CAAC,QAAuC,EAAE,YAA4B,EAAA;AAI3E,QAAA,OAAO,OAAO,CAAC,OAAO,EAAE;;;IAIzB,GAAG,CAAC,UAAwC,EAAE,YAA4B,EAAA;AAIzE,QAAA,OAAO,OAAO,CAAC,OAAO,CAAC,EAAO,CAAC;;IAGhC,OAAO,CAAC,UAA4C,EAAE,YAA4B,EAAA;AAIjF,QAAA,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAA6C,CAAC;;IAG3F,OAAO,CAAC,UAA4C,EAAE,YAA4B,EAAA;AAIjF,QAAA,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;;AAG3B,IAAA,MAAM,CAAC,QAAuC,EAAE,UAA2C,EAAE,YAA4B,EAAA;AAKxH,QAAA,OAAO,OAAO,CAAC,OAAO,CAAC,EAAO,CAAC;;AAEhC;;;;"}
|
|
@@ -34,10 +34,12 @@ class MetadataStorage {
|
|
|
34
34
|
if (!this.STORAGE.has(entityName)) {
|
|
35
35
|
this.STORAGE.set(entityName, new Map());
|
|
36
36
|
}
|
|
37
|
+
// eslint-disable-next-line @elsikora/typescript/no-non-null-assertion
|
|
37
38
|
const entityMetadata = this.STORAGE.get(entityName);
|
|
38
39
|
if (!entityMetadata.has(propertyName)) {
|
|
39
40
|
entityMetadata.set(propertyName, { [PROPERTY_DESCRIBE_DECORATOR_API_CONSTANT.METADATA_PROPERTY_NAME]: {} });
|
|
40
41
|
}
|
|
42
|
+
// eslint-disable-next-line @elsikora/typescript/no-non-null-assertion
|
|
41
43
|
const propertyMetadata = entityMetadata.get(propertyName);
|
|
42
44
|
propertyMetadata[key] = value;
|
|
43
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata-storage.class.js","sources":["../../../../../src/class/metadata-storage.class.ts"],"sourcesContent":[null],"names":[],"mappings":";;;MAMa,eAAe,CAAA;IACnB,OAAO,QAAQ;AAEN,IAAA,OAAO,GAA6C,IAAI,GAAG,EAAuC;AAE5G,IAAA,OAAO,WAAW,GAAA;AACxB,QAAA,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE;AAC9B,YAAA,eAAe,CAAC,QAAQ,GAAG,IAAI,eAAe,EAAE;;QAGjD,OAAO,eAAe,CAAC,QAAQ;;IAGzB,sBAAsB,GAAA;QAC5B,MAAM,MAAM,GAA8B,EAAE;AAE5C,QAAA,KAAK,MAAM,CAAC,UAAU,EAAE,cAAc,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE;YAClE,MAAM,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC;;AAGxD,QAAA,OAAO,MAAM;;AAMP,IAAA,WAAW,CAAC,UAAkB,EAAE,YAAqB,EAAE,GAA0B,EAAA;QACvF,MAAM,cAAc,GAA4C,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;AAE5F,QAAA,IAAI,CAAC,cAAc;AAAE,YAAA,OAAO,SAAS;AAErC,QAAA,IAAI,CAAC,YAAY;AAAE,YAAA,OAAO,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC;QAC5D,MAAM,gBAAgB,GAA+B,cAAc,CAAC,GAAG,CAAC,YAAY,CAAC;AAErF,QAAA,IAAI,CAAC,gBAAgB;AAAE,YAAA,OAAO,SAAS;AAEvC,QAAA,IAAI,CAAC,GAAG;AAAE,YAAA,OAAO,gBAAgB;AAEjC,QAAA,OAAO,gBAAgB,CAAC,GAAG,CAAC;;AAGtB,IAAA,WAAW,CAAiC,UAAkB,EAAE,YAAoB,EAAE,GAA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AAgB;AAEjC,QAAA,OAAO,gBAAgB,CAAC,GAAG,CAAC;;AAGtB,IAAA,WAAW,CAAiC,UAAkB,EAAE,YAAoB,EAAE,GAAM,EAAE,KAAwB,EAAA;QAC5H,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;YAClC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,GAAG,EAAE,CAAC;;;QAGxC,MAAM,cAAc,GAAgC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAE;QAEjF,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;AACtC,YAAA,cAAc,CAAC,GAAG,CAAC,YAAY,EAAE,EAAE,CAAC,wCAAwC,CAAC,sBAAsB,GAAG,EAAE,EAAE,CAAC;;;QAI5G,MAAM,gBAAgB,GAAmB,cAAc,CAAC,GAAG,CAAC,YAAY,CAAE;AAC1E,QAAA,gBAAgB,CAAC,GAAG,CAAC,GAAG,KAAK;;AAE9B;;;;"}
|
|
@@ -17,6 +17,7 @@ import '../../../../enum/utility/error-string-action.enum.js';
|
|
|
17
17
|
|
|
18
18
|
class DtoStrategyRequest {
|
|
19
19
|
getDecoratorConfig(method, _metadata) {
|
|
20
|
+
// eslint-disable-next-line @elsikora/sonar/no-all-duplicated-branches
|
|
20
21
|
switch (method) {
|
|
21
22
|
case EApiRouteType.CREATE: {
|
|
22
23
|
return { isRequired: true };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.class.js","sources":["../../../../../../../../src/class/utility/dto/strategy/request.class.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;MAKa,kBAAkB,CAAA;IAC9B,kBAAkB,CAAC,MAAqB,EAAE,SAAyC,EAAA
|
|
1
|
+
{"version":3,"file":"request.class.js","sources":["../../../../../../../../src/class/utility/dto/strategy/request.class.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;MAKa,kBAAkB,CAAA;IAC9B,kBAAkB,CAAC,MAAqB,EAAE,SAAyC,EAAA;;QAElF,QAAQ,MAAM;AACb,YAAA,KAAK,aAAa,CAAC,MAAM,EAAE;AAC1B,gBAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE;;AAG5B,YAAA,KAAK,aAAa,CAAC,MAAM,EAAE;AAC1B,gBAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE;;AAG5B,YAAA,KAAK,aAAa,CAAC,GAAG,EAAE;AACvB,gBAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE;;AAG5B,YAAA,KAAK,aAAa,CAAC,QAAQ,EAAE;AAC5B,gBAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE;;AAG5B,YAAA,KAAK,aAAa,CAAC,cAAc,EAAE;AAClC,gBAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE;;AAG5B,YAAA,KAAK,aAAa,CAAC,MAAM,EAAE;AAC1B,gBAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE;;YAG5B,SAAS;AACR,gBAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE;;;;AAI9B;;;;"}
|
|
@@ -12,6 +12,7 @@ const SORT_ARGUMENT_MORE = 1;
|
|
|
12
12
|
const MIN_INTEGER = -2147483648;
|
|
13
13
|
const MAX_INTEGER = 2_147_483_647;
|
|
14
14
|
const MIN_BIGINT = -9223372036854776e3;
|
|
15
|
+
// eslint-disable-next-line @elsikora/javascript/no-loss-of-precision
|
|
15
16
|
const MAX_BIGINT = 9_223_372_036_854_775_807;
|
|
16
17
|
const MILLISECONDS_IN_SECOND = 1000;
|
|
17
18
|
const NUMBER_CONSTANT = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number.constant.js","sources":["../../../../../src/constant/number.constant.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAW,CAAC;AAClC,MAAM,IAAI,GAAW,CAAC;AACtB,MAAM,GAAG,GAAW,CAAC;AACrB,MAAM,YAAY,GAAW,EAAE;AAC/B,MAAM,yBAAyB,GAAW,CAAC;AAC3C,MAAM,yBAAyB,GAAW,GAAG;AAC7C,MAAM,yBAAyB,GAAW,CAAC;AAC3C,MAAM,qBAAqB,GAAW,GAAG;AACzC,MAAM,oBAAoB,GAAW,CAAC;AACtC,MAAM,kBAAkB,GAAW,EAAE;AACrC,MAAM,kBAAkB,GAAW,CAAC;AACpC,MAAM,WAAW,GAAW,WAAc;AAC1C,MAAM,WAAW,GAAW,aAAa;AACzC,MAAM,UAAU,GAAW,mBAA0B;
|
|
1
|
+
{"version":3,"file":"number.constant.js","sources":["../../../../../src/constant/number.constant.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAW,CAAC;AAClC,MAAM,IAAI,GAAW,CAAC;AACtB,MAAM,GAAG,GAAW,CAAC;AACrB,MAAM,YAAY,GAAW,EAAE;AAC/B,MAAM,yBAAyB,GAAW,CAAC;AAC3C,MAAM,yBAAyB,GAAW,GAAG;AAC7C,MAAM,yBAAyB,GAAW,CAAC;AAC3C,MAAM,qBAAqB,GAAW,GAAG;AACzC,MAAM,oBAAoB,GAAW,CAAC;AACtC,MAAM,kBAAkB,GAAW,EAAE;AACrC,MAAM,kBAAkB,GAAW,CAAC;AACpC,MAAM,WAAW,GAAW,WAAc;AAC1C,MAAM,WAAW,GAAW,aAAa;AACzC,MAAM,UAAU,GAAW,mBAA0B;AACrD;AACA,MAAM,UAAU,GAAW,yBAAyB;AACpD,MAAM,sBAAsB,GAAW,IAAI;AAE9B,MAAA,eAAe,GAiBxB;IACH,yBAAyB;IACzB,UAAU;IACV,yBAAyB;IACzB,WAAW;IACX,sBAAsB;IACtB,UAAU;IACV,yBAAyB;IACzB,WAAW;IACX,YAAY;IACZ,GAAG;IACH,qBAAqB;IACrB,oBAAoB;IACpB,kBAAkB;IAClB,kBAAkB;IAClB,IAAI;IACJ,gBAAgB;;;;;"}
|
|
@@ -4,7 +4,9 @@ const ApiController = (options) => (target) => {
|
|
|
4
4
|
const factory = new ApiControllerFactory(target, options);
|
|
5
5
|
factory.init();
|
|
6
6
|
const ValidatedController = class extends target {
|
|
7
|
+
// eslint-disable-next-line @elsikora/typescript/no-useless-constructor
|
|
7
8
|
constructor(..._arguments) {
|
|
9
|
+
// eslint-disable-next-line @elsikora/typescript/no-unsafe-argument
|
|
8
10
|
super(..._arguments);
|
|
9
11
|
}
|
|
10
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controller.decorator.js","sources":["../../../../../../src/decorator/api/controller.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAKO,MAAM,aAAa,GACzB,CAA2B,OAAoC,KAC/D,CAAsC,MAAS,KAAO;IACrD,MAAM,OAAO,GAA4B,IAAI,oBAAoB,CAAI,MAAM,EAAE,OAAO,CAAC;IACrF,OAAO,CAAC,IAAI,EAAE;AAEd,IAAA,MAAM,mBAAmB,GAA2D,cAAc,MAAM,CAAA
|
|
1
|
+
{"version":3,"file":"controller.decorator.js","sources":["../../../../../../src/decorator/api/controller.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAKO,MAAM,aAAa,GACzB,CAA2B,OAAoC,KAC/D,CAAsC,MAAS,KAAO;IACrD,MAAM,OAAO,GAA4B,IAAI,oBAAoB,CAAI,MAAM,EAAE,OAAO,CAAC;IACrF,OAAO,CAAC,IAAI,EAAE;AAEd,IAAA,MAAM,mBAAmB,GAA2D,cAAc,MAAM,CAAA;;AAEvG,QAAA,WAAA,CAAY,GAAG,UAAe,EAAA;;AAE7B,YAAA,KAAK,CAAC,GAAG,UAAU,CAAC;;KAErB;AACD,IAAA,MAAM,CAAC,cAAc,CAAC,mBAAmB,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;AAE1E,IAAA,OAAO,mBAAwB;AAChC;;;;"}
|
|
@@ -19,22 +19,27 @@ import { ErrorException } from '../../../utility/error-exception.utility.js';
|
|
|
19
19
|
import { ErrorString } from '../../../utility/error-string.utility.js';
|
|
20
20
|
import { LoggerUtility } from '../../../utility/logger.utility.js';
|
|
21
21
|
|
|
22
|
+
// eslint-disable-next-line @elsikora/typescript/no-unnecessary-type-parameters
|
|
22
23
|
function ApiFunctionCreate(properties) {
|
|
23
24
|
const { entity } = properties;
|
|
24
25
|
return function (target, propertyKey, descriptor) {
|
|
25
|
-
descriptor.value = async function (properties) {
|
|
26
|
+
descriptor.value = async function (properties, eventManager) {
|
|
26
27
|
const repository = this.repository;
|
|
27
28
|
if (!repository) {
|
|
28
29
|
throw ErrorException("Repository is not available in this context");
|
|
29
30
|
}
|
|
30
|
-
return executor({ entity, properties, repository });
|
|
31
|
+
return executor({ entity, eventManager, properties, repository });
|
|
31
32
|
};
|
|
32
33
|
return descriptor;
|
|
33
34
|
};
|
|
34
35
|
}
|
|
35
36
|
async function executor(options) {
|
|
36
|
-
const { entity, properties, repository } = options;
|
|
37
|
+
const { entity, eventManager, properties, repository } = options;
|
|
37
38
|
try {
|
|
39
|
+
if (eventManager) {
|
|
40
|
+
const eventRepository = eventManager.getRepository(entity);
|
|
41
|
+
return await eventRepository.save(properties);
|
|
42
|
+
}
|
|
38
43
|
return await repository.save(properties);
|
|
39
44
|
}
|
|
40
45
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.decorator.js","sources":["../../../../../../../src/decorator/api/function/create.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"create.decorator.js","sources":["../../../../../../../src/decorator/api/function/create.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAaA;AACM,SAAU,iBAAiB,CAA2B,UAAkC,EAAA;AAC7F,IAAA,MAAM,EAAE,MAAM,EAAE,GAA2B,UAAU;AAErD,IAAA,OAAO,U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
|
|
23
23
|
import { ApiFunctionUpdate } from './update.decorator.js';
|
|
24
24
|
|
|
25
|
+
// eslint-disable-next-line @elsikora/typescript/no-unnecessary-type-parameters
|
|
25
26
|
function ApiFunction(properties) {
|
|
26
27
|
const { entity, type } = properties;
|
|
27
28
|
return function (_target, propertyKey, descriptor) {
|
|
28
29
|
const originalMethod = descriptor.value;
|
|
30
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
29
31
|
descriptor.value = function (...arguments_) {
|
|
30
32
|
let decoratorFunction;
|
|
31
33
|
switch (type) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorator.js","sources":["../../../../../../../src/decorator/api/function/decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"decorator.js","sources":["../../../../../../../src/decorator/api/function/decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAiBA;AACM,SAAU,WAAW,CAA8B,UAAqC,EAAA;AAC7F,IAAA,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAA8B,UAAU;AAE9D,IAAA,OAAO,UAAU,OAAgB,EAAE,WAAmB,EAAE,UAA8B,EAAA;AACrF,QAAA,MAAM,cAAc,GAAY,UAAU,CAAC,KAAK;;AAGhD,QAAA,UAAU,CAAC,KAAK,GAAG,UAA+C,GAAG,UAAsB,EAAA;AAC1F,YAAA,IAAI,iBAAqC;YAEzC,QAAQ,IAAI;AACX,gBAAA,KAAK,gBAAgB,CAAC,MAAM,EAAE;AAC7B,oBAAA,iBAAiB,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;oBAEjD;;AAGD,gBAAA,KAAK,gBAAgB,CAAC,MAAM,EAAE;AAC7B,oBAAA,iBAAiB,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;oBAEjD;;AAGD,gBAAA,KAAK,gBAAgB,CAAC,GAAG,EAAE;AAC1B,oBAAA,iBAAiB,GAAG,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;oBAE9C;;AAGD,gBAAA,KAAK,gBAAgB,CAAC,QAAQ,EAAE;AAC/B,oBAAA,iBAAiB,GAAG,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;oBAElD;;AAGD,gBAAA,KAAK,gBAAgB,CAAC,QAAQ,EAAE;AAC/B,oBAAA,iBAAiB,GAAG,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;oBAElD;;AAGD,gBAAA,KAAK,gBAAgB,CAAC,MAAM,EAAE;AAC7B,oBAAA,iBAAiB,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;oBAEjD;;gBAGD,SAAS;AACR,oBAAA,MAAM,cAAc,CAAC,sBAAsB,CAAC;;;AAI9C,YAAA,MAAM,kBAAkB,GAAuB,iBAAiB,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC;AAC9G,YAAA,MAAM,cAAc,GAAsC,kBAAkB,CAAC,KAA0C;YAEvH,OAAO,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC;AAC9C,SAAC;AAED,QAAA,OAAO,UAAU;AAClB,KAAC;AACF;;;;"}
|
|
@@ -20,12 +20,13 @@ import { ErrorString } from '../../../utility/error-string.utility.js';
|
|
|
20
20
|
import { LoggerUtility } from '../../../utility/logger.utility.js';
|
|
21
21
|
import { ApiFunctionGet } from './get.decorator.js';
|
|
22
22
|
|
|
23
|
+
// eslint-disable-next-line @elsikora/typescript/no-unnecessary-type-parameters
|
|
23
24
|
function ApiFunctionDelete(properties) {
|
|
24
25
|
const { entity } = properties;
|
|
25
26
|
const getDecorator = ApiFunctionGet({ entity });
|
|
26
27
|
let getFunction;
|
|
27
28
|
return function (target, propertyKey, descriptor) {
|
|
28
|
-
descriptor.value = async function (criteria) {
|
|
29
|
+
descriptor.value = async function (criteria, eventManager) {
|
|
29
30
|
const repository = this.repository;
|
|
30
31
|
if (!repository) {
|
|
31
32
|
throw ErrorException("Repository is not available in this context");
|
|
@@ -44,15 +45,19 @@ function ApiFunctionDelete(properties) {
|
|
|
44
45
|
throw ErrorException("Get function is not properly decorated");
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
|
-
return executor({ criteria, entity, getFunction, repository });
|
|
48
|
+
return executor({ criteria, entity, eventManager, getFunction, repository });
|
|
48
49
|
};
|
|
49
50
|
return descriptor;
|
|
50
51
|
};
|
|
51
52
|
}
|
|
52
53
|
async function executor(options) {
|
|
53
|
-
const { criteria, entity, getFunction, repository } = options;
|
|
54
|
+
const { criteria, entity, eventManager, getFunction, repository } = options;
|
|
54
55
|
try {
|
|
55
56
|
const existingEntity = await getFunction({ where: criteria });
|
|
57
|
+
if (eventManager) {
|
|
58
|
+
const eventRepository = eventManager.getRepository(entity);
|
|
59
|
+
return await eventRepository.remove(existingEntity);
|
|
60
|
+
}
|
|
56
61
|
return await repository.remove(existingEntity);
|
|
57
62
|
}
|
|
58
63
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.decorator.js","sources":["../../../../../../../src/decorator/api/function/delete.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"delete.decorator.js","sources":["../../../../../../../src/decorator/api/function/delete.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAcA;AACM,SAAU,iBAAiB,CAA2B,UAAkC,EAAA;AAC7F,IAAA,MAAM,EAAE,MAAM,EAAE,GAA2B,UAAU;IACrD,MAAM,YAAY,GAA6F,cAAc,CAAI,EAAE,MAAM,EAAE,CAAC;AAC5I,IAAA,IAAI,WAAmG;AAEvG,IAAA,OAAO,UAAU,MAAe,EAAE,WAAmB,EAAE,UAA8B,EAAA;AAMpF,QAAA,UAAU,CAAC,KAAK,GAAG,gBAIlB,QAAuC,EACvC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AAM,KAAK;;AAGZ,QAAA,aAAa,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC,OAAO,CAAC,CAAA,sBAAA,EAAyB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC;AAE5G,QAAA,MAAM,IAAI,4BAA4B,CACrC,WAAW,CAAC;AACX,YAAA,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,kBAAkB,CAAC,cAAc;AACvC,SAAA,CAAC,CACF;;AAEH;;;;"}
|
|
@@ -19,28 +19,40 @@ import { ErrorException } from '../../../utility/error-exception.utility.js';
|
|
|
19
19
|
import { ErrorString } from '../../../utility/error-string.utility.js';
|
|
20
20
|
import { LoggerUtility } from '../../../utility/logger.utility.js';
|
|
21
21
|
|
|
22
|
+
// eslint-disable-next-line @elsikora/typescript/no-unnecessary-type-parameters
|
|
22
23
|
function ApiFunctionGetList(properties) {
|
|
23
24
|
const { entity } = properties;
|
|
24
25
|
return function (_target, _propertyKey, descriptor) {
|
|
25
|
-
descriptor.value = async function (properties) {
|
|
26
|
+
descriptor.value = async function (properties, eventManager) {
|
|
26
27
|
const repository = this.repository;
|
|
27
28
|
if (!repository) {
|
|
28
29
|
throw ErrorException("Repository is not available in this context");
|
|
29
30
|
}
|
|
30
|
-
return executor({ entity, properties, repository });
|
|
31
|
+
return executor({ entity, eventManager, properties, repository });
|
|
31
32
|
};
|
|
32
33
|
return descriptor;
|
|
33
34
|
};
|
|
34
35
|
}
|
|
35
36
|
async function executor(options) {
|
|
36
|
-
const { entity, properties, repository } = options;
|
|
37
|
+
const { entity, eventManager, properties, repository } = options;
|
|
37
38
|
try {
|
|
38
|
-
|
|
39
|
+
let items;
|
|
40
|
+
let totalCount;
|
|
41
|
+
if (eventManager) {
|
|
42
|
+
const eventRepository = eventManager.getRepository(entity);
|
|
43
|
+
[items, totalCount] = await eventRepository.findAndCount(properties);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
[items, totalCount] = await repository.findAndCount(properties);
|
|
47
|
+
}
|
|
39
48
|
return {
|
|
40
49
|
count: items.length,
|
|
50
|
+
// @ts-ignore
|
|
51
|
+
// eslint-disable-next-line @elsikora/sonar/no-nested-conditional,@elsikora/unicorn/no-nested-ternary
|
|
41
52
|
currentPage: items.length === 0 ? 0 : properties.skip ? Math.ceil(properties.skip / properties?.take) + 1 : 1,
|
|
42
53
|
items,
|
|
43
54
|
totalCount,
|
|
55
|
+
// @ts-ignore
|
|
44
56
|
totalPages: Math.ceil(totalCount / properties.take),
|
|
45
57
|
};
|
|
46
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-list.decorator.js","sources":["../../../../../../../src/decorator/api/function/get-list.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"get-list.decorator.js","sources":["../../../../../../../src/decorator/api/function/get-list.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAaA;AACM,SAAU,kBAAkB,CAA2B,UAAkC,EAAA;AAC9F,IAAA,MAAM,EAAE,MAAM,EAAE,GAA2B,UAAU;AAErD,IAAA,OAAO,UAAU,OAAgB,EAAE,YAAoB,EAAE,UAA8B,EAAA;AACtF,QAAA,UAAU,CAAC,KAAK,GAAG,gBAIlB,UAA4C,EAC5C,YAA4B,EAAA;AAE5B,YAAA,MAAM,UAAU,GAAkB,IAAI,CAAC,UAAU;YAEjD,IAAI,CAAC,UAAU,EAAE;AAChB,gBAAA,MAAM,cAAc,CAAC,6CAA6C,CAAC;;AAGpE,YAAA,OAAO,QAAQ,CAAI,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;AACrE,SAAC;AAED,QAAA,OAAO,UAAU;AAClB,KAAC;AACF;AAEA,eAAe,QAAQ,CAA2B,OAAiD,EAAA;IAClG,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,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