@quanticjs/core 2.1.0 → 3.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.
@@ -10,9 +10,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.QuanticCoreModule = void 0;
11
11
  const common_1 = require("@nestjs/common");
12
12
  const cqrs_1 = require("@nestjs/cqrs");
13
+ const core_1 = require("@nestjs/core");
14
+ const BehaviorRegistry_1 = require("./cqrs/pipeline/BehaviorRegistry");
13
15
  const QuanticCommandBus_1 = require("./cqrs/pipeline/QuanticCommandBus");
14
16
  const QuanticQueryBus_1 = require("./cqrs/pipeline/QuanticQueryBus");
15
- const types_1 = require("./cqrs/pipeline/types");
16
17
  const LogBehavior_1 = require("./cqrs/behaviors/LogBehavior");
17
18
  const ValidationBehavior_1 = require("./cqrs/behaviors/ValidationBehavior");
18
19
  const TransactionalBehavior_1 = require("./cqrs/behaviors/TransactionalBehavior");
@@ -21,14 +22,12 @@ let QuanticCoreModule = QuanticCoreModule_1 = class QuanticCoreModule {
21
22
  static forRoot() {
22
23
  return {
23
24
  module: QuanticCoreModule_1,
24
- imports: [cqrs_1.CqrsModule.forRoot()],
25
+ imports: [cqrs_1.CqrsModule.forRoot(), core_1.DiscoveryModule],
25
26
  providers: [
26
27
  LogBehavior_1.LogBehavior,
27
- { provide: types_1.PIPELINE_BEHAVIOR, useExisting: LogBehavior_1.LogBehavior, multi: true },
28
28
  ValidationBehavior_1.ValidationBehavior,
29
- { provide: types_1.PIPELINE_BEHAVIOR, useExisting: ValidationBehavior_1.ValidationBehavior, multi: true },
30
29
  TransactionalBehavior_1.TransactionalBehavior,
31
- { provide: types_1.PIPELINE_BEHAVIOR, useExisting: TransactionalBehavior_1.TransactionalBehavior, multi: true },
30
+ BehaviorRegistry_1.BehaviorRegistry,
32
31
  QuanticCommandBus_1.QuanticCommandBus,
33
32
  QuanticQueryBus_1.QuanticQueryBus,
34
33
  GracefulShutdownService_1.GracefulShutdownService,
@@ -38,10 +37,10 @@ let QuanticCoreModule = QuanticCoreModule_1 = class QuanticCoreModule {
38
37
  LogBehavior_1.LogBehavior,
39
38
  ValidationBehavior_1.ValidationBehavior,
40
39
  TransactionalBehavior_1.TransactionalBehavior,
40
+ BehaviorRegistry_1.BehaviorRegistry,
41
41
  QuanticCommandBus_1.QuanticCommandBus,
42
42
  QuanticQueryBus_1.QuanticQueryBus,
43
43
  GracefulShutdownService_1.GracefulShutdownService,
44
- types_1.PIPELINE_BEHAVIOR,
45
44
  ],
46
45
  };
47
46
  }
@@ -1,8 +1,6 @@
1
1
  import { Result } from '../../result/Result';
2
- import { PipelineBehavior, PipelineScope } from '../pipeline/types';
2
+ import { PipelineBehavior } from '../pipeline/types';
3
3
  export declare class LogBehavior implements PipelineBehavior {
4
- readonly order: 10;
5
- readonly scope: PipelineScope;
6
4
  private readonly logger;
7
5
  execute<T>(command: object, next: () => Promise<Result<T>>): Promise<Result<T>>;
8
6
  private maskPayload;
@@ -11,13 +11,12 @@ const common_1 = require("@nestjs/common");
11
11
  const Result_1 = require("../../result/Result");
12
12
  const CorrelationStore_1 = require("../../middleware/CorrelationStore");
13
13
  const behavior_order_1 = require("../pipeline/behavior-order");
14
+ const Behavior_decorator_1 = require("../decorators/Behavior.decorator");
14
15
  const PII_FIELDS = new Set(['email', 'githubAccessToken', 'accessToken', 'token', 'secretKey', 'password']);
15
16
  const MAX_STRING_LENGTH = 200;
16
17
  const MAX_ARRAY_LENGTH = 5;
17
18
  const MAX_DEPTH = 2;
18
19
  let LogBehavior = class LogBehavior {
19
- order = behavior_order_1.BehaviorOrder.LOG;
20
- scope = 'both';
21
20
  logger = new common_1.Logger('PipelineBehavior');
22
21
  async execute(command, next) {
23
22
  const commandName = command.constructor.name;
@@ -124,5 +123,6 @@ let LogBehavior = class LogBehavior {
124
123
  };
125
124
  exports.LogBehavior = LogBehavior;
126
125
  exports.LogBehavior = LogBehavior = __decorate([
127
- (0, common_1.Injectable)()
126
+ (0, common_1.Injectable)(),
127
+ (0, Behavior_decorator_1.Behavior)({ order: behavior_order_1.BehaviorOrder.LOG, scope: 'both' })
128
128
  ], LogBehavior);
@@ -1,10 +1,8 @@
1
1
  import { DataSource } from 'typeorm';
2
2
  import { Result } from '../../result/Result';
3
- import { PipelineBehavior, PipelineScope } from '../pipeline/types';
3
+ import { PipelineBehavior } from '../pipeline/types';
4
4
  export declare class TransactionalBehavior implements PipelineBehavior {
5
5
  private readonly dataSource?;
6
- readonly order: 80;
7
- readonly scope: PipelineScope;
8
6
  private readonly logger;
9
7
  constructor(dataSource?: DataSource | undefined);
10
8
  execute<T>(command: object, next: () => Promise<Result<T>>): Promise<Result<T>>;
@@ -20,10 +20,9 @@ const Result_1 = require("../../result/Result");
20
20
  const TransactionContext_1 = require("../transaction/TransactionContext");
21
21
  const IsolatedTransaction_decorator_1 = require("../decorators/IsolatedTransaction.decorator");
22
22
  const behavior_order_1 = require("../pipeline/behavior-order");
23
+ const Behavior_decorator_1 = require("../decorators/Behavior.decorator");
23
24
  let TransactionalBehavior = TransactionalBehavior_1 = class TransactionalBehavior {
24
25
  dataSource;
25
- order = behavior_order_1.BehaviorOrder.TRANSACTIONAL;
26
- scope = 'command';
27
26
  logger = new common_1.Logger(TransactionalBehavior_1.name);
28
27
  constructor(dataSource) {
29
28
  this.dataSource = dataSource;
@@ -63,6 +62,7 @@ let TransactionalBehavior = TransactionalBehavior_1 = class TransactionalBehavio
63
62
  exports.TransactionalBehavior = TransactionalBehavior;
64
63
  exports.TransactionalBehavior = TransactionalBehavior = TransactionalBehavior_1 = __decorate([
65
64
  (0, common_1.Injectable)(),
65
+ (0, Behavior_decorator_1.Behavior)({ order: behavior_order_1.BehaviorOrder.TRANSACTIONAL, scope: 'command' }),
66
66
  __param(0, (0, common_1.Optional)()),
67
67
  __metadata("design:paramtypes", [typeorm_1.DataSource])
68
68
  ], TransactionalBehavior);
@@ -1,7 +1,5 @@
1
1
  import { Result } from '../../result/Result';
2
- import { PipelineBehavior, PipelineScope } from '../pipeline/types';
2
+ import { PipelineBehavior } from '../pipeline/types';
3
3
  export declare class ValidationBehavior implements PipelineBehavior {
4
- readonly order: 40;
5
- readonly scope: PipelineScope;
6
4
  execute<T>(command: object, next: () => Promise<Result<T>>): Promise<Result<T>>;
7
5
  }
@@ -11,9 +11,8 @@ const common_1 = require("@nestjs/common");
11
11
  const Validate_decorator_1 = require("../decorators/Validate.decorator");
12
12
  const Result_1 = require("../../result/Result");
13
13
  const behavior_order_1 = require("../pipeline/behavior-order");
14
+ const Behavior_decorator_1 = require("../decorators/Behavior.decorator");
14
15
  let ValidationBehavior = class ValidationBehavior {
15
- order = behavior_order_1.BehaviorOrder.VALIDATE;
16
- scope = 'both';
17
16
  async execute(command, next) {
18
17
  if (!(0, Validate_decorator_1.shouldValidate)(command.constructor)) {
19
18
  return next();
@@ -32,5 +31,6 @@ let ValidationBehavior = class ValidationBehavior {
32
31
  };
33
32
  exports.ValidationBehavior = ValidationBehavior;
34
33
  exports.ValidationBehavior = ValidationBehavior = __decorate([
35
- (0, common_1.Injectable)()
34
+ (0, common_1.Injectable)(),
35
+ (0, Behavior_decorator_1.Behavior)({ order: behavior_order_1.BehaviorOrder.VALIDATE, scope: 'both' })
36
36
  ], ValidationBehavior);
@@ -0,0 +1,10 @@
1
+ import 'reflect-metadata';
2
+ import { PipelineScope } from '../pipeline/types';
3
+ declare const BEHAVIOR_METADATA_KEY = "quanticjs:pipeline-behavior";
4
+ export interface BehaviorOptions {
5
+ order: number;
6
+ scope: PipelineScope;
7
+ }
8
+ export declare function Behavior(options: BehaviorOptions): ClassDecorator;
9
+ export declare function getBehaviorMetadata(target: object): BehaviorOptions | undefined;
10
+ export { BEHAVIOR_METADATA_KEY };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BEHAVIOR_METADATA_KEY = void 0;
4
+ exports.Behavior = Behavior;
5
+ exports.getBehaviorMetadata = getBehaviorMetadata;
6
+ require("reflect-metadata");
7
+ const BEHAVIOR_METADATA_KEY = 'quanticjs:pipeline-behavior';
8
+ exports.BEHAVIOR_METADATA_KEY = BEHAVIOR_METADATA_KEY;
9
+ function Behavior(options) {
10
+ return (target) => {
11
+ Reflect.defineMetadata(BEHAVIOR_METADATA_KEY, options, target);
12
+ };
13
+ }
14
+ function getBehaviorMetadata(target) {
15
+ return Reflect.getMetadata(BEHAVIOR_METADATA_KEY, target);
16
+ }
@@ -0,0 +1,13 @@
1
+ import { OnModuleInit } from '@nestjs/common';
2
+ import { DiscoveryService } from '@nestjs/core';
3
+ import { BehaviorFn } from './runPipeline';
4
+ export declare class BehaviorRegistry implements OnModuleInit {
5
+ private readonly discovery;
6
+ private readonly logger;
7
+ private commandBehaviors;
8
+ private queryBehaviors;
9
+ constructor(discovery: DiscoveryService);
10
+ onModuleInit(): void;
11
+ getCommandBehaviors(): BehaviorFn[];
12
+ getQueryBehaviors(): BehaviorFn[];
13
+ }
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var BehaviorRegistry_1;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.BehaviorRegistry = void 0;
14
+ const common_1 = require("@nestjs/common");
15
+ const core_1 = require("@nestjs/core");
16
+ const Behavior_decorator_1 = require("../decorators/Behavior.decorator");
17
+ let BehaviorRegistry = BehaviorRegistry_1 = class BehaviorRegistry {
18
+ discovery;
19
+ logger = new common_1.Logger(BehaviorRegistry_1.name);
20
+ commandBehaviors = [];
21
+ queryBehaviors = [];
22
+ constructor(discovery) {
23
+ this.discovery = discovery;
24
+ }
25
+ onModuleInit() {
26
+ const providers = this.discovery.getProviders();
27
+ const entries = [];
28
+ for (const wrapper of providers) {
29
+ const { metatype, instance } = wrapper;
30
+ if (!metatype || !instance)
31
+ continue;
32
+ const metadata = (0, Behavior_decorator_1.getBehaviorMetadata)(metatype);
33
+ if (!metadata)
34
+ continue;
35
+ if (typeof instance.execute !== 'function') {
36
+ this.logger.warn(`${metatype.name} has @Behavior() but no execute() method`);
37
+ continue;
38
+ }
39
+ entries.push({ metadata, instance, name: metatype.name });
40
+ }
41
+ entries.sort((a, b) => a.metadata.order - b.metadata.order);
42
+ this.commandBehaviors = entries
43
+ .filter((e) => e.metadata.scope !== 'query')
44
+ .map((e) => (cmd, next) => e.instance.execute(cmd, next));
45
+ this.queryBehaviors = entries
46
+ .filter((e) => e.metadata.scope !== 'command')
47
+ .map((e) => (cmd, next) => e.instance.execute(cmd, next));
48
+ const names = entries.map((e) => `${e.name}(${e.metadata.order})`).join(', ');
49
+ this.logger.log(`Discovered ${entries.length} behaviors: ${names}`);
50
+ }
51
+ getCommandBehaviors() {
52
+ return this.commandBehaviors;
53
+ }
54
+ getQueryBehaviors() {
55
+ return this.queryBehaviors;
56
+ }
57
+ };
58
+ exports.BehaviorRegistry = BehaviorRegistry;
59
+ exports.BehaviorRegistry = BehaviorRegistry = BehaviorRegistry_1 = __decorate([
60
+ (0, common_1.Injectable)(),
61
+ __metadata("design:paramtypes", [core_1.DiscoveryService])
62
+ ], BehaviorRegistry);
@@ -1,12 +1,12 @@
1
1
  import { OnModuleInit } from '@nestjs/common';
2
2
  import { CommandBus } from '@nestjs/cqrs';
3
- import { PipelineBehavior } from './types';
3
+ import { BehaviorRegistry } from './BehaviorRegistry';
4
4
  export declare class QuanticCommandBus implements OnModuleInit {
5
5
  private readonly commandBus;
6
- private readonly allBehaviors?;
6
+ private readonly registry;
7
7
  private readonly logger;
8
8
  private behaviors;
9
9
  private originalExecute;
10
- constructor(commandBus: CommandBus, allBehaviors?: PipelineBehavior[] | undefined);
10
+ constructor(commandBus: CommandBus, registry: BehaviorRegistry);
11
11
  onModuleInit(): void;
12
12
  }
@@ -8,31 +8,25 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
13
- };
14
11
  var QuanticCommandBus_1;
15
12
  Object.defineProperty(exports, "__esModule", { value: true });
16
13
  exports.QuanticCommandBus = void 0;
17
14
  const common_1 = require("@nestjs/common");
18
15
  const cqrs_1 = require("@nestjs/cqrs");
19
16
  const runPipeline_1 = require("./runPipeline");
20
- const types_1 = require("./types");
17
+ const BehaviorRegistry_1 = require("./BehaviorRegistry");
21
18
  let QuanticCommandBus = QuanticCommandBus_1 = class QuanticCommandBus {
22
19
  commandBus;
23
- allBehaviors;
20
+ registry;
24
21
  logger = new common_1.Logger(QuanticCommandBus_1.name);
25
22
  behaviors = [];
26
23
  originalExecute;
27
- constructor(commandBus, allBehaviors) {
24
+ constructor(commandBus, registry) {
28
25
  this.commandBus = commandBus;
29
- this.allBehaviors = allBehaviors;
26
+ this.registry = registry;
30
27
  }
31
28
  onModuleInit() {
32
- this.behaviors = (this.allBehaviors ?? [])
33
- .filter((b) => b.scope !== 'query')
34
- .sort((a, b) => a.order - b.order)
35
- .map((b) => (cmd, next) => b.execute(cmd, next));
29
+ this.behaviors = this.registry.getCommandBehaviors();
36
30
  this.originalExecute = this.commandBus.execute.bind(this.commandBus);
37
31
  const self = this;
38
32
  this.commandBus.execute = (command) => {
@@ -45,7 +39,6 @@ let QuanticCommandBus = QuanticCommandBus_1 = class QuanticCommandBus {
45
39
  exports.QuanticCommandBus = QuanticCommandBus;
46
40
  exports.QuanticCommandBus = QuanticCommandBus = QuanticCommandBus_1 = __decorate([
47
41
  (0, common_1.Injectable)(),
48
- __param(1, (0, common_1.Optional)()),
49
- __param(1, (0, common_1.Inject)(types_1.PIPELINE_BEHAVIOR)),
50
- __metadata("design:paramtypes", [cqrs_1.CommandBus, Array])
42
+ __metadata("design:paramtypes", [cqrs_1.CommandBus,
43
+ BehaviorRegistry_1.BehaviorRegistry])
51
44
  ], QuanticCommandBus);
@@ -1,12 +1,12 @@
1
1
  import { OnModuleInit } from '@nestjs/common';
2
2
  import { QueryBus } from '@nestjs/cqrs';
3
- import { PipelineBehavior } from './types';
3
+ import { BehaviorRegistry } from './BehaviorRegistry';
4
4
  export declare class QuanticQueryBus implements OnModuleInit {
5
5
  private readonly queryBus;
6
- private readonly allBehaviors?;
6
+ private readonly registry;
7
7
  private readonly logger;
8
8
  private behaviors;
9
9
  private originalExecute;
10
- constructor(queryBus: QueryBus, allBehaviors?: PipelineBehavior[] | undefined);
10
+ constructor(queryBus: QueryBus, registry: BehaviorRegistry);
11
11
  onModuleInit(): void;
12
12
  }
@@ -8,31 +8,25 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
13
- };
14
11
  var QuanticQueryBus_1;
15
12
  Object.defineProperty(exports, "__esModule", { value: true });
16
13
  exports.QuanticQueryBus = void 0;
17
14
  const common_1 = require("@nestjs/common");
18
15
  const cqrs_1 = require("@nestjs/cqrs");
19
16
  const runPipeline_1 = require("./runPipeline");
20
- const types_1 = require("./types");
17
+ const BehaviorRegistry_1 = require("./BehaviorRegistry");
21
18
  let QuanticQueryBus = QuanticQueryBus_1 = class QuanticQueryBus {
22
19
  queryBus;
23
- allBehaviors;
20
+ registry;
24
21
  logger = new common_1.Logger(QuanticQueryBus_1.name);
25
22
  behaviors = [];
26
23
  originalExecute;
27
- constructor(queryBus, allBehaviors) {
24
+ constructor(queryBus, registry) {
28
25
  this.queryBus = queryBus;
29
- this.allBehaviors = allBehaviors;
26
+ this.registry = registry;
30
27
  }
31
28
  onModuleInit() {
32
- this.behaviors = (this.allBehaviors ?? [])
33
- .filter((b) => b.scope !== 'command')
34
- .sort((a, b) => a.order - b.order)
35
- .map((b) => (cmd, next) => b.execute(cmd, next));
29
+ this.behaviors = this.registry.getQueryBehaviors();
36
30
  this.originalExecute = this.queryBus.execute.bind(this.queryBus);
37
31
  const self = this;
38
32
  this.queryBus.execute = (query) => {
@@ -45,7 +39,6 @@ let QuanticQueryBus = QuanticQueryBus_1 = class QuanticQueryBus {
45
39
  exports.QuanticQueryBus = QuanticQueryBus;
46
40
  exports.QuanticQueryBus = QuanticQueryBus = QuanticQueryBus_1 = __decorate([
47
41
  (0, common_1.Injectable)(),
48
- __param(1, (0, common_1.Optional)()),
49
- __param(1, (0, common_1.Inject)(types_1.PIPELINE_BEHAVIOR)),
50
- __metadata("design:paramtypes", [cqrs_1.QueryBus, Array])
42
+ __metadata("design:paramtypes", [cqrs_1.QueryBus,
43
+ BehaviorRegistry_1.BehaviorRegistry])
51
44
  ], QuanticQueryBus);
@@ -1,8 +1,5 @@
1
1
  import { Result } from '../../result/Result';
2
- export declare const PIPELINE_BEHAVIOR: unique symbol;
3
2
  export type PipelineScope = 'command' | 'query' | 'both';
4
3
  export interface PipelineBehavior {
5
- readonly order: number;
6
- readonly scope: PipelineScope;
7
4
  execute<T>(command: object, next: () => Promise<Result<T>>): Promise<Result<T>>;
8
5
  }
@@ -1,4 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PIPELINE_BEHAVIOR = void 0;
4
- exports.PIPELINE_BEHAVIOR = Symbol('PIPELINE_BEHAVIOR');
package/dist/index.d.ts CHANGED
@@ -19,9 +19,11 @@ export { bootstrapService } from './bootstrap/bootstrapService';
19
19
  export type { BootstrapOptions } from './bootstrap/bootstrapService';
20
20
  export { createPinoConfig } from './logging/pino-config';
21
21
  export { REDIS_CLIENT } from './cqrs/constants';
22
- export { PIPELINE_BEHAVIOR } from './cqrs/pipeline/types';
23
22
  export type { PipelineBehavior, PipelineScope } from './cqrs/pipeline/types';
24
23
  export { BehaviorOrder } from './cqrs/pipeline/behavior-order';
24
+ export { Behavior, getBehaviorMetadata } from './cqrs/decorators/Behavior.decorator';
25
+ export type { BehaviorOptions } from './cqrs/decorators/Behavior.decorator';
26
+ export { BehaviorRegistry } from './cqrs/pipeline/BehaviorRegistry';
25
27
  export { FeatureFlag, getFeatureFlagMetadata } from './cqrs/decorators/FeatureFlag.decorator';
26
28
  export type { FeatureFlagOptions } from './cqrs/decorators/FeatureFlag.decorator';
27
29
  export { Log, getLogMetadata } from './cqrs/decorators/Log.decorator';
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QuanticCoreModule = exports.GracefulShutdownService = exports.QuanticQueryBus = exports.QuanticCommandBus = exports.TransactionalBehavior = exports.ValidationBehavior = exports.LogBehavior = exports.getTransactionalRepo = exports.TransactionContext = exports.WORKFLOW_ENGINE = exports.validateCommand = exports.getWorkflowMetadata = exports.Workflow = exports.isIsolatedTransaction = exports.IsolatedTransaction = exports.getDistributedLockMetadata = exports.DistributedLock = exports.getInvalidateCacheMetadata = exports.InvalidateCache = exports.getCacheMetadata = exports.Cache = exports.getValidatorClass = exports.shouldValidate = exports.Validate = exports.getLogMetadata = exports.Log = exports.getFeatureFlagMetadata = exports.FeatureFlag = exports.BehaviorOrder = exports.PIPELINE_BEHAVIOR = exports.REDIS_CLIENT = exports.createPinoConfig = exports.bootstrapService = exports.createCircuitBreaker = exports.TenantSubscriber = exports.Roles = exports.RolesGuard = exports.JwtStrategy = exports.Public = exports.JwtAuthGuard = exports.ResultInterceptor = exports.GlobalExceptionFilter = exports.tenantStore = exports.TenantContextMiddleware = exports.correlationStore = exports.CorrelationIdMiddleware = exports.TenantBaseEntity = exports.BaseEntity = exports.ErrorType = exports.Result = void 0;
4
- exports.createMockRedisClient = exports.createMockRepository = void 0;
3
+ exports.QuanticQueryBus = exports.QuanticCommandBus = exports.TransactionalBehavior = exports.ValidationBehavior = exports.LogBehavior = exports.getTransactionalRepo = exports.TransactionContext = exports.WORKFLOW_ENGINE = exports.validateCommand = exports.getWorkflowMetadata = exports.Workflow = exports.isIsolatedTransaction = exports.IsolatedTransaction = exports.getDistributedLockMetadata = exports.DistributedLock = exports.getInvalidateCacheMetadata = exports.InvalidateCache = exports.getCacheMetadata = exports.Cache = exports.getValidatorClass = exports.shouldValidate = exports.Validate = exports.getLogMetadata = exports.Log = exports.getFeatureFlagMetadata = exports.FeatureFlag = exports.BehaviorRegistry = exports.getBehaviorMetadata = exports.Behavior = exports.BehaviorOrder = exports.REDIS_CLIENT = exports.createPinoConfig = exports.bootstrapService = exports.createCircuitBreaker = exports.TenantSubscriber = exports.Roles = exports.RolesGuard = exports.JwtStrategy = exports.Public = exports.JwtAuthGuard = exports.ResultInterceptor = exports.GlobalExceptionFilter = exports.tenantStore = exports.TenantContextMiddleware = exports.correlationStore = exports.CorrelationIdMiddleware = exports.TenantBaseEntity = exports.BaseEntity = exports.ErrorType = exports.Result = void 0;
4
+ exports.createMockRedisClient = exports.createMockRepository = exports.QuanticCoreModule = exports.GracefulShutdownService = void 0;
5
5
  // Result
6
6
  var Result_1 = require("./result/Result");
7
7
  Object.defineProperty(exports, "Result", { enumerable: true, get: function () { return Result_1.Result; } });
@@ -50,11 +50,13 @@ Object.defineProperty(exports, "createPinoConfig", { enumerable: true, get: func
50
50
  // CQRS Constants
51
51
  var constants_1 = require("./cqrs/constants");
52
52
  Object.defineProperty(exports, "REDIS_CLIENT", { enumerable: true, get: function () { return constants_1.REDIS_CLIENT; } });
53
- // Pipeline types (new in v2)
54
- var types_1 = require("./cqrs/pipeline/types");
55
- Object.defineProperty(exports, "PIPELINE_BEHAVIOR", { enumerable: true, get: function () { return types_1.PIPELINE_BEHAVIOR; } });
56
53
  var behavior_order_1 = require("./cqrs/pipeline/behavior-order");
57
54
  Object.defineProperty(exports, "BehaviorOrder", { enumerable: true, get: function () { return behavior_order_1.BehaviorOrder; } });
55
+ var Behavior_decorator_1 = require("./cqrs/decorators/Behavior.decorator");
56
+ Object.defineProperty(exports, "Behavior", { enumerable: true, get: function () { return Behavior_decorator_1.Behavior; } });
57
+ Object.defineProperty(exports, "getBehaviorMetadata", { enumerable: true, get: function () { return Behavior_decorator_1.getBehaviorMetadata; } });
58
+ var BehaviorRegistry_1 = require("./cqrs/pipeline/BehaviorRegistry");
59
+ Object.defineProperty(exports, "BehaviorRegistry", { enumerable: true, get: function () { return BehaviorRegistry_1.BehaviorRegistry; } });
58
60
  // CQRS Decorators
59
61
  var FeatureFlag_decorator_1 = require("./cqrs/decorators/FeatureFlag.decorator");
60
62
  Object.defineProperty(exports, "FeatureFlag", { enumerable: true, get: function () { return FeatureFlag_decorator_1.FeatureFlag; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quanticjs/core",
3
- "version": "2.1.0",
3
+ "version": "3.1.0",
4
4
  "description": "NestJS CQRS framework — Result<T>, pipeline behaviors, base entities, middleware, guards",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",