@invariant--labs/foundation 1.1.2
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/.pnp.cjs +22192 -0
- package/.pnp.loader.mjs +2126 -0
- package/.yarnrc.yml +1 -0
- package/CHANGELOG.md +527 -0
- package/README.md +3 -0
- package/eslint.config.mjs +52 -0
- package/invariant.json +22 -0
- package/jest/jest.config.base.ts +30 -0
- package/jest/jest.spec.base.ts +7 -0
- package/jest.config.js +49 -0
- package/package.json +99 -0
- package/src/core/application/index.ts +1 -0
- package/src/core/application/persistence/index.ts +3 -0
- package/src/core/application/persistence/query-builder.ts +2 -0
- package/src/core/application/persistence/read-projection.ts +2 -0
- package/src/core/application/persistence/repository.ts +23 -0
- package/src/core/domain/entities/aggregate-root.ts +34 -0
- package/src/core/domain/entities/entity.spec.ts +43 -0
- package/src/core/domain/entities/entity.ts +29 -0
- package/src/core/domain/entities/identifier.spec.ts +34 -0
- package/src/core/domain/entities/identifier.ts +16 -0
- package/src/core/domain/entities/index.ts +5 -0
- package/src/core/domain/entities/projection.ts +7 -0
- package/src/core/domain/entities/unique-entity-id.ts +9 -0
- package/src/core/domain/events/domain-event.ts +7 -0
- package/src/core/domain/events/index.ts +1 -0
- package/src/core/domain/index.ts +3 -0
- package/src/core/domain/value-objects/index.ts +2 -0
- package/src/core/domain/value-objects/range.ts +4 -0
- package/src/core/domain/value-objects/value-object.spec.ts +45 -0
- package/src/core/domain/value-objects/value-object.ts +17 -0
- package/src/core/errors/command-failure.error.spec.ts +30 -0
- package/src/core/errors/command-failure.error.ts +9 -0
- package/src/core/errors/command-filter.error.ts +3 -0
- package/src/core/errors/detailed.error.ts +25 -0
- package/src/core/errors/domain.error.spec.ts +27 -0
- package/src/core/errors/domain.error.ts +9 -0
- package/src/core/errors/entity-not-found.error.spec.ts +32 -0
- package/src/core/errors/entity-not-found.error.ts +9 -0
- package/src/core/errors/fake-implementation.error.spec.ts +27 -0
- package/src/core/errors/fake-implementation.error.ts +15 -0
- package/src/core/errors/index.ts +8 -0
- package/src/core/errors/query-failure.error.ts +8 -0
- package/src/core/errors/too-many-results.error.ts +3 -0
- package/src/core/index.ts +4 -0
- package/src/core/infrastructure/config/config.provider.ts +78 -0
- package/src/core/infrastructure/config/config.service.ts +25 -0
- package/src/core/infrastructure/config/index.ts +2 -0
- package/src/core/infrastructure/messaging/fake/fake-messaging.service.ts +17 -0
- package/src/core/infrastructure/messaging/fake/fake-queue-manager.service.ts +9 -0
- package/src/core/infrastructure/messaging/fake/fake-queue-messaging.service.ts +9 -0
- package/src/core/infrastructure/messaging/fake/index.ts +3 -0
- package/src/core/infrastructure/messaging/index.ts +6 -0
- package/src/core/infrastructure/messaging/messaging.service.ts +3 -0
- package/src/core/infrastructure/messaging/queue-manager.service.ts +6 -0
- package/src/core/infrastructure/messaging/queue-messaging.service.ts +3 -0
- package/src/core/infrastructure/messaging/rabbitmq/index.ts +2 -0
- package/src/core/infrastructure/messaging/rabbitmq/rabbit-messaging.service.ts +11 -0
- package/src/core/infrastructure/messaging/rabbitmq/rabbit-queue-messaging.service.ts +11 -0
- package/src/core/infrastructure/messaging/types.ts +28 -0
- package/src/core/infrastructure/persistence/errors/index.ts +2 -0
- package/src/core/infrastructure/persistence/errors/model-to-entity-conversion.error.ts +9 -0
- package/src/core/infrastructure/persistence/errors/persistence.error.ts +8 -0
- package/src/core/infrastructure/persistence/in-memory/fake.repository.ts +79 -0
- package/src/core/infrastructure/persistence/in-memory/in-memory.query-builder.ts +4 -0
- package/src/core/infrastructure/persistence/in-memory/in-memory.repository.spec.ts +50 -0
- package/src/core/infrastructure/persistence/in-memory/in-memory.repository.ts +81 -0
- package/src/core/infrastructure/persistence/in-memory/index.ts +3 -0
- package/src/core/infrastructure/persistence/index.ts +4 -0
- package/src/core/infrastructure/persistence/read-side/in-memory.query-builder.ts +4 -0
- package/src/core/infrastructure/persistence/read-side/index.ts +1 -0
- package/src/core/infrastructure/persistence/read-side/knex/index.ts +2 -0
- package/src/core/infrastructure/persistence/read-side/knex/knex-types.definition.ts +13 -0
- package/src/core/infrastructure/persistence/read-side/knex/knex.query-builder.ts +70 -0
- package/src/core/infrastructure/persistence/read-side/knex-query-builder.ts +70 -0
- package/src/core/infrastructure/persistence/read-side/knex-types.definition.ts +13 -0
- package/src/core/infrastructure/persistence/write-side/aggregate-typeorm-repository.ts +87 -0
- package/src/core/infrastructure/persistence/write-side/entity-typeorm-repository.ts +64 -0
- package/src/core/infrastructure/persistence/write-side/in-memory.repository.ts +82 -0
- package/src/core/infrastructure/persistence/write-side/index.ts +1 -0
- package/src/core/infrastructure/persistence/write-side/model-attributes.ts +4 -0
- package/src/core/infrastructure/persistence/write-side/orm-embedded-mapper.ts +11 -0
- package/src/core/infrastructure/persistence/write-side/orm-mapper.ts +11 -0
- package/src/core/infrastructure/persistence/write-side/typeorm/aggregate-typeorm.repository.ts +87 -0
- package/src/core/infrastructure/persistence/write-side/typeorm/entity-typeorm.repository.ts +64 -0
- package/src/core/infrastructure/persistence/write-side/typeorm/index.ts +5 -0
- package/src/core/infrastructure/persistence/write-side/typeorm/model-attributes.ts +4 -0
- package/src/core/infrastructure/persistence/write-side/typeorm/orm-embedded.mapper.ts +11 -0
- package/src/core/infrastructure/persistence/write-side/typeorm/orm.mapper.ts +11 -0
- package/src/core/types/architecture-layer.ts +52 -0
- package/src/core/types/array-element.ts +5 -0
- package/src/core/types/index.ts +2 -0
- package/src/index.ts +30 -0
- package/src/modules/config/config.module.ts +9 -0
- package/src/modules/config/index.ts +2 -0
- package/src/modules/graphql/index.ts +1 -0
- package/src/modules/graphql/paginated-response.object-type.ts +23 -0
- package/src/modules/healthcheck/healthcheck-out.dto.ts +43 -0
- package/src/modules/healthcheck/index.ts +1 -0
- package/src/modules/knex/index.ts +3 -0
- package/src/modules/knex/knex-core.module.ts +30 -0
- package/src/modules/knex/knex.decorator.ts +5 -0
- package/src/modules/knex/knex.interface.ts +12 -0
- package/src/modules/knex/knex.module.ts +14 -0
- package/src/modules/knex/knex.token.ts +2 -0
- package/src/modules/logger/app-logger.ts +28 -0
- package/src/modules/logger/index.ts +5 -0
- package/src/modules/logger/log.ts +26 -0
- package/src/modules/logger/logger.module.ts +47 -0
- package/src/modules/logger/logger.service.ts +131 -0
- package/src/modules/logger/transports/console-color.transport.ts +41 -0
- package/src/modules/logger/transports/console-json.transport.ts +23 -0
- package/src/modules/logger/transports/console.transport.ts +10 -0
- package/src/modules/logger/transports/fake.transport.ts +18 -0
- package/src/modules/logger/transports/index.ts +5 -0
- package/src/modules/logger/transports/logger-transport.ts +22 -0
- package/src/modules/messaging/index.ts +2 -0
- package/src/modules/messaging/messaging.module.ts +92 -0
- package/src/modules/queue/default-queue-name.resolver.ts +5 -0
- package/src/modules/queue/index.ts +3 -0
- package/src/modules/queue/queue.module.ts +73 -0
- package/src/modules/queue/rabbit-queue-manager.service.ts +67 -0
- package/src/nestjs/errors/handlers/error-handler.ts +38 -0
- package/src/nestjs/errors/handlers/error-handler.type.ts +23 -0
- package/src/nestjs/errors/handlers/generic-error-handler.ts +59 -0
- package/src/nestjs/errors/handlers/handle-errors.decorator.ts +43 -0
- package/src/nestjs/errors/handlers/index.ts +5 -0
- package/src/nestjs/errors/handlers/validation-error-handler.ts +46 -0
- package/src/nestjs/errors/index.ts +2 -0
- package/src/nestjs/errors/parsers/axios-metadata.parser.ts +21 -0
- package/src/nestjs/errors/parsers/error-metadata.definition.ts +1 -0
- package/src/nestjs/errors/parsers/index.ts +5 -0
- package/src/nestjs/errors/parsers/knex-metadata.parser.ts +18 -0
- package/src/nestjs/errors/parsers/typeorm-metadata.parser.ts +19 -0
- package/src/nestjs/errors/parsers/workos-metadata.parser.ts +17 -0
- package/src/nestjs/http/decorators/index.ts +1 -0
- package/src/nestjs/http/decorators/log-app-ctx.decorator.ts +32 -0
- package/src/nestjs/http/dtos/date-range.dto.ts +15 -0
- package/src/nestjs/http/dtos/index.ts +1 -0
- package/src/nestjs/http/filters/all-exceptions.filter.ts +92 -0
- package/src/nestjs/http/filters/command-failure.filter.ts +12 -0
- package/src/nestjs/http/filters/index.ts +4 -0
- package/src/nestjs/http/filters/rpc-exceptions.filter.ts +10 -0
- package/src/nestjs/http/filters/too-many-results.filter.ts +12 -0
- package/src/nestjs/http/index.ts +6 -0
- package/src/nestjs/http/interceptors/index.ts +2 -0
- package/src/nestjs/http/interceptors/log-app-ctx.interceptor.ts +109 -0
- package/src/nestjs/http/interceptors/serialize-output.interceptor.ts +19 -0
- package/src/nestjs/http/middleware/http-logger.middleware.ts +31 -0
- package/src/nestjs/http/middleware/index.ts +2 -0
- package/src/nestjs/http/middleware/logger.middleware.ts +21 -0
- package/src/nestjs/http/swagger/index.ts +1 -0
- package/src/nestjs/http/swagger/swagger.ts +44 -0
- package/src/nestjs/index.ts +2 -0
- package/src/testing/command-bus.stub.ts +33 -0
- package/src/testing/event-bus.stub.ts +56 -0
- package/src/testing/event-publisher.stub.ts +24 -0
- package/src/testing/fake-logger.ts +20 -0
- package/src/testing/index.ts +2 -0
- package/src/testing/query-bus.stub.ts +27 -0
- package/src/testing/stub.spec.ts +250 -0
- package/src/testing/stub.ts +170 -0
- package/src/testing/stubs/command-bus.stub.ts +33 -0
- package/src/testing/stubs/event-bus.stub.ts +56 -0
- package/src/testing/stubs/event-publisher.stub.ts +24 -0
- package/src/testing/stubs/index.ts +5 -0
- package/src/testing/stubs/query-bus.stub.ts +27 -0
- package/src/testing/stubs/stub.ts +170 -0
- package/src/utils/array.spec.ts +29 -0
- package/src/utils/array.ts +10 -0
- package/src/utils/base64.spec.ts +18 -0
- package/src/utils/base64.ts +6 -0
- package/src/utils/collection.ts +4 -0
- package/src/utils/common.ts +13 -0
- package/src/utils/csv.ts +49 -0
- package/src/utils/date/date-range.ts +4 -0
- package/src/utils/date/date.spec.ts +100 -0
- package/src/utils/date/date.ts +177 -0
- package/src/utils/date/diff.spec.ts +66 -0
- package/src/utils/date/diffYear.spec.ts +23 -0
- package/src/utils/date/fillMissingRangeValues.spec.ts +523 -0
- package/src/utils/date/groubBy.spec.ts +183 -0
- package/src/utils/date/index.ts +2 -0
- package/src/utils/date/isSame.spec.ts +111 -0
- package/src/utils/file.spec.ts +66 -0
- package/src/utils/file.ts +5 -0
- package/src/utils/hash-key.ts +23 -0
- package/src/utils/index.ts +14 -0
- package/src/utils/invariant.ts +3 -0
- package/src/utils/iso-date.ts +11 -0
- package/src/utils/object.spec.ts +18 -0
- package/src/utils/object.ts +6 -0
- package/src/utils/paginated.ts +36 -0
- package/src/utils/string.spec.ts +10 -0
- package/src/utils/string.ts +19 -0
- package/src/utils/type.ts +9 -0
- package/src/utils/xml.ts +6 -0
- package/src/validation/ensure-array.decorator.ts +5 -0
- package/src/validation/index.ts +7 -0
- package/src/validation/is-iso-date.decorator.spec.ts +29 -0
- package/src/validation/is-iso-date.decorator.ts +30 -0
- package/src/validation/is-less-than-or-equal.decorator.spec.ts +30 -0
- package/src/validation/is-less-than-or-equal.decorator.ts +52 -0
- package/src/validation/is-less-than.decorator.spec.ts +36 -0
- package/src/validation/is-less-than.decorator.ts +52 -0
- package/src/validation/is-more-than-or-equal.decorator.spec.ts +30 -0
- package/src/validation/is-more-than-or-equal.decorator.ts +52 -0
- package/src/validation/is-more-than.decorator.spec.ts +36 -0
- package/src/validation/is-more-than.decorator.ts +52 -0
- package/src/validation/is-time-string.decorator.spec.ts +35 -0
- package/src/validation/is-time-string.decorator.ts +29 -0
- package/tsconfig.build.json +6 -0
- package/tsconfig.json +34 -0
- package/tsconfig.spec.json +14 -0
package/.yarnrc.yml
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#nodeLinker: node-modules
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [1.1.1] - 2026-02-09
|
|
11
|
+
|
|
12
|
+
### Changed - Folder Cleanup & Code Modernization
|
|
13
|
+
|
|
14
|
+
Complete cleanup of the incomplete v1.1.0 folder restructuring, removing all duplicate files and simplifying the directory layout.
|
|
15
|
+
|
|
16
|
+
#### Folder Structure Simplification
|
|
17
|
+
|
|
18
|
+
Consolidated from 17 top-level directories down to 7:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
src/
|
|
22
|
+
├── core/ # Domain, Application, Infrastructure, Errors, Types
|
|
23
|
+
├── modules/ # NestJS modules (config, logger, messaging, queue, knex, graphql, healthcheck)
|
|
24
|
+
├── nestjs/ # NestJS framework integration (http, errors)
|
|
25
|
+
├── validation/ # Validation decorators
|
|
26
|
+
├── utils/ # Utility functions
|
|
27
|
+
├── testing/ # Test stubs and fakes
|
|
28
|
+
└── index.ts
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
#### Removed (duplicates of canonical locations)
|
|
32
|
+
|
|
33
|
+
| Deleted Directory | Canonical Location |
|
|
34
|
+
|---|---|
|
|
35
|
+
| `src/domain/` | `src/core/domain/` |
|
|
36
|
+
| `src/application/` | `src/core/application/` |
|
|
37
|
+
| `src/errors/` | `src/core/errors/` |
|
|
38
|
+
| `src/definitions/` | `src/core/types/` |
|
|
39
|
+
| `src/error-handlers/` | `src/nestjs/errors/handlers/` |
|
|
40
|
+
| `src/error-parsers/` | `src/nestjs/errors/parsers/` |
|
|
41
|
+
| `src/decorators/` | `src/validation/` |
|
|
42
|
+
| `src/filters/` | `src/nestjs/http/filters/` |
|
|
43
|
+
| `src/interceptors/` | `src/nestjs/http/interceptors/` |
|
|
44
|
+
| `src/modules/` | `src/modules/` (moved from `src/nestjs/modules/`) |
|
|
45
|
+
| `src/infrastructure/web/` | `src/nestjs/http/` |
|
|
46
|
+
| `src/core/errors/deprecated/` | removed entirely |
|
|
47
|
+
|
|
48
|
+
#### Moved
|
|
49
|
+
|
|
50
|
+
| From | To |
|
|
51
|
+
|---|---|
|
|
52
|
+
| `src/infrastructure/` | `src/core/infrastructure/` |
|
|
53
|
+
| `src/nestjs/modules/` | `src/modules/` |
|
|
54
|
+
|
|
55
|
+
#### Code Modernization
|
|
56
|
+
|
|
57
|
+
- Replaced `||` with `??` (nullish coalescing) throughout
|
|
58
|
+
- Replaced `&&` guard patterns with `?.` (optional chaining)
|
|
59
|
+
- Applied `as const` and `satisfies` for type-safe constants
|
|
60
|
+
- Replaced `forEach` with `for...of` loops
|
|
61
|
+
- Used `.at(-1)` instead of `arr[arr.length - 1]` (ES2022)
|
|
62
|
+
- Used named imports (`import { v4 as uuidv4 }`) instead of namespace imports
|
|
63
|
+
- Replaced `.substr()` with `.substring()` (non-deprecated)
|
|
64
|
+
- Removed unused color constants and unnecessary JSDoc comments
|
|
65
|
+
- Extracted helper functions to keep methods under 20 lines
|
|
66
|
+
- Renamed constants to UPPER_SNAKE_CASE (`nsid` → `NSID`, `logLevel` → `LOG_LEVELS`, etc.)
|
|
67
|
+
- Made class properties `readonly` where appropriate
|
|
68
|
+
|
|
69
|
+
### Fixed
|
|
70
|
+
|
|
71
|
+
- Fixed `QueueModuleAsyncOptions.inject` type to use proper NestJS `InjectionToken` type
|
|
72
|
+
- Fixed `StubCommandBus.execute()` to return `Promise` matching parent class signature
|
|
73
|
+
- Fixed `AllExceptionsFilter` to pass `DataLog` instead of raw `Error` to logger
|
|
74
|
+
- Fixed `LogAppCtx` decorator to cast computed architecture layer properly
|
|
75
|
+
- Removed deprecated error classes (`http-controller-exception.error.ts`, `platform-unavailable.error.ts`)
|
|
76
|
+
|
|
77
|
+
### Added
|
|
78
|
+
|
|
79
|
+
- New spec tests for domain entities, value objects, errors, persistence, and validation
|
|
80
|
+
|
|
81
|
+
## [1.1.0] - 2026-01-17
|
|
82
|
+
|
|
83
|
+
### Changed - DDD/Clean Architecture Reorganization
|
|
84
|
+
|
|
85
|
+
Major structural reorganization following Domain-Driven Design (DDD), Clean Architecture, and CQRS principles. **No breaking changes** - all exports remain available from the package root.
|
|
86
|
+
|
|
87
|
+
#### Architectural Overview
|
|
88
|
+
|
|
89
|
+
The library is now organized into four main layers:
|
|
90
|
+
- **core/** - Framework-agnostic domain and application building blocks
|
|
91
|
+
- **infrastructure/** - Technology-specific implementations (TypeORM, Knex, RabbitMQ)
|
|
92
|
+
- **nestjs/** - NestJS framework integrations (modules, HTTP layer, error handling)
|
|
93
|
+
- **shared/** - Validation, utilities, and testing helpers
|
|
94
|
+
|
|
95
|
+
#### Core Layer Migration
|
|
96
|
+
|
|
97
|
+
**Domain Entities** (`src/core/domain/entities/`)
|
|
98
|
+
| Old Path | New Path |
|
|
99
|
+
|----------|----------|
|
|
100
|
+
| `src/domain/aggregate-root.ts` | `src/core/domain/entities/aggregate-root.ts` |
|
|
101
|
+
| `src/domain/entity.ts` | `src/core/domain/entities/entity.ts` |
|
|
102
|
+
| `src/domain/identifier.ts` | `src/core/domain/entities/identifier.ts` |
|
|
103
|
+
| `src/domain/unique-entity-id.ts` | `src/core/domain/entities/unique-entity-id.ts` |
|
|
104
|
+
| `src/domain/projection.ts` | `src/core/domain/entities/projection.ts` |
|
|
105
|
+
|
|
106
|
+
**Value Objects** (`src/core/domain/value-objects/`)
|
|
107
|
+
| Old Path | New Path |
|
|
108
|
+
|----------|----------|
|
|
109
|
+
| `src/domain/value-object.ts` | `src/core/domain/value-objects/value-object.ts` |
|
|
110
|
+
| `src/domain/range.ts` | `src/core/domain/value-objects/range.ts` |
|
|
111
|
+
|
|
112
|
+
**Domain Events** (`src/core/domain/events/`)
|
|
113
|
+
| Old Path | New Path |
|
|
114
|
+
|----------|----------|
|
|
115
|
+
| `src/domain/domain-event.ts` | `src/core/domain/events/domain-event.ts` |
|
|
116
|
+
|
|
117
|
+
**Application Layer** (`src/core/application/persistence/`)
|
|
118
|
+
| Old Path | New Path |
|
|
119
|
+
|----------|----------|
|
|
120
|
+
| `src/application/repository.ts` | `src/core/application/persistence/repository.ts` |
|
|
121
|
+
| `src/application/query-builder.ts` | `src/core/application/persistence/query-builder.ts` |
|
|
122
|
+
| `src/application/read-projection.ts` | `src/core/application/persistence/read-projection.ts` |
|
|
123
|
+
|
|
124
|
+
**Types** (`src/core/types/`)
|
|
125
|
+
| Old Path | New Path |
|
|
126
|
+
|----------|----------|
|
|
127
|
+
| `src/domain/architechture-layer.ts` | `src/core/types/architecture-layer.ts` (typo fixed) |
|
|
128
|
+
| `src/definitions/array-element.ts` | `src/core/types/array-element.ts` |
|
|
129
|
+
|
|
130
|
+
**Errors** (`src/core/errors/`)
|
|
131
|
+
| Old Path | New Path |
|
|
132
|
+
|----------|----------|
|
|
133
|
+
| `src/errors/detailed.error.ts` | `src/core/errors/detailed.error.ts` |
|
|
134
|
+
| `src/errors/domain.error.ts` | `src/core/errors/domain.error.ts` |
|
|
135
|
+
| `src/errors/entity-not-found.error.ts` | `src/core/errors/entity-not-found.error.ts` |
|
|
136
|
+
| `src/errors/command-failure.error.ts` | `src/core/errors/command-failure.error.ts` |
|
|
137
|
+
| `src/errors/command-filter.error.ts` | `src/core/errors/command-filter.error.ts` |
|
|
138
|
+
| `src/errors/query-failure.error.ts` | `src/core/errors/query-failure.error.ts` |
|
|
139
|
+
| `src/errors/too-many-results.error.ts` | `src/core/errors/too-many-results.error.ts` |
|
|
140
|
+
| `src/errors/fake-implementation.error.ts` | `src/core/errors/fake-implementation.error.ts` |
|
|
141
|
+
|
|
142
|
+
**Deprecated Errors** (`src/core/errors/deprecated/`)
|
|
143
|
+
| Old Path | New Path |
|
|
144
|
+
|----------|----------|
|
|
145
|
+
| `src/errors/old/http-controller-exception.error.ts` | `src/core/errors/deprecated/http-controller-exception.error.ts` |
|
|
146
|
+
| `src/errors/old/platform-unavailable.error.ts` | `src/core/errors/deprecated/platform-unavailable.error.ts` |
|
|
147
|
+
|
|
148
|
+
#### Infrastructure Layer Migration
|
|
149
|
+
|
|
150
|
+
**Write-Side TypeORM** (`src/infrastructure/persistence/write-side/typeorm/`)
|
|
151
|
+
| Old Path | New Path |
|
|
152
|
+
|----------|----------|
|
|
153
|
+
| `src/infrastructure/persistence/write-side/aggregate-typeorm-repository.ts` | `src/infrastructure/persistence/write-side/typeorm/aggregate-typeorm.repository.ts` |
|
|
154
|
+
| `src/infrastructure/persistence/write-side/entity-typeorm-repository.ts` | `src/infrastructure/persistence/write-side/typeorm/entity-typeorm.repository.ts` |
|
|
155
|
+
| `src/infrastructure/persistence/write-side/orm-mapper.ts` | `src/infrastructure/persistence/write-side/typeorm/orm.mapper.ts` |
|
|
156
|
+
| `src/infrastructure/persistence/write-side/orm-embedded-mapper.ts` | `src/infrastructure/persistence/write-side/typeorm/orm-embedded.mapper.ts` |
|
|
157
|
+
| `src/infrastructure/persistence/write-side/model-attributes.ts` | `src/infrastructure/persistence/write-side/typeorm/model-attributes.ts` |
|
|
158
|
+
|
|
159
|
+
**Read-Side Knex** (`src/infrastructure/persistence/read-side/knex/`)
|
|
160
|
+
| Old Path | New Path |
|
|
161
|
+
|----------|----------|
|
|
162
|
+
| `src/infrastructure/persistence/read-side/knex-query-builder.ts` | `src/infrastructure/persistence/read-side/knex/knex.query-builder.ts` |
|
|
163
|
+
| `src/infrastructure/persistence/read-side/knex-types.definition.ts` | `src/infrastructure/persistence/read-side/knex/knex-types.definition.ts` |
|
|
164
|
+
|
|
165
|
+
**In-Memory** (`src/infrastructure/persistence/in-memory/`)
|
|
166
|
+
| Old Path | New Path |
|
|
167
|
+
|----------|----------|
|
|
168
|
+
| `src/infrastructure/persistence/write-side/in-memory.repository.ts` | `src/infrastructure/persistence/in-memory/in-memory.repository.ts` |
|
|
169
|
+
| `src/infrastructure/persistence/read-side/in-memory.query-builder.ts` | `src/infrastructure/persistence/in-memory/in-memory.query-builder.ts` |
|
|
170
|
+
| `src/application/fake.repository.ts` | `src/infrastructure/persistence/in-memory/fake.repository.ts` |
|
|
171
|
+
|
|
172
|
+
**Messaging** (`src/infrastructure/messaging/`)
|
|
173
|
+
| Old Path | New Path |
|
|
174
|
+
|----------|----------|
|
|
175
|
+
| `src/modules/messaging/messaging.service.ts` | `src/infrastructure/messaging/messaging.service.ts` |
|
|
176
|
+
| `src/modules/queue/messaging.service.ts` | `src/infrastructure/messaging/queue-messaging.service.ts` |
|
|
177
|
+
| `src/modules/queue/queue-manager.service.ts` | `src/infrastructure/messaging/queue-manager.service.ts` |
|
|
178
|
+
| `src/modules/queue/types.ts` | `src/infrastructure/messaging/types.ts` |
|
|
179
|
+
| `src/modules/messaging/rabbit-messaging.service.ts` | `src/infrastructure/messaging/rabbitmq/rabbit-messaging.service.ts` |
|
|
180
|
+
| `src/modules/messaging/fake-messaging.service.ts` | `src/infrastructure/messaging/fake/fake-messaging.service.ts` |
|
|
181
|
+
|
|
182
|
+
**Config** (`src/infrastructure/config/`)
|
|
183
|
+
| Old Path | New Path |
|
|
184
|
+
|----------|----------|
|
|
185
|
+
| `src/modules/config/config.service.ts` | `src/infrastructure/config/config.service.ts` |
|
|
186
|
+
| `src/modules/config/config.provider.ts` | `src/infrastructure/config/config.provider.ts` |
|
|
187
|
+
|
|
188
|
+
#### NestJS Layer Migration
|
|
189
|
+
|
|
190
|
+
**HTTP Filters** (`src/nestjs/http/filters/`)
|
|
191
|
+
| Old Path | New Path |
|
|
192
|
+
|----------|----------|
|
|
193
|
+
| `src/filters/all-exceptions.filter.ts` | `src/nestjs/http/filters/all-exceptions.filter.ts` |
|
|
194
|
+
| `src/filters/command-failure.filter.ts` | `src/nestjs/http/filters/command-failure.filter.ts` |
|
|
195
|
+
| `src/filters/too-many-results.filter.ts` | `src/nestjs/http/filters/too-many-results.filter.ts` |
|
|
196
|
+
| `src/filters/rpc-exceptions.filter.ts` | `src/nestjs/http/filters/rpc-exceptions.filter.ts` |
|
|
197
|
+
|
|
198
|
+
**HTTP Interceptors** (`src/nestjs/http/interceptors/`)
|
|
199
|
+
| Old Path | New Path |
|
|
200
|
+
|----------|----------|
|
|
201
|
+
| `src/interceptors/serialize-output.ts` | `src/nestjs/http/interceptors/serialize-output.interceptor.ts` |
|
|
202
|
+
| `src/modules/logger/interceptor/log-app-ctx-interceptor.ts` | `src/nestjs/http/interceptors/log-app-ctx.interceptor.ts` |
|
|
203
|
+
|
|
204
|
+
**HTTP Middleware** (`src/nestjs/http/middleware/`)
|
|
205
|
+
| Old Path | New Path |
|
|
206
|
+
|----------|----------|
|
|
207
|
+
| `src/modules/logger/middleware/http-logger-middleware.ts` | `src/nestjs/http/middleware/http-logger.middleware.ts` |
|
|
208
|
+
| `src/modules/logger/middleware/logger-middleware.ts` | `src/nestjs/http/middleware/logger.middleware.ts` |
|
|
209
|
+
|
|
210
|
+
**HTTP Decorators** (`src/nestjs/http/decorators/`)
|
|
211
|
+
| Old Path | New Path |
|
|
212
|
+
|----------|----------|
|
|
213
|
+
| `src/modules/logger/decorator/log-app-ctx.ts` | `src/nestjs/http/decorators/log-app-ctx.decorator.ts` |
|
|
214
|
+
|
|
215
|
+
**HTTP DTOs** (`src/nestjs/http/dtos/`)
|
|
216
|
+
| Old Path | New Path |
|
|
217
|
+
|----------|----------|
|
|
218
|
+
| `src/infrastructure/web/common-dtos/date-range.dto.ts` | `src/nestjs/http/dtos/date-range.dto.ts` |
|
|
219
|
+
|
|
220
|
+
**HTTP Swagger** (`src/nestjs/http/swagger/`)
|
|
221
|
+
| Old Path | New Path |
|
|
222
|
+
|----------|----------|
|
|
223
|
+
| `src/infrastructure/web/rest/swagger.ts` | `src/nestjs/http/swagger/swagger.ts` |
|
|
224
|
+
|
|
225
|
+
**Error Handlers** (`src/nestjs/errors/handlers/`)
|
|
226
|
+
| Old Path | New Path |
|
|
227
|
+
|----------|----------|
|
|
228
|
+
| `src/error-handlers/error-handler.ts` | `src/nestjs/errors/handlers/error-handler.ts` |
|
|
229
|
+
| `src/error-handlers/error-handler.type.ts` | `src/nestjs/errors/handlers/error-handler.type.ts` |
|
|
230
|
+
| `src/error-handlers/generic-error-handler.ts` | `src/nestjs/errors/handlers/generic-error-handler.ts` |
|
|
231
|
+
| `src/error-handlers/validation-error-handler.ts` | `src/nestjs/errors/handlers/validation-error-handler.ts` |
|
|
232
|
+
| `src/error-handlers/handle-errors.decorator.ts` | `src/nestjs/errors/handlers/handle-errors.decorator.ts` |
|
|
233
|
+
|
|
234
|
+
**Error Parsers** (`src/nestjs/errors/parsers/`)
|
|
235
|
+
| Old Path | New Path |
|
|
236
|
+
|----------|----------|
|
|
237
|
+
| `src/error-parsers/error-metadata.definition.ts` | `src/nestjs/errors/parsers/error-metadata.definition.ts` |
|
|
238
|
+
| `src/error-parsers/axios-metadata.parser.ts` | `src/nestjs/errors/parsers/axios-metadata.parser.ts` |
|
|
239
|
+
| `src/error-parsers/knex-metadata.parser.ts` | `src/nestjs/errors/parsers/knex-metadata.parser.ts` |
|
|
240
|
+
| `src/error-parsers/typeorm-metadata.parser.ts` | `src/nestjs/errors/parsers/typeorm-metadata.parser.ts` |
|
|
241
|
+
| `src/error-parsers/workos-metadata.parser.ts` | `src/nestjs/errors/parsers/workos-metadata.parser.ts` |
|
|
242
|
+
|
|
243
|
+
**Modules** (`src/nestjs/modules/`)
|
|
244
|
+
| Old Path | New Path |
|
|
245
|
+
|----------|----------|
|
|
246
|
+
| `src/modules/config/config.module.ts` | `src/nestjs/modules/config/config.module.ts` |
|
|
247
|
+
| `src/modules/logger/logger.module.ts` | `src/nestjs/modules/logger/logger.module.ts` |
|
|
248
|
+
| `src/modules/messaging/messaging.module.ts` | `src/nestjs/modules/messaging/messaging.module.ts` |
|
|
249
|
+
| `src/modules/queue/queue.module.ts` | `src/nestjs/modules/queue/queue.module.ts` |
|
|
250
|
+
| `src/modules/knex/knex.module.ts` | `src/nestjs/modules/knex/knex.module.ts` |
|
|
251
|
+
| `src/modules/graphql/paginated-response.object-type.ts` | `src/nestjs/modules/graphql/paginated-response.object-type.ts` |
|
|
252
|
+
| `src/modules/healthcheck/dtos/healthcheck-out.dto.ts` | `src/nestjs/modules/healthcheck/healthcheck-out.dto.ts` |
|
|
253
|
+
|
|
254
|
+
#### Validation Layer Migration
|
|
255
|
+
|
|
256
|
+
**Validation Decorators** (`src/validation/`)
|
|
257
|
+
| Old Path | New Path |
|
|
258
|
+
|----------|----------|
|
|
259
|
+
| `src/decorators/ensure-array.ts` | `src/validation/ensure-array.decorator.ts` |
|
|
260
|
+
| `src/decorators/is-iso-date.ts` | `src/validation/is-iso-date.decorator.ts` |
|
|
261
|
+
| `src/decorators/is-less-than.ts` | `src/validation/is-less-than.decorator.ts` |
|
|
262
|
+
| `src/decorators/is-less-than-or-equal.ts` | `src/validation/is-less-than-or-equal.decorator.ts` |
|
|
263
|
+
| `src/decorators/is-more-than.ts` | `src/validation/is-more-than.decorator.ts` |
|
|
264
|
+
| `src/decorators/is-more-than-or-equal.ts` | `src/validation/is-more-than-or-equal.decorator.ts` |
|
|
265
|
+
| `src/decorators/is-time-string.ts` | `src/validation/is-time-string.decorator.ts` |
|
|
266
|
+
|
|
267
|
+
#### Testing Layer Migration
|
|
268
|
+
|
|
269
|
+
**Stubs** (`src/testing/stubs/`)
|
|
270
|
+
| Old Path | New Path |
|
|
271
|
+
|----------|----------|
|
|
272
|
+
| `src/testing/command-bus.stub.ts` | `src/testing/stubs/command-bus.stub.ts` |
|
|
273
|
+
| `src/testing/event-bus.stub.ts` | `src/testing/stubs/event-bus.stub.ts` |
|
|
274
|
+
| `src/testing/event-publisher.stub.ts` | `src/testing/stubs/event-publisher.stub.ts` |
|
|
275
|
+
| `src/testing/query-bus.stub.ts` | `src/testing/stubs/query-bus.stub.ts` |
|
|
276
|
+
| `src/testing/stub.ts` | `src/testing/stubs/stub.ts` |
|
|
277
|
+
|
|
278
|
+
### Fixed
|
|
279
|
+
- Fixed typo: `architechture-layer.ts` renamed to `architecture-layer.ts`
|
|
280
|
+
- Fixed TypeScript compilation error in `src/utils/file.ts` by ensuring `@types/multer` dependency is installed
|
|
281
|
+
|
|
282
|
+
### Deprecated
|
|
283
|
+
- `src/core/errors/deprecated/http-controller-exception.error.ts` - Use error handlers from `nestjs/errors/handlers` instead
|
|
284
|
+
- `src/core/errors/deprecated/platform-unavailable.error.ts` - Use a more specific error class instead
|
|
285
|
+
|
|
286
|
+
## [1.0.0] - 2026-01-17
|
|
287
|
+
|
|
288
|
+
### Added - Initial Release
|
|
289
|
+
|
|
290
|
+
#### Application Layer
|
|
291
|
+
- `src/application/fake.repository.ts` - Fake repository implementation for testing
|
|
292
|
+
- `src/application/index.ts` - Application layer exports
|
|
293
|
+
- `src/application/query-builder.ts` - Query builder abstraction
|
|
294
|
+
- `src/application/read-projection.ts` - Read projection interface
|
|
295
|
+
- `src/application/repository.ts` - Repository interface
|
|
296
|
+
|
|
297
|
+
#### Decorators
|
|
298
|
+
- `src/decorators/ensure-array.ts` - Array transformation decorator
|
|
299
|
+
- `src/decorators/index.ts` - Decorators exports
|
|
300
|
+
- `src/decorators/is-iso-date.spec.ts` - ISO date validation tests
|
|
301
|
+
- `src/decorators/is-iso-date.ts` - ISO date validation decorator
|
|
302
|
+
- `src/decorators/is-less-than-or-equal.spec.ts` - Less than or equal validation tests
|
|
303
|
+
- `src/decorators/is-less-than-or-equal.ts` - Less than or equal validation decorator
|
|
304
|
+
- `src/decorators/is-less-than.spec.ts` - Less than validation tests
|
|
305
|
+
- `src/decorators/is-less-than.ts` - Less than validation decorator
|
|
306
|
+
- `src/decorators/is-more-than-or-equal.spec.ts` - More than or equal validation tests
|
|
307
|
+
- `src/decorators/is-more-than-or-equal.ts` - More than or equal validation decorator
|
|
308
|
+
- `src/decorators/is-more-than.spec.ts` - More than validation tests
|
|
309
|
+
- `src/decorators/is-more-than.ts` - More than validation decorator
|
|
310
|
+
- `src/decorators/is-time-string.spec.ts` - Time string validation tests
|
|
311
|
+
- `src/decorators/is-time-string.ts` - Time string validation decorator
|
|
312
|
+
|
|
313
|
+
#### Definitions
|
|
314
|
+
- `src/definitions/array-element.ts` - Array element type definitions
|
|
315
|
+
- `src/definitions/index.ts` - Definitions exports
|
|
316
|
+
|
|
317
|
+
#### Domain Layer
|
|
318
|
+
- `src/domain/aggregate-root.ts` - Aggregate root base class
|
|
319
|
+
- `src/domain/architechture-layer.ts` - Architecture layer definitions
|
|
320
|
+
- `src/domain/domain-event.ts` - Domain event base class
|
|
321
|
+
- `src/domain/entity.ts` - Entity base class
|
|
322
|
+
- `src/domain/identifier.ts` - Identifier interface
|
|
323
|
+
- `src/domain/index.ts` - Domain layer exports
|
|
324
|
+
- `src/domain/projection.ts` - Projection interface
|
|
325
|
+
- `src/domain/range.ts` - Range value object
|
|
326
|
+
- `src/domain/unique-entity-id.ts` - Unique entity identifier
|
|
327
|
+
- `src/domain/value-object.ts` - Value object base class
|
|
328
|
+
|
|
329
|
+
#### Error Handlers
|
|
330
|
+
- `src/error-handlers/error-handler.spec.ts` - Error handler tests
|
|
331
|
+
- `src/error-handlers/error-handler.ts` - Error handler interface
|
|
332
|
+
- `src/error-handlers/error-handler.type.ts` - Error handler type definitions
|
|
333
|
+
- `src/error-handlers/generic-error-handler.spec.ts` - Generic error handler tests
|
|
334
|
+
- `src/error-handlers/generic-error-handler.ts` - Generic error handler implementation
|
|
335
|
+
- `src/error-handlers/handle-errors.decorator.ts` - Error handling decorator
|
|
336
|
+
- `src/error-handlers/handle-errors.spec.ts` - Error handling decorator tests
|
|
337
|
+
- `src/error-handlers/index.ts` - Error handlers exports
|
|
338
|
+
- `src/error-handlers/validation-error-handler.spec.ts` - Validation error handler tests
|
|
339
|
+
- `src/error-handlers/validation-error-handler.ts` - Validation error handler implementation
|
|
340
|
+
|
|
341
|
+
#### Error Parsers
|
|
342
|
+
- `src/error-parsers/axios-metadata.parser.ts` - Axios error metadata parser
|
|
343
|
+
- `src/error-parsers/error-metadata.definition.ts` - Error metadata type definitions
|
|
344
|
+
- `src/error-parsers/index.ts` - Error parsers exports
|
|
345
|
+
- `src/error-parsers/knex-metadata.parser.ts` - Knex error metadata parser
|
|
346
|
+
- `src/error-parsers/typeorm-metadata.parser.ts` - TypeORM error metadata parser
|
|
347
|
+
- `src/error-parsers/workos-metadata.parser.ts` - WorkOS error metadata parser
|
|
348
|
+
|
|
349
|
+
#### Errors
|
|
350
|
+
- `src/errors/command-failure.error.ts` - Command failure error
|
|
351
|
+
- `src/errors/command-filter.error.ts` - Command filter error
|
|
352
|
+
- `src/errors/detailed.error.ts` - Detailed error with metadata
|
|
353
|
+
- `src/errors/domain.error.ts` - Domain error base class
|
|
354
|
+
- `src/errors/entity-not-found.error.ts` - Entity not found error
|
|
355
|
+
- `src/errors/fake-implementation.error.ts` - Fake implementation error
|
|
356
|
+
- `src/errors/index.ts` - Errors exports
|
|
357
|
+
- `src/errors/old/http-controller-exception.error.ts` - Legacy HTTP controller exception
|
|
358
|
+
- `src/errors/old/platform-unavailable.error.ts` - Legacy platform unavailable error
|
|
359
|
+
- `src/errors/query-failure.error.ts` - Query failure error
|
|
360
|
+
- `src/errors/too-many-results.error.ts` - Too many results error
|
|
361
|
+
|
|
362
|
+
#### Filters
|
|
363
|
+
- `src/filters/all-exceptions.filter.spec.ts` - All exceptions filter tests
|
|
364
|
+
- `src/filters/all-exceptions.filter.ts` - All exceptions filter implementation
|
|
365
|
+
- `src/filters/command-failure.filter.spec.ts` - Command failure filter tests
|
|
366
|
+
- `src/filters/command-failure.filter.ts` - Command failure filter implementation
|
|
367
|
+
- `src/filters/index.ts` - Filters exports
|
|
368
|
+
- `src/filters/rpc-exceptions.filter.ts` - RPC exceptions filter
|
|
369
|
+
- `src/filters/too-many-results.filter.ts` - Too many results filter
|
|
370
|
+
|
|
371
|
+
#### Infrastructure - Persistence
|
|
372
|
+
- `src/infrastructure/persistence/errors/model-to-entity-conversion.error.ts` - Model to entity conversion error
|
|
373
|
+
- `src/infrastructure/persistence/errors/persistence.error.ts` - Persistence error
|
|
374
|
+
- `src/infrastructure/persistence/index.ts` - Persistence layer exports
|
|
375
|
+
- `src/infrastructure/persistence/read-side/in-memory.query-builder.ts` - In-memory query builder
|
|
376
|
+
- `src/infrastructure/persistence/read-side/knex-query-builder.ts` - Knex query builder
|
|
377
|
+
- `src/infrastructure/persistence/read-side/knex-types.definition.ts` - Knex type definitions
|
|
378
|
+
- `src/infrastructure/persistence/write-side/aggregate-typeorm-repository.ts` - Aggregate TypeORM repository
|
|
379
|
+
- `src/infrastructure/persistence/write-side/entity-typeorm-repository.ts` - Entity TypeORM repository
|
|
380
|
+
- `src/infrastructure/persistence/write-side/in-memory.repository.ts` - In-memory repository
|
|
381
|
+
- `src/infrastructure/persistence/write-side/model-attributes.ts` - Model attributes utilities
|
|
382
|
+
- `src/infrastructure/persistence/write-side/orm-embedded-mapper.ts` - ORM embedded mapper
|
|
383
|
+
- `src/infrastructure/persistence/write-side/orm-mapper.ts` - ORM mapper
|
|
384
|
+
|
|
385
|
+
#### Infrastructure - Web
|
|
386
|
+
- `src/infrastructure/web/common-dtos/date-range.dto.ts` - Date range DTO
|
|
387
|
+
- `src/infrastructure/web/common-dtos/index.ts` - Common DTOs exports
|
|
388
|
+
- `src/infrastructure/web/index.ts` - Web infrastructure exports
|
|
389
|
+
- `src/infrastructure/web/rest/index.ts` - REST infrastructure exports
|
|
390
|
+
- `src/infrastructure/web/rest/swagger.ts` - Swagger configuration
|
|
391
|
+
|
|
392
|
+
#### Interceptors
|
|
393
|
+
- `src/interceptors/index.ts` - Interceptors exports
|
|
394
|
+
- `src/interceptors/serialize-output.ts` - Output serialization interceptor
|
|
395
|
+
|
|
396
|
+
#### Modules - Config
|
|
397
|
+
- `src/modules/config/config.module.ts` - Configuration module
|
|
398
|
+
- `src/modules/config/config.provider.spec.ts` - Configuration provider tests
|
|
399
|
+
- `src/modules/config/config.provider.ts` - Configuration provider
|
|
400
|
+
- `src/modules/config/config.service.ts` - Configuration service
|
|
401
|
+
- `src/modules/config/index.ts` - Config module exports
|
|
402
|
+
|
|
403
|
+
#### Modules - GraphQL
|
|
404
|
+
- `src/modules/graphql/index.ts` - GraphQL module exports
|
|
405
|
+
- `src/modules/graphql/paginated-response.object-type.ts` - Paginated response GraphQL type
|
|
406
|
+
|
|
407
|
+
#### Modules - Healthcheck
|
|
408
|
+
- `src/modules/healthcheck/dtos/healthcheck-out.dto.ts` - Healthcheck output DTO
|
|
409
|
+
- `src/modules/healthcheck/index.ts` - Healthcheck module exports
|
|
410
|
+
|
|
411
|
+
#### Modules - Knex
|
|
412
|
+
- `src/modules/knex/index.ts` - Knex module exports
|
|
413
|
+
- `src/modules/knex/knex-core.module.ts` - Knex core module
|
|
414
|
+
- `src/modules/knex/knex.decorator.ts` - Knex decorator
|
|
415
|
+
- `src/modules/knex/knex.interface.ts` - Knex interface
|
|
416
|
+
- `src/modules/knex/knex.module.ts` - Knex module
|
|
417
|
+
- `src/modules/knex/knex.token.ts` - Knex injection token
|
|
418
|
+
|
|
419
|
+
#### Modules - Logger
|
|
420
|
+
- `src/modules/logger/app-logger/app-logger.spec.ts` - App logger tests
|
|
421
|
+
- `src/modules/logger/app-logger/app-logger.ts` - App logger implementation
|
|
422
|
+
- `src/modules/logger/decorator/log-app-ctx.spec.ts` - Log application context decorator tests
|
|
423
|
+
- `src/modules/logger/decorator/log-app-ctx.ts` - Log application context decorator
|
|
424
|
+
- `src/modules/logger/index.ts` - Logger module exports
|
|
425
|
+
- `src/modules/logger/interceptor/log-app-ctx-interceptor.spec.ts` - Log context interceptor tests
|
|
426
|
+
- `src/modules/logger/interceptor/log-app-ctx-interceptor.ts` - Log context interceptor
|
|
427
|
+
- `src/modules/logger/logger.module.ts` - Logger module
|
|
428
|
+
- `src/modules/logger/middleware/http-logger-middleware.spec.ts` - HTTP logger middleware tests
|
|
429
|
+
- `src/modules/logger/middleware/http-logger-middleware.ts` - HTTP logger middleware
|
|
430
|
+
- `src/modules/logger/middleware/logger-middleware.spec.ts` - Logger middleware tests
|
|
431
|
+
- `src/modules/logger/middleware/logger-middleware.ts` - Logger middleware
|
|
432
|
+
- `src/modules/logger/service/log.ts` - Log utility
|
|
433
|
+
- `src/modules/logger/service/logger.service.spec.ts` - Logger service tests
|
|
434
|
+
- `src/modules/logger/service/logger.service.ts` - Logger service
|
|
435
|
+
- `src/modules/logger/transports/console-color.transport.ts` - Console color transport
|
|
436
|
+
- `src/modules/logger/transports/console-json.transport.ts` - Console JSON transport
|
|
437
|
+
- `src/modules/logger/transports/console.transport.ts` - Console transport
|
|
438
|
+
- `src/modules/logger/transports/fake.transport.ts` - Fake transport for testing
|
|
439
|
+
- `src/modules/logger/transports/index.ts` - Transports exports
|
|
440
|
+
- `src/modules/logger/transports/logger-transport.spec.ts` - Logger transport tests
|
|
441
|
+
- `src/modules/logger/transports/logger-transport.ts` - Logger transport interface
|
|
442
|
+
|
|
443
|
+
#### Modules - Messaging
|
|
444
|
+
- `src/modules/messaging/fake-messaging.service.ts` - Fake messaging service
|
|
445
|
+
- `src/modules/messaging/index.ts` - Messaging module exports
|
|
446
|
+
- `src/modules/messaging/messaging.module.ts` - Messaging module
|
|
447
|
+
- `src/modules/messaging/messaging.service.ts` - Messaging service interface
|
|
448
|
+
- `src/modules/messaging/rabbit-messaging.service.ts` - RabbitMQ messaging service
|
|
449
|
+
|
|
450
|
+
#### Modules - Queue
|
|
451
|
+
- `src/modules/queue/default-queue-name.resolver.ts` - Default queue name resolver
|
|
452
|
+
- `src/modules/queue/fake-messaging.service.ts` - Fake messaging service for queues
|
|
453
|
+
- `src/modules/queue/fake-queue-manager.service.ts` - Fake queue manager
|
|
454
|
+
- `src/modules/queue/index.ts` - Queue module exports
|
|
455
|
+
- `src/modules/queue/messaging.service.ts` - Queue messaging service
|
|
456
|
+
- `src/modules/queue/queue-manager.service.ts` - Queue manager interface
|
|
457
|
+
- `src/modules/queue/queue.module.ts` - Queue module
|
|
458
|
+
- `src/modules/queue/rabbit-messaging.service.ts` - RabbitMQ messaging service
|
|
459
|
+
- `src/modules/queue/rabbit-queue-manager.service.ts` - RabbitMQ queue manager
|
|
460
|
+
- `src/modules/queue/types.ts` - Queue type definitions
|
|
461
|
+
|
|
462
|
+
#### Testing Utilities
|
|
463
|
+
- `src/testing/command-bus.stub.ts` - Command bus stub for testing
|
|
464
|
+
- `src/testing/event-bus.stub.ts` - Event bus stub for testing
|
|
465
|
+
- `src/testing/event-publisher.stub.ts` - Event publisher stub for testing
|
|
466
|
+
- `src/testing/fake-logger.ts` - Fake logger for testing
|
|
467
|
+
- `src/testing/index.ts` - Testing utilities exports
|
|
468
|
+
- `src/testing/query-bus.stub.ts` - Query bus stub for testing
|
|
469
|
+
- `src/testing/stub.spec.ts` - Stub utilities tests
|
|
470
|
+
- `src/testing/stub.ts` - Stub utilities
|
|
471
|
+
|
|
472
|
+
#### Utils
|
|
473
|
+
- `src/utils/array.spec.ts` - Array utilities tests
|
|
474
|
+
- `src/utils/array.ts` - Array utilities
|
|
475
|
+
- `src/utils/base64.spec.ts` - Base64 utilities tests
|
|
476
|
+
- `src/utils/base64.ts` - Base64 encoding/decoding utilities
|
|
477
|
+
- `src/utils/collection.ts` - Collection utilities
|
|
478
|
+
- `src/utils/common.ts` - Common utilities
|
|
479
|
+
- `src/utils/csv.ts` - CSV utilities
|
|
480
|
+
- `src/utils/file.spec.ts` - File utilities tests
|
|
481
|
+
- `src/utils/file.ts` - File utilities (file extension extraction)
|
|
482
|
+
- `src/utils/hash-key.ts` - Hash key utilities
|
|
483
|
+
- `src/utils/index.ts` - Utils exports
|
|
484
|
+
- `src/utils/invariant.ts` - Invariant assertion utilities
|
|
485
|
+
- `src/utils/iso-date.ts` - ISO date utilities
|
|
486
|
+
- `src/utils/object.spec.ts` - Object utilities tests
|
|
487
|
+
- `src/utils/object.ts` - Object utilities
|
|
488
|
+
- `src/utils/paginated.ts` - Pagination utilities
|
|
489
|
+
- `src/utils/string.spec.ts` - String utilities tests
|
|
490
|
+
- `src/utils/string.ts` - String utilities
|
|
491
|
+
- `src/utils/type.ts` - Type utilities
|
|
492
|
+
- `src/utils/xml.ts` - XML utilities
|
|
493
|
+
|
|
494
|
+
#### Utils - Date
|
|
495
|
+
- `src/utils/date/date-range.ts` - Date range utilities
|
|
496
|
+
- `src/utils/date/date.spec.ts` - Date utilities tests
|
|
497
|
+
- `src/utils/date/date.ts` - Date utilities
|
|
498
|
+
- `src/utils/date/diff.spec.ts` - Date diff tests
|
|
499
|
+
- `src/utils/date/diffYear.spec.ts` - Year diff tests
|
|
500
|
+
- `src/utils/date/fillMissingRangeValues.spec.ts` - Fill missing range values tests
|
|
501
|
+
- `src/utils/date/groubBy.spec.ts` - Group by date tests
|
|
502
|
+
- `src/utils/date/index.ts` - Date utilities exports
|
|
503
|
+
- `src/utils/date/isSame.spec.ts` - Date comparison tests
|
|
504
|
+
|
|
505
|
+
#### Root Files
|
|
506
|
+
- `src/index.ts` - Main library exports
|
|
507
|
+
|
|
508
|
+
#### Configuration Files
|
|
509
|
+
- `.eslintrc.js` - ESLint configuration
|
|
510
|
+
- `.yarnrc.yml` - Yarn configuration
|
|
511
|
+
- `jest.config.ts` - Jest configuration
|
|
512
|
+
- `jest/jest.config.base.ts` - Jest base configuration
|
|
513
|
+
- `jest/jest.spec.base.ts` - Jest spec base configuration
|
|
514
|
+
- `package.json` - Package configuration and dependencies
|
|
515
|
+
- `tsconfig.build.json` - TypeScript build configuration
|
|
516
|
+
- `tsconfig.json` - TypeScript configuration
|
|
517
|
+
- `tsconfig.spec.json` - TypeScript test configuration
|
|
518
|
+
|
|
519
|
+
### Dependencies
|
|
520
|
+
- NestJS framework (v11.x) with core modules
|
|
521
|
+
- TypeORM (v0.3.25) for ORM
|
|
522
|
+
- Knex (v3.1.0) for query building
|
|
523
|
+
- GraphQL (v16.11.0) with NestJS integration
|
|
524
|
+
- RabbitMQ via amqplib for messaging
|
|
525
|
+
- Jest (v30.x) for testing
|
|
526
|
+
- TypeScript (v5.8.3)
|
|
527
|
+
- Various utility libraries (lodash, luxon, uuid, etc.)
|
package/README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import eslint from "@eslint/js";
|
|
2
|
+
import tseslint from "typescript-eslint";
|
|
3
|
+
import prettierConfig from "eslint-config-prettier";
|
|
4
|
+
import noOnlyTests from "eslint-plugin-no-only-tests";
|
|
5
|
+
import globals from "globals";
|
|
6
|
+
|
|
7
|
+
export default tseslint.config(
|
|
8
|
+
{
|
|
9
|
+
ignores: ["node_modules/", "dist/", "eslint.config.mjs"],
|
|
10
|
+
},
|
|
11
|
+
eslint.configs.recommended,
|
|
12
|
+
...tseslint.configs.recommendedTypeChecked,
|
|
13
|
+
prettierConfig,
|
|
14
|
+
{
|
|
15
|
+
languageOptions: {
|
|
16
|
+
ecmaVersion: 2022,
|
|
17
|
+
sourceType: "module",
|
|
18
|
+
globals: {
|
|
19
|
+
...globals.node,
|
|
20
|
+
...globals.jest,
|
|
21
|
+
},
|
|
22
|
+
parserOptions: {
|
|
23
|
+
project: "./tsconfig.json",
|
|
24
|
+
tsconfigRootDir: import.meta.dirname,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
plugins: {
|
|
28
|
+
"no-only-tests": noOnlyTests,
|
|
29
|
+
},
|
|
30
|
+
rules: {
|
|
31
|
+
semi: "error",
|
|
32
|
+
curly: "error",
|
|
33
|
+
"@typescript-eslint/no-unsafe-return": "warn",
|
|
34
|
+
"@typescript-eslint/no-unsafe-assignment": "warn",
|
|
35
|
+
"@typescript-eslint/no-unsafe-call": "warn",
|
|
36
|
+
"@typescript-eslint/no-unsafe-argument": "warn",
|
|
37
|
+
"@typescript-eslint/no-unsafe-member-access": "warn",
|
|
38
|
+
"no-only-tests/no-only-tests": "error",
|
|
39
|
+
"no-console": "error",
|
|
40
|
+
"@typescript-eslint/no-unused-vars": [
|
|
41
|
+
"error",
|
|
42
|
+
{ vars: "all", args: "after-used", ignoreRestSiblings: false },
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
files: ["**/*.spec.ts", "**/*.integration.ts", "**/*.e2e.ts"],
|
|
48
|
+
rules: {
|
|
49
|
+
"no-only-tests/no-only-tests": "error",
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
);
|
package/invariant.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "foundation",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"targets": [
|
|
5
|
+
"claude"
|
|
6
|
+
],
|
|
7
|
+
"packages": {
|
|
8
|
+
"permissions": {
|
|
9
|
+
"name": "permissions",
|
|
10
|
+
"version": "1.0.0",
|
|
11
|
+
"source": "github",
|
|
12
|
+
"sourceUrl": "github:invariant-guru/permissions"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"active": [
|
|
16
|
+
{
|
|
17
|
+
"package": "permissions",
|
|
18
|
+
"type": "instructions",
|
|
19
|
+
"item": "high"
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
roots: ["<rootDir>/src"],
|
|
3
|
+
moduleDirectories: ["node_modules"],
|
|
4
|
+
testPathIgnorePatterns: ["./node_modules/"],
|
|
5
|
+
testEnvironment: "node",
|
|
6
|
+
preset: "ts-jest/presets/default-esm",
|
|
7
|
+
transform: {
|
|
8
|
+
"^.+\\.[tj]s$": [
|
|
9
|
+
"ts-jest",
|
|
10
|
+
{
|
|
11
|
+
tsconfig: "<rootDir>/tsconfig.spec.json",
|
|
12
|
+
useESM: true,
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
},
|
|
16
|
+
// These modules will be excluded from transformIgnorePatterns configuration which means they will be transformed.
|
|
17
|
+
transformIgnorePatterns: ["/node_modules/(?!(jose)/)"],
|
|
18
|
+
moduleNameMapper: {
|
|
19
|
+
"^src/(.*)$": "<rootDir>/src/$1",
|
|
20
|
+
"^(\\.{1,2}/.*)\\.js$": "$1",
|
|
21
|
+
},
|
|
22
|
+
extensionsToTreatAsEsm: [".ts"],
|
|
23
|
+
maxWorkers: "25%",
|
|
24
|
+
moduleFileExtensions: ["ts", "js"],
|
|
25
|
+
restoreMocks: true,
|
|
26
|
+
workerIdleMemoryLimit: "1024MB",
|
|
27
|
+
testEnvironmentOptions: {
|
|
28
|
+
globalsCleanup: "on",
|
|
29
|
+
},
|
|
30
|
+
};
|