@quanticjs/core 1.1.1 → 2.0.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/QuanticCoreModule.d.ts +4 -0
- package/dist/QuanticCoreModule.js +53 -0
- package/dist/cqrs/behaviors/LogBehavior.d.ts +4 -1
- package/dist/cqrs/behaviors/LogBehavior.js +3 -0
- package/dist/cqrs/behaviors/TransactionalBehavior.d.ts +4 -11
- package/dist/cqrs/behaviors/TransactionalBehavior.js +3 -12
- package/dist/cqrs/behaviors/ValidationBehavior.d.ts +4 -1
- package/dist/cqrs/behaviors/ValidationBehavior.js +3 -0
- package/dist/cqrs/pipeline/QuanticCommandBus.d.ts +3 -28
- package/dist/cqrs/pipeline/QuanticCommandBus.js +11 -59
- package/dist/cqrs/pipeline/QuanticQueryBus.d.ts +3 -19
- package/dist/cqrs/pipeline/QuanticQueryBus.js +11 -38
- package/dist/cqrs/pipeline/behavior-order.d.ts +11 -0
- package/dist/cqrs/pipeline/behavior-order.js +14 -0
- package/dist/cqrs/pipeline/types.d.ts +8 -0
- package/dist/cqrs/pipeline/types.js +4 -0
- package/dist/index.d.ts +6 -22
- package/dist/index.js +13 -44
- package/package.json +26 -80
- package/dist/cqrs/PipelineExecutor.d.ts +0 -31
- package/dist/cqrs/PipelineExecutor.js +0 -81
- package/dist/cqrs/behaviors/CacheBehavior.d.ts +0 -9
- package/dist/cqrs/behaviors/CacheBehavior.js +0 -68
- package/dist/cqrs/behaviors/DistributedLockBehavior.d.ts +0 -12
- package/dist/cqrs/behaviors/DistributedLockBehavior.js +0 -90
- package/dist/cqrs/behaviors/FeatureFlagBehavior.d.ts +0 -8
- package/dist/cqrs/behaviors/FeatureFlagBehavior.js +0 -58
- package/dist/cqrs/behaviors/InvalidateCacheBehavior.d.ts +0 -9
- package/dist/cqrs/behaviors/InvalidateCacheBehavior.js +0 -61
- package/dist/cqrs/behaviors/PerformanceBehavior.d.ts +0 -12
- package/dist/cqrs/behaviors/PerformanceBehavior.js +0 -56
- package/dist/cqrs/behaviors/WorkflowBehavior.d.ts +0 -8
- package/dist/cqrs/behaviors/WorkflowBehavior.js +0 -61
- package/dist/events/DomainEvent.d.ts +0 -14
- package/dist/events/DomainEvent.js +0 -27
- package/dist/events/OutboxEvent.entity.d.ts +0 -18
- package/dist/events/OutboxEvent.entity.js +0 -87
- package/dist/events/OutboxPublisherService.d.ts +0 -14
- package/dist/events/OutboxPublisherService.js +0 -104
- package/dist/events/RedisStreamConsumer.d.ts +0 -43
- package/dist/events/RedisStreamConsumer.js +0 -158
- package/dist/events/RedisStreamPublisher.d.ts +0 -9
- package/dist/events/RedisStreamPublisher.js +0 -60
- package/dist/metrics/MetricsController.d.ts +0 -7
- package/dist/metrics/MetricsController.js +0 -42
- package/dist/metrics/MetricsService.d.ts +0 -13
- package/dist/metrics/MetricsService.js +0 -58
- package/dist/redis/redis.module.d.ts +0 -8
- package/dist/redis/redis.module.js +0 -49
- package/dist/shared-kernel.module.d.ts +0 -13
- package/dist/shared-kernel.module.js +0 -87
- package/dist/testing/TestingModuleFactory.d.ts +0 -23
- package/dist/testing/TestingModuleFactory.js +0 -63
- package/dist/testing/index.d.ts +0 -2
- package/dist/testing/index.js +0 -7
- package/dist/unleash/initial-flags.d.ts +0 -7
- package/dist/unleash/initial-flags.js +0 -9
- package/dist/unleash/unleash.module.d.ts +0 -9
- package/dist/unleash/unleash.module.js +0 -47
- package/src/bootstrap/bootstrapService.ts +0 -72
- package/src/cqrs/behaviors/CacheBehavior.spec.ts +0 -63
- package/src/cqrs/behaviors/CacheBehavior.ts +0 -54
- package/src/cqrs/behaviors/DistributedLockBehavior.ts +0 -88
- package/src/cqrs/behaviors/FeatureFlagBehavior.ts +0 -46
- package/src/cqrs/behaviors/InvalidateCacheBehavior.spec.ts +0 -89
- package/src/cqrs/behaviors/InvalidateCacheBehavior.ts +0 -50
- package/src/cqrs/behaviors/LogBehavior.spec.ts +0 -55
- package/src/cqrs/behaviors/LogBehavior.ts +0 -121
- package/src/cqrs/behaviors/PerformanceBehavior.spec.ts +0 -48
- package/src/cqrs/behaviors/PerformanceBehavior.ts +0 -43
- package/src/cqrs/behaviors/TransactionalBehavior.ts +0 -64
- package/src/cqrs/behaviors/ValidationBehavior.spec.ts +0 -114
- package/src/cqrs/behaviors/ValidationBehavior.ts +0 -29
- package/src/cqrs/behaviors/WorkflowBehavior.spec.ts +0 -97
- package/src/cqrs/behaviors/WorkflowBehavior.ts +0 -62
- package/src/cqrs/constants.ts +0 -2
- package/src/cqrs/decorators/Cache.decorator.ts +0 -24
- package/src/cqrs/decorators/DistributedLock.decorator.ts +0 -34
- package/src/cqrs/decorators/FeatureFlag.decorator.ts +0 -23
- package/src/cqrs/decorators/InvalidateCache.decorator.spec.ts +0 -20
- package/src/cqrs/decorators/InvalidateCache.decorator.ts +0 -17
- package/src/cqrs/decorators/IsolatedTransaction.decorator.ts +0 -24
- package/src/cqrs/decorators/Log.decorator.ts +0 -22
- package/src/cqrs/decorators/Validate.decorator.ts +0 -39
- package/src/cqrs/decorators/Workflow.decorator.ts +0 -22
- package/src/cqrs/interfaces/WorkflowEngine.ts +0 -19
- package/src/cqrs/pipeline/QuanticCommandBus.ts +0 -69
- package/src/cqrs/pipeline/QuanticQueryBus.ts +0 -56
- package/src/cqrs/pipeline/runPipeline.ts +0 -22
- package/src/cqrs/transaction/TransactionContext.ts +0 -26
- package/src/cqrs/transaction/getTransactionalRepo.ts +0 -23
- package/src/cqrs/validation/ICommandValidator.ts +0 -55
- package/src/entities/BaseEntity.ts +0 -16
- package/src/entities/TenantBaseEntity.ts +0 -7
- package/src/events/DomainEvent.ts +0 -27
- package/src/events/OutboxEvent.entity.ts +0 -56
- package/src/events/OutboxPublisherService.ts +0 -94
- package/src/events/RedisStreamConsumer.ts +0 -172
- package/src/events/RedisStreamPublisher.ts +0 -54
- package/src/filters/GlobalExceptionFilter.ts +0 -125
- package/src/guards/JwtAuthGuard.ts +0 -29
- package/src/guards/JwtStrategy.ts +0 -41
- package/src/guards/RolesGuard.ts +0 -39
- package/src/index.ts +0 -118
- package/src/interceptors/ResultInterceptor.ts +0 -93
- package/src/lifecycle/GracefulShutdownService.ts +0 -77
- package/src/logging/pino-config.ts +0 -80
- package/src/metrics/MetricsController.ts +0 -17
- package/src/metrics/MetricsService.ts +0 -55
- package/src/middleware/CorrelationIdMiddleware.ts +0 -27
- package/src/middleware/CorrelationStore.ts +0 -13
- package/src/middleware/TenantContextMiddleware.ts +0 -21
- package/src/middleware/TenantStore.ts +0 -11
- package/src/redis/redis.module.ts +0 -41
- package/src/resilience/CircuitBreakerFactory.ts +0 -33
- package/src/result/Result.ts +0 -66
- package/src/shared-kernel.module.ts +0 -87
- package/src/subscribers/TenantSubscriber.ts +0 -47
- package/src/testing/TestingModuleFactory.ts +0 -78
- package/src/testing/index.ts +0 -2
- package/src/testing/mocks.ts +0 -59
- package/src/unleash/unleash.module.ts +0 -45
- package/tsconfig.json +0 -22
|
@@ -0,0 +1,53 @@
|
|
|
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 QuanticCoreModule_1;
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.QuanticCoreModule = void 0;
|
|
11
|
+
const common_1 = require("@nestjs/common");
|
|
12
|
+
const cqrs_1 = require("@nestjs/cqrs");
|
|
13
|
+
const QuanticCommandBus_1 = require("./cqrs/pipeline/QuanticCommandBus");
|
|
14
|
+
const QuanticQueryBus_1 = require("./cqrs/pipeline/QuanticQueryBus");
|
|
15
|
+
const types_1 = require("./cqrs/pipeline/types");
|
|
16
|
+
const LogBehavior_1 = require("./cqrs/behaviors/LogBehavior");
|
|
17
|
+
const ValidationBehavior_1 = require("./cqrs/behaviors/ValidationBehavior");
|
|
18
|
+
const TransactionalBehavior_1 = require("./cqrs/behaviors/TransactionalBehavior");
|
|
19
|
+
const GracefulShutdownService_1 = require("./lifecycle/GracefulShutdownService");
|
|
20
|
+
let QuanticCoreModule = QuanticCoreModule_1 = class QuanticCoreModule {
|
|
21
|
+
static forRoot() {
|
|
22
|
+
return {
|
|
23
|
+
module: QuanticCoreModule_1,
|
|
24
|
+
imports: [cqrs_1.CqrsModule.forRoot()],
|
|
25
|
+
providers: [
|
|
26
|
+
LogBehavior_1.LogBehavior,
|
|
27
|
+
{ provide: types_1.PIPELINE_BEHAVIOR, useExisting: LogBehavior_1.LogBehavior, multi: true },
|
|
28
|
+
ValidationBehavior_1.ValidationBehavior,
|
|
29
|
+
{ provide: types_1.PIPELINE_BEHAVIOR, useExisting: ValidationBehavior_1.ValidationBehavior, multi: true },
|
|
30
|
+
TransactionalBehavior_1.TransactionalBehavior,
|
|
31
|
+
{ provide: types_1.PIPELINE_BEHAVIOR, useExisting: TransactionalBehavior_1.TransactionalBehavior, multi: true },
|
|
32
|
+
QuanticCommandBus_1.QuanticCommandBus,
|
|
33
|
+
QuanticQueryBus_1.QuanticQueryBus,
|
|
34
|
+
GracefulShutdownService_1.GracefulShutdownService,
|
|
35
|
+
],
|
|
36
|
+
exports: [
|
|
37
|
+
cqrs_1.CqrsModule,
|
|
38
|
+
LogBehavior_1.LogBehavior,
|
|
39
|
+
ValidationBehavior_1.ValidationBehavior,
|
|
40
|
+
TransactionalBehavior_1.TransactionalBehavior,
|
|
41
|
+
QuanticCommandBus_1.QuanticCommandBus,
|
|
42
|
+
QuanticQueryBus_1.QuanticQueryBus,
|
|
43
|
+
GracefulShutdownService_1.GracefulShutdownService,
|
|
44
|
+
types_1.PIPELINE_BEHAVIOR,
|
|
45
|
+
],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
exports.QuanticCoreModule = QuanticCoreModule;
|
|
50
|
+
exports.QuanticCoreModule = QuanticCoreModule = QuanticCoreModule_1 = __decorate([
|
|
51
|
+
(0, common_1.Global)(),
|
|
52
|
+
(0, common_1.Module)({})
|
|
53
|
+
], QuanticCoreModule);
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Result } from '../../result/Result';
|
|
2
|
-
|
|
2
|
+
import { PipelineBehavior, PipelineScope } from '../pipeline/types';
|
|
3
|
+
export declare class LogBehavior implements PipelineBehavior {
|
|
4
|
+
readonly order: 10;
|
|
5
|
+
readonly scope: PipelineScope;
|
|
3
6
|
private readonly logger;
|
|
4
7
|
execute<T>(command: object, next: () => Promise<Result<T>>): Promise<Result<T>>;
|
|
5
8
|
private maskPayload;
|
|
@@ -10,11 +10,14 @@ exports.LogBehavior = void 0;
|
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
|
11
11
|
const Result_1 = require("../../result/Result");
|
|
12
12
|
const CorrelationStore_1 = require("../../middleware/CorrelationStore");
|
|
13
|
+
const behavior_order_1 = require("../pipeline/behavior-order");
|
|
13
14
|
const PII_FIELDS = new Set(['email', 'githubAccessToken', 'accessToken', 'token', 'secretKey', 'password']);
|
|
14
15
|
const MAX_STRING_LENGTH = 200;
|
|
15
16
|
const MAX_ARRAY_LENGTH = 5;
|
|
16
17
|
const MAX_DEPTH = 2;
|
|
17
18
|
let LogBehavior = class LogBehavior {
|
|
19
|
+
order = behavior_order_1.BehaviorOrder.LOG;
|
|
20
|
+
scope = 'both';
|
|
18
21
|
logger = new common_1.Logger('PipelineBehavior');
|
|
19
22
|
async execute(command, next) {
|
|
20
23
|
const commandName = command.constructor.name;
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
import { DataSource } from 'typeorm';
|
|
2
2
|
import { Result } from '../../result/Result';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
* Every command is transactional by default (no decorator needed):
|
|
7
|
-
* - If no ambient transaction exists → CREATE one, own commit/rollback
|
|
8
|
-
* - If an ambient transaction exists → JOIN it (pass through, outer scope owns lifecycle)
|
|
9
|
-
* - If command is @IsolatedTransaction() → always CREATE a new one, even if context exists
|
|
10
|
-
*
|
|
11
|
-
* Queries skip this behavior entirely (separate pipeline chain in QuanticQueryBus).
|
|
12
|
-
*/
|
|
13
|
-
export declare class TransactionalBehavior {
|
|
3
|
+
import { PipelineBehavior, PipelineScope } from '../pipeline/types';
|
|
4
|
+
export declare class TransactionalBehavior implements PipelineBehavior {
|
|
14
5
|
private readonly dataSource?;
|
|
6
|
+
readonly order: 80;
|
|
7
|
+
readonly scope: PipelineScope;
|
|
15
8
|
private readonly logger;
|
|
16
9
|
constructor(dataSource?: DataSource | undefined);
|
|
17
10
|
execute<T>(command: object, next: () => Promise<Result<T>>): Promise<Result<T>>;
|
|
@@ -19,18 +19,11 @@ const typeorm_1 = require("typeorm");
|
|
|
19
19
|
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
|
-
|
|
23
|
-
* TransactionalBehavior — UnitOfWork pattern via AsyncLocalStorage.
|
|
24
|
-
*
|
|
25
|
-
* Every command is transactional by default (no decorator needed):
|
|
26
|
-
* - If no ambient transaction exists → CREATE one, own commit/rollback
|
|
27
|
-
* - If an ambient transaction exists → JOIN it (pass through, outer scope owns lifecycle)
|
|
28
|
-
* - If command is @IsolatedTransaction() → always CREATE a new one, even if context exists
|
|
29
|
-
*
|
|
30
|
-
* Queries skip this behavior entirely (separate pipeline chain in QuanticQueryBus).
|
|
31
|
-
*/
|
|
22
|
+
const behavior_order_1 = require("../pipeline/behavior-order");
|
|
32
23
|
let TransactionalBehavior = TransactionalBehavior_1 = class TransactionalBehavior {
|
|
33
24
|
dataSource;
|
|
25
|
+
order = behavior_order_1.BehaviorOrder.TRANSACTIONAL;
|
|
26
|
+
scope = 'command';
|
|
34
27
|
logger = new common_1.Logger(TransactionalBehavior_1.name);
|
|
35
28
|
constructor(dataSource) {
|
|
36
29
|
this.dataSource = dataSource;
|
|
@@ -41,11 +34,9 @@ let TransactionalBehavior = TransactionalBehavior_1 = class TransactionalBehavio
|
|
|
41
34
|
}
|
|
42
35
|
const existing = TransactionContext_1.TransactionContext.get();
|
|
43
36
|
const isolated = (0, IsolatedTransaction_decorator_1.isIsolatedTransaction)(command.constructor);
|
|
44
|
-
// JOIN — ambient transaction exists and command does not demand isolation
|
|
45
37
|
if (existing && !isolated) {
|
|
46
38
|
return next();
|
|
47
39
|
}
|
|
48
|
-
// CREATE — we are the outermost scope (or isolated); we own the lifecycle
|
|
49
40
|
const queryRunner = this.dataSource.createQueryRunner();
|
|
50
41
|
await queryRunner.connect();
|
|
51
42
|
await queryRunner.startTransaction();
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { Result } from '../../result/Result';
|
|
2
|
-
|
|
2
|
+
import { PipelineBehavior, PipelineScope } from '../pipeline/types';
|
|
3
|
+
export declare class ValidationBehavior implements PipelineBehavior {
|
|
4
|
+
readonly order: 40;
|
|
5
|
+
readonly scope: PipelineScope;
|
|
3
6
|
execute<T>(command: object, next: () => Promise<Result<T>>): Promise<Result<T>>;
|
|
4
7
|
}
|
|
@@ -10,7 +10,10 @@ exports.ValidationBehavior = void 0;
|
|
|
10
10
|
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
|
+
const behavior_order_1 = require("../pipeline/behavior-order");
|
|
13
14
|
let ValidationBehavior = class ValidationBehavior {
|
|
15
|
+
order = behavior_order_1.BehaviorOrder.VALIDATE;
|
|
16
|
+
scope = 'both';
|
|
14
17
|
async execute(command, next) {
|
|
15
18
|
if (!(0, Validate_decorator_1.shouldValidate)(command.constructor)) {
|
|
16
19
|
return next();
|
|
@@ -1,37 +1,12 @@
|
|
|
1
1
|
import { OnModuleInit } from '@nestjs/common';
|
|
2
2
|
import { CommandBus } from '@nestjs/cqrs';
|
|
3
|
-
import {
|
|
4
|
-
import { FeatureFlagBehavior } from '../behaviors/FeatureFlagBehavior';
|
|
5
|
-
import { ValidationBehavior } from '../behaviors/ValidationBehavior';
|
|
6
|
-
import { CacheBehavior } from '../behaviors/CacheBehavior';
|
|
7
|
-
import { DistributedLockBehavior } from '../behaviors/DistributedLockBehavior';
|
|
8
|
-
import { TransactionalBehavior } from '../behaviors/TransactionalBehavior';
|
|
9
|
-
import { PerformanceBehavior } from '../behaviors/PerformanceBehavior';
|
|
10
|
-
import { WorkflowBehavior } from '../behaviors/WorkflowBehavior';
|
|
11
|
-
import { InvalidateCacheBehavior } from '../behaviors/InvalidateCacheBehavior';
|
|
12
|
-
/**
|
|
13
|
-
* QuanticCommandBus — wraps the @nestjs/cqrs CommandBus with a behavior pipeline.
|
|
14
|
-
*
|
|
15
|
-
* Pipeline order:
|
|
16
|
-
* InvalidateCache → Log → Performance → FeatureFlag → Validate → Workflow → Cache → DistributedLock → Transactional → Handler
|
|
17
|
-
*
|
|
18
|
-
* Controllers inject the standard CommandBus from @nestjs/cqrs.
|
|
19
|
-
* This class patches its execute() in onModuleInit so the pipeline is transparent.
|
|
20
|
-
*/
|
|
3
|
+
import { PipelineBehavior } from './types';
|
|
21
4
|
export declare class QuanticCommandBus implements OnModuleInit {
|
|
22
5
|
private readonly commandBus;
|
|
23
|
-
private readonly
|
|
24
|
-
private readonly performanceBehavior;
|
|
25
|
-
private readonly featureFlagBehavior;
|
|
26
|
-
private readonly validationBehavior;
|
|
27
|
-
private readonly workflowBehavior;
|
|
28
|
-
private readonly cacheBehavior;
|
|
29
|
-
private readonly distributedLockBehavior;
|
|
30
|
-
private readonly transactionalBehavior;
|
|
31
|
-
private readonly invalidateCacheBehavior;
|
|
6
|
+
private readonly allBehaviors?;
|
|
32
7
|
private readonly logger;
|
|
33
8
|
private behaviors;
|
|
34
9
|
private originalExecute;
|
|
35
|
-
constructor(commandBus: CommandBus,
|
|
10
|
+
constructor(commandBus: CommandBus, allBehaviors?: PipelineBehavior[] | undefined);
|
|
36
11
|
onModuleInit(): void;
|
|
37
12
|
}
|
|
@@ -16,64 +16,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
16
16
|
exports.QuanticCommandBus = void 0;
|
|
17
17
|
const common_1 = require("@nestjs/common");
|
|
18
18
|
const cqrs_1 = require("@nestjs/cqrs");
|
|
19
|
-
const LogBehavior_1 = require("../behaviors/LogBehavior");
|
|
20
|
-
const FeatureFlagBehavior_1 = require("../behaviors/FeatureFlagBehavior");
|
|
21
|
-
const ValidationBehavior_1 = require("../behaviors/ValidationBehavior");
|
|
22
|
-
const CacheBehavior_1 = require("../behaviors/CacheBehavior");
|
|
23
|
-
const DistributedLockBehavior_1 = require("../behaviors/DistributedLockBehavior");
|
|
24
|
-
const TransactionalBehavior_1 = require("../behaviors/TransactionalBehavior");
|
|
25
|
-
const PerformanceBehavior_1 = require("../behaviors/PerformanceBehavior");
|
|
26
|
-
const WorkflowBehavior_1 = require("../behaviors/WorkflowBehavior");
|
|
27
|
-
const InvalidateCacheBehavior_1 = require("../behaviors/InvalidateCacheBehavior");
|
|
28
19
|
const runPipeline_1 = require("./runPipeline");
|
|
29
|
-
|
|
30
|
-
* QuanticCommandBus — wraps the @nestjs/cqrs CommandBus with a behavior pipeline.
|
|
31
|
-
*
|
|
32
|
-
* Pipeline order:
|
|
33
|
-
* InvalidateCache → Log → Performance → FeatureFlag → Validate → Workflow → Cache → DistributedLock → Transactional → Handler
|
|
34
|
-
*
|
|
35
|
-
* Controllers inject the standard CommandBus from @nestjs/cqrs.
|
|
36
|
-
* This class patches its execute() in onModuleInit so the pipeline is transparent.
|
|
37
|
-
*/
|
|
20
|
+
const types_1 = require("./types");
|
|
38
21
|
let QuanticCommandBus = QuanticCommandBus_1 = class QuanticCommandBus {
|
|
39
22
|
commandBus;
|
|
40
|
-
|
|
41
|
-
performanceBehavior;
|
|
42
|
-
featureFlagBehavior;
|
|
43
|
-
validationBehavior;
|
|
44
|
-
workflowBehavior;
|
|
45
|
-
cacheBehavior;
|
|
46
|
-
distributedLockBehavior;
|
|
47
|
-
transactionalBehavior;
|
|
48
|
-
invalidateCacheBehavior;
|
|
23
|
+
allBehaviors;
|
|
49
24
|
logger = new common_1.Logger(QuanticCommandBus_1.name);
|
|
50
25
|
behaviors = [];
|
|
51
26
|
originalExecute;
|
|
52
|
-
constructor(commandBus,
|
|
27
|
+
constructor(commandBus, allBehaviors) {
|
|
53
28
|
this.commandBus = commandBus;
|
|
54
|
-
this.
|
|
55
|
-
this.performanceBehavior = performanceBehavior;
|
|
56
|
-
this.featureFlagBehavior = featureFlagBehavior;
|
|
57
|
-
this.validationBehavior = validationBehavior;
|
|
58
|
-
this.workflowBehavior = workflowBehavior;
|
|
59
|
-
this.cacheBehavior = cacheBehavior;
|
|
60
|
-
this.distributedLockBehavior = distributedLockBehavior;
|
|
61
|
-
this.transactionalBehavior = transactionalBehavior;
|
|
62
|
-
this.invalidateCacheBehavior = invalidateCacheBehavior;
|
|
29
|
+
this.allBehaviors = allBehaviors;
|
|
63
30
|
}
|
|
64
31
|
onModuleInit() {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
(
|
|
68
|
-
(cmd, next) =>
|
|
69
|
-
(cmd, next) => this.performanceBehavior.execute(cmd, next),
|
|
70
|
-
...optional(this.featureFlagBehavior),
|
|
71
|
-
(cmd, next) => this.validationBehavior.execute(cmd, next),
|
|
72
|
-
...optional(this.workflowBehavior),
|
|
73
|
-
(cmd, next) => this.cacheBehavior.execute(cmd, next),
|
|
74
|
-
(cmd, next) => this.distributedLockBehavior.execute(cmd, next),
|
|
75
|
-
(cmd, next) => this.transactionalBehavior.execute(cmd, next),
|
|
76
|
-
];
|
|
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));
|
|
77
36
|
this.originalExecute = this.commandBus.execute.bind(this.commandBus);
|
|
78
37
|
const self = this;
|
|
79
38
|
this.commandBus.execute = (command) => {
|
|
@@ -86,14 +45,7 @@ let QuanticCommandBus = QuanticCommandBus_1 = class QuanticCommandBus {
|
|
|
86
45
|
exports.QuanticCommandBus = QuanticCommandBus;
|
|
87
46
|
exports.QuanticCommandBus = QuanticCommandBus = QuanticCommandBus_1 = __decorate([
|
|
88
47
|
(0, common_1.Injectable)(),
|
|
89
|
-
__param(
|
|
90
|
-
__param(
|
|
91
|
-
|
|
92
|
-
__param(5, (0, common_1.Inject)(WorkflowBehavior_1.WorkflowBehavior)),
|
|
93
|
-
__metadata("design:paramtypes", [cqrs_1.CommandBus,
|
|
94
|
-
LogBehavior_1.LogBehavior,
|
|
95
|
-
PerformanceBehavior_1.PerformanceBehavior, Object, ValidationBehavior_1.ValidationBehavior, Object, CacheBehavior_1.CacheBehavior,
|
|
96
|
-
DistributedLockBehavior_1.DistributedLockBehavior,
|
|
97
|
-
TransactionalBehavior_1.TransactionalBehavior,
|
|
98
|
-
InvalidateCacheBehavior_1.InvalidateCacheBehavior])
|
|
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])
|
|
99
51
|
], QuanticCommandBus);
|
|
@@ -1,28 +1,12 @@
|
|
|
1
1
|
import { OnModuleInit } from '@nestjs/common';
|
|
2
2
|
import { QueryBus } from '@nestjs/cqrs';
|
|
3
|
-
import {
|
|
4
|
-
import { FeatureFlagBehavior } from '../behaviors/FeatureFlagBehavior';
|
|
5
|
-
import { ValidationBehavior } from '../behaviors/ValidationBehavior';
|
|
6
|
-
import { CacheBehavior } from '../behaviors/CacheBehavior';
|
|
7
|
-
import { PerformanceBehavior } from '../behaviors/PerformanceBehavior';
|
|
8
|
-
/**
|
|
9
|
-
* QuanticQueryBus — wraps the @nestjs/cqrs QueryBus with a behavior pipeline.
|
|
10
|
-
*
|
|
11
|
-
* Pipeline order:
|
|
12
|
-
* Log → Performance → FeatureFlag → Validate → Cache → Handler
|
|
13
|
-
*
|
|
14
|
-
* Queries skip Workflow, DistributedLock, and Transactional — they are read-only.
|
|
15
|
-
*/
|
|
3
|
+
import { PipelineBehavior } from './types';
|
|
16
4
|
export declare class QuanticQueryBus implements OnModuleInit {
|
|
17
5
|
private readonly queryBus;
|
|
18
|
-
private readonly
|
|
19
|
-
private readonly performanceBehavior;
|
|
20
|
-
private readonly featureFlagBehavior;
|
|
21
|
-
private readonly validationBehavior;
|
|
22
|
-
private readonly cacheBehavior;
|
|
6
|
+
private readonly allBehaviors?;
|
|
23
7
|
private readonly logger;
|
|
24
8
|
private behaviors;
|
|
25
9
|
private originalExecute;
|
|
26
|
-
constructor(queryBus: QueryBus,
|
|
10
|
+
constructor(queryBus: QueryBus, allBehaviors?: PipelineBehavior[] | undefined);
|
|
27
11
|
onModuleInit(): void;
|
|
28
12
|
}
|
|
@@ -16,47 +16,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
16
16
|
exports.QuanticQueryBus = void 0;
|
|
17
17
|
const common_1 = require("@nestjs/common");
|
|
18
18
|
const cqrs_1 = require("@nestjs/cqrs");
|
|
19
|
-
const LogBehavior_1 = require("../behaviors/LogBehavior");
|
|
20
|
-
const FeatureFlagBehavior_1 = require("../behaviors/FeatureFlagBehavior");
|
|
21
|
-
const ValidationBehavior_1 = require("../behaviors/ValidationBehavior");
|
|
22
|
-
const CacheBehavior_1 = require("../behaviors/CacheBehavior");
|
|
23
|
-
const PerformanceBehavior_1 = require("../behaviors/PerformanceBehavior");
|
|
24
19
|
const runPipeline_1 = require("./runPipeline");
|
|
25
|
-
|
|
26
|
-
* QuanticQueryBus — wraps the @nestjs/cqrs QueryBus with a behavior pipeline.
|
|
27
|
-
*
|
|
28
|
-
* Pipeline order:
|
|
29
|
-
* Log → Performance → FeatureFlag → Validate → Cache → Handler
|
|
30
|
-
*
|
|
31
|
-
* Queries skip Workflow, DistributedLock, and Transactional — they are read-only.
|
|
32
|
-
*/
|
|
20
|
+
const types_1 = require("./types");
|
|
33
21
|
let QuanticQueryBus = QuanticQueryBus_1 = class QuanticQueryBus {
|
|
34
22
|
queryBus;
|
|
35
|
-
|
|
36
|
-
performanceBehavior;
|
|
37
|
-
featureFlagBehavior;
|
|
38
|
-
validationBehavior;
|
|
39
|
-
cacheBehavior;
|
|
23
|
+
allBehaviors;
|
|
40
24
|
logger = new common_1.Logger(QuanticQueryBus_1.name);
|
|
41
25
|
behaviors = [];
|
|
42
26
|
originalExecute;
|
|
43
|
-
constructor(queryBus,
|
|
27
|
+
constructor(queryBus, allBehaviors) {
|
|
44
28
|
this.queryBus = queryBus;
|
|
45
|
-
this.
|
|
46
|
-
this.performanceBehavior = performanceBehavior;
|
|
47
|
-
this.featureFlagBehavior = featureFlagBehavior;
|
|
48
|
-
this.validationBehavior = validationBehavior;
|
|
49
|
-
this.cacheBehavior = cacheBehavior;
|
|
29
|
+
this.allBehaviors = allBehaviors;
|
|
50
30
|
}
|
|
51
31
|
onModuleInit() {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
(
|
|
55
|
-
(cmd, next) =>
|
|
56
|
-
...optional(this.featureFlagBehavior),
|
|
57
|
-
(cmd, next) => this.validationBehavior.execute(cmd, next),
|
|
58
|
-
(cmd, next) => this.cacheBehavior.execute(cmd, next),
|
|
59
|
-
];
|
|
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));
|
|
60
36
|
this.originalExecute = this.queryBus.execute.bind(this.queryBus);
|
|
61
37
|
const self = this;
|
|
62
38
|
this.queryBus.execute = (query) => {
|
|
@@ -69,10 +45,7 @@ let QuanticQueryBus = QuanticQueryBus_1 = class QuanticQueryBus {
|
|
|
69
45
|
exports.QuanticQueryBus = QuanticQueryBus;
|
|
70
46
|
exports.QuanticQueryBus = QuanticQueryBus = QuanticQueryBus_1 = __decorate([
|
|
71
47
|
(0, common_1.Injectable)(),
|
|
72
|
-
__param(
|
|
73
|
-
__param(
|
|
74
|
-
__metadata("design:paramtypes", [cqrs_1.QueryBus,
|
|
75
|
-
LogBehavior_1.LogBehavior,
|
|
76
|
-
PerformanceBehavior_1.PerformanceBehavior, Object, ValidationBehavior_1.ValidationBehavior,
|
|
77
|
-
CacheBehavior_1.CacheBehavior])
|
|
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])
|
|
78
51
|
], QuanticQueryBus);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const BehaviorOrder: {
|
|
2
|
+
readonly INVALIDATE_CACHE: 5;
|
|
3
|
+
readonly LOG: 10;
|
|
4
|
+
readonly PERFORMANCE: 20;
|
|
5
|
+
readonly FEATURE_FLAG: 30;
|
|
6
|
+
readonly VALIDATE: 40;
|
|
7
|
+
readonly WORKFLOW: 50;
|
|
8
|
+
readonly CACHE: 60;
|
|
9
|
+
readonly DISTRIBUTED_LOCK: 70;
|
|
10
|
+
readonly TRANSACTIONAL: 80;
|
|
11
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BehaviorOrder = void 0;
|
|
4
|
+
exports.BehaviorOrder = {
|
|
5
|
+
INVALIDATE_CACHE: 5,
|
|
6
|
+
LOG: 10,
|
|
7
|
+
PERFORMANCE: 20,
|
|
8
|
+
FEATURE_FLAG: 30,
|
|
9
|
+
VALIDATE: 40,
|
|
10
|
+
WORKFLOW: 50,
|
|
11
|
+
CACHE: 60,
|
|
12
|
+
DISTRIBUTED_LOCK: 70,
|
|
13
|
+
TRANSACTIONAL: 80,
|
|
14
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Result } from '../../result/Result';
|
|
2
|
+
export declare const PIPELINE_BEHAVIOR: unique symbol;
|
|
3
|
+
export type PipelineScope = 'command' | 'query' | 'both';
|
|
4
|
+
export interface PipelineBehavior {
|
|
5
|
+
readonly order: number;
|
|
6
|
+
readonly scope: PipelineScope;
|
|
7
|
+
execute<T>(command: object, next: () => Promise<Result<T>>): Promise<Result<T>>;
|
|
8
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -19,13 +19,14 @@ 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
|
+
export type { PipelineBehavior, PipelineScope } from './cqrs/pipeline/types';
|
|
24
|
+
export { BehaviorOrder } from './cqrs/pipeline/behavior-order';
|
|
22
25
|
export { FeatureFlag, getFeatureFlagMetadata } from './cqrs/decorators/FeatureFlag.decorator';
|
|
23
26
|
export type { FeatureFlagOptions } from './cqrs/decorators/FeatureFlag.decorator';
|
|
24
27
|
export { Log, getLogMetadata } from './cqrs/decorators/Log.decorator';
|
|
25
28
|
export type { LogOptions } from './cqrs/decorators/Log.decorator';
|
|
26
29
|
export { Validate, shouldValidate, getValidatorClass } from './cqrs/decorators/Validate.decorator';
|
|
27
|
-
export type { ICommandValidator } from './cqrs/validation/ICommandValidator';
|
|
28
|
-
export { validateCommand } from './cqrs/validation/ICommandValidator';
|
|
29
30
|
export { Cache, getCacheMetadata } from './cqrs/decorators/Cache.decorator';
|
|
30
31
|
export type { CacheOptions } from './cqrs/decorators/Cache.decorator';
|
|
31
32
|
export { InvalidateCache, getInvalidateCacheMetadata } from './cqrs/decorators/InvalidateCache.decorator';
|
|
@@ -35,35 +36,18 @@ export type { DistributedLockOptions } from './cqrs/decorators/DistributedLock.d
|
|
|
35
36
|
export { IsolatedTransaction, isIsolatedTransaction } from './cqrs/decorators/IsolatedTransaction.decorator';
|
|
36
37
|
export { Workflow, getWorkflowMetadata } from './cqrs/decorators/Workflow.decorator';
|
|
37
38
|
export type { WorkflowOptions } from './cqrs/decorators/Workflow.decorator';
|
|
39
|
+
export type { ICommandValidator } from './cqrs/validation/ICommandValidator';
|
|
40
|
+
export { validateCommand } from './cqrs/validation/ICommandValidator';
|
|
38
41
|
export { WORKFLOW_ENGINE } from './cqrs/interfaces/WorkflowEngine';
|
|
39
42
|
export type { WorkflowEngine, WorkflowStartResult } from './cqrs/interfaces/WorkflowEngine';
|
|
40
43
|
export { TransactionContext } from './cqrs/transaction/TransactionContext';
|
|
41
44
|
export { getTransactionalRepo } from './cqrs/transaction/getTransactionalRepo';
|
|
42
|
-
export { MetricsService } from './metrics/MetricsService';
|
|
43
|
-
export { MetricsController } from './metrics/MetricsController';
|
|
44
45
|
export { LogBehavior } from './cqrs/behaviors/LogBehavior';
|
|
45
|
-
export { FeatureFlagBehavior } from './cqrs/behaviors/FeatureFlagBehavior';
|
|
46
46
|
export { ValidationBehavior } from './cqrs/behaviors/ValidationBehavior';
|
|
47
|
-
export { CacheBehavior } from './cqrs/behaviors/CacheBehavior';
|
|
48
|
-
export { InvalidateCacheBehavior } from './cqrs/behaviors/InvalidateCacheBehavior';
|
|
49
|
-
export { DistributedLockBehavior } from './cqrs/behaviors/DistributedLockBehavior';
|
|
50
47
|
export { TransactionalBehavior } from './cqrs/behaviors/TransactionalBehavior';
|
|
51
|
-
export { PerformanceBehavior } from './cqrs/behaviors/PerformanceBehavior';
|
|
52
|
-
export { WorkflowBehavior } from './cqrs/behaviors/WorkflowBehavior';
|
|
53
48
|
export { QuanticCommandBus } from './cqrs/pipeline/QuanticCommandBus';
|
|
54
49
|
export { QuanticQueryBus } from './cqrs/pipeline/QuanticQueryBus';
|
|
55
50
|
export { type BehaviorFn } from './cqrs/pipeline/runPipeline';
|
|
56
|
-
export { RedisModule } from './redis/redis.module';
|
|
57
|
-
export type { RedisModuleOptions } from './redis/redis.module';
|
|
58
|
-
export { DomainEvent } from './events/DomainEvent';
|
|
59
|
-
export type { DomainEventPayload } from './events/DomainEvent';
|
|
60
|
-
export { OutboxEvent, OutboxEventStatus } from './events/OutboxEvent.entity';
|
|
61
|
-
export { RedisStreamPublisher } from './events/RedisStreamPublisher';
|
|
62
|
-
export { RedisStreamConsumer } from './events/RedisStreamConsumer';
|
|
63
|
-
export { OutboxPublisherService } from './events/OutboxPublisherService';
|
|
64
|
-
export { UnleashModule } from './unleash/unleash.module';
|
|
65
|
-
export type { UnleashModuleOptions } from './unleash/unleash.module';
|
|
66
51
|
export { GracefulShutdownService } from './lifecycle/GracefulShutdownService';
|
|
67
|
-
export {
|
|
68
|
-
export type { QuanticModuleOptions, SharedKernelModuleOptions } from './shared-kernel.module';
|
|
52
|
+
export { QuanticCoreModule } from './QuanticCoreModule';
|
|
69
53
|
export { createMockRepository, createMockRedisClient } from './testing/mocks';
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.createMockRedisClient = exports.createMockRepository =
|
|
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;
|
|
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,6 +50,11 @@ 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
|
+
var behavior_order_1 = require("./cqrs/pipeline/behavior-order");
|
|
57
|
+
Object.defineProperty(exports, "BehaviorOrder", { enumerable: true, get: function () { return behavior_order_1.BehaviorOrder; } });
|
|
53
58
|
// CQRS Decorators
|
|
54
59
|
var FeatureFlag_decorator_1 = require("./cqrs/decorators/FeatureFlag.decorator");
|
|
55
60
|
Object.defineProperty(exports, "FeatureFlag", { enumerable: true, get: function () { return FeatureFlag_decorator_1.FeatureFlag; } });
|
|
@@ -61,8 +66,6 @@ var Validate_decorator_1 = require("./cqrs/decorators/Validate.decorator");
|
|
|
61
66
|
Object.defineProperty(exports, "Validate", { enumerable: true, get: function () { return Validate_decorator_1.Validate; } });
|
|
62
67
|
Object.defineProperty(exports, "shouldValidate", { enumerable: true, get: function () { return Validate_decorator_1.shouldValidate; } });
|
|
63
68
|
Object.defineProperty(exports, "getValidatorClass", { enumerable: true, get: function () { return Validate_decorator_1.getValidatorClass; } });
|
|
64
|
-
var ICommandValidator_1 = require("./cqrs/validation/ICommandValidator");
|
|
65
|
-
Object.defineProperty(exports, "validateCommand", { enumerable: true, get: function () { return ICommandValidator_1.validateCommand; } });
|
|
66
69
|
var Cache_decorator_1 = require("./cqrs/decorators/Cache.decorator");
|
|
67
70
|
Object.defineProperty(exports, "Cache", { enumerable: true, get: function () { return Cache_decorator_1.Cache; } });
|
|
68
71
|
Object.defineProperty(exports, "getCacheMetadata", { enumerable: true, get: function () { return Cache_decorator_1.getCacheMetadata; } });
|
|
@@ -78,6 +81,8 @@ Object.defineProperty(exports, "isIsolatedTransaction", { enumerable: true, get:
|
|
|
78
81
|
var Workflow_decorator_1 = require("./cqrs/decorators/Workflow.decorator");
|
|
79
82
|
Object.defineProperty(exports, "Workflow", { enumerable: true, get: function () { return Workflow_decorator_1.Workflow; } });
|
|
80
83
|
Object.defineProperty(exports, "getWorkflowMetadata", { enumerable: true, get: function () { return Workflow_decorator_1.getWorkflowMetadata; } });
|
|
84
|
+
var ICommandValidator_1 = require("./cqrs/validation/ICommandValidator");
|
|
85
|
+
Object.defineProperty(exports, "validateCommand", { enumerable: true, get: function () { return ICommandValidator_1.validateCommand; } });
|
|
81
86
|
// Workflow Engine Interface
|
|
82
87
|
var WorkflowEngine_1 = require("./cqrs/interfaces/WorkflowEngine");
|
|
83
88
|
Object.defineProperty(exports, "WORKFLOW_ENGINE", { enumerable: true, get: function () { return WorkflowEngine_1.WORKFLOW_ENGINE; } });
|
|
@@ -86,60 +91,24 @@ var TransactionContext_1 = require("./cqrs/transaction/TransactionContext");
|
|
|
86
91
|
Object.defineProperty(exports, "TransactionContext", { enumerable: true, get: function () { return TransactionContext_1.TransactionContext; } });
|
|
87
92
|
var getTransactionalRepo_1 = require("./cqrs/transaction/getTransactionalRepo");
|
|
88
93
|
Object.defineProperty(exports, "getTransactionalRepo", { enumerable: true, get: function () { return getTransactionalRepo_1.getTransactionalRepo; } });
|
|
89
|
-
//
|
|
90
|
-
var MetricsService_1 = require("./metrics/MetricsService");
|
|
91
|
-
Object.defineProperty(exports, "MetricsService", { enumerable: true, get: function () { return MetricsService_1.MetricsService; } });
|
|
92
|
-
var MetricsController_1 = require("./metrics/MetricsController");
|
|
93
|
-
Object.defineProperty(exports, "MetricsController", { enumerable: true, get: function () { return MetricsController_1.MetricsController; } });
|
|
94
|
-
// CQRS Behaviors
|
|
94
|
+
// CQRS Core Behaviors
|
|
95
95
|
var LogBehavior_1 = require("./cqrs/behaviors/LogBehavior");
|
|
96
96
|
Object.defineProperty(exports, "LogBehavior", { enumerable: true, get: function () { return LogBehavior_1.LogBehavior; } });
|
|
97
|
-
var FeatureFlagBehavior_1 = require("./cqrs/behaviors/FeatureFlagBehavior");
|
|
98
|
-
Object.defineProperty(exports, "FeatureFlagBehavior", { enumerable: true, get: function () { return FeatureFlagBehavior_1.FeatureFlagBehavior; } });
|
|
99
97
|
var ValidationBehavior_1 = require("./cqrs/behaviors/ValidationBehavior");
|
|
100
98
|
Object.defineProperty(exports, "ValidationBehavior", { enumerable: true, get: function () { return ValidationBehavior_1.ValidationBehavior; } });
|
|
101
|
-
var CacheBehavior_1 = require("./cqrs/behaviors/CacheBehavior");
|
|
102
|
-
Object.defineProperty(exports, "CacheBehavior", { enumerable: true, get: function () { return CacheBehavior_1.CacheBehavior; } });
|
|
103
|
-
var InvalidateCacheBehavior_1 = require("./cqrs/behaviors/InvalidateCacheBehavior");
|
|
104
|
-
Object.defineProperty(exports, "InvalidateCacheBehavior", { enumerable: true, get: function () { return InvalidateCacheBehavior_1.InvalidateCacheBehavior; } });
|
|
105
|
-
var DistributedLockBehavior_1 = require("./cqrs/behaviors/DistributedLockBehavior");
|
|
106
|
-
Object.defineProperty(exports, "DistributedLockBehavior", { enumerable: true, get: function () { return DistributedLockBehavior_1.DistributedLockBehavior; } });
|
|
107
99
|
var TransactionalBehavior_1 = require("./cqrs/behaviors/TransactionalBehavior");
|
|
108
100
|
Object.defineProperty(exports, "TransactionalBehavior", { enumerable: true, get: function () { return TransactionalBehavior_1.TransactionalBehavior; } });
|
|
109
|
-
var PerformanceBehavior_1 = require("./cqrs/behaviors/PerformanceBehavior");
|
|
110
|
-
Object.defineProperty(exports, "PerformanceBehavior", { enumerable: true, get: function () { return PerformanceBehavior_1.PerformanceBehavior; } });
|
|
111
|
-
var WorkflowBehavior_1 = require("./cqrs/behaviors/WorkflowBehavior");
|
|
112
|
-
Object.defineProperty(exports, "WorkflowBehavior", { enumerable: true, get: function () { return WorkflowBehavior_1.WorkflowBehavior; } });
|
|
113
101
|
// CQRS Pipeline
|
|
114
102
|
var QuanticCommandBus_1 = require("./cqrs/pipeline/QuanticCommandBus");
|
|
115
103
|
Object.defineProperty(exports, "QuanticCommandBus", { enumerable: true, get: function () { return QuanticCommandBus_1.QuanticCommandBus; } });
|
|
116
104
|
var QuanticQueryBus_1 = require("./cqrs/pipeline/QuanticQueryBus");
|
|
117
105
|
Object.defineProperty(exports, "QuanticQueryBus", { enumerable: true, get: function () { return QuanticQueryBus_1.QuanticQueryBus; } });
|
|
118
|
-
// Redis
|
|
119
|
-
var redis_module_1 = require("./redis/redis.module");
|
|
120
|
-
Object.defineProperty(exports, "RedisModule", { enumerable: true, get: function () { return redis_module_1.RedisModule; } });
|
|
121
|
-
// Events
|
|
122
|
-
var DomainEvent_1 = require("./events/DomainEvent");
|
|
123
|
-
Object.defineProperty(exports, "DomainEvent", { enumerable: true, get: function () { return DomainEvent_1.DomainEvent; } });
|
|
124
|
-
var OutboxEvent_entity_1 = require("./events/OutboxEvent.entity");
|
|
125
|
-
Object.defineProperty(exports, "OutboxEvent", { enumerable: true, get: function () { return OutboxEvent_entity_1.OutboxEvent; } });
|
|
126
|
-
Object.defineProperty(exports, "OutboxEventStatus", { enumerable: true, get: function () { return OutboxEvent_entity_1.OutboxEventStatus; } });
|
|
127
|
-
var RedisStreamPublisher_1 = require("./events/RedisStreamPublisher");
|
|
128
|
-
Object.defineProperty(exports, "RedisStreamPublisher", { enumerable: true, get: function () { return RedisStreamPublisher_1.RedisStreamPublisher; } });
|
|
129
|
-
var RedisStreamConsumer_1 = require("./events/RedisStreamConsumer");
|
|
130
|
-
Object.defineProperty(exports, "RedisStreamConsumer", { enumerable: true, get: function () { return RedisStreamConsumer_1.RedisStreamConsumer; } });
|
|
131
|
-
var OutboxPublisherService_1 = require("./events/OutboxPublisherService");
|
|
132
|
-
Object.defineProperty(exports, "OutboxPublisherService", { enumerable: true, get: function () { return OutboxPublisherService_1.OutboxPublisherService; } });
|
|
133
|
-
// Unleash
|
|
134
|
-
var unleash_module_1 = require("./unleash/unleash.module");
|
|
135
|
-
Object.defineProperty(exports, "UnleashModule", { enumerable: true, get: function () { return unleash_module_1.UnleashModule; } });
|
|
136
106
|
// Lifecycle
|
|
137
107
|
var GracefulShutdownService_1 = require("./lifecycle/GracefulShutdownService");
|
|
138
108
|
Object.defineProperty(exports, "GracefulShutdownService", { enumerable: true, get: function () { return GracefulShutdownService_1.GracefulShutdownService; } });
|
|
139
|
-
//
|
|
140
|
-
var
|
|
141
|
-
Object.defineProperty(exports, "
|
|
142
|
-
Object.defineProperty(exports, "SharedKernelModule", { enumerable: true, get: function () { return shared_kernel_module_1.SharedKernelModule; } });
|
|
109
|
+
// Module
|
|
110
|
+
var QuanticCoreModule_1 = require("./QuanticCoreModule");
|
|
111
|
+
Object.defineProperty(exports, "QuanticCoreModule", { enumerable: true, get: function () { return QuanticCoreModule_1.QuanticCoreModule; } });
|
|
143
112
|
// Testing mock helpers (safe for prod — no @nestjs/testing dependency)
|
|
144
113
|
var mocks_1 = require("./testing/mocks");
|
|
145
114
|
Object.defineProperty(exports, "createMockRepository", { enumerable: true, get: function () { return mocks_1.createMockRepository; } });
|