@solid-nestjs/common 0.2.6 → 0.2.9
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/adapters/index.d.ts +7 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +23 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/validation.adapter.d.ts +20 -0
- package/dist/adapters/validation.adapter.d.ts.map +1 -0
- package/dist/adapters/validation.adapter.js +309 -0
- package/dist/adapters/validation.adapter.js.map +1 -0
- package/dist/decorator-registry/decorator-registry.d.ts +54 -0
- package/dist/decorator-registry/decorator-registry.d.ts.map +1 -0
- package/dist/decorator-registry/decorator-registry.js +161 -0
- package/dist/decorator-registry/decorator-registry.js.map +1 -0
- package/dist/decorator-registry/index.d.ts +2 -0
- package/dist/decorator-registry/index.d.ts.map +1 -0
- package/dist/decorator-registry/index.js +18 -0
- package/dist/decorator-registry/index.js.map +1 -0
- package/dist/decorators/index.d.ts +6 -0
- package/dist/decorators/index.d.ts.map +1 -1
- package/dist/decorators/index.js +6 -0
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/solid-entity.decorator.d.ts +6 -0
- package/dist/decorators/solid-entity.decorator.d.ts.map +1 -0
- package/dist/decorators/solid-entity.decorator.js +23 -0
- package/dist/decorators/solid-entity.decorator.js.map +1 -0
- package/dist/decorators/solid-field.decorator.d.ts +7 -0
- package/dist/decorators/solid-field.decorator.d.ts.map +1 -0
- package/dist/decorators/solid-field.decorator.js +51 -0
- package/dist/decorators/solid-field.decorator.js.map +1 -0
- package/dist/decorators/solid-id.decorator.d.ts +9 -0
- package/dist/decorators/solid-id.decorator.d.ts.map +1 -0
- package/dist/decorators/solid-id.decorator.js +27 -0
- package/dist/decorators/solid-id.decorator.js.map +1 -0
- package/dist/decorators/solid-input.decorator.d.ts +6 -0
- package/dist/decorators/solid-input.decorator.d.ts.map +1 -0
- package/dist/decorators/solid-input.decorator.js +35 -0
- package/dist/decorators/solid-input.decorator.js.map +1 -0
- package/dist/decorators/solid-relation.decorator.d.ts +19 -0
- package/dist/decorators/solid-relation.decorator.d.ts.map +1 -0
- package/dist/decorators/solid-relation.decorator.js +66 -0
- package/dist/decorators/solid-relation.decorator.js.map +1 -0
- package/dist/decorators/solid-timestamp.decorator.d.ts +13 -0
- package/dist/decorators/solid-timestamp.decorator.d.ts.map +1 -0
- package/dist/decorators/solid-timestamp.decorator.js +49 -0
- package/dist/decorators/solid-timestamp.decorator.js.map +1 -0
- package/dist/enums/aggregate-function.enum.d.ts +42 -0
- package/dist/enums/aggregate-function.enum.d.ts.map +1 -0
- package/dist/enums/aggregate-function.enum.js +46 -0
- package/dist/enums/aggregate-function.enum.js.map +1 -0
- package/dist/enums/index.d.ts +1 -0
- package/dist/enums/index.d.ts.map +1 -1
- package/dist/enums/index.js +1 -0
- package/dist/enums/index.js.map +1 -1
- package/dist/helpers/args-helpers/class-generator.helper.d.ts +143 -0
- package/dist/helpers/args-helpers/class-generator.helper.d.ts.map +1 -0
- package/dist/helpers/args-helpers/class-generator.helper.js +221 -0
- package/dist/helpers/args-helpers/class-generator.helper.js.map +1 -0
- package/dist/helpers/args-helpers/create-groupby-request.helper.d.ts +83 -0
- package/dist/helpers/args-helpers/create-groupby-request.helper.d.ts.map +1 -0
- package/dist/helpers/args-helpers/create-groupby-request.helper.js +119 -0
- package/dist/helpers/args-helpers/create-groupby-request.helper.js.map +1 -0
- package/dist/helpers/args-helpers/decorator-builder.helper.d.ts +160 -0
- package/dist/helpers/args-helpers/decorator-builder.helper.d.ts.map +1 -0
- package/dist/helpers/args-helpers/decorator-builder.helper.js +161 -0
- package/dist/helpers/args-helpers/decorator-builder.helper.js.map +1 -0
- package/dist/helpers/args-helpers/field-config.helper.d.ts +98 -0
- package/dist/helpers/args-helpers/field-config.helper.d.ts.map +1 -0
- package/dist/helpers/args-helpers/field-config.helper.js +143 -0
- package/dist/helpers/args-helpers/field-config.helper.js.map +1 -0
- package/dist/helpers/args-helpers/groupby-args-from.helper.d.ts +87 -0
- package/dist/helpers/args-helpers/groupby-args-from.helper.d.ts.map +1 -0
- package/dist/helpers/args-helpers/groupby-args-from.helper.js +185 -0
- package/dist/helpers/args-helpers/groupby-args-from.helper.js.map +1 -0
- package/dist/helpers/args-helpers/index.d.ts +15 -0
- package/dist/helpers/args-helpers/index.d.ts.map +1 -0
- package/dist/helpers/args-helpers/index.js +58 -0
- package/dist/helpers/args-helpers/index.js.map +1 -0
- package/dist/helpers/args-helpers/type-inference.helper.d.ts +191 -0
- package/dist/helpers/args-helpers/type-inference.helper.d.ts.map +1 -0
- package/dist/helpers/args-helpers/type-inference.helper.js +330 -0
- package/dist/helpers/args-helpers/type-inference.helper.js.map +1 -0
- package/dist/helpers/class-generation/dynamic-class.helper.d.ts +101 -0
- package/dist/helpers/class-generation/dynamic-class.helper.d.ts.map +1 -0
- package/dist/helpers/class-generation/dynamic-class.helper.js +180 -0
- package/dist/helpers/class-generation/dynamic-class.helper.js.map +1 -0
- package/dist/helpers/class-generation/index.d.ts +9 -0
- package/dist/helpers/class-generation/index.d.ts.map +1 -0
- package/dist/helpers/class-generation/index.js +18 -0
- package/dist/helpers/class-generation/index.js.map +1 -0
- package/dist/helpers/decorators/decorator-utils.helper.d.ts +75 -0
- package/dist/helpers/decorators/decorator-utils.helper.d.ts.map +1 -0
- package/dist/helpers/decorators/decorator-utils.helper.js +92 -0
- package/dist/helpers/decorators/decorator-utils.helper.js.map +1 -0
- package/dist/helpers/decorators/index.d.ts +9 -0
- package/dist/helpers/decorators/index.d.ts.map +1 -0
- package/dist/helpers/decorators/index.js +16 -0
- package/dist/helpers/decorators/index.js.map +1 -0
- package/dist/helpers/dto-generator-base.helper.d.ts +19 -0
- package/dist/helpers/dto-generator-base.helper.d.ts.map +1 -0
- package/dist/helpers/dto-generator-base.helper.js +72 -0
- package/dist/helpers/dto-generator-base.helper.js.map +1 -0
- package/dist/helpers/index.d.ts +9 -0
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js +9 -0
- package/dist/helpers/index.js.map +1 -1
- package/dist/helpers/metadata-extractor.helper.d.ts +26 -0
- package/dist/helpers/metadata-extractor.helper.d.ts.map +1 -0
- package/dist/helpers/metadata-extractor.helper.js +67 -0
- package/dist/helpers/metadata-extractor.helper.js.map +1 -0
- package/dist/helpers/package-detector.helper.d.ts +33 -0
- package/dist/helpers/package-detector.helper.d.ts.map +1 -0
- package/dist/helpers/package-detector.helper.js +82 -0
- package/dist/helpers/package-detector.helper.js.map +1 -0
- package/dist/helpers/property-filter.helper.d.ts +15 -0
- package/dist/helpers/property-filter.helper.d.ts.map +1 -0
- package/dist/helpers/property-filter.helper.js +44 -0
- package/dist/helpers/property-filter.helper.js.map +1 -0
- package/dist/helpers/type-inference.helper.d.ts +76 -0
- package/dist/helpers/type-inference.helper.d.ts.map +1 -0
- package/dist/helpers/type-inference.helper.js +205 -0
- package/dist/helpers/type-inference.helper.js.map +1 -0
- package/dist/helpers/validation-inference.helper.d.ts +18 -0
- package/dist/helpers/validation-inference.helper.d.ts.map +1 -0
- package/dist/helpers/validation-inference.helper.js +100 -0
- package/dist/helpers/validation-inference.helper.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces/adapters/decorator-adapter.interface.d.ts +8 -0
- package/dist/interfaces/adapters/decorator-adapter.interface.d.ts.map +1 -0
- package/dist/interfaces/adapters/decorator-adapter.interface.js +3 -0
- package/dist/interfaces/adapters/decorator-adapter.interface.js.map +1 -0
- package/dist/interfaces/decorators/solid-field-options.interface.d.ts +55 -0
- package/dist/interfaces/decorators/solid-field-options.interface.d.ts.map +1 -0
- package/dist/interfaces/decorators/solid-field-options.interface.js +3 -0
- package/dist/interfaces/decorators/solid-field-options.interface.js.map +1 -0
- package/dist/interfaces/index.d.ts +5 -0
- package/dist/interfaces/index.d.ts.map +1 -1
- package/dist/interfaces/index.js +5 -0
- package/dist/interfaces/index.js.map +1 -1
- package/dist/interfaces/inputs/filters.interfaces.d.ts +36 -0
- package/dist/interfaces/inputs/filters.interfaces.d.ts.map +1 -0
- package/dist/interfaces/inputs/filters.interfaces.js +3 -0
- package/dist/interfaces/inputs/filters.interfaces.js.map +1 -0
- package/dist/interfaces/inputs/find-args.interface.d.ts +8 -0
- package/dist/interfaces/inputs/find-args.interface.d.ts.map +1 -0
- package/dist/interfaces/inputs/find-args.interface.js +3 -0
- package/dist/interfaces/inputs/find-args.interface.js.map +1 -0
- package/dist/interfaces/inputs/group-by-args.interface.d.ts +33 -0
- package/dist/interfaces/inputs/group-by-args.interface.d.ts.map +1 -0
- package/dist/interfaces/inputs/group-by-args.interface.js +3 -0
- package/dist/interfaces/inputs/group-by-args.interface.js.map +1 -0
- package/dist/interfaces/inputs/group-by-request.interface.d.ts +63 -0
- package/dist/interfaces/inputs/group-by-request.interface.d.ts.map +1 -0
- package/dist/interfaces/inputs/group-by-request.interface.js +3 -0
- package/dist/interfaces/inputs/group-by-request.interface.js.map +1 -0
- package/dist/interfaces/inputs/index.d.ts +6 -0
- package/dist/interfaces/inputs/index.d.ts.map +1 -0
- package/dist/interfaces/inputs/index.js +22 -0
- package/dist/interfaces/inputs/index.js.map +1 -0
- package/dist/interfaces/inputs/pagination-request.interface.d.ts +7 -0
- package/dist/interfaces/inputs/pagination-request.interface.d.ts.map +1 -0
- package/dist/interfaces/inputs/pagination-request.interface.js +3 -0
- package/dist/interfaces/inputs/pagination-request.interface.js.map +1 -0
- package/dist/interfaces/metadata/field-metadata.interface.d.ts +29 -0
- package/dist/interfaces/metadata/field-metadata.interface.d.ts.map +1 -0
- package/dist/interfaces/metadata/field-metadata.interface.js +3 -0
- package/dist/interfaces/metadata/field-metadata.interface.js.map +1 -0
- package/dist/interfaces/misc/group-by-args.interface.d.ts +33 -0
- package/dist/interfaces/misc/group-by-args.interface.d.ts.map +1 -0
- package/dist/interfaces/misc/group-by-args.interface.js +3 -0
- package/dist/interfaces/misc/group-by-args.interface.js.map +1 -0
- package/dist/interfaces/misc/group-by-request.interface.d.ts +63 -0
- package/dist/interfaces/misc/group-by-request.interface.d.ts.map +1 -0
- package/dist/interfaces/misc/group-by-request.interface.js +3 -0
- package/dist/interfaces/misc/group-by-request.interface.js.map +1 -0
- package/dist/interfaces/misc/group-by-response.interface.d.ts +59 -0
- package/dist/interfaces/misc/group-by-response.interface.d.ts.map +1 -0
- package/dist/interfaces/misc/group-by-response.interface.js +3 -0
- package/dist/interfaces/misc/group-by-response.interface.js.map +1 -0
- package/dist/interfaces/misc/group-by.interface.d.ts +145 -0
- package/dist/interfaces/misc/group-by.interface.d.ts.map +1 -0
- package/dist/interfaces/misc/group-by.interface.js +3 -0
- package/dist/interfaces/misc/group-by.interface.js.map +1 -0
- package/dist/interfaces/misc/index.d.ts +0 -4
- package/dist/interfaces/misc/index.d.ts.map +1 -1
- package/dist/interfaces/misc/index.js +0 -4
- package/dist/interfaces/misc/index.js.map +1 -1
- package/dist/interfaces/outputs/group-by-response.interface.d.ts +59 -0
- package/dist/interfaces/outputs/group-by-response.interface.d.ts.map +1 -0
- package/dist/interfaces/outputs/group-by-response.interface.js +3 -0
- package/dist/interfaces/outputs/group-by-response.interface.js.map +1 -0
- package/dist/interfaces/outputs/index.d.ts +3 -0
- package/dist/interfaces/outputs/index.d.ts.map +1 -0
- package/dist/interfaces/outputs/index.js +19 -0
- package/dist/interfaces/outputs/index.js.map +1 -0
- package/dist/interfaces/outputs/pagination-result.interface.d.ts +10 -0
- package/dist/interfaces/outputs/pagination-result.interface.d.ts.map +1 -0
- package/dist/interfaces/outputs/pagination-result.interface.js +3 -0
- package/dist/interfaces/outputs/pagination-result.interface.js.map +1 -0
- package/dist/interfaces/services/crud-service.interface.d.ts +2 -1
- package/dist/interfaces/services/crud-service.interface.d.ts.map +1 -1
- package/dist/interfaces/services/crud-service.interface.js.map +1 -1
- package/dist/interfaces/services/data-service.interface.d.ts +3 -1
- package/dist/interfaces/services/data-service.interface.d.ts.map +1 -1
- package/dist/interfaces/structures/common-services.index.d.ts +1 -0
- package/dist/interfaces/structures/common-services.index.d.ts.map +1 -0
- package/dist/interfaces/structures/common-services.index.js +2 -0
- package/dist/interfaces/structures/common-services.index.js.map +1 -0
- package/dist/interfaces/structures/crud-service-structure.interface.d.ts +2 -1
- package/dist/interfaces/structures/crud-service-structure.interface.d.ts.map +1 -1
- package/dist/interfaces/structures/data-service-structure.interface.d.ts +2 -1
- package/dist/interfaces/structures/data-service-structure.interface.d.ts.map +1 -1
- package/dist/interfaces/structures/entity-provider-structure.interface.d.ts +2 -1
- package/dist/interfaces/structures/entity-provider-structure.interface.d.ts.map +1 -1
- package/dist/interfaces/structures/entity-provider-structure.interface.js.map +1 -1
- package/dist/interfaces/structures/service-plugins.interface.d.ts +2 -1
- package/dist/interfaces/structures/service-plugins.interface.d.ts.map +1 -1
- package/dist/metadata/index.d.ts +2 -0
- package/dist/metadata/index.d.ts.map +1 -0
- package/dist/metadata/index.js +18 -0
- package/dist/metadata/index.js.map +1 -0
- package/dist/metadata/metadata-storage.d.ts +54 -0
- package/dist/metadata/metadata-storage.d.ts.map +1 -0
- package/dist/metadata/metadata-storage.js +106 -0
- package/dist/metadata/metadata-storage.js.map +1 -0
- package/dist/registry/index.d.ts +2 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/index.js +18 -0
- package/dist/registry/index.js.map +1 -0
- package/dist/registry/relation-adapter-registry.d.ts +11 -0
- package/dist/registry/relation-adapter-registry.d.ts.map +1 -0
- package/dist/registry/relation-adapter-registry.js +30 -0
- package/dist/registry/relation-adapter-registry.js.map +1 -0
- package/dist/types/dto-generation.types.d.ts +46 -0
- package/dist/types/dto-generation.types.d.ts.map +1 -0
- package/dist/types/dto-generation.types.js +6 -0
- package/dist/types/dto-generation.types.js.map +1 -0
- package/dist/types/find-args.type.d.ts +9 -7
- package/dist/types/find-args.type.d.ts.map +1 -1
- package/dist/types/group-by.type.d.ts +41 -0
- package/dist/types/group-by.type.d.ts.map +1 -0
- package/dist/types/group-by.type.js +3 -0
- package/dist/types/group-by.type.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/utils/object.utils.d.ts +0 -8
- package/dist/utils/object.utils.d.ts.map +0 -1
- package/dist/utils/object.utils.js +0 -11
- package/dist/utils/object.utils.js.map +0 -1
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
export * from './current-context.decorator';
|
|
2
2
|
export * from './ignore-arg.decorator';
|
|
3
3
|
export * from './wrapped.decorator';
|
|
4
|
+
export * from './solid-field.decorator';
|
|
5
|
+
export * from './solid-id.decorator';
|
|
6
|
+
export * from './solid-entity.decorator';
|
|
7
|
+
export * from './solid-input.decorator';
|
|
8
|
+
export * from './solid-timestamp.decorator';
|
|
9
|
+
export * from './solid-relation.decorator';
|
|
4
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC"}
|
package/dist/decorators/index.js
CHANGED
|
@@ -17,4 +17,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./current-context.decorator"), exports);
|
|
18
18
|
__exportStar(require("./ignore-arg.decorator"), exports);
|
|
19
19
|
__exportStar(require("./wrapped.decorator"), exports);
|
|
20
|
+
__exportStar(require("./solid-field.decorator"), exports);
|
|
21
|
+
__exportStar(require("./solid-id.decorator"), exports);
|
|
22
|
+
__exportStar(require("./solid-entity.decorator"), exports);
|
|
23
|
+
__exportStar(require("./solid-input.decorator"), exports);
|
|
24
|
+
__exportStar(require("./solid-timestamp.decorator"), exports);
|
|
25
|
+
__exportStar(require("./solid-relation.decorator"), exports);
|
|
20
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C;AAC5C,yDAAuC;AACvC,sDAAoC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C;AAC5C,yDAAuC;AACvC,sDAAoC;AACpC,0DAAwC;AACxC,uDAAqC;AACrC,2DAAyC;AACzC,0DAAwC;AACxC,8DAA4C;AAC5C,6DAA2C"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SolidEntityOptions } from '../interfaces';
|
|
2
|
+
/**
|
|
3
|
+
* Class decorator for entities with automatic database and API mappings
|
|
4
|
+
*/
|
|
5
|
+
export declare function SolidEntity(options?: SolidEntityOptions): ClassDecorator;
|
|
6
|
+
//# sourceMappingURL=solid-entity.decorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solid-entity.decorator.d.ts","sourceRoot":"","sources":["../../src/decorators/solid-entity.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAkB,MAAM,eAAe,CAAC;AAInE;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,cAAc,CAexE"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SolidEntity = SolidEntity;
|
|
4
|
+
const metadata_1 = require("../metadata");
|
|
5
|
+
const decorator_registry_1 = require("../decorator-registry");
|
|
6
|
+
/**
|
|
7
|
+
* Class decorator for entities with automatic database and API mappings
|
|
8
|
+
*/
|
|
9
|
+
function SolidEntity(options) {
|
|
10
|
+
return function (target) {
|
|
11
|
+
// Create entity metadata
|
|
12
|
+
const metadata = {
|
|
13
|
+
target,
|
|
14
|
+
options: options || {},
|
|
15
|
+
type: 'entity'
|
|
16
|
+
};
|
|
17
|
+
// Store entity metadata
|
|
18
|
+
metadata_1.MetadataStorage.addEntityMetadata(metadata);
|
|
19
|
+
// Apply class-level decorators from all registered adapters
|
|
20
|
+
decorator_registry_1.DecoratorRegistry.applyClassDecorators(target, 'entity', options || {});
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=solid-entity.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solid-entity.decorator.js","sourceRoot":"","sources":["../../src/decorators/solid-entity.decorator.ts"],"names":[],"mappings":";;AAOA,kCAeC;AArBD,0CAA8C;AAC9C,8DAA0D;AAE1D;;GAEG;AACH,SAAgB,WAAW,CAAC,OAA4B;IACtD,OAAO,UAAU,MAAgB;QAC/B,yBAAyB;QACzB,MAAM,QAAQ,GAAmB;YAC/B,MAAM;YACN,OAAO,EAAE,OAAO,IAAI,EAAE;YACtB,IAAI,EAAE,QAAQ;SACf,CAAC;QAEF,wBAAwB;QACxB,0BAAe,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;QAE5C,4DAA4D;QAC5D,sCAAiB,CAAC,oBAAoB,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC;IAC1E,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { SolidFieldOptions } from '../interfaces';
|
|
3
|
+
/**
|
|
4
|
+
* Universal field decorator that applies appropriate decorators based on context
|
|
5
|
+
*/
|
|
6
|
+
export declare function SolidField(options?: SolidFieldOptions): PropertyDecorator;
|
|
7
|
+
//# sourceMappingURL=solid-field.decorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solid-field.decorator.d.ts","sourceRoot":"","sources":["../../src/decorators/solid-field.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAiB,MAAM,eAAe,CAAC;AAKjE;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,iBAAiB,CAqBzE"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SolidField = SolidField;
|
|
4
|
+
require("reflect-metadata");
|
|
5
|
+
const metadata_1 = require("../metadata");
|
|
6
|
+
const decorator_registry_1 = require("../decorator-registry");
|
|
7
|
+
const helpers_1 = require("../helpers");
|
|
8
|
+
/**
|
|
9
|
+
* Universal field decorator that applies appropriate decorators based on context
|
|
10
|
+
*/
|
|
11
|
+
function SolidField(options) {
|
|
12
|
+
return function (target, propertyKey) {
|
|
13
|
+
// Get type information from TypeScript metadata
|
|
14
|
+
const type = Reflect.getMetadata('design:type', target, propertyKey);
|
|
15
|
+
const typeInfo = (0, helpers_1.inferTypeFromMetadata)(target, propertyKey);
|
|
16
|
+
// Create field metadata
|
|
17
|
+
const metadata = {
|
|
18
|
+
target: target.constructor,
|
|
19
|
+
propertyKey,
|
|
20
|
+
type,
|
|
21
|
+
options: options || {},
|
|
22
|
+
isOptional: typeInfo.isOptional || detectOptionalFromOptions(options),
|
|
23
|
+
};
|
|
24
|
+
// Store metadata for later use
|
|
25
|
+
metadata_1.MetadataStorage.addFieldMetadata(metadata);
|
|
26
|
+
// Apply decorators from all registered adapters
|
|
27
|
+
decorator_registry_1.DecoratorRegistry.applyDecorators(target, propertyKey, metadata);
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Detects if a field should be optional based on options
|
|
32
|
+
*/
|
|
33
|
+
function detectOptionalFromOptions(options) {
|
|
34
|
+
if (!options)
|
|
35
|
+
return false;
|
|
36
|
+
// Explicit nullable setting
|
|
37
|
+
if (options.nullable === true)
|
|
38
|
+
return true;
|
|
39
|
+
if (options.nullable === false)
|
|
40
|
+
return false;
|
|
41
|
+
// Required setting (inverse of optional)
|
|
42
|
+
if (options.required === true)
|
|
43
|
+
return false;
|
|
44
|
+
if (options.required === false)
|
|
45
|
+
return true;
|
|
46
|
+
// Default value implies optional
|
|
47
|
+
if (options.defaultValue !== undefined)
|
|
48
|
+
return true;
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=solid-field.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solid-field.decorator.js","sourceRoot":"","sources":["../../src/decorators/solid-field.decorator.ts"],"names":[],"mappings":";;AASA,gCAqBC;AA9BD,4BAA0B;AAE1B,0CAA8C;AAC9C,8DAA0D;AAC1D,wCAAmD;AAEnD;;GAEG;AACH,SAAgB,UAAU,CAAC,OAA2B;IACpD,OAAO,UAAU,MAAW,EAAE,WAA4B;QACxD,gDAAgD;QAChD,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC,aAAa,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;QACrE,MAAM,QAAQ,GAAG,IAAA,+BAAqB,EAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QAE5D,wBAAwB;QACxB,MAAM,QAAQ,GAAkB;YAC9B,MAAM,EAAE,MAAM,CAAC,WAAW;YAC1B,WAAW;YACX,IAAI;YACJ,OAAO,EAAE,OAAO,IAAI,EAAE;YACtB,UAAU,EAAE,QAAQ,CAAC,UAAU,IAAI,yBAAyB,CAAC,OAAO,CAAC;SACtE,CAAC;QAEF,+BAA+B;QAC/B,0BAAe,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QAE3C,gDAAgD;QAChD,sCAAiB,CAAC,eAAe,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;IACnE,CAAC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,yBAAyB,CAAC,OAA2B;IAC5D,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IAE3B,4BAA4B;IAC5B,IAAI,OAAO,CAAC,QAAQ,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC3C,IAAI,OAAO,CAAC,QAAQ,KAAK,KAAK;QAAE,OAAO,KAAK,CAAC;IAE7C,yCAAyC;IACzC,IAAI,OAAO,CAAC,QAAQ,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,OAAO,CAAC,QAAQ,KAAK,KAAK;QAAE,OAAO,IAAI,CAAC;IAE5C,iCAAiC;IACjC,IAAI,OAAO,CAAC,YAAY,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAEpD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SolidFieldOptions } from '../interfaces';
|
|
2
|
+
export interface SolidIdOptions extends Omit<SolidFieldOptions, 'isPrimaryKey' | 'required' | 'nullable'> {
|
|
3
|
+
generated?: 'uuid' | 'increment' | boolean;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Specialized decorator for primary key fields
|
|
7
|
+
*/
|
|
8
|
+
export declare function SolidId(options?: SolidIdOptions): PropertyDecorator;
|
|
9
|
+
//# sourceMappingURL=solid-id.decorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solid-id.decorator.d.ts","sourceRoot":"","sources":["../../src/decorators/solid-id.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGlD,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,iBAAiB,EAAE,cAAc,GAAG,UAAU,GAAG,UAAU,CAAC;IACvG,SAAS,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,OAAO,CAAC;CAC5C;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,iBAAiB,CAmBnE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SolidId = SolidId;
|
|
4
|
+
const solid_field_decorator_1 = require("./solid-field.decorator");
|
|
5
|
+
/**
|
|
6
|
+
* Specialized decorator for primary key fields
|
|
7
|
+
*/
|
|
8
|
+
function SolidId(options) {
|
|
9
|
+
return function (target, propertyKey) {
|
|
10
|
+
// Enhance options with primary key specific settings
|
|
11
|
+
const enhancedOptions = {
|
|
12
|
+
...options,
|
|
13
|
+
isPrimaryKey: true,
|
|
14
|
+
unique: true,
|
|
15
|
+
required: true,
|
|
16
|
+
nullable: false,
|
|
17
|
+
generated: options?.generated ?? 'uuid',
|
|
18
|
+
adapters: {
|
|
19
|
+
...options?.adapters
|
|
20
|
+
// Individual adapters will handle ID-specific logic internally
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
// Apply the enhanced SolidField decorator
|
|
24
|
+
return (0, solid_field_decorator_1.SolidField)(enhancedOptions)(target, propertyKey);
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=solid-id.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solid-id.decorator.js","sourceRoot":"","sources":["../../src/decorators/solid-id.decorator.ts"],"names":[],"mappings":";;AAUA,0BAmBC;AA5BD,mEAAqD;AAMrD;;GAEG;AACH,SAAgB,OAAO,CAAC,OAAwB;IAC9C,OAAO,UAAU,MAAW,EAAE,WAA4B;QACxD,qDAAqD;QACrD,MAAM,eAAe,GAAsB;YACzC,GAAG,OAAO;YACV,YAAY,EAAE,IAAI;YAClB,MAAM,EAAE,IAAI;YACZ,QAAQ,EAAE,IAAI;YACd,QAAQ,EAAE,KAAK;YACf,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,MAAM;YACvC,QAAQ,EAAE;gBACR,GAAG,OAAO,EAAE,QAAQ;gBACpB,+DAA+D;aAChE;SACF,CAAC;QAEF,0CAA0C;QAC1C,OAAO,IAAA,kCAAU,EAAC,eAAe,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAC1D,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SolidInputOptions } from '../interfaces';
|
|
2
|
+
/**
|
|
3
|
+
* Class decorator for DTOs/Input types (skips database decorators by default)
|
|
4
|
+
*/
|
|
5
|
+
export declare function SolidInput(options?: SolidInputOptions): ClassDecorator;
|
|
6
|
+
//# sourceMappingURL=solid-input.decorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solid-input.decorator.d.ts","sourceRoot":"","sources":["../../src/decorators/solid-input.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAkB,MAAM,eAAe,CAAC;AAIlE;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,cAAc,CA8BtE"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SolidInput = SolidInput;
|
|
4
|
+
const metadata_1 = require("../metadata");
|
|
5
|
+
const decorator_registry_1 = require("../decorator-registry");
|
|
6
|
+
/**
|
|
7
|
+
* Class decorator for DTOs/Input types (skips database decorators by default)
|
|
8
|
+
*/
|
|
9
|
+
function SolidInput(options) {
|
|
10
|
+
return function (target) {
|
|
11
|
+
// Default skip list for input types (typically skip database decorators)
|
|
12
|
+
const defaultSkip = options?.defaultSkip || [];
|
|
13
|
+
const skipList = [
|
|
14
|
+
...defaultSkip,
|
|
15
|
+
...(options?.skip || [])
|
|
16
|
+
];
|
|
17
|
+
// Remove duplicates
|
|
18
|
+
const uniqueSkipList = [...new Set(skipList)];
|
|
19
|
+
const enhancedOptions = {
|
|
20
|
+
...options,
|
|
21
|
+
skip: uniqueSkipList
|
|
22
|
+
};
|
|
23
|
+
// Create entity metadata
|
|
24
|
+
const metadata = {
|
|
25
|
+
target,
|
|
26
|
+
options: enhancedOptions,
|
|
27
|
+
type: 'input'
|
|
28
|
+
};
|
|
29
|
+
// Store entity metadata
|
|
30
|
+
metadata_1.MetadataStorage.addEntityMetadata(metadata);
|
|
31
|
+
// Apply class-level decorators from all registered adapters (excluding skipped ones)
|
|
32
|
+
decorator_registry_1.DecoratorRegistry.applyClassDecorators(target, 'input', enhancedOptions);
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=solid-input.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solid-input.decorator.js","sourceRoot":"","sources":["../../src/decorators/solid-input.decorator.ts"],"names":[],"mappings":";;AAOA,gCA8BC;AApCD,0CAA8C;AAC9C,8DAA0D;AAE1D;;GAEG;AACH,SAAgB,UAAU,CAAC,OAA2B;IACpD,OAAO,UAAU,MAAgB;QAC/B,yEAAyE;QACzE,MAAM,WAAW,GAAG,OAAO,EAAE,WAAW,IAAI,EAAE,CAAC;QAC/C,MAAM,QAAQ,GAAG;YACf,GAAG,WAAW;YACd,GAAG,CAAC,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC;SACzB,CAAC;QAEF,oBAAoB;QACpB,MAAM,cAAc,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;QAE9C,MAAM,eAAe,GAAG;YACtB,GAAG,OAAO;YACV,IAAI,EAAE,cAAc;SACrB,CAAC;QAEF,yBAAyB;QACzB,MAAM,QAAQ,GAAmB;YAC/B,MAAM;YACN,OAAO,EAAE,eAAe;YACxB,IAAI,EAAE,OAAO;SACd,CAAC;QAEF,wBAAwB;QACxB,0BAAe,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;QAE5C,qFAAqF;QACrF,sCAAiB,CAAC,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC;IAC3E,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SolidFieldOptions } from '../interfaces';
|
|
2
|
+
export type RelationType = 'one-to-many' | 'many-to-one' | 'one-to-one' | 'many-to-many';
|
|
3
|
+
export interface SolidRelationOptions extends Omit<SolidFieldOptions, 'relation' | 'target' | 'inverseSide'> {
|
|
4
|
+
type: RelationType;
|
|
5
|
+
target: () => Function;
|
|
6
|
+
inverseSide?: string | ((object: any) => any);
|
|
7
|
+
onDelete?: 'RESTRICT' | 'CASCADE' | 'SET NULL';
|
|
8
|
+
onUpdate?: 'RESTRICT' | 'CASCADE' | 'SET NULL';
|
|
9
|
+
orphanedRowAction?: 'nullify' | 'delete' | 'soft-delete' | 'disable';
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Decorator for entity relations with automatic adapter mappings
|
|
13
|
+
*/
|
|
14
|
+
export declare function SolidRelation(options: SolidRelationOptions): PropertyDecorator;
|
|
15
|
+
export declare const SolidOneToMany: (target: () => Function, inverseSide: string | ((object: any) => any), options?: Omit<SolidRelationOptions, "type" | "target" | "inverseSide">) => PropertyDecorator;
|
|
16
|
+
export declare const SolidManyToOne: (target: () => Function, inverseSide?: string | ((object: any) => any), options?: Omit<SolidRelationOptions, "type" | "target" | "inverseSide">) => PropertyDecorator;
|
|
17
|
+
export declare const SolidOneToOne: (target: () => Function, inverseSide?: string | ((object: any) => any), options?: Omit<SolidRelationOptions, "type" | "target" | "inverseSide">) => PropertyDecorator;
|
|
18
|
+
export declare const SolidManyToMany: (target: () => Function, inverseSide?: string | ((object: any) => any), options?: Omit<SolidRelationOptions, "type" | "target" | "inverseSide">) => PropertyDecorator;
|
|
19
|
+
//# sourceMappingURL=solid-relation.decorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solid-relation.decorator.d.ts","sourceRoot":"","sources":["../../src/decorators/solid-relation.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAIlD,MAAM,MAAM,YAAY,GAAG,aAAa,GAAG,aAAa,GAAG,YAAY,GAAG,cAAc,CAAC;AAEzF,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,iBAAiB,EAAE,UAAU,GAAG,QAAQ,GAAG,aAAa,CAAC;IAC1G,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,EAAE,MAAM,QAAQ,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC,CAAC;IAC9C,QAAQ,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,UAAU,CAAC;IAC/C,QAAQ,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,UAAU,CAAC;IAC/C,iBAAiB,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,aAAa,GAAG,SAAS,CAAC;CACtE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,iBAAiB,CA4B9E;AAGD,eAAO,MAAM,cAAc,GACzB,QAAQ,MAAM,QAAQ,EACtB,aAAa,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC,EAC5C,UAAU,IAAI,CAAC,oBAAoB,EAAE,MAAM,GAAG,QAAQ,GAAG,aAAa,CAAC,sBAOrE,CAAC;AAEL,eAAO,MAAM,cAAc,GACzB,QAAQ,MAAM,QAAQ,EACtB,cAAc,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC,EAC7C,UAAU,IAAI,CAAC,oBAAoB,EAAE,MAAM,GAAG,QAAQ,GAAG,aAAa,CAAC,sBAOrE,CAAC;AAEL,eAAO,MAAM,aAAa,GACxB,QAAQ,MAAM,QAAQ,EACtB,cAAc,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC,EAC7C,UAAU,IAAI,CAAC,oBAAoB,EAAE,MAAM,GAAG,QAAQ,GAAG,aAAa,CAAC,sBAOrE,CAAC;AAEL,eAAO,MAAM,eAAe,GAC1B,QAAQ,MAAM,QAAQ,EACtB,cAAc,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC,EAC7C,UAAU,IAAI,CAAC,oBAAoB,EAAE,MAAM,GAAG,QAAQ,GAAG,aAAa,CAAC,sBAOrE,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SolidManyToMany = exports.SolidOneToOne = exports.SolidManyToOne = exports.SolidOneToMany = void 0;
|
|
4
|
+
exports.SolidRelation = SolidRelation;
|
|
5
|
+
const solid_field_decorator_1 = require("./solid-field.decorator");
|
|
6
|
+
const registry_1 = require("../registry");
|
|
7
|
+
/**
|
|
8
|
+
* Decorator for entity relations with automatic adapter mappings
|
|
9
|
+
*/
|
|
10
|
+
function SolidRelation(options) {
|
|
11
|
+
return function (target, propertyKey) {
|
|
12
|
+
const { type, target: targetFn, inverseSide, ...restOptions } = options;
|
|
13
|
+
// Build enhanced options for SolidField
|
|
14
|
+
const enhancedOptions = {
|
|
15
|
+
...restOptions,
|
|
16
|
+
relation: type,
|
|
17
|
+
target: targetFn,
|
|
18
|
+
inverseSide: typeof inverseSide === 'string' ?
|
|
19
|
+
(obj) => obj[inverseSide] :
|
|
20
|
+
inverseSide,
|
|
21
|
+
adapters: {
|
|
22
|
+
...restOptions.adapters,
|
|
23
|
+
// Generate adapter options for all registered adapters
|
|
24
|
+
...registry_1.RelationAdapterRegistry.getRegisteredAdapters().reduce((acc, adapterName) => {
|
|
25
|
+
acc[adapterName] = {
|
|
26
|
+
...registry_1.RelationAdapterRegistry.getAdapterOptions(adapterName, type, targetFn, inverseSide, options),
|
|
27
|
+
...restOptions.adapters?.[adapterName]
|
|
28
|
+
};
|
|
29
|
+
return acc;
|
|
30
|
+
}, {})
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
// Apply the enhanced SolidField decorator
|
|
34
|
+
return (0, solid_field_decorator_1.SolidField)(enhancedOptions)(target, propertyKey);
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
// Convenience decorators for specific relation types
|
|
38
|
+
const SolidOneToMany = (target, inverseSide, options) => SolidRelation({
|
|
39
|
+
...options,
|
|
40
|
+
type: 'one-to-many',
|
|
41
|
+
target,
|
|
42
|
+
inverseSide
|
|
43
|
+
});
|
|
44
|
+
exports.SolidOneToMany = SolidOneToMany;
|
|
45
|
+
const SolidManyToOne = (target, inverseSide, options) => SolidRelation({
|
|
46
|
+
...options,
|
|
47
|
+
type: 'many-to-one',
|
|
48
|
+
target,
|
|
49
|
+
inverseSide
|
|
50
|
+
});
|
|
51
|
+
exports.SolidManyToOne = SolidManyToOne;
|
|
52
|
+
const SolidOneToOne = (target, inverseSide, options) => SolidRelation({
|
|
53
|
+
...options,
|
|
54
|
+
type: 'one-to-one',
|
|
55
|
+
target,
|
|
56
|
+
inverseSide
|
|
57
|
+
});
|
|
58
|
+
exports.SolidOneToOne = SolidOneToOne;
|
|
59
|
+
const SolidManyToMany = (target, inverseSide, options) => SolidRelation({
|
|
60
|
+
...options,
|
|
61
|
+
type: 'many-to-many',
|
|
62
|
+
target,
|
|
63
|
+
inverseSide
|
|
64
|
+
});
|
|
65
|
+
exports.SolidManyToMany = SolidManyToMany;
|
|
66
|
+
//# sourceMappingURL=solid-relation.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solid-relation.decorator.js","sourceRoot":"","sources":["../../src/decorators/solid-relation.decorator.ts"],"names":[],"mappings":";;;AAkBA,sCA4BC;AA7CD,mEAAqD;AACrD,0CAAsD;AAatD;;GAEG;AACH,SAAgB,aAAa,CAAC,OAA6B;IACzD,OAAO,UAAU,MAAW,EAAE,WAA4B;QACxD,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,WAAW,EAAE,GAAG,OAAO,CAAC;QAExE,wCAAwC;QACxC,MAAM,eAAe,GAAsB;YACzC,GAAG,WAAW;YACd,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,QAAQ;YAChB,WAAW,EAAE,OAAO,WAAW,KAAK,QAAQ,CAAC,CAAC;gBAC5C,CAAC,GAAQ,EAAE,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;gBAChC,WAAW;YACb,QAAQ,EAAE;gBACR,GAAG,WAAW,CAAC,QAAQ;gBACvB,uDAAuD;gBACvD,GAAG,kCAAuB,CAAC,qBAAqB,EAAE,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,WAAW,EAAE,EAAE;oBAC7E,GAAG,CAAC,WAAW,CAAC,GAAG;wBACjB,GAAG,kCAAuB,CAAC,iBAAiB,CAAC,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,CAAC;wBAC/F,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC,WAAW,CAAC;qBACvC,CAAC;oBACF,OAAO,GAAG,CAAC;gBACb,CAAC,EAAE,EAAS,CAAC;aACd;SACF,CAAC;QAEF,0CAA0C;QAC1C,OAAO,IAAA,kCAAU,EAAC,eAAe,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAC1D,CAAC,CAAC;AACJ,CAAC;AAED,qDAAqD;AAC9C,MAAM,cAAc,GAAG,CAC5B,MAAsB,EACtB,WAA4C,EAC5C,OAAuE,EACvE,EAAE,CACF,aAAa,CAAC;IACZ,GAAG,OAAO;IACV,IAAI,EAAE,aAAa;IACnB,MAAM;IACN,WAAW;CACZ,CAAC,CAAC;AAVQ,QAAA,cAAc,kBAUtB;AAEE,MAAM,cAAc,GAAG,CAC5B,MAAsB,EACtB,WAA6C,EAC7C,OAAuE,EACvE,EAAE,CACF,aAAa,CAAC;IACZ,GAAG,OAAO;IACV,IAAI,EAAE,aAAa;IACnB,MAAM;IACN,WAAW;CACZ,CAAC,CAAC;AAVQ,QAAA,cAAc,kBAUtB;AAEE,MAAM,aAAa,GAAG,CAC3B,MAAsB,EACtB,WAA6C,EAC7C,OAAuE,EACvE,EAAE,CACF,aAAa,CAAC;IACZ,GAAG,OAAO;IACV,IAAI,EAAE,YAAY;IAClB,MAAM;IACN,WAAW;CACZ,CAAC,CAAC;AAVQ,QAAA,aAAa,iBAUrB;AAEE,MAAM,eAAe,GAAG,CAC7B,MAAsB,EACtB,WAA6C,EAC7C,OAAuE,EACvE,EAAE,CACF,aAAa,CAAC;IACZ,GAAG,OAAO;IACV,IAAI,EAAE,cAAc;IACpB,MAAM;IACN,WAAW;CACZ,CAAC,CAAC;AAVQ,QAAA,eAAe,mBAUvB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SolidFieldOptions } from '../interfaces';
|
|
2
|
+
export type TimestampType = 'created' | 'updated' | 'deleted';
|
|
3
|
+
export interface SolidTimestampOptions extends Omit<SolidFieldOptions, 'nullable' | 'createdAt' | 'updatedAt' | 'deletedAt'> {
|
|
4
|
+
type?: TimestampType;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Decorator for timestamp fields (created, updated, deleted)
|
|
8
|
+
*/
|
|
9
|
+
export declare function SolidTimestamp(type?: TimestampType, options?: SolidTimestampOptions): PropertyDecorator;
|
|
10
|
+
export declare const SolidCreatedAt: (options?: Omit<SolidTimestampOptions, "type">) => PropertyDecorator;
|
|
11
|
+
export declare const SolidUpdatedAt: (options?: Omit<SolidTimestampOptions, "type">) => PropertyDecorator;
|
|
12
|
+
export declare const SolidDeletedAt: (options?: Omit<SolidTimestampOptions, "type">) => PropertyDecorator;
|
|
13
|
+
//# sourceMappingURL=solid-timestamp.decorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solid-timestamp.decorator.d.ts","sourceRoot":"","sources":["../../src/decorators/solid-timestamp.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGlD,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;AAE9D,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,iBAAiB,EAAE,UAAU,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,CAAC;IAC1H,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,IAAI,GAAE,aAAyB,EAC/B,OAAO,CAAC,EAAE,qBAAqB,GAC9B,iBAAiB,CAmCnB;AAGD,eAAO,MAAM,cAAc,GAAI,UAAU,IAAI,CAAC,qBAAqB,EAAE,MAAM,CAAC,sBACxC,CAAC;AAErC,eAAO,MAAM,cAAc,GAAI,UAAU,IAAI,CAAC,qBAAqB,EAAE,MAAM,CAAC,sBACxC,CAAC;AAErC,eAAO,MAAM,cAAc,GAAI,UAAU,IAAI,CAAC,qBAAqB,EAAE,MAAM,CAAC,sBACxC,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SolidDeletedAt = exports.SolidUpdatedAt = exports.SolidCreatedAt = void 0;
|
|
4
|
+
exports.SolidTimestamp = SolidTimestamp;
|
|
5
|
+
const solid_field_decorator_1 = require("./solid-field.decorator");
|
|
6
|
+
/**
|
|
7
|
+
* Decorator for timestamp fields (created, updated, deleted)
|
|
8
|
+
*/
|
|
9
|
+
function SolidTimestamp(type = 'created', options) {
|
|
10
|
+
return function (target, propertyKey) {
|
|
11
|
+
// Configuration for different timestamp types
|
|
12
|
+
const timestampConfig = {
|
|
13
|
+
created: {
|
|
14
|
+
description: 'Creation timestamp',
|
|
15
|
+
createdAt: true,
|
|
16
|
+
nullable: false,
|
|
17
|
+
},
|
|
18
|
+
updated: {
|
|
19
|
+
description: 'Last update timestamp',
|
|
20
|
+
updatedAt: true,
|
|
21
|
+
nullable: false,
|
|
22
|
+
},
|
|
23
|
+
deleted: {
|
|
24
|
+
description: 'Deletion timestamp (soft delete)',
|
|
25
|
+
deletedAt: true,
|
|
26
|
+
nullable: true,
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const config = timestampConfig[type];
|
|
30
|
+
const enhancedOptions = {
|
|
31
|
+
...options,
|
|
32
|
+
...config,
|
|
33
|
+
skip: ['validation'], // Timestamps don't need validation
|
|
34
|
+
adapters: {
|
|
35
|
+
...options?.adapters
|
|
36
|
+
// Individual adapters will handle timestamp-specific logic internally
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
return (0, solid_field_decorator_1.SolidField)(enhancedOptions)(target, propertyKey);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
// Convenience decorators
|
|
43
|
+
const SolidCreatedAt = (options) => SolidTimestamp('created', options);
|
|
44
|
+
exports.SolidCreatedAt = SolidCreatedAt;
|
|
45
|
+
const SolidUpdatedAt = (options) => SolidTimestamp('updated', options);
|
|
46
|
+
exports.SolidUpdatedAt = SolidUpdatedAt;
|
|
47
|
+
const SolidDeletedAt = (options) => SolidTimestamp('deleted', options);
|
|
48
|
+
exports.SolidDeletedAt = SolidDeletedAt;
|
|
49
|
+
//# sourceMappingURL=solid-timestamp.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solid-timestamp.decorator.js","sourceRoot":"","sources":["../../src/decorators/solid-timestamp.decorator.ts"],"names":[],"mappings":";;;AAYA,wCAsCC;AAjDD,mEAAqD;AAQrD;;GAEG;AACH,SAAgB,cAAc,CAC5B,OAAsB,SAAS,EAC/B,OAA+B;IAE/B,OAAO,UAAU,MAAW,EAAE,WAA4B;QACxD,8CAA8C;QAC9C,MAAM,eAAe,GAAG;YACtB,OAAO,EAAE;gBACP,WAAW,EAAE,oBAAoB;gBACjC,SAAS,EAAE,IAAI;gBACf,QAAQ,EAAE,KAAK;aAChB;YACD,OAAO,EAAE;gBACP,WAAW,EAAE,uBAAuB;gBACpC,SAAS,EAAE,IAAI;gBACf,QAAQ,EAAE,KAAK;aAChB;YACD,OAAO,EAAE;gBACP,WAAW,EAAE,kCAAkC;gBAC/C,SAAS,EAAE,IAAI;gBACf,QAAQ,EAAE,IAAI;aACf;SACF,CAAC;QAEF,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;QAErC,MAAM,eAAe,GAAsB;YACzC,GAAG,OAAO;YACV,GAAG,MAAM;YACT,IAAI,EAAE,CAAC,YAAY,CAAC,EAAE,mCAAmC;YACzD,QAAQ,EAAE;gBACR,GAAG,OAAO,EAAE,QAAQ;gBACpB,sEAAsE;aACvE;SACF,CAAC;QAEF,OAAO,IAAA,kCAAU,EAAC,eAAe,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAC1D,CAAC,CAAC;AACJ,CAAC;AAED,yBAAyB;AAClB,MAAM,cAAc,GAAG,CAAC,OAA6C,EAAE,EAAE,CAC9E,cAAc,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AADxB,QAAA,cAAc,kBACU;AAE9B,MAAM,cAAc,GAAG,CAAC,OAA6C,EAAE,EAAE,CAC9E,cAAc,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AADxB,QAAA,cAAc,kBACU;AAE9B,MAAM,cAAc,GAAG,CAAC,OAA6C,EAAE,EAAE,CAC9E,cAAc,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AADxB,QAAA,cAAc,kBACU"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enumeration of supported aggregate functions for database queries.
|
|
3
|
+
*
|
|
4
|
+
* @enum {string}
|
|
5
|
+
* @readonly
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* // Using aggregate functions in groupBy operations
|
|
10
|
+
* const aggregates = [
|
|
11
|
+
* { field: 'price', function: AggregateFunctionTypes.AVG },
|
|
12
|
+
* { field: 'id', function: AggregateFunctionTypes.COUNT }
|
|
13
|
+
* ];
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare enum AggregateFunctionTypes {
|
|
17
|
+
/**
|
|
18
|
+
* Count of non-null values
|
|
19
|
+
*/
|
|
20
|
+
COUNT = "COUNT",
|
|
21
|
+
/**
|
|
22
|
+
* Sum of numeric values
|
|
23
|
+
*/
|
|
24
|
+
SUM = "SUM",
|
|
25
|
+
/**
|
|
26
|
+
* Average of numeric values
|
|
27
|
+
*/
|
|
28
|
+
AVG = "AVG",
|
|
29
|
+
/**
|
|
30
|
+
* Minimum value
|
|
31
|
+
*/
|
|
32
|
+
MIN = "MIN",
|
|
33
|
+
/**
|
|
34
|
+
* Maximum value
|
|
35
|
+
*/
|
|
36
|
+
MAX = "MAX",
|
|
37
|
+
/**
|
|
38
|
+
* Count of distinct values
|
|
39
|
+
*/
|
|
40
|
+
COUNT_DISTINCT = "COUNT_DISTINCT"
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=aggregate-function.enum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregate-function.enum.d.ts","sourceRoot":"","sources":["../../src/enums/aggregate-function.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,oBAAY,sBAAsB;IAChC;;OAEG;IACH,KAAK,UAAU;IAEf;;OAEG;IACH,GAAG,QAAQ;IAEX;;OAEG;IACH,GAAG,QAAQ;IAEX;;OAEG;IACH,GAAG,QAAQ;IAEX;;OAEG;IACH,GAAG,QAAQ;IAEX;;OAEG;IACH,cAAc,mBAAmB;CAClC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AggregateFunctionTypes = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Enumeration of supported aggregate functions for database queries.
|
|
6
|
+
*
|
|
7
|
+
* @enum {string}
|
|
8
|
+
* @readonly
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* // Using aggregate functions in groupBy operations
|
|
13
|
+
* const aggregates = [
|
|
14
|
+
* { field: 'price', function: AggregateFunctionTypes.AVG },
|
|
15
|
+
* { field: 'id', function: AggregateFunctionTypes.COUNT }
|
|
16
|
+
* ];
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
var AggregateFunctionTypes;
|
|
20
|
+
(function (AggregateFunctionTypes) {
|
|
21
|
+
/**
|
|
22
|
+
* Count of non-null values
|
|
23
|
+
*/
|
|
24
|
+
AggregateFunctionTypes["COUNT"] = "COUNT";
|
|
25
|
+
/**
|
|
26
|
+
* Sum of numeric values
|
|
27
|
+
*/
|
|
28
|
+
AggregateFunctionTypes["SUM"] = "SUM";
|
|
29
|
+
/**
|
|
30
|
+
* Average of numeric values
|
|
31
|
+
*/
|
|
32
|
+
AggregateFunctionTypes["AVG"] = "AVG";
|
|
33
|
+
/**
|
|
34
|
+
* Minimum value
|
|
35
|
+
*/
|
|
36
|
+
AggregateFunctionTypes["MIN"] = "MIN";
|
|
37
|
+
/**
|
|
38
|
+
* Maximum value
|
|
39
|
+
*/
|
|
40
|
+
AggregateFunctionTypes["MAX"] = "MAX";
|
|
41
|
+
/**
|
|
42
|
+
* Count of distinct values
|
|
43
|
+
*/
|
|
44
|
+
AggregateFunctionTypes["COUNT_DISTINCT"] = "COUNT_DISTINCT";
|
|
45
|
+
})(AggregateFunctionTypes || (exports.AggregateFunctionTypes = AggregateFunctionTypes = {}));
|
|
46
|
+
//# sourceMappingURL=aggregate-function.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregate-function.enum.js","sourceRoot":"","sources":["../../src/enums/aggregate-function.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,IAAY,sBA8BX;AA9BD,WAAY,sBAAsB;IAChC;;OAEG;IACH,yCAAe,CAAA;IAEf;;OAEG;IACH,qCAAW,CAAA;IAEX;;OAEG;IACH,qCAAW,CAAA;IAEX;;OAEG;IACH,qCAAW,CAAA;IAEX;;OAEG;IACH,qCAAW,CAAA;IAEX;;OAEG;IACH,2DAAiC,CAAA;AACnC,CAAC,EA9BW,sBAAsB,sCAAtB,sBAAsB,QA8BjC"}
|
package/dist/enums/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/enums/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/enums/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC"}
|
package/dist/enums/index.js
CHANGED
|
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./standard-actions.enum"), exports);
|
|
18
18
|
__exportStar(require("./order-by-type.enum"), exports);
|
|
19
|
+
__exportStar(require("./aggregate-function.enum"), exports);
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
package/dist/enums/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/enums/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC;AACxC,uDAAqC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/enums/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC;AACxC,uDAAqC;AACrC,4DAA0C"}
|