@elsikora/nestjs-crud-config 2.0.2-dev.1 → 3.0.0-dev.1
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/README.md +50 -67
- package/dist/cjs/index.js +0 -12
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/modules/config/config.module.js +0 -6
- package/dist/cjs/modules/config/config.module.js.map +1 -1
- package/dist/cjs/modules/config/config.service.d.ts +3 -0
- package/dist/cjs/modules/config/config.service.js +41 -49
- package/dist/cjs/modules/config/config.service.js.map +1 -1
- package/dist/cjs/modules/config/data/index.d.ts +0 -3
- package/dist/cjs/modules/config/interface/delete-options.interface.d.ts +3 -2
- package/dist/cjs/modules/config/interface/get-list-options.interface.d.ts +3 -2
- package/dist/cjs/modules/config/interface/get-options.interface.d.ts +3 -2
- package/dist/cjs/modules/config/interface/set-options.interface.d.ts +3 -2
- package/dist/cjs/modules/config/migration/interface/migration-definition.interface.d.ts +3 -3
- package/dist/cjs/modules/config/migration/interface/migration-options.interface.d.ts +2 -1
- package/dist/cjs/modules/config/migration/migration.service.d.ts +2 -3
- package/dist/cjs/modules/config/migration/migration.service.js +15 -37
- package/dist/cjs/modules/config/migration/migration.service.js.map +1 -1
- package/dist/cjs/package.json +0 -1
- package/dist/cjs/shared/interface/utility/create-dynamic-entity/relation-options.interface.d.ts +1 -1
- package/dist/esm/index.js +0 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/modules/config/config.module.js +0 -6
- package/dist/esm/modules/config/config.module.js.map +1 -1
- package/dist/esm/modules/config/config.service.d.ts +3 -0
- package/dist/esm/modules/config/config.service.js +41 -49
- package/dist/esm/modules/config/config.service.js.map +1 -1
- package/dist/esm/modules/config/data/index.d.ts +0 -3
- package/dist/esm/modules/config/interface/delete-options.interface.d.ts +3 -2
- package/dist/esm/modules/config/interface/get-list-options.interface.d.ts +3 -2
- package/dist/esm/modules/config/interface/get-options.interface.d.ts +3 -2
- package/dist/esm/modules/config/interface/set-options.interface.d.ts +3 -2
- package/dist/esm/modules/config/migration/interface/migration-definition.interface.d.ts +3 -3
- package/dist/esm/modules/config/migration/interface/migration-options.interface.d.ts +2 -1
- package/dist/esm/modules/config/migration/migration.service.d.ts +2 -3
- package/dist/esm/modules/config/migration/migration.service.js +15 -37
- package/dist/esm/modules/config/migration/migration.service.js.map +1 -1
- package/dist/esm/package.json +0 -1
- package/dist/esm/shared/interface/utility/create-dynamic-entity/relation-options.interface.d.ts +1 -1
- package/package.json +6 -5
- package/dist/cjs/modules/config/data/event/before-insert.event.d.ts +0 -20
- package/dist/cjs/modules/config/data/event/before-insert.event.js +0 -23
- package/dist/cjs/modules/config/data/event/before-insert.event.js.map +0 -1
- package/dist/cjs/modules/config/data/event/index.d.ts +0 -1
- package/dist/cjs/modules/config/data/listener/before-insert.listener.d.ts +0 -19
- package/dist/cjs/modules/config/data/listener/before-insert.listener.js +0 -60
- package/dist/cjs/modules/config/data/listener/before-insert.listener.js.map +0 -1
- package/dist/cjs/modules/config/data/listener/index.d.ts +0 -1
- package/dist/cjs/modules/config/data/subscriber/before-insert.subscriber.d.ts +0 -25
- package/dist/cjs/modules/config/data/subscriber/before-insert.subscriber.js +0 -74
- package/dist/cjs/modules/config/data/subscriber/before-insert.subscriber.js.map +0 -1
- package/dist/cjs/modules/config/data/subscriber/index.d.ts +0 -1
- package/dist/esm/modules/config/data/event/before-insert.event.d.ts +0 -20
- package/dist/esm/modules/config/data/event/before-insert.event.js +0 -21
- package/dist/esm/modules/config/data/event/before-insert.event.js.map +0 -1
- package/dist/esm/modules/config/data/event/index.d.ts +0 -1
- package/dist/esm/modules/config/data/listener/before-insert.listener.d.ts +0 -19
- package/dist/esm/modules/config/data/listener/before-insert.listener.js +0 -60
- package/dist/esm/modules/config/data/listener/before-insert.listener.js.map +0 -1
- package/dist/esm/modules/config/data/listener/index.d.ts +0 -1
- package/dist/esm/modules/config/data/subscriber/before-insert.subscriber.d.ts +0 -25
- package/dist/esm/modules/config/data/subscriber/before-insert.subscriber.js +0 -74
- package/dist/esm/modules/config/data/subscriber/before-insert.subscriber.js.map +0 -1
- package/dist/esm/modules/config/data/subscriber/index.d.ts +0 -1
package/README.md
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
- [Description](#-description)
|
|
17
17
|
- [Features](#-features)
|
|
18
18
|
- [Installation](#-installation)
|
|
19
|
+
- [Migrating to 3.0](#migrating-to-30)
|
|
19
20
|
- [Usage](#-usage)
|
|
20
21
|
- [Migration System](#-migration-system)
|
|
21
22
|
- [API Documentation](#-api-documentation)
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
|
|
30
31
|
NestJS CRUD Config is a powerful configuration management module that revolutionizes how NestJS applications handle configuration data. Unlike traditional environment variable approaches, this library stores configuration in a database with full CRUD operations, making it perfect for dynamic configuration management across multiple environments and services.
|
|
31
32
|
|
|
32
|
-
The module provides hierarchical organization through sections and data entries, supports optional AES-256-GCM encryption for sensitive values, and includes automatic REST API endpoints for configuration management. Built with TypeScript-first design and leveraging the NestJS CRUD Automator for automatic API generation, it features dynamic entity creation at runtime,
|
|
33
|
+
The module provides hierarchical organization through sections and data entries, supports optional AES-256-GCM encryption for sensitive values, and includes automatic REST API endpoints for configuration management. Built with TypeScript-first design and leveraging the NestJS CRUD Automator for automatic API generation, it features dynamic entity creation at runtime, named transaction ownership, and intelligent caching.
|
|
33
34
|
|
|
34
35
|
Whether you're managing API keys across different environments, storing feature flags, or maintaining application settings that need to change without redeployment, this module provides a robust, secure, and scalable solution for microservice architectures, multi-tenant applications, and any system requiring centralized, database-backed configuration management with real-time updates.
|
|
35
36
|
|
|
@@ -45,7 +46,7 @@ Whether you're managing API keys across different environments, storing feature
|
|
|
45
46
|
- **🎯 TypeScript-first design** - Full type safety with comprehensive interfaces and type definitions
|
|
46
47
|
- **🚀 NestJS CRUD Automator integration** - Leverages advanced CRUD automation for controllers and services
|
|
47
48
|
- **💾 Intelligent caching** - Built-in caching support with configurable TTL and cache size limits
|
|
48
|
-
- **🔄
|
|
49
|
+
- **🔄 Named transaction ownership** - Each Automator-owned unit of work uses one exact TypeORM manager, including joined migration writes
|
|
49
50
|
- **🎛️ Highly customizable** - Configure table prefixes, field lengths, validation rules, and entity relationships
|
|
50
51
|
- **🚦 Flexible controller configuration** - Customize API paths, disable endpoints, or run in headless mode
|
|
51
52
|
- **🔧 Advanced CRUD customization** - Full control over routes, swagger documentation, and controller behavior
|
|
@@ -54,15 +55,17 @@ Whether you're managing API keys across different environments, storing feature
|
|
|
54
55
|
|
|
55
56
|
## 🛠 Installation
|
|
56
57
|
|
|
58
|
+
These docs describe the upcoming CrudConfig 3.0 contract. Use the 3.x-only range below. It intentionally fails until a 3.0 prerelease exists instead of resolving incompatible CrudConfig 2.x:
|
|
59
|
+
|
|
57
60
|
```bash
|
|
58
|
-
#
|
|
59
|
-
npm install @elsikora/nestjs-crud-config
|
|
61
|
+
# npm
|
|
62
|
+
npm install @elsikora/nestjs-crud-config@^3.0.0-0
|
|
60
63
|
|
|
61
|
-
#
|
|
62
|
-
yarn add @elsikora/nestjs-crud-config
|
|
64
|
+
# yarn
|
|
65
|
+
yarn add @elsikora/nestjs-crud-config@^3.0.0-0
|
|
63
66
|
|
|
64
|
-
#
|
|
65
|
-
pnpm add @elsikora/nestjs-crud-config
|
|
67
|
+
# pnpm
|
|
68
|
+
pnpm add @elsikora/nestjs-crud-config@^3.0.0-0
|
|
66
69
|
```
|
|
67
70
|
|
|
68
71
|
### Prerequisites
|
|
@@ -70,33 +73,40 @@ pnpm add @elsikora/nestjs-crud-config
|
|
|
70
73
|
Install the required peer dependencies:
|
|
71
74
|
|
|
72
75
|
```bash
|
|
73
|
-
npm install @elsikora/nestjs-crud-automator@^
|
|
74
|
-
npm install @nestjs/passport@^11.0.5 @nestjs/platform-fastify@^11.1.24 @nestjs/swagger
|
|
76
|
+
npm install @elsikora/nestjs-crud-automator@^3.0.2 @nestjs/common@^11.1.24 @nestjs/core@^11.1.24 @nestjs/typeorm@^11.0.0 typeorm@^0.3.20
|
|
77
|
+
npm install @nestjs/passport@^11.0.5 @nestjs/platform-fastify@^11.1.24 @nestjs/swagger@11.4.2 @nestjs/throttler@^6.5.0 class-transformer@^0.5.1 class-validator@^0.15.1 fastify@^5.8.5 lodash@^4.18.1
|
|
75
78
|
```
|
|
76
79
|
|
|
77
|
-
### Automator
|
|
80
|
+
### Automator 3 compatibility
|
|
78
81
|
|
|
79
|
-
|
|
82
|
+
The upcoming CrudConfig 3 release requires `@elsikora/nestjs-crud-automator >=3.0.2-0 <4.0.0`. Automator 2 is not supported.
|
|
80
83
|
|
|
81
|
-
|
|
84
|
+
Generated route overrides continue to use Automator generation config:
|
|
82
85
|
|
|
83
86
|
```typescript
|
|
84
87
|
DELETE: {
|
|
85
|
-
|
|
86
|
-
|
|
88
|
+
generation: {
|
|
89
|
+
isEnabled: false,
|
|
90
|
+
},
|
|
91
|
+
},
|
|
87
92
|
```
|
|
88
93
|
|
|
89
|
-
|
|
94
|
+
ConfigData `CREATE` and `UPDATE` use Automator nested request relation loading. The built-in section relation expects request bodies such as `{ "section": { "id": "section-uuid" } }`.
|
|
90
95
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
The tested Swagger baseline is exact `11.4.2`. See [Migrating to 3.0](#migrating-to-30) for transaction and EventEmitter changes.
|
|
97
|
+
|
|
98
|
+
### Migrating to 3.0
|
|
99
|
+
|
|
100
|
+
The upcoming 3.0 release is breaking:
|
|
101
|
+
|
|
102
|
+
- Automator 2 compatibility is removed.
|
|
103
|
+
- Transaction-enabled migration execution and rollback use the named `crud-config-migrations` Automator owner.
|
|
104
|
+
- Standalone `CrudConfigService.set()` uses the named `crud-config-set` owner.
|
|
105
|
+
- Migration config operations must receive the callback `EntityManager` through `eventManager` so they join instead of opening a nested owner.
|
|
106
|
+
- The ConfigData before-insert EventEmitter pipeline and `@nestjs/event-emitter` dependency are removed.
|
|
107
|
+
- The database unique constraint remains authoritative, and Automator maps duplicate writes to `409 CONFIGDATA_DUPLICATE_KEY`.
|
|
98
108
|
|
|
99
|
-
|
|
109
|
+
See the complete [3.0 migration guide](docs/guides/migrating-to-3-0/page.mdx).
|
|
100
110
|
|
|
101
111
|
### Database Support
|
|
102
112
|
|
|
@@ -338,7 +348,7 @@ The NestJS CRUD Config module includes a powerful **production-ready migration s
|
|
|
338
348
|
### Key Features
|
|
339
349
|
|
|
340
350
|
- **🔄 Automatic execution on startup** - Migrations run automatically when the application bootstraps
|
|
341
|
-
- **💾
|
|
351
|
+
- **💾 Named transaction support** - Transaction-enabled migrations run inside one named Automator owner
|
|
342
352
|
- **🌍 Environment-specific configurations** - Create different configurations for different environments
|
|
343
353
|
- **📊 Migration tracking** - Complete audit trail with timestamps and execution status
|
|
344
354
|
- **🔙 Rollback support** - Define rollback procedures for each migration
|
|
@@ -395,6 +405,10 @@ import { initialAppConfigMigration } from "./migrations/001-initial-app-config.m
|
|
|
395
405
|
export class AppModule {}
|
|
396
406
|
```
|
|
397
407
|
|
|
408
|
+
With `useTransaction: true` (the default), execution owns one `crud-config-migrations` transaction and passes its exact `EntityManager` to each migration callback. Pass that manager as `eventManager` to every config operation in the migration. Omitting it from `set()` would attempt to open the separate `crud-config-set` owner, and Automator rejects nested owners.
|
|
409
|
+
|
|
410
|
+
With `useTransaction: false`, there is no migration-wide owner and callbacks receive `undefined`. A standalone `set()` still owns its own atomic `crud-config-set` transaction, so several config writes are not one all-or-nothing unit. Rollback execution always uses the named migration owner.
|
|
411
|
+
|
|
398
412
|
### Creating Migration Files
|
|
399
413
|
|
|
400
414
|
Create a migration file with the required structure:
|
|
@@ -581,29 +595,20 @@ CrudConfigModule.registerAsync({
|
|
|
581
595
|
- ✅ `002_add_feature_flags`
|
|
582
596
|
- ❌ `migration1`, `config_setup`
|
|
583
597
|
|
|
584
|
-
2. **
|
|
598
|
+
2. **Retry safety**: Use `set()` as the upsert for a configuration key
|
|
585
599
|
|
|
586
600
|
```typescript
|
|
587
|
-
|
|
588
|
-
const existing = await configService.get({
|
|
589
|
-
section: 'app-settings',
|
|
590
|
-
name: 'APP_NAME',
|
|
591
|
-
environment: 'default',
|
|
592
|
-
}).catch(() => null);
|
|
593
|
-
|
|
594
|
-
if (!existing) {
|
|
595
|
-
await configService.set({...});
|
|
596
|
-
}
|
|
601
|
+
await configService.set({ eventManager: entityManager, ...properties });
|
|
597
602
|
```
|
|
598
603
|
|
|
599
604
|
3. **Error Handling**: Always handle errors gracefully
|
|
600
605
|
|
|
601
606
|
```typescript
|
|
602
607
|
try {
|
|
603
|
-
|
|
608
|
+
await configService.set({ eventManager: entityManager, ...properties });
|
|
604
609
|
} catch (error) {
|
|
605
|
-
|
|
606
|
-
|
|
610
|
+
console.error("Migration failed:", error);
|
|
611
|
+
throw error; // Re-throw to mark migration as failed
|
|
607
612
|
}
|
|
608
613
|
```
|
|
609
614
|
|
|
@@ -619,6 +624,7 @@ CrudConfigModule.registerAsync({
|
|
|
619
624
|
```typescript
|
|
620
625
|
const currentEnv = process.env.NODE_ENV || "development";
|
|
621
626
|
await configService.set({
|
|
627
|
+
eventManager: entityManager,
|
|
622
628
|
environment: currentEnv,
|
|
623
629
|
// ... other options
|
|
624
630
|
});
|
|
@@ -763,7 +769,7 @@ CrudConfigModule.register({
|
|
|
763
769
|
});
|
|
764
770
|
```
|
|
765
771
|
|
|
766
|
-
|
|
772
|
+
Automator 3 route options use `generation.isEnabled` for route generation. Relation loading uses TypeORM `relationLoadStrategy` values (`"query"` or `"join"`); the built-in ConfigData section relation uses `"query"`.
|
|
767
773
|
|
|
768
774
|
## 🗄️ Database Schema
|
|
769
775
|
|
|
@@ -830,34 +836,11 @@ console.log(config.value); // Automatically decrypted value
|
|
|
830
836
|
console.log(config.isEncrypted); // true
|
|
831
837
|
```
|
|
832
838
|
|
|
833
|
-
###
|
|
834
|
-
|
|
835
|
-
The module includes comprehensive event handling with both listeners and TypeORM subscribers:
|
|
839
|
+
### Transaction and Duplicate Protection
|
|
836
840
|
|
|
837
|
-
|
|
838
|
-
// Event listener example
|
|
839
|
-
@Injectable()
|
|
840
|
-
export class ConfigDataBeforeInsertListener {
|
|
841
|
-
@OnEvent("config-data.beforeInsert")
|
|
842
|
-
async handleBeforeInsert(payload: ConfigDataEventBeforeInsert) {
|
|
843
|
-
// Custom validation logic
|
|
844
|
-
const entity = payload.item;
|
|
845
|
-
const entityManager = payload.eventManager;
|
|
846
|
-
|
|
847
|
-
// Perform custom checks
|
|
848
|
-
return { isSuccess: true };
|
|
849
|
-
}
|
|
850
|
-
}
|
|
841
|
+
`CrudConfigService.set()` owns a named Automator transaction when called without `eventManager`. When a migration supplies its owner manager, all generated ConfigSection and ConfigData service operations join that same transaction.
|
|
851
842
|
|
|
852
|
-
|
|
853
|
-
@EventSubscriber()
|
|
854
|
-
export class ConfigDataBeforeInsertSubscriber {
|
|
855
|
-
beforeInsert(event: InsertEvent<IConfigData>) {
|
|
856
|
-
// Database-level validation
|
|
857
|
-
return Promise.resolve(true);
|
|
858
|
-
}
|
|
859
|
-
}
|
|
860
|
-
```
|
|
843
|
+
The package does not require consumer `EventEmitterModule` wiring. ConfigData uniqueness is enforced by the database across `name`, `environment`, and `section`; Automator maps a conflicting generated create or update to `409 CONFIGDATA_DUPLICATE_KEY`. Put application-specific validation or auditing in the application service/lifecycle layer rather than a package before-insert event.
|
|
861
844
|
|
|
862
845
|
### Headless Mode (Without Controllers)
|
|
863
846
|
|
|
@@ -910,7 +893,7 @@ export class MultiEnvironmentService {
|
|
|
910
893
|
| Full CRUD operations with REST API | ✅ Done |
|
|
911
894
|
| Swagger/OpenAPI documentation | ✅ Done |
|
|
912
895
|
| Multi-environment support | ✅ Done |
|
|
913
|
-
|
|
|
896
|
+
| Named Automator transaction ownership | ✅ Done |
|
|
914
897
|
| Caching system with TTL | ✅ Done |
|
|
915
898
|
| Custom table names and prefixes | ✅ Done |
|
|
916
899
|
| Validation and constraints | ✅ Done |
|
package/dist/cjs/index.js
CHANGED
|
@@ -4,9 +4,6 @@ var config_module = require('./modules/config/config.module.js');
|
|
|
4
4
|
var config_service = require('./modules/config/config.service.js');
|
|
5
5
|
var controller = require('./modules/config/data/controller.js');
|
|
6
6
|
var entity = require('./modules/config/data/entity/entity.js');
|
|
7
|
-
var beforeInsert_event = require('./modules/config/data/event/before-insert.event.js');
|
|
8
|
-
var beforeInsert_listener = require('./modules/config/data/listener/before-insert.listener.js');
|
|
9
|
-
var beforeInsert_subscriber = require('./modules/config/data/subscriber/before-insert.subscriber.js');
|
|
10
7
|
var entity$1 = require('./modules/config/migration/entity/entity.js');
|
|
11
8
|
var status = require('./modules/config/migration/enum/status.js');
|
|
12
9
|
var migrationRunner_service = require('./modules/config/migration/migration-runner.service.js');
|
|
@@ -38,15 +35,6 @@ Object.defineProperty(exports, "CrudConfigService", {
|
|
|
38
35
|
});
|
|
39
36
|
exports.createDynamicDataController = controller.createDynamicDataController;
|
|
40
37
|
exports.createConfigDataEntity = entity.createConfigDataEntity;
|
|
41
|
-
exports.ConfigDataEventBeforeInsert = beforeInsert_event.ConfigDataEventBeforeInsert;
|
|
42
|
-
Object.defineProperty(exports, "ConfigDataBeforeInsertListener", {
|
|
43
|
-
enumerable: true,
|
|
44
|
-
get: function () { return beforeInsert_listener.ConfigDataBeforeInsertListener; }
|
|
45
|
-
});
|
|
46
|
-
Object.defineProperty(exports, "ConfigDataBeforeInsertSubscriber", {
|
|
47
|
-
enumerable: true,
|
|
48
|
-
get: function () { return beforeInsert_subscriber.ConfigDataBeforeInsertSubscriber; }
|
|
49
|
-
});
|
|
50
38
|
exports.createConfigMigrationEntity = entity$1.createConfigMigrationEntity;
|
|
51
39
|
Object.defineProperty(exports, "EConfigMigrationStatus", {
|
|
52
40
|
enumerable: true,
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
var tslib_es6 = require('../../external/tslib/tslib.es6.js');
|
|
4
4
|
var controller$1 = require('./data/controller.js');
|
|
5
5
|
var entity$1 = require('./data/entity/entity.js');
|
|
6
|
-
var beforeInsert_listener = require('./data/listener/before-insert.listener.js');
|
|
7
|
-
var beforeInsert_subscriber = require('./data/subscriber/before-insert.subscriber.js');
|
|
8
6
|
var entity$2 = require('./migration/entity/entity.js');
|
|
9
7
|
require('./migration/enum/status.js');
|
|
10
8
|
var migrationRunner_service = require('./migration/migration-runner.service.js');
|
|
@@ -150,8 +148,6 @@ exports.CrudConfigModule = CrudConfigModule_1 = class CrudConfigModule {
|
|
|
150
148
|
config_service.CrudConfigService,
|
|
151
149
|
migration_service.ConfigMigrationService,
|
|
152
150
|
migrationRunner_service.ConfigMigrationRunnerService,
|
|
153
|
-
beforeInsert_listener.ConfigDataBeforeInsertListener,
|
|
154
|
-
beforeInsert_subscriber.ConfigDataBeforeInsertSubscriber,
|
|
155
151
|
crypto_utility.CryptoUtility,
|
|
156
152
|
],
|
|
157
153
|
};
|
|
@@ -264,8 +260,6 @@ exports.CrudConfigModule = CrudConfigModule_1 = class CrudConfigModule {
|
|
|
264
260
|
config_service.CrudConfigService,
|
|
265
261
|
migration_service.ConfigMigrationService,
|
|
266
262
|
migrationRunner_service.ConfigMigrationRunnerService,
|
|
267
|
-
beforeInsert_listener.ConfigDataBeforeInsertListener,
|
|
268
|
-
beforeInsert_subscriber.ConfigDataBeforeInsertSubscriber,
|
|
269
263
|
crypto_utility.CryptoUtility,
|
|
270
264
|
];
|
|
271
265
|
if (properties.useClass) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.module.js","sources":["../../../../../src/modules/config/config.module.ts"],"sourcesContent":[null],"names":["CrudConfigModule","createConfigSectionEntity","CONFIG_SECTION_CONSTANT","createConfigDataEntity","CONFIG_DATA_CONSTANT","createConfigMigrationEntity","CONFIG_MIGRATION_CONSTANT","TOKEN_CONSTANT","getDataSourceToken","getRepositoryToken","createDynamicService","createDynamicSectionController","createDynamicDataController","CacheModule","CrudConfigService","ConfigMigrationService","ConfigMigrationRunnerService","CryptoUtility","
|
|
1
|
+
{"version":3,"file":"config.module.js","sources":["../../../../../src/modules/config/config.module.ts"],"sourcesContent":[null],"names":["CrudConfigModule","createConfigSectionEntity","CONFIG_SECTION_CONSTANT","createConfigDataEntity","CONFIG_DATA_CONSTANT","createConfigMigrationEntity","CONFIG_MIGRATION_CONSTANT","TOKEN_CONSTANT","getDataSourceToken","getRepositoryToken","createDynamicService","createDynamicSectionController","createDynamicDataController","CacheModule","CrudConfigService","ConfigMigrationService","ConfigMigrationRunnerService","CryptoUtility","__decorate","Global","Module"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAmCaA,wBAAgB,GAAA,kBAAA,GAAtB,MAAM,gBAAgB,CAAA;IACrB,OAAO,QAAQ,CAAC,OAAuB,EAAA;QAC7C,MAAM,MAAM,GAAW,OAAO,CAAC,aAAa,EAAE,WAAW,IAAI,EAAE;QAE/D,MAAM,aAAa,GAAmCC,gCAAyB,CAAC;AAC/E,YAAA,oBAAoB,EACnB,OAAO,CAAC,aAAa,EAAE,aAAa,EAAE,oBAAoB;AAC1D,gBAAAC,wCAAuB,CAAC,sBAAsB;YAC/C,aAAa,EACZ,OAAO,CAAC,aAAa,EAAE,aAAa,EAAE,aAAa,IAAIA,wCAAuB,CAAC,eAAe;AAC/F,YAAA,SAAS,EACR,MAAM;iBACL,OAAO,CAAC,aAAa,EAAE,aAAa,EAAE,SAAS,IAAIA,wCAAuB,CAAC,kBAAkB,CAAC;AAChG,SAAA,CAAC;QAEF,MAAM,UAAU,GAAgCC,+BAAsB,CAAC;AACtE,YAAA,mBAAmB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AE,OAAO,cAAwC,KAA6B;AACvF,gBAAA,OAAO,cAAc,CAAC,aAAa,EAAE;YACtC,CAAC;SACD;IACF;;AAxXYP,wBAAgB,GAAA,kBAAA,GAAAkB,oBAAA,CAAA;AAF5B,IAAAC,aAAM,EAAE;IACRC,aAAM,CAAC,EAAE;AACG,CAAA,EAAApB,wBAAgB,CAyX5B;;"}
|
|
@@ -44,10 +44,13 @@ export declare class CrudConfigService {
|
|
|
44
44
|
* Sets a configuration value with optional encryption.
|
|
45
45
|
* The specified section must already exist.
|
|
46
46
|
* If a configuration with the same name and environment already exists, it will be updated. Otherwise, a new one will be created.
|
|
47
|
+
* Owns the named crud-config-set Automator transaction when eventManager is omitted.
|
|
48
|
+
* A provided eventManager must already belong to an active Automator owner.
|
|
47
49
|
* @param {IConfigSetOptions} options Configuration set options
|
|
48
50
|
* @returns {Promise<IConfigData>} Promise resolving to the saved configuration data
|
|
49
51
|
*/
|
|
50
52
|
set(options: IConfigSetOptions): Promise<IConfigData>;
|
|
51
53
|
private getOrCreateSection;
|
|
52
54
|
private runWithEventManager;
|
|
55
|
+
private setWithEntityManager;
|
|
53
56
|
}
|
|
@@ -181,6 +181,8 @@ exports.CrudConfigService = class CrudConfigService {
|
|
|
181
181
|
* Sets a configuration value with optional encryption.
|
|
182
182
|
* The specified section must already exist.
|
|
183
183
|
* If a configuration with the same name and environment already exists, it will be updated. Otherwise, a new one will be created.
|
|
184
|
+
* Owns the named crud-config-set Automator transaction when eventManager is omitted.
|
|
185
|
+
* A provided eventManager must already belong to an active Automator owner.
|
|
184
186
|
* @param {IConfigSetOptions} options Configuration set options
|
|
185
187
|
* @returns {Promise<IConfigData>} Promise resolving to the saved configuration data
|
|
186
188
|
*/
|
|
@@ -191,7 +193,7 @@ exports.CrudConfigService = class CrudConfigService {
|
|
|
191
193
|
value: "***",
|
|
192
194
|
};
|
|
193
195
|
this.LOGGER.verbose(`Entering set method with options: ${JSON.stringify(maskedOptions)}`);
|
|
194
|
-
const {
|
|
196
|
+
const { environment, eventManager, name, section: sectionName, value, } = options;
|
|
195
197
|
const finalEnvironment = environment ?? this.options?.environment ?? "default";
|
|
196
198
|
const shouldApplyEncryption = this.options?.encryptionOptions?.isEnabled ?? false;
|
|
197
199
|
let finalValue = value;
|
|
@@ -213,68 +215,26 @@ exports.CrudConfigService = class CrudConfigService {
|
|
|
213
215
|
throw new common.InternalServerErrorException(nestjsCrudAutomator.ErrorString({ entity: { name: "ConfigData" }, type: nestjsCrudAutomator.EErrorStringAction.ENCRYPTION_ERROR }));
|
|
214
216
|
}
|
|
215
217
|
}
|
|
216
|
-
let queryRunner;
|
|
217
|
-
let useTransaction = false;
|
|
218
|
-
let localEventManager = eventManager;
|
|
219
218
|
try {
|
|
220
|
-
useTransaction = !eventManager;
|
|
221
|
-
if (useTransaction) {
|
|
222
|
-
if (!this.dataSource) {
|
|
223
|
-
throw new common.InternalServerErrorException("DataSource not available for transaction");
|
|
224
|
-
}
|
|
225
|
-
queryRunner = this.dataSource.createQueryRunner();
|
|
226
|
-
await queryRunner.connect();
|
|
227
|
-
await queryRunner.startTransaction();
|
|
228
|
-
localEventManager = queryRunner.manager;
|
|
229
|
-
}
|
|
230
|
-
this.LOGGER.verbose(`Fetching or creating section: ${sectionName}`);
|
|
231
|
-
const section = await this.getOrCreateSection(sectionName, localEventManager);
|
|
232
|
-
this.LOGGER.verbose(`Preparing config data for ${name}`);
|
|
233
|
-
const configData = {
|
|
234
|
-
description: description ?? undefined,
|
|
235
|
-
environment: finalEnvironment,
|
|
236
|
-
isEncrypted,
|
|
237
|
-
name,
|
|
238
|
-
section: { id: section.id },
|
|
239
|
-
value: finalValue,
|
|
240
|
-
};
|
|
241
219
|
let result;
|
|
242
|
-
|
|
243
|
-
this.
|
|
244
|
-
const existingData = await this.runWithEventManager(localEventManager, () => this.dataService.get({
|
|
245
|
-
where: { environment: finalEnvironment, name, section: { id: section.id } },
|
|
246
|
-
}));
|
|
247
|
-
this.LOGGER.verbose(`Updating existing config: ${name}`);
|
|
248
|
-
result = await this.runWithEventManager(localEventManager, () => this.dataService.update({ id: existingData.id }, configData));
|
|
220
|
+
if (eventManager) {
|
|
221
|
+
result = await this.setWithEntityManager(options, finalValue, isEncrypted, eventManager);
|
|
249
222
|
}
|
|
250
|
-
|
|
251
|
-
if (
|
|
252
|
-
|
|
253
|
-
result = await this.runWithEventManager(localEventManager, () => this.dataService.create(configData));
|
|
254
|
-
}
|
|
255
|
-
else {
|
|
256
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
257
|
-
this.LOGGER.error(`Error updating config: ${errorMessage}`);
|
|
258
|
-
throw error;
|
|
223
|
+
else {
|
|
224
|
+
if (!this.dataSource) {
|
|
225
|
+
throw new common.InternalServerErrorException("DataSource not available for transaction");
|
|
259
226
|
}
|
|
227
|
+
result = await nestjsCrudAutomator.ApiFunctionTransactionScope.runWithDataSource(this.dataSource, { name: "crud-config-set" }, async (transactionalEntityManager) => await this.setWithEntityManager(options, finalValue, isEncrypted, transactionalEntityManager));
|
|
260
228
|
}
|
|
261
229
|
if (this.options?.cacheOptions?.isEnabled && this.cacheManager) {
|
|
262
230
|
const cacheKey = `config:${sectionName}:${name}:${finalEnvironment}`;
|
|
263
231
|
const listCacheKey = `config:list:${sectionName}:${finalEnvironment}`;
|
|
264
232
|
await Promise.all([this.cacheManager.del(cacheKey), this.cacheManager.del(listCacheKey)]);
|
|
265
233
|
}
|
|
266
|
-
if (useTransaction && queryRunner) {
|
|
267
|
-
await queryRunner.commitTransaction();
|
|
268
|
-
await queryRunner.release();
|
|
269
|
-
}
|
|
270
234
|
this.LOGGER.verbose(`Set method completed successfully for ${name}`);
|
|
271
235
|
return result;
|
|
272
236
|
}
|
|
273
237
|
catch (error) {
|
|
274
|
-
if (useTransaction && queryRunner) {
|
|
275
|
-
await queryRunner.rollbackTransaction();
|
|
276
|
-
await queryRunner.release();
|
|
277
|
-
}
|
|
278
238
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
279
239
|
this.LOGGER.error(`Error in set method: ${errorMessage}`);
|
|
280
240
|
if (error instanceof common.HttpException) {
|
|
@@ -305,6 +265,38 @@ exports.CrudConfigService = class CrudConfigService {
|
|
|
305
265
|
}
|
|
306
266
|
return await nestjsCrudAutomator.ApiFunctionTransactionScope.runWithEntityManager(eventManager, callback);
|
|
307
267
|
}
|
|
268
|
+
async setWithEntityManager(options, value, isEncrypted, entityManager) {
|
|
269
|
+
const { description, environment, name, section: sectionName } = options;
|
|
270
|
+
const finalEnvironment = environment ?? this.options?.environment ?? "default";
|
|
271
|
+
this.LOGGER.verbose(`Fetching or creating section: ${sectionName}`);
|
|
272
|
+
const section = await this.getOrCreateSection(sectionName, entityManager);
|
|
273
|
+
this.LOGGER.verbose(`Preparing config data for ${name}`);
|
|
274
|
+
const configData = {
|
|
275
|
+
description: description ?? undefined,
|
|
276
|
+
environment: finalEnvironment,
|
|
277
|
+
isEncrypted,
|
|
278
|
+
name,
|
|
279
|
+
section: { id: section.id },
|
|
280
|
+
value,
|
|
281
|
+
};
|
|
282
|
+
try {
|
|
283
|
+
this.LOGGER.verbose(`Checking for existing config: ${name}`);
|
|
284
|
+
const existingData = await this.runWithEventManager(entityManager, () => this.dataService.get({
|
|
285
|
+
where: { environment: finalEnvironment, name, section: { id: section.id } },
|
|
286
|
+
}));
|
|
287
|
+
this.LOGGER.verbose(`Updating existing config: ${name}`);
|
|
288
|
+
return await this.runWithEventManager(entityManager, () => this.dataService.update({ id: existingData.id }, configData));
|
|
289
|
+
}
|
|
290
|
+
catch (error) {
|
|
291
|
+
if (error instanceof common.NotFoundException) {
|
|
292
|
+
this.LOGGER.verbose(`Config ${name} not found, creating new one`);
|
|
293
|
+
return await this.runWithEventManager(entityManager, () => this.dataService.create(configData));
|
|
294
|
+
}
|
|
295
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
296
|
+
this.LOGGER.error(`Error updating config: ${errorMessage}`);
|
|
297
|
+
throw error;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
308
300
|
};
|
|
309
301
|
exports.CrudConfigService = tslib_es6.__decorate([
|
|
310
302
|
common.Injectable(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.service.js","sources":["../../../../../src/modules/config/config.service.ts"],"sourcesContent":[null],"names":["CrudConfigService","LoggerUtility","HttpException","InternalServerErrorException","ErrorString","EErrorStringAction","NotFoundException","ApiFunctionTransactionScope","__decorate","Injectable","__param","Inject","TOKEN_CONSTANT","CACHE_MANAGER","Optional","DataSource","ApiServiceBase","CryptoUtility"],"mappings":";;;;;;;;;;;;AAiCA;;;;;AAKG;AAEUA,yBAAiB,GAAvB,MAAM,iBAAiB,CAAA;AAKX,IAAA,cAAA;AAEA,IAAA,WAAA;AACmC,IAAA,YAAA;AACgB,IAAA,OAAA;AACnB,IAAA,UAAA;AAChC,IAAA,aAAA;AAVD,IAAA,MAAM,GAAkBC,4BAAa,CAAC,SAAS,CAAC,mBAAmB,CAAC;IAErF,WAAA,CAEkB,cAA8C,EAE9C,WAAwC,EACL,YAAmB,EACH,OAAwB,EAC3C,UAAuB,EACvD,aAA6B,EAAA;QAN7B,IAAA,CAAA,cAAc,GAAd,cAAc;QAEd,IAAA,CAAA,WAAW,GAAX,WAAW;QACwB,IAAA,CAAA,YAAY,GAAZ,YAAY;QACI,IAAA,CAAA,OAAO,GAAP,OAAO;QAC1B,IAAA,CAAA,UAAU,GAAV,UAAU;QAC1C,IAAA,CAAA,aAAa,GAAb,aAAa;IAC5B;AAEH;;;;AAIG;IACH,MAAM,MAAM,CAAC,OAA6B,EAAA;AACzC,QAAA,MAAM,aAAa,GAAY;AAC9B,YAAA,GAAG,OAAO;YACV,YAAY,EAAE,OAAO,CAAC,YAAY,GAAG,iBAAiB,GAAG,SAAS;SAClE;AACD,QAAA,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA,qCAAA,EAAwC,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA,CAAE,CAAC;AAE5F,QAAA,MAA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oBAAA,CAAA;AAD7B,IAAAC,iBAAU,EAAE;AAKV,IAAAC,iBAAA,CAAA,CAAA,EAAAC,aAAM,CAACC,6BAAc,CAAC,sBAAsB,CAAC,CAAA;AAE7C,IAAAF,iBAAA,CAAA,CAAA,EAAAC,aAAM,CAACC,6BAAc,CAAC,mBAAmB,CAAC,CAAA;AAE1C,IAAAF,iBAAA,CAAA,CAAA,EAAAC,aAAM,CAACE,0BAAa,CAAC,CAAA;IAAEH,iBAAA,CAAA,CAAA,EAAAI,eAAQ,EAAE,CAAA;AACjC,IAAAJ,iBAAA,CAAA,CAAA,EAAAC,aAAM,CAACC,6BAAc,CAAC,cAAc,CAAC,CAAA;IAAEF,iBAAA,CAAA,CAAA,EAAAI,eAAQ,EAAE,CAAA;AACjD,IAAAJ,iBAAA,CAAA,CAAA,EAAAC,aAAM,CAACI,kBAAU,CAAC,CAAA;IAAEL,iBAAA,CAAA,CAAA,EAAAI,eAAQ,EAAE,CAAA;+CALEE,kCAAc;AAEjB,QAAAA,kCAAc,kBAGkBD,kBAAU;QACvCE,4BAAa,CAAA;AAXnC,CAAA,EAAAjB,yBAAiB,CAqa7B;;"}
|
|
1
|
+
{"version":3,"file":"config.service.js","sources":["../../../../../src/modules/config/config.service.ts"],"sourcesContent":[null],"names":["CrudConfigService","LoggerUtility","HttpException","InternalServerErrorException","ErrorString","EErrorStringAction","ApiFunctionTransactionScope","NotFoundException","__decorate","Injectable","__param","Inject","TOKEN_CONSTANT","CACHE_MANAGER","Optional","DataSource","ApiServiceBase","CryptoUtility"],"mappings":";;;;;;;;;;;;AAiCA;;;;;AAKG;AAEUA,yBAAiB,GAAvB,MAAM,iBAAiB,CAAA;AAKX,IAAA,cAAA;AAEA,IAAA,WAAA;AACmC,IAAA,YAAA;AACgB,IAAA,OAAA;AACnB,IAAA,UAAA;AAChC,IAAA,aAAA;AAVD,IAAA,MAAM,GAAkBC,4BAAa,CAAC,SAAS,CAAC,mBAAmB,CAAC;IAErF,WAAA,CAEkB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CAAA;AAXnC,CAAA,EAAAjB,yBAAiB,CAqa7B;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EntityManager } from '
|
|
1
|
+
import { EntityManager } from 'typeorm';
|
|
2
2
|
/**
|
|
3
3
|
* Context options for configuration retrieval
|
|
4
4
|
* @see {@link https://elsikora.com/docs/nestjs-crud-config/api-reference/interfaces/crud-config-delete-options | API Reference - IConfigDeleteOptions}
|
|
@@ -9,7 +9,8 @@ export interface IConfigDeleteOptions {
|
|
|
9
9
|
*/
|
|
10
10
|
environment?: string;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* When provided, the exact entity manager already bound to an active Automator owner.
|
|
13
|
+
* Omit it for a standalone operation.
|
|
13
14
|
*/
|
|
14
15
|
eventManager?: EntityManager;
|
|
15
16
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EntityManager } from '
|
|
1
|
+
import { EntityManager } from 'typeorm';
|
|
2
2
|
/**
|
|
3
3
|
* Context options for configuration retrieval
|
|
4
4
|
* @see {@link https://elsikora.com/docs/nestjs-crud-config/api-reference/interfaces/crud-config-get-list-options | API Reference - IConfigGetListOptions}
|
|
@@ -9,7 +9,8 @@ export interface IConfigGetListOptions {
|
|
|
9
9
|
*/
|
|
10
10
|
environment?: string;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* When provided, the exact entity manager already bound to an active Automator owner.
|
|
13
|
+
* Omit it for a standalone operation.
|
|
13
14
|
*/
|
|
14
15
|
eventManager?: EntityManager;
|
|
15
16
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EntityManager } from '
|
|
1
|
+
import { EntityManager } from 'typeorm';
|
|
2
2
|
/**
|
|
3
3
|
* Context options for configuration retrieval
|
|
4
4
|
* @see {@link https://elsikora.com/docs/nestjs-crud-config/api-reference/interfaces/crud-config-get-options | API Reference - IConfigGetOptions}
|
|
@@ -9,7 +9,8 @@ export interface IConfigGetOptions {
|
|
|
9
9
|
*/
|
|
10
10
|
environment?: string;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* When provided, the exact entity manager already bound to an active Automator owner.
|
|
13
|
+
* Omit it for a standalone operation.
|
|
13
14
|
*/
|
|
14
15
|
eventManager?: EntityManager;
|
|
15
16
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EntityManager } from '
|
|
1
|
+
import { EntityManager } from 'typeorm';
|
|
2
2
|
/**
|
|
3
3
|
* Context options for configuration setting
|
|
4
4
|
* @see {@link https://elsikora.com/docs/nestjs-crud-config/api-reference/interfaces/crud-config-set-options | API Reference - IConfigSetOptions}
|
|
@@ -13,7 +13,8 @@ export interface IConfigSetOptions {
|
|
|
13
13
|
*/
|
|
14
14
|
environment?: string;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Exact entity manager already bound to an active Automator owner.
|
|
17
|
+
* Omit it for a standalone set, which owns the named crud-config-set transaction.
|
|
17
18
|
*/
|
|
18
19
|
eventManager?: EntityManager;
|
|
19
20
|
/**
|