@elsikora/nestjs-crud-automator 1.1.0
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/class/api/base-service.class.d.ts +8 -0
- package/dist/class/api/base-service.class.js +13 -0
- package/dist/class/api/base-service.class.js.map +1 -0
- package/dist/class/api/index.d.ts +1 -0
- package/dist/class/api/index.js +18 -0
- package/dist/class/api/index.js.map +1 -0
- package/dist/class/index.d.ts +1 -0
- package/dist/class/index.js +18 -0
- package/dist/class/index.js.map +1 -0
- package/dist/constant/date.constant.d.ts +4 -0
- package/dist/constant/date.constant.js +10 -0
- package/dist/constant/date.constant.js.map +1 -0
- package/dist/constant/decorator/api/function.constant.d.ts +4 -0
- package/dist/constant/decorator/api/function.constant.js +9 -0
- package/dist/constant/decorator/api/function.constant.js.map +1 -0
- package/dist/constant/decorator/api/index.d.ts +1 -0
- package/dist/constant/decorator/api/index.js +18 -0
- package/dist/constant/decorator/api/index.js.map +1 -0
- package/dist/constant/decorator/index.d.ts +1 -0
- package/dist/constant/decorator/index.js +18 -0
- package/dist/constant/decorator/index.js.map +1 -0
- package/dist/constant/dto/exception.constant.d.ts +6 -0
- package/dist/constant/dto/exception.constant.js +14 -0
- package/dist/constant/dto/exception.constant.js.map +1 -0
- package/dist/constant/dto/index.d.ts +1 -0
- package/dist/constant/dto/index.js +18 -0
- package/dist/constant/dto/index.js.map +1 -0
- package/dist/constant/index.d.ts +5 -0
- package/dist/constant/index.js +22 -0
- package/dist/constant/index.js.map +1 -0
- package/dist/constant/interface/api/filter.constant.d.ts +3 -0
- package/dist/constant/interface/api/filter.constant.js +12 -0
- package/dist/constant/interface/api/filter.constant.js.map +1 -0
- package/dist/constant/interface/api/index.d.ts +1 -0
- package/dist/constant/interface/api/index.js +18 -0
- package/dist/constant/interface/api/index.js.map +1 -0
- package/dist/constant/interface/api/property/index.d.ts +2 -0
- package/dist/constant/interface/api/property/index.js +19 -0
- package/dist/constant/interface/api/property/index.js.map +1 -0
- package/dist/constant/interface/api/property/string.constant.d.ts +6 -0
- package/dist/constant/interface/api/property/string.constant.js +12 -0
- package/dist/constant/interface/api/property/string.constant.js.map +1 -0
- package/dist/constant/interface/api/property/wallet.constant.d.ts +5 -0
- package/dist/constant/interface/api/property/wallet.constant.js +12 -0
- package/dist/constant/interface/api/property/wallet.constant.js.map +1 -0
- package/dist/constant/interface/index.d.ts +1 -0
- package/dist/constant/interface/index.js +18 -0
- package/dist/constant/interface/index.js.map +1 -0
- package/dist/constant/number.constant.d.ts +18 -0
- package/dist/constant/number.constant.js +38 -0
- package/dist/constant/number.constant.js.map +1 -0
- package/dist/decorator/api/function/decorator.d.ts +7 -0
- package/dist/decorator/api/function/decorator.js +27 -0
- package/dist/decorator/api/function/decorator.js.map +1 -0
- package/dist/decorator/api/function/get-list.decorator.d.ts +5 -0
- package/dist/decorator/api/function/get-list.decorator.js +129 -0
- package/dist/decorator/api/function/get-list.decorator.js.map +1 -0
- package/dist/decorator/api/function/get.decorator.d.ts +4 -0
- package/dist/decorator/api/function/get.decorator.js +58 -0
- package/dist/decorator/api/function/get.decorator.js.map +1 -0
- package/dist/decorator/api/function/index.d.ts +2 -0
- package/dist/decorator/api/function/index.js +19 -0
- package/dist/decorator/api/function/index.js.map +1 -0
- package/dist/decorator/api/index.d.ts +3 -0
- package/dist/decorator/api/index.js +20 -0
- package/dist/decorator/api/index.js.map +1 -0
- package/dist/decorator/api/method.decorator.d.ts +2 -0
- package/dist/decorator/api/method.decorator.js +203 -0
- package/dist/decorator/api/method.decorator.js.map +1 -0
- package/dist/decorator/api/property/boolean.decorator.d.ts +2 -0
- package/dist/decorator/api/property/boolean.decorator.js +77 -0
- package/dist/decorator/api/property/boolean.decorator.js.map +1 -0
- package/dist/decorator/api/property/date.decorator.d.ts +2 -0
- package/dist/decorator/api/property/date.decorator.js +87 -0
- package/dist/decorator/api/property/date.decorator.js.map +1 -0
- package/dist/decorator/api/property/index.d.ts +7 -0
- package/dist/decorator/api/property/index.js +24 -0
- package/dist/decorator/api/property/index.js.map +1 -0
- package/dist/decorator/api/property/number.decorator.d.ts +2 -0
- package/dist/decorator/api/property/number.decorator.js +146 -0
- package/dist/decorator/api/property/number.decorator.js.map +1 -0
- package/dist/decorator/api/property/object.decorator.d.ts +2 -0
- package/dist/decorator/api/property/object.decorator.js +124 -0
- package/dist/decorator/api/property/object.decorator.js.map +1 -0
- package/dist/decorator/api/property/string.decorator.d.ts +2 -0
- package/dist/decorator/api/property/string.decorator.js +282 -0
- package/dist/decorator/api/property/string.decorator.js.map +1 -0
- package/dist/decorator/api/property/uuid.decorator.d.ts +2 -0
- package/dist/decorator/api/property/uuid.decorator.js +63 -0
- package/dist/decorator/api/property/uuid.decorator.js.map +1 -0
- package/dist/decorator/api/property/wallet.decorator.d.ts +2 -0
- package/dist/decorator/api/property/wallet.decorator.js +25 -0
- package/dist/decorator/api/property/wallet.decorator.js.map +1 -0
- package/dist/decorator/api/service.decorator.d.ts +8 -0
- package/dist/decorator/api/service.decorator.js +71 -0
- package/dist/decorator/api/service.decorator.js.map +1 -0
- package/dist/decorator/index.d.ts +1 -0
- package/dist/decorator/index.js +18 -0
- package/dist/decorator/index.js.map +1 -0
- package/dist/dto/exception/bad-request.dto.d.ts +8 -0
- package/dist/dto/exception/bad-request.dto.js +84 -0
- package/dist/dto/exception/bad-request.dto.js.map +1 -0
- package/dist/dto/exception/conflict.dto.d.ts +8 -0
- package/dist/dto/exception/conflict.dto.js +84 -0
- package/dist/dto/exception/conflict.dto.js.map +1 -0
- package/dist/dto/exception/forbidden.dto.d.ts +8 -0
- package/dist/dto/exception/forbidden.dto.js +84 -0
- package/dist/dto/exception/forbidden.dto.js.map +1 -0
- package/dist/dto/exception/index.d.ts +7 -0
- package/dist/dto/exception/index.js +24 -0
- package/dist/dto/exception/index.js.map +1 -0
- package/dist/dto/exception/internal-server-error.dto.d.ts +8 -0
- package/dist/dto/exception/internal-server-error.dto.js +84 -0
- package/dist/dto/exception/internal-server-error.dto.js.map +1 -0
- package/dist/dto/exception/not-found.dto.d.ts +8 -0
- package/dist/dto/exception/not-found.dto.js +84 -0
- package/dist/dto/exception/not-found.dto.js.map +1 -0
- package/dist/dto/exception/too-many-requests.dto.d.ts +8 -0
- package/dist/dto/exception/too-many-requests.dto.js +84 -0
- package/dist/dto/exception/too-many-requests.dto.js.map +1 -0
- package/dist/dto/exception/unauthorized.dto.d.ts +8 -0
- package/dist/dto/exception/unauthorized.dto.js +84 -0
- package/dist/dto/exception/unauthorized.dto.js.map +1 -0
- package/dist/dto/index.d.ts +1 -0
- package/dist/dto/index.js +18 -0
- package/dist/dto/index.js.map +1 -0
- package/dist/enum/decorator/api/action.enum.d.ts +14 -0
- package/dist/enum/decorator/api/action.enum.js +19 -0
- package/dist/enum/decorator/api/action.enum.js.map +1 -0
- package/dist/enum/decorator/api/authentication-type.enum.d.ts +5 -0
- package/dist/enum/decorator/api/authentication-type.enum.js +10 -0
- package/dist/enum/decorator/api/authentication-type.enum.js.map +1 -0
- package/dist/enum/decorator/api/function/index.d.ts +1 -0
- package/dist/enum/decorator/api/function/index.js +18 -0
- package/dist/enum/decorator/api/function/index.js.map +1 -0
- package/dist/enum/decorator/api/function/type.enum.d.ts +10 -0
- package/dist/enum/decorator/api/function/type.enum.js +15 -0
- package/dist/enum/decorator/api/function/type.enum.js.map +1 -0
- package/dist/enum/decorator/api/index.d.ts +4 -0
- package/dist/enum/decorator/api/index.js +21 -0
- package/dist/enum/decorator/api/index.js.map +1 -0
- package/dist/enum/decorator/api/property/data-type.enum.d.ts +23 -0
- package/dist/enum/decorator/api/property/data-type.enum.js +42 -0
- package/dist/enum/decorator/api/property/data-type.enum.js.map +1 -0
- package/dist/enum/decorator/api/property/date-type.enum.d.ts +14 -0
- package/dist/enum/decorator/api/property/date-type.enum.js +19 -0
- package/dist/enum/decorator/api/property/date-type.enum.js.map +1 -0
- package/dist/enum/decorator/api/property/index.d.ts +2 -0
- package/dist/enum/decorator/api/property/index.js +19 -0
- package/dist/enum/decorator/api/property/index.js.map +1 -0
- package/dist/enum/decorator/index.d.ts +1 -0
- package/dist/enum/decorator/index.js +18 -0
- package/dist/enum/decorator/index.js.map +1 -0
- package/dist/enum/filter-order-direction.enum.d.ts +4 -0
- package/dist/enum/filter-order-direction.enum.js +9 -0
- package/dist/enum/filter-order-direction.enum.js.map +1 -0
- package/dist/enum/index.d.ts +3 -0
- package/dist/enum/index.js +20 -0
- package/dist/enum/index.js.map +1 -0
- package/dist/enum/utility/error-string-action.enum.d.ts +55 -0
- package/dist/enum/utility/error-string-action.enum.js +60 -0
- package/dist/enum/utility/error-string-action.enum.js.map +1 -0
- package/dist/enum/utility/index.d.ts +1 -0
- package/dist/enum/utility/index.js +18 -0
- package/dist/enum/utility/index.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/interceptor/correlation-id-response-body.interceptor.d.ts +5 -0
- package/dist/interceptor/correlation-id-response-body.interceptor.js +90 -0
- package/dist/interceptor/correlation-id-response-body.interceptor.js.map +1 -0
- package/dist/interceptor/index.d.ts +1 -0
- package/dist/interceptor/index.js +18 -0
- package/dist/interceptor/index.js.map +1 -0
- package/dist/interface/api-base-entity.interface.d.ts +3 -0
- package/dist/interface/api-base-entity.interface.js +3 -0
- package/dist/interface/api-base-entity.interface.js.map +1 -0
- package/dist/interface/decorator/api/function/index.d.ts +1 -0
- package/dist/interface/decorator/api/function/index.js +3 -0
- package/dist/interface/decorator/api/function/index.js.map +1 -0
- package/dist/interface/decorator/api/get-list-response-result.interface.d.ts +7 -0
- package/dist/interface/decorator/api/get-list-response-result.interface.js +3 -0
- package/dist/interface/decorator/api/get-list-response-result.interface.js.map +1 -0
- package/dist/interface/decorator/api/index.d.ts +5 -0
- package/dist/interface/decorator/api/index.js +22 -0
- package/dist/interface/decorator/api/index.js.map +1 -0
- package/dist/interface/decorator/api/method/index.d.ts +2 -0
- package/dist/interface/decorator/api/method/index.js +19 -0
- package/dist/interface/decorator/api/method/index.js.map +1 -0
- package/dist/interface/decorator/api/method/properties.interface.d.ts +16 -0
- package/dist/interface/decorator/api/method/properties.interface.js +3 -0
- package/dist/interface/decorator/api/method/properties.interface.js.map +1 -0
- package/dist/interface/decorator/api/method/throttler-properties.interface.d.ts +4 -0
- package/dist/interface/decorator/api/method/throttler-properties.interface.js +3 -0
- package/dist/interface/decorator/api/method/throttler-properties.interface.js.map +1 -0
- package/dist/interface/decorator/api/property/base-properties.interface.d.ts +13 -0
- package/dist/interface/decorator/api/property/base-properties.interface.js +3 -0
- package/dist/interface/decorator/api/property/base-properties.interface.js.map +1 -0
- package/dist/interface/decorator/api/property/date-properties.interface.d.ts +5 -0
- package/dist/interface/decorator/api/property/date-properties.interface.js +3 -0
- package/dist/interface/decorator/api/property/date-properties.interface.js.map +1 -0
- package/dist/interface/decorator/api/property/index.d.ts +6 -0
- package/dist/interface/decorator/api/property/index.js +23 -0
- package/dist/interface/decorator/api/property/index.js.map +1 -0
- package/dist/interface/decorator/api/property/number-properties.interface.d.ts +9 -0
- package/dist/interface/decorator/api/property/number-properties.interface.js +3 -0
- package/dist/interface/decorator/api/property/number-properties.interface.js.map +1 -0
- package/dist/interface/decorator/api/property/object-properties.interface.d.ts +10 -0
- package/dist/interface/decorator/api/property/object-properties.interface.js +3 -0
- package/dist/interface/decorator/api/property/object-properties.interface.js.map +1 -0
- package/dist/interface/decorator/api/property/string-properties.interface.d.ts +10 -0
- package/dist/interface/decorator/api/property/string-properties.interface.js +3 -0
- package/dist/interface/decorator/api/property/string-properties.interface.js.map +1 -0
- package/dist/interface/decorator/api/property/uuid-properties.interface.d.ts +8 -0
- package/dist/interface/decorator/api/property/uuid-properties.interface.js +3 -0
- package/dist/interface/decorator/api/property/uuid-properties.interface.js.map +1 -0
- package/dist/interface/decorator/api/response-type.interface.d.ts +9 -0
- package/dist/interface/decorator/api/response-type.interface.js +3 -0
- package/dist/interface/decorator/api/response-type.interface.js.map +1 -0
- package/dist/interface/decorator/index.d.ts +1 -0
- package/dist/interface/decorator/index.js +18 -0
- package/dist/interface/decorator/index.js.map +1 -0
- package/dist/interface/index.d.ts +4 -0
- package/dist/interface/index.js +21 -0
- package/dist/interface/index.js.map +1 -0
- package/dist/interface/service.interface.d.ts +1 -0
- package/dist/interface/service.interface.js +3 -0
- package/dist/interface/service.interface.js.map +1 -0
- package/dist/interface/utility/error-string-properties.interface.d.ts +5 -0
- package/dist/interface/utility/error-string-properties.interface.js +3 -0
- package/dist/interface/utility/error-string-properties.interface.js.map +1 -0
- package/dist/interface/utility/index.d.ts +1 -0
- package/dist/interface/utility/index.js +18 -0
- package/dist/interface/utility/index.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/type/api/filter/allowed-types.type.d.ts +1 -0
- package/dist/type/api/filter/allowed-types.type.js +3 -0
- package/dist/type/api/filter/allowed-types.type.js.map +1 -0
- package/dist/type/api/filter/extracted-allowed-types.type.d.ts +2 -0
- package/dist/type/api/filter/extracted-allowed-types.type.js +3 -0
- package/dist/type/api/filter/extracted-allowed-types.type.js.map +1 -0
- package/dist/type/api/filter/field-selector.type.d.ts +3 -0
- package/dist/type/api/filter/field-selector.type.js +3 -0
- package/dist/type/api/filter/field-selector.type.js.map +1 -0
- package/dist/type/api/filter/index.d.ts +4 -0
- package/dist/type/api/filter/index.js +21 -0
- package/dist/type/api/filter/index.js.map +1 -0
- package/dist/type/api/filter/order-by.type.d.ts +5 -0
- package/dist/type/api/filter/order-by.type.js +3 -0
- package/dist/type/api/filter/order-by.type.js.map +1 -0
- package/dist/type/api/function/get-list-properties.type.d.ts +23 -0
- package/dist/type/api/function/get-list-properties.type.js +3 -0
- package/dist/type/api/function/get-list-properties.type.js.map +1 -0
- package/dist/type/api/function/get-properties.type.d.ts +6 -0
- package/dist/type/api/function/get-properties.type.js +3 -0
- package/dist/type/api/function/get-properties.type.js.map +1 -0
- package/dist/type/api/function/index.d.ts +1 -0
- package/dist/type/api/function/index.js +18 -0
- package/dist/type/api/function/index.js.map +1 -0
- package/dist/type/api/index.d.ts +2 -0
- package/dist/type/api/index.js +19 -0
- package/dist/type/api/index.js.map +1 -0
- package/dist/type/index.d.ts +1 -0
- package/dist/type/index.js +18 -0
- package/dist/type/index.js.map +1 -0
- package/dist/utility/api/filter-order-by-from-entity.utility.d.ts +4 -0
- package/dist/utility/api/filter-order-by-from-entity.utility.js +34 -0
- package/dist/utility/api/filter-order-by-from-entity.utility.js.map +1 -0
- package/dist/utility/api/index.d.ts +1 -0
- package/dist/utility/api/index.js +18 -0
- package/dist/utility/api/index.js.map +1 -0
- package/dist/utility/create-rest-application.utility.d.ts +3 -0
- package/dist/utility/create-rest-application.utility.js +9 -0
- package/dist/utility/create-rest-application.utility.js.map +1 -0
- package/dist/utility/error-string.utility.d.ts +2 -0
- package/dist/utility/error-string.utility.js +7 -0
- package/dist/utility/error-string.utility.js.map +1 -0
- package/dist/utility/index.d.ts +3 -0
- package/dist/utility/index.js +20 -0
- package/dist/utility/index.js.map +1 -0
- package/dist/validator/index.d.ts +1 -0
- package/dist/validator/index.js +18 -0
- package/dist/validator/index.js.map +1 -0
- package/dist/validator/is-regular-expression.validator.d.ts +4 -0
- package/dist/validator/is-regular-expression.validator.js +31 -0
- package/dist/validator/is-regular-expression.validator.js.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TApiFilterAllowedTypes = string | number | Date;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"allowed-types.type.js","sourceRoot":"/","sources":["type/api/filter/allowed-types.type.ts"],"names":[],"mappings":"","sourcesContent":["export type TApiFilterAllowedTypes = string | number | Date;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extracted-allowed-types.type.js","sourceRoot":"/","sources":["type/api/filter/extracted-allowed-types.type.ts"],"names":[],"mappings":"","sourcesContent":["import { TApiFilterAllowedTypes } from \"./allowed-types.type\";\n\nexport type TApiFilterExctractedAllowedTypes<T> = T extends TApiFilterAllowedTypes ? T : never;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-selector.type.js","sourceRoot":"/","sources":["type/api/filter/field-selector.type.ts"],"names":[],"mappings":"","sourcesContent":["export type TFilterFieldSelector<E> = {\n [K in keyof E]?: boolean;\n};\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
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("./order-by.type"), exports);
|
|
18
|
+
__exportStar(require("./extracted-allowed-types.type"), exports);
|
|
19
|
+
__exportStar(require("./allowed-types.type"), exports);
|
|
20
|
+
__exportStar(require("./field-selector.type"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["type/api/filter/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,iEAA+C;AAC/C,uDAAqC;AACrC,wDAAsC","sourcesContent":["export * from \"./order-by.type\";\nexport * from \"./extracted-allowed-types.type\";\nexport * from \"./allowed-types.type\";\nexport * from \"./field-selector.type\";\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { BaseEntity } from "typeorm";
|
|
2
|
+
import { TApiFilterExctractedAllowedTypes } from "./extracted-allowed-types.type";
|
|
3
|
+
export type IApiFilterOrderBy<E extends BaseEntity> = {
|
|
4
|
+
[K in Uppercase<string & keyof E> as TApiFilterExctractedAllowedTypes<E[Lowercase<K> & keyof E]> extends never ? never : K]: E[Lowercase<K> & keyof E];
|
|
5
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"order-by.type.js","sourceRoot":"/","sources":["type/api/filter/order-by.type.ts"],"names":[],"mappings":"","sourcesContent":["import {BaseEntity} from \"typeorm\";\nimport {TApiFilterExctractedAllowedTypes} from \"./extracted-allowed-types.type\";\n\nexport type IApiFilterOrderBy<E extends BaseEntity> = {\n [K in Uppercase<string & keyof E> as TApiFilterExctractedAllowedTypes<E[Lowercase<K> & keyof E]> extends never ? never : K]: E[Lowercase<K> & keyof E];\n};\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { BaseEntity, FindManyOptions } from "typeorm";
|
|
2
|
+
import { EFilterOrderDirection } from "../../../enum";
|
|
3
|
+
import { IApiFilterOrderBy } from "../filter";
|
|
4
|
+
type BaseProperties<E extends BaseEntity> = {
|
|
5
|
+
orderDirection?: EFilterOrderDirection;
|
|
6
|
+
orderBy?: IApiFilterOrderBy<E>;
|
|
7
|
+
limit: number;
|
|
8
|
+
page: number;
|
|
9
|
+
createdAtFrom?: Date;
|
|
10
|
+
createdAtTo?: Date;
|
|
11
|
+
updatedAtFrom?: Date;
|
|
12
|
+
updatedAtTo?: Date;
|
|
13
|
+
receivedAtFrom?: Date;
|
|
14
|
+
receivedAtTo?: Date;
|
|
15
|
+
filter?: FindManyOptions<E>;
|
|
16
|
+
};
|
|
17
|
+
export type TApiFunctionGetListProperties<E extends BaseEntity> = BaseProperties<E> & {
|
|
18
|
+
orderBy?: IApiFilterOrderBy<E>;
|
|
19
|
+
filter?: FindManyOptions<E>;
|
|
20
|
+
} & {
|
|
21
|
+
[K in Exclude<keyof Omit<E, "createdAt" | "updatedAt" | "receivedAt">, keyof BaseProperties<E>>]?: E[K];
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-list-properties.type.js","sourceRoot":"/","sources":["type/api/function/get-list-properties.type.ts"],"names":[],"mappings":"","sourcesContent":["import type {BaseEntity, FindManyOptions} from \"typeorm\"\nimport {EFilterOrderDirection} from \"../../../enum\";\nimport {IApiFilterOrderBy} from \"../filter\";\n\ntype BaseProperties<E extends BaseEntity> = {\n\torderDirection?: EFilterOrderDirection;\n\torderBy?: IApiFilterOrderBy<E>;\n\tlimit: number;\n\tpage: number;\n\tcreatedAtFrom?: Date;\n\tcreatedAtTo?: Date;\n\tupdatedAtFrom?: Date;\n\tupdatedAtTo?: Date;\n\treceivedAtFrom?: Date;\n\treceivedAtTo?: Date;\n\tfilter?: FindManyOptions<E>;\n};\n\nexport type TApiFunctionGetListProperties<E extends BaseEntity> = BaseProperties<E> & {\n\torderBy?: IApiFilterOrderBy<E>;\n\tfilter?: FindManyOptions<E>;\n} & {\n\t[K in Exclude<keyof Omit<E, \"createdAt\" | \"updatedAt\" | \"receivedAt\">, keyof BaseProperties<E>>]?: E[K];\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-properties.type.js","sourceRoot":"/","sources":["type/api/function/get-properties.type.ts"],"names":[],"mappings":"","sourcesContent":["import type {BaseEntity, FindManyOptions} from \"typeorm\"\n\nexport type TApiFunctionGetProperties<E extends BaseEntity> = {\n filter?: FindManyOptions<E>;\n} & {\n [K in keyof E]?: E[K];\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./get-list-properties.type";
|
|
@@ -0,0 +1,18 @@
|
|
|
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("./get-list-properties.type"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["type/api/function/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C","sourcesContent":["export * from \"./get-list-properties.type\";\n"]}
|
|
@@ -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("./filter"), exports);
|
|
18
|
+
__exportStar(require("./function"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["type/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,6CAA2B","sourcesContent":["export * from \"./filter\";\nexport * from \"./function\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./api";
|
|
@@ -0,0 +1,18 @@
|
|
|
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("./api"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["type/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB","sourcesContent":["export * from \"./api\";\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import "reflect-metadata";
|
|
2
|
+
import { BaseEntity } from "typeorm";
|
|
3
|
+
import { IApiFilterOrderBy, TFilterFieldSelector } from "../../type";
|
|
4
|
+
export declare function FilterOrderByFromEntity<E extends BaseEntity>(entityClass: new () => E, fieldSelector?: TFilterFieldSelector<E>): IApiFilterOrderBy<E>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FilterOrderByFromEntity = FilterOrderByFromEntity;
|
|
4
|
+
require("reflect-metadata");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const filter_constant_1 = require("../../constant/interface/api/filter.constant");
|
|
7
|
+
function FilterOrderByFromEntity(entityClass, fieldSelector) {
|
|
8
|
+
const metadata = (0, typeorm_1.getMetadataArgsStorage)();
|
|
9
|
+
const columns = metadata.columns.filter(col => col.target === entityClass);
|
|
10
|
+
if (fieldSelector) {
|
|
11
|
+
const entityFields = new Set(columns.map(col => col.propertyName));
|
|
12
|
+
for (const field in fieldSelector) {
|
|
13
|
+
if (!entityFields.has(field)) {
|
|
14
|
+
throw new Error(`Field "${field}" does not exist in the entity.`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return columns.reduce((acc, column) => {
|
|
19
|
+
const columnType = column.options?.type || Reflect.getMetadata("design:type", entityClass.prototype, column.propertyName);
|
|
20
|
+
console.log("TYPE", column.propertyName, columnType);
|
|
21
|
+
if ((typeof columnType === 'function' && (columnType === String || columnType === Number || columnType === Date)) || filter_constant_1.API_FILTER_INTERFACE_CONSTANT.ALLOWED_ENTITY_TO_FILTER_COLUMNS.includes(columnType) &&
|
|
22
|
+
(fieldSelector === undefined || fieldSelector[column.propertyName] !== false)) {
|
|
23
|
+
const snakeUpperCase = column.propertyName.split('').map((char, index) => {
|
|
24
|
+
if (index > 0 && char === char.toUpperCase() && char !== char.toLowerCase()) {
|
|
25
|
+
return '_' + char;
|
|
26
|
+
}
|
|
27
|
+
return char;
|
|
28
|
+
}).join('').toUpperCase();
|
|
29
|
+
acc[snakeUpperCase] = column.propertyName;
|
|
30
|
+
}
|
|
31
|
+
return acc;
|
|
32
|
+
}, {});
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=filter-order-by-from-entity.utility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter-order-by-from-entity.utility.js","sourceRoot":"/","sources":["utility/api/filter-order-by-from-entity.utility.ts"],"names":[],"mappings":";;AAOA,0DAgCC;AAvCD,4BAA0B;AAC1B,qCAA6D;AAI7D,kFAA2F;AAE3F,SAAgB,uBAAuB,CACnC,WAAwB,EACxB,aAAuC;IAEvC,MAAM,QAAQ,GAAwB,IAAA,gCAAsB,GAAE,CAAC;IAC/D,MAAM,OAAO,GAAyB,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,KAAK,WAAW,CAAC,CAAC;IAEjG,IAAI,aAAa,EAAE,CAAC;QAChB,MAAM,YAAY,GAAgB,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC;QAChF,KAAK,MAAM,KAAK,IAAI,aAAa,EAAE,CAAC;YAChC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC3B,MAAM,IAAI,KAAK,CAAC,UAAU,KAAK,iCAAiC,CAAC,CAAC;YACtE,CAAC;QACL,CAAC;IACL,CAAC;IAED,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,GAAyB,EAAE,MAA0B,EAAE,EAAE;QAC5E,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,EAAE,IAAI,IAAI,OAAO,CAAC,WAAW,CAAC,aAAa,EAAE,WAAW,CAAC,SAAS,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;QAC1H,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;QACrD,IAAI,CAAC,OAAO,UAAU,KAAK,UAAU,IAAI,CAAC,UAAU,KAAK,MAAM,IAAI,UAAU,KAAK,MAAM,IAAI,UAAU,KAAK,IAAI,CAAC,CAAC,IAAI,+CAA6B,CAAC,gCAAgC,CAAC,QAAQ,CAAC,UAAoB,CAAC;YAC9M,CAAC,aAAa,KAAK,SAAS,IAAI,aAAa,CAAC,MAAM,CAAC,YAAuB,CAAC,KAAK,KAAK,CAAC,EAAE,CAAC;YAC3F,MAAM,cAAc,GAAW,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;gBAC7E,IAAI,KAAK,GAAG,CAAC,IAAI,IAAI,KAAK,IAAI,CAAC,WAAW,EAAE,IAAI,IAAI,KAAK,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;oBAC1E,OAAO,GAAG,GAAG,IAAI,CAAC;gBACtB,CAAC;gBACD,OAAO,IAAI,CAAC;YAChB,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;YAE1B,GAAG,CAAC,cAA4C,CAAC,GAAG,MAAM,CAAC,YAAmB,CAAC;QACnF,CAAC;QACD,OAAO,GAAG,CAAC;IACf,CAAC,EAAE,EAA0B,CAAC,CAAC;AACnC,CAAC","sourcesContent":["import \"reflect-metadata\";\nimport { BaseEntity, getMetadataArgsStorage } from \"typeorm\";\nimport {ColumnMetadataArgs} from \"typeorm/metadata-args/ColumnMetadataArgs\";\nimport {MetadataArgsStorage} from \"typeorm/metadata-args/MetadataArgsStorage\";\nimport {IApiFilterOrderBy, TFilterFieldSelector} from \"../../type\";\nimport {API_FILTER_INTERFACE_CONSTANT} from \"../../constant/interface/api/filter.constant\";\n\nexport function FilterOrderByFromEntity<E extends BaseEntity>(\n entityClass: new () => E,\n fieldSelector?: TFilterFieldSelector<E>\n): IApiFilterOrderBy<E> {\n const metadata: MetadataArgsStorage = getMetadataArgsStorage();\n const columns: ColumnMetadataArgs[] = metadata.columns.filter(col => col.target === entityClass);\n\n if (fieldSelector) {\n const entityFields: Set<string> = new Set(columns.map(col => col.propertyName));\n for (const field in fieldSelector) {\n if (!entityFields.has(field)) {\n throw new Error(`Field \"${field}\" does not exist in the entity.`);\n }\n }\n }\n\n return columns.reduce((acc: IApiFilterOrderBy<E>, column: ColumnMetadataArgs) => {\n const columnType = column.options?.type || Reflect.getMetadata(\"design:type\", entityClass.prototype, column.propertyName);\n console.log(\"TYPE\", column.propertyName, columnType);\n if ((typeof columnType === 'function' && (columnType === String || columnType === Number || columnType === Date)) || API_FILTER_INTERFACE_CONSTANT.ALLOWED_ENTITY_TO_FILTER_COLUMNS.includes(columnType as string) &&\n (fieldSelector === undefined || fieldSelector[column.propertyName as keyof E] !== false)) {\n const snakeUpperCase: string = column.propertyName.split('').map((char, index) => {\n if (index > 0 && char === char.toUpperCase() && char !== char.toLowerCase()) {\n return '_' + char;\n }\n return char;\n }).join('').toUpperCase();\n\n acc[snakeUpperCase as keyof IApiFilterOrderBy<E>] = column.propertyName as any;\n }\n return acc;\n }, {} as IApiFilterOrderBy<E>);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./filter-order-by-from-entity.utility";
|
|
@@ -0,0 +1,18 @@
|
|
|
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("./filter-order-by-from-entity.utility"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["utility/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wEAAsD","sourcesContent":["export * from \"./filter-order-by-from-entity.utility\";\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateRestApplication = CreateRestApplication;
|
|
4
|
+
const core_1 = require("@nestjs/core");
|
|
5
|
+
const platform_fastify_1 = require("@nestjs/platform-fastify");
|
|
6
|
+
function CreateRestApplication(appModule) {
|
|
7
|
+
return core_1.NestFactory.create(appModule, new platform_fastify_1.FastifyAdapter({}));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=create-rest-application.utility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-rest-application.utility.js","sourceRoot":"/","sources":["utility/create-rest-application.utility.ts"],"names":[],"mappings":";;AAKA,sDAKC;AARD,uCAA2C;AAC3C,+DAA0D;AAE1D,SAAgB,qBAAqB,CAAC,SAAc;IAChD,OAAO,kBAAW,CAAC,MAAM,CACrB,SAAS,EACT,IAAI,iCAAc,CAAC,EAAE,CAAC,CACzB,CAAC;AACN,CAAC","sourcesContent":["import type { NestFastifyApplication } from \"@nestjs/platform-fastify\";\nimport type { RawServerDefault } from \"fastify\";\nimport { NestFactory } from \"@nestjs/core\";\nimport { FastifyAdapter } from \"@nestjs/platform-fastify\";\n\nexport function CreateRestApplication(appModule: any): Promise<NestFastifyApplication<RawServerDefault>> {\n return NestFactory.create<NestFastifyApplication>(\n appModule,\n new FastifyAdapter({})\n );\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ErrorString = ErrorString;
|
|
4
|
+
function ErrorString(options) {
|
|
5
|
+
return options.type.replace("{entity}", options.entity.name.toUpperCase());
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=error-string.utility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-string.utility.js","sourceRoot":"/","sources":["utility/error-string.utility.ts"],"names":[],"mappings":";;AAEA,kCAEC;AAFD,SAAgB,WAAW,CAA2B,OAAkC;IACvF,OAAO,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;AAC5E,CAAC","sourcesContent":["import type { IApiBaseEntity, IErrorStringProperties } from \"../interface\";\n\nexport function ErrorString<T extends IApiBaseEntity>(options: IErrorStringProperties<T>): string {\n\treturn options.type.replace(\"{entity}\", options.entity.name.toUpperCase());\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
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("./error-string.utility"), exports);
|
|
18
|
+
__exportStar(require("./api"), exports);
|
|
19
|
+
__exportStar(require("./create-rest-application.utility"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["utility/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,wCAAsB;AACtB,oEAAkD","sourcesContent":["export * from \"./error-string.utility\";\nexport * from \"./api\";\nexport * from \"./create-rest-application.utility\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./is-regular-expression.validator";
|
|
@@ -0,0 +1,18 @@
|
|
|
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("./is-regular-expression.validator"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["validator/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oEAAkD","sourcesContent":["export * from \"./is-regular-expression.validator\";\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.IsRegularExpression = void 0;
|
|
10
|
+
const class_validator_1 = require("class-validator");
|
|
11
|
+
let IsRegularExpression = class IsRegularExpression {
|
|
12
|
+
validate(pattern) {
|
|
13
|
+
if (pattern) {
|
|
14
|
+
try {
|
|
15
|
+
new RegExp(pattern);
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports.IsRegularExpression = IsRegularExpression;
|
|
28
|
+
exports.IsRegularExpression = IsRegularExpression = __decorate([
|
|
29
|
+
(0, class_validator_1.ValidatorConstraint)()
|
|
30
|
+
], IsRegularExpression);
|
|
31
|
+
//# sourceMappingURL=is-regular-expression.validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-regular-expression.validator.js","sourceRoot":"/","sources":["validator/is-regular-expression.validator.ts"],"names":[],"mappings":";;;;;;;;;AAAA,qDAAsD;AAK/C,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC/B,QAAQ,CAAC,OAAe;QACvB,IAAI,OAAO,EAAE,CAAC;YACb,IAAI,CAAC;gBACJ,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;gBAEpB,OAAO,IAAI,CAAC;YACb,CAAC;YAAC,MAAM,CAAC;gBACR,OAAO,KAAK,CAAC;YACd,CAAC;QACF,CAAC;aAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;CACD,CAAA;AAdY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,qCAAmB,GAAE;GACT,mBAAmB,CAc/B","sourcesContent":["import { ValidatorConstraint } from \"class-validator\";\n\nimport type { ValidatorConstraintInterface } from \"class-validator\";\n\n@ValidatorConstraint()\nexport class IsRegularExpression implements ValidatorConstraintInterface {\n\tvalidate(pattern: string): boolean {\n\t\tif (pattern) {\n\t\t\ttry {\n\t\t\t\tnew RegExp(pattern);\n\n\t\t\t\treturn true;\n\t\t\t} catch {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n}\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@elsikora/nestjs-crud-automator",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"import": {
|
|
8
|
+
"types": "./dist/mjs/index.d.ts",
|
|
9
|
+
"default": "./dist/mjs/index.js"
|
|
10
|
+
},
|
|
11
|
+
"require": {
|
|
12
|
+
"types": "./dist/cjs/index.d.ts",
|
|
13
|
+
"default": "./dist/cjs/index.js"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "https://github.com/ElsiKora/NestJS-Crud-Automator"
|
|
26
|
+
},
|
|
27
|
+
"keywords": [
|
|
28
|
+
"NestJS",
|
|
29
|
+
"CRUD",
|
|
30
|
+
"TypeORM",
|
|
31
|
+
"REST API",
|
|
32
|
+
"Swagger",
|
|
33
|
+
"Decorator"
|
|
34
|
+
],
|
|
35
|
+
"scripts": {
|
|
36
|
+
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.json\" \".github/**/*.yml\"",
|
|
37
|
+
"lint": "eslint ./src --ext .ts,.tsx,.json,.yml --fix; eslint ./*.json --fix",
|
|
38
|
+
"build": "npm run prebuild && tsc -p tsconfig.build.json",
|
|
39
|
+
"patch": "changeset",
|
|
40
|
+
"prebuild": "rm -rf dist/*",
|
|
41
|
+
"release": "npm install && npm run build && changeset publish"
|
|
42
|
+
},
|
|
43
|
+
"author": "ElsiKora",
|
|
44
|
+
"license": "MIT",
|
|
45
|
+
"description": "A library for automating the creation of CRUD operations in NestJS.",
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"@nestjs/common": ">=10.3.10",
|
|
48
|
+
"@nestjs/core": ">=10.3.10",
|
|
49
|
+
"@nestjs/platform-fastify": ">=10.3.10",
|
|
50
|
+
"@nestjs/swagger": ">=7.4.0",
|
|
51
|
+
"@nestjs/throttler": ">=6.0.0",
|
|
52
|
+
"class-transformer": ">=0.5.1",
|
|
53
|
+
"class-validator": ">=0.14.1",
|
|
54
|
+
"fastify": ">=4.28.1",
|
|
55
|
+
"lodash": ">=4.17.21",
|
|
56
|
+
"typeorm": ">=0.3.20"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@types/lodash": "^4.17.7",
|
|
60
|
+
"@types/node": "^22.1.0",
|
|
61
|
+
"typescript": "^5.5.4",
|
|
62
|
+
"@changesets/cli": "^2.27.7"
|
|
63
|
+
}
|
|
64
|
+
}
|